00001
00021 #ifndef MATHUTIL_H
00022 #define MATHUTIL_H
00023
00024 #include "OSParameters.h"
00025 #include "OSdtoa.h"
00026 #include "OSErrorClass.h"
00027
00028
00029 #include <sstream>
00030 #include<string>
00031
00032
00033 #ifdef __cplusplus
00034 extern "C" std::string os_dtoa_format(double x);
00035 extern "C" double os_strtod_wrap(const char *str, char **strEnd);
00036 #else
00037 #ifdef __STDC__
00038 std::string os_dtoa_format(double x);
00039 double os_strtod_wrap(const char *str, char **strEnd);
00040 #endif
00041 #endif
00042
00043
00044 using std::ostringstream;
00045
00058 class MathUtil{
00059 public:
00060
00062 MathUtil();
00063
00065 ~MathUtil();
00066
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00095
00096
00097
00098
00113 static SparseMatrix* convertLinearConstraintCoefficientMatrixToTheOtherMajor(
00114 bool isColumnMajor, int startSize, int valueSize, int* start, int* index,
00115 double* value, int dimension);
00116
00122 std::string format_os_dtoa( double x);
00123
00124
00133
00134
00143
00144
00145 };
00146 #endif