Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CoMISo
CoMISo
Commits
4171cfa3
Commit
4171cfa3
authored
Jan 19, 2021
by
David Bommes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in constraint conversion for empty constraint vector
parent
ededd54a
Pipeline
#16509
failed with stages
in 4 minutes and 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
NSolver/AugmentedLagrangianMethod.hh
NSolver/AugmentedLagrangianMethod.hh
+2
-1
NSolver/LinearConstraintConverter.hh
NSolver/LinearConstraintConverter.hh
+2
-2
NSolver/TruncatedNewtonPCG.hh
NSolver/TruncatedNewtonPCG.hh
+8
-6
No files found.
NSolver/AugmentedLagrangianMethod.hh
View file @
4171cfa3
...
...
@@ -238,7 +238,8 @@ public:
int
solve_experimental
(
NProblemInterface
*
_problem
,
std
::
vector
<
NConstraintInterface
*>&
_constraints
,
std
::
vector
<
LinearConstraint
>&
_linear_constraints
)
{
DEB_time_func_def
;
DEB_enter_func
;
// DEB_time_func_def;
converged_
=
false
;
DEB_line_if
(
!
silent_
,
2
,
"*** optimize via AugmentedLagrangianMethod with "
<<
_problem
->
n_unknowns
()
<<
" unknowns and "
<<
_constraints
.
size
()
<<
" constraints"
);
...
...
NSolver/LinearConstraintConverter.hh
View file @
4171cfa3
...
...
@@ -70,11 +70,11 @@ public:
// }
template
<
class
SMatrixT
,
class
VectorT
>
static
void
nsolver_to_eigen
(
std
::
vector
<
LinearConstraint
>&
_constraints
,
SMatrixT
&
_A
,
VectorT
&
_b
)
static
void
nsolver_to_eigen
(
std
::
vector
<
LinearConstraint
>&
_constraints
,
SMatrixT
&
_A
,
VectorT
&
_b
,
int
_n_variables
=
0
)
{
if
(
_constraints
.
empty
())
{
_A
.
resize
(
0
,
0
);
_A
.
resize
(
0
,
_n_variables
);
_b
.
resize
(
0
);
return
;
}
...
...
NSolver/TruncatedNewtonPCG.hh
View file @
4171cfa3
...
...
@@ -1145,7 +1145,9 @@ public:
// It is also required that the constraints are linearly independent
int
solve_projected_normal_equation
(
NProblemInterface
*
_problem
,
const
SMatrixD
&
_A
,
const
VectorD
&
_b
)
{
DEB_time_func_def
;
// DEB_time_func_def;
DEB_enter_func
;
converged_
=
false
;
// number of unknowns
...
...
@@ -1396,7 +1398,7 @@ public:
// convert constraints
SMatrixD
A
;
VectorD
b
;
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
);
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
,
_problem
->
n_unknowns
()
);
return
solve
(
_problem
,
A
,
b
);
}
...
...
@@ -1406,7 +1408,7 @@ public:
// convert constraints
SMatrixD
A
;
VectorD
b
;
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
);
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
,
_problem
->
n_unknowns
()
);
return
solve_experimental
(
_problem
,
A
,
b
);
}
...
...
@@ -1416,7 +1418,7 @@ public:
// convert constraints
SMatrixD
A
;
VectorD
b
;
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
);
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
,
_problem
->
n_unknowns
()
);
return
solve_reduced_system
(
_problem
,
A
,
b
);
}
...
...
@@ -1426,7 +1428,7 @@ public:
// convert constraints
SMatrixD
A
;
VectorD
b
;
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
);
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
,
_problem
->
n_unknowns
()
);
return
solve_reduced_system_EigenCG
(
_problem
,
A
,
b
);
}
...
...
@@ -1436,7 +1438,7 @@ public:
// convert constraints
SMatrixD
A
;
VectorD
b
;
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
);
LinearConstraintConverter
::
nsolver_to_eigen
(
_constraints
,
A
,
b
,
_problem
->
n_unknowns
()
);
return
solve_projected_normal_equation
(
_problem
,
A
,
b
);
}
...
...
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