| scalar_type: Field over which the vector space is defined |
| 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 |
| 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 |
| 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 |
| Negation | -v = (-1)*v |