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
dda63bcd
Verified
Commit
dda63bcd
authored
5 years ago
by
Ansgar Burchardt
Browse files
Options
Downloads
Patches
Plain Diff
DynamicVector, FieldVector: add `data` member function
parent
fda92a53
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!700
dense vectors: add some more methods expected for containers
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/common/dynvector.hh
+12
-0
12 additions, 0 deletions
dune/common/dynvector.hh
dune/common/fvector.hh
+24
-0
24 additions, 0 deletions
dune/common/fvector.hh
dune/common/test/fvectortest.cc
+1
-0
1 addition, 0 deletions
dune/common/test/fvectortest.cc
with
37 additions
and
0 deletions
dune/common/dynvector.hh
+
12
−
0
View file @
dda63bcd
...
...
@@ -156,6 +156,18 @@ namespace Dune {
return
_data
[
i
];
}
//! return pointer to underlying array
K
*
data
()
noexcept
{
return
_data
.
data
();
}
//! return pointer to underlying array
const
K
*
data
()
const
noexcept
{
return
_data
.
data
();
}
const
container_type
&
container
()
const
{
return
_data
;
}
container_type
&
container
()
{
return
_data
;
}
};
...
...
This diff is collapsed.
Click to expand it.
dune/common/fvector.hh
+
24
−
0
View file @
dda63bcd
...
...
@@ -196,6 +196,18 @@ namespace Dune {
DUNE_ASSERT_BOUNDS
(
i
<
SIZE
);
return
_data
[
i
];
}
//! return pointer to underlying array
K
*
data
()
noexcept
{
return
_data
.
data
();
}
//! return pointer to underlying array
const
K
*
data
()
const
noexcept
{
return
_data
.
data
();
}
};
/** \brief Read a FieldVector from an input stream
...
...
@@ -333,6 +345,18 @@ namespace Dune {
return
_data
;
}
//! return pointer to underlying array
K
*
data
()
noexcept
{
return
&
_data
;
}
//! return pointer to underlying array
const
K
*
data
()
const
noexcept
{
return
&
_data
;
}
//===== conversion operator
/** \brief Conversion operator */
...
...
This diff is collapsed.
Click to expand it.
dune/common/test/fvectortest.cc
+
1
−
0
View file @
dda63bcd
...
...
@@ -128,6 +128,7 @@ struct FieldVectorMainTestCommons
if
(
w
.
size
()
>
0
)
{
FVECTORTEST_ASSERT
(
!
w
.
empty
());
FVECTORTEST_ASSERT
(
std
::
addressof
(
w
[
0
])
==
std
::
addressof
(
w
.
front
()));
FVECTORTEST_ASSERT
(
std
::
addressof
(
w
[
0
])
==
w
.
data
());
FVECTORTEST_ASSERT
(
std
::
addressof
(
w
[
d
-
1
])
==
std
::
addressof
(
w
.
back
()));
}
}
...
...
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