GammaLib 2.0.0
Loading...
Searching...
No Matches
GVector.hpp File Reference

Vector class interface definition. More...

#include <cmath>
#include <string>
#include "GBase.hpp"
#include "GException.hpp"

Go to the source code of this file.

Classes

class  GVector
 Vector class. More...
 

Functions

GVector operator+ (const GVector &a, const GVector &b)
 Add two vectors.
 
GVector operator+ (const GVector &vector, const double &scalar)
 Add scalar to vector.
 
GVector operator+ (const double &scalar, const GVector &vector)
 Add scalar to vector.
 
GVector operator- (const GVector &a, const GVector &b)
 Subtract vector from vector.
 
GVector operator- (const GVector &vector, const double &scalar)
 Subtract scalar from vector.
 
GVector operator- (const double &scalar, const GVector &vector)
 Subtract vector from scalar.
 
GVector operator* (const GVector &vector, const double &scalar)
 Multiply vector by scalar.
 
GVector operator* (const double &scalar, const GVector &vector)
 Multiply vector by scalar.
 
GVector operator/ (const GVector &vector, const double &scalar)
 Divide vector by scalar.
 

Detailed Description

Vector class interface definition.

Author
Juergen Knoedlseder

Definition in file GVector.hpp.

Function Documentation

◆ operator*() [1/2]

GVector operator* ( const double & scalar,
const GVector & vector )
inline

Multiply vector by scalar.

Parameters
[in]scalarScalar.
[in]vectorVector.
Returns
Vector for which all elements have be multiplied by scalar.

Returns a vector for which all elements have be multiplied by scalar.

Definition at line 322 of file GVector.hpp.

◆ operator*() [2/2]

GVector operator* ( const GVector & vector,
const double & scalar )
inline

Multiply vector by scalar.

Parameters
[in]vectorVector.
[in]scalarScalar.
Returns
Vector for which all elements have be multiplied by scalar.

Returns a vector for which all elements have be multiplied by scalar.

Definition at line 304 of file GVector.hpp.

◆ operator+() [1/3]

GVector operator+ ( const double & scalar,
const GVector & vector )
inline

Add scalar to vector.

Parameters
[in]scalarScalar.
[in]vectorVector.
Returns
Vector with scalar added to all elements.

Returns a vector for which the scalar has been added to all elements.

Definition at line 230 of file GVector.hpp.

◆ operator+() [2/3]

GVector operator+ ( const GVector & a,
const GVector & b )
inline

Add two vectors.

Parameters
[in]aVector.
[in]bVector.
Returns
Sum of vectors a and b.

Returns the sum of vectors a and b.

Definition at line 194 of file GVector.hpp.

◆ operator+() [3/3]

GVector operator+ ( const GVector & vector,
const double & scalar )
inline

Add scalar to vector.

Parameters
[in]vectorVector.
[in]scalarScalar.
Returns
Vector with scalar added to all elements.

Returns a vector for which the scalar has been added to all elements.

Definition at line 212 of file GVector.hpp.

◆ operator-() [1/3]

GVector operator- ( const double & scalar,
const GVector & vector )
inline

Subtract vector from scalar.

Parameters
[in]scalarScalar.
[in]vectorVector.
Returns
Vector with all elements subtracted from scalar.

Returns a vector for which all elements have been subtracted from the scalar.

Definition at line 286 of file GVector.hpp.

◆ operator-() [2/3]

GVector operator- ( const GVector & a,
const GVector & b )
inline

Subtract vector from vector.

Parameters
[in]aVector.
[in]bVector.
Returns
Difference between vector a and b.

Returns the difference between vector a and b.

Definition at line 248 of file GVector.hpp.

◆ operator-() [3/3]

GVector operator- ( const GVector & vector,
const double & scalar )
inline

Subtract scalar from vector.

Parameters
[in]vectorVector.
[in]scalarScalar.
Returns
Vector with scalar subtracted from all elements.

Returns a vector for which the scalar has been subtracted from all elements.

Definition at line 267 of file GVector.hpp.

◆ operator/()

GVector operator/ ( const GVector & vector,
const double & scalar )
inline

Divide vector by scalar.

Parameters
[in]vectorVector.
[in]scalarScalar.
Returns
Vector for which all elements have be divided by scalar.

Returns a vector for which all elements have be divided by scalar.

Definition at line 340 of file GVector.hpp.