Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > ff8e7344076b5fbaa54d805766a057bd > files > 34

libscs-devel-1.4.1-4.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>scs_private.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>scs_private.h</h1><a href="scs__private_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/** Various declarations and macros shared by</font>
00002 <font class="comment">   several .c files, but useless to users of the library </font>
00003 <font class="comment"></font>
00004 <font class="comment"> @file scs_private.h</font>
00005 <font class="comment"></font>
00006 <font class="comment">@author Defour David David.Defour@ens-lyon.fr</font>
00007 <font class="comment">@author Florent de Dinechin Florent.de.Dinechin@ens-lyon.fr </font>
00008 <font class="comment">*/</font>
00009 
00010 
00011 <font class="comment">/*</font>
00012 <font class="comment">Copyright (C) 2002  David Defour and Florent de Dinechin</font>
00013 <font class="comment"></font>
00014 <font class="comment">    This library is free software; you can redistribute it and/or</font>
00015 <font class="comment">    modify it under the terms of the GNU Lesser General Public</font>
00016 <font class="comment">    License as published by the Free Software Foundation; either</font>
00017 <font class="comment">    version 2.1 of the License, or (at your option) any later version.</font>
00018 <font class="comment"></font>
00019 <font class="comment">    This library is distributed in the hope that it will be useful,</font>
00020 <font class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00021 <font class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</font>
00022 <font class="comment">    Lesser General Public License for more details.</font>
00023 <font class="comment"></font>
00024 <font class="comment">    You should have received a copy of the GNU Lesser General Public</font>
00025 <font class="comment">    License along with this library; if not, write to the Free Software</font>
00026 <font class="comment">    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</font>
00027 <font class="comment"></font>
00028 <font class="comment"> */</font>
00029 <font class="preprocessor">#ifndef SCS_PRIVATE_H</font>
00030 <font class="preprocessor"></font><font class="preprocessor">#define SCS_PRIVATE_H 1</font>
00031 <font class="preprocessor"></font>
00032 
00033 <font class="preprocessor">#define SCS_RADIX   (1&lt;&lt;SCS_NB_BITS)</font>
00034 <font class="preprocessor"></font>
00035 <font class="preprocessor">#define SCS_MASK_RADIX ((unsigned int)(SCS_RADIX-1))</font>
00036 <font class="preprocessor"></font>
00037 <font class="preprocessor">#include "<a class="code" href="scs_8h.html">scs.h</a>"</font>
00038 
00039 <font class="preprocessor">#ifdef WORDS_BIGENDIAN</font>
00040 <font class="preprocessor"></font><font class="preprocessor"> #define HI_ENDIAN 0</font>
00041 <font class="preprocessor"></font><font class="preprocessor"> #define LO_ENDIAN 1 </font>
00042 <font class="preprocessor"></font><font class="preprocessor">#else</font>
00043 <font class="preprocessor"></font><font class="preprocessor"> #define HI_ENDIAN 1</font>
00044 <font class="preprocessor"></font><font class="preprocessor"> #define LO_ENDIAN 0</font>
00045 <font class="preprocessor"></font><font class="preprocessor">#endif</font>
00046 <font class="preprocessor"></font>
00047 <font class="comment">/* An int such that SCS_MAX_RANGE * SCS_NB_BITS &lt; 1024, </font>
00048 <font class="comment">   where 1024 is the max of the exponent of a double number.</font>
00049 <font class="comment">   Used in scs2double.c along with radix_rng_double et al. </font>
00050 <font class="comment">   The value of 32 is OK for all practical values of SCS_NB_BITS */</font>       
00051 <font class="preprocessor">#define SCS_MAX_RANGE  32</font>
00052 <font class="preprocessor"></font>
00053 <font class="comment">/*</font>
00054 <font class="comment"> * DEFINITION OF DOUBLE PRECISION FLOATING POINT NUMBER CONSTANTS </font>
00055 <font class="comment"> */</font>
00056 <font class="comment">/* In all the following "radix" means 2^(SCS_NB_BITS),</font>
00057 <font class="comment">   and radix_blah means radix^blah.</font>
00058 <font class="comment">   (1023 + e)&lt;&lt;20 is the way to cast e into the exponent field of an IEEE-754 double</font>
00059 <font class="comment"> */</font>
00060  
00061 <font class="preprocessor">#ifdef WORDS_BIGENDIAN</font>
00062 <font class="preprocessor"></font> <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_one_double  = {{((1023+SCS_NB_BITS)&lt;&lt;20) ,               0x00000000 }}; 
00063  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_two_double  = {{((1023+2*SCS_NB_BITS)&lt;&lt;20) ,             0x00000000 }}; 
00064  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mone_double = {{((1023-SCS_NB_BITS)&lt;&lt;20) ,               0x00000000 }}; 
00065  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mtwo_double = {{((1023-2*SCS_NB_BITS)&lt;&lt;20) ,             0x00000000 }}; 
00066  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_rng_double  = {{((1023+SCS_NB_BITS*SCS_MAX_RANGE)&lt;&lt;20) , 0x00000000 }}; 
00067  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mrng_double = {{((1023-SCS_NB_BITS*SCS_MAX_RANGE)&lt;&lt;20) , 0x00000000 }};
00068  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number max_double        = {{0x7FEFFFFF ,                             0xFFFFFFFF }}; 
00069  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number min_double        = {{0x00000000 ,                             0x00000001 }}; 
00070 <font class="preprocessor">#else</font>
00071 <font class="preprocessor"></font> <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_one_double  = {{0x00000000 , ((1023+SCS_NB_BITS)&lt;&lt;20)               }}; 
00072  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_two_double  = {{0x00000000 , ((1023+2*SCS_NB_BITS)&lt;&lt;20)             }}; 
00073  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mone_double = {{0x00000000 , ((1023-SCS_NB_BITS)&lt;&lt;20)               }}; 
00074  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mtwo_double = {{0x00000000 , ((1023-2*SCS_NB_BITS)&lt;&lt;20)             }}; 
00075  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_rng_double  = {{0x00000000 , ((1023+SCS_NB_BITS*SCS_MAX_RANGE)&lt;&lt;20) }}; 
00076  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number radix_mrng_double = {{0x00000000 , ((1023-SCS_NB_BITS*SCS_MAX_RANGE)&lt;&lt;20) }}; 
00077  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number max_double        = {{0xFFFFFFFF ,                             0x7FEFFFFF }}; 
00078  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number min_double        = {{0x00000001 ,                             0x00000000 }}; 
00079 <font class="preprocessor"> #endif</font>
00080 <font class="preprocessor"></font>
00081 
00082 <font class="preprocessor">#define SCS_RADIX_ONE_DOUBLE     radix_one_double.d   </font><font class="comment">/* 2^(SCS_NB_BITS)           */</font> 
00083 <font class="preprocessor">#define SCS_RADIX_TWO_DOUBLE     radix_two_double.d   </font><font class="comment">/* 2^(2.SCS_NB_BITS)         */</font>
00084 <font class="preprocessor">#define SCS_RADIX_MONE_DOUBLE    radix_mone_double.d  </font><font class="comment">/* 2^-(SCS_NB_BITS)          */</font> 
00085 <font class="preprocessor">#define SCS_RADIX_MTWO_DOUBLE    radix_mtwo_double.d  </font><font class="comment">/* 2^-(2.SCS_NB_BITS)        */</font> 
00086 <font class="preprocessor">#define SCS_RADIX_RNG_DOUBLE     radix_rng_double.d   </font><font class="comment">/* 2^(SCS_NB_BITS.SCS_MAX_RANGE) */</font>
00087 <font class="preprocessor">#define SCS_RADIX_MRNG_DOUBLE    radix_mrng_double.d  </font><font class="comment">/* 2^-(SCS_NB_BITS.SCS_MAX_RANGE)*/</font>
00088 <font class="preprocessor">#define SCS_MAX_DOUBLE           max_double.d         </font><font class="comment">/* 2^1024-1              */</font>
00089 <font class="preprocessor">#define SCS_MIN_DOUBLE           min_double.d         </font><font class="comment">/* 2^-1074             */</font>
00090 
00091 
00092 
00093 
00094 
00095 
00096 <font class="preprocessor">#define R_HW  result-&gt;h_word</font>
00097 <font class="preprocessor"></font><font class="preprocessor">#define R_SGN result-&gt;sign</font>
00098 <font class="preprocessor"></font><font class="preprocessor">#define R_IND result-&gt;index</font>
00099 <font class="preprocessor"></font><font class="preprocessor">#define R_EXP result-&gt;exception.d</font>
00100 <font class="preprocessor"></font>
00101 <font class="preprocessor">#define X_HW  x-&gt;h_word</font>
00102 <font class="preprocessor"></font><font class="preprocessor">#define X_SGN x-&gt;sign</font>
00103 <font class="preprocessor"></font><font class="preprocessor">#define X_IND x-&gt;index</font>
00104 <font class="preprocessor"></font><font class="preprocessor">#define X_EXP x-&gt;exception.d</font>
00105 <font class="preprocessor"></font>
00106 <font class="preprocessor">#define Y_HW  y-&gt;h_word</font>
00107 <font class="preprocessor"></font><font class="preprocessor">#define Y_SGN y-&gt;sign</font>
00108 <font class="preprocessor"></font><font class="preprocessor">#define Y_IND y-&gt;index</font>
00109 <font class="preprocessor"></font><font class="preprocessor">#define Y_EXP y-&gt;exception.d</font>
00110 <font class="preprocessor"></font>
00111 <font class="preprocessor">#define Z_HW  z-&gt;h_word</font>
00112 <font class="preprocessor"></font><font class="preprocessor">#define Z_SGN z-&gt;sign</font>
00113 <font class="preprocessor"></font><font class="preprocessor">#define Z_IND z-&gt;index</font>
00114 <font class="preprocessor"></font><font class="preprocessor">#define Z_EXP z-&gt;exception.d</font>
00115 <font class="preprocessor"></font>
00116 <font class="preprocessor">#define W_HW  w-&gt;h_word</font>
00117 <font class="preprocessor"></font><font class="preprocessor">#define W_SGN w-&gt;sign</font>
00118 <font class="preprocessor"></font><font class="preprocessor">#define W_IND w-&gt;index</font>
00119 <font class="preprocessor"></font><font class="preprocessor">#define W_EXP w-&gt;exception.d</font>
00120 <font class="preprocessor"></font>
00121 
00122 
00123 <font class="comment">/* A few additional defines for the case when we use floating-point</font>
00124 <font class="comment">   multiplier */</font>
00125 
00126 <font class="preprocessor">#ifdef SCS_USE_FLT_MULT</font>
00127 <font class="preprocessor"></font><font class="comment">/* There is a "53" below, which means that these constants won't do</font>
00128 <font class="comment">   what we expect from them on x86 because of the double extended</font>
00129 <font class="comment">   precision. We could put more ifdefs, but why care, nobody wants to use the</font>
00130 <font class="comment">   FP muls on the x86. */</font>
00131 <font class="preprocessor">#ifdef WORDS_BIGENDIAN</font>
00132 <font class="preprocessor"></font> <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number scs_flt_trunc_cst = {{ ((1023+SCS_NB_BITS-1)&lt;&lt;20) ,           0x00000000 }}; 
00133  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number scs_flt_shift_cst = {{ ((1023+SCS_NB_BITS+53)&lt;&lt;20),0x00000000}}; 
00134 <font class="preprocessor">#else</font>
00135 <font class="preprocessor"></font> <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number scs_flt_trunc_cst = {{ 0x00000000, ((1023+SCS_NB_BITS-1)&lt;&lt;20) }}; 
00136  <font class="keyword">static</font> <font class="keyword">const</font> scs_db_number scs_flt_shift_cst = {{ 0x00000000 ,((1023+SCS_NB_BITS+53)&lt;&lt;20)}}; 
00137 <font class="preprocessor">#endif </font><font class="comment">/*WORDS_BIGENDIAN*/</font>
00138 
00139 <font class="preprocessor">#define SCS_FLT_TRUNC_CST  scs_flt_trunc_cst.d    </font><font class="comment">/* 2^(SCS_NB_BITS+53-1) */</font>
00140 <font class="preprocessor">#define SCS_FLT_SHIFT_CST  scs_flt_shift_cst.d    </font><font class="comment">/* 2^(SCS_NB_BITS)(1+1/2) */</font>
00141 <font class="preprocessor">#endif </font><font class="comment">/* SCS_USE_FLTMULT */</font>
00142 
00143 <font class="preprocessor">#endif</font>
</pre></div><hr><address align="right"><small>Generated on Tue Jun 17 10:15:51 2003 for SCSLib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>