Compadre 1.5.5
Loading...
Searching...
No Matches
Compadre_LinearAlgebra_Declarations.hpp
Go to the documentation of this file.
1#ifndef _COMPADRE_LINEAR_ALGEBRA_DECLARATIONS_HPP_
2#define _COMPADRE_LINEAR_ALGEBRA_DECLARATIONS_HPP_
3
4#include "Compadre_Config.h"
7
8namespace Compadre {
9
10namespace GMLS_LinearAlgebra {
11
12 /*! \brief Calculates two eigenvectors corresponding to two dominant eigenvalues
13 \param teamMember [in] - Kokkos::TeamPolicy member type (created by parallel_for)
14 \param V [out] - dimension * dimension Kokkos View
15 \param PtP [in] - dimension * dimension Kokkos View
16 \param dimensions [in] - dimension of PtP
17 */
18 KOKKOS_INLINE_FUNCTION
19 void largestTwoEigenvectorsThreeByThreeSymmetric(const member_type& teamMember, scratch_matrix_right_type V, scratch_matrix_right_type PtP, const int dimensions, pool_type& random_number_pool);
20
21 /*! \brief Solves a batch of problems with QR+Pivoting
22
23 ~ Note: Very strong assumption on B. ~
24
25 A contains num_matrices * lda * nda data which is num_matrices different (lda x nda) matrices with valid entries of size (M x N), and
26 B contains num_matrices * ldb * ndb data which is num_matrices different (ldb x ndb) right hand sides.
27 B is assumed to have one of two forms:
28 - \f$M==N\f$, the valid entries are the first (N X NRHS)
29 - \f$M>N\f$, the valid entries are the first (NRHS)
30 i.e. for this case, B is intended to store non-zero entries from a diagonal matrix (as a vector). For the \f$k^{th}\f$ matrix, the (m,m) entry of a diagonal matrix would here be stored in the \f$m^{th}\f$ position.
31
32
33
34 \param pm [in] - manager class for team and thread parallelism
35 \param A [in/out] - matrix A (in), meaningless workspace output (out)
36 \param lda [in] - row dimension of each matrix in A
37 \param nda [in] - columns dimension of each matrix in A
38 \param B [in/out] - right hand sides (in), solution (out)
39 \param ldb [in] - row dimension of each matrix in B
40 \param ndb [in] - column dimension of each matrix in B
41 \param M [in] - number of rows containing data (maximum rows over everything in batch) in A
42 \param N [in] - number of columns containing data in each matrix in A
43 \param NRHS [in] - number of columns containing data in each matrix in B
44 \param num_matrices [in] - number of problems
45 \param implicit_RHS [in] - determines whether RHS will be stored implicitly. If true, instead of RHS storing the full sqrt(W) explicitly, only the diagonal entries of sqrt(W) will be stored as a 1D array beginning at entry with matrix coordinate (0,0).
46 */
47 template <typename A_layout=layout_right, typename B_layout=layout_right, typename X_layout=layout_right>
48 void batchQRPivotingSolve(ParallelManager pm, double *A, int lda, int nda, double *B, int ldb, int ndb, int M, int N, int NRHS, const int num_matrices, const bool implicit_RHS = true);
49
50} // GMLS_LinearAlgebra
51} // Compadre
52
53#endif
Kokkos::Random_XorShift64_Pool pool_type
team_policy::member_type member_type
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
KOKKOS_INLINE_FUNCTION void largestTwoEigenvectorsThreeByThreeSymmetric(const member_type &teamMember, scratch_matrix_right_type V, scratch_matrix_right_type PtP, const int dimensions, pool_type &random_number_pool)
Calculates two eigenvectors corresponding to two dominant eigenvalues.
void batchQRPivotingSolve(ParallelManager pm, double *A, int lda, int nda, double *B, int ldb, int ndb, int M, int N, int NRHS, const int num_matrices, const bool implicit_RHS)
Solves a batch of problems with QR+Pivoting.