Skip to content

Commit 89d5f22

Browse files
authored
Algebra (#15)
Add in the interface description the LorentzVectorBase abstract type and option to subtype it in order to benefit from default overriding implementation of +, -, and \cdot.
1 parent 8b2f2d2 commit 89d5f22

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/src/10-interface.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,16 @@ The methods that returns the coordinates of the prefered system (returned by `co
6464
| `LorentzVectorBase.spatial_magnitude2(::MyType{MyLorentzVector})` | mass to the square |
6565
| Any of the above method i.e, a method of option Y when methods of option X are provided ||
6666

67-
=======
67+
## LorentzVectorBase
68+
69+
The type can *optionnally* be a subtype of the LorentzVectorBase.LorentzVectorBase to benefit from default implementations of lorentz vector algebra.
70+
71+
# Basic functions provided for subtypes of LorentzVectorBase
72+
73+
- Base.+(::LorentzVectorBase, ::LorentzVectorBase)
74+
- Base.-(::LorentzVectorBase, ::LorentzVectorBase)
75+
- LinearAlgebra.dot(::LorentzVectorBase, ::LorentzVectorBase)¹
76+
77+
---
78+
¹x⋅y = LinearAlgebra.dot(x,y)
79+

0 commit comments

Comments
 (0)