Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
3rd
eigen
Commits
a3f96257
Commit
a3f96257
authored
10 years ago
by
Gael Guennebaud
Browse files
Options
Download
Email Patches
Plain Diff
Fix dynamic allocation in JacobiSVD (regression)
(grafted from 501e6f168055a3d7782730c1ade00b8f853a1a0d)
parent
406efe38
branches/3.2
3.2.10
3.2.9
3.2.8
3.2.7
3.2.6
3.2.5
3.2.4
3.2.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Eigen/src/SVD/JacobiSVD.h
+11
-3
Eigen/src/SVD/JacobiSVD.h
with
11 additions
and
3 deletions
+11
-3
Eigen/src/SVD/JacobiSVD.h
View file @
a3f96257
...
...
@@ -762,6 +762,7 @@ template<typename _MatrixType, int QRPreconditioner> class JacobiSVD
internal
::
qr_preconditioner_impl
<
MatrixType
,
QRPreconditioner
,
internal
::
PreconditionIfMoreColsThanRows
>
m_qr_precond_morecols
;
internal
::
qr_preconditioner_impl
<
MatrixType
,
QRPreconditioner
,
internal
::
PreconditionIfMoreRowsThanCols
>
m_qr_precond_morerows
;
MatrixType
m_scaledMatrix
;
};
template
<
typename
MatrixType
,
int
QRPreconditioner
>
...
...
@@ -808,8 +809,9 @@ void JacobiSVD<MatrixType, QRPreconditioner>::allocate(Index rows, Index cols, u
:
0
);
m_workMatrix
.
resize
(
m_diagSize
,
m_diagSize
);
if
(
m_cols
>
m_rows
)
m_qr_precond_morecols
.
allocate
(
*
this
);
if
(
m_rows
>
m_cols
)
m_qr_precond_morerows
.
allocate
(
*
this
);
if
(
m_cols
>
m_rows
)
m_qr_precond_morecols
.
allocate
(
*
this
);
if
(
m_rows
>
m_cols
)
m_qr_precond_morerows
.
allocate
(
*
this
);
if
(
m_cols
!=
m_cols
)
m_scaledMatrix
.
resize
(
rows
,
cols
);
}
template
<
typename
MatrixType
,
int
QRPreconditioner
>
...
...
@@ -832,7 +834,13 @@ JacobiSVD<MatrixType, QRPreconditioner>::compute(const MatrixType& matrix, unsig
/*** step 1. The R-SVD step: we use a QR decomposition to reduce to the case of a square matrix */
if
(
!
m_qr_precond_morecols
.
run
(
*
this
,
matrix
/
scale
)
&&
!
m_qr_precond_morerows
.
run
(
*
this
,
matrix
/
scale
))
if
(
m_rows
!=
m_cols
)
{
m_scaledMatrix
=
matrix
/
scale
;
m_qr_precond_morecols
.
run
(
*
this
,
m_scaledMatrix
);
m_qr_precond_morerows
.
run
(
*
this
,
m_scaledMatrix
);
}
else
{
m_workMatrix
=
matrix
.
block
(
0
,
0
,
m_diagSize
,
m_diagSize
)
/
scale
;
if
(
m_computeFullU
)
m_matrixU
.
setIdentity
(
m_rows
,
m_rows
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help