toysolver-0.7.0: Assorted decision procedures for SAT, SMT, Max-SAT, PB, MIP, etc
Copyright(c) Masahiro Sakai 2012-2013
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • RankNTypes
  • ExplicitForAll

ToySolver.Data.AlgebraicNumber.Real

Description

Algebraic reals

Reference:

Synopsis

Algebraic real type

data AReal Source #

Algebraic real numbers.

Instances

Instances details
Eq AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

(==) :: AReal -> AReal -> Bool #

(/=) :: AReal -> AReal -> Bool #

Fractional AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Num AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Ord AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

compare :: AReal -> AReal -> Ordering #

(<) :: AReal -> AReal -> Bool #

(<=) :: AReal -> AReal -> Bool #

(>) :: AReal -> AReal -> Bool #

(>=) :: AReal -> AReal -> Bool #

max :: AReal -> AReal -> AReal #

min :: AReal -> AReal -> AReal #

Real AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

toRational :: AReal -> Rational #

RealFrac AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

properFraction :: Integral b => AReal -> (b, AReal) #

truncate :: Integral b => AReal -> b #

round :: Integral b => AReal -> b #

ceiling :: Integral b => AReal -> b #

floor :: Integral b => AReal -> b #

Show AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

showsPrec :: Int -> AReal -> ShowS #

show :: AReal -> String #

showList :: [AReal] -> ShowS #

Pretty AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

PrettyCoeff AReal Source # 
Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Degree AReal Source #

Degree of the algebraic number.

If the algebraic number's minimalPolynomial has degree n, then the algebraic number is said to be degree n.

Instance details

Defined in ToySolver.Data.AlgebraicNumber.Real

Methods

deg :: AReal -> Integer 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

nthRoot :: Integer -> AReal -> AReal Source #

The nth root of a

refineIsolatingInterval :: AReal -> AReal Source #

Same algebraic real, but represented using finer grained isolatingInterval.

Approximation

approx Source #

Arguments

:: AReal

a

-> Rational

epsilon

-> Rational 

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

approxInterval Source #

Arguments

:: AReal

a

-> Rational

epsilon

-> Interval Rational 

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

Misc

goldenRatio :: AReal Source #

Golden ratio