00001
00022 #ifndef MATHUTIL_H
00023 #define MATHUTIL_H
00024
00025 #include "OSParameters.h"
00026 #include "OSdtoa.h"
00027 #include "OSErrorClass.h"
00028 #include "OSDataStructures.h"
00029
00030
00031 #include <sstream>
00032 #include<string>
00033
00034
00035 #ifdef __cplusplus
00036 extern "C" std::string os_dtoa_format(double x);
00037 extern "C" double os_strtod_wrap(const char *str, char **strEnd);
00038 #else
00039 #ifdef __STDC__
00040 std::string os_dtoa_format(double x);
00041 double os_strtod_wrap(const char *str, char **strEnd);
00042 #endif
00043 #endif
00044
00045
00046 using std::ostringstream;
00047
00060 class MathUtil{
00061 public:
00062
00064 MathUtil();
00065
00067 ~MathUtil();
00068
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00097
00098
00099
00100
00115 static SparseMatrix* convertLinearConstraintCoefficientMatrixToTheOtherMajor(
00116 bool isColumnMajor, int startSize, int valueSize, int* start, int* index,
00117 double* value, int dimension);
00118
00124 std::string format_os_dtoa( double x);
00125
00126
00135
00136
00145
00146
00147 };
00148 #endif