g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
solvers
csparse
csparse_wrapper.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without
6
// modification, are permitted provided that the following conditions are
7
// met:
8
//
9
// * Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above copyright
12
// notice, this list of conditions and the following disclaimer in the
13
// documentation and/or other materials provided with the distribution.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
#ifndef G2O_CSPARSE_WRAPPER_H
28
#define G2O_CSPARSE_WRAPPER_H
29
30
#include <cstddef>
31
#include <memory>
32
33
#include "
g2o/core/eigen_types.h
"
34
35
namespace
g2o
{
36
namespace
csparse
{
37
38
class
CSparse
{
39
public
:
40
CSparse
();
41
~CSparse
();
42
44
struct
SparseView
{
45
int
&
m
;
46
int
&
n
;
47
int
&
nzmax
;
48
int
*&
p
;
49
int
*&
i
;
50
double
*&
x
;
51
int
&
columnsAllocated
;
52
SparseView
(
int
&
m
,
int
&
n
,
int
&
nzmax
,
int
*&
p
,
int
*&
i
,
double
*&
x
,
53
int
&
columnsAllocated
)
54
:
m
(
m
),
55
n
(
n
),
56
nzmax
(
nzmax
),
57
p
(
p
),
58
i
(
i
),
59
x
(
x
),
60
columnsAllocated
(
columnsAllocated
) {}
61
};
62
64
struct
FactorView
{
65
int
&
n
;
66
int
*&
p
;
67
int
*&
i
;
68
double
*&
x
;
69
int
*&
pinv
;
70
FactorView
(
int
&
n
,
int
*&
p
,
int
*&
i
,
double
*&
x
,
int
*&
pinv
)
71
:
n
(
n
),
p
(
p
),
i
(
i
),
x
(
x
),
pinv
(
pinv
) {}
72
};
73
74
bool
factorize
();
75
bool
hasFactor
()
const
;
76
void
freeFactor
();
77
FactorView
factor
();
78
80
bool
amd
(
const
SparseView&
sparseView
,
VectorXI
& result);
81
82
int
choleskyNz
()
const
;
83
84
bool
solve
(
double
* x,
double
* b)
const
;
85
86
bool
analyze
();
87
bool
analyze_p
(
int
* permutation);
88
89
bool
hasSymbolic
()
const
;
90
void
freeSymbolic
();
91
92
SparseView
sparseView
();
93
bool
writeSparse
(
const
std::string& filename)
const
;
94
95
private
:
96
class
Impl;
97
std::unique_ptr<Impl>
pImpl
;
98
};
99
100
}
// namespace csparse
101
}
// namespace g2o
102
#endif
g2o::csparse::CSparse::freeSymbolic
void freeSymbolic()
Definition
csparse_wrapper.cpp:208
g2o::csparse::CSparse::hasFactor
bool hasFactor() const
Definition
csparse_wrapper.cpp:115
g2o::csparse::CSparse::amd
bool amd(const SparseView &sparseView, VectorXI &result)
compute AMD ordering on the given SparseView, store into result
Definition
csparse_wrapper.cpp:117
g2o::csparse::CSparse::freeFactor
void freeFactor()
Definition
csparse_wrapper.cpp:108
g2o::csparse::CSparse::solve
bool solve(double *x, double *b) const
Definition
csparse_wrapper.cpp:150
g2o::csparse::CSparse::~CSparse
~CSparse()
g2o::csparse::CSparse::CSparse
CSparse()
Definition
csparse_wrapper.cpp:104
g2o::csparse::CSparse::analyze
bool analyze()
Definition
csparse_wrapper.cpp:160
g2o::csparse::CSparse::hasSymbolic
bool hasSymbolic() const
Definition
csparse_wrapper.cpp:204
g2o::csparse::CSparse::factor
FactorView factor()
Definition
csparse_wrapper.cpp:144
g2o::csparse::CSparse::pImpl
std::unique_ptr< Impl > pImpl
Definition
csparse_wrapper.h:97
g2o::csparse::CSparse::sparseView
SparseView sparseView()
Definition
csparse_wrapper.cpp:138
g2o::csparse::CSparse::analyze_p
bool analyze_p(int *permutation)
Definition
csparse_wrapper.cpp:166
g2o::csparse::CSparse::writeSparse
bool writeSparse(const std::string &filename) const
Definition
csparse_wrapper.cpp:215
g2o::csparse::CSparse::factorize
bool factorize()
Definition
csparse_wrapper.cpp:194
g2o::csparse::CSparse::choleskyNz
int choleskyNz() const
Definition
csparse_wrapper.cpp:189
eigen_types.h
g2o::csparse
Definition
csparse_wrapper.cpp:39
g2o
Definition
dl_wrapper.cpp:55
g2o::VectorXI
Eigen::Matrix< int, Eigen::Dynamic, 1, Eigen::ColMajor > VectorXI
Definition
eigen_types.h:41
g2o::csparse::CSparse::FactorView::pinv
int *& pinv
Definition
csparse_wrapper.h:69
g2o::csparse::CSparse::FactorView::p
int *& p
Definition
csparse_wrapper.h:66
g2o::csparse::CSparse::FactorView::x
double *& x
Definition
csparse_wrapper.h:68
g2o::csparse::CSparse::FactorView::i
int *& i
Definition
csparse_wrapper.h:67
g2o::csparse::CSparse::FactorView::n
int & n
Definition
csparse_wrapper.h:65
g2o::csparse::CSparse::FactorView::FactorView
FactorView(int &n, int *&p, int *&i, double *&x, int *&pinv)
Definition
csparse_wrapper.h:70
g2o::csparse::CSparse::SparseView::columnsAllocated
int & columnsAllocated
Definition
csparse_wrapper.h:51
g2o::csparse::CSparse::SparseView::SparseView
SparseView(int &m, int &n, int &nzmax, int *&p, int *&i, double *&x, int &columnsAllocated)
Definition
csparse_wrapper.h:52
g2o::csparse::CSparse::SparseView::x
double *& x
Definition
csparse_wrapper.h:50
g2o::csparse::CSparse::SparseView::i
int *& i
Definition
csparse_wrapper.h:49
g2o::csparse::CSparse::SparseView::p
int *& p
Definition
csparse_wrapper.h:48
g2o::csparse::CSparse::SparseView::nzmax
int & nzmax
Definition
csparse_wrapper.h:47
g2o::csparse::CSparse::SparseView::m
int & m
Definition
csparse_wrapper.h:45
g2o::csparse::CSparse::SparseView::n
int & n
Definition
csparse_wrapper.h:46
Generated on
for g2o by
1.17.0