Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
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
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
code
pugs
Commits
a132286f
Commit
a132286f
authored
2 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add output for subviews
parent
7dd81c7b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!161
Improve connectivity construction's performances
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/utils/Array.hpp
+12
-0
12 additions, 0 deletions
src/utils/Array.hpp
src/utils/Table.hpp
+39
-0
39 additions, 0 deletions
src/utils/Table.hpp
with
51 additions
and
0 deletions
src/utils/Array.hpp
+
12
−
0
View file @
a132286f
...
...
@@ -24,6 +24,18 @@ class [[nodiscard]] Array
const
size_t
m_size
;
public:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
UnsafeArrayView
&
x
)
{
if
(
x
.
size
()
>
0
)
{
os
<<
0
<<
':'
<<
NaNHelper
(
x
[
0
]);
}
for
(
size_t
i
=
1
;
i
<
x
.
size
();
++
i
)
{
os
<<
' '
<<
i
<<
':'
<<
NaNHelper
(
x
[
i
]);
}
return
os
;
}
[[
nodiscard
]]
PUGS_INLINE
size_t
size
()
const
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/Table.hpp
+
39
−
0
View file @
a132286f
...
...
@@ -63,6 +63,19 @@ class [[nodiscard]] Table
Assert
(
row
<
table
.
numberOfRows
(),
"required row view is not contained in the Table"
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
UnsafeRowView
&
x
)
{
if
(
x
.
size
()
>
0
)
{
os
<<
0
<<
':'
<<
NaNHelper
(
x
[
0
]);
}
for
(
size_t
i
=
1
;
i
<
x
.
size
();
++
i
)
{
os
<<
' '
<<
i
<<
':'
<<
NaNHelper
(
x
[
i
]);
}
return
os
;
}
// To try to keep these views close to the initial array one
// forbids copy constructor and take benefits of C++-17 copy
// elisions.
...
...
@@ -113,6 +126,19 @@ class [[nodiscard]] Table
}
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
RowView
&
x
)
{
if
(
x
.
size
()
>
0
)
{
os
<<
0
<<
':'
<<
NaNHelper
(
x
[
0
]);
}
for
(
size_t
i
=
1
;
i
<
x
.
size
();
++
i
)
{
os
<<
' '
<<
i
<<
':'
<<
NaNHelper
(
x
[
i
]);
}
return
os
;
}
RowView
(
const
UnsafeTableView
&
table_view
,
index_type
row
)
:
m_table_view
{
table_view
},
m_row
{
row
}
{
Assert
(
row
<
m_table_view
.
numberOfRows
(),
"required row view is not contained in the Table view"
);
...
...
@@ -155,6 +181,19 @@ class [[nodiscard]] Table
return
m_table
(
m_row_begin
+
i
,
m_column_begin
+
j
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
UnsafeTableView
&
t
)
{
for
(
size_t
i
=
0
;
i
<
t
.
numberOfRows
();
++
i
)
{
os
<<
i
<<
'|'
;
for
(
size_t
j
=
0
;
j
<
t
.
numberOfColumns
();
++
j
)
{
os
<<
' '
<<
j
<<
':'
<<
NaNHelper
(
t
(
i
,
j
));
}
os
<<
'\n'
;
}
return
os
;
}
PUGS_INLINE
void
fill
(
const
DataType
&
data
)
const
{
...
...
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