Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Stack Of Tasks
eigenpy
Commits
f9e84ec6
Commit
f9e84ec6
authored
1 year ago
by
Wilson Jallet
Browse files
Options
Downloads
Patches
Plain Diff
[std-array] add SliceAllocator template parameter
+ sets allocator for the std::vector<T, Allocator> returned by get_slice
parent
153ba3e9
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
include/eigenpy/std-array.hpp
+10
-7
10 additions, 7 deletions
include/eigenpy/std-array.hpp
with
10 additions
and
7 deletions
include/eigenpy/std-array.hpp
+
10
−
7
View file @
f9e84ec6
...
...
@@ -10,20 +10,22 @@
namespace
eigenpy
{
template
<
typename
Container
,
bool
NoProxy
,
class
DerivedPolicies
>
template
<
typename
Container
,
bool
NoProxy
,
class
SliceAllocator
,
class
DerivedPolicies
>
class
array_indexing_suite
;
namespace
details
{
template
<
typename
Container
,
bool
NoProxy
>
template
<
typename
Container
,
bool
NoProxy
,
class
SliceAllocator
>
class
final_array_derived_policies
:
public
array_indexing_suite
<
Container
,
NoProxy
,
final_array_derived_policies
<
Container
,
NoProxy
>
>
{};
Container
,
NoProxy
,
SliceAllocator
,
final_array_derived_policies
<
Container
,
NoProxy
,
SliceAllocator
>
>
{};
}
// namespace details
template
<
typename
Container
,
bool
NoProxy
=
false
,
class
DerivedPolicies
=
details
::
final_array_derived_policies
<
Container
,
NoProxy
>
>
class
SliceAllocator
=
std
::
allocator
<
typename
Container
::
value_type
>,
class
DerivedPolicies
=
details
::
final_array_derived_policies
<
Container
,
NoProxy
,
SliceAllocator
>
>
class
array_indexing_suite
:
public
bp
::
vector_indexing_suite
<
Container
,
NoProxy
,
DerivedPolicies
>
{
public:
...
...
@@ -32,6 +34,7 @@ class array_indexing_suite
typedef
typename
Container
::
size_type
index_type
;
typedef
typename
Container
::
size_type
size_type
;
typedef
typename
Container
::
difference_type
difference_type
;
typedef
std
::
vector
<
data_type
,
SliceAllocator
>
slice_vector_type
;
static
constexpr
std
::
size_t
Size
=
std
::
tuple_size
<
Container
>
{};
template
<
class
Class
>
...
...
@@ -70,7 +73,7 @@ class array_indexing_suite
index_type
to
)
{
if
(
from
>
to
)
return
bp
::
object
(
std
::
array
<
data_type
,
0
>
());
size_t
size
=
to
-
from
+
1
;
// will be >= 0
s
td
::
vector
<
data
_type
>
out
;
s
lice_
vector_type
out
;
for
(
size_t
i
=
0
;
i
<
size
;
i
++
)
{
out
.
push_back
(
container
[
i
]);
}
...
...
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