Table of Contents

Class NumericConversion

Namespace
ScottPlot
Assembly
ScottPlot.dll

This class contains type-specific methods to convert between generic values and doubles optimized for performance using platform-specific features. See discussion in https://github.com/ScottPlot/ScottPlot/pull/1927

public static class NumericConversion
Inheritance
NumericConversion
Inherited Members

Methods

AddBytes(byte, byte)

public static byte AddBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

AreReal(double, double)

public static bool AreReal(double x, double y)

Parameters

x double
y double

Returns

bool

Clamp<T>(T, T, T)

public static T Clamp<T>(T input, T min, T max) where T : IComparable

Parameters

input T
min T
max T

Returns

T

Type Parameters

T

CreateAddFunction<T>()

public static Func<T, T, T> CreateAddFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

CreateLessThanOrEqualFunction<T>()

public static Func<T, T, bool> CreateLessThanOrEqualFunction<T>()

Returns

Func<T, T, bool>

Type Parameters

T

CreateMultFunction<T>()

public static Func<T, T, T> CreateMultFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

CreateSubtractFunction<T>()

public static Func<T, T, T> CreateSubtractFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

DecrementLargeDouble(double)

public static double DecrementLargeDouble(double value)

Parameters

value double

Returns

double

DoubleToGeneric<T>(double)

public static T DoubleToGeneric<T>(double value)

Parameters

value double

Returns

T

Type Parameters

T

DoubleToGeneric<T>(double, out T)

Creates a T for a given double value using a conversion technique optimized for the platform.

public static void DoubleToGeneric<T>(double value, out T v)

Parameters

value double
v T

Type Parameters

T

DoubleToGeneric<T>(double[])

public static T[] DoubleToGeneric<T>(this double[] input)

Parameters

input double[]

Returns

T[]

Type Parameters

T

GenericToCoordinates<T1, T2>(IEnumerable<T1>, IEnumerable<T2>)

public static Coordinates[] GenericToCoordinates<T1, T2>(IEnumerable<T1> xs, IEnumerable<T2> ys)

Parameters

xs IEnumerable<T1>
ys IEnumerable<T2>

Returns

Coordinates[]

Type Parameters

T1
T2

GenericToCoordinates<T1, T2>(ref T1, ref T2)

public static Coordinates GenericToCoordinates<T1, T2>(ref T1 x, ref T2 y)

Parameters

x T1
y T2

Returns

Coordinates

Type Parameters

T1
T2

GenericToDoubleArray<T>(IEnumerable<T>)

public static double[] GenericToDoubleArray<T>(IEnumerable<T> values)

Parameters

values IEnumerable<T>

Returns

double[]

Type Parameters

T

GenericToDoubleArray<T>(T[])

public static double[] GenericToDoubleArray<T>(T[] values)

Parameters

values T[]

Returns

double[]

Type Parameters

T

GenericToDouble<T>(IReadOnlyList<T>, int)

Returns the double value of the T at position i in list using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(IReadOnlyList<T> list, int i)

Parameters

list IReadOnlyList<T>
i int

Returns

double

Type Parameters

T

GenericToDouble<T>(ref T)

Returns the double value of a T using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(ref T value)

Parameters

value T

Returns

double

Type Parameters

T

GenericToDouble<T>(T[], int)

Returns the double value of the T at position i in array using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(T[] array, int i)

Parameters

array T[]
i int

Returns

double

Type Parameters

T

IncrementLargeDouble(double)

public static double IncrementLargeDouble(double value)

Parameters

value double

Returns

double

IsReal(double)

public static bool IsReal(double x)

Parameters

x double

Returns

bool

IsReal(float)

public static bool IsReal(float x)

Parameters

x float

Returns

bool

LessThanOrEqualBytes(byte, byte)

public static bool LessThanOrEqualBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

bool

Multiply(byte, byte)

public static byte Multiply(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

SubtractBytes(byte, byte)

public static byte SubtractBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

ToDateTime(double)

public static DateTime ToDateTime(double value)

Parameters

value double

Returns

DateTime

ToGenericArray<T>(double[])

public static T[] ToGenericArray<T>(this double[] input)

Parameters

input double[]

Returns

T[]

Type Parameters

T

ToNumber(DateTime)

Convert a DateTime into a number that can be plotted on a numeric axis

public static double ToNumber(DateTime value)

Parameters

value DateTime

Returns

double