|
| 1 | +--- mlpack-4.6.1/src/mlpack/core/data/utilities.hpp 2025-05-14 14:48:05.000000000 -0400 |
| 2 | ++++ mlpack-4.6.1-new/src/mlpack/core/data/utilities.hpp 2025-05-15 09:59:41.590371158 -0400 |
| 3 | +@@ -134,6 +134,7 @@ |
| 4 | + template<typename MatType, typename DataOptionsType> |
| 5 | + bool SaveMatrix(const MatType& matrix, |
| 6 | + const DataOptionsType& opts, |
| 7 | ++ const std::string& filename, |
| 8 | + std::fstream& stream) |
| 9 | + { |
| 10 | + bool success = false; |
| 11 | +--- mlpack-4.6.1/src/mlpack/core/data/save_impl.hpp 2025-05-14 14:48:05.000000000 -0400 |
| 12 | ++++ mlpack-4.6.1-new/src/mlpack/core/data/save_impl.hpp 2025-05-15 09:59:41.590371158 -0400 |
| 13 | +@@ -135,21 +135,21 @@ |
| 14 | + TextOptions txtOpts(std::move(opts)); |
| 15 | + if constexpr (IsSparseMat<MatType>::value) |
| 16 | + { |
| 17 | +- success = SaveSparse(matrix, txtOpts, stream); |
| 18 | ++ success = SaveSparse(matrix, txtOpts, filename, stream); |
| 19 | + } |
| 20 | + else if constexpr (IsCol<MatType>::value) |
| 21 | + { |
| 22 | + opts.NoTranspose() = true; |
| 23 | +- success = SaveDense(matrix, txtOpts, stream); |
| 24 | ++ success = SaveDense(matrix, txtOpts, filename, stream); |
| 25 | + } |
| 26 | + else if constexpr (IsRow<MatType>::value) |
| 27 | + { |
| 28 | + opts.NoTranspose() = false; |
| 29 | +- success = SaveDense(matrix, txtOpts, stream); |
| 30 | ++ success = SaveDense(matrix, txtOpts, filename, stream); |
| 31 | + } |
| 32 | + else if constexpr (IsDense<MatType>::value) |
| 33 | + { |
| 34 | +- success = SaveDense(matrix, txtOpts, stream); |
| 35 | ++ success = SaveDense(matrix, txtOpts, filename, stream); |
| 36 | + } |
| 37 | + opts = std::move(txtOpts); |
| 38 | + } |
| 39 | +@@ -183,6 +183,7 @@ |
| 40 | + template<typename eT> |
| 41 | + bool SaveDense(const arma::Mat<eT>& matrix, |
| 42 | + TextOptions& opts, |
| 43 | ++ const std::string& filename, |
| 44 | + std::fstream& stream) |
| 45 | + { |
| 46 | + bool success = false; |
| 47 | +@@ -191,10 +192,10 @@ |
| 48 | + if (!opts.NoTranspose()) |
| 49 | + { |
| 50 | + tmp = trans(matrix); |
| 51 | +- success = SaveMatrix(tmp, opts, stream); |
| 52 | ++ success = SaveMatrix(tmp, opts, filename, stream); |
| 53 | + } |
| 54 | + else |
| 55 | +- success = SaveMatrix(matrix, opts, stream); |
| 56 | ++ success = SaveMatrix(matrix, opts, filename, stream); |
| 57 | + |
| 58 | + return success; |
| 59 | + } |
| 60 | +@@ -203,6 +204,7 @@ |
| 61 | + template<typename eT> |
| 62 | + bool SaveSparse(const arma::SpMat<eT>& matrix, |
| 63 | + TextOptions& opts, |
| 64 | ++ const std::string& filename, |
| 65 | + std::fstream& stream) |
| 66 | + { |
| 67 | + bool success = false; |
| 68 | +@@ -212,10 +214,10 @@ |
| 69 | + if (!opts.NoTranspose()) |
| 70 | + { |
| 71 | + arma::SpMat<eT> tmp = trans(matrix); |
| 72 | +- success = SaveMatrix(tmp, opts, stream); |
| 73 | ++ success = SaveMatrix(tmp, opts, filename, stream); |
| 74 | + } |
| 75 | + else |
| 76 | +- success = SaveMatrix(matrix, opts, stream); |
| 77 | ++ success = SaveMatrix(matrix, opts, filename, stream); |
| 78 | + |
| 79 | + return success; |
| 80 | + } |
0 commit comments