Eigen 3.4.90
Main Page
Related Pages
Modules
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
h
i
k
m
n
o
p
q
r
s
t
u
v
Related Functions
o
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
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
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
v
w
x
y
Typedefs
a
b
c
d
e
f
i
l
m
n
r
s
t
u
Macros
_
a
b
c
d
e
f
g
h
l
m
p
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
doc
snippets
LLT_solve.cpp
Go to the documentation of this file.
1
typedef
Matrix<float,Dynamic,2>
DataMatrix
;
2
// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
3
DataMatrix
samples
= DataMatrix::Random(12,2);
4
VectorXf
elevations
= 2*
samples
.col(0) + 3*
samples
.col(1) + VectorXf::Random(12)*0.1;
5
// and let's solve samples * [x y]^T = elevations in least square sense:
6
Matrix<float,2,1>
xy
7
= (
samples
.adjoint() *
samples
).llt().solve((
samples
.adjoint()*
elevations
));
8
cout <<
xy
<< endl;
xy
Matrix< float, 2, 1 > xy
Definition:
LLT_solve.cpp:7
DataMatrix
Matrix< float, Dynamic, 2 > DataMatrix
Definition:
LLT_solve.cpp:1
samples
DataMatrix samples
Definition:
LLT_solve.cpp:3
elevations
VectorXf elevations
Definition:
LLT_solve.cpp:4
Eigen::VectorXf
Matrix< float, Dynamic, 1 > VectorXf
DynamicĂ—1 vector of type float.
Definition:
Matrix.h:501
Code