Skip to content

Commit

Permalink
Getting ready for release of version 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cffk committed Dec 31, 2022
1 parent 308d40f commit ae48ec0
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ project (GeographicLib-C C)

# Version information
set (PROJECT_VERSION_MAJOR 2)
set (PROJECT_VERSION_MINOR 0)
set (PROJECT_VERSION_PATCH 1)
set (PROJECT_VERSION_MINOR 1)
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 (PROJECT_VERSION_SUFFIX "-devel")
set (PROJECT_VERSION_SUFFIX "-alpha")
set (PROJECT_FULLVERSION ${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX})

set (PACKAGE_DIR "${PROJECT_NAME}-${PROJECT_VERSION}")
Expand Down
6 changes: 5 additions & 1 deletion HOWTO-RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ also changes needed in
docs/source/apps/geod.rst
docs/source/geodesic.rst
src/apps/geod_interface.cpp
src/apps/bin_geod.cmake
src/init.cpp
src/tests/bin_geodtest.cmake
src/tests/CMakeLists.txt

After release, issue a PR for PROJ

R package geosphere:
Robert J. Hijmans <[email protected]>

Notify @xylar about need for updated patch for
https://github.com/conda-forge/proj.4-feedstock
8 changes: 4 additions & 4 deletions doc/geodesic-c.dox.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
\mainpage Geodesic routines implemented in C
\author Charles F. F. Karney ([email protected])
\version @PROJECT_VERSION@
\date 2022-04-21
\date 2023-mm-dd

\section abstract-c Abstract

Expand Down Expand Up @@ -309,11 +309,11 @@ You can check the version of the geodesic library with, e.g.,

\page changes Change log

- <a href="../2.0.1/index.html">Version 2.0.1</a>
(released 20yy-mm-dd)
- <a href="../2.1/index.html">Version 2.1</a>
(released 2023-mm-dd)
- Minor improvement in the logic for the geodesic inverse problem.
- Relax overly strict convergence test for inverse problem.
- Allow for buggy remquo in geodsigntest.c.
- TODO: Relax overly strict convergence test for inverse problem in.

- <a href="../2.0/index.html">Version 2.0</a>
(released 2022-04-21)
Expand Down
2 changes: 1 addition & 1 deletion proj-example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project (proj-example C)
cmake_minimum_required (VERSION 3.13.0)
project (proj-example C)

find_package (PROJ REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion proj-example/proj-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main (void) {
proj_context_destroy(C);
}
/* Initialize geodesic */
geod_init(&g, a, 1/invf);
geod_init(&g, a, invf != 0 ? 1/invf : 0);
/* Don't need GEOD_DISTANCE_IN if using GEOD_ARCMODE */
geod_inverseline(&l, &g, 33.94, -118.41, -43.49, 172.53,
GEOD_LATITUDE | GEOD_LONGITUDE | GEOD_AZIMUTH);
Expand Down
36 changes: 20 additions & 16 deletions src/geodesic.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void Init(void) {
tol1 = 200 * tol0;
tol2 = sqrt(tol0);
/* Check on bisection interval */
tolb = tol0 * tol2;
tolb = tol0;
xthresh = 1000 * tol2;
degree = pi/hd;
NaN = nan("0");
Expand Down Expand Up @@ -111,7 +111,7 @@ static double sumx(double u, double v, double* t) {
return s;
}

static double polyval(int N, const double p[], double x) {
static double polyvalx(int N, const double p[], double x) {
double y = N < 0 ? 0 : *p++;
while (--N >= 0) y = y * x + *p++;
return y;
Expand Down Expand Up @@ -879,16 +879,20 @@ static double geod_geninverse_int(const struct geod_geodesic* g,
double salp1a = tiny, calp1a = 1, salp1b = tiny, calp1b = -1;
boolx tripn = FALSE;
boolx tripb = FALSE;
for (; numit < maxit2; ++numit) {
for (;; ++numit) {
/* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16
* WGS84 and random input: mean = 2.85, sd = 0.60 */
double dv = 0,
v = Lambda12(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2, salp1, calp1,
slam12, clam12,
&salp2, &calp2, &sig12, &ssig1, &csig1, &ssig2, &csig2,
&eps, &domg12, numit < maxit1, &dv, Ca);
/* Reversed test to allow escape with NaNs */
if (tripb || !(fabs(v) >= (tripn ? 8 : 1) * tol0)) break;
if (tripb ||
/* Reversed test to allow escape with NaNs */
!(fabs(v) >= (tripn ? 8 : 1) * tol0) ||
/* Enough bisections to get accurate result */
numit == maxit2)
break;
/* Update bracketing values */
if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b))
{ salp1b = salp1; calp1b = calp1; }
Expand Down Expand Up @@ -1482,7 +1486,7 @@ double Lambda12(const struct geod_geodesic* g,

double A3f(const struct geod_geodesic* g, double eps) {
/* Evaluate A3 */
return polyval(nA3 - 1, g->A3x, eps);
return polyvalx(nA3 - 1, g->A3x, eps);
}

void C3f(const struct geod_geodesic* g, double eps, double c[]) {
Expand All @@ -1493,7 +1497,7 @@ void C3f(const struct geod_geodesic* g, double eps, double c[]) {
for (l = 1; l < nC3; ++l) { /* l is index of C3[l] */
int m = nC3 - l - 1; /* order of polynomial in eps */
mult *= eps;
c[l] = mult * polyval(m, g->C3x + o, eps);
c[l] = mult * polyvalx(m, g->C3x + o, eps);
o += m + 1;
}
}
Expand All @@ -1505,7 +1509,7 @@ void C4f(const struct geod_geodesic* g, double eps, double c[]) {
int o = 0, l;
for (l = 0; l < nC4; ++l) { /* l is index of C4[l] */
int m = nC4 - l - 1; /* order of polynomial in eps */
c[l] = mult * polyval(m, g->C4x + o, eps);
c[l] = mult * polyvalx(m, g->C4x + o, eps);
o += m + 1;
mult *= eps;
}
Expand All @@ -1518,7 +1522,7 @@ double A1m1f(double eps) {
1, 4, 64, 0, 256,
};
int m = nA1/2;
double t = polyval(m, coeff, sq(eps)) / coeff[m + 1];
double t = polyvalx(m, coeff, sq(eps)) / coeff[m + 1];
return (t + eps) / (1 - eps);
}

Expand All @@ -1544,7 +1548,7 @@ void C1f(double eps, double c[]) {
int o = 0, l;
for (l = 1; l <= nC1; ++l) { /* l is index of C1p[l] */
int m = (nC1 - l) / 2; /* order of polynomial in eps^2 */
c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1];
c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1];
o += m + 2;
d *= eps;
}
Expand Down Expand Up @@ -1572,7 +1576,7 @@ void C1pf(double eps, double c[]) {
int o = 0, l;
for (l = 1; l <= nC1p; ++l) { /* l is index of C1p[l] */
int m = (nC1p - l) / 2; /* order of polynomial in eps^2 */
c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1];
c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1];
o += m + 2;
d *= eps;
}
Expand All @@ -1585,7 +1589,7 @@ double A2m1f(double eps) {
-11, -28, -192, 0, 256,
};
int m = nA2/2;
double t = polyval(m, coeff, sq(eps)) / coeff[m + 1];
double t = polyvalx(m, coeff, sq(eps)) / coeff[m + 1];
return (t - eps) / (1 + eps);
}

Expand All @@ -1611,7 +1615,7 @@ void C2f(double eps, double c[]) {
int o = 0, l;
for (l = 1; l <= nC2; ++l) { /* l is index of C2[l] */
int m = (nC2 - l) / 2; /* order of polynomial in eps^2 */
c[l] = d * polyval(m, coeff + o, eps2) / coeff[o + m + 1];
c[l] = d * polyvalx(m, coeff + o, eps2) / coeff[o + m + 1];
o += m + 2;
d *= eps;
}
Expand All @@ -1636,7 +1640,7 @@ void A3coeff(struct geod_geodesic* g) {
int o = 0, k = 0, j;
for (j = nA3 - 1; j >= 0; --j) { /* coeff of eps^j */
int m = nA3 - j - 1 < j ? nA3 - j - 1 : j; /* order of polynomial in n */
g->A3x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1];
g->A3x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1];
o += m + 2;
}
}
Expand Down Expand Up @@ -1679,7 +1683,7 @@ void C3coeff(struct geod_geodesic* g) {
for (l = 1; l < nC3; ++l) { /* l is index of C3[l] */
for (j = nC3 - 1; j >= l; --j) { /* coeff of eps^j */
int m = nC3 - j - 1 < j ? nC3 - j - 1 : j; /* order of polynomial in n */
g->C3x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1];
g->C3x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1];
o += m + 2;
}
}
Expand Down Expand Up @@ -1735,7 +1739,7 @@ void C4coeff(struct geod_geodesic* g) {
for (l = 0; l < nC4; ++l) { /* l is index of C4[l] */
for (j = nC4 - 1; j >= l; --j) { /* coeff of eps^j */
int m = nC4 - j - 1; /* order of polynomial in n */
g->C4x[k++] = polyval(m, coeff + o, g->n) / coeff[o + m + 1];
g->C4x[k++] = polyvalx(m, coeff + o, g->n) / coeff[o + m + 1];
o += m + 2;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/geodesic.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* The minor version of the geodesic library. (This tracks the version of
* GeographicLib.)
**********************************************************************/
#define GEODESIC_VERSION_MINOR 0
#define GEODESIC_VERSION_MINOR 1
/**
* The patch level of the geodesic library. (This tracks the version of
* GeographicLib.)
Expand Down

0 comments on commit ae48ec0

Please sign in to comment.