The requirements of Euclidean Vector are very similar to those of Location, and could actually have been represented by a Location. However, an euclidean vector is very different from a point, or location, (from a mathematical point of view) and it would have been confusing to represent these two entities by the same concept.
Default Constructible, Assignable, Equality Comparable
A::coordinate_type
The type of the coordinates pi, . Operations +, -, * must be defined on this type. The coordinate type should also be convertible to type double
A | A type that is a model of Euclidean Vector | |
a, b | Objects of type A | |
C | coordinate type: A::coordinate_type | |
i | object of type unsigned int |
A::dimension
Return type: | int | |
Semantics: | returns the dimension of vectors of type A |
A(a)
Return type: | A | |
Postcondition: | A(a) is a copy of a |
A b(a)
Postcondition: | b is a copy of a |
b = a
Return type: | A | |
Postcondition: | b is a copy of a |
a[i]
Return type: | C | |
Precondition: | ||
Semantics: | returns the ith coordinate of the vector |
a == b
Return type: | bool | |
Semantics: | checks if two vectors are identical |