VectorSpace concept

Description

A vector space is an algebraic structure over a Field of values. It is an AdditiveAbeleanGroup for the addition and has a scalar multiplication.

Refinement of

AdditiveAbeleanGroup.

Associated types

scalar_type: Field over which the vector space is defined

Notation

X A type that is a model of VectorSpace
v,w Object of type X
a object of type convertible to X::scalar_type
0 zero vector, i.e. the identity for the addition
0 zero scalar, i.e. the identity for the addition in the Field X::scalar_type

Definitions

Valid expressions

In addition to those defined by AdditiveAbelianGroup:
Name Expression Type requirements Return type
Scalar multiplication a * v X
Scalar division v / a X
Scalar multiplication v *= a X
Scalar division v /= a X

Expression semantics

Name Expression Precondition Semantics Postcondition
Scalar multiplication a*v
Scalar division v / a a!=0 equivalent to (1/a) * v
Scalar multiplication v*=a v=a*v
Scalar division v/=a a!=0 v=v/a

Complexity guarantees

Invariants

In addition to those of AdditiveAbelianGroup:
Negation -v = (-1)*v

Models

Notes