Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
bb9a2e85
Commit
bb9a2e85
authored
Nov 23, 2016
by
David Bommes
Browse files
fixed wrong scaling in removal of dependent linear constraints
parent
2fc2771f
Pipeline
#3694
failed with stage
in 6 minutes and 40 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
NSolver/ConstraintTools.cc
View file @
bb9a2e85
...
...
@@ -113,23 +113,28 @@ remove_dependent_linear_constraints_only_linear_equality( std::vector<NConstrain
double
aij
=
A
(
i
,
j
);
if
(
std
::
abs
(
aij
)
<=
_eps
)
{
// constraint is linear dependent
// std::cerr << "drop " << aij << "in row " << i << "and column " << j << std::endl;
// constraint is linearly dependent
row_status
[
i
]
=
0
;
// remove.push_back(i);
if
(
std
::
abs
(
A
(
i
,
n
))
>
_eps
)
std
::
cerr
<<
"Warning: found dependent constraint with nonzero rhs "
<<
A
(
i
,
n
)
<<
std
::
endl
;
}
else
{
// std::cerr << "keep " << aij << "in row " << i << "and column " << j << std::endl;
// constraint is linearly independent
row_status
[
i
]
=
1
;
keep
.
push_back
(
i
);
// normalize
gmm
::
scale
(
A
.
row
(
i
),
1.0
/
aij
);
// update undecided constraints
// copy col
SVectorGMM
col
=
Ac
.
col
(
j
);
// copy row
SVectorGMM
row
;
gmm
::
copy
(
A
.
row
(
i
),
row
);
// iterate over column
typename
gmm
::
linalg_traits
<
SVectorGMM
>::
const_iterator
c_it
=
gmm
::
vect_const_begin
(
col
);
typename
gmm
::
linalg_traits
<
SVectorGMM
>::
const_iterator
c_end
=
gmm
::
vect_const_end
(
col
);
...
...
@@ -141,8 +146,6 @@ remove_dependent_linear_constraints_only_linear_equality( std::vector<NConstrain
int
k
=
c_it
.
index
();
double
s
=
-
(
*
c_it
)
/
aij
;
SVectorGMM
row
;
gmm
::
copy
(
A
.
row
(
i
),
row
);
add_row_simultaneously
(
k
,
s
,
row
,
A
,
Ac
,
_eps
);
// make sure the eliminated entry is 0 on all other rows
A
(
k
,
j
)
=
0
;
...
...
NSolver/NewtonSolver.hh
View file @
bb9a2e85
...
...
@@ -187,6 +187,7 @@ protected:
// DEB_line(2, "-> re-try with regularized constraints...");
std
::
cerr
<<
"Eigen::SparseLU reported problem while factoring KKT system: "
<<
lu_solver_
.
lastErrorMessage
()
<<
std
::
endl
;
//#if COMISO_SUITESPARSE_AVAILABLE
// std::cerr << "Eigen::SparseLU reported problem while factoring KKT system. " << std::endl;
//#else
...
...
Write
Preview
Supports
Markdown
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