Changeset ddc27d8 in git


Ignore:
Timestamp:
Nov 20, 1997, 4:25:05 PM (26 years ago)
Author:
Jens Schmidt <schmidt@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f8c8b82fe7f133a61ed61cf56a09aea0752694c2
Parents:
c2b784d2a361f4e8e390743e963f669b3e9b6b5d
Message:
	* imm.h: functions rereordered


git-svn-id: file:///usr/local/Singular/svn/trunk@916 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/imm.h

    rc2b784 rddc27d8  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: imm.h,v 1.7 1997-11-19 11:37:29 schmidt Exp $ */
     2/* $Id: imm.h,v 1.8 1997-11-20 15:25:05 schmidt Exp $ */
    33
    44#ifndef INCL_IMM_H
     
    3535#endif
    3636
    37 //{{{ predicates
    38 inline int is_imm ( const InternalCF * const ptr )
    39 {
    40     // returns 0 if ptr is not immediate
    41     return ( (int)ptr & 3 );
    42 }
    43 
    44 inline int imm_iszero ( const InternalCF * const ptr )
    45 {
    46     return imm2int( ptr ) == 0;
    47 }
    48 
    49 inline int imm_isone ( const InternalCF * const ptr )
    50 {
    51     return imm2int( ptr ) == 1;
    52 }
    53 
    54 inline int imm_iszero_p ( const InternalCF * const ptr )
    55 {
    56     return imm2int( ptr ) == 0;
    57 }
    58 
    59 inline int imm_isone_p ( const InternalCF * const ptr )
    60 {
    61     return imm2int( ptr ) == 1;
    62 }
    63 
    64 inline int imm_iszero_gf ( const InternalCF * const ptr )
    65 {
    66     return gf_iszero( imm2int( ptr ) );
    67 }
    68 
    69 inline int imm_isone_gf ( const InternalCF * const ptr )
    70 {
    71     return gf_isone( imm2int( ptr ) );
    72 }
    73 //}}}
    74 
    7537//{{{ conversion functions
    7638#ifdef HAS_ARITHMETIC_SHIFT
     
    11678    return (InternalCF*)((i << 2) | GFMARK );
    11779}
    118 
     80//}}}
     81
     82//{{{ predicates
     83inline int is_imm ( const InternalCF * const ptr )
     84{
     85    // returns 0 if ptr is not immediate
     86    return ( (int)ptr & 3 );
     87}
     88
     89inline int imm_iszero ( const InternalCF * const ptr )
     90{
     91    return imm2int( ptr ) == 0;
     92}
     93
     94inline int imm_isone ( const InternalCF * const ptr )
     95{
     96    return imm2int( ptr ) == 1;
     97}
     98
     99inline int imm_iszero_p ( const InternalCF * const ptr )
     100{
     101    return imm2int( ptr ) == 0;
     102}
     103
     104inline int imm_isone_p ( const InternalCF * const ptr )
     105{
     106    return imm2int( ptr ) == 1;
     107}
     108
     109inline int imm_iszero_gf ( const InternalCF * const ptr )
     110{
     111    return gf_iszero( imm2int( ptr ) );
     112}
     113
     114inline int imm_isone_gf ( const InternalCF * const ptr )
     115{
     116    return gf_isone( imm2int( ptr ) );
     117}
     118//}}}
     119
     120//{{{ conversion functions
    119121inline int imm_intval ( const InternalCF* const op )
    120122{
     
    142144//
    143145// If CO is an immediate integer, the sign is defined as usual.
    144 // If CO is an element of a finite field and SW_SYMMETRIC_FF is
    145 // on the sign of CO is the sign of the symmetric representation
    146 // of CO.  If CO is in GF(q) or in a finite field and
    147 // SW_SYMMETRIC_FF is off, the sign of CO is zero iff CO is zero,
    148 // otherwise the sign is one.
     146// If CO is an element of FF(p) and SW_SYMMETRIC_FF is on the
     147// sign of CO is the sign of the symmetric representation of CO.
     148// If CO is in GF(q) or in FF(p) and SW_SYMMETRIC_FF is off, the
     149// sign of CO is zero iff CO is zero, otherwise the sign is one.
    149150//
    150151// See alse: CanonicalForm::sign(), gf_sign()
Note: See TracChangeset for help on using the changeset viewer.