]> www.ginac.de Git - ginac.git/commitdiff
Added new exam for pseries and removed some 'void's
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 10 Mar 2004 16:03:21 +0000 (16:03 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 10 Mar 2004 16:03:21 +0000 (16:03 +0000)
check/exam_pseries.cpp
check/time_antipode.cpp

index 28a6150ff52c0242f6c7a27d34fe7795d75b78a0..fc07d7684a7cd43e64a553b4f86e9d696fe57c63 100644 (file)
@@ -39,7 +39,7 @@ static unsigned check_series(const ex &e, const ex &point, const ex &d, int orde
 }
 
 // Series expansion
-static unsigned exam_series1(void)
+static unsigned exam_series1()
 {
        using GiNaC::log;
 
@@ -108,12 +108,18 @@ static unsigned exam_series1(void)
        e = pow(x, 8) * pow(pow(x,3)+ pow(x + pow(x,3), 2), -2);
        d = pow(x, 4) - 2*pow(x, 5) + Order(pow(x, 6));
        result += check_series(e, 0, d, 6);
+
+       e = cos(x) * pow(sin(x)*(pow(x, 5) + 4 * pow(x, 2)), -3);
+       d = pow(x, -9) / 64 - 3 * pow(x, -6) / 256 - pow(x, -5) / 960 + 535 * pow(x, -3) / 96768
+           + pow(x, -2) / 1280 - pow(x, -1) / 14400 - numeric(283, 129024) - 2143 * x / 5322240
+           + Order(pow(x, 2));
+       result += check_series(e, 0, d, 2);
        
        return result;
 }
 
 // Series addition
-static unsigned exam_series2(void)
+static unsigned exam_series2()
 {
        unsigned result = 0;
        ex e, d;
@@ -126,7 +132,7 @@ static unsigned exam_series2(void)
 }
 
 // Series multiplication
-static unsigned exam_series3(void)
+static unsigned exam_series3()
 {
        unsigned result = 0;
        ex e, d;
@@ -139,7 +145,7 @@ static unsigned exam_series3(void)
 }
 
 // Series exponentiation
-static unsigned exam_series4(void)
+static unsigned exam_series4()
 {
        unsigned result = 0;
        ex e, d;
@@ -157,7 +163,7 @@ static unsigned exam_series4(void)
 }
 
 // Order term handling
-static unsigned exam_series5(void)
+static unsigned exam_series5()
 {
        unsigned result = 0;
        ex e, d;
@@ -177,7 +183,7 @@ static unsigned exam_series5(void)
 }
 
 // Series expansion of tgamma(-1)
-static unsigned exam_series6(void)
+static unsigned exam_series6()
 {
        ex e = tgamma(2*x);
        ex d = pow(x+1,-1)*numeric(1,4) +
@@ -209,7 +215,7 @@ static unsigned exam_series6(void)
 }
        
 // Series expansion of tan(x==Pi/2)
-static unsigned exam_series7(void)
+static unsigned exam_series7()
 {
        ex e = tan(x*Pi/2);
        ex d = pow(x-1,-1)/Pi*(-2) + pow(x-1,1)*Pi/6 + pow(x-1,3)*pow(Pi,3)/360
@@ -219,7 +225,7 @@ static unsigned exam_series7(void)
 }
 
 // Series expansion of log(sin(x==0))
-static unsigned exam_series8(void)
+static unsigned exam_series8()
 {
        ex e = log(sin(x));
        ex d = log(x) - pow(x,2)/6 - pow(x,4)/180 - pow(x,6)/2835 - pow(x,8)/37800 + Order(pow(x,9));
@@ -227,7 +233,7 @@ static unsigned exam_series8(void)
 }
 
 // Series expansion of Li2(sin(x==0))
-static unsigned exam_series9(void)
+static unsigned exam_series9()
 {
        ex e = Li2(sin(x));
        ex d = x + pow(x,2)/4 - pow(x,3)/18 - pow(x,4)/48
@@ -237,7 +243,7 @@ static unsigned exam_series9(void)
 }
 
 // Series expansion of Li2((x==2)^2), caring about branch-cut
-static unsigned exam_series10(void)
+static unsigned exam_series10()
 {
        using GiNaC::log;
 
@@ -251,7 +257,7 @@ static unsigned exam_series10(void)
 }
 
 // Series expansion of logarithms around branch points
-static unsigned exam_series11(void)
+static unsigned exam_series11()
 {
        using GiNaC::log;
 
@@ -293,7 +299,7 @@ static unsigned exam_series11(void)
 }
 
 // Series expansion of other functions around branch points
-static unsigned exam_series12(void)
+static unsigned exam_series12()
 {
        using GiNaC::log;
 
@@ -321,7 +327,7 @@ static unsigned exam_series12(void)
 }
 
 
-unsigned exam_pseries(void)
+unsigned exam_pseries()
 {
        unsigned result = 0;
        
index be8dc4d69a5eeb9cc1b853f24c9ee53a7d0568e0..d618fabed94b1da3634ef2df1b4dc48e7c583f2f 100644 (file)
@@ -84,8 +84,8 @@ public:
        vertex(ijpair ij = ijpair(0,0)) : indices(ij) { }
        void increment_indices(const ijpair &ind) { indices.first += ind.first; indices.second += ind.second; }
        virtual ~vertex() { }
-       virtual vertex* copy(void) const = 0;
-       virtual ijpair get_increment(void) const { return indices; }
+       virtual vertex* copy() const = 0;
+       virtual ijpair get_increment() const { return indices; }
        virtual const ex evaluate(const symbol &x, const unsigned grad) const = 0;
        bool operator==(const vertex &v) const { return (indices==v.indices); }
        bool operator<(const vertex &v) const { return (indices<v.indices); }
@@ -100,8 +100,8 @@ protected:
 class Sigma : public vertex {
 public:
        Sigma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy(void) const { return new Sigma(*this); }
-       ijpair get_increment(void) const { return ijpair(indices.first+indices.second+1, 0); }
+       vertex* copy() const { return new Sigma(*this); }
+       ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
        const ex evaluate(const symbol &x, const unsigned grad) const;
 private:
 };
@@ -132,8 +132,8 @@ const ex Sigma::evaluate(const symbol &x, const unsigned grad) const
 class Sigma_flipped : public Sigma {
 public:
        Sigma_flipped(ijpair ij = ijpair(0,0)) : Sigma(ij) { }
-       vertex* copy(void) const { return new Sigma_flipped(*this); }
-       ijpair get_increment(void) const { return ijpair(0, indices.first+indices.second+1); }
+       vertex* copy() const { return new Sigma_flipped(*this); }
+       ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
        const ex evaluate(const symbol &x, const unsigned grad) const { return Sigma::evaluate(x, grad); }
 private:
 };
@@ -145,8 +145,8 @@ private:
 class Gamma : public vertex {
 public:
        Gamma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy(void) const { return new Gamma(*this); }
-       ijpair get_increment(void) const { return ijpair(indices.first+indices.second+1, 0); }
+       vertex* copy() const { return new Gamma(*this); }
+       ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
        const ex evaluate(const symbol &x, const unsigned grad) const;
 private:
 };
@@ -179,7 +179,7 @@ const ex Gamma::evaluate(const symbol &x, const unsigned grad) const
 class Vacuum : public vertex {
 public:
        Vacuum(ijpair ij = ijpair(0,0)) : vertex(ij) { }
-       vertex* copy(void) const { return new Vacuum(*this); }
+       vertex* copy() const { return new Vacuum(*this); }
        ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
        const ex evaluate(const symbol &x, const unsigned grad) const;
 private:
@@ -218,7 +218,7 @@ public:
        ~node() { delete vert; }
        void add_child(const node &, bool = false);
        const ex evaluate(const symbol &x, unsigned grad) const;
-       unsigned total_edges(void) const;
+       unsigned total_edges() const;
        bool operator==(const node &) const;
        bool operator<(const node &) const;
 private:
@@ -274,7 +274,7 @@ const ex node::evaluate(const symbol &x, unsigned grad) const
        return (product * vert->evaluate(x,grad));
 }
 
-unsigned node::total_edges(void) const
+unsigned node::total_edges() const
 {
        unsigned accu = 0;
        for (multiset<child>::const_iterator i=children.begin(); i!=children.end(); ++i) {
@@ -473,7 +473,7 @@ static unsigned test_tree(const node tree_generator(unsigned))
        return 0;
 }
 
-unsigned time_antipode(void)
+unsigned time_antipode()
 {
        unsigned result = 0;
        timer jaeger_le_coultre;