Directory: | ./ |
---|---|
File: | include/pinocchio/serialization/csv.hpp |
Date: | 2025-02-12 21:03:38 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 5 | 5 | 100.0% |
Branches: | 10 | 20 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2024 INRIA | ||
3 | // | ||
4 | |||
5 | #ifndef __pinocchio_serialization_csv_hpp__ | ||
6 | #define __pinocchio_serialization_csv_hpp__ | ||
7 | |||
8 | #include "pinocchio/serialization/fwd.hpp" | ||
9 | |||
10 | #include <Eigen/Core> | ||
11 | #include <fstream> | ||
12 | |||
13 | namespace pinocchio | ||
14 | { | ||
15 | |||
16 | template<typename Derived> | ||
17 | 1 | void toCSVfile(const std::string & filename, const Eigen::MatrixBase<Derived> & matrix) | |
18 | { | ||
19 |
7/14✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
|
2 | const Eigen::IOFormat CSVFormat(Eigen::StreamPrecision, Eigen::DontAlignCols, ", ", "\n"); |
20 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | std::ofstream file(filename.c_str()); |
21 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | file << matrix.format(CSVFormat); |
22 | 1 | } | |
23 | } // namespace pinocchio | ||
24 | |||
25 | #endif // ifndef __pinocchio_serialization_csv_hpp__ | ||
26 |