Debian Codegraph @

packages/kokkos-kernels/batched/dense/src/KokkosBatched_UTV_Decl.hpp

raw
1 //@HEADER
2 // ************************************************************************
3 //
4 // Kokkos v. 4.0
5 // Copyright (2022) National Technology & Engineering
6 // Solutions of Sandia, LLC (NTESS).
7 //
8 // Under the terms of Contract DE-NA0003525 with NTESS,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12 // See https://kokkos.org/LICENSE for license information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //@HEADER
16 #ifndef KOKKOSBATCHED_UTV_DECL_HPP
17 #define KOKKOSBATCHED_UTV_DECL_HPP
18
19 /// \author Kyungjoo Kim ([email protected])
20
21 #include "KokkosBatched_Util.hpp"
22
23 namespace KokkosBatched {
24
25 ///
26 /// For given A, it performs UTV factorization i.e., UTV = A P^T
27 /// - input:
28 /// - A is m x m real matrix
29 /// - p is m integer vector
30 /// - U is m x m real matrix
31 /// - V is m x m real matrix
32 /// - w is 3*m real vector workspace (contiguous)
33 /// - output:
34 /// - A is overwritten as lower triangular matrix_rank x matrix_rank real
35 /// matrix
36 /// - P^T includes pivot indicies (note that this is different from
37 /// permutation indicies)
38 /// - U is left orthogonal matrix m x matrix_rank
39 /// - V is right orthogonal matrix matrix_rank x m
40 ///
41 /// When A is a full rank i.e., matrix_rank == m, this only compute a QR with
42 /// column pivoting
43 /// - output:
44 /// - A is overwritten as upper triangular matrix
45 /// - P^T includes pivot indicies (note that this is different from
46 /// permutation indicies)
47 /// - U is an orthogonal matrix m x m
48 /// - V is not touched
49 ///
50 /// For the solution of a rank-deficient problem, it is recommended to use
51 /// SolveUTV.
52 ///
53
54 ///
55 /// TeamVector UTV
56 ///
57
58 template <typename MemberType, typename ArgAlgo>
59 struct TeamVectorUTV {
60 template <typename AViewType, typename pViewType, typename UViewType, typename VViewType, typename wViewType>
61 KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const AViewType &A, const pViewType &p,
62 const UViewType &U, const VViewType &V, const wViewType &w,
63 int &matrix_rank);
64 };
65
66 } // namespace KokkosBatched
67
68 #include "KokkosBatched_UTV_TeamVector_Impl.hpp"
69
70 #endif