13 #ifndef MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP 14 #define MLPACK_CORE_UTIL_PREFIXEDOUTSTREAM_HPP 68 destination(destination),
154 #include "prefixedoutstream_impl.hpp" std::ostream & destination
The output stream that all data is to be sent to; example: std::cout.
Linear algebra utility functions, generally performed on matrices or vectors.
PrefixedOutStream & operator<<(bool val)
Write a bool to the stream.
bool fatal
If true, a std::runtime_error exception will be thrown 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.
test cpp RESULT_VARIABLE MEX_RESULT_TRASH OUTPUT_VARIABLE MEX_OUTPUT ERROR_VARIABLE MEX_ERROR_TRASH string(REGEX MATCH"Warning: You are using"MEX_WARNING"${MEX_OUTPUT}") if(MEX_WARNING) string(REGEX REPLACE".*using [a-zA-Z]* version \"([0-9.]*)[^\"]*\".*""\\1"OTHER_COMPILER_VERSION"$
Allows us to output to an ostream with a prefix at the beginning of each line, in the same way we wou...