Eigen-Contrib  5.0.1
 
Loading...
Searching...
No Matches
GpuSparseLDLT.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2026 Rasmus Munk Larsen <rmlarsen@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9// SPDX-License-Identifier: MPL-2.0
10
11// GPU sparse LDL^T / LDL^H factorization via cuDSS, for symmetric indefinite and
12// Hermitian indefinite matrices.
13
14#ifndef EIGEN_GPU_SPARSE_LDLT_H
15#define EIGEN_GPU_SPARSE_LDLT_H
16
17// IWYU pragma: private
18#include "./InternalHeaderCheck.h"
19
20#include "./GpuSparseSolverBase.h"
21
22namespace Eigen {
23namespace gpu {
24
33template <typename Scalar_, int UpLo_ = Lower>
34class SparseLDLT : public internal::SparseSolverBase<Scalar_, SparseLDLT<Scalar_, UpLo_>> {
36 friend Base;
37
38 public:
39 using Scalar = Scalar_;
40 static constexpr int UpLo = UpLo_;
41
42 SparseLDLT() = default;
43
46 explicit SparseLDLT(Context& ctx) : Base(ctx) {}
47
48 template <typename InputType>
49 explicit SparseLDLT(const SparseMatrixBase<InputType>& A) {
50 this->compute(A);
51 }
52
54 template <typename InputType>
55 SparseLDLT(Context& ctx, const SparseMatrixBase<InputType>& A) : Base(ctx) {
56 this->compute(A);
57 }
58
59 static constexpr bool needs_csr_conversion() { return false; }
60 static constexpr cudssMatrixType_t cudss_matrix_type() { return internal::cudss_hermitian_type<Scalar>::value; }
61 static constexpr cudssMatrixViewType_t cudss_matrix_view() {
62 return internal::cudss_view_type<UpLo, ColMajor>::value;
63 }
64};
65
66} // namespace gpu
67} // namespace Eigen
68
69#endif // EIGEN_GPU_SPARSE_LDLT_H
Unified GPU execution context owning a CUDA stream and library handles.
Definition GpuContext.h:81
Definition GpuSparseLDLT.h:34
SparseLDLT(Context &ctx, const SparseMatrixBase< InputType > &A)
Definition GpuSparseLDLT.h:55
SparseLDLT(Context &ctx)
Definition GpuSparseLDLT.h:46
Definition GpuSparseSolverBase.h:139
SparseLDLT< Scalar_, Lower > & compute(const SparseMatrixBase< InputType > &A)
Definition GpuSparseSolverBase.h:223
Namespace containing all symbols from the Eigen library.