arma_ostream_bones.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
  2. // Copyright 2008-2016 National ICT Australia (NICTA)
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // ------------------------------------------------------------------------
  15. //! \addtogroup arma_ostream
  16. //! @{
  17. class arma_ostream_state
  18. {
  19. private:
  20. const ios::fmtflags orig_flags;
  21. const std::streamsize orig_precision;
  22. const std::streamsize orig_width;
  23. const char orig_fill;
  24. public:
  25. inline arma_ostream_state(const std::ostream& o);
  26. inline void restore(std::ostream& o) const;
  27. };
  28. class arma_ostream
  29. {
  30. public:
  31. template<typename eT> inline static std::streamsize modify_stream(std::ostream& o, const eT* data, const uword n_elem);
  32. template<typename T> inline static std::streamsize modify_stream(std::ostream& o, const std::complex<T>* data, const uword n_elem);
  33. template<typename eT> inline static std::streamsize modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator begin, const uword n_elem, const typename arma_not_cx<eT>::result* junk = 0);
  34. template<typename T> inline static std::streamsize modify_stream(std::ostream& o, typename SpMat< T>::const_iterator begin, const uword n_elem, const typename arma_cx_only<T>::result* junk = 0);
  35. template<typename eT> inline static void print_elem_zero(std::ostream& o, const bool modify);
  36. template<typename eT> inline static void raw_print_elem_zero(std::ostream& o);
  37. template<typename eT> inline static void print_elem(std::ostream& o, const eT& x, const bool modify);
  38. template<typename eT> inline static void raw_print_elem(std::ostream& o, const eT& x);
  39. template<typename T> inline static void print_elem(std::ostream& o, const std::complex<T>& x, const bool modify);
  40. template<typename T> inline static void raw_print_elem(std::ostream& o, const std::complex<T>& x);
  41. template<typename eT> arma_cold inline static void print(std::ostream& o, const Mat<eT>& m, const bool modify);
  42. template<typename eT> arma_cold inline static void print(std::ostream& o, const Cube<eT>& m, const bool modify);
  43. template<typename oT> arma_cold inline static void print(std::ostream& o, const field<oT>& m);
  44. template<typename oT> arma_cold inline static void print(std::ostream& o, const subview_field<oT>& m);
  45. template<typename eT> arma_cold inline static void print_dense(std::ostream& o, const SpMat<eT>& m, const bool modify);
  46. template<typename eT> arma_cold inline static void print(std::ostream& o, const SpMat<eT>& m, const bool modify);
  47. arma_cold inline static void print(std::ostream& o, const SizeMat& S);
  48. arma_cold inline static void print(std::ostream& o, const SizeCube& S);
  49. };
  50. //! @}