QUGaR 0.0.4
Loading...
Searching...
No Matches
vector.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------
2//
3// Copyright (C) 2025-present by Pablo Antolin
4//
5// This file is part of the QUGaR library.
6//
7// SPDX-License-Identifier: MIT
8//
9// --------------------------------------------------------------------------
10
11#ifndef QUGAR_VECTOR_HPP
12
13#define QUGAR_VECTOR_HPP
14
21
22
23#include <algoim/uvector.hpp>
24
25namespace qugar {
26
31template<typename T, int dim> using Vector = ::algoim::uvector<T, dim>;
32
33using ::algoim::norm;
34
35using ::algoim::sqrnorm;
36
37using ::algoim::remove_component;
38
39using ::algoim::set_component;
40
41using ::algoim::add_component;
42
43using ::algoim::max;
44
45using ::algoim::min;
46
47using ::algoim::argmax;
48
49using ::algoim::argmin;
50
51using ::algoim::dot;
52
53using ::algoim::prod;
54
55using ::algoim::all;
56
57using ::algoim::any;
58
59
69template<typename T, int dim> Vector<T, dim> permute_vector_directions(const Vector<T, dim> &vec)
70{
71 Vector<T, dim> permuted;
72 for (int dir = 0; dir < dim; ++dir) {
73 permuted(dir) = vec(dim - dir - 1);
74 }
75 return permuted;
76}
77
78
79}// namespace qugar
80
81#endif// QUGAR_VECTOR_HPP
QUGaR's main namespace.
Definition affine_transf.hpp:28
::algoim::uvector< T, dim > Vector
Class representing a vector.
Definition vector.hpp:31
Vector< T, dim > permute_vector_directions(const Vector< T, dim > &vec)
Definition vector.hpp:69