Changeset 8181f5 in git


Ignore:
Timestamp:
Sep 7, 2012, 2:07:49 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
6dffa9e5b66ac5a81df2b68ff1c38dafc918b1f9
Parents:
f284db60abd29db5bed239271c0b6f6b1b680996
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-07 14:07:49+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-07 19:51:24+02:00
Message:
moved the description of 'struct snumber' to longrat.h and documented the struct. members
Location:
libpolys/coeffs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/longrat.cc

    rf284db r8181f5  
    6969#endif
    7070
    71 /*-----------------------------------------------------------------*/
    72 /*3
    73 * parameter s in number:
    74 * 0 (or FALSE): not normalised rational
    75 * 1 (or TRUE):  normalised rational
    76 * 3          :  integer with n==NULL
    77 */
    78 /*3
    79 **  'SR_INT' is the type of those integers small enough to fit into  29  bits.
    80 **  Therefor the value range of this small integers is: $-2^{28}...2^{28}-1$.
    81 **
    82 **  Small integers are represented by an immediate integer handle, containing
    83 **  the value instead of pointing  to  it,  which  has  the  following  form:
    84 **
    85 **      +-------+-------+-------+-------+- - - -+-------+-------+-------+
    86 **      | guard | sign  | bit   | bit   |       | bit   | tag   | tag   |
    87 **      | bit   | bit   | 27    | 26    |       | 0     | 0     | 1     |
    88 **      +-------+-------+-------+-------+- - - -+-------+-------+-------+
    89 **
    90 **  Immediate integers handles carry the tag 'SR_INT', i.e. the last bit is 1.
    91 **  This distuingishes immediate integers from other handles which  point  to
    92 **  structures aligned on 4 byte boundaries and therefor have last bit  zero.
    93 **  (The second bit is reserved as tag to allow extensions of  this  scheme.)
    94 **  Using immediates as pointers and dereferencing them gives address errors.
    95 **
    96 **  To aid overflow check the most significant two bits must always be equal,
    97 **  that is to say that the sign bit of immediate integers has a  guard  bit.
    98 **
    99 **  The macros 'INT_TO_SR' and 'SR_TO_INT' should be used to convert  between
    100 **  a small integer value and its representation as immediate integer handle.
    101 **
    102 **  Large integers and rationals are represented by z and n
    103 **  where n may be undefined (if s==3)
    104 **  NULL represents only deleted values
    105 */
    106 #define SR_HDL(A) ((long)(A))
     71//#define SR_HDL(A) ((long)(A))
    10772/*#define SR_INT    1L*/
    10873/*#define INT_TO_SR(INT)  ((number) (((long)INT << 2) + SR_INT))*/
  • libpolys/coeffs/longrat.h

    rf284db r8181f5  
    1313#include <coeffs/coeffs.h>
    1414
     15struct snumber;
     16typedef struct snumber  *number;
     17
     18/*-----------------------------------------------------------------*/
     19/**
     20**  'SR_INT' is the type of those integers small enough to fit into  29  bits.
     21**  Therefor the value range of this small integers is: $-2^{28}...2^{28}-1$.
     22**
     23**  Small integers are represented by an immediate integer handle, containing
     24**  the value instead of pointing  to  it,  which  has  the  following  form:
     25**
     26**      +-------+-------+-------+-------+- - - -+-------+-------+-------+
     27**      | guard | sign  | bit   | bit   |       | bit   | tag   | tag   |
     28**      | bit   | bit   | 27    | 26    |       | 0     | 0     | 1     |
     29**      +-------+-------+-------+-------+- - - -+-------+-------+-------+
     30**
     31**  Immediate integers handles carry the tag 'SR_INT', i.e. the last bit is 1.
     32**  This distuingishes immediate integers from other handles which  point  to
     33**  structures aligned on 4 byte boundaries and therefor have last bit  zero.
     34**  (The second bit is reserved as tag to allow extensions of  this  scheme.)
     35**  Using immediates as pointers and dereferencing them gives address errors.
     36**
     37**  To aid overflow check the most significant two bits must always be equal,
     38**  that is to say that the sign bit of immediate integers has a  guard  bit.
     39**
     40**  The macros 'INT_TO_SR' and 'SR_TO_INT' should be used to convert  between
     41**  a small integer value and its representation as immediate integer handle.
     42**
     43**  Large integers and rationals are represented by z and n
     44**  where n may be undefined (if s==3)
     45**  NULL represents only deleted values
     46*/
     47
     48struct snumber
     49{
     50  mpz_t z; //< Zaehler
     51  mpz_t n; //< Nenner
     52#if defined(LDEBUG)
     53  int debug;
     54#endif
     55
     56  /**
     57   * parameter s in number:
     58   * 0 (or FALSE): not normalised rational
     59   * 1 (or TRUE):  normalised rational
     60   * 3          :  integer with n==NULL
     61   **/
     62  BOOLEAN s; //< integer parameter
     63};
     64
    1565#define SR_HDL(A) ((long)(A))
    1666
     
    2272
    2373
    24 struct snumber;
    25 typedef struct snumber  *number;
    26 struct snumber
    27 {
    28   mpz_t z;
    29   mpz_t n;
    30 #if defined(LDEBUG)
    31   int debug;
    32 #endif
    33   BOOLEAN s;
    34 };
    3574
    3675// allow inlining only from p_Numbers.h and if ! LDEBUG
Note: See TracChangeset for help on using the changeset viewer.