From cf8f92747d9bd3f54f9dd206f7952eba12f7c791 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Wed, 19 Jan 2000 22:42:36 +0000 Subject: [PATCH] - updated for class series->class pseries - added one additional check for the behavior of the order term during the series expansion of a simple polynomial --- check/Makefile.in | 4 +++- check/differentiation.cpp | 4 ++-- check/series_expansion.cpp | 25 +++++++++++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/check/Makefile.in b/check/Makefile.in index f9d3cf45..bcb32424 100644 --- a/check/Makefile.in +++ b/check/Makefile.in @@ -59,6 +59,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ +ARCHIVE_AGE = @ARCHIVE_AGE@ +ARCHIVE_VERSION = @ARCHIVE_VERSION@ AS = @AS@ CC = @CC@ CXX = @CXX@ @@ -246,7 +248,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/check/differentiation.cpp b/check/differentiation.cpp index d5fda588..5b5f12dc 100644 --- a/check/differentiation.cpp +++ b/check/differentiation.cpp @@ -261,8 +261,8 @@ static unsigned differentiation6(void) e = sin(x).series(x, 0, 8); d = cos(x).series(x, 0, 7); ed = e.diff(x); - ed = static_cast(ed.bp)->convert_to_poly(); - d = static_cast(d.bp)->convert_to_poly(); + ed = series_to_poly(ed); + d = series_to_poly(d); if ((ed - d).compare(ex(0)) != 0) { clog << "derivative of " << e << " by " << x << " returned " diff --git a/check/series_expansion.cpp b/check/series_expansion.cpp index bd7cbbb3..00998fd5 100644 --- a/check/series_expansion.cpp +++ b/check/series_expansion.cpp @@ -31,7 +31,7 @@ static symbol x("x"); static unsigned check_series(const ex &e, const ex &point, const ex &d, int order = 8) { ex es = e.series(x, point, order); - ex ep = static_cast(es.bp)->convert_to_poly(); + ex ep = static_cast(*es.bp).convert_to_poly(); if (!(ep - d).is_zero()) { clog << "series expansion of " << e << " at " << point << " erroneously returned " << ep << " (instead of " << d @@ -131,8 +131,28 @@ static unsigned series3(void) return result; } -// Series of special functions +// Order term handling static unsigned series4(void) +{ + unsigned result = 0; + ex e, d; + + e = 1 + x + pow(x, 2) + pow(x, 3); + d = Order(1); + result += check_series(e, 0, d, 0); + d = 1 + Order(x); + result += check_series(e, 0, d, 1); + d = 1 + x + Order(pow(x, 2)); + result += check_series(e, 0, d, 2); + d = 1 + x + pow(x, 2) + Order(pow(x, 3)); + result += check_series(e, 0, d, 3); + d = 1 + x + pow(x, 2) + pow(x, 3); + result += check_series(e, 0, d, 4); + return result; +} + +// Series of special functions +static unsigned series5(void) { unsigned result = 0; ex e, d; @@ -190,6 +210,7 @@ unsigned series_expansion(void) result += series2(); result += series3(); result += series4(); + result += series5(); if (!result) { cout << " passed "; -- 2.44.0