Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
7985c829
Commit
7985c829
authored
4 years ago
by
podlesny
Browse files
Options
Downloads
Patches
Plain Diff
icorporate scaled direction from DirectionalRestriction
parent
2bbd7ca0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/tectonic/spatial-solving/tnnmg/linesearchsolver.hh
+17
-5
17 additions, 5 deletions
dune/tectonic/spatial-solving/tnnmg/linesearchsolver.hh
with
17 additions
and
5 deletions
dune/tectonic/spatial-solving/tnnmg/linesearchsolver.hh
+
17
−
5
View file @
7985c829
...
...
@@ -16,25 +16,37 @@ class LineSearchSolver
public:
template
<
class
Vector
,
class
Functional
,
class
BitVector
>
void
operator
()(
Vector
&
x
,
const
Functional
&
f
,
const
BitVector
&
ignore
)
const
{
x
=
0
;
x
=
1.
0
;
if
(
ignore
)
return
;
/*
Dune::Solvers::Interval<double> D;
Dune
::
Solvers
::
Interval
<
double
>
D
;
D
=
f
.
subDifferential
(
0
);
std
::
cout
<<
"f.A "
<<
f
.
quadraticPart
()
<<
" f.b "
<<
f
.
linearPart
()
<<
std
::
endl
;
std
::
cout
<<
D
[
0
]
<<
" "
<<
D
[
1
]
<<
std
::
endl
;
std
::
cout
<<
"domain: "
<<
f
.
domain
()[
0
]
<<
" "
<<
f
.
domain
()[
1
]
<<
std
::
endl
;
if
(
D
[
1
]
>
0
)
// NOTE: Numerical instability can actually get us here
return
;
*/
if
(
almost_equal
(
f
.
domain
()[
0
],
f
.
domain
()[
1
],
2
))
{
x
=
f
.
domain
()[
0
];
std
::
cout
<<
"no interval: "
<<
x
<<
std
::
endl
;
return
;
}
int
bisectionsteps
=
0
;
const
Bisection
globalBisection
(
0.0
,
1.0
,
0.0
,
0.0
);
;
const
Bisection
globalBisection
;
//
(0.0, 1.0, 0.0, 0.0);
x
=
globalBisection
.
minimize
(
f
,
0.0
,
0.0
,
bisectionsteps
);
x
=
globalBisection
.
minimize
(
f
,
f
.
scaling
(),
0.0
,
bisectionsteps
);
std
::
cout
<<
"x: "
<<
x
<<
"scaling: "
<<
f
.
scaling
();
x
/=
f
.
scaling
();
std
::
cout
<<
"final x: "
<<
x
<<
std
::
endl
;
//x = f.domain().projectIn(x);
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment