C# Class RobustArithmetic.Test.Util.ExpansionExtensions

Various checks and conditions related for arbitrary-precision double expansions, implementing the various conditions from Shewchuk's paper.
ファイルを表示 Open project: govert/RobustGeometry.NET

Public Methods

Method 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

Method 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 method

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
return bool

AreNonAdjacent() public static method

public static AreNonAdjacent ( double x, double y ) : bool
x double
y double
return bool

AreNonOverlapping() public static method

"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
return bool

AreOverlapping() public static method

public static AreOverlapping ( double x, double y ) : bool
x double
y double
return bool

IsNonAdjacent() public static method

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

IsNonOverlapping() public static method

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

IsSorted() public static method

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
return bool

IsStronglyNonOverlapping() public static method

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
return bool

IsZeroElim() public static method

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
return bool

Print() public static method

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