dimension error exception More...
#include <tsExceptions.h>
Inherits tsException.
Public Member Functions | |
Dimension_error (std::string p, std::string n1, std::string n2, const int dim1, const int dim2) | |
void | debug_print () |
dimension error exception
Thrown when the vector dimension of two timeSeriesArray objects in an arithmetic operation are not the same.
Dimension_error::Dimension_error | ( | std::string | p, | |
std::string | n1, | |||
std::string | n2, | |||
const int | dim1, | |||
const int | dim2 | |||
) | [inline] |
p | a string describing the offending operation | |
n1 | the name of a timeSeriesArray | |
n2 | the name of a timeSeriesArray | |
dim1 | the dimension of timeSeriesArray n1 | |
dim2 | the dimension of timeSeriesArray n2 |
The information used to construct the 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.get_nElem() != ts.get_nElem()) { throw Dimension_error("+",d.varName,ts.varName, d.get_nElem(),ts.get_nElem()); }
void Dimension_error::debug_print | ( | ) | [inline, virtual] |
error message
try { timeSeriesArray<float> lanedev("SCC_Lane_Deviation",data); timeSeriesArray<float> objhead("SCC_DynObj_Heading",data); timeSeriesArray<float> bad = lanedev + objhead; } catch (tsException& tse) { tse.debug_print(); cerr << "skipping to next file..." << endl; }
Illegal operation: (+) SCC_Lane_Deviation has dimension 4 SCC_DynObj_Heading has dimension 20 skipping to next file...
Reimplemented from tsException.