CanMultiply

com.phasmidsoftware.number.algebra.core.CanMultiply
trait CanMultiply[T <: Structure, U <: Structure] extends Can[T]

Represents a trait that extends the capabilities of mathematical structures defined by T and U to support multiplication operations within an algebraic framework.

This trait builds upon the foundational traits Can, CanAddAndSubtract, and CanScale, adding multiplicative behavior and related utilities. It defines operations such as obtaining the multiplicative identity, performing multiplication, and combining structures in a multiplicative context with optional compatibility checks.

It's conceivable that some algebraic structures might support multiplication but not addition.

Type parameters

T

the type of structure that supports multiplication, bounded by Structure and requiring a ClassTag

U

a secondary structure type used in combinatory operations, also bounded by Structure

Attributes

Graph
Supertypes
trait Can[T]
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def one: T

Returns the multiplicative identity element of type T in the context of a structure that supports multiplication.

Returns the multiplicative identity element of type T in the context of a structure that supports multiplication.

Attributes

Returns

the instance of type T that acts as the identity element for multiplication

Concrete methods

def *(that: T)(using MultiplicativeMonoid[T]): T

Multiplies the current instance of type T with another instance of type T, using the provided MultiplicativeMonoid context.

Multiplies the current instance of type T with another instance of type T, using the provided MultiplicativeMonoid context.

Value parameters

that

the instance of type T to be multiplied with the current instance.

Attributes

Returns

the result of multiplying the current instance by the given instance of type T.

Inherited methods

def asT: T

Casts the current instance to the type parameter T of the enclosing Can trait.

Casts the current instance to the type parameter T of the enclosing Can trait.

This method performs a type-safe cast using the ClassTag to verify at runtime that the cast is valid. If the current instance cannot be cast to type T, an AlgebraException is thrown.

Attributes

Returns

the current instance as an instance of type T

Throws
AlgebraException

if the cast is invalid

Inherited from:
Can