//================================================================================================== /* ROTGEN - Runtime Overlay for Eigen Copyright : CODE RECKONS SPDX-License-Identifier: BSL-1.0 */ //================================================================================================== #pragma once #include #include #include namespace rotgen { class ROTGEN_EXPORT ioformat { private: struct payload; std::unique_ptr storage_; public: ioformat(int precision, int flags = 0, std::string const& coeffSeparator = " ", std::string const& rowSeparator = "\n", std::string const& rowPrefix = "", std::string const& rowSuffix = "", std::string const& matPrefix = "", std::string const& matSuffix = "", char fill = ' '); ~ioformat(); std::unique_ptr const& storage() const { return storage_; } }; template struct format { format(M const& m, ioformat const& f) : matrix_(m), format_(f) {} M const& matrix_; ioformat const& format_; }; template std::ostream& operator<<(std::ostream& os, format const& f) { return os << format{f.matrix_.base(), f.format_}; } }