com.phasmidsoftware.number.core.misc
Members list
Type members
Classlikes
the order of the parameters is significant. The result of applying this function is: g(f(x))
the order of the parameters is significant. The result of applying this function is: g(f(x))
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
The Approximate trait provides a mechanism to compute approximate representations of values of type X as Double. Implementations of this trait define how to compute this approximation while adhering to a specified maximum allowable error.
The Approximate trait provides a mechanism to compute approximate representations of values of type X as Double. Implementations of this trait define how to compute this approximation while adhering to a specified maximum allowable error.
This is particularly useful for applications where an approximation with controlled precision is sufficient and can improve performance.
It operates based on an implicit epsilon value, which determines the acceptable error tolerance between the true value and the approximate result.
Type parameters
- X
-
The type of the input object to be approximated.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
- Known subtypes
-
class RandomLong
An object providing benchmarking utilities for measuring the execution time of code snippets. It includes an implicit class that extends the functionality of the Int type, allowing expressions to be evaluated multiple times with performance metrics.
An object providing benchmarking utilities for measuring the execution time of code snippets. It includes an implicit class that extends the functionality of the Int type, allowing expressions to be evaluated multiple times with performance metrics.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Benchmark.type
Bumperator is a concrete Iterator that selectively filters out elements based on a user-supplied function. Elements are compared using a binary predicate, and if the function returns true for a pair of elements, both elements are skipped in the resulting iteration.
Bumperator is a concrete Iterator that selectively filters out elements based on a user-supplied function. Elements are compared using a binary predicate, and if the function returns true for a pair of elements, both elements are skipped in the resulting iteration.
The name comes from the rowing races at Oxford and Cambridge whereby when a boat "bumps" the boat in front, both withdraw for the day but return the following day with their former order reversed. See Bumps race
TODO move this into expression module.
Type parameters
- T
-
the type of each element in the iterator
Value parameters
- f
-
a binary predicate function that determines whether two consecutive elements should be "bumped out" (skipped)
- xs
-
an input iterator providing elements to iterate over
Attributes
- Note
-
Throws java.lang.IllegalArgumentException if the input iterator is empty
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Iterator[T]trait IterableOnceOps[T, Iterator, Iterator[T]]trait IterableOnce[T]class Objecttrait Matchableclass AnyShow all
The Bumperator companion object provides a factory method to create an instance of the Bumperator iterator. It applies a filtering function to consecutive elements of a sequence, ensuring only those satisfying the provided condition remain in the iteration pipeline.
The Bumperator companion object provides a factory method to create an instance of the Bumperator iterator. It applies a filtering function to consecutive elements of a sequence, ensuring only those satisfying the provided condition remain in the iteration pipeline.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Bumperator.type
Scaled ConFrac. The "value" of the ConFrac is "divided" by a.
Scaled ConFrac. The "value" of the ConFrac is "divided" by a.
CONSIDER making CF a trait.
Value parameters
- a
-
the coefficient to apply to c`.
- c
-
a
ConFrac.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
the order of the parameters is significant. The result of applying this function is: f(g(x))
the order of the parameters is significant. The result of applying this function is: f(g(x))
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DiFunc[X]class LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
This Class defines a lazily-evaluated Generalized Continued Fraction, somewhat like a LazyList.
This Class defines a lazily-evaluated Generalized Continued Fraction, somewhat like a LazyList.
Value parameters
- b
-
the (additive) coefficient, represented on the Wikipedia page (Generalized CF) as b.
- co
-
an optional reference to a ConFrac.
Attributes
- Companion
- object
- Supertypes
Companion object for ConFrac.
Companion object for ConFrac.
This object defines an apply method which takes a LazyList of Pairs and returns a ConFrac. This object defines a "simple" method which takes a LazyList of Int and returns a ConFrac.
In addition, several ConFrac objects are defined, one each for pi, e, phi, and sqrt(19).
Attributes
Represents an exception that is specifically thrown in the context of continued fraction computations or related operations.
Represents an exception that is specifically thrown in the context of continued fraction computations or related operations.
Value parameters
- str
-
The error message associated with this exception.
Attributes
- Constructor
-
Creates a new instance of ConFracException with the provided error message.
- Supertypes
-
trait Producttrait Equalsclass RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
This Class defines a Continued Fraction. See Continued Fraction.
This Class defines a Continued Fraction. See Continued Fraction.
Continued fractions are an interesting way of defining irrational (or rational) numbers. There are two distinct types:
Finite
Value parameters
- cf
-
the ConFrac that defines this ContinuedFraction.
- infinite
-
whether this ContinuedFraction is infinite (defaults to true).
- markov
-
the Markov constant for this particular ContinuedFraction (defaults to Hurwitz, i.e. the square root of 5)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
This object represents utility methods and predefined constants for working with continued fractions. It provides functionality to construct, transform, and manipulate ContinuedFraction instances.
This object represents utility methods and predefined constants for working with continued fractions. It provides functionality to construct, transform, and manipulate ContinuedFraction instances.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ContinuedFraction.type
These converters are used by the tryMap and transpose.
These converters are used by the tryMap and transpose.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Converters.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ComposedDifferentiable[X]class DiFuncBase[X]class DifferentiableFunction[X]class KnownDifferentiableFunction[X]class ExpDifferentiable[X]object Inverseobject Negativeclass Powerclass TimesShow all
Base class for trait DiFunc
Base class for trait DiFunc
Value parameters
- ds
-
a variable number of one-functions
- g
-
function which transforms value (THE function)
Attributes
- Supertypes
- Known subtypes
-
class DifferentiableFunction[X]class KnownDifferentiableFunction[X]class ExpDifferentiable[X]object Inverseobject Negativeclass Powerclass TimesShow all
Attributes
- Supertypes
- Known subtypes
-
class KnownDifferentiableFunction[X]class ExpDifferentiable[X]
A trait representing an entity that can be evaluated for an approximate double value.
A trait representing an entity that can be evaluated for an approximate double value.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ConFrac
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Known[X]class LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass KnownDifferentiableFunction[X]class DifferentiableFunction[X]trait X => Xclass DiFuncBase[X]trait DiFunc[X]class Objecttrait Matchableclass AnyShow all
This module is concerned with the generic operations for operating on Numbers.
This module is concerned with the generic operations for operating on Numbers.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
FP.type
The Factorial object provides methods to compute the factorial of a given non-negative integer. The calculation is implemented using tail recursion for improved performance and optimization.
The Factorial object provides methods to compute the factorial of a given non-negative integer. The calculation is implemented using tail recursion for improved performance and optimization.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Factorial.type
The Fuzzy trait defines a quantity for which there is doubt about its actual value. This Fuzzy trait is Numeric (it extends Fractional), and thus Fuzzy values can be ordered, compared, and take part in arithmetic operations, including division.
The Fuzzy trait defines a quantity for which there is doubt about its actual value. This Fuzzy trait is Numeric (it extends Fractional), and thus Fuzzy values can be ordered, compared, and take part in arithmetic operations, including division.
In this implementation of Fuzzy, the actual value is represented by a Double (see the get method).
In general, a Fuzzy trait would only require ordering.
Numeric fuzzy objects define a probability distribution such that it is possible to determine the likelihood that the actual value of the fuzzy object is between two limits. Typical distributions are Gaussian (i.e. "Normal") and Box (i.e. a truncated Uniform distribution). Additionally, we support Trapezoid shape. Other distributions are possible, of course, especially when Gaussian fuzzy objects are combined with other fuzzy objects. This package does not properly handle these situations.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
-
trait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Known[X]class LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object DoubleLazyFunctionobject FuzzyLazyFunctionobject IntLazyFunctionobject RationalLazyFunction
This case class represents an infinite product of terms which can be derived by a function (f) which takes as its parameter a prime number.
This case class represents an infinite product of terms which can be derived by a function (f) which takes as its parameter a prime number.
Each successive term in the product is based on the list of primes starting with 2.
Type parameters
- X
-
a type for which there is evidence of Numeric[X].
Value parameters
- f
-
the function (see description above).
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Int => Xclass Objecttrait Matchableclass AnyShow all
This case class represents an infinite sum of terms which can be derived by a function (f) which takes as its parameters the index of the term and the previous value of the term.
This case class represents an infinite sum of terms which can be derived by a function (f) which takes as its parameters the index of the term and the previous value of the term.
Type parameters
- X
-
a type for which there is evidence of Numeric[X].
Value parameters
- f
-
the function (see description above).
- x0
-
the initial value of type X which is used for the first term.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Int => Xclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass DiFuncBase[Double]trait DiFunc[Double]class Objecttrait Matchableclass AnyShow all
- Self type
-
Inverse.type
Attributes
- Supertypes
- Known subtypes
-
class Exp[X]class Identity[X]object DoubleLazyFunctionobject FuzzyLazyFunctionobject IntLazyFunctionobject RationalLazyFunctionclass Product[X]class Sum[X]Show all
Attributes
- Supertypes
-
class DifferentiableFunction[X]trait X => Xclass DiFuncBase[X]trait DiFunc[X]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class ExpDifferentiable[X]
Attributes
- Supertypes
-
trait Apptrait DelayedInitclass Objecttrait Matchableclass Any
- Self type
-
Lab.type
Attributes
- Supertypes
-
trait Apptrait DelayedInitclass Objecttrait Matchableclass Any
- Self type
-
Lab2.type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
LazyDouble.type
Attributes
- Companion
- object
- Supertypes
-
trait Producttrait Equalsclass LazyNumber[Double]trait Serializabletrait Valuable[Double]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object DoubleIsLazyNumber
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LazyFunction.type
This abstract class is the base class for various functions used by LazyNumber algebra. It's not that the functions are lazy, it's that they are used by the LazyNumber module.
This abstract class is the base class for various functions used by LazyNumber algebra. It's not that the functions are lazy, it's that they are used by the LazyNumber module.
Attributes
- Companion
- object
- Supertypes
-
trait X => Xclass Objecttrait Matchableclass Any
- Known subtypes
-
class AndThen[X]class Composed[X]class ComposedDifferentiable[X]class Known[X]class Exp[X]class Identity[X]object DoubleLazyFunctionobject FuzzyLazyFunctionobject IntLazyFunctionobject RationalLazyFunctionclass Product[X]class Sum[X]class Named[X]Show all
Attributes
- Companion
- object
- Supertypes
-
trait Producttrait Equalsclass LazyNumber[Fuzzy]trait Serializableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object FuzzyIsLazyNumber
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LazyNumber.type
LazyNumber is an abstract (base) class for HasValue objects. The value of a LazyNumber is determined by applying the function f to the nominal value x. A LazyNumber is lazy in two senses:
LazyNumber is an abstract (base) class for HasValue objects. The value of a LazyNumber is determined by applying the function f to the nominal value x. A LazyNumber is lazy in two senses:
-
the nominal (initial) value of a LazyNumber is call-by-name so is not evaluated until needed.
-
the any function applied to the number, via map or flatMap, is composed with the existing function such that the actual value is not evaluated until necessary.
Attributes
- Companion
- object
- Supertypes
- Known subtypes
-
class LazyDoubleobject DoubleIsLazyNumberclass LazyFuzzyobject FuzzyIsLazyNumberclass LazyRationalobject RationalIsLazyNumberShow all
Attributes
- Companion
- object
- Supertypes
-
trait Producttrait Equalsclass LazyNumber[Rational]trait Serializableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object RationalIsLazyNumber
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
LazyRational.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass DiFuncBase[Double]trait DiFunc[Double]class Objecttrait Matchableclass AnyShow all
- Self type
-
Negative.type
A case class for solving equations using Newton's approximation method (Newton-Raphson) https://en.wikipedia.org/wiki/Newton%27s_method. Newton-Raphson is a special case of Householder's more general method https://en.wikipedia.org/wiki/Householder%27s_method. CONSIDER implementing Halley's method https://en.wikipedia.org/wiki/Halley%27s_method.
A case class for solving equations using Newton's approximation method (Newton-Raphson) https://en.wikipedia.org/wiki/Newton%27s_method. Newton-Raphson is a special case of Householder's more general method https://en.wikipedia.org/wiki/Householder%27s_method. CONSIDER implementing Halley's method https://en.wikipedia.org/wiki/Halley%27s_method.
Value parameters
- dfByDx
-
The derivative of the function.
- f
-
The function whose root is to be found.
Attributes
- Constructor
-
Creates a new Newton solver with the given function and its derivative.
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A pair of coefficients. The a value is always 1 in the case of a simple Continued Fraction. The b value is always positive (except for the b which precedes a Continue Fraction, which may be negative).
A pair of coefficients. The a value is always 1 in the case of a simple Continued Fraction. The b value is always positive (except for the b which precedes a Continue Fraction, which may be negative).
CONSIDER representing this by a Rational. However, these coefficients are really independent entities.
Value parameters
- a
-
the
avalue. - b
-
the
bvalue.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Apptrait DelayedInitclass Objecttrait Matchableclass Any
- Self type
-
PiMain.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass DiFuncBase[Double]trait DiFunc[Double]class Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Known[X]class LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
NOTE: I have no idea why I wrote this module here.
NOTE: I have no idea why I wrote this module here.
Type parameters
- T
-
the underlying type of RNG.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class BaseRNG[T]class RandomLong
Attributes
- Companion
- object
- Supertypes
- Self type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RandomLong.type
Monadic trait which defines a random-state.
Monadic trait which defines a random-state.
Created by scalaprof on 9/24/16.
Type parameters
- T
-
the underlying type of this random state, i.e. the type of the result of calling get
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class RandomState_Java[T]
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
RandomState.type
A concrete implementation of RandomState based on the Java random number generator
A concrete implementation of RandomState based on the Java random number generator
Type parameters
- T
-
the underlying type of this random state, i.e. the type of the result of calling get
Value parameters
- g
-
the function which maps a Long value into a T
- n
-
the random Long that characterizes this random state
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait RandomState[T]class Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Known[X]class LazyFunction[X]trait X => Xclass Objecttrait Matchableclass AnyShow all
This trait is, essentially, a subset of IterableOnce.
This trait is, essentially, a subset of IterableOnce.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ConFrac
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass DiFuncBase[Double]trait DiFunc[Double]class Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TryUsing.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class LazyNumber[X]class LazyDoubleobject DoubleIsLazyNumberclass LazyFuzzyobject FuzzyIsLazyNumberclass LazyRationalobject RationalIsLazyNumberShow all
Object defining a set of mathematical operations related to variance and statistical computations.
Object defining a set of mathematical operations related to variance and statistical computations.
Attributes
- Supertypes
-
trait Apptrait DelayedInitclass Objecttrait Matchableclass Any
- Self type
-
Variance.type