OpenMEEG
Loading...
Searching...
No Matches
OpenMEEGMaths
include
matop.h
Go to the documentation of this file.
1
// Project Name: OpenMEEG (http://openmeeg.github.io)
2
// © INRIA and ENPC under the French open source license CeCILL-B.
3
// See full copyright notice in the file LICENSE.txt
4
// If you make a copy of this file, you must either:
5
// - provide also LICENSE.txt and modify this header to refer to it.
6
// - replace this header by the LICENSE.txt content.
7
8
#pragma once
9
10
#include "
matrix.h
"
11
#include "
sparse_matrix.h
"
12
13
namespace
OpenMEEG
{
14
15
inline
Matrix
16
nullspace_projector
(
const
Matrix
& M) {
17
const
size_t
Nl = M.
nlin
();
18
const
size_t
Nc = M.
ncol
();
19
20
Matrix
U,V;
21
SparseMatrix
D;
22
M.
svd
(U,D,V);
23
24
// Set S to 0 everywhere, except in the last part of the diag:
25
26
SparseMatrix
S(Nc,Nc);
27
for
(
unsigned
i=Nl;i<Nc;++i)
28
S(i,i) = 1.0;
29
30
return
(V.
transpose
()*S)*V;
// P is a projector: P^2 = P and mat*P*X = 0
31
}
32
}
OpenMEEG::LinOpInfo::nlin
Dimension nlin() const
Definition:
linop.h:48
OpenMEEG::LinOpInfo::ncol
virtual Dimension ncol() const
Definition:
linop.h:51
OpenMEEG::Matrix
Matrix class Matrix class.
Definition:
matrix.h:28
OpenMEEG::Matrix::svd
void svd(Matrix &U, SparseMatrix &S, Matrix &V, const bool complete=true) const
OpenMEEG::Matrix::transpose
Matrix transpose() const
OpenMEEG::SparseMatrix
Definition:
sparse_matrix.h:26
matrix.h
OpenMEEG
Definition:
analytics.h:14
OpenMEEG::nullspace_projector
Matrix nullspace_projector(const Matrix &M)
Definition:
matop.h:16
sparse_matrix.h
Generated by
1.9.6