Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Chaofan Chen
ogs
Commits
0826f8bf
Commit
0826f8bf
authored
1 year ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[MaL] Use full precision for Eigen matrix output (fmt/spdlog)
parent
5874c268
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/FormattingUtils.cpp
+17
-0
17 additions, 0 deletions
MathLib/FormattingUtils.cpp
MathLib/FormattingUtils.h
+13
-0
13 additions, 0 deletions
MathLib/FormattingUtils.h
with
30 additions
and
0 deletions
MathLib/FormattingUtils.cpp
0 → 100644
+
17
−
0
View file @
0826f8bf
/**
* \file
* \copyright
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
"FormattingUtils.h"
namespace
MathLib
{
Eigen
::
IOFormat
const
EigenIOFormat
::
full_precision
{
Eigen
::
FullPrecision
,
0
,
" "
,
"
\n
"
,
""
,
""
,
""
,
""
,
' '
};
}
// namespace MathLib
This diff is collapsed.
Click to expand it.
MathLib/FormattingUtils.h
+
13
−
0
View file @
0826f8bf
...
...
@@ -15,8 +15,21 @@
#include
<Eigen/Core>
#include
<concepts>
namespace
MathLib
{
struct
EigenIOFormat
{
static
const
Eigen
::
IOFormat
full_precision
;
};
}
// namespace MathLib
template
<
typename
T
>
requires
std
::
derived_from
<
T
,
Eigen
::
DenseBase
<
T
>>
struct
fmt
::
formatter
<
T
>
:
fmt
::
ostream_formatter
{
auto
format
(
T
const
&
value
,
fmt
::
format_context
&
ctx
)
const
{
return
fmt
::
ostream_formatter
::
format
(
value
.
format
(
MathLib
::
EigenIOFormat
::
full_precision
),
ctx
);
}
};
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