simon-git: spigot (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Fri Dec 26 15:47:37 GMT 2014
TL;DR:
f68ef8b Refactor parsing of function calls.
52ba083 Implement an internal spigot_mobius().
388eca7 Implement a general way to construct algebraic numbers.
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: 2014-12-26 15:47:37
commit f68ef8bf4773dddc31120538ac8b5af0d455b04a
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=f68ef8bf4773dddc31120538ac8b5af0d455b04a;hp=4cb52256adf37289ac0822642888cf007c9f8863
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Dec 26 15:41:36 2014 +0000
Refactor parsing of function calls.
Now, instead of counting the arguments as we go along and throwing a
parse error if we don't see the expected comma or closing paren, we
accept however many arguments we might happen to see, and check at the
end whether there were the right number. This gives better error
messages, and also permits variadic functions - for which I've
included a mechanism, but not yet implemented any.
expr.cpp | 101 +++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 57 insertions(+), 44 deletions(-)
commit 52ba0834c14878f45a9d565b321ef6caa87eb603
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=52ba0834c14878f45a9d565b321ef6caa87eb603;hp=f68ef8bf4773dddc31120538ac8b5af0d455b04a
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Dec 26 15:41:40 2014 +0000
Implement an internal spigot_mobius().
This exposes the full generality of the code in unary.cpp that was
previously only used to implement spigot_rational_mul and
spigot_reciprocal. Now clients in other modules can enact any old
Mobius transformation, in a single step.
funcs.h | 3 ++
unary.cpp | 95 ++++++++++++++-----------------------------------------------
2 files changed, 24 insertions(+), 74 deletions(-)
commit 388eca75d9ae9ddd911233b609318031f611a520
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=388eca75d9ae9ddd911233b609318031f611a520;hp=52ba0834c14878f45a9d565b321ef6caa87eb603
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Dec 26 15:44:15 2014 +0000
Implement a general way to construct algebraic numbers.
It's done by gradually transforming the input polynomial to scale and
translate the target root; much like the main spigot system itself,
but dealing in polynomials rather than Mobius transformations.
The input syntax is a variadic function algebraic(lo,hi,a0,...,an),
which is a bit ugly (especially because there's no visual distinction
between the first two interval-bound arguments and the polynomial
coefficients). I was tempted to reuse the existing expression parser
to permit the polynomial to be specified _as_ a polynomial (so you
could actually directly write something like 'x^3-3x+1' to specify
what you wanted a root of), but that seemed excessively ad-hoc and I'd
only have had to go back and introduce an entire type system and
semantics etc at some later point.
Makefile.am | 4 +-
algebraic.cpp | 301 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
expr.cpp | 4 +
funcs.h | 7 ++
manpage.but | 7 ++
manual.but | 10 ++
python/setup.py | 1 +
test.sh | 16 +++
8 files changed, 348 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list