LazyDouble

com.phasmidsoftware.number.core.misc.LazyDouble
See theLazyDouble companion object
case class LazyDouble(x: Double, f: Double => Double) extends LazyNumber[Double]

Attributes

Companion
object
Graph
Supertypes
trait Product
trait Equals
class LazyNumber[Double]
trait Fractional[LazyNumber[Double]]
trait Numeric[LazyNumber[Double]]
trait Ordering[LazyNumber[Double]]
trait PartialOrdering[LazyNumber[Double]]
trait Equiv[LazyNumber[Double]]
trait Serializable
trait Comparator[LazyNumber[Double]]
trait Valuable[Double]
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Type members

Inherited classlikes

class FractionalOps(lhs: Fractional.this.T) extends NumericOps

Attributes

Inherited from:
Fractional
Supertypes
class Fractional.this.NumericOps
class Object
trait Matchable
class Any
class NumericOps(lhs: Numeric.this.T)

Attributes

Inherited from:
Numeric
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fractional.this.FractionalOps
class OrderingOps(lhs: Ordering.this.T)

This inner class defines comparison operators available for T.

This inner class defines comparison operators available for T.

It can't extend AnyVal because it is not a top-level class or a member of a statically accessible object.

Value parameters

lhs

the left-hand side value for infix comparison operations

Attributes

Inherited from:
Ordering
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def construct(x: => Double, f: Double => Double): LazyNumber[Double]
def fromInt(x: Int): LazyDouble
def parseString(str: String): Option[LazyNumber[Double]]

Inherited methods

def *(that: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def +(that: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def -(that: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def /(that: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def abs(x: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
Numeric
def compare(x: LazyNumber[Double], y: LazyNumber[Double]): Int

Returns an integer whose sign communicates how x compares to y.

Returns an integer whose sign communicates how x compares to y.

The result sign has the following meaning:

  • negative if x < y
  • positive if x > y
  • zero otherwise (if x == y)

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Returns

a negative integer, zero, or a positive integer as x is less than, equal to, or greater than y

Inherited from:
LazyNumber
def div(x: LazyNumber[Double], y: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
override def equiv(x: LazyNumber[Double], y: LazyNumber[Double]): Boolean

Returns true if x == y in the ordering.

Returns true if x == y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering -> Equiv
Inherited from:
Ordering
def fAdd(y: => LazyNumber[Double]): Sum[Double]

Attributes

Inherited from:
LazyNumber
def fDiv(y: => LazyNumber[Double]): Product[Double]

Attributes

Inherited from:
LazyNumber
def fMult(y: => LazyNumber[Double]): Product[Double]

Attributes

Inherited from:
LazyNumber
def flatMap(g: Double => LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
override def gt(x: LazyNumber[Double], y: LazyNumber[Double]): Boolean

Returns true if x > y in the ordering.

Returns true if x > y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def gteq(x: LazyNumber[Double], y: LazyNumber[Double]): Boolean

Returns true if x >= y in the ordering.

Returns true if x >= y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def invert(x: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def isReverseOf(other: Ordering[_]): Boolean

Returns whether or not the other ordering is the opposite ordering of this one.

Returns whether or not the other ordering is the opposite ordering of this one.

Equivalent to other == this.reverse.

Implementations should only override this method if they are overriding reverse as well.

Value parameters

other

the ordering to check

Attributes

Returns

true if other is the reverse of this ordering, false otherwise

Inherited from:
Ordering
override def lt(x: LazyNumber[Double], y: LazyNumber[Double]): Boolean

Returns true if x < y in the ordering.

Returns true if x < y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def lteq(x: LazyNumber[Double], y: LazyNumber[Double]): Boolean

Returns true if x <= y in the ordering.

Returns true if x <= y in the ordering.

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def map(f: Double => Double): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def max[U <: LazyNumber[Double]](x: U, y: U): U

Returns x if x >= y, otherwise y.

Returns x if x >= y, otherwise y.

Type parameters

U

a subtype of T, used to preserve the specific type in the return value

Value parameters

x

the first candidate value

y

the second candidate value

Attributes

Inherited from:
Ordering
def min[U <: LazyNumber[Double]](x: U, y: U): U

Returns x if x <= y, otherwise y.

Returns x if x <= y, otherwise y.

Type parameters

U

a subtype of T, used to preserve the specific type in the return value

Value parameters

x

the first candidate value

y

the second candidate value

Attributes

Inherited from:
Ordering
def minus(x: LazyNumber[Double], y: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def negate(x: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def on[U](f: U => LazyNumber[Double]): Ordering[U]

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

def compare[U, T: Ordering](x: U, y: U, f: U => T) = Ordering[T].compare(f(x), f(y))

Type parameters

U

the type of the values to be ordered

Value parameters

f

the function to extract a T value from a U value

Attributes

Returns

an Ordering[U] that orders values by applying f and comparing the results using this ordering

Inherited from:
Ordering
def one: LazyNumber[Double]

Attributes

Inherited from:
Numeric
def orElse(other: Ordering[LazyNumber[Double]]): Ordering[LazyNumber[Double]]

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Value parameters

other

an Ordering to use if this Ordering returns zero

Attributes

Returns

an Ordering[T] that uses this ordering first, falling back to other when values are equal

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElse(Ordering.by[Pair, Int](_.b))
Inherited from:
Ordering
def orElseBy[S](f: LazyNumber[Double] => S)(implicit ord: Ordering[S]): Ordering[LazyNumber[Double]]

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

def compare[T, S: Ordering](x: T, y: T, f: T => S) = Ordering[S].compare(f(x), f(y))

This function is equivalent to passing the result of Ordering.by(f) to orElse.

Type parameters

S

the type returned by the extraction function f

Value parameters

f

the function to extract a comparison key from a T value

ord

the implicit ordering for the extracted key type S

Attributes

Returns

an Ordering[T] that uses this ordering first, falling back to comparing by f when values are equal

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElseBy[Int](_.b)
Inherited from:
Ordering
def plus(x: LazyNumber[Double], y: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def reverse: Ordering[LazyNumber[Double]]

Returns the opposite ordering of this one.

Returns the opposite ordering of this one.

Implementations overriding this method MUST override isReverseOf as well if they change the behavior at all (for example, caching does not require overriding it).

Attributes

Returns

an Ordering[T] that compares elements in the reverse order of this ordering

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def reversed(): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def sign(x: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
Numeric
def thenComparing[U <: Comparable[_ >: U <: <FromJavaObject>]](x$0: Function[_ >: LazyNumber[Double] <: <FromJavaObject>, _ <: U]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def thenComparing[U <: <FromJavaObject>](x$0: Function[_ >: LazyNumber[Double] <: <FromJavaObject>, _ <: U], x$1: Comparator[_ >: U <: <FromJavaObject>]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def thenComparing(x$0: Comparator[_ >: LazyNumber[Double] <: <FromJavaObject>]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def thenComparingDouble(x$0: ToDoubleFunction[_ >: LazyNumber[Double] <: <FromJavaObject>]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def thenComparingInt(x$0: ToIntFunction[_ >: LazyNumber[Double] <: <FromJavaObject>]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def thenComparingLong(x$0: ToLongFunction[_ >: LazyNumber[Double] <: <FromJavaObject>]): Comparator[LazyNumber[Double]]

Attributes

Inherited from:
Comparator
def times(x: LazyNumber[Double], y: LazyNumber[Double]): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def toDouble(x: LazyNumber[Double]): Double

Attributes

Inherited from:
LazyNumber
def toFloat(x: LazyNumber[Double]): Float

Attributes

Inherited from:
LazyNumber
def toInt(x: LazyNumber[Double]): Int

Attributes

Inherited from:
LazyNumber
def toLong(x: LazyNumber[Double]): Long

Attributes

Inherited from:
LazyNumber
def tryCompare(x: LazyNumber[Double], y: LazyNumber[Double]): Some[Int]

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Value parameters

x

the first value to compare

y

the second value to compare

Attributes

Inherited from:
Ordering
def unary_-: LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def unary_/: LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def unit(x: => Double): LazyNumber[Double]

Attributes

Inherited from:
LazyNumber
def zero: LazyNumber[Double]

Attributes

Inherited from:
Numeric

Deprecated and Inherited methods

def signum(x: LazyNumber[Double]): Int

Attributes

Deprecated
[Since version 2.13.0] use `sign` method instead
Inherited from:
Numeric

Inherited fields

lazy val fInvert: Named[Double]

Attributes

Inherited from:
LazyNumber
lazy val fNegate: Product[Double]

Attributes

Inherited from:
LazyNumber
lazy val get: Double

Attributes

Inherited from:
LazyNumber
val z: Fractional[Double]

Attributes

Inherited from:
LazyNumber

Implicits

Inherited implicits

implicit override def mkNumericOps(lhs: LazyNumber[Double]): FractionalOps

Attributes

Definition Classes
Fractional -> Numeric
Inherited from:
Fractional
implicit def mkOrderingOps(lhs: LazyNumber[Double]): OrderingOps

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

Value parameters

lhs

the value to enrich with ordering operators

Attributes

Inherited from:
Ordering