Abstract supertype of types that support scaling by a numeric factor. Examples of such types include vectors and matrices. The scale operator ** accepts a scale factor as its first operand, and an instance of Scalable as its second operand.

Vector scaled = 2.0 ** Vector(x,y,z);

Concrete classes which implement this interface should satisfy:

  • x == 1**x
  • a ** (b ** x) == a*b ** x

where 1 denotes the multiplicative identity of the numeric scaling type.

Concrete classes which implement this interface are encouraged to also satisfy Invertible, in which case, the following identity should be satisfied:

  • -x == -1**x

Concrete classes which implement this interface and which also satisfy Summable should satisfy:

  • x+x == 2**x
  • a ** (x+y) == a**x + a**y

The Scale must be a numeric type, but is not required to be Number, since a complex number scaling type should be allowed.

By: Gavin

no type hierarchy

no supertypes hierarchy

no subtypes hierarchy

Inherited Attributes
Attributes inherited from: Object
Methods
scaleSource Codeshared formal Value scale(Scale scalar)

Scale this value by the given scale factor.

Inherited Methods
Methods inherited from: Object