C# Class RobustArithmetic.Test.Util.ExpansionExtensions

Various checks and conditions related for arbitrary-precision double expansions, implementing the various conditions from Shewchuk's paper.
Afficher le fichier Open project: govert/RobustGeometry.NET

Méthodes publiques

Méthode Description
AreAdjacent ( double x, double y ) : bool

Shewchuk p. 3 "Two floating-point values x and y are adjacent if they overlap, if x overlaps 2y, or if 2x overlaps y."

AreNonAdjacent ( double x, double y ) : bool
AreNonOverlapping ( double x, double y ) : bool

"Two floating-point values x and y are nonoverlapping if there exist integers r and s such that x = r.2^s and |y| < 2^s, OR y = r.2^s and |x| < 2^s."

AreOverlapping ( double x, double y ) : bool
IsNonAdjacent ( this doubles ) : bool

S.p3 "An expansion is nonadjacent if no two of its components are adjacent."

IsNonOverlapping ( this doubles ) : bool

S.p3 "An expansion is nonoverlapping if all its components are mutually nonoverlapping."

IsSorted ( this doubles ) : bool

Checks that the components are "sorted in order of increasing magnitude, except that any of the components may be zero". This is a condition used in Shewchuk Theorem 10, p. 10.

IsStronglyNonOverlapping ( this doubles ) : bool

S.p12 "An expansion is strongly nonoverlapping if no two of its components are overlapping, no component is adjacent to two other components, and any pair of adjacent components have the property that both components can be expressed with a one-bit significand (that is, both are powers of two)."

IsZeroElim ( this doubles ) : bool

Checks whether an expansion has been zero-eliminated. Either the expansion must have exactly one element, which is 0.0, or the expansion must have no 0.0 elements.

Print ( this e, int elen, double scale ) : void

Private Methods

Méthode Description
ArePowersOfTwo ( double>.this doubles ) : bool
GetAdjacent ( IEnumerable doubles ) : double>>.IEnumerable

Returns The order of adjacency is not important, so the order of entries in the returned tuple is not significant.

NonOverlaps ( this x, double y ) : bool

Method Details

AreAdjacent() public static méthode

Shewchuk p. 3 "Two floating-point values x and y are adjacent if they overlap, if x overlaps 2y, or if 2x overlaps y."
public static AreAdjacent ( double x, double y ) : bool
x double
y double
Résultat bool

AreNonAdjacent() public static méthode

public static AreNonAdjacent ( double x, double y ) : bool
x double
y double
Résultat bool

AreNonOverlapping() public static méthode

"Two floating-point values x and y are nonoverlapping if there exist integers r and s such that x = r.2^s and |y| < 2^s, OR y = r.2^s and |x| < 2^s."
public static AreNonOverlapping ( double x, double y ) : bool
x double
y double
Résultat bool

AreOverlapping() public static méthode

public static AreOverlapping ( double x, double y ) : bool
x double
y double
Résultat bool

IsNonAdjacent() public static méthode

S.p3 "An expansion is nonadjacent if no two of its components are adjacent."
public static IsNonAdjacent ( this doubles ) : bool
doubles this
Résultat bool

IsNonOverlapping() public static méthode

S.p3 "An expansion is nonoverlapping if all its components are mutually nonoverlapping."
public static IsNonOverlapping ( this doubles ) : bool
doubles this
Résultat bool

IsSorted() public static méthode

Checks that the components are "sorted in order of increasing magnitude, except that any of the components may be zero". This is a condition used in Shewchuk Theorem 10, p. 10.
public static IsSorted ( this doubles ) : bool
doubles this
Résultat bool

IsStronglyNonOverlapping() public static méthode

S.p12 "An expansion is strongly nonoverlapping if no two of its components are overlapping, no component is adjacent to two other components, and any pair of adjacent components have the property that both components can be expressed with a one-bit significand (that is, both are powers of two)."
public static IsStronglyNonOverlapping ( this doubles ) : bool
doubles this
Résultat bool

IsZeroElim() public static méthode

Checks whether an expansion has been zero-eliminated. Either the expansion must have exactly one element, which is 0.0, or the expansion must have no 0.0 elements.
public static IsZeroElim ( this doubles ) : bool
doubles this
Résultat bool

Print() public static méthode

public static Print ( this e, int elen, double scale ) : void
e this
elen int
scale double
Résultat void