maliput
Vector4 Class Reference

Detailed Description

A 4-dimensional vector.

#include <include/maliput/math/vector.h>

Inheritance diagram for Vector4:
[legend]

Public Member Functions

 Vector4 ()
 Constructs a null 4-dimensional vector. More...
 
 Vector4 (std::initializer_list< double > values)
 Constructs a 4-dimensional vector using initializing list;. More...
 
 Vector4 (std::array< double, 4 > values)
 Constructs a 4-dimensional vector from a std::array object;. More...
 
 Vector4 (double x, double y, double z, double w)
 Constructs a 4-dimensional from double type arguments.;. More...
 
 Vector4 (const Vector< 4 > &other)
 Constructs a Vector4 from a Vector<4>. More...
 
double x () const
 
double y () const
 
double z () const
 
double w () const
 
doublex ()
 
doubley ()
 
doublez ()
 
doublew ()
 
- Public Member Functions inherited from VectorBase< 4, Vector4 >
 VectorBase ()
 Constructs a null N-dimensional vector. More...
 
 VectorBase (std::array< double, N > values)
 Constructs an N-dimensional vector from a std::array object;. More...
 
 VectorBase (std::initializer_list< double > values)
 Constructs an N-dimensional vector using initializing list;. More...
 
 VectorBase (const VectorBase< N, Vector4 > &other)=default
 Copy constructor. More...
 
 VectorBase (VectorBase< N, Vector4 > &&other)=default
 Move constructor. More...
 
double dot (const VectorBase< N, Vector4 > &vector) const
 
double norm () const
 
void normalize ()
 Divides each vector component by norm(). More...
 
Vector4 normalized () const
 
std::size_t size () const
 
std::array< double, N > to_array () const
 
Vector4operator= (const VectorBase< N, Vector4 > &other)
 Assignment operator overload. More...
 
Vector4operator= (const VectorBase< N, Vector4 > &&other)
 Move assignment operator overload. More...
 
double operator[] (std::size_t index) const
 Constant subscripting array operator overload. More...
 
doubleoperator[] (std::size_t index)
 Subscripting array operator overload. More...
 
bool operator== (const VectorBase< N, Vector4 > &vector) const
 Equality operator overload. More...
 
bool operator!= (const VectorBase< N, Vector4 > &vector) const
 Inequality operator overload. More...
 
Vector4 operator+ (const VectorBase< N, Vector4 > &vector) const
 Add operator overload. More...
 
Vector4operator+= (const VectorBase< N, Vector4 > &vector)
 Add and assignment operator overload. More...
 
Vector4 operator- (const VectorBase< N, Vector4 > &vector) const
 Substract operator overload. More...
 
Vector4 operator/ (double scalar) const
 Divide operator overload between a VectorBase<N, Derived> vector and a double. More...
 
std::string to_str () const
 

Static Public Member Functions

static Vector4 UnitX ()
 
static Vector4 UnitY ()
 
static Vector4 UnitZ ()
 
static Vector4 UnitW ()
 
- Static Public Member Functions inherited from VectorBase< 4, Vector4 >
static Vector4 Zero ()
 
static Vector4 Ones ()
 
static Vector4 FromStr (const std::string &vector_str)
 Parses vector_str that should come in the following format "{A, B, C, ...}" (white spaces could or could not be there). More...
 

Additional Inherited Members

- Static Public Attributes inherited from VectorBase< 4, Vector4 >
static constexpr std::size_t kDimension
 The dimension of the vector. More...
 
- Protected Attributes inherited from VectorBase< 4, Vector4 >
std::array< double, N > values_
 

Constructor & Destructor Documentation

◆ Vector4() [1/5]

Vector4 ( )

Constructs a null 4-dimensional vector.

◆ Vector4() [2/5]

Vector4 ( std::initializer_list< double values)

Constructs a 4-dimensional vector using initializing list;.

◆ Vector4() [3/5]

Vector4 ( std::array< double, 4 >  values)

Constructs a 4-dimensional vector from a std::array object;.

◆ Vector4() [4/5]

Vector4 ( double  x,
double  y,
double  z,
double  w 
)

Constructs a 4-dimensional from double type arguments.;.

◆ Vector4() [5/5]

Vector4 ( const Vector< 4 > &  other)

Constructs a Vector4 from a Vector<4>.

Member Function Documentation

◆ UnitW()

Vector4 UnitW ( )
static
Returns
An unitary 4-dimensional vector with direction at w axis.

◆ UnitX()

Vector4 UnitX ( )
static
Returns
An unitary 4-dimensional vector with direction at x axis.

◆ UnitY()

Vector4 UnitY ( )
static
Returns
An unitary 4-dimensional vector with direction at y axis.

◆ UnitZ()

Vector4 UnitZ ( )
static
Returns
An unitary 4-dimensional vector with direction at z axis.

◆ w() [1/2]

double& w ( )
Returns
The w value by reference.

◆ w() [2/2]

double w ( ) const
Returns
The w value.

◆ x() [1/2]

double& x ( )
Returns
The x value by reference.

◆ x() [2/2]

double x ( ) const
Returns
The x value.

◆ y() [1/2]

double& y ( )
Returns
The y value by reference.

◆ y() [2/2]

double y ( ) const
Returns
The y value.

◆ z() [1/2]

double& z ( )
Returns
The z value by reference.

◆ z() [2/2]

double z ( ) const
Returns
The z value.

The documentation for this class was generated from the following files: