15 #ifndef __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
16 #define __MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP
23 #include <boost/lexical_cast.hpp>
24 #include <boost/utility/enable_if.hpp>
25 #include <boost/type_traits.hpp>
71 destination(destination),
131 typename boost::disable_if<
138 typename boost::enable_if<
141 typename boost::disable_if<
142 HasToString<T, std::
string(T::*)() const>
148 typename boost::enable_if<
151 typename boost::enable_if<
152 HasToString<T, std::
string(T::*)() const>
186 #include "prefixedoutstream_impl.hpp"
std::ostream & destination
The output stream that all data is to be sent too; example: std::cout.
Linear algebra utility functions, generally performed on matrices or vectors.
void CallBaseLogic(const T &s, typename boost::disable_if< boost::is_class< T > >::type *=0)
This handles forwarding all primitive types transparently.
PrefixedOutStream & operator<<(bool val)
Write a bool to the stream.
bool fatal
If true, the application will terminate with an error code when a CR is encountered.
std::string prefix
Contains the prefix we must prepend to each line.
PrefixedOutStream(std::ostream &destination, const char *prefix, bool ignoreInput=false, bool fatal=false)
Set up the PrefixedOutStream.
bool ignoreInput
Discards input, prints nothing if true.
bool carriageReturned
If true, the previous call to operator<< encountered a CR, and a prefix will be necessary.
void BaseLogic(const T &val)
Conducts the base logic required in all the operator << overloads.
void PrefixIfNeeded()
Output the prefix, but only if we need to and if we are allowed to.
#define HAS_MEM_FUNC(FUNC, NAME)
Allows us to output to an ostream with a prefix at the beginning of each line, in the same way we wou...