Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
c
d
e
f
g
i
k
l
m
n
p
q
r
s
t
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Classes
Class List
Class Hierarchy
Class Members
All
!
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
!
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
f
k
l
m
n
o
p
r
s
t
v
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
:
a
b
c
d
e
g
h
i
l
m
n
o
p
r
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
x
z
Enumerations
Enumerator
b
c
e
f
g
i
l
m
n
o
p
r
s
t
u
v
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
gtsam
3rdparty
Spectra
MatOp
internal
SymGEigsShiftInvertOp.h
Go to the documentation of this file.
1
// Copyright (C) 2020-2025 Yixuan Qiu <yixuan.qiu@cos.name>
2
//
3
// This Source Code Form is subject to the terms of the Mozilla
4
// Public License v. 2.0. If a copy of the MPL was not distributed
5
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7
#ifndef SPECTRA_SYM_GEIGS_SHIFT_INVERT_OP_H
8
#define SPECTRA_SYM_GEIGS_SHIFT_INVERT_OP_H
9
10
#include <Eigen/Core>
11
12
#include "../SymShiftInvert.h"
13
#include "../SparseSymMatProd.h"
14
15
namespace
Spectra
{
16
26
template
<
typename
OpType = SymShiftInvert<
double
>,
27
typename
BOpType = SparseSymMatProd<
double
>>
28
class
SymGEigsShiftInvertOp
29
{
30
public
:
31
using
Scalar
=
typename
OpType::Scalar
;
32
33
private
:
34
using
Index
=
Eigen::Index
;
35
using
Vector
=
Eigen::Matrix<Scalar, Eigen::Dynamic, 1>
;
36
37
OpType&
m_op
;
38
const
BOpType&
m_Bop
;
39
mutable
Vector
m_cache
;
// temporary working space
40
41
public
:
48
SymGEigsShiftInvertOp
(OpType& op,
const
BOpType& Bop) :
49
m_op
(op),
m_Bop
(Bop),
m_cache
(op.
rows
())
50
{}
51
55
SymGEigsShiftInvertOp
(
SymGEigsShiftInvertOp
&&
other
) :
56
m_op
(
other
.
m_op
),
m_Bop
(
other
.
m_Bop
)
57
{
58
// We emulate the move constructor for Vector using Vector::swap()
59
m_cache
.
swap
(
other
.m_cache);
60
}
61
65
Index
rows
()
const
{
return
m_op
.rows(); }
69
Index
cols
()
const
{
return
m_op
.rows(); }
70
74
void
set_shift
(
const
Scalar
&
sigma
)
75
{
76
m_op
.set_shift(
sigma
);
77
}
78
85
// y_out = inv(A - sigma * B) * B * x_in
86
void
perform_op
(
const
Scalar
* x_in,
Scalar
* y_out)
const
87
{
88
m_Bop
.perform_op(x_in,
m_cache
.
data
());
89
m_op
.perform_op(
m_cache
.
data
(), y_out);
90
}
91
};
92
93
}
// namespace Spectra
94
95
#endif // SPECTRA_SYM_GEIGS_SHIFT_INVERT_OP_H
Spectra::SymGEigsShiftInvertOp
Definition:
SymGEigsShiftInvertOp.h:28
Eigen::PlainObjectBase::swap
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase< OtherDerived > &other)
Definition:
PlainObjectBase.h:953
sampling::sigma
static const double sigma
Definition:
testGaussianBayesNet.cpp:170
Spectra::SymGEigsShiftInvertOp::Index
Eigen::Index Index
Definition:
SymGEigsShiftInvertOp.h:34
Spectra::SymGEigsShiftInvertOp::perform_op
void perform_op(const Scalar *x_in, Scalar *y_out) const
Definition:
SymGEigsShiftInvertOp.h:86
Spectra::SymGEigsShiftInvertOp::m_cache
Vector m_cache
Definition:
SymGEigsShiftInvertOp.h:39
Spectra::SymGEigsShiftInvertOp::Scalar
typename OpType::Scalar Scalar
Definition:
SymGEigsShiftInvertOp.h:31
Spectra::SymGEigsShiftInvertOp::set_shift
void set_shift(const Scalar &sigma)
Definition:
SymGEigsShiftInvertOp.h:74
Spectra::SymGEigsShiftInvertOp::m_op
OpType & m_op
Definition:
SymGEigsShiftInvertOp.h:37
Spectra::SymGEigsShiftInvertOp::SymGEigsShiftInvertOp
SymGEigsShiftInvertOp(SymGEigsShiftInvertOp &&other)
Definition:
SymGEigsShiftInvertOp.h:55
Spectra
Definition:
LOBPCGSolver.h:19
Eigen::PlainObjectBase::data
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
Definition:
PlainObjectBase.h:247
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >
Spectra::SymGEigsShiftInvertOp::m_Bop
const BOpType & m_Bop
Definition:
SymGEigsShiftInvertOp.h:38
Spectra::SymGEigsShiftInvertOp::cols
Index cols() const
Definition:
SymGEigsShiftInvertOp.h:69
Spectra::SymGEigsShiftInvertOp::SymGEigsShiftInvertOp
SymGEigsShiftInvertOp(OpType &op, const BOpType &Bop)
Definition:
SymGEigsShiftInvertOp.h:48
pybind_wrapper_test_script.other
other
Definition:
pybind_wrapper_test_script.py:42
Spectra::SymGEigsShiftInvertOp::rows
Index rows() const
Definition:
SymGEigsShiftInvertOp.h:65
Scalar
SCALAR Scalar
Definition:
bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition:
Meta.h:74
gtsam
Author(s):
autogenerated on Thu Apr 10 2025 03:04:25