Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Vector3< T > Class Template Reference

Class managing a 3-dimensional vector of type T. More...

#include <arcane/utils/Vector3.h>

Public Types

using ThatClass = Vector3<T>
using value_type = T

Public Member Functions

constexpr __host__ __device__ Vector3 ()=default
 Constructs the zero vector.
constexpr __host__ __device__ Vector3 (const T &ax, const T &ay, const T &az)
 Constructs the triplet (ax,ay,az).
constexpr __host__ __device__ Vector3 (const T &v)
 Constructs the instance with the triplet (v,v,v).
constexpr Vector3 (const std::array< T, 3 > &v)
 Constructs the instance with the array v.
constexpr Vector3 (std::initializer_list< T > v)
 Constructs the instance with the list v.
constexpr Vector3operator= (std::initializer_list< T > v)
 Positions the instance with the list v.
constexpr __host__ __device__ void operator+= (const T &b)
 Adds b to the instance.
constexpr __host__ __device__ void operator+= (const ThatClass &b)
 Adds b to the instance.
constexpr __host__ __device__ void operator-= (const T &b)
 Subtracts b from the instance.
constexpr __host__ __device__ void operator-= (const ThatClass &b)
 Subtracts b from the instance.
constexpr __host__ __device__ void operator*= (const T &b)
 Multiplies each component of the instance by b.
constexpr __host__ __device__ void operator/= (const T &b)
 Divides each component of the instance by b.
constexpr __host__ __device__ ThatClass operator- () const
 Returns the opposite of the instance.

Public Attributes

x = {}
y = {}
z = {}

Friends

constexpr __host__ __device__ bool operator< (const Vector3< T > &v1, const Vector3< T > &v2)
std::ostream & operator<< (std::ostream &o, const Vector3< T > &t)
 Writes the triplet t to the stream o.
constexpr __host__ __device__ bool operator== (const Vector3< T > &v1, const Vector3< T > &v2)
constexpr __host__ __device__ bool operator!= (const Vector3< T > &v1, const Vector3< T > &v2)
constexpr __host__ __device__ ThatClass operator+ (const ThatClass &a, const ThatClass &b)
 Sums component by component of a and b.
constexpr __host__ __device__ ThatClass operator+ (const ThatClass &a, const T &b)
 Returns a by adding b to each component.
constexpr __host__ __device__ ThatClass operator+ (const T &a, const ThatClass &b)
 Returns b by adding a to each component.
constexpr __host__ __device__ ThatClass operator- (const ThatClass &a, const ThatClass &b)
 Subtracts each component of a by each component of b.
constexpr __host__ __device__ ThatClass operator- (const ThatClass &a, const T &b)
 Subtracts each component of a by b.
constexpr __host__ __device__ ThatClass operator* (const T &a, const ThatClass &b)
 Multiplies each component of b by a.
constexpr __host__ __device__ ThatClass operator* (const ThatClass &a, const T &b)
 Multiplies each component of a by b.
constexpr __host__ __device__ ThatClass operator/ (const ThatClass &a, const T &b)
 Divides each component of a by b.

Detailed Description

template<typename T>
class Arcane::Vector3< T >

Class managing a 3-dimensional vector of type T.

The 3 elements of the vector can be accessed via x, y, or z.

Definition at line 36 of file Vector3.h.

Member Typedef Documentation

◆ ThatClass

template<typename T>
using Arcane::Vector3< T >::ThatClass = Vector3<T>

Definition at line 40 of file Vector3.h.

◆ value_type

template<typename T>
using Arcane::Vector3< T >::value_type = T

Definition at line 41 of file Vector3.h.

Constructor & Destructor Documentation

◆ Vector3() [1/4]

template<typename T>
__host__ __device__ Arcane::Vector3< T >::Vector3 ( const T & ax,
const T & ay,
const T & az )
inlineconstexpr

Constructs the triplet (ax,ay,az).

Definition at line 56 of file Vector3.h.

◆ Vector3() [2/4]

template<typename T>
__host__ __device__ Arcane::Vector3< T >::Vector3 ( const T & v)
inlineexplicitconstexpr

Constructs the instance with the triplet (v,v,v).

Definition at line 64 of file Vector3.h.

◆ Vector3() [3/4]

template<typename T>
Arcane::Vector3< T >::Vector3 ( const std::array< T, 3 > & v)
inlineexplicitconstexpr

Constructs the instance with the array v.

Definition at line 72 of file Vector3.h.

◆ Vector3() [4/4]

template<typename T>
Arcane::Vector3< T >::Vector3 ( std::initializer_list< T > v)
inlineconstexpr

Constructs the instance with the list v.

Definition at line 80 of file Vector3.h.

Member Function Documentation

◆ operator*=()

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator*= ( const T & b)
inlineconstexpr

Multiplies each component of the instance by b.

Definition at line 160 of file Vector3.h.

◆ operator+=() [1/2]

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator+= ( const T & b)
inlineconstexpr

Adds b to the instance.

Definition at line 128 of file Vector3.h.

◆ operator+=() [2/2]

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator+= ( const ThatClass & b)
inlineconstexpr

Adds b to the instance.

Definition at line 136 of file Vector3.h.

◆ operator-()

template<typename T>
__host__ __device__ ThatClass Arcane::Vector3< T >::operator- ( ) const
inlineconstexpr

Returns the opposite of the instance.

Definition at line 206 of file Vector3.h.

◆ operator-=() [1/2]

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator-= ( const T & b)
inlineconstexpr

Subtracts b from the instance.

Definition at line 144 of file Vector3.h.

◆ operator-=() [2/2]

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator-= ( const ThatClass & b)
inlineconstexpr

Subtracts b from the instance.

Definition at line 152 of file Vector3.h.

◆ operator/=()

template<typename T>
__host__ __device__ void Arcane::Vector3< T >::operator/= ( const T & b)
inlineconstexpr

Divides each component of the instance by b.

Definition at line 168 of file Vector3.h.

◆ operator=()

template<typename T>
Vector3 & Arcane::Vector3< T >::operator= ( std::initializer_list< T > v)
inlineconstexpr

Positions the instance with the list v.

Definition at line 86 of file Vector3.h.

◆ operator!=

template<typename T>
__host__ __device__ bool operator!= ( const Vector3< T > & v1,
const Vector3< T > & v2 )
friend

Definition at line 120 of file Vector3.h.

◆ operator* [1/2]

template<typename T>
__host__ __device__ ThatClass operator* ( const T & a,
const ThatClass & b )
friend

Multiplies each component of b by a.

Definition at line 210 of file Vector3.h.

◆ operator* [2/2]

template<typename T>
__host__ __device__ ThatClass operator* ( const ThatClass & a,
const T & b )
friend

Multiplies each component of a by b.

Definition at line 216 of file Vector3.h.

◆ operator+ [1/3]

template<typename T>
__host__ __device__ ThatClass operator+ ( const T & a,
const ThatClass & b )
friend

Returns b by adding a to each component.

Definition at line 188 of file Vector3.h.

◆ operator+ [2/3]

template<typename T>
__host__ __device__ ThatClass operator+ ( const ThatClass & a,
const T & b )
friend

Returns a by adding b to each component.

Definition at line 182 of file Vector3.h.

◆ operator+ [3/3]

template<typename T>
__host__ __device__ ThatClass operator+ ( const ThatClass & a,
const ThatClass & b )
friend

Sums component by component of a and b.

Definition at line 176 of file Vector3.h.

◆ operator- [1/2]

template<typename T>
__host__ __device__ ThatClass operator- ( const ThatClass & a,
const T & b )
friend

Subtracts each component of a by b.

Definition at line 200 of file Vector3.h.

◆ operator- [2/2]

template<typename T>
__host__ __device__ ThatClass operator- ( const ThatClass & a,
const ThatClass & b )
friend

Subtracts each component of a by each component of b.

Definition at line 194 of file Vector3.h.

◆ operator/

template<typename T>
__host__ __device__ ThatClass operator/ ( const ThatClass & a,
const T & b )
friend

Divides each component of a by b.

Definition at line 222 of file Vector3.h.

◆ operator<

template<typename T>
__host__ __device__ bool operator< ( const Vector3< T > & v1,
const Vector3< T > & v2 )
friend

Definition at line 94 of file Vector3.h.

◆ operator<<

template<typename T>
std::ostream & operator<< ( std::ostream & o,
const Vector3< T > & t )
friend

Writes the triplet t to the stream o.

Definition at line 107 of file Vector3.h.

◆ operator==

template<typename T>
__host__ __device__ bool operator== ( const Vector3< T > & v1,
const Vector3< T > & v2 )
friend

Definition at line 114 of file Vector3.h.

Member Data Documentation

◆ x

template<typename T>
T Arcane::Vector3< T >::x = {}

Definition at line 45 of file Vector3.h.

◆ y

template<typename T>
T Arcane::Vector3< T >::y = {}

Definition at line 46 of file Vector3.h.

◆ z

template<typename T>
T Arcane::Vector3< T >::z = {}

Definition at line 47 of file Vector3.h.


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