@z This file was created by Aleksandar Donev as part of the Network Optimization project. Feel free to use any portion of it and contact me at donev@pa.msu.edu @x \Title{Precision (kind) constants for Pentium machines} \author{Aleksandar Donev} \date{January 2000} @*0 Module |Precision|. The module |Precision| contains definitions of certain kind parameters for integer, real and boolean numbers. It is of course very platform dependent. Here I use the module |Standard_Types| from the Portability Project by Dan Nagle to achieve some portability. The most important parameters here are |i_32| and |i_64|, which are the kinds for 32- and 64-bit integers (used in certain codes where bit-based operations are performed, such as random-number generation or Hilbert-curve generation), the kinds |i_word| and |r_word| which are the kinds of default |INTEGER| and |REAL| numbers. But really most important to this library are |i_wp|, |r_wp| and |l_wp| which represent the {\bf working precisions} for integers (only for numbers that may grow too large), reals (single or double---very important for optimization) and boolean (default |LOGICAL| on Pentiums is a whole word, which is wasteful on memory, but usually faster). @%% @a MODULE Precision @; USE Standard_Types @; // From portability project PRIVATE @; /* These values need to be changed when switching platforms, especially to a 64-bit machine such as an Alpha: */ INTEGER, PARAMETER, PUBLIC :: i_byte = byte_k, i_short = short_k, i_sp = int_k, i_dp = long_k, i_word = KIND(0) @; // Integers INTEGER, PARAMETER, PUBLIC :: i_32 = i_sp, i_64 = i_dp @; // 2's complement IEEE integers INTEGER, PARAMETER, PUBLIC :: r_sp = single_k, r_dp = double_k, r_qp = quad_k, r_word = KIND(0.0) @; // Real numbers INTEGER, PARAMETER, PUBLIC :: r_32 = r_sp , r_64=r_dp @; // IEEE floating-point numbers INTEGER, PARAMETER, PUBLIC :: l_short = l_byte_k, l_word = l_int_k @; // Boolean values INTEGER, PARAMETER, PUBLIC :: c_ascii = KIND(' ') @; // ASCII characters INTEGER, PARAMETER, PUBLIC :: r_wp = R_WP, i_wp = I_WP, l_wp = L_WP @; // Working precisions END MODULE Precision @; @%%