Copyright | (c) Masahiro Sakai 2012-2013 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
ToySolver.Data.AlgebraicNumber.Real
Description
Algebraic reals
Reference:
- Why the concept of a field extension is a natural one http://www.dpmms.cam.ac.uk/~wtg10/galois.html
Synopsis
- data AReal
- realRoots :: UPolynomial Rational -> [AReal]
- realRootsEx :: UPolynomial AReal -> [AReal]
- minimalPolynomial :: AReal -> UPolynomial Rational
- isolatingInterval :: AReal -> Interval Rational
- isRational :: AReal -> Bool
- isAlgebraicInteger :: AReal -> Bool
- height :: AReal -> Integer
- rootIndex :: AReal -> Int
- nthRoot :: Integer -> AReal -> AReal
- refineIsolatingInterval :: AReal -> AReal
- approx :: AReal -> Rational -> Rational
- approxInterval :: AReal -> Rational -> Interval Rational
- simpARealPoly :: UPolynomial AReal -> UPolynomial Rational
- goldenRatio :: AReal
Algebraic real type
Algebraic real numbers.
Instances
Num AReal Source # | |
Fractional AReal Source # | |
Real AReal Source # | |
Defined in ToySolver.Data.AlgebraicNumber.Real Methods toRational :: AReal -> Rational # | |
RealFrac AReal Source # | |
Show AReal Source # | |
Eq AReal Source # | |
Ord AReal Source # | |
Pretty AReal Source # | |
Defined in ToySolver.Data.AlgebraicNumber.Real Methods pPrintPrec :: PrettyLevel -> Rational -> AReal -> Doc # pPrintList :: PrettyLevel -> [AReal] -> Doc # | |
Degree AReal Source # | Degree of the algebraic number. If the algebraic number's |
PrettyCoeff AReal Source # | |
Defined in ToySolver.Data.AlgebraicNumber.Real Methods pPrintCoeff :: PrettyLevel -> Rational -> AReal -> Doc Source # isNegativeCoeff :: AReal -> Bool Source # |
Construction
realRoots :: UPolynomial Rational -> [AReal] Source #
Real roots of the polynomial in ascending order.
realRootsEx :: UPolynomial AReal -> [AReal] Source #
Real roots of the polynomial in ascending order.
Properties
minimalPolynomial :: AReal -> UPolynomial Rational Source #
The polynomial of which the algebraic number is root.
isolatingInterval :: AReal -> Interval Rational Source #
Isolating interval that separate the number from other roots of minimalPolynomial
of it.
isRational :: AReal -> Bool Source #
Whether the algebraic number is a rational.
isAlgebraicInteger :: AReal -> Bool Source #
Whether the algebraic number is a root of a polynomial with integer
coefficients with leading coefficient 1
(a monic polynomial).
height :: AReal -> Integer Source #
Height of the algebraic number.
The height of an algebraic number is the greatest absolute value of the coefficients of the irreducible and primitive polynomial with integral rational coefficients.
rootIndex :: AReal -> Int Source #
root index, satisfying
realRoots
(minimalPolynomial
a) !! rootIndex a == a
Operations
refineIsolatingInterval :: AReal -> AReal Source #
Same algebraic real, but represented using finer grained isolatingInterval
.
Approximation
Returns approximate rational value such that abs (a - approx a epsilon) <= epsilon
.
Returns approximate interval such that width (approxInterval a epsilon) <= epsilon
.
Misc
goldenRatio :: AReal Source #
Golden ratio