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
52ffd3f9
Commit
52ffd3f9
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Whitespace, typedef
parent
2f1b9c5b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bisection-example-new.cc
+6
-5
6 additions, 5 deletions
src/bisection-example-new.cc
with
6 additions
and
5 deletions
src/bisection-example-new.cc
+
6
−
5
View file @
52ffd3f9
...
@@ -97,10 +97,11 @@ class SampleFunctional {
...
@@ -97,10 +97,11 @@ class SampleFunctional {
template
<
class
Functional
>
template
<
class
Functional
>
void
minimise
(
const
Functional
J
,
const
typename
Functional
::
SmallVector
x
,
void
minimise
(
const
Functional
J
,
const
typename
Functional
::
SmallVector
x
,
typename
Functional
::
SmallVector
&
corr
)
{
typename
Functional
::
SmallVector
&
corr
)
{
typename
Functional
::
SmallVector
descDir
=
J
.
descentDirection
(
x
);
typedef
typename
Functional
::
SmallVector
SmallVector
;
SmallVector
descDir
=
J
.
descentDirection
(
x
);
if
(
descDir
==
typename
Functional
::
SmallVector
(
0.0
))
{
if
(
descDir
==
SmallVector
(
0.0
))
{
corr
=
typename
Functional
::
SmallVector
(
0.0
);
corr
=
SmallVector
(
0.0
);
return
;
return
;
}
}
...
@@ -112,7 +113,7 @@ void minimise(const Functional J, const typename Functional::SmallVector x,
...
@@ -112,7 +113,7 @@ void minimise(const Functional J, const typename Functional::SmallVector x,
since A is symmetric.
since A is symmetric.
*/
*/
typename
Functional
::
SmallVector
tmp
;
SmallVector
tmp
;
J
.
A
.
mv
(
descDir
,
tmp
);
// Av
J
.
A
.
mv
(
descDir
,
tmp
);
// Av
double
const
JRestA
=
tmp
*
descDir
;
// <Av,v>
double
const
JRestA
=
tmp
*
descDir
;
// <Av,v>
...
@@ -120,7 +121,7 @@ void minimise(const Functional J, const typename Functional::SmallVector x,
...
@@ -120,7 +121,7 @@ void minimise(const Functional J, const typename Functional::SmallVector x,
J
.
A
.
mv
(
x
,
tmp
);
// Au
J
.
A
.
mv
(
x
,
tmp
);
// Au
double
const
JRestb
=
(
J
.
b
-
tmp
)
*
descDir
;
// <b-Au,v>
double
const
JRestb
=
(
J
.
b
-
tmp
)
*
descDir
;
// <b-Au,v>
typedef
MyNonlinearity
<
Functional
::
SmallVector
::
dimension
,
typedef
MyNonlinearity
<
SmallVector
::
dimension
,
typename
Functional
::
FunctionType
>
MyNonlinearityType
;
typename
Functional
::
FunctionType
>
MyNonlinearityType
;
MyNonlinearityType
phi
;
MyNonlinearityType
phi
;
typedef
DirectionalConvexFunction
<
MyNonlinearityType
>
typedef
DirectionalConvexFunction
<
MyNonlinearityType
>
...
...
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