float128_util.h

Go to the documentation of this file.
00001 #include "qs_config.h"
00002 #ifdef HAVE_SOFTFLOAT
00003 #if HAVE_SOFTFLOAT
00004 /****************************************************************************/
00005 /*                                                                          */
00006 /*  This file is part of QSopt_ex.                                          */
00007 /*                                                                          */
00008 /*  (c) Copyright 2006 by David Applegate, William Cook, Sanjeeb Dash,      */
00009 /*  and Daniel Espinoza                                                     */
00010 /*                                                                          */
00011 /*  Sanjeeb Dash ownership of copyright in QSopt_ex is derived from his     */
00012 /*  copyright in QSopt.                                                     */
00013 /*                                                                          */
00014 /*  This code may be used under the terms of the GNU General Public License */
00015 /*  (Version 2.1 or later) as published by the Free Software Foundation.    */
00016 /*                                                                          */
00017 /*  Alternatively, use is granted for research purposes only.               */
00018 /*                                                                          */
00019 /*  It is your choice of which of these two licenses you are operating      */
00020 /*  under.                                                                  */
00021 /*                                                                          */
00022 /*  We make no guarantees about the correctness or usefulness of this code. */
00023 /*                                                                          */
00024 /****************************************************************************/
00025 
00026 /* RCSINFO $Id: float128_util.h,v 1.2 2003/11/05 16:47:22 meven Exp $ */
00027 #ifndef float128_ILL_UTIL_H
00028 #define float128_ILL_UTIL_H
00029 
00030 #include "machdefs.h"
00031 #include "config.h"
00032 
00033 #ifdef _USRDLL
00034 
00035 #ifdef QSLIB_EXPORTS
00036 #define float128_QSLIB_INTERFACE __declspec(dllexport)
00037 #else
00038 #define float128_QSLIB_INTERFACE __declspec(dllimport)
00039 #endif
00040 
00041 #else
00042 
00043 #define float128_QSLIB_INTERFACE extern
00044 
00045 #endif
00046 
00047 #ifdef WIN32
00048 #define strcasecmp(s1, s2)  stricmp(s1, s2)
00049 #define strncasecmp(s1, s2, n)  strnicmp(s1, s2, n)
00050 #endif
00051 
00052 /****************************************************************************/
00053 /*                                                                          */
00054 /*  This file is part of CONCORDE                                           */
00055 /*                                                                          */
00056 /*  (c) Copyright 1995--1999 by David Applegate, Robert Bixby,              */
00057 /*  Vasek Chvatal, and William Cook                                         */
00058 /*                                                                          */
00059 /*  Permission is granted for academic research use.  For other uses,       */
00060 /*  contact the authors for licensing options.                              */
00061 /*                                                                          */
00062 /*  Use at your own risk.  We make no guarantees about the                  */
00063 /*  correctness or usefulness of this code.                                 */
00064 /*                                                                          */
00065 /****************************************************************************/
00066 
00067 /****************************************************************************/
00068 /*                                                                          */
00069 /*    EXPORTED FUNCTIONS:                                                   */
00070 /*                                                                          */
00071 /*  EGLPNUMPT_SWAP                                                          */
00072 /*  float128_ILL_SWAP(a,b,t)                                                         */
00073 /*    swaps a and b, using t as temporary space.  a, b, and t should all    */
00074 /*    be the same type.                                                     */
00075 /*                                                                          */
00076 /*  float128_ILL_OURABS(a)                                                           */
00077 /*    returns the absolute value of a.                                      */
00078 /*                                                                          */
00079 /****************************************************************************/
00080 typedef char float128_ILLbool;
00081 
00082 #define float128_FALSE 0
00083 #define float128_TRUE  1
00084 
00085 #define float128_ILL_SWAP(a,b,t) (((t)=(a)),((a)=(b)),((b)=(t)))
00086 #define float128_EGLPNUM_SWAP(a,b,t) ((float128_EGlpNumCopy(t,a)),(float128_EGlpNumCopy(a,b)),(float128_EGlpNumCopy(b,t)))
00087 
00088 #define float128_ILL_OURABS(a) (((a) >= 0) ? (a) : -(a))
00089 
00090 #include "sortrus_common.h"
00091 #include "allocrus.h"
00092 #include "urandom.h"
00093 #include "zeit.h"
00094 /****************************************************************************/
00095 /*                                                                          */
00096 /*                             float128_util.c                                       */
00097 /*                                                                          */
00098 /****************************************************************************/
00099 #define float128_ILL_UTIL_STR(new, str) \
00100     { new = float128_ILLutil_str(str); \
00101       if (str != NULL) { ILL_CHECKnull(new, "out of memeory"); } }
00102 
00103 extern char *float128_ILLutil_str (
00104   const char *str);
00105 
00106    /* allocates and returns a copy of s */
00107 
00108 extern int float128_ILLutil_array_index (
00109   char *list[],
00110   int n,
00111   const char *name);
00112 
00113    /* returns index of name in list or -1  */
00114 
00115 extern int float128_ILLutil_index (
00116   const char *list[],
00117   const char *name);
00118 
00119    /* returns index of name in list or -1  */
00120 
00121 extern unsigned int float128_ILLutil_nextprime (
00122   unsigned int x);
00123 
00124 extern const char *float128_ILLutil_strchr (
00125   const char *s,
00126   int c);
00127 
00128 extern int float128_ILLutil_strcasecmp (
00129   const char *s1,
00130   const char *s2);
00131 extern int float128_ILLutil_strncasecmp (
00132   const char *s1,
00133   const char *s2,
00134   size_t n);
00135 
00136 
00137 extern int float128_ILLutil_our_gcd (
00138   int a,
00139   int b),
00140   float128_ILLutil_our_lcm (
00141   int a,
00142   int b),
00143   float128_ILLutil_our_log2 (
00144   int a);
00145 
00146 double float128_ILLutil_our_floor (
00147   double x),
00148   float128_ILLutil_our_ceil (
00149   double x),
00150   float128_ILLutil_our_frac (
00151   double x),
00152   float128_ILLutil_norm_sqr (
00153   double *v,
00154   int len);
00155 
00156 #include "bgetopt.h"
00157 /*#include "float128_dheaps_i.h"*/
00158 /*#include "float128_priority.h"*/
00159 #endif /* float128_ILL_UTIL_H */
00160 #endif
00161 #endif

Generated on Thu Mar 29 09:32:30 2012 for QSopt_ex by  doxygen 1.4.7