SourceForge.net Logo timeSeries: timeSeries Class Library

tsResult_Dimension_error Class Reference
[timeSeries objects]

dimension error exception for tsResult objects More...

#include <tsExceptions.h>

Inherits tsException.

Collaboration diagram for tsResult_Dimension_error:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tsResult_Dimension_error (std::string p, const int dim1, const int dim2)
void debug_print ()

Detailed Description

dimension error exception for tsResult objects

Thrown when the dimension of two tsResult objects are different


Constructor & Destructor Documentation

tsResult_Dimension_error::tsResult_Dimension_error ( std::string  p,
const int  dim1,
const int  dim2 
) [inline]
Parameters:
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

Example: the tsResult + operator can throw Dimension_error:
             if (d.size() != tsr.size()) {
                 throw tsResult_Dimension_error(string("+"),d.size(),tsr.size());
             }

Member Function Documentation

void tsResult_Dimension_error::debug_print (  )  [inline, virtual]

error message

Example:
This code:
        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;
        }
Results in this error message:
		Illegal operation: (+) tsResult object 1 has dimension 1
		                       tsResult object 2 has dimension 3
		skipping to next file...
		

Reimplemented from tsException.

Generated on Tue Mar 16 15:10:52 2010 for timeSeries by  doxygen 1.6.3