Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Core Modules
dune-common
Commits
19185989
Commit
19185989
authored
14 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
get rid of the "K"
[[Imported from SVN: r6180]]
parent
3205359c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/densevector.hh
+17
-17
17 additions, 17 deletions
dune/common/densevector.hh
with
17 additions
and
17 deletions
dune/common/densevector.hh
+
17
−
17
View file @
19185989
...
...
@@ -220,7 +220,7 @@ namespace Dune {
class
DenseVector
{
typedef
DenseMatVecTraits
<
V
>
Traits
;
typedef
typename
Traits
::
value_type
K
;
//
typedef typename Traits::value_type K;
// Curiously recuring template pattern
V
&
asImp
()
{
return
static_cast
<
V
&>
(
*
this
);
}
...
...
@@ -252,7 +252,7 @@ namespace Dune {
//===== assignment from scalar
//! Assignment operator for scalar
derived_type
&
operator
=
(
const
K
&
k
)
derived_type
&
operator
=
(
const
value_type
&
k
)
{
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
(
*
this
)[
i
]
=
k
;
...
...
@@ -399,7 +399,7 @@ namespace Dune {
}
//! vector space multiplication with scalar
derived_type
&
operator
*=
(
const
K
&
k
)
derived_type
&
operator
*=
(
const
value_type
&
k
)
{
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
(
*
this
)[
i
]
*=
k
;
...
...
@@ -407,7 +407,7 @@ namespace Dune {
}
//! vector space division by scalar
derived_type
&
operator
/=
(
const
K
&
k
)
derived_type
&
operator
/=
(
const
value_type
&
k
)
{
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
(
*
this
)[
i
]
/=
k
;
...
...
@@ -433,7 +433,7 @@ namespace Dune {
//! vector space axpy operation ( *this += a y )
derived_type
&
axpy
(
const
K
&
a
,
const
DenseVector
&
y
)
derived_type
&
axpy
(
const
value_type
&
a
,
const
DenseVector
&
y
)
{
assert
(
y
.
size
()
==
size
());
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
...
...
@@ -456,8 +456,8 @@ namespace Dune {
//===== norms
//! one norm (sum over absolute values of entries)
typename
FieldTraits
<
K
>::
real_type
one_norm
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
one_norm
()
const
{
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
+=
std
::
abs
((
*
this
)[
i
]);
return
result
;
...
...
@@ -465,45 +465,45 @@ namespace Dune {
//! simplified one norm (uses Manhattan norm for complex values)
typename
FieldTraits
<
K
>::
real_type
one_norm_real
()
const
typename
FieldTraits
<
value_type
>::
real_type
one_norm_real
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
+=
fvmeta
::
absreal
((
*
this
)[
i
]);
return
result
;
}
//! two norm sqrt(sum over squared values of entries)
typename
FieldTraits
<
K
>::
real_type
two_norm
()
const
typename
FieldTraits
<
value_type
>::
real_type
two_norm
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
+=
fvmeta
::
abs2
((
*
this
)[
i
]);
return
fvmeta
::
sqrt
(
result
);
}
//! square of two norm (sum over squared values of entries), need for block recursion
typename
FieldTraits
<
K
>::
real_type
two_norm2
()
const
typename
FieldTraits
<
value_type
>::
real_type
two_norm2
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
+=
fvmeta
::
abs2
((
*
this
)[
i
]);
return
result
;
}
//! infinity norm (maximum of absolute values of entries)
typename
FieldTraits
<
K
>::
real_type
infinity_norm
()
const
typename
FieldTraits
<
value_type
>::
real_type
infinity_norm
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
=
std
::
max
(
result
,
std
::
abs
((
*
this
)[
i
]));
return
result
;
}
//! simplified infinity norm (uses Manhattan norm for complex values)
typename
FieldTraits
<
K
>::
real_type
infinity_norm_real
()
const
typename
FieldTraits
<
value_type
>::
real_type
infinity_norm_real
()
const
{
typename
FieldTraits
<
K
>::
real_type
result
=
0
;
typename
FieldTraits
<
value_type
>::
real_type
result
=
0
;
for
(
size_type
i
=
0
;
i
<
size
();
i
++
)
result
=
std
::
max
(
result
,
fvmeta
::
absreal
((
*
this
)[
i
]));
return
result
;
...
...
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