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
examples
TutorialLinAlgSVDSolve.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <
Eigen/Dense
>
3
4
int
main
()
5
{
6
Eigen::MatrixXf
A
=
Eigen::MatrixXf::Random
(3, 2);
7
std::cout <<
"Here is the matrix A:\n"
<<
A
<< std::endl;
8
Eigen::VectorXf
b
=
Eigen::VectorXf::Random
(3);
9
std::cout <<
"Here is the right hand side b:\n"
<<
b
<< std::endl;
10
std::cout <<
"The least-squares solution is:\n"
11
<<
A
.bdcSvd(
Eigen::ComputeThinU
|
Eigen::ComputeThinV
).solve(
b
) << std::endl;
12
}
b
Array< int, 3, 1 > b
Definition:
Array_variadic_ctor_cxx11.cpp:2
A
MatrixXcf A
Definition:
ComplexEigenSolver_compute.cpp:1
Dense
main
int main()
Definition:
TutorialLinAlgSVDSolve.cpp:4
Eigen::DenseBase::Random
static const RandomReturnType Random()
Definition:
Random.h:114
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition:
Matrix.h:182
Eigen::ComputeThinV
@ ComputeThinV
Definition:
Constants.h:401
Eigen::ComputeThinU
@ ComputeThinU
Definition:
Constants.h:397
Code