toysolver-0.1.0: Assorted decision procedures for SAT, Max-SAT, PB, MIP, etc

Copyright (c) Masahiro Sakai 2012-2013 BSD-style masahiro.sakai@gmail.com provisional non-portable (Rank2Types) None Haskell2010

ToySolver.Data.AlgebraicNumber.Real

Description

Algebraic reals

Reference:

Synopsis

Algebraic real type

data AReal Source

Algebraic real numbers.

Instances

 Eq AReal Fractional AReal Num AReal Ord AReal Real AReal RealFrac AReal Show AReal Pretty AReal PrettyCoeff AReal Degree AReal Degree of the algebraic number.If the algebraic number's `minimalPolynomial` has degree `n`, then the algebraic number is said to be degree `n`.

Construction

Real roots of the polynomial in ascending order.

Real roots of the polynomial in ascending order.

Properties

The polynomial of which the algebraic number is root.

Isolating interval that separate the number from other roots of `minimalPolynomial` of it.

Whether the algebraic number is a rational.

Whether the algebraic number is a root of a polynomial with integer coefficients with leading coefficient `1` (a monic polynomial).

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.

root index, satisfying

````realRoots` (`minimalPolynomial` a) !! rootIndex a == a
```

Operations

The `n`th root of `a`

Same algebraic real, but represented using finer grained `isolatingInterval`.

Approximation

Arguments

 :: AReal a -> Rational epsilon -> Rational

Returns approximate rational value such that `abs (a - approx a epsilon) <= epsilon`.

Arguments

 :: AReal a -> Rational epsilon -> Interval Rational

Returns approximate interval such that `width (approxInterval a epsilon) <= epsilon`.

Golden ratio