EBGeometry 1.0
Loading...
Searching...
No Matches
EBGeometry_Vec.hpp
Go to the documentation of this file.
1/* EBGeometry
2 * Copyright © 2022 Robert Marskar
3 * Please refer to Copyright.txt and LICENSE in the EBGeometry root directory.
4 */
5
13#ifndef EBGeometry_Vec
14#define EBGeometry_Vec
15
16// Std includes
17#include <array>
18#include <iostream>
19
20// Our includes
22
29template <typename T>
207
218{
219public:
223 friend std::ostream&
224 operator<<(std::ostream& os, const Vec3T<T>& vec)
225 {
226 os << '(' << vec[0] << ',' << vec[1] << ',' << vec[2] << ')';
227
228 return os;
229 }
230
235
242
251
256
262
268
274 unit(const size_t a_dir) noexcept;
275
281
287
293
299 inline constexpr bool
301
307 operator[](size_t i) noexcept;
308
315
320 inline constexpr bool
322
327 inline constexpr bool
329
338
344 inline constexpr bool
346
355
362 inline constexpr bool
364
372
380
388
394
403
412
420
428
437
446
455
464
474
484
492
500
508 inline size_t
510
518 inline size_t
520
528
536
541 std::array<T, 3> m_X;
542};
543
553
564
574
584
591inline T
593
599inline T
601
611
621
631
642
653
662
670
671#include "EBGeometry_NamespaceFooter.hpp"
672
673#include "EBGeometry_VecImplem.hpp"
674
675#endif
Two-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:31
constexpr T length() const noexcept
Compute length of vector.
~Vec2T()=default
Destructor (does nothing)
static constexpr Vec2T< T > min() noexcept
Return minimum possible representative vector.
constexpr T length2() const noexcept
Compute square of vector.
static constexpr Vec2T< T > one() noexcept
Return av vector with x = y = 1.
static constexpr Vec2T< T > max() noexcept
Return maximum possible representative vector.
Vec2T()
Default constructor. Sets the vector to the zero vector.
T x
First component in the vector.
Definition EBGeometry_Vec.hpp:61
constexpr Vec2T(const T &a_x, const T &a_y)
Full constructor.
T y
Second component in the vector.
Definition EBGeometry_Vec.hpp:66
constexpr T dot(const Vec2T &a_other) const noexcept
Dot product operator.
static constexpr Vec2T< T > zero() noexcept
Return av vector with x = y = 0.
Vec2T(const Vec2T &u) noexcept
Copy constructor.
static constexpr Vec2T< T > infinity() noexcept
Return a vector with inf components.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
Vec3T() noexcept
Default constructor. Sets the vector to the zero vector.