From 22ad347719ff1d8602a6b6eaa7819787c5b100e3 Mon Sep 17 00:00:00 2001 From: oldk1331 Date: Tue, 6 Jun 2017 08:23:21 +0800 Subject: [PATCH] merge SimplifyAlgebraicNumberConvertPackage into AlgebraicNumber --- src/algebra/Makefile.in | 2 +- src/algebra/constant.spad | 4 ++++ src/algebra/exposed.lsp | 1 - src/algebra/manip.spad | 10 ---------- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index ddfffb1ed..1ec674cbb 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -266,7 +266,7 @@ SPADLIST7=\ SEGXCAT SEM SEQU SEQU2 SEQUCAT SETAGG SETCAT SETMN SETLAT SEXCAT \ SEXOF SEX SFORT SFQCMPK SFRGCD SFRTCAT \ SGCF SGROUP SHDP SHP SIGNEF SIGNRF \ - SIMPAN SIMPC SIMPCF SINT SKAGG \ + SIMPC SIMPCF SINT SKAGG \ SKICOMB SKSMP SMATCAT SMITH SMP SMPCOER \ SMTS SNTSCAT SOLVEFOR SOLVERAD SOLVESER SOLVETRA \ SORD SOREXPV SORTPAK SPACE3 SPACEC SPECOUT SPFCAT SPFUTS SPLNODE \ diff --git a/src/algebra/constant.spad b/src/algebra/constant.spad index f56619121..c85af65d2 100644 --- a/src/algebra/constant.spad +++ b/src/algebra/constant.spad @@ -30,6 +30,9 @@ AlgebraicNumber() : Exports == Implementation where reduce : % -> % ++ reduce(f) simplifies all the unreduced algebraic numbers ++ present in f by applying their defining relations. + simplify : % -> % + ++ simplify(f) applies simplifications to f. Currently it only + ++ applies the \spadfun{rootProduct} simplification. trueEqual : (%, %) -> Boolean ++ trueEqual(x, y) tries to determine if the two numbers are equal norm : (SUP(%), Kernel %) -> SUP(%) @@ -99,6 +102,7 @@ AlgebraicNumber() : Exports == Implementation where x : % ^ n : Integer == n < 0 => mainRatDenom (x ^$Rep n) x ^$Rep n + simplify a == rootProduct(a::Rep)$AlgebraicManipulations(Z, FE) trueEqual(a, b) == -- if two algebraic numbers have the same norm (after deleting repeated -- roots, then they are certainly conjugates. Note that we start with a diff --git a/src/algebra/exposed.lsp b/src/algebra/exposed.lsp index 33eb3f46c..eb242d94d 100644 --- a/src/algebra/exposed.lsp +++ b/src/algebra/exposed.lsp @@ -302,7 +302,6 @@ (|Sequence| . SEQU) (|SequenceFunctions2| . SEQU2) (|Set| . SET) - (|SimplifyAlgebraicNumberConvertPackage| . SIMPAN) (|SingleInteger| . SINT) (|SmithNormalForm| . SMITH) (|SparseUnivariatePolynomialFunctions2| . SUP2) diff --git a/src/algebra/manip.spad b/src/algebra/manip.spad index fff77041a..76a436579 100644 --- a/src/algebra/manip.spad +++ b/src/algebra/manip.spad @@ -435,16 +435,6 @@ AlgebraicManipulations(R, F) : Exports == Implementation where nlk := cons(nk, nlk) eval(x, lk, nlk) -)abbrev package SIMPAN SimplifyAlgebraicNumberConvertPackage -++ Package to allow simplify to be called on AlgebraicNumbers -++ by converting to EXPR(INT) -SimplifyAlgebraicNumberConvertPackage() : with - simplify : AlgebraicNumber -> Expression(Integer) - ++ simplify(an) applies simplifications to an - == add - simplify(a : AlgebraicNumber) == - simplify(a::Expression(Integer))$TranscendentalManipulations(Integer, Expression Integer) - )abbrev package TRMANIP TranscendentalManipulations ++ Transformations on transcendental objects ++ Author: Bob Sutor, Manuel Bronstein