simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Wed Apr 15 20:26:12 BST 2015


TL;DR:
  d42f6f5 Factor out the gcd code from spigot_rational().
  f3cef0a Make algebraic() cope with repeated roots.
  42bf424 Add special cases in arithmetic.cpp for one rational operand.

Repository:     git://git.tartarus.org/simon/spigot.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=spigot.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2015-04-15 20:26:12

commit d42f6f526487088df864a5a82d9c77d6bdb9d4a5
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=d42f6f526487088df864a5a82d9c77d6bdb9d4a5;hp=56bc6f7e269e397363c68339aa333954b2b77c87
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Apr 15 19:37:54 2015 +0100

    Factor out the gcd code from spigot_rational().
    
    I'm about to reuse it elsewhere.

 misc.cpp   |   12 ++++++++++++
 spigot.cpp |    7 +------
 spigot.h   |    1 +
 3 files changed, 14 insertions(+), 6 deletions(-)

commit f3cef0a203391bd5d570d8adeeb4387ec160630a
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=f3cef0a203391bd5d570d8adeeb4387ec160630a;hp=d42f6f526487088df864a5a82d9c77d6bdb9d4a5
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Apr 15 19:38:26 2015 +0100

    Make algebraic() cope with repeated roots.
    
    The root-finding code relies on the polynomial's value changing sign
    when it crosses the root, so it has trouble with repeated roots (more
    specifically, ones with _even_ multiplicity). But we can fix that in
    preprocessing, because any repeated root of a polynomial is also a
    root of its derivative with multiplicity one less, so P / gcd(P,P') is
    a polynomial with the same roots as P but all with multiplicity 1.

 algebraic.cpp |  136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 test.sh       |    6 +++
 2 files changed, 142 insertions(+)

commit 42bf424363579e20aa153959fb423d7a96a951e1
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=42bf424363579e20aa153959fb423d7a96a951e1;hp=f3cef0a203391bd5d570d8adeeb4387ec160630a
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Apr 15 20:24:39 2015 +0100

    Add special cases in arithmetic.cpp for one rational operand.
    
    We were already special-casing arithmetic between _two_ known
    rationals, but not doing anything about the case of one known rational
    and one general real. But in fact we can deal with those too more
    efficiently than the general case, by converting them into
    spigot_mobius() calls.
    
    Since spigot_mobius() has very little overhead when applied directly
    to a Source, this should speed things up. Unfortunately it doesn't
    help much in cases where it's applied to a Core (in particular, the
    output of spigot_pi() which is a Core2 at the to level) because that
    has to be turned back into a Source in order to prepend a matrix. But
    there we go; you can't win them all.

 arithmetic.cpp |   47 +++++++++++++++++++++++++++++++++++++----------
 test.sh        |    8 ++++++++
 2 files changed, 45 insertions(+), 10 deletions(-)



More information about the tartarus-commits mailing list