Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ag-ohlberger
dune-community
dune-xt
Commits
61ca818b
Commit
61ca818b
authored
6 years ago
by
Dr. Felix Tobias Schindler
Committed by
Tobias Leibner
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[vector] add sup_norm(vec)
parent
43604ae0
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
dune/xt/common/vector.hh
+23
-0
23 additions, 0 deletions
dune/xt/common/vector.hh
with
23 additions
and
0 deletions
dune/xt/common/vector.hh
+
23
−
0
View file @
61ca818b
...
@@ -290,6 +290,29 @@ typename std::enable_if<is_vector<VectorType>::value, VectorType>::type zeros_li
...
@@ -290,6 +290,29 @@ typename std::enable_if<is_vector<VectorType>::value, VectorType>::type zeros_li
}
}
template
<
class
VectorType
>
std
::
enable_if_t
<
is_vector
<
VectorType
>::
value
,
typename
VectorAbstraction
<
VectorType
>::
R
>
sup_norm
(
const
VectorType
&
vector
)
{
typename
VectorAbstraction
<
VectorType
>::
R
result
(
0
);
for
(
size_t
ii
=
0
;
ii
<
vector
.
size
();
++
ii
)
result
=
std
::
max
(
result
,
std
::
abs
(
vector
[
ii
]));
return
result
;
}
template
<
class
F
>
typename
FieldTraits
<
F
>::
real_type
sup_norm
(
const
DynamicVector
<
F
>&
vector
)
{
return
vector
.
infinity_norm
();
}
template
<
class
F
,
int
SIZE
>
typename
FieldTraits
<
F
>::
real_type
sup_norm
(
const
FieldVector
<
F
,
SIZE
>&
vector
)
{
return
vector
.
infinity_norm
();
}
template
<
class
VectorType
>
template
<
class
VectorType
>
typename
std
::
enable_if
<
is_vector
<
VectorType
>::
value
,
typename
VectorAbstraction
<
VectorType
>::
ScalarType
*>::
type
typename
std
::
enable_if
<
is_vector
<
VectorType
>::
value
,
typename
VectorAbstraction
<
VectorType
>::
ScalarType
*>::
type
data
(
VectorType
&
source
)
data
(
VectorType
&
source
)
...
...
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