Changeset ab2923 in git


Ignore:
Timestamp:
Aug 7, 2007, 4:11:18 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
Children:
e61df204676c5cfbf13c624fb0a8a94e0c49c8eb
Parents:
592e22040e058cea577d1be39a41916d20067d38
Message:
*hannes: more gf_tables


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

Legend:

Unmodified
Added
Removed
  • factory/gfops.cc

    r592e22 rab2923  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: gfops.cc,v 1.5 1998-06-12 14:33:41 schmidt Exp $ */
     2/* $Id: gfops.cc,v 1.6 2007-08-07 14:11:18 Singular Exp $ */
    33
    44#include <config.h>
     
    2020
    2121
    22 const int gf_maxtable = 32767;
     22const int gf_maxtable = 63001;
    2323const int gf_maxbuffer = 200;
    2424
     
    3131     97, 101, 103, 107, 109, 113, 127, 131,
    3232    137, 139, 149, 151, 157, 163, 167, 173,
    33     179, 181
     33    179, 181, 191, 193, 197, 199, 223, 211,
     34    227, 229, 233, 239, 241, 251
    3435};
    3536
     
    5051    int i;
    5152    CanonicalForm result;
    52     for ( i = 0; i <= degree; i++ ) {
     53    for ( i = 0; i <= degree; i++ )
     54    {
    5355        result += CanonicalForm( coeffs[ i ] ) * power( Variable( level ), degree - i );
    5456    }
     
    6567
    6668    // do not read the table a second time
    67     if ( gf_q == q ) {
     69    if ( gf_q == q )
     70    {
    6871        return;
    6972    }
     
    7174#ifdef SINGULAR
    7275    // just copy the table if Singular already read it
    73     if ( q == nfCharQ ) {
     76    if ( q == nfCharQ )
     77    {
    7478        gf_p = p; gf_n = n;
    7579        gf_q = q; gf_q1 = q - 1;
     
    112116    bufptr = (char *)strchr( bufptr, ' ' ) + 1;
    113117    int * mipo = new int[degree + 1];
    114     for ( i = 0; i <= degree; i++ ) {
     118    for ( i = 0; i <= degree; i++ )
     119    {
    115120        sscanf( bufptr, "%d", mipo + i );
    116121        bufptr = (char *)strchr( bufptr, ' ' ) + 1;
     
    125130    int k, digs = gf_tab_numdigits62( gf_q );
    126131    i = 1;
    127     while ( i < gf_q ) {
     132    while ( i < gf_q )
     133    {
    128134        success = fgets( buffer, gf_maxbuffer, inputfile );
    129135        STICKYASSERT( strlen( buffer ) - 1 == (size_t)digs * 30, "illegal table" );
    130136        bufptr = buffer;
    131137        k = 0;
    132         while ( i < gf_q && k < 30 ) {
     138        while ( i < gf_q && k < 30 )
     139        {
    133140            gf_table[i] = convertback62( bufptr, digs );
    134141            bufptr += digs;
     
    154161    if ( i == gf_primes_len )
    155162        return false;
    156     else {
     163    else
     164    {
    157165        i = n;
    158166        int a = 1;
    159         while ( a < gf_maxtable && i > 0 ) {
     167        while ( a < gf_maxtable && i > 0 )
     168        {
    160169            a *= p;
    161170            i--;
     
    181190    if ( gf_iszero( a ) )
    182191        return 0;
    183     else {
     192    else
     193    {
    184194        // starting from z^0=1, step through the table
    185195        // counting the steps until we hit z^a or z^0
     
    187197        // latter is guaranteed to be fulfilled.
    188198        int i = 0, ff = 1;
    189         do {
     199        do
     200        {
    190201            if ( i == a )
    191202                return ff;
     
    202213    if ( gf_iszero( a ) )
    203214        return true;
    204     else {
     215    else
     216    {
    205217        // z^a in GF(p) iff (z^a)^p-1=1
    206218        return gf_isone( gf_power( a, gf_p - 1 ) );
Note: See TracChangeset for help on using the changeset viewer.