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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
41ddf658
Commit
41ddf658
authored
Jul 23, 2024
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Allow output of ShrinkVectorView and ShrinkMatrixView
parent
e00336ad
No related branches found
No related tags found
1 merge request
!205
High-order polynomial reconstruction
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/algebra/ShrinkMatrixView.hpp
+15
-0
15 additions, 0 deletions
src/algebra/ShrinkMatrixView.hpp
src/algebra/ShrinkVectorView.hpp
+14
-0
14 additions, 0 deletions
src/algebra/ShrinkVectorView.hpp
with
29 additions
and
0 deletions
src/algebra/ShrinkMatrixView.hpp
+
15
−
0
View file @
41ddf658
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#include
<utils/PugsMacros.hpp>
#include
<utils/PugsMacros.hpp>
#include
<cstddef>
#include
<cstddef>
#include
<iostream>
#include
<utils/NaNHelper.hpp>
template
<
typename
MatrixType
>
template
<
typename
MatrixType
>
class
ShrinkMatrixView
class
ShrinkMatrixView
...
@@ -18,6 +20,19 @@ class ShrinkMatrixView
...
@@ -18,6 +20,19 @@ class ShrinkMatrixView
const
size_t
m_nb_rows
;
const
size_t
m_nb_rows
;
public:
public:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ShrinkMatrixView
&
A
)
{
for
(
size_t
i
=
0
;
i
<
A
.
numberOfRows
();
++
i
)
{
os
<<
i
<<
'|'
;
for
(
size_t
j
=
0
;
j
<
A
.
numberOfColumns
();
++
j
)
{
os
<<
' '
<<
j
<<
':'
<<
NaNHelper
(
A
(
i
,
j
));
}
os
<<
'\n'
;
}
return
os
;
}
PUGS_INLINE
size_t
PUGS_INLINE
size_t
numberOfRows
()
const
noexcept
numberOfRows
()
const
noexcept
{
{
...
...
This diff is collapsed.
Click to expand it.
src/algebra/ShrinkVectorView.hpp
+
14
−
0
View file @
41ddf658
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#include
<utils/PugsMacros.hpp>
#include
<utils/PugsMacros.hpp>
#include
<cstddef>
#include
<cstddef>
#include
<iostream>
#include
<utils/NaNHelper.hpp>
template
<
typename
VectorType
>
template
<
typename
VectorType
>
class
ShrinkVectorView
class
ShrinkVectorView
...
@@ -18,6 +20,18 @@ class ShrinkVectorView
...
@@ -18,6 +20,18 @@ class ShrinkVectorView
const
size_t
m_dimension
;
const
size_t
m_dimension
;
public:
public:
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ShrinkVectorView
&
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
;
}
PUGS_INLINE
size_t
PUGS_INLINE
size_t
dimension
()
const
noexcept
dimension
()
const
noexcept
{
{
...
...
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