Chris@49
|
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2011 Conrad Sanderson
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9 //! \addtogroup arma_ostream
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13
|
Chris@49
|
14 class arma_ostream_state
|
Chris@49
|
15 {
|
Chris@49
|
16 private:
|
Chris@49
|
17
|
Chris@49
|
18 const ios::fmtflags orig_flags;
|
Chris@49
|
19 const std::streamsize orig_precision;
|
Chris@49
|
20 const std::streamsize orig_width;
|
Chris@49
|
21 const char orig_fill;
|
Chris@49
|
22
|
Chris@49
|
23
|
Chris@49
|
24 public:
|
Chris@49
|
25
|
Chris@49
|
26 inline arma_ostream_state(const std::ostream& o);
|
Chris@49
|
27
|
Chris@49
|
28 inline void restore(std::ostream& o) const;
|
Chris@49
|
29 };
|
Chris@49
|
30
|
Chris@49
|
31
|
Chris@49
|
32
|
Chris@49
|
33 class arma_ostream
|
Chris@49
|
34 {
|
Chris@49
|
35 public:
|
Chris@49
|
36
|
Chris@49
|
37 template<typename eT> inline static std::streamsize modify_stream(std::ostream& o, const eT* data, const uword n_elem);
|
Chris@49
|
38 template<typename T> inline static std::streamsize modify_stream(std::ostream& o, const std::complex<T>* data, const uword n_elem);
|
Chris@49
|
39 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);
|
Chris@49
|
40 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);
|
Chris@49
|
41
|
Chris@49
|
42 template<typename eT> inline static void print_elem_zero(std::ostream& o, const bool modify);
|
Chris@49
|
43
|
Chris@49
|
44 template<typename eT> arma_inline static void print_elem(std::ostream& o, const eT& x, const bool modify);
|
Chris@49
|
45 template<typename T> inline static void print_elem(std::ostream& o, const std::complex<T>& x, const bool modify);
|
Chris@49
|
46
|
Chris@49
|
47 template<typename eT> inline static void print(std::ostream& o, const Mat<eT>& m, const bool modify);
|
Chris@49
|
48 template<typename eT> inline static void print(std::ostream& o, const Cube<eT>& m, const bool modify);
|
Chris@49
|
49
|
Chris@49
|
50 template<typename oT> inline static void print(std::ostream& o, const field<oT>& m);
|
Chris@49
|
51 template<typename oT> inline static void print(std::ostream& o, const subview_field<oT>& m);
|
Chris@49
|
52
|
Chris@49
|
53
|
Chris@49
|
54 template<typename eT> inline static void print_dense(std::ostream& o, const SpMat<eT>& m, const bool modify);
|
Chris@49
|
55 template<typename eT> inline static void print(std::ostream& o, const SpMat<eT>& m, const bool modify);
|
Chris@49
|
56 };
|
Chris@49
|
57
|
Chris@49
|
58
|
Chris@49
|
59
|
Chris@49
|
60 //! @}
|