Scalable

com.phasmidsoftware.number.algebra.core.Scalable
trait Scalable[T <: Scalable[T]]

A trait representing the ability to scale an instance of type T as a whole using an integer multiplier.

This trait defines a contract for types that support a scaling operation, where an instance can be adjusted by multiplying it with an integer. The result of the scaling operation is returned as an Option, allowing implementations to specify cases where scaling may not be valid or possible.

Type parameters

T

the type of the instance that can be scaled

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Algebraic
class Angle
trait ExactNumber
class WholeNumber
class InversePower
class Real
trait Equation
Show all

Members list

Value members

Abstract methods

infix def *(factor: Rational): T

Scales the current instance by the given factor.

Scales the current instance by the given factor.

This method applies a scaling operation on the instance using the provided rational factor and returns the resulting scaled instance.

The result is not guaranteed to be normalized.

Value parameters

factor

the rational number representing the scale factor

Attributes

Returns

the scaled instance of type T

Concrete methods

infix def *(factor: Int): T

Multiplies the current instance by the specified integer factor.

Multiplies the current instance by the specified integer factor.

Value parameters

factor

the integer value to multiply with the current instance

Attributes

Returns

a new instance of type T representing the result of the multiplication