AdditiveGroup concept

Description

This is the concept for numerical data types used as values in vectors and matrices. It provides addition, and substraction as well as a zero element.

Refinement of

DefaultConstructible, EqualityComparable.

Associated types

Notation

XA type that is a model of AdditiveGroup
YA type that is a model of AdditiveGroup
xObject of type X
yObject of type Y

Definitions

Valid expressions

In addition to those of DefaultConstructible, EqualityComparable:
NameExpressionType requirementsReturn type
Additionx + yX
Additionx += yy is convertible to XX
Negation- xX
Subtractionx - yX
Subtractionx -= yy is convertible to XX

Expression semantics

In addition to those of HasZero DefaultConstructible, EqualityComparable:
Name Expression Precondition Semantics Postcondition
Additionx + y
Additionx += yIs equivalent to x = x + y
Negation- x
Subtractionx - y
Subtractionx -= yIs equivalent to x = x - y

Complexity guarantees

Invariants

Models

Notes