Tests if a
is zero.
Tests if a
is zero.
Given a sequence of as
, sum them using the monoid and return the total.
Given a sequence of as
, sum them using the monoid and return the total.
Given a sequence of as
, sum them using the semigroup and return the total.
Given a sequence of as
, sum them using the semigroup and return the total.
If the sequence is empty, returns None. Otherwise, returns Some(total).
Return a
added with itself n
times.
Return a
added with itself n
times.
A normed vector space is a vector space equipped with a function
norm: V => F
. The main constraint is that the norm of a vector must be scaled linearly when the vector is scaled; that isnorm(k *: v) == k.abs * norm(v)
. Additionally, a normed vector space is also aMetricSpace
, wheredistance(v, w) = norm(v - w)
, and so must obey the triangle inequality.An example of a normed vector space is R^n equipped with the euclidean vector length as the norm.