dimension error exception for tsResult objects More...
#include <tsExceptions.h>
Inherits tsException.
Public Member Functions | |
tsResult_Dimension_error (std::string p, const int dim1, const int dim2) | |
void | debug_print () |
dimension error exception for tsResult objects
Thrown when the dimension of two tsResult objects are different
tsResult_Dimension_error::tsResult_Dimension_error | ( | std::string | p, | |
const int | dim1, | |||
const int | dim2 | |||
) | [inline] |
p | a string describing the offending operation | |
dim1 | the dimension of the first tsResult | |
dim2 | the dimension of the second tsResult |
The information used to construct the tsResult_Dimension_error exception can be used by the debug_print method to generate readable error messages for the user
+
operator can throw Dimension_error:if (d.size() != tsr.size()) { throw tsResult_Dimension_error(string("+"),d.size(),tsr.size()); }
void tsResult_Dimension_error::debug_print | ( | ) | [inline, virtual] |
error message
try { timeSeries<float> swa("CFS_Steering_Wheel_Angle",data); timeSeriesArray<float> omega("VDS_Chassis_CG_Ang_Vel",data); float bad = swa.mean() + omega.mean(); } catch (tsException& tse) { tse.debug_print(); cerr << "skipping to next file..." << endl; }
Illegal operation: (+) tsResult object 1 has dimension 1 tsResult object 2 has dimension 3 skipping to next file...
Reimplemented from tsException.