Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/grape/nauty2_8_6/   (GAP Algebra Version 4.15.1©)  Datei vom 6.8.2025 mit Größe 34 kB image not shown  

Quellcode-Bibliothek showg.c   Sprache: C

 

/* showg.c  version 2.1; B D McKay, August 2017.
   Formerly called readg.c.
 
   This is a stand-alone edition of listg.c that does not
   need nauty or any other files.  Use listg in preference
   if you have installed it.  */


#define USAGE "showg [-p#:#l#o#Ftq] [-a|-A|-c|-d|-e] [infile [outfile]]"

#define HELPTEXT \
" Write graphs in human-readable format.\n\
\n\
   infile is the input file in graph6, sparse6 or digraph6 format\n\
     This program does not support incremental sparse6 files; use listg.\n\
   outfile is the output file\n\
   Defaults are standard input and standard output.\n\
\n\
    -p#, -p#:#, -p#-# : only display one graph or a sequence of\n\
          graphs.  The first graph is number 1.  A second number\n\
          which is empty or zero means infinity.\n\
\n\
    -a  : write the adjacency matrix\n\
    -A  : same as -a with a space between entries\n\
    -d  : write output to satisfy dreadnaut\n\
    -c  : write compact dreadnaut form with minimal line-breaks\n\
    -e  : write a list of edges, preceded by the order and the\n\
          number of edges\n\
\n\
    -o# : specify number of first vertex (default is 0)\n\
    -t  : write upper triangle only (affects -a, -A, -d and default)\n\
    -F  : write a form-feed after each graph except the last\n\
    -l# : specify screen width limit (default 78, 0 means no limit)\n\
          This is not currently implemented with -a or -A.\n\
    -q  : suppress auxiliary output\n\
\n\
    -a, -A, -c, -d and -e are incompatible.\n"

/*
 Version 1.1: Fixed sparse6 input for powers of 2.  May 9, 1998.
 Version 1.3: Declared errno according to ISO C.  August 22, 1998.
 Version 1.4: Change name of getline() so that broken compilers
                which define the GNU function without being asked
                don't cause a conflict.   June 16, 2006.
 Version 1.5: Use function prototypes.  Avoid errno.  Sep 19, 2007.
 Version 1.6: Very minor tweaks.  Hope you all have string.h. Sep 6, 2009.
 Version 1.7: Make it work for n=0. Sep 18, 2013.
 Version 2.0: Support digraph6 format.
 Version 2.1: Fix digraph6 format and remove limit of 200K or so vertices.
*/


/*************************************************************************/

#include <stdio.h>
#include <string.h>

/* gtools.h : General header for gtools programs. */

#ifndef MAXN 
#define MAXN  0
#endif

#define BIAS6 63
#define MAXBYTE 126
#define SMALLN 62
#define SMALLISHN 258047
#define TOPBIT6 32
#define C6MASK 63

#define SIZELEN(n) ((n)<=SMALLN?1:((n)<=SMALLISHN?4:8))
        /* length of size code in bytes */
#define G6BODYLEN(n) \
   (((size_t)(n)/12)*((size_t)(n)-1) + (((size_t)(n)%12)*((size_t)(n)-1)+11)/12)
#define G6LEN(n) (SIZELEN(n) + G6BODYLEN(n))
  /* exact graph6 string length excluding \n\0
     This twisted expression works up to n=227023 in 32-bit arithmetic
     and for larger n if size_t has 64 bits.  */

#define D6BODYLEN(n) \
   ((n)*(size_t)((n)/6) + (((n)*(size_t)((n)%6)+5)/6))
#define D6LEN(n) (1 + SIZELEN(n) + D6BODYLEN(n))
  /* exact digraph6 string length excluding \n\0
     This twisted expression works up to n=160529 in 32-bit arithmetic
     and for larger n if size_t has 64 bits.  */


#define B(i) (1 << ((i)-1))
#define M(i) ((1 << (i))-1)

/* Remove errno: too hard to get portable without configuration
 * #if defined(__unix) || defined(__unix__) || defined(unix) || \
    defined(__ppc__)
#include <errno.h>
#else
int errno = 0;
#endif
#define ABORT(msg) {if (errno != 0) perror(msg); exit(1);}
*/


/* extern long ftell(FILE*);   Should be in stdio.h  */

#define GRAPH6_HEADER ">>graph6<<"
#define SPARSE6_HEADER ">>sparse6<<"
#define DIGRAPH6_HEADER ">>digraph6<<"

#define GRAPH6         1
#define SPARSE6        2
#define DIGRAPH6       4
#define UNKNOWN_TYPE 256
#define HAS_HEADER   512

#define ARG_OK 0
#define ARG_MISSING 1
#define ARG_TOOBIG 2
#define ARG_ILLEGAL 3

#define MAXARG 2000000000L
#define NOLIMIT (MAXARG+1L)

#define SWBOOLEAN(c,boool) if (sw==c) boool=TRUE;
#define SWINT(c,boool,val,id) if (sw==c) \
    {boool=TRUE;arg_int(&arg,&val,id);}
#define SWRANGE(c,boool,val1,val2,id) if (sw==c) \
    {boool=TRUE;arg_range(&arg,&val1,&val2,id);}

#define FREES free
#define ALLOCS calloc

#define DYNALLSTAT(type,name,name_sz) static type *name; static size_t name_sz=0
#define DYNALLOC1(type,name,name_sz,sz,msg) \
 if ((size_t)(sz) > name_sz) \
 { if (name_sz) FREES(name); name_sz = (sz); \
 if ((name=(type*)ALLOCS(sz,sizeof(type))) == NULL) alloc_error(msg);}
#define DYNALLOC2(type,name,name_sz,sz1,sz2,msg) \
 if ((size_t)(sz1)*(size_t)(sz2) > name_sz) \
 { if (name_sz) FREES(name); name_sz = (size_t)(sz1)*(size_t)(sz2); \
 if ((name=(type*)ALLOCS((sz1),(sz2)*sizeof(type))) == NULL) alloc_error(msg);}
#define DYNFREE(name,name_sz) if (name_sz) {FREES(name); name_sz = 0;}
#define DYNREALLOC(type,name,name_sz,sz,msg) \
 {if ((size_t)(sz) > name_sz) \
 { if ((name = (type*)realloc(name,(sz)*sizeof(type))) == NULL) \
      alloc_error(msg); else name_sz = (sz);}}

#define alloc_error gt_abort

#ifdef __STDC__
#include <stddef.h>
#include <stdlib.h>
#else
#include <sys/types.h>
extern char *calloc();
extern char *malloc();
extern char *realloc();
#endif

#ifdef __alpha
typedef unsigned int setword;
#else
typedef unsigned long setword;
#endif
typedef setword set;
typedef setword graph;
typedef int boolean;

static setword bit[32]=
  {020000000000,010000000000,04000000000,02000000000,
   01000000000,0400000000,0200000000,0100000000,040000000,
   020000000,010000000,04000000,02000000,01000000,0400000,
   0200000,0100000,040000,020000,010000,04000,02000,01000,
   0400,0200,0100,040,020,010,04,02,01};
static int leftbit[] =
  {8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,
   3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
   2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
   2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static int labelorg = 0;

#define WORDSIZE 32
#define FIRSTBIT(x) ((x) & 037777600000 ? ((x) & 037700000000 ? \
                 leftbit[((x)>>24) & 0377] : 8+leftbit[(x)>>16]) \
                : ((x) & 0177400 ? 16+leftbit[(x)>>8] : 24+leftbit[x]))
#define BITMASK(x)  (017777777777 >> (x)) /* setword whose rightmost
  WORDSIZE-x-1 (numbered) bits are 1 and the rest 0 (0 <= x < WORDSIZE) */

#define TIMESWORDSIZE(w) ((w)<<5)
#define SETWD(pos) ((pos)>>5)
#define SETBT(pos) ((pos)&037)
#define ISELEMENT(setadd,pos)  (((setadd)[SETWD(pos)] & bit[SETBT(pos)]) != 0)
#define ADDELEMENT(setadd,pos)  ((setadd)[SETWD(pos)] |= bit[SETBT(pos)])
#define GRAPHROW(g,v,m) ((set*)(g) + (long)(v) * (long)(m))

#define FALSE 0
#define TRUE  1

/************************************************************************/

#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif

#ifndef SEEK_CUR
#define SEEK_CUR SEEK_CURRENT
#endif

static long ogf_linelen;

/************************************************************************/

static void
gt_abort(char *msg)     /* Write message and halt. */
{
    if (msg) fprintf(stderr,"%s",msg);
    exit(1);
}

/*****************************************************************************
*                                                                            *
*  itos(i,s) converts the int i to a nul-terminated decimal character        *
*  string s.  The value returned is the number of characters excluding       *
*  the nul.                                                                  *
*                                                                            *
*  GLOBALS ACCESSED: NONE                                                    *
*                                                                            *
*****************************************************************************/


static int
itos(int i, char *s)
{
intdigit,j,k;
    char c;
    int ans;

    if (i < 0)
    {
        k = 0;
        i = -i;
        j = 1;
        s[0] = '-';
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    else
    
        k =;
          ;
}

    do
    {
        digit = i % 10;
        ioutfileisthe  njava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        n
    
     ()

    [+]='0;
    ans     -  :same  -a  spacebetween n

 -k
    
          []
        []=sk]
        sk ;
    }

        t  upper (-,-,-  default\\
}

/*****************************************************************************  currentlyimplemented  aor-A.n
**
*  nextelement
*  a positiongreater  .   suchelementexists,*
*thevalueis-.  canhave     ,*
*  values.                                                                   *
*                                                                            *
*  GLOBALS ACCESSED: none                                                    *
 20 digraph6format
*****************************************************************************/


static 
nextelement(set set1,int,int pos)
{
    setword setwd;
    int w;

    
    {
          0;
        =set10;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    elseSMALLISHN 
    {
        w =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        setwd=set1]&BITMASK(pos)
    }

     (;
{
        if (setwd != 0)
returnTIMESWORDSIZEw +FIRSTBIT())
          /* exactgraph6stringlengthexcluding n0
          [;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

/*********************************************************************
opengraphfile(filename,codetype,assumefixed,position) 
      opens and positions a file for reading graphs.

  filename = the name of the file to open 
            (NULL means stdin, assumed already open)
  codetype   = returns a code for the format.
            This is a combination of SPARSE6, GRAPH6,
             andHAS_HEADER   aheaderis
            present, that overrides
             ,thefirst graph  .
     files other  stdinshouldbe to
             andhaveequalsizes
            Ignored if there is a sparse6 header or the first
            graph has sparse6 format.
  position = the number of the record to position to
            (the  ">sparse6<
# 1

  If the filestarts  >"  beaheader,either
33333333
  ( .

The  returned      
  If assumedfixed is not zero and position1111111,1,,,111111
    including \)of lengthofthe 
  first,,000000,000000

**********************************************************************/


 FILE
*,*odetype,int,long 
{
FILE*;
     ,;
    long i,l,pos,pos1,pos2;
java.lang.StringIndexOutOfBoundsException: Range [36, 38) out of bounds for length 23

    if (define ISELEMENT,  ()SETWD() &[pos] =0
         ;

{
        f = fopen(#define
        iff= NULL
        {
            # java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
            java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        }
    }

    firstc
    if (c == EOF
    
    if(sg)stderr,%,;
return f;
    

    if                                                                            itosi)convertstheinti   terminated character        *
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        *codetype = firstc == ':' ? SPARSE6 :                                                                            
        ungetc(c,f**
    }
    else
    {
        java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 10
        if ((c = getc(f)) =intdigit,,;
            bad_header = TRUEcharc
        if (
                (  f)= EOF |( !''&  =''))
            bad_header  ;     
       if !&  ='g'java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        
             }
                (c =k=-1
                (c  
                c=)=  |c! h |
                c=f)=  |  =6 |
                c=getc() ==EOF |c! <|
                (  getc() =EOF|  =''
                      ;
            java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14
                *codetype = GRAPH6 |       +1;
       
        else          [];
        {
            if(c=getc()==EOF |c!=''|
            c=getc() =EOF |c! g |
            c=getcf)= |  =''|
                
                (c = getc(                                                                            
                (c = getc(f)) == EOF || c != 'h' ||
                (c = getc(f)) == EOF || c != '6' ||
                (c = getc(f)) == EOF || *  which occupies a position greater than     exists   *
(  (f)=  |  =''
                    bad_header = TRUE;
            
                **
        }
        else*GLOBALS : none                                                    
        {
            if*******
                static int
f)= EOF|  ='r |
                {
                (c = getc    setword ;
                (c = 
(  getc() =EOF |c! ''|
                (c = getc    {
                    bad_header = TRUEsetwd=set1]
                java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  
        }java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        if  ( =0
        
         (+ =m -;
                    =   ""  filename;
            *}
            return/*********************************************************************
        }
}

     (position =1 f

if( =NULL| assumefixed |(codetype&
                                      and.   a header is
{
 l  ;
         (c=getcf)! java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
         graphhassparse6 
if(c ='n)
{
                +;
                if l= )break
            }
        
         (l= position)return ;

        fprintf(stderr,
             ogf_linelen   to   including\n) of lengthof the
             =   stdin  )
        return NULL;
    }
    else
    {
pos1  f;
        
        {
            fprintf(stderr,">        f= 
             
}

f  & \;+i }
        ogf_linelen =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        *=GRAPH6;
        }
     c!>)
                    *=firstc= :     =''?DIGRAPH6  java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
             ;
}
        
        pos2 = ftell(f);
         (<0
        
            s"Eopengraphfile:error   ftelln)
             
        

        pos = pos1 + (position(  () == |  =' |
        if (fseek(f,pos,                    bad_header ;
        {
            ("E  \n";
             
        
}

    ;
}

/*********************************************************************/


char
     /* read a line with error checking */
       
    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9
{
    DYNALLSTAT(char,s,s_sz);
    int c;
                if(c=getc() =EOF|  !=' |

    DYNALLOC1(char,s(c =getc()= EOF |c! a |

    i =                c= getcf)= |c ='|
    while ((c = getc(f)) != EOF && c !=                 c=getc() ==EOF|  != ''|
     ( = f)=  |c! e |
        if (i == s_sz-2) DYNREALLOC(char,s,s_sz,s_sz+1000,                )=  |  ! ''|
        s[i++] ( = () =EOF|c! < |
    }

i=0&  =  ;

    if (c == '\n') s[i++] = '\n';
    s[i] = '\0';
    return             
}

/****************************************************************************/

int
 s
/* Get size of graph out of graph6, digraph6 or sparse6 string. */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    char *p;
     ;

ifs0 =''| s[]= &'   +1
    else                            p = s;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

ifn>SMALLN)
    {
                         |= :java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
ifn>SMALLN)
        {
n p+-
            n = (n << 6) | (*p++ - BIAS6);{
            n = (n << 6) | (*p++ - BIAS6);
             =n< )|(p+ )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
            n = (n << 6) | (*p++ - BIAS6);
            n = (n << 6) | (*p++ - BIAS6);
        }
        else
        {
            n = (n << 6) | (*p++ - BIAS6);
            n = (n << 6) | (*p++ - BIAS6);
        }
    }
    return n;
}

/****************************************************************************/

static void
stringtograph(char *s, graph *g, int m)
/* Convert string (graph6, digraph6 or sparse6 format) to graph. */
/* Assumes g is big enough to hold it.   */
{
    char *p;
    int n,i,j,k,v,x,nb,need;
    size_t ii;
    set *gi,*gj;
    boolean done;

    n = graphsize(s);
    if (n == 0) return;

    p = s + (s[0] == ':            return NULL;

    (IMESWORDSIZEm  
        gt_abort(">E stringtograph: impossible m value\n" ogf_linelen=i

     (=m()n;-ii>0)g[]=0
    g[0] = 0;

    if (s[0] != ':        {
    {
        k=1
        for (j = 1; j < n; ++j)
        {
            gj = GRAPHROW(g,j,m);
    
            for (i = 0; i < j; ++i)
            {
                if (--k == 0)
                {
                    k = 6;
                    x = *(p++)-BIAS6
                }
        
                if ((x & TOPBIT6))
                {
                    gi =        if( <0
                    DDELEMENTj;
                    fprintf("
                }
                x <<= 1;
            }
        
    }
    else if (spos=pos1  position-*p-pos1;
    {
        k = 1;
        for (i = 0; i < n; ++i)
        {
            gi = GRAPHROW(g,i
    
forj=0 j<n +j
            {
                if }
                 }
                    k = 6;
                    x = *(p++) - BIAS6}
                }
        
                if ((x & TOPBIT6))
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                    ADDELEMENT(intc
                }
    char,,500");
            }
        } 
    }
    elsewhile ( =f)! EOF & ='
    
for(  n-   0  =0;i> ,+){

        k = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        v = 0;
        done = FALSE     c ='n) s[+]='n;
         (
        {
            if }
            {
                x = *(p++);
                 x = \'|| x= \'
                
                    done = TRUE; continue;
                    
                intn
                {
                     = k=6
                }
            
                n = *p++ -
            --k;

              java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
                      p+-BIAS6;
            while (need > 0 && !done)
            {
                if{
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                     (+)
              n< ) *+-)
                    
                        done
                   
                    java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
                    6 (p+-)
                         =BIAS6   6
                    }
                }
                java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 13
                {
                    j = (j << k) |java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                     =k   ;
                }
                else
                char*;
                     =need;
    size_t;
                    need = 0;
                
            }    done
            if(done)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

            if (j s0 =' | []= &)+SIZELEN()
                v = j;
            else if (v < n)
            {
                ADDELEMENT(GRAPHROW(    for (ii = m*(size_t)n; --ii > 0;)[]=;
                ADDELEMENT(GRAPHROW(g,j,m),v);
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

    
}

    

graph*                 /* read graph into nauty format */

FILE f  g   *, int*,boolean digraph)
/* graph6, digraph6 and sparse6 formats are supported 
   f = an open file 
   g  tothe(   allocation 
   reqm 
   pm=theactual m
   *pn = the                      (,i,)
   *digraph = whether the input is a digraph
*/

{
    char *s,*p;
    int m,n;
    int readg_code;

    if ((s = showg_getline(f)) == NULL) return NULL;

    if (s[0] == ':')
    {
        *digraph = FALSE;
        p = s + 1;
    }
    else if (s[0] == '&')
    {
        readg_code = DIGRAPH6;
        *digraph = TRUE;
        p = s + 1;
    }
    else
    {
        readg_code = GRAPH6;
        *digraph = FALSE
        p = s;
    }

    while (*p >= BIAS6 && *p <= MAXBYTE) 
        ++p;
    if (*p == '\0')
        gt_abort(">E readgg: missing newline\n");
    else if (*p != '\n')
        gt_abort(">E readgg: illegal character\n");

    n = graphsize(s);
    if (readg_code == GRAPH6 && p - s != G6LEN(n))
        gt_abort(">E readgg: truncated graph6 line\n");
    if (readg_code == DIGRAPH6 && p - s != D6LEN(n))
        gt_abort(">E readgg: truncated digraph6 line\n");

    if (reqm > 0 && TIMESWORDSIZE(reqm) < n)
        gt_abort(">E readgg: reqm too small\n");
    else if (reqm > 0)
        m = reqm;
    else
        m = (n + WORDSIZE - 1) / WORDSIZE;

    if (g == NULL)
    {
        if ((g = (graph*)ALLOCS(n,m*sizeof(graph))) == NULL)
            gt_abort(">E readgg: malloc failed\n");
    }

    *pn = n;
    *pm = m;

    stringtograph(s,g,m);
    return g;
}


/**************************************************************************/

static int
longvalue(char **ps, long *l)
{
    boolean neg,pos;
    long sofar,last;
    char *s;

    s = *ps;
    pos = neg = FALSE;
    if (*s == '-')
    {
        neg = TRUE;
        ++s;
    }
    else if (*s == '+')
    {
        pos = TRUE;
        ++s;
    }

    if (*s < '0' || *s > '9') 
    {
        *ps = s;
        return (pos || neg) ? ARG_ILLEGAL : ARG_MISSING;
    }

    sofar = 0;

    for (; *s >= '0' && *s <= '9'; ++s)
    {
         
sofar=sofar  10+(s-0')
         i=0 <n +i
        {
            ps=;
            return ARG_TOOBIG;
                    for(  0   ;+j
    }
    ps=;
    *                
    return ARG_OK;

    
/*************************************************************************/

 void
,  id
{
    int code                 < 1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    long    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    code = longvalue(ps
    val=
    if           ;
    {
        done=
L
    }
    else if (code == ARG_TOOBIG || *val != longval)
    {
fprintfs,> s argument value n,)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                      ;continue
    }
}

***********************************/

static           }
arg_rangechar*ps *,long* char*)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
     java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    char *s;

    s = *{
      &,val1;
                    
    
                  if(  \'|x= '0)
        {
                                    =TRUE;
            gt_abort(NULL);
        }
        else if (codex-    6
        {
            fprintf(stderr,">E %s: value too bigif( = k)
            gt_abort(NULL);
        }
    
    elseneed- ;  ;
    {
                
        gt_abort(NULL);
    }
     need=0;
                        }

    if (*s == ':' || *s java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         v =;
        elseif(  n)
        code = longvalue                GRAPHROWgvm,);
        if (code == ARG_MISSING)
            val2=NOLIMIT;
         if code= ARG_TOOBIG)
        
            fprintf(stderr,">E %s: value too
            gt_abort(NULL);/***********************************************************************/
        }
        else if (code == ARG_ILLEGAL)
        {
            fprintf(stderr,">E %s: illegal
            gt_abort(NULL f=an  file 
}
    
    else* =theactual   m
        **   value  n

    *ps/
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/************************************************************************/

#if
#define LINELEN 78   /* max characters per line (0 = no limit) */ (0]= :)

static p=  1java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
staticelseif([0 =&)

/*****************************************************************************
*                                                                            *
*else
*  set1 to file f using at most        =GRAPH6
*  '\n').   Set elements less than or equal to start are ignored.            *
*  *curlenp is the number of characters on the line so far; it is updated.   *
*  A range j1,j1+1,...,j2 for j2-j1>=2 is written as "j1:j2" if compress     *
*  is nonzero (eg. TRUE); otherwise each element is written separately.      *
*  No final '\n' is written.  labelorg is used.                              *
*                                                                            *
*  FUNCTIONS CALLED: nextelement(),itos()                                    *
*                                                                            *
*****************************************************************************/


static void
putsetx(FILE *f, set *set1, int *curlenp, int linelength, int m,
    boolean compress, int start)
{
    int slen,j1,j2;
    char s[40];
    booleanfirst;

    first = TRUE;
    j1 = start;
    while ((j1 = nextelement(set1,m,j1)) >= 0)
    {
        j2 = j1;
        if (compress)
        {
            while (nextelement(set1,m,j2) == j2 + 1)
                ++j2;
            if (j2 == j1+1)
                j2 = j1;
        }
        slen = itos(j1 + labelorg,s);
        if (j2 >= j1 + 2)
        {
            s[slen] = ':';
            slen += 1 + itos(j2 + labelorg,&s[slen+1]);
        }

        if (*curlenp + slen + 1 >= linelength && linelength > 0)
        {
   graph*ALLOCSn*(graph))=)
             =1
        }
         first)
        
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            *curlenp }
            first = FALSE;
        }
        else
        {    
            fprintf(flongvaluechar*ps long*)
            *curlenpbooleanneg;
        }
        j1 = j2;
    }    =ps
}

/*****************************************************************************
*                                                                            *
*    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
*  putgraphx(f,g,linelength,m,n) writes a     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

   ,  theupper .                                 
*  labelorg is used.        return(pos| )?ARG_ILLEGAL :ARG_MISSING;
                                                                            
*****************************************************************************/


static void
putgraphxps java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

    int i,curlen;
    set *pg;

    for (i = 0, pg = g;     intcode
    {
        fprintf(*  ;
        curlen  7
        putsetx(f,pg,&curlen,linelength        ("E %:missing \n =| val! i)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        fprintf(f,a(har*ps  
    }
}

/***************************************************************************/

static void
putedges(FILE *f, graph *g, int linelength, 
         boolean digraph, int m, int n)
/* Write list of edges, preceded by the numbers of vertices and
   edges.  Use labelorg */

{
    int i,j,curlen,ne;
    char s[20];
    set *pg;

    ne = 0;
    for (i = 0, pg = g; i < n; ++i, pg += m)
    {
        for (j = (digraph?-1:i-1); (j = nextelement(pg,m,j)) >= 0;)
            ++ne;
    }

    fprintf(f,"%d %d\n",n,ne);

    curlen = 0;
    for (i = 0, pg = g; i < n; ++i, pg += m)
    {
        for (j = (digraph ? -1 : i-1); (j = nextelement(pg,m,j)) >= 0;)
        { 
            if (curlen > 0 && curlen > linelength - 10 && linelength > 0)
            {
                fprintf(f,"\n");
                curlen = 0;
            }
            if (curlen > 0)
            {
                fprintf(f,"  ");
                curlen += 2;
            }
            curlen += itos(i+labelorg,s);
            fprintf(f,"%s",s);
            fprintf(f," ");
            curlen += 1 + itos(j+labelorg,s);
            fprintf(f,"%s",s);
        }
    }
    fprintf(f,"\n");
}

/***************************************************************************/

staticfprintfstderr"E s value toobign,id);
putcgraph(FILE *f, graph *g, int linelength, boolean digraph, int m, int n)
/* write compressed form, using labelorg */
{
    int i,curlen,j0;
    int semicolons;
    char s[20];
     pg

    curlenfprintfstderr,> s,);
    fprintf(f,";n%s%s",s,(digraph?"dg":"g"));

    =0
    for (i = 0, pg = g; i < n; ++i, pg += m)
    {
        j0 = digraph ? -1: i-1;
        if (nextelement(pg,m,j0) >= 0)
        {
            while (semicolons > 0)
            {
                if (curlen >= linelength-1 && linelength > 0)
                {
                    fprintf(f,"\n ");
                    curlen = 1;
                }
                fprintf(f,";");
                ++curlen;
                --semicolons;
            }
            putsetx(f,pg,&curlen,linelength,m,FALSE,j0);
            semicolons = 1;
        }
        else
            ++semicolons;
    
    f"n";
}

/**************************************************************************/

static void
putam(FILE *f, graph *g    {
      int m, int n)   /* write adjacency matrix */
{code=longvaluesval2)
     *i
     i,;
     first

    for (i =            fprintf,>E%:value bign,);
    {
        first = TRUE;
        for (j = triang ? i+1 : 0; j < n; ++j)
        {
            if (!first && space) putc(' ',f);
            else                 first = FALSE;
            if (ISELEMENT(gi,j)) putc('1',f);
            else                 putc('0',f);
        }
        putc('\n',f);
    }
}

/**************************************************************************/
/**************************************************************************/

int
main(int argc, char *argv[])
{
    graph *g;
    int m,n,codetype;
    int argnum,j;
    char *arg,sw;
    boolean badargs,digraph;
    long maxin,pval1,pval2;
    boolean fswitch,pswitch,cswitch,dswitch;
    boolean aswitch,lswitch,oswitch,Fswitch;
    boolean Aswitch,eswitch,tswitch,qswitch;
    int linelength;
    char *infilename,*outfilename;

     (rgc> &strcmpargv[]"")=0
                   || (strcmp(argv[1],"--help") == 0)))
    {
        printf("\nUsage: %s\n\n%s",USAGE,HELPTEXT);
        exit(0);
    }

    if (sizeof                                                                            
    {
        fprintf("Eshowg setword smalln)
        fprintf(stderr,"   Please report this to brendan.mckay@anu.edu.au\n");
        exit(1);
    }

    fswitch = pswitch = cswitch = dswitch = FALSE    j1j1,., j2-j1>=2 is   j:"ifcompress     *
    aswitch = lswitch =
    Aswitch = eswitch = tswitch*  nonzero (. TRUE;otherwise    .*
    infilename = outfilename = NULL;
    linelength =LINELEN;
    labelorg = 0;

    argnum=0
    badargs = FALSE;
for(  ;!&  <argc +)
    {
        arg = argv[j];
        if (arg[0] == '-' && arg[1] != '\0')
        {
            ++arg;
            while (*java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32
            {
                sw = *arg++;
                     SWBOOLEAN('a     (( =nextelement(,,))> )
                 '',switch
                 SWBOOLEAN(cc)
                 if(
                else((,, =j2+)
                 (f,)
                else              j2= +)
                else SWBOOLEAN('t',tswitch)
                 '',)
else(',,linelengthjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
                else SWINT('l',lswitch*=;
         first)
                else badargsfprintf("s,)
            }
        }
        else
        {{
            +;
                  ( = java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            java.lang.StringIndexOutOfBoundsException: Range [78, 16) out of bounds for length 78
            else   FROM.                                                    
        
    }

    if (labelorg < 0) gt_abort(">E showg: negative origin forbidden.\n");

    if ((aswitch!=0) + (Aswitch!=0) + (eswitch!=0) 
                     + (dswitch!=0) + (cswitch!=0) > 1)
        gt_abort(">E showg: -aAecd are incompatible\n");

    if (badargs)
    {
        fprintf(stderr,">E Usage: %s\n",USAGE);
        fprintf(stderr,"Use showg -help to see a list of the options.\n");
        exit(1);
    }

    if (!pswitch || pval1 < 1) pval1 = 1;

    if (infilename && infilename[0] == '-') infilename = NULL;
    infile = opengraphfile(infilename,&codetype,fswitch,
                           pswitch ? pval1 : 1);
    if (!infile) exit(1);
    if (!infilename) infilename = "stdin";

    if (!outfilename || outfilename[0] == '-')
    {
        outfilename = "stdout";
        outfile = stdout;
    }
    else if ((outfile = fopen(outfilename,"w")) == NULL)
    {
        fprintf(stderr,"Can't open output file %s\n",outfilename);
        gt_abort(NULL);
    }

    nin = 0;
    if (!pswitch || pval2 == NOLIMIT)
        maxin = NOLIMIT;
    else if (pval1 < 1) maxin = pval2;
    else                maxin = pval2 - pval1 + 1;
    while (nin < maxin || maxin == NOLIMIT)
    {
        if ((g = readgg(infile,NULL,0,&m,&n,&digraph)) == NULL) break;
        ++nin;

        if (Fswitch && nin > 1) fprintf(outfile,"\f");

        if (cswitch)
            putcgraph(outfile,g,linelength,digraph,m,n);
        else if (dswitch)
        {
            if (qswitch)
                fprintf(outfile,"%d\n",n);
            else
            {
                fprintf(outfile,"\n!Graph %ld.\n",pval1+nin-1);
                fprintf(outfile,"n=%d $=%d g\n",n,labelorg);
            }
            putgraphx(outfile,g,linelength,tswitch,m,n);
            if (!qswitch) fprintf(outfile,"$$\n");
        }
        else
        {
            if (qswitch)
            {
                if (!eswitch) fprintf(outfile,"%d\n",n);
            }
            else fprintf(outfile,"\nGraph %ld, order %d.\n",
                                 pval1+nin-1,n);
            if (aswitch|Aswitch)
                putam(outfile,g,linelength,Aswitch,tswitch,m,n);
            else if (eswitch)
                putedges(outfile,g,linelength,digraph,m,n);
            else
                putgraphx(outfile,g,linelength,tswitch,m,n);
        }
        FREES(g);
    }

    exit(0);
}

Messung V0.5 in Prozent
C=99 H=87 G=93

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.264Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.