42#ifndef TEUCHOS_TABULAR_OUTPUTTER_HPP
43#define TEUCHOS_TABULAR_OUTPUTTER_HPP
128 void nextRow(
const bool allowRemainingFields =
false);
138 const int outputWidth_in
161#pragma warning(disable:4251)
181 return ( time_in > 0.0 ? time_in : -1.0 );
199 const double relTime =
214#define TEUCHOS_START_PERF_OUTPUT_TIMER(OUTPUTTER, NUMLOOPS) \
215 (OUTPUTTER).startTimer(NUMLOOPS); \
216 for ( int k = 0; k < (NUMLOOPS); ++k )
220#define TEUCHOS_START_PERF_OUTPUT_TIMER_INNERLOOP(OUTPUTTER, NUMLOOPS, NUMINNERLOOPS) \
221 (OUTPUTTER).startTimer((NUMLOOPS)*(NUMINNERLOOPS)); \
222 for ( int k = 0; k < (NUMLOOPS); ++k )
226#define TEUCHOS_START_PERF_OUTPUT_TIMER_INNERLOOP(OUTPUTTER, NUMLOOPS, NUMINNERLOOPS) \
227 (OUTPUTTER).startTimer((NUMLOOPS)*(NUMINNERLOOPS)); \
228 for ( int k = 0; k < (NUMLOOPS); ++k )
234#define TEUCHOS_END_PERF_OUTPUT_TIMER(OUTPUTTER, VARNAME) \
235 const double VARNAME = (OUTPUTTER).stopTimer(); \
236 (OUTPUTTER).outputField(VARNAME)
254 "Error, you can not output a field until you print the header with"
260 "Error, you have already output all of the "
261 <<
fieldSpecs_.size() <<
" fields for this tabular output."
262 " You must call nextRow() before outputting to the next row."
284 *
out_ << std::scientific;
Templated array class derived from the STL std::vector.
#define TEUCHOSCORE_LIB_DLL_EXPORT
Reference-counted pointer class and non-member templated function implementations.
Basic wall-clock timer class.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
ExceptionBase(const std::string &what_arg)
Smart reference counting pointer class for automatic garbage collection.
InvalidFieldOutputError(const std::string &what_arg)
InvalidFieldSpecError(const std::string &what_arg)
MissingFieldsError(const std::string &what_arg)
static const std::string fieldSpacer_
void pushFieldSpec(const std::string &fieldName, const EFieldType fieldType=DOUBLE, const EFieldJustification fieldJustification=RIGHT, const EFloatingOutputType floatingOutputType=SCIENTIFIC, const int width=-1)
Add a new field to be output.
void nextRow(const bool allowRemainingFields=false)
Finalize the row of output.
void outputHeader()
Output the headers.
void setFieldTypePrecision(const EFieldType fieldType, const int prec)
Set the precision of output for a field.
Array< FieldSpec > fieldSpecs_
TabularOutputter(std::ostream &out)
double adjustTime(const double &time_in)
Tuple< int, numFieldTypes > fieldTypePrecision_
void setOStream(const RCP< std::ostream > &out)
Set the ostream that all output will be sent to.
void startTimer(const int numLoops)
void outputField(const T &t)
Output to the next field.
Statically sized simple array (tuple) class.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
EFloatingOutputType floatingOutputType
FieldSpec(std::string fieldName_in, EFieldType fieldType_in, EFieldJustification fieldJustification_in, EFloatingOutputType floatingOutputType_in, const int outputWidth_in)
EFieldJustification fieldJustification