00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef KTYPES_HPP
00028 #define KTYPES_HPP
00029
00035
00036 #include <stdexcept>
00037 #include <string>
00038
00039
00040 #if (defined(_MSC_VER) && _MSC_VER <= 1200)
00041
00042 #define KTYPENAME
00043 #define KSSTREAM_HEADER <strstream>
00044 #define KOSTRINGSTREAM std::ostrstream
00045 #define KEND_OF_STREAM << '\0'
00046
00047 #else
00048
00049 #define KTYPENAME typename
00050 #define KSSTREAM_HEADER <sstream>
00051 #define KOSTRINGSTREAM std::ostringstream
00052 #define KEND_OF_STREAM
00053
00054 #endif
00055
00057
00063 namespace Kalman {
00064
00065 typedef short int K_INT_16;
00066 typedef unsigned short int K_UINT_16;
00067 typedef long int K_INT_32;
00068 typedef unsigned long int K_UINT_32;
00069 typedef float K_REAL_32;
00070 typedef double K_REAL_64;
00071
00073 struct KalmanError : public std::logic_error {
00074
00076
00080 explicit KalmanError(const std::string& message)
00081 : logic_error(message) {}
00082 };
00083
00085 struct OutOfBoundError : public KalmanError {
00086
00088 explicit OutOfBoundError(const std::string& message)
00089 : KalmanError(message) {}
00090 };
00091
00093 namespace Util {
00094
00096
00103 template <typename T>
00104 inline void swap(T& a, T& b) {
00105 T tmp = a;
00106 a = b;
00107 b = tmp;
00108 }
00109
00110 }
00111
00112 }
00113
00114 #endif