/home/coin/SVN-release/CoinAll-1.1.0/OS/src/OSUtils/OSMathUtil.h

Go to the documentation of this file.
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         /*public static double round (double x, int precision){
00075                 double mask = 0.0, y, result;           
00076                 try{
00077                         mask = Math.pow (10.0, -(double)precision);
00078                 }
00079                 catch(ArithmeticException e){
00080                         return x;
00081                 }
00082                 y  = mod(x, mask);
00083                 result  = x - y;
00084                 if (y / mask >= 0.5) result += mask;
00085                 return result;
00086         }//round
00087         */
00095         /*public static double mod (double x, double y){
00096                 return  x - Math.floor(x / y) * y;
00097         }//mod
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         //double os_strtod_wrap(const char *str) throw(ErrorClass);
00134         
00143         //double os_strtod_wrap(const char *str,  const char *strEnd) throw(ErrorClass);
00144                         
00145 };//class MathUtil
00146 #endif

Generated on Sun Nov 14 14:06:39 2010 for Coin-All by  doxygen 1.4.7