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

Portabilitynon-portable (Rank2Types)
Stabilityprovisional
Maintainermasahiro.sakai@gmail.com
Safe HaskellNone

Data.AlgebraicNumber.Real

Contents

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

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 RationalSource

The polynomial of which the algebraic number is root.

isRational :: AReal -> BoolSource

Whether the algebraic number is a rational.

isAlgebraicInteger :: AReal -> BoolSource

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

height :: AReal -> IntegerSource

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 -> IntSource

root index, satisfying

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

Operations

nthRoot :: Integer -> AReal -> ARealSource

The nth root of a

Approximation

approxSource

Arguments

:: AReal

a

-> Rational

epsilon

-> Rational 

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

approxIntervalSource

Arguments

:: AReal

a

-> Rational

epsilon

-> Interval Rational 

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

Misc

goldenRatio :: ARealSource

Golden ratio