vector-extensions.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 INESC TEC
4  * Copyright (c) 2021 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Code from https://gitlab.inesctec.pt/pmms/ns3-satellite
20  *
21  * Author: Pedro Silva <pmms@inesctec.pt>
22  * Author: Bastien Tauran <bastien.tauran@viveris.fr>
23  */
24 
25 #ifndef SATELLITE_VECTOR_EXTENSIONS_H
26 #define SATELLITE_VECTOR_EXTENSIONS_H
27 
28 #include <ns3/vector.h>
29 
30 namespace ns3
31 {
32 
49 Vector3D operator+(const Vector3D& v1, const Vector3D& v2);
50 
57 Vector3D operator-(const Vector3D& v1, const Vector3D& v2);
58 
65 Vector3D operator*(const Vector3D& vector, double scalar);
66 
73 Vector3D operator*(double scalar, const Vector3D& vector);
74 
81 Vector3D CrossProduct(const Vector3D& v1, const Vector3D& v2);
82 
89 double DotProduct(const Vector3D& v1, const Vector3D& v2);
90 
96 double Magnitude(const Vector3D& vector);
97 
103 double MagnitudeSquared(const Vector3D& vector);
104 
105 } // namespace ns3
106 
107 #endif /* SATELLITE_VECTOR_EXTENSIONS_H */
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Vector3D operator*(const Vector3D &vector, double scalar)
Multiplication between a Vector3D object and a scalar.
double Magnitude(const Vector3D &vector)
Magnitude of a Vector3D object.
double DotProduct(const Vector3D &v1, const Vector3D &v2)
Dot product of two Vector3D objects.
Vector3D operator-(const Vector3D &v1, const Vector3D &v2)
Subtraction of Vector3D objects.
Vector3D operator+(const Vector3D &v1, const Vector3D &v2)
extensions to ns3::Vector3D to support additional operations
double MagnitudeSquared(const Vector3D &vector)
The square of the magnitude of a Vector3D object.
Vector3D CrossProduct(const Vector3D &v1, const Vector3D &v2)
Cross product of two Vector3D objects.