Scalar

com.phasmidsoftware.number.algebra.eager.Scalar
See theScalar companion trait
object Scalar

The Scalar object is a utility for creating and representing scalar values with dimensional factors, exact or approximate numerical precision, and optional fuzziness (uncertainty or imprecision).

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Scalar.type

Members list

Value members

Concrete methods

Creates a Scalar instance based on the input core.Number. Converts the number into an appropriate scalar representation, either exact or fuzzy, depending on the properties of the input.

Creates a Scalar instance based on the input core.Number. Converts the number into an appropriate scalar representation, either exact or fuzzy, depending on the properties of the input.

CONSIDER moving this up into Structure.

Value parameters

x

the core.Number to be converted into a Scalar. It can be an ExactNumber or a FuzzyNumber, each with specific properties such as value, factor, and optional fuzziness.

Attributes

Returns

the resulting Scalar based on the input number's properties, which encapsulates its exact value, factor, and optional fuzziness.

def createScalar(value: Value, factor: Factor, fuzz: Option[Fuzziness[Double]]): Structure

Creates a Scalar instance based on the given input parameters. The method evaluates the input value and optional fuzziness to determine the appropriate numerical representation (e.g., WholeNumber, Real, RationalNumber) and associates it with the provided factor (e.g., PureNumber, Radian).

Creates a Scalar instance based on the given input parameters. The method evaluates the input value and optional fuzziness to determine the appropriate numerical representation (e.g., WholeNumber, Real, RationalNumber) and associates it with the provided factor (e.g., PureNumber, Radian).

CONSIDER this should return a Scalar. Alternatively, it shoul be moved to Structure and renamed to createStructure.

Value parameters

factor

the dimensional factor associated with the scalar, such as PureNumber, Radian, or other domain-specific factors.

fuzz

an optional fuzziness component representing the uncertainty or imprecision in the numerical value.

value

the numerical value, which can either be a right value for exact numbers (e.g., integers, floating-point values) or a left value for rational or other representations.

Attributes

Returns

the resulting Scalar based on the input values, factor, and optional fuzziness.

Note

Throws an com.phasmidsoftware.number.algebra.util.AlgebraException if called with unsupported factors.

Concrete fields

val logger: Logger
val zero: Scalar

Implicits

Implicits

LatexRenderer for Scalar (general case).

LatexRenderer for Scalar (general case).

Attempts to render based on the concrete type.

Attributes