Commit 2a0dc243 authored by Jerome Benoit's avatar Jerome Benoit

Imported Debian patch 1.0+ds-1

parent 1ac9d9b7
apophenia (1.0+ds-1) unstable; urgency=medium
* New upstream release, all upstream patches were integrated.
* Debianization:
- debian/control:
- Build-Depends field, refresh (gsl2 migration);
- Vcs-Browser field, correct;
- debian/patches/*, refresh.
-- Jerome Benoit <calculus@rezozer.net> Wed, 02 Dec 2015 04:46:01 +0000
apophenia (0.999e+ds-4) unstable; urgency=medium
* RC bug fix release:
......
......@@ -7,7 +7,7 @@ Build-Depends:
debhelper (>= 9),
autotools-dev, autoconf-archive, gnulib, dh-autoreconf, libtool,
pkg-config, help2man,
zlib1g-dev, libmysqlclient-dev, libsqlite3-dev, libgsl0-dev,
zlib1g-dev, libmysqlclient-dev, libsqlite3-dev, libgsl-dev,
bc, sqlite3
Build-Depends-Indep:
graphviz,
......@@ -16,7 +16,7 @@ Build-Depends-Indep:
Standards-Version: 3.9.6
Homepage: http://apophenia.info/
Vcs-Git: git://anonscm.debian.org/debian-science/packages/apophenia.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/apophenia.git
Vcs-Browser: http://anonscm.debian.org/cgit/debian-science/packages/apophenia.git
Package: libapophenia2
Provides: libapophenia
......
......@@ -9,7 +9,7 @@ Last-Update: 2015-07-08
--- a/docs/documentation.h
+++ b/docs/documentation.h
@@ -2618,8 +2618,8 @@
@@ -2637,8 +2637,8 @@
relate. It is taken from this
<a href="http://modelingwithdata.org/pdfs/cheatsheet.pdf">cheat sheet</a> on general C and SQL use (2 page PDF).
......
......@@ -8,7 +8,7 @@ Last-Update: 2015-07-10
+++ b/configure.ac
@@ -87,6 +87,9 @@
## Debian package version
DEB_PKG_VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p')
DEB_PKG_VERSION=$(dpkg-parsechangelog -S Version)
AC_SUBST(DEB_PKG_VERSION)
+## work around for bugs #597187 and #757967
+MYSQL_CFLAGS=$(echo "${MYSQL_CFLAGS}" | sed -e 's/-DNDEBUG//g;s/-g//g;s/-fabi-version=2//g;s/-fno-omit-frame-pointer//g;s/-fno-strict-aliasing//g;s/[ ]*$//g' | tr -s ' ')
......
......@@ -3,7 +3,7 @@ Description: debianization
to address Debian specific stuff in general.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-07-09
Last-Update: 2015-12-01
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
......@@ -60,7 +60,7 @@ Last-Update: 2015-07-09
@@ -4,13 +4,13 @@
AC_PREREQ(2.60)
AC_INIT([apophenia], [0.999e], [fluffmail@f-m.fm])
AC_INIT([apophenia], [1.0], [fluffmail@f-m.fm])
-AM_SILENT_RULES([yes])
+AM_SILENT_RULES([no])
AC_CONFIG_SRCDIR([apop_arms.c])
......@@ -79,7 +79,7 @@ Last-Update: 2015-07-09
+# Debian stuff
+## Debian package version
+DEB_PKG_VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p')
+DEB_PKG_VERSION=$(dpkg-parsechangelog -S Version)
+AC_SUBST(DEB_PKG_VERSION)
+
AC_CONFIG_FILES([
......
upstream-typo-eg_t_test_by_rows.patch
upstream-bug-793998-eg_t_test_by_rows.patch
upstream-bug-793998-eg_test_updating.patch
upstream-bug-793998-tests_distribution_tests.patch
upstream-fix-typo.patch
upstream-enhancement-eg_test_updating.patch
debianization.patch
debianization-help2man.patch
debianization-documentation.patch
......
Description: upstream -- RC bug fix 793998 -- eg/t_test_by_rows.c
Fix a careless mistake that had introduced a type mismatch: size_t vs int.
The patch was designed with 'gcc (Debian 5.2.1-22) 5.2.1 20151010' on
a s390x Debian porter (sid).
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-10-16
--- a/eg/t_test_by_rows.c
+++ b/eg/t_test_by_rows.c
@@ -4,7 +4,7 @@
void offset_rng(double *v){*v = gsl_rng_uniform(apop_rng_get_thread()) + row_offset;}
double find_tstat(gsl_vector *in){ return apop_mean(in)/sqrt(apop_var(in));}
-double conf(double in, void *df){ return gsl_cdf_tdist_P(in, *(int *)df);}
+double conf(double in, void *df){ return gsl_cdf_tdist_P(in, *(size_t *)df);}
//apop_vector_mean is a macro, so we can't point a pointer to it.
double mu(gsl_vector *in){ return apop_vector_mean(in);}
Description: upstream -- RC bug fix 793998 -- eg/test_updating
Fix a type conversion bug that failed the eg/test_updating test on some
architectures (e.g., arm64 and ppc64el). The initial fix has been harden
as it raised new issues on the 32bit i386 architecture.
The patch was designed with 'gcc (Debian 5.2.1-15) 5.2.1 20150808' on
i386, arm64, and ppc64el Debian porters (sid).
The raised issue is likely due to some unexpected (broken ?) optimization
at compile time: the use of the function modf appeared to break the
faulty optimization.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-08-30
--- a/apop_mcmc.c
+++ b/apop_mcmc.c
@@ -196,13 +196,14 @@
}
-void main_mcmc_loop(apop_data *d, apop_model *m, apop_data *out, gsl_vector *draw,
+void main_mcmc_loop(apop_data *d, apop_model *m, apop_data *out, gsl_vector *draw,
apop_mcmc_settings *s, gsl_rng *rng, int *constraint_fails){
+ double integerpart_periods_burnin = GSL_NAN; modf((double)(s->periods)*s->burnin,&integerpart_periods_burnin);
s->accept_count = 0;
+ int out_row = -lround(integerpart_periods_burnin);
int block = 0;
- for (s->proposal_count=1; s->proposal_count< s->periods+1; s->proposal_count++){
- one_step(d, draw, m, s, rng, constraint_fails, out, block
- , s->proposal_count-1 - s->periods*s->burnin);
+ for (s->proposal_count=1; s->proposal_count< s->periods+1; s->proposal_count++, out_row++){
+ one_step(d, draw, m, s, rng, constraint_fails, out, block, out_row);
block = (block+1) % s->block_count;
s->proposals[block].adapt_fn(s->proposals+block, s);
//if (constraint_fails>10000) break;
@@ -300,11 +301,14 @@
apop_prep(d, m); //typically a no-op
s->last_ll = GSL_NEGINF;
gsl_vector * drawv = apop_data_pack(m->parameters);
- Apop_stopif(s->burnin > 1, s->burnin/=(s->periods + 0.0),
+ const double double_periods = (double)(s->periods);
+ Apop_stopif(s->burnin > 1, s->burnin/=double_periods,
1, "Burn-in should be a fraction of the number of periods, "
"not a whole number of periods. Rescaling to burnin=%g."
- , s->burnin/(s->periods+0.0));
- apop_data *out = apop_data_alloc(s->periods*(1-s->burnin), drawv->size);
+ , s->burnin/double_periods);
+ double integerpart_periods_cburnin = GSL_NAN; modf(double_periods*(1.0-s->burnin),&integerpart_periods_cburnin);
+ const size_t data_size1 = llround(integerpart_periods_cburnin);
+ apop_data *out = apop_data_alloc(data_size1, drawv->size);
if (!s->proposals){
set_block_count_and_block_starts(m->parameters, s, drawv->size);
Description: upstream -- RC bug fix 793998 -- tests/distribution_tests
Fix a machine precision issue by relying on a more numerical approach,
given that the employed numerical library is GSL.
It appears that on i386 architecture (at least) the last digits are chopped:
1-(*out) = 0x1p-63 verifies the test !(*out >= 1) inside the beta_rng function,
but inside the calling function (1-(*out)) is 0x0p+0 , that is *out is 1 .
(Note that GSL_DBL_EPSILON has the value 0x1p-52 .) The patch was designed with
'gcc (Debian 5.2.1-15) 5.2.1 20150808' on a i386 Debian porter (sid).
A more architecture oriented approach might exist, but anyway the numerical
approach is satisfactory given that advanced numerical computations are done
via GSL which relies on GSL_DBL_EPSILON.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-08-30
--- a/model/apop_beta.c
+++ b/model/apop_beta.c
@@ -88,11 +88,13 @@
}
static int beta_rng(double *out, gsl_rng *r, apop_model* eps){
+ double ans = GSL_NAN;
Nullcheck_mp(eps, 1)
Get_ab(eps)
do {
- *out = gsl_ran_beta(r, ab.alpha, ab.beta);
- } while (*out <= 0 || *out >= 1);
+ ans = gsl_ran_beta(r, ab.alpha, ab.beta);
+ } while (!((0.0 < ans) && (GSL_DBL_EPSILON <= 1.0 - ans)));
+ *out = ans;
return 0;
}
Description: upstream -- enhancement -- test_updating
Render Apop_stopif message emitted by eg/test_updating.c more precise.
Origin: debian
Forwarded: https://github.com/b-k/apophenia/pull/28
Author:
Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-12-02
--- a/eg/test_updating.c
+++ b/eg/test_updating.c
@@ -4,7 +4,7 @@
void distances(gsl_vector *v1, gsl_vector *v2, double tol){
double error = apop_vector_distance(v1, v2, .metric='m');
double updated_size = apop_vector_sum(v1);
- Apop_stopif(error/updated_size > tol, exit(1), 0, "The error is %g, which is too big.", error/updated_size);
+ Apop_stopif(error/updated_size > tol, exit(1), 0, "The error is %g, which is too big (> %g).", error/updated_size, tol);
}
int main(){
Description: upstream -- typo -- model/apop_loess.c
Fix a misstyped GSL macro: DBL_EPSILON instead of GSL_DBL_EPSILON .
Origin: debian
Forwarded: https://github.com/b-k/apophenia/pull/28
Author:
Jerome Benoit <calculus@rezozer.net>
Last-Update: 2015-12-02
--- a/model/apop_loess.c
+++ b/model/apop_loess.c
@@ -1216,7 +1216,7 @@
++execnt;
if (execnt == 1)
- machep = DBL_EPSILON;
+ machep = GSL_DBL_EPSILON;
/* sort by distance */
for (i3 = 1; i3 <= *n; ++i3)
dist[i3] = 0.;
Description: upstream -- typo -- eg/t_test_by_rows
Fix a faulty left parenthesis that had hidden a serious numerical bug.
The so raised bug has been submitted alongside to the upstream maintainer:
the numerical fix was provided by him.
Origin: debian/upstream
Author:
Jerome Benoit <calculus@rezozer.net>
Ben Klemens <fluffmail@f-m.fm>
Last-Update: 2015-10-16
Comment:
The typo and the raised numerical issue were isolated by Jerome Benoit on
behalf of the Debian Science Team; the numerical fix was provided by Ben
Klemens as upstream maintainer.
--- a/eg/t_test_by_rows.c
+++ b/eg/t_test_by_rows.c
@@ -32,7 +32,7 @@
assert(apop_data_get(means, i, -1) * apop_data_get(tstats, i, -1) >=0);
//inverse of P-value should be the t statistic.
- assert(fabs(gsl_cdf_tdist_Pinv(apop_data_get(confidences, i, -1),100)
- - apop_data_get(tstats, i, -1) < 1e-3));
+ assert(fabs(gsl_cdf_tdist_Pinv(apop_data_get(confidences, i, -1), 99)
+ - apop_data_get(tstats, i, -1)) < 1e-5);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment