VectorSpace

trait VectorSpace[V, @specialized(Int, Long, Float, Double) F] extends CModule[V, F]

A vector space is a group V that can be multiplied by scalars in F that lie in a field. Scalar multiplication must distribute over vector addition

(`x *: (v + w) === x *: v + x *: w`) and scalar addition
(`(x + y) *: v === x *: v + y *: v`). Scalar multiplication by 1 in `F` is an identity function
(`1 *: v === v`). Scalar multiplication is "associative" (`x *: y *: v === (x * y) *: v`).
Companion
object
trait CModule[V, F]
trait RightModule[V, F]
trait LeftModule[V, F]
trait AdditiveCommutativeGroup[V]
trait AdditiveCommutativeMonoid[V]
trait AdditiveCommutativeSemigroup[V]
trait AdditiveGroup[V]
trait AdditiveMonoid[V]
trait AdditiveSemigroup[V]
trait Serializable
class Any

Value members

Concrete methods

def divr(v: V, f: F): V

Inherited methods

override
def additive: CommutativeGroup[V]
Definition Classes
AdditiveCommutativeGroup -> AdditiveCommutativeMonoid -> AdditiveCommutativeSemigroup -> AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveCommutativeGroup
def isZero(a: V)(implicit ev: Eq[V]): Boolean

Tests if a is zero.

Tests if a is zero.

Inherited from
AdditiveMonoid
def minus(x: V, y: V): V
Inherited from
AdditiveGroup
def negate(x: V): V
Inherited from
AdditiveGroup
def plus(x: V, y: V): V
Inherited from
AdditiveSemigroup
def sum(as: IterableOnce[V]): V

Given a sequence of as, compute the sum.

Given a sequence of as, compute the sum.

Inherited from
AdditiveMonoid
override
def sumN(a: V, n: Int): V
Definition Classes
AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveGroup
def timesl(r: F, v: V): V
Inherited from
LeftModule
override
def timesr(v: V, r: F): V
Definition Classes
Inherited from
CModule
override
def trySum(as: IterableOnce[V]): Option[V]
Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveMonoid
def zero: V
Inherited from
AdditiveMonoid

Implicits

Implicits

implicit
def scalar: Field[F]