Exact

com.phasmidsoftware.lascala.values.Exact
See theExact companion object
case class Exact[T](t: T)(implicit fractionalT: Fractional[T]) extends BaseNumericFuzzy[T]

Concrete class extending Fuzzy which has zero fuzziness.

Type parameters

T

the underlying type of the value: which must support typeclass Fractional

Value parameters

t

the numerical value

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class BaseNumericFuzzy[T]
trait NumericFuzzy[T]
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

class MappedFuzzy[U](f_: BaseNumericFuzzy.this.T => U, g_: BaseNumericFuzzy.this.T => U, val isExact: Boolean)(using evidence$1: Fractional[U]) extends NumericFuzzy[U]

This class is for lazy map operations. However, at present, it is not used.

This class is for lazy map operations. However, at present, it is not used.

Type parameters

U

the underlying type of the result

Value parameters

f_

the value function

g_

the derivative function

isExact

is Exact

Attributes

Inherited from:
BaseNumericFuzzy
Supertypes
trait NumericFuzzy[U]
trait Fuzzy[U]
trait Ordered[Fuzzy[U]]
trait Comparable[Fuzzy[U]]
trait () => U
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def fuzziness: T

Abstract method to yield the fuzziness of this NumericFuzzy object. NOTE: that this method is not promoted to Fuzzy because non-numeric Fuzzy objects don't have a concept of fuzziness.

Abstract method to yield the fuzziness of this NumericFuzzy object. NOTE: that this method is not promoted to Fuzzy because non-numeric Fuzzy objects don't have a concept of fuzziness.

Attributes

Returns

the degree of fuzziness of this Fuzzy object (as an absolute value)

def getP(t: T): Option[Probability]

Abstract method to determine the probability that the nominal value of this Fuzzy object is actually t

Abstract method to determine the probability that the nominal value of this Fuzzy object is actually t

Value parameters

t

the candidate value

Attributes

Returns

the probability (as an Option) that t=apply(). NOTE: that the value of the probability follows the rules described in method p

def isExact: Boolean

Abstract method to determine if this Fuzzy object is exact (i.e. zero fuzziness)

Abstract method to determine if this Fuzzy object is exact (i.e. zero fuzziness)

Attributes

Returns

true if this object is exact, otherwise false

def map[U : Fractional](f: T => U, g: T => U): Fuzzy[U]

Abstract method to map this Fuzzy object into a different Fuzzy object.

Abstract method to map this Fuzzy object into a different Fuzzy object.

Type parameters

U

the underlying type of the result

Value parameters

f

a function T=>U which will be applied to the nominal value of this Fuzzy

g

a function T=>U which will be applied to the fuzzy value of this Fuzzy. NOTE: that the coefficient of delta-T must be positive.

Attributes

Returns

a Fuzzy[U] object

def map2[U : Fractional, V : Fractional](uf: Fuzzy[U])(f: (T, U) => V, g: (T, U) => V): NumericFuzzy[V]

Method to evaluate "map2" for this Fuzzy[T] object

Method to evaluate "map2" for this Fuzzy[T] object

Type parameters

U

the underlying type of the second fuzzy object

V

the underlying type of the resulting fuzzy object.

Value parameters

f

the function which takes a T and a U and returns a V

g

the function which takes a delta-T and a delta-U and returns a delta-V. NOTE: that the coefficients for both the delta-U and the delta-V must be positive.

uf

the Fuzzy[U] object which will be the second fuzzy object

Attributes

Returns

a Fuzzy[V]

def p(t1: T, t2: T)(implicit ev: Ordering[T]): Probability

Abstract method to determine the probability that the nominal value of this Fuzzy object is between t1 and t2 (inclusive).

Abstract method to determine the probability that the nominal value of this Fuzzy object is between t1 and t2 (inclusive).

Value parameters

t1

the lower value

t2

the higher value

Attributes

Returns

a probability

override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function0 -> Any

Inherited methods

def *[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def +[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def -[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def /[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def <(that: Fuzzy[T]): Boolean

Returns true if this is less than that

Returns true if this is less than that

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def <=(that: Fuzzy[T]): Boolean

Returns true if this is less than or equal to that.

Returns true if this is less than or equal to that.

Attributes

Inherited from:
Ordered
def >(that: Fuzzy[T]): Boolean

Returns true if this is greater than that.

Returns true if this is greater than that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def >=(that: Fuzzy[T]): Boolean

Returns true if this is greater than or equal to that.

Returns true if this is greater than or equal to that.

Attributes

Inherited from:
Ordered
override def apply(): T

Applies the body of this function to the arguments.

Applies the body of this function to the arguments.

Attributes

Returns

the result of function application.

Definition Classes
BaseNumericFuzzy -> Function0
Inherited from:
BaseNumericFuzzy
def compare(that: Fuzzy[T]): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Implement this method to determine how instances of A will be sorted.

Returns x where:

  • x &lt; 0 when this &lt; that

  • x == 0 when this == that

  • x > 0 when this > that

Value parameters

that

the instance to compare against

Attributes

Returns

an integer whose sign indicates the ordering relation between this and that

Inherited from:
BaseNumericFuzzy
def compareTo(that: Fuzzy[T]): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def div[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def exp: NumericFuzzy[Double]

Attributes

Inherited from:
BaseNumericFuzzy

Attributes

Inherited from:
BaseNumericFuzzy
def mapFunc[U : Fractional](f: T => U, dfbydx: T => U): NumericFuzzy[U]

Convenience method to invoke map on a NumericFuzzy such that the result is also a NumericFuzzy

Convenience method to invoke map on a NumericFuzzy such that the result is also a NumericFuzzy

Type parameters

U

the underlying type of the result

Value parameters

dfbydx

a function T=>U which will be applied to the nominal value of this Fuzzy.

f

a function T=>U which will be applied to the nominal value of this Fuzzy

Attributes

Returns

a NumericFuzzy[U] object

Inherited from:
BaseNumericFuzzy
def mapFuncExp[U : Fractional](f: T => U, dfbydx: T => U)(unity: Boolean): NumericFuzzy[U]

Convenience method to invoke map on a NumericFuzzy such that the result is also a NumericFuzzy, but with the possibility of creating an Exact(1)

Convenience method to invoke map on a NumericFuzzy such that the result is also a NumericFuzzy, but with the possibility of creating an Exact(1)

Type parameters

U

the underlying type of the result

Value parameters

dfbydx

a function T=>U which will be applied to the nominal value of this Fuzzy.

f

a function T=>U which will be applied to the nominal value of this Fuzzy

unity

if true then an Exact(1) will be returned, otherwise we delegate to mapFunc

Attributes

Returns

a NumericFuzzy[U] object

Inherited from:
BaseNumericFuzzy
def minus[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy

Attributes

Inherited from:
BaseNumericFuzzy
def p(t: T): Probability

Method to return EITHER the Probability of the nominal value of this Fuzzy being the same as t. OR (if T is continuous Numeric, such as Double) the probability density function at t.

Method to return EITHER the Probability of the nominal value of this Fuzzy being the same as t. OR (if T is continuous Numeric, such as Double) the probability density function at t.

Value parameters

t

the value of t for which we wish to evaluate the probability of it matching the nominal value.

Attributes

Returns

either a finite Probability or the value of the probability density function at t.

Inherited from:
Fuzzy
def plus[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def power(e: Double): NumericFuzzy[Double]

Attributes

Inherited from:
BaseNumericFuzzy
def power(e: Int): NumericFuzzy[T]

Attributes

Inherited from:
BaseNumericFuzzy
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
def times[U : Fractional, V : Fractional](uf: Fuzzy[U]): NumericFuzzy[V]

Attributes

Inherited from:
BaseNumericFuzzy
def toDouble: Double

Method to yield the nominal value as a Double

Method to yield the nominal value as a Double

Attributes

Returns

the nominal value of this NumericFuzzy.

Inherited from:
BaseNumericFuzzy