From 89d5f2203b51dbad3aad61fadb7961550d37a7f6 Mon Sep 17 00:00:00 2001 From: Philippe Gras Date: Wed, 2 Oct 2024 23:08:04 +0200 Subject: [PATCH] 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. --- docs/src/10-interface.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/src/10-interface.md b/docs/src/10-interface.md index 404e42a..3754c99 100644 --- a/docs/src/10-interface.md +++ b/docs/src/10-interface.md @@ -64,4 +64,16 @@ The methods that returns the coordinates of the prefered system (returned by `co | `LorentzVectorBase.spatial_magnitude2(::MyType{MyLorentzVector})` | mass to the square | | Any of the above method i.e, a method of option Y when methods of option X are provided || -======= +## LorentzVectorBase + +The type can *optionnally* be a subtype of the LorentzVectorBase.LorentzVectorBase to benefit from default implementations of lorentz vector algebra. + +# Basic functions provided for subtypes of LorentzVectorBase + +- Base.+(::LorentzVectorBase, ::LorentzVectorBase) +- Base.-(::LorentzVectorBase, ::LorentzVectorBase) +- LinearAlgebra.dot(::LorentzVectorBase, ::LorentzVectorBase)¹ + +--- +¹x⋅y = LinearAlgebra.dot(x,y) +