Loading...
Searching...
No Matches
manipulation.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25// ========================================================================== //
26// LINEAR ALGEBRA PACKAGE //
27// //
28// Functions for basic linear algebra computations. //
29// ========================================================================== //
30// INFO //
31// ========================================================================== //
32// Author : Alessandro Alaia //
33// Data : Sept 26, 2014 //
34// Version : v2.0 //
35// //
36// All rights reserved. //
37// ========================================================================== //
38# ifndef __BITPIT_MANIPULATION_HPP__
39# define __BITPIT_MANIPULATION_HPP__
40
41// ========================================================================== //
42// INCLUDES //
43// ========================================================================== //
44
45// Standard template library
46# include <vector>
47# include <cmath>
48# include <array>
49# include <iostream>
50
51# include "bitpit_operators.hpp"
52
53# include "matrix_utilities.hpp"
54
55namespace bitpit{
56
60namespace linearalgebra{
61
62template <class T>
63void transpose( // Matrix transposition
64 std::vector< std::vector< T > > &, // (input) Input matrix
65 std::vector< std::vector< T > > & // (input/output) Output transpose
66);
67
68template <class T, size_t m, size_t n>
69void transpose( // Matrix transposition
70 std::array< std::array< T, n >, m > &, // (input) Input matrix
71 std::array< std::array< T, m >, n > & // (input/output) Output transpose
72);
73
74template <class T>
75std::vector< std::vector< T > > transpose( // Matrix transposition
76 const std::vector< std::vector< T > > & // (input) Input matrix
77);
78
79template <class T, size_t m, size_t n>
80std::array< std::array< T, m >, n > transpose( // Matrix transposition
81 const std::array< std::array< T, n >, m > & // (input) Input matrix
82);
83
84template <class T>
85void triL( // Lower triangular part extraction
86 std::vector< std::vector< T > > &, // (input) Input matrix
87 std::vector< std::vector< T > > & // (input/output) Lower triangular part
88);
89
90template <class T, size_t m, size_t n>
91void triL( // Extract the lower triangular part
92 std::array< std::array< T, n >, m > &, // (input) Input matrix
93 std::array< std::array< T, n >, m > & // (input/output) Lower triangular part
94);
95
96template <class T>
97void triU( // Extract the upper triangular part
98 std::vector< std::vector< T > > &, // (input) input matrix
99 std::vector< std::vector< T > > & // (input/output) Upper triangular part
100);
101
102template <class T, size_t m, size_t n>
103void triU( // Extract the upper triangular part
104 std::array< std::array< T, n >, m > &, // (input) input matrix
105 std::array< std::array< T, n >, m > & // (input/output) Upper triangular part
106);
107
108}
109
110}
111
112// =================================================================================== //
113// TEMPLATES //
114// =================================================================================== //
115# include "manipulation.tpp"
116
117# endif
void transpose(std::vector< std::vector< T > > &, std::vector< std::vector< T > > &)
void triL(std::vector< std::vector< T > > &, std::vector< std::vector< T > > &)
void triU(std::vector< std::vector< T > > &, std::vector< std::vector< T > > &)
--- layout: doxygen_footer ---