SharedMeatAxe  1.0
meataxe.h
1 /* ============================= C MeatAxe ==================================
2  File: $Id: meataxe.h,v 1.3 2007-09-03 21:35:22 mringe Exp $
3  Comment: MeatAxe library external interfaces.
4  --------------------------------------------------------------------------
5  (C) Copyright 2004 Michael Ringe, Lehrstuhl D fuer Mathematik,
6  RWTH Aachen, Germany <mringe@math.rwth-aachen.de>
7  This program is free software; see the file COPYING for details.
8  ========================================================================== */
9 
10 #ifndef MEATAXE_H_INCLUDED
11 #define MEATAXE_H_INCLUDED
12 
13 #include <stdio.h>
14 #include <stdarg.h>
15 
16 #if defined GCC
17 #define MTX_PRINTF_ATTRIBUTE(f,v) __attribute__((format(printf,f,v)))
18 #else
19 #define MTX_PRINTF_ATTRIBUTE(f,v)
20 #endif
21 
26 #define FM_READ 0x01
27 #define FM_CREATE 0x02
28 #define FM_APPEND 0x03
29 #define FM_TEXT 0x10
30 #define FM_LIB 0x20
31 #define FM_NOERROR 0x40
32 
36 int SysCreateDirectory(const char *name);
37 int SysGetPid();
38 void SysInit(void);
39 void *SysMalloc(size_t nbytes);
40 FILE *SysFopen(const char *name, int mode);
41 void SysFree(void *x);
42 int SysFseek(FILE *f,long pos);
43 int SysFseekRelative(FILE *file, long distance);
44 void *SysRealloc(void *buf, size_t nbytes);
45 int SysReadLong32(FILE *f, long *buf, int n);
46 #define SysReadLong SysReadLong32
47 int SysReadLongX(FILE *f, long *buf, int n);
48 int SysRemoveDirectory(const char *name);
49 int SysRemoveFile(const char *name);
50 void SysSetTimeLimit(long nsecs);
51 long SysTimeUsed(void);
52 int SysWriteLong32(FILE *f, const long *buf, int n);
53 #define SysWriteLong SysWriteLong32
54 int SysWriteLongX(FILE *f, const long *buf, int n);
55 
56 #define ALLOC(type) ((type *) SysMalloc(sizeof(type)))
57 #define NALLOC(type,n) ((type *) SysMalloc((size_t)(n) * sizeof(type)))
58 #define NREALLOC(x,type,n)\
59  ((type *) SysRealloc(x,(size_t)(n) * sizeof(type)))
60 #define FREE(x) SysFree(x)
61 
66 /* ---------------------------------------------------------------------------------------------- */
67 
73 /* Data types and constants
74  ------------------------ */
75 
76 #if ZZZ==0
77 
78 typedef unsigned char FEL;
79 typedef FEL *PTR;
80 #define FF_ZERO ((FEL)0)
81 #define FF_ONE ((FEL)1)
82 #define ZZZVERSION 6
83 
84 #elif ZZZ==1
85 
86 typedef unsigned short FEL;
87 typedef unsigned short *PTR;
88 #define FF_ZERO ((FEL)0xFFFF)
89 #define FF_ONE ((FEL)0)
90 #define ZZZVERSION 0x101
91 
92 #else
93 
94 #error "ZZZ undefined"
95 
96 #endif
97 
98 /* Kernel variables and functions
99  ------------------------------ */
100 
101 extern int FfOrder;
102 extern int FfChar;
103 extern FEL FfGen;
104 extern int FfNoc;
105 extern size_t FfCurrentRowSize;
106 extern int FfCurrentRowSizeIo;
107 extern int MPB;
108 extern int LPR;
111 /* Arithmetic */
112 FEL FfAdd(FEL a, FEL b);
113 FEL FfSub(FEL a, FEL b);
114 FEL FfMul(FEL a, FEL b);
115 FEL FfDiv(FEL a, FEL b);
116 FEL FfNeg(FEL a);
117 FEL FfInv(FEL a);
118 
119 int FfMakeTables(int field);
120 int FfSetField(int field);
121 int FfSetNoc(int noc);
122 
123 
124 void FfAddMulRow(PTR dest, PTR src, FEL f);
125 void FfAddMulRowPartial(PTR dest, PTR src, FEL f, int first, int len);
126 PTR FfAddRow(PTR dest, PTR src);
127 PTR FfAddRowPartial(PTR dest, PTR src, int first, int len);
128 PTR FfSubRow(PTR dest, PTR src);
129 PTR FfSubRowPartial(PTR dest, PTR src, int first, int len);
130 PTR FfSubRowPartialReverse(PTR dest, PTR src, int first, int len);
131 PTR FfAlloc(int nor);
132 int FfCmpRows(PTR p1, PTR p2);
133 void FfCleanRow(PTR row, PTR matrix, int nor, const int *piv);
134 int FfCleanRow2(PTR row, PTR matrix, int nor, const int *piv, PTR row2);
135 int FfCleanRowAndRepeat(PTR row, PTR mat, int nor, const int *piv,
136  PTR row2, PTR mat2);
137 void FfCopyRow(PTR dest, PTR src);
138 FEL FfEmbed(FEL a, int subfield);
139 FEL FfExtract(PTR row, int col);
140 void FfExtractColumn(PTR mat,int nor,int col,PTR result);
141 int FfFindPivot(PTR row, FEL *mark);
142 void FfFree(PTR x);
143 FEL FfFromInt(int l);
144 PTR FfGetPtr(PTR base, int row);
145 void FfInsert(PTR row, int col, FEL mark);
146 void FfMulRow(PTR row, FEL mark);
147 FILE *FfReadHeader(const char *name, int *fld, int *nor, int *noc);
148 int FfReadRows(FILE *f, PTR buf, int n);
149 FEL FfRestrict(FEL a, int subfield);
150 size_t FfRowSize(int noc);
151 FEL FfScalarProduct(PTR a, PTR b);
152 int FfSeekRow(FILE *f, int pos);
153 int FfStepPtr(PTR *x);
154 void FfSwapRows(PTR dest, PTR src);
155 const char *FfToGap(FEL f);
156 int FfToInt(FEL f);
157 size_t FfTrueRowSize(int noc);
158 FILE *FfWriteHeader(const char *name, int fld, int nor, int noc);
159 int FfWriteRows(FILE *f, PTR buf, int n);
160 
161 
162 /* --------------------------------------------------------------------------
163  Macro versions of kernel functions
164  -------------------------------------------------------------------------- */
165 
166 
167 #if ZZZ==0
168 
169 extern FEL mtx_tmult[256][256];
170 extern FEL mtx_tadd[256][256];
171 extern FEL mtx_taddinv[256];
172 extern FEL mtx_tmultinv[256];
173 extern FEL mtx_tffirst[256][2];
174 extern FEL mtx_textract[8][256];
175 extern FEL mtx_tnull[8][256];
176 extern FEL mtx_tinsert[8][256];
177 extern long mtx_embedord[4];
178 extern FEL mtx_embed[4][16];
179 extern FEL mtx_restrict[4][256];
180 
181 #define FfAdd(a,b) ((FEL)mtx_tadd[(int)(unsigned char)a][(int)(unsigned char)b])
182 #define FfDiv(a,b) FfMul((a),FfInv(b))
183 #define FfInv(a) (mtx_tmultinv[(int)(unsigned char)a])
184 #define FfMul(a,b) ((FEL)mtx_tmult[(int)(unsigned char)a][(int)(unsigned char)b])
185 #define FfNeg(a) (mtx_taddinv[(int)(unsigned char)a])
186 #define FfSub(a,b) FfAdd((a),FfNeg(b))
187 
188 #elif ZZZ==1
189 
190 #define FfExtract(row,col) ((FEL)((row)[(col)-1]))
191 #define FfInsert(row,col,mark) ((void)((row)[(col)-1] = mark))
192 
193 
194 #endif
195 
198 /* ------------------------------------------------------------------
199  Other low-level functions (zzz2.c)
200  ------------------------------------------------------------------ */
201 
202 void FfMapRow(PTR row, PTR matrix, int nor, PTR result);
203 void FfPermRow(PTR row, const long *perm, PTR result);
204 int FfSumAndIntersection(PTR wrk1, int *nor1, int *nor2, PTR wrk2, int *piv);
205 
206 
207 /* ------------------------------------------------------------------
208  Library initialization and cleanup
209  ------------------------------------------------------------------ */
210 
211 extern int Mtx_IsInitialized;
212 extern int Mtx_IsX86;
213 extern int MtxOpt_UseOldWordGenerator;
214 
215 int MtxInitLibrary();
216 void MtxCleanupLibrary();
217 
218 
232 typedef struct {
233  char *S;
234 } String;
235 
236 String StrAlloc(size_t initial_capacity);
237 void StrFree(String *s);
238 void StrAppend(String *s, const char *text);
239 MTX_PRINTF_ATTRIBUTE(2,3)
240 void StrAppendF(String *s, const char *fmt, ...);
241 MTX_PRINTF_ATTRIBUTE(2,3)
242 void StrPrintF(String *s, const char *fmt, ...);
243 
249 /* ------------------------------------------------------------------
250  Application framework
251  ------------------------------------------------------------------ */
252 
258 extern char MtxBinDir[1024];
259 extern char MtxLibDir[1024];
261 #define APP_MAX_ARGS 50
262 
284 typedef struct
285 {
286  const char *Name;
287  const char *Description;
288  const char *Help;
290 
291 
298 typedef struct
299 {
301  int OrigArgC;
302  const char **OrigArgV;
303  int ArgC;
304  const char **ArgV;
305  int OptEnd;
306  unsigned long IsDone[APP_MAX_ARGS];
307  const char *OptArg;
308  int OptInd;
309  char TempDirName[200];
311 
312 
313 MtxApplication_t *AppAlloc(MtxApplicationInfo_t const *ai, int argc, const char **argv);
314 int AppFree(MtxApplication_t *a);
315 int AppGetOption(MtxApplication_t *app, const char *spec);
316 int AppGetCountedOption(MtxApplication_t *app, const char *spec);
317 const char *AppGetTextOption(MtxApplication_t *app, const char *spec,
318  const char *dflt);
319 int AppGetIntOption(MtxApplication_t *app, const char *spec, int dflt,
320  int min, int max);
321 int AppGetArguments(MtxApplication_t *app, int min_argc, int max_argc);
322 const char *AppCreateTempDir(MtxApplication_t *app);
323 
324 #define MTX_COMMON_OPTIONS_SYNTAX \
325  "[<Options>]"
326 
327 #define MTX_COMMON_OPTIONS_DESCRIPTION \
328  " -Q ...................... Quiet, no messages\n" \
329  " -V ...................... Verbose, more messages\n" \
330  " -T <MaxTime> ............ Set CPU time limit [s]\n"
331 
338 /* ------------------------------------------------------------------
339  Messages and error handling
340  ------------------------------------------------------------------ */
341  /* Error message codes (%E arguments) */
342 #define MTX_ERR_NOMEM 1
343 #define MTX_ERR_GAME_OVER 2
344 #define MTX_ERR_DIV0 8
345 #define MTX_ERR_FILEFMT 24
346 #define MTX_ERR_BADARG 31
347 #define MTX_ERR_RANGE 33
348 #define MTX_ERR_NOTECH 34
349 #define MTX_ERR_NOTSQUARE 35
350 #define MTX_ERR_INCOMPAT 36
351 #define MTX_ERR_BADUSAGE 41
352 #define MTX_ERR_OPTION 42
353 #define MTX_ERR_NARGS 43
354 #define MTX_ERR_NOTMATRIX 51
355 #define MTX_ERR_NOTPERM 53
363 typedef struct
364 {
365  const char *Name;
366  const char *BaseName;
367 }
369 
376 typedef struct
377 {
379  int LineNo;
380  const char *Text;
381 }
383 
388 typedef void MtxErrorHandler_t(const MtxErrorRecord_t *);
389 
390 #define MTX_DEFINE_FILE_INFO \
391  static MtxFileInfo_t Mtx_ThisFile = { __FILE__, NULL };
392 
393 int MtxError(MtxFileInfo_t *fi, int line, const char *text, ...);
395 
396 
397 #define MTX_ERROR(msg) MtxError(&Mtx_ThisFile,__LINE__,msg)
398 #define MTX_ERROR1(msg,a1) MtxError(&Mtx_ThisFile,__LINE__,msg,a1)
399 #define MTX_ERROR2(msg,a1,a2) MtxError(&Mtx_ThisFile,__LINE__,msg,a1,a2)
400 #define MTX_ERROR3(msg,a1,a2,a3) MtxError(&Mtx_ThisFile,__LINE__,msg,a1,a2,a3)
401 #define MTX_ERROR4(msg,a1,a2,a3,a4) MtxError(&Mtx_ThisFile,__LINE__,\
402  msg,a1,a2,a3,a4)
403 #define MTX_ERROR5(msg,a1,a2,a3,a4,a5) MtxError(&Mtx_ThisFile,__LINE__,\
404  msg,a1,a2,a3,a4,a5)
405 #define MTX_ERROR7(msg,a1,a2,a3,a4,a5,a6,a7) MtxError(&Mtx_ThisFile,__LINE__,\
406  msg,a1,a2,a3,a4,a5,a6,a7)
407 
408 
409 #define MTX_VERIFY(e) ((void)((e) ||\
410  MtxError(&Mtx_ThisFile,__LINE__,"Assertion failed: %s",#e)))
411 
412 #ifdef _DEBUG
413 #define DEBUG 1
414 #endif
415 
416 #ifdef DEBUG
417 #define MTX_ASSERT(e) MTX_VERIFY(e)
418 #else
419 #define MTX_ASSERT(e)
420 #undef PARANOID
421 #endif
422 
423 
424 
425 /* ------------------------------------------------------------------
426  Messages
427  ------------------------------------------------------------------ */
428 
429 int MtxFormatMessage(char *buf, int bufsize, const char *msg, va_list al);
430 int MtxPrintMessage(FILE *f, const char *fmt, ...);
431 
432 extern int MtxMessageLevel;
433 #define MSG0 (MtxMessageLevel >= 0)
434 #define MSG1 (MtxMessageLevel >= 1)
435 #define MSG2 (MtxMessageLevel >= 2)
436 #define MSG3 (MtxMessageLevel >= 3)
437 #define MSG4 (MtxMessageLevel >= 4)
438 #define MESSAGE(level,args)\
439  (MtxMessageLevel>=(level) ? ( printf args , fflush(stdout), 1) : 0 )
440 
444 /* ------------------------------------------------------------------
445  Miscellaneous
446  ------------------------------------------------------------------ */
447 
448 void MtxRandomInit(unsigned seed);
449 long int MtxRandom(void);
450 int MtxRandomInt(int max);
451 long gcd(long a, long b);
452 long lcm(long a, long b);
453 
454 
455 /* ------------------------------------------------------------------
456  Structured text files (stfXXX.c)
457  ------------------------------------------------------------------ */
458 
468 typedef struct
469 {
470  FILE *File;
471  char *LineBuf;
472  char *GetPtr;
474  int OutPos;
475  int LineNo;
476 } StfData;
477 
478 int StfClose(StfData *f);
479 StfData *StfOpen(const char *name, int mode);
480 
481 int StfPut(StfData *f, const char *text);
482 int StfPutInt(StfData *f, int value);
483 int StfPutString(StfData *f, const char *text);
484 int StfPutVector(StfData *f, int size, const int *value);
485 int StfBeginEntry(StfData *f, const char *name);
486 int StfEndEntry(StfData *f);
487 int StfWriteValue(StfData *f, const char *name, const char *value);
488 int StfWriteInt(StfData *f, const char *name, int value);
489 int StfWriteString(StfData *f, const char *name, const char *value);
490 int StfWriteVector(StfData *f, const char *name, int size, const int *value);
491 
492 int StfReadLine(StfData *f);
493 const char *StfGetName(StfData *f);
494 int StfGetInt(StfData *f, int *buf);
495 int StfGetString(StfData *f, char *buf, size_t bufsize);
496 int StfMatch(StfData *f, const char *pattern);
497 int StfGetVector(StfData *f, int *bufsize, int *buf);
498 
503 /* ------------------------------------------------------------------
504  MeatAxe files
505  ------------------------------------------------------------------ */
506 
510 typedef struct
511 {
512  unsigned long Magic;
513  int Field;
514  int Nor;
515  int Noc;
516  FILE *File;
517  char *Name;
518 } MtxFile_t;
519 
520 int MfIsValid(const MtxFile_t *file);
521 MtxFile_t *MfOpen(const char *name);
522 MtxFile_t *MfCreate(const char *name, int field, int nor, int noc);
523 int MfClose(MtxFile_t *file);
524 int MfReadLong(MtxFile_t *f, long *buf, int nrows);
525 int MfReadRows(MtxFile_t *f, PTR buf, int nrows);
526 int MfWriteLong(MtxFile_t *f, const long *buf, int count);
527 int MfWriteRows(MtxFile_t *f, PTR buf, int nrows);
528 
529 
530 /* ---------------------------------------------------------------------------------------------- */
531 
532 typedef struct
533 {
534  unsigned long Magic;
535  int Field;
536  int Nor;
537  int Noc;
539  size_t RowSize;
540  int *PivotTable;
541 } Matrix_t;
542 
543 Matrix_t *MatAdd(Matrix_t *dest, const Matrix_t *src);
544 Matrix_t *MatAddMul(Matrix_t *dest, const Matrix_t *src, FEL coeff);
545 Matrix_t *MatAlloc(int field, int nor, int noc);
546 int MatClean(Matrix_t *mat, const Matrix_t *sub);
547 int MatCompare(const Matrix_t *a, const Matrix_t *b);
548 int MatCopyRegion(Matrix_t *dest, int destrow, int destcol,
549  const Matrix_t *src, int row1, int col1, int nrows, int ncols);
550 Matrix_t *MatCut(const Matrix_t *src, int row1, int col1, int nrows, int ncols);
551 Matrix_t *MatCutRows(const Matrix_t *src, int row1, int nrows);
552 Matrix_t *MatDup(const Matrix_t *src);
553 int MatEchelonize(Matrix_t *mat);
554 int MatFree(Matrix_t *mat);
555 PTR MatGetPtr(const Matrix_t *mat, int row);
556 Matrix_t *MatId(int fl, int nor);
557 Matrix_t *MatInverse(const Matrix_t *src);
558 int MatIsValid(const Matrix_t *m);
559 Matrix_t *MatLoad(const char *fn);
560 Matrix_t *MatMul(Matrix_t *dest, const Matrix_t *src);
561 Matrix_t *MatMulScalar(Matrix_t *dest, FEL coeff);
562 Matrix_t *MatMulStrassen(Matrix_t *dest, const Matrix_t *A, const Matrix_t *B);
563 void StrassenSetCutoff(size_t size);
564 long MatNullity(const Matrix_t *mat);
565 long MatNullity__(Matrix_t *mat);
566 Matrix_t *MatNullSpace(const Matrix_t *mat);
567 Matrix_t *MatNullSpace_(Matrix_t *mat, int flags);
569 int MatOrder(const Matrix_t *mat);
570 int MatPivotize(Matrix_t *mat);
571 Matrix_t *MatPower(const Matrix_t *mat, long n);
572 void MatPrint(const char *name, const Matrix_t *m);
573 Matrix_t *MatRead(FILE *f);
574 int MatSave(const Matrix_t *mat, const char *fn);
575 FEL MatTrace(const Matrix_t *mat);
576 Matrix_t *MatTransposed(const Matrix_t *src);
577 int MatWrite(const Matrix_t *mat, FILE *f);
578 
579 /* For internal use only */
580 void Mat_DeletePivotTable(Matrix_t *mat);
581 
582 
583 
584 /* ------------------------------------------------------------------
585  Greased matrices
586  ------------------------------------------------------------------ */
587 
597 typedef struct {
598  long ***tabs;
599  int *nrvals;
600  int nrtabs;
602 
603 const GrExtractionTable_t *GrGetExtractionTable(int fl,int grrows);
604 
605 
610 typedef struct
611 {
612  unsigned long Magic;
613  int Field;
614  int Nor;
615  int Noc;
616  int GrRows;
618  int NumVecs;
621  int MPB;
623 
624 void GrMapRow(PTR v,GreasedMatrix_t *M, PTR w);
625 GreasedMatrix_t *GrMatAlloc(const Matrix_t *m, int gr_rows);
626 int GrMatFree(GreasedMatrix_t *mat);
627 int GrMatIsValid(const GreasedMatrix_t *mat);
628 
633 /* ------------------------------------------------------------------
634  Permutations
635  ------------------------------------------------------------------ */
636 
644 typedef struct
645 {
646  unsigned long Magic;
647  int Degree;
648  long *Data;
649 } Perm_t;
650 
651 
652 Perm_t *PermAlloc(int deg);
653 int PermCompare(const Perm_t *a, const Perm_t *b);
654 Perm_t *PermDup(const Perm_t *src);
655 int PermFree(Perm_t *p);
656 Perm_t *PermInverse(const Perm_t *src);
657 int PermIsValid(const Perm_t *p);
658 Perm_t *PermLoad(const char *fn);
659 Perm_t *PermMul(Perm_t *dest, const Perm_t *src);
660 int PermOrder(const Perm_t *perm);
661 void PermPrint(const char *name, const Perm_t *perm);
662 Perm_t *PermPower(const Perm_t *p, int n);
663 Perm_t *PermRead(FILE *f);
664 int PermSave(const Perm_t *perm, const char *fn);
665 int PermWrite(const Perm_t *perm, FILE *f);
666 
667 void Perm_ConvertOld(long *data, int len);
668 
671 /* ------------------------------------------------------------------
672  Polynomials
673  ------------------------------------------------------------------ */
674 
679 typedef struct
680 {
681  unsigned long Magic;
682  int Field;
683  int Degree;
686  int BufSize;
687 }
688 Poly_t;
689 
690 
691 Poly_t *PolAdd(Poly_t *dest, const Poly_t *src);
692 Poly_t *PolAlloc(int fl, int n);
693 int PolCompare(const Poly_t *a, const Poly_t *b);
694 Poly_t *PolDerive(Poly_t *pol);
695 Poly_t *PolDivMod(Poly_t *a, const Poly_t *b);
696 Poly_t *PolDup(const Poly_t *p);
697 int PolFree(Poly_t *p);
698 Poly_t *PolGcd(const Poly_t *a, const Poly_t *b);
699 int PolGcdEx(const Poly_t *a, const Poly_t *b, Poly_t **result);
700 int PolIsValid(const Poly_t *p);
701 Poly_t *PolMod(Poly_t *a, const Poly_t *b);
702 void Pol_Normalize(Poly_t *p);
703 Poly_t *PolLoad(const char *fn);
704 Poly_t *PolMul(Poly_t *dest, const Poly_t *src);
705 void PolPrint(char *name, const Poly_t *p);
706 Poly_t *PolRead(FILE *f);
707 int PolSave(const Poly_t *pol, const char *fn);
708 int PolWrite(const Poly_t *p, FILE *f);
709 
712 /* ------------------------------------------------------------------
713  Factored polynomials
714  ------------------------------------------------------------------ */
715 
716 typedef struct
717 {
718  unsigned long Magic;
719  int NFactors;
720  int BufSize;
722  int *Mult;
723 } FPoly_t;
724 
725 FPoly_t *FpAlloc();
726 int FpFree(FPoly_t *x);
727 int FpIsValid(const FPoly_t *p);
728 FPoly_t *FpMul(FPoly_t *dest, const FPoly_t *src);
729 FPoly_t *FpMulP(FPoly_t *dest, const Poly_t *src, int pwr);
730 int FpPrint(const char *name, const FPoly_t *p);
731 
732 /* ---------------------------------------------------------------------------------------------- */
733 
734 typedef struct
735 {
736  unsigned long Magic;
737  int Size;
738  int BufSize;
739  long Data[1];
741 } BitString_t;
743 BitString_t *BsAlloc(int size);
744 int BsAnd(BitString_t *dest, const BitString_t *src);
745 int BsClear(BitString_t *bs, int i);
746 int BsClearAll(BitString_t *bs);
747 int BsCompare(const BitString_t *a, const BitString_t *b);
748 BitString_t *BsCopy(BitString_t *dest, const BitString_t *src);
749 BitString_t *BsDup(const BitString_t *src);
750 int BsFree(BitString_t *bs);
751 int BsIntersectionCount(const BitString_t *a, const BitString_t *b);
752 int BsIsSub(const BitString_t *a, const BitString_t *b);
753 int BsIsValid(const BitString_t *bs);
754 int BsMinus(BitString_t *dest, const BitString_t *src);
755 int BsOr(BitString_t *dest, const BitString_t *src);
756 void BsPrint(const char *name, const BitString_t *bs);
757 BitString_t *BsRead(FILE *f);
758 int BsSet(BitString_t *bs, int i);
759 int BsTest(const BitString_t *bs, int i);
760 int BsWrite(BitString_t *bs, FILE *f);
761 
762 #ifndef DEBUG
763 
764 #define BS_BPL (sizeof(long) * 8)
765 #define BsSet(bs,i) ((bs)->Data[(i) / BS_BPL] |= 1L << ((i) % BS_BPL))
766 #define BsClear(bs,i) ((bs)->Data[(i) / BS_BPL] &= ~(1L << ((i) % BS_BPL)))
767 #define BsTest(bs,i) (((bs)->Data[(i) / BS_BPL] & (1L << ((i) % BS_BPL))) != 0 ? 1 : 0)
768 
769 #endif
770 
771 
772 /* ------------------------------------------------------------------
773  Sets
774  ------------------------------------------------------------------ */
775 
776 typedef struct
777 {
778  unsigned long Magic;
779  int Size;
780  int BufSize;
781  long *Data;
782 } Set_t;
783 
784 
785 Set_t *SetAlloc();
786 int SetContains(const Set_t *set, long elem);
787 Set_t *SetDup(const Set_t *s);
788 int SetFree(Set_t *x);
789 int SetInsert(Set_t *set, long elem);
790 int SetIsValid(const Set_t *s);
791 int SetPrint(char *name, const Set_t *s);
792 
793 
794 /* ------------------------------------------------------------------
795  Integer matrices
796  ------------------------------------------------------------------ */
797 
798 typedef struct
799 {
800  unsigned long Magic;
801  int Nor;
802  int Noc;
803  long *Data;
804 } IntMatrix_t;
805 
806 IntMatrix_t *ImatAlloc(int nor, int noc);
807 int ImatFree(IntMatrix_t *mat);
808 int ImatIsValid(const IntMatrix_t *m);
809 IntMatrix_t *ImatLoad(const char *fn);
810 IntMatrix_t *ImatRead(FILE *f);
811 int ImatSave(const IntMatrix_t *mat, const char *file_name);
812 int ImatWrite(const IntMatrix_t *mat, FILE *f);
813 
814 
815 /* --------------------------------------------------------------------------
816  Polymorphic objects
817  -------------------------------------------------------------------------- */
818 
819 void *XDup(void *a);
820 int XIsCompatible(void *a, void *b);
821 void XFree(void *a);
822 void *XInverse(void *a);
823 void *XLoad(const char *fn);
824 void XMul(void *a, void *b);
825 long XOrder(void *a);
826 void *XPower(void *a, int n);
827 int XSave(void *a, const char *fn);
828 
829 
830 
831 
832 
833 
834 
835 /* --------------------------------------------------------------------------
836  Matrix sets
837  -------------------------------------------------------------------------- */
838 
843 typedef struct
844 {
845  Matrix_t *Matrix;
846  int PivRow;
847  int PivCol;
848  FEL PivMark;
850 
851 
855 typedef struct {
856  unsigned long Magic;
857  int Len;
858  MatrixSetElement_t *List;
859 } MatrixSet_t;
860 
862 int MsClean(const MatrixSet_t *set, Matrix_t *mat);
863 int MsCleanAndAppend(MatrixSet_t *set, Matrix_t *mat);
864 int MsFree(MatrixSet_t *set);
865 int MsIsValid(const MatrixSet_t *set);
866 
867 
868 
869 /* --------------------------------------------------------------------------
870  Matrix representations
871  -------------------------------------------------------------------------- */
872 
873 typedef struct
874 {
875  unsigned long Magic;
876  int NGen;
877  Matrix_t **Gen;
878 } MatRep_t;
879 
880 #define MR_COPY_GENERATORS 0x0001
881 
882 int MrAddGenerator(MatRep_t *rep, Matrix_t *gen, int flags);
883 MatRep_t *MrAlloc(int ngen, Matrix_t **gen, int flags);
884 int MrChangeBasis(MatRep_t *rep, const Matrix_t *trans);
885 int MrIsValid(const MatRep_t *rep);
886 int MrFree(MatRep_t *rep);
887 MatRep_t *MrLoad(const char *basename, int ngen);
888 int MrSave(const MatRep_t *rep, const char *basename);
889 MatRep_t *MrTransposed(const MatRep_t *rep);
890 
891 
892 
893 /* ------------------------------------------------------------------
894  The word generator
895  ------------------------------------------------------------------ */
896 
897 typedef struct
898 {
899  const MatRep_t *Rep;
900  Matrix_t *Basis[8];
901  int N2[8];
902  int *Description;
903 } WgData_t;
904 
905 
906 WgData_t *WgAlloc(const MatRep_t *rep);
907 int *WgDescribeWord(WgData_t *b, long n);
908 int WgFree(WgData_t *b);
909 Matrix_t *WgMakeWord(WgData_t *b, long n);
910 void WgMakeFingerPrint(WgData_t *b, int fp[6]);
911 const char *WgSymbolicName(WgData_t *b, long n);
912 
913 
914 
915 
916 
917 /* ------------------------------------------------------------------
918  Spin-up, Split, Quotients, etc.
919  ------------------------------------------------------------------ */
920 
921 #define SF_FIRST 0x0001 /* Try only the first seed vector */
922 #define SF_EACH 0x0002 /* Try each seed vector */
923 #define SF_MAKE 0x0004 /* Try all 1-dimensional subspaces */
924 #define SF_SUB 0x0010 /* Try until finding a proper subspace */
925 #define SF_CYCLIC 0x0020 /* Try until finding a cyclic vector */
926 #define SF_COMBINE 0x0040 /* Combine the spans */
927 #define SF_SEED_MASK 0x000F
928 #define SF_MODE_MASK 0x00F0
929 #define SF_STD 0x0100 /* Spin up 'canonically' */
930 
931 Matrix_t *QProjection(const Matrix_t *subspace, const Matrix_t *vectors);
932 Matrix_t *QAction(const Matrix_t *sub, const Matrix_t *gen);
933 Matrix_t *SAction(const Matrix_t *sub, const Matrix_t *gen);
934 
935 typedef struct
936 {
937  int MaxSubspaceDimension;
938  int MaxTries;
939  int Result;
940 } SpinUpInfo_t;
941 
942 int SpinUpInfoInit(SpinUpInfo_t *info);
943 Matrix_t *SpinUp(const Matrix_t *seed, const MatRep_t *rep, int flags,
944  IntMatrix_t **script, SpinUpInfo_t *info);
945 Matrix_t *SpinUpWithScript(const Matrix_t *seed, const MatRep_t *rep,
946  const IntMatrix_t *script);
947 int Split(Matrix_t *subspace, const MatRep_t *rep,
948  MatRep_t **sub, MatRep_t **quot);
949 
950 int ConvertSpinUpScript(IntMatrix_t *script);
951 
952 Matrix_t *SpinUpWithPermutations(const Matrix_t *seed, int ngen,
953  const Perm_t **gen, int flags, IntMatrix_t **script, SpinUpInfo_t *info);
954 
955 
956 /* ------------------------------------------------------------------
957  Seed vector generator
958  ------------------------------------------------------------------ */
959 
960 long MakeSeedVector(const Matrix_t *basis, long lastno, PTR vec);
961 
962 
963 
964 /* ------------------------------------------------------------------
965  Miscellaneous algorithms
966  ------------------------------------------------------------------ */
967 
968 Matrix_t *MatInsert_(Matrix_t *mat, const Poly_t *pol);
969 Matrix_t *MatInsert(const Matrix_t *mat, const Poly_t *pol);
970 int IsSubspace(const Matrix_t *sub, const Matrix_t *space, int ngen);
971 
972 Matrix_t *MatTensor(const Matrix_t *m1, const Matrix_t *m2);
973 int MatrixToVector(const Matrix_t *mat, Matrix_t *vecs, int n);
974 Matrix_t *VectorToMatrix(Matrix_t *vecs, int n, int noc);
975 Matrix_t *TensorMap(Matrix_t *vec, const Matrix_t *a, const Matrix_t *b);
976 
977 int StablePower(const Matrix_t *mat, int *pwr, Matrix_t **ker);
978 int StablePower_(Matrix_t *mat, int *pwr, Matrix_t **ker);
979 
980 
981 
982 /* ------------------------------------------------------------------
983  Polynomial factorization (Berlekamp algorithm)
984  ------------------------------------------------------------------ */
985 
986 FPoly_t *Factorization(const Poly_t *pol);
987 
988 
989 
990 /* ------------------------------------------------------------------
991  Characteristic and minimal polynomials (charpol.c, minpol.c)
992  ------------------------------------------------------------------ */
993 
994 extern long CharPolSeed;
995 Poly_t *CharPolFactor(const Matrix_t *mat);
996 FPoly_t *CharPol(const Matrix_t *mat);
998 FPoly_t *MinPol(Matrix_t *mat);
999 
1000 
1001 
1002 /* ------------------------------------------------------------------
1003  The lattice package
1004  ------------------------------------------------------------------ */
1010 #define MAXGEN 20 /* Max. number of generators */
1011 #define LAT_MAXCF 200 /* Max. number of composition factors */
1012 #define MAXCYCL 30000 /* Max. number of cyclic submodules */
1013 #define MAXDOTL 90000 /* Max. number of dotted lines */
1014 #define MAXNSUB 20000 /* Max. number of submodules */
1015 #define LAT_MAXBASENAME 100
1016 
1017 typedef struct
1018 {
1019  long dim, num, mult;
1020  long idword;
1021  Poly_t *idpol;
1022  long peakword;
1023  Poly_t *peakpol;
1024  long nmount;
1025  long ndotl;
1026  long spl;
1027 }
1028 CfInfo;
1029 
1030 typedef struct
1031 {
1032  char BaseName[LAT_MAXBASENAME];
1033  int Field;
1034  int NGen;
1035  int NCf;
1036  CfInfo Cf[LAT_MAXCF];
1037  int NSocles;
1038  int *Socle;
1039  int NHeads;
1040  int *Head;
1041 } Lat_Info;
1042 
1043 int Lat_ReadInfo(Lat_Info *li, const char *basename);
1044 int Lat_WriteInfo(const Lat_Info *li);
1045 const char *Lat_CfName(const Lat_Info *li, int cf);
1046 int Lat_AddHead(Lat_Info *li, int *mult);
1047 int Lat_AddSocle(Lat_Info *li, int *mult);
1048 
1049 
1050 #define LAT_RG_INVERT 0x0001 /* Invert generators */
1051 #define LAT_RG_TRANSPOSE 0x0002 /* Transpose generators */
1052 #define LAT_RG_STD 0x0004 /* Use standard form */
1053 
1054 MatRep_t *Lat_ReadCfGens(Lat_Info *info, int cf, int flags);
1055 
1061 /* ------------------------------------------------------------------
1062  Tensor condensation package
1063  ------------------------------------------------------------------ */
1064 
1073 typedef struct
1074 {
1075  char NameM[LAT_MAXBASENAME];
1076  char NameN[LAT_MAXBASENAME];
1077  int Dim;
1078  int NCf;
1079  int CfIndex[2][LAT_MAXCF];
1080 } TkData_t;
1081 
1082 int TK_ReadInfo(TkData_t *tki, const char *name);
1083 int TK_WriteInfo(TkData_t *tki, const char *name);
1084 
1085 
1086 
1087 
1088 /* !!!!!!!!!!!!!!! 2.3 STUFF below !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
1089 /* !!!!!!!!!!!!!!! 2.3 STUFF below !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
1090 /* !!!!!!!!!!!!!!! 2.3 STUFF below !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
1091 
1092 
1093 
1094 /* ------------------------------------------------------------------
1095  Return codes
1096  ------------------------------------------------------------------ */
1097 
1098 #define EXIT_OK 0 /* Exit code: normal end */
1099 #define EXIT_ERR 1 /* error */
1100 
1101 
1102 
1103 /* ------------------------------------------------------------------
1104  Function operating on representations and vector spaces
1105  ------------------------------------------------------------------ */
1106 
1107 int IsIsomorphic(const MatRep_t *rep1, const CfInfo *info1,
1108  const MatRep_t *rep2, Matrix_t **trans, int use_pw);
1109 int MakeEndomorphisms(const MatRep_t *rep, const Matrix_t *nsp,
1110  Matrix_t *endo[]);
1111 Matrix_t *HomogeneousPart(MatRep_t *m, MatRep_t *s, Matrix_t *npw,
1112  const IntMatrix_t *op, int dimends);
1113 
1114 
1115 
1116 /* ------------------------------------------------------------------
1117  Lattice drawing functions
1118  ------------------------------------------------------------------ */
1119 
1123 typedef struct
1124 {
1125  double PosX, PosY; /* Position [0..1] */
1126  unsigned long UserData; /* User-defined attributes */
1127  int Layer; /* Layer number */
1128  double Score; /* Used in optimization */
1129  int ScoreCount;
1130 } LdNode_t;
1131 
1135 typedef struct
1136 {
1137  int NNodes;
1138  LdNode_t *Nodes;
1139  int *IsSub; /* Incidence relation, <NNodes> * <NNodes> entries */
1140  int *LayerNo; /* Layer numbers */
1141  int NLayers;
1142 } LdLattice_t;
1143 
1144 #define LD_ISSUB(l,i,k) ((l)->IsSub[(i) * (l)->NNodes + (k)])
1145 
1146 LdLattice_t *LdAlloc(int num_nodes);
1147 int LdFree(LdLattice_t *l);
1148 int LdAddIncidence(LdLattice_t *lat, int sub, int sup);
1149 int LdSetPositions(LdLattice_t *l);
1150 
1151 int ChangeBasis(const Matrix_t *M, int ngen, const Matrix_t *gen[],
1152  Matrix_t *newgen[]);
1153 
1154 
1155 #endif /* !defined(_MEATAXE_H_) */
1156 
1157 
void FfPermRow(PTR row, const long *perm, PTR result)
Multiply a Vector by a Permutation.
Definition: zpermrow.c:34
Poly_t ** Factor
List of irreducible factors.
Definition: meataxe.h:721
FPoly_t * Factorization(const Poly_t *pol)
Factor a polynomial.
Definition: berlekmp.c:282
int Nor
Number of rows.
Definition: meataxe.h:536
IntMatrix_t * ImatAlloc(int nor, int noc)
Create a New Integer Matrix.
Definition: imatcore.c:77
int FfOrder
Current field order.
Definition: zzz2.c:45
FEL mtx_tinsert[8][256]
table for insertion of a mark into a byte
Definition: maketabF.c:32
const char ** OrigArgV
Original argv from main().
Definition: meataxe.h:302
Matrix_t * SpinUpWithScript(const Matrix_t *seed, const MatRep_t *rep, const IntMatrix_t *script)
Spin-up with script.
Definition: spinup2.c:61
int SysRemoveDirectory(const char *name)
Remove a directory.
Definition: os.c:308
int FfCleanRow2(PTR row, PTR matrix, int nor, const int *piv, PTR row2)
Clean Row and Record Operations.
Definition: zcleanrow.c:69
int MatWrite(const Matrix_t *mat, FILE *f)
Write a matrix to a file.
Definition: matwrite.c:30
Poly_t * PolDivMod(Poly_t *a, const Poly_t *b)
Polynomial Division.
Definition: poldiv.c:45
int PolIsValid(const Poly_t *p)
Check a polynomial.
Definition: polcore.c:58
void StrFree(String *s)
Free a string.
Definition: string.c:133
FPoly_t * FpMul(FPoly_t *dest, const FPoly_t *src)
Multiply Factored Polynomials.
Definition: fpmul2.c:34
char * S
pointer to NUL terminated string
Definition: meataxe.h:233
FEL FfNeg(FEL a)
Finite field negative.
int PolFree(Poly_t *p)
Free a polynomial" This function frees a polynomial data structure and cleans up all internal data...
Definition: polcore.c:144
void StrAppend(String *s, const char *text)
Appends text to the end of a string.
Definition: string.c:166
int NumVecs
Total number of vectors in PrecalcData.
Definition: meataxe.h:618
int FfToInt(FEL f)
Convert field element to integer.
Definition: kernel-0.c:1073
int StfWriteVector(StfData *f, const char *name, int size, const int *value)
Write a Vector.
Definition: stfwrite.c:314
const GrExtractionTable_t * ExtrTab
Extraction table.
Definition: meataxe.h:620
long *** tabs
tables for different remainders of byte numbers mod grrows
Definition: meataxe.h:598
int LPR
Number of marks per byte (depends on field order)
Definition: kernel-0.c:28
Matrix_t * SpinUpWithPermutations(const Matrix_t *seed, int ngen, const Perm_t **gen, int flags, IntMatrix_t **script, SpinUpInfo_t *info)
Spin Up With Permutations.
Definition: spinup.c:600
PTR FfSubRowPartial(PTR dest, PTR src, int first, int len)
Subtract a part of two rows.
Definition: kernel-0.c:814
int ArgC
Number of arguments.
Definition: meataxe.h:303
Poly_t * PolGcd(const Poly_t *a, const Poly_t *b)
Greatest Common Divisor of two Polynomials.
Definition: polgcd.c:55
BitString_t * BsRead(FILE *f)
Read a bit string from a file.
Definition: bsread.c:31
FEL FfFromInt(int l)
Convert integer to field element.
Definition: kernel-0.c:1056
int StfGetString(StfData *f, char *buf, size_t bufsize)
Read a string.
Definition: stfread.c:208
FILE * File
The stream we&#39;re using.
Definition: meataxe.h:470
WgData_t * WgAlloc(const MatRep_t *rep)
Initialize the word generator.
Definition: wgen.c:426
MatRep_t * MrLoad(const char *basename, int ngen)
Load a Matrix Representation.
Definition: mrread.c:40
const char * Help
Help text.
Definition: meataxe.h:288
Structured text file.
Definition: meataxe.h:468
char * Name
File name.
Definition: meataxe.h:517
const char * Text
Error message.
Definition: meataxe.h:380
int * Description
Symbolic description of a word.
Definition: meataxe.h:902
int MatSave(const Matrix_t *mat, const char *fn)
Write a matrix to a file.
Definition: matwrite.c:66
int Size
Number of elements.
Definition: meataxe.h:779
int Noc
Number of columns.
Definition: meataxe.h:515
long CharPolSeed
Seed for Characteristic Polynomial.
Definition: charpol.c:37
int GrMatIsValid(const GreasedMatrix_t *mat)
Check a greased matrix.
Definition: grmatcore.c:53
int FfReadRows(FILE *f, PTR buf, int n)
Read Rows This function reads 1 or more rows from a file.
Definition: ffio.c:57
int BsClear(BitString_t *bs, int i)
Clear one bit in a bit string.
void MtxRandomInit(unsigned seed)
Initialize the random number generator.
Definition: random.c:49
Matrix_t * MatMulStrassen(Matrix_t *dest, const Matrix_t *A, const Matrix_t *B)
Multiply matrices.
Definition: window.c:1010
Poly_t * CharPolFactor(const Matrix_t *mat)
Characteristic Polynomial.
Definition: charpol.c:219
int MatClean(Matrix_t *mat, const Matrix_t *sub)
Clean a matrix.
Definition: matclean.c:35
PTR Data
Data, organized as array of rows.
Definition: meataxe.h:538
int OptInd
Used internally.
Definition: meataxe.h:308
int BufSize
Used internally for memory management.
Definition: meataxe.h:686
int MsClean(const MatrixSet_t *set, Matrix_t *mat)
Clean a Matrix with a Matrix Set.
Definition: msclean.c:58
unsigned long Magic
Used internally.
Definition: meataxe.h:718
int StfPutInt(StfData *f, int value)
Write an Integer.
Definition: stfwrite.c:59
int PermIsValid(const Perm_t *p)
Check a permutation.
Definition: permcore.c:61
int PolCompare(const Poly_t *a, const Poly_t *b)
Compare Two Plynomials.
Definition: polcmp.c:39
int BufSize
Used internally for memory management.
Definition: meataxe.h:720
void FfExtractColumn(PTR mat, int nor, int col, PTR result)
!section kernel.ff.row Extract one column of a matrix.
Definition: kernel-0.c:1280
int SysFseek(FILE *f, long pos)
Set file pointer.
Definition: os.c:270
FEL mtx_tmult[256][256]
table for field element multiplication
Definition: maketabF.c:32
int SpinUpInfoInit(SpinUpInfo_t *info)
Initialize spin-up parameters.
Definition: spinup.c:629
int SetIsValid(const Set_t *s)
Check a set.
Definition: setcore.c:50
int MPB
Number of marks per byte.
Definition: meataxe.h:621
MeatAxe data file object.
Definition: meataxe.h:510
int BsFree(BitString_t *bs)
Free a bit string.
Definition: bscore.c:126
int FfFindPivot(PTR row, FEL *mark)
Find pivot column.
Definition: kernel-0.c:1392
int ImatIsValid(const IntMatrix_t *m)
Check an Integer Matrix.
Definition: imatcore.c:48
FEL * PTR
A pointer to a row vector.
Definition: meataxe.h:79
int FfChar
Current characteristic.
Definition: zzz2.c:36
int * Mult
Multiplicity of each factor.
Definition: meataxe.h:722
long * Data
The elements in ascending order.
Definition: meataxe.h:781
unsigned char FEL
A finite field element.
Definition: meataxe.h:78
int * WgDescribeWord(WgData_t *b, long n)
Creates a symbolic description of a word.
Definition: wgen.c:334
int BsWrite(BitString_t *bs, FILE *f)
Write a bit string to a file.
Definition: bswrite.c:32
Matrix_t * SpinUp(const Matrix_t *seed, const MatRep_t *rep, int flags, IntMatrix_t **script, SpinUpInfo_t *info)
Spin up.
Definition: spinup.c:576
File information.
Definition: meataxe.h:363
int PermCompare(const Perm_t *a, const Perm_t *b)
Compare two permutations.
Definition: permcmp.c:39
int * Socle
Mult.
Definition: meataxe.h:1038
int NSocles
Loewy length.
Definition: meataxe.h:1037
A Polynomial.
Definition: meataxe.h:679
int MatFree(Matrix_t *mat)
Delete a matrix.
Definition: matcore.c:205
IntMatrix_t * ImatLoad(const char *fn)
Read an Integer Matrix From a File.
Definition: imatread.c:65
int StfWriteInt(StfData *f, const char *name, int value)
Write an Integer.
Definition: stfwrite.c:276
A bit string.
Definition: meataxe.h:734
int StfBeginEntry(StfData *f, const char *name)
Start a New Entry.
Definition: stfwrite.c:158
int FfSetField(int field)
Set the field order.
Definition: kernel-0.c:385
Node in a graphical lattice representation.
Definition: meataxe.h:1123
Matrix_t * MatCutRows(const Matrix_t *src, int row1, int nrows)
Copy a range of rows of a matrix.
Definition: matcut.c:130
void StrassenSetCutoff(size_t size)
Set the cutoff for Winograd-Strassen multiplication.
Definition: window.c:68
int MtxFormatMessage(char *buf, int bufsize, const char *msg, va_list al)
Format a message.
Definition: message.c:164
Poly_t * PolDerive(Poly_t *pol)
Derive a Polynomial.
Definition: polderive.c:43
int StfPut(StfData *f, const char *text)
Write a Raw Value.
Definition: stfwrite.c:32
A dynamic string.
Definition: meataxe.h:232
BitString_t * BsAlloc(int size)
Create a bit string.
Definition: bscore.c:86
FEL FfRestrict(FEL a, int subfield)
Restrict to a subfield.
Definition: kernel-0.c:508
int MrSave(const MatRep_t *rep, const char *basename)
Save a Matrix Representation.
Definition: mrwrite.c:34
int NHeads
Number of radical layers.
Definition: meataxe.h:1039
Matrix_t * MatMulScalar(Matrix_t *dest, FEL coeff)
Multiply a Matrix by a Constant.
Definition: mmulscal.c:27
Matrix_t * MatLoad(const char *fn)
Read a matrix from a file.
Definition: matread.c:73
int BufSize
Used internally for memory management.
Definition: meataxe.h:780
Matrix_t * MatTransposed(const Matrix_t *src)
Transpose a matrix.
Definition: mattr.c:27
String StrAlloc(size_t initial_capacity)
Create a string.
Definition: string.c:119
int SysFseekRelative(FILE *file, long distance)
Set file pointer relative to current position.
Definition: os.c:356
Set_t * SetAlloc()
Create a new set.
Definition: setcore.c:81
size_t FfRowSize(int noc)
Calculate row size.
Definition: kernel-0.c:444
Tensor condensation state.
Definition: meataxe.h:1073
FEL mtx_tffirst[256][2]
table for value and index of the first non-zero mark in byte
Definition: maketabF.c:32
int FfWriteRows(FILE *f, PTR buf, int n)
Write rows This function writes 1 or more rows to a file.
Definition: ffio.c:95
FEL mtx_textract[8][256]
table for extraction of a mark from a byte
Definition: maketabF.c:32
PTR FfAddRow(PTR dest, PTR src)
Add two rows.
Definition: kernel-0.c:576
StfData * StfOpen(const char *name, int mode)
Open a Structured Text File.
Definition: stfcore.c:133
Application information structure.
Definition: meataxe.h:284
int AppFree(MtxApplication_t *a)
End an application.
Definition: args.c:414
int Noc
Number of columns.
Definition: meataxe.h:537
int MfClose(MtxFile_t *file)
Close a File.
Definition: mfcore.c:170
FEL FfExtract(PTR row, int col)
!function FfExtract "Extract a mark from a row"
Definition: kernel-0.c:1364
Perm_t * PermPower(const Perm_t *p, int n)
Power of a permutation This function calculates the n-th power of a permutation.
Definition: permpwr.c:36
int nrtabs
number of tables used
Definition: meataxe.h:600
int ImatFree(IntMatrix_t *mat)
Delete an Integer Matrix.
Definition: imatcore.c:124
int * PivotTable
Pivot table (if matrix is in echelon form) .
Definition: meataxe.h:540
int Nor
Number of rows.
Definition: meataxe.h:614
size_t FfCurrentRowSize
Row size.
Definition: kernel-0.c:214
const char * Lat_CfName(const Lat_Info *li, int cf)
Make Constituent Name.
Definition: cfinfo.c:428
int MsFree(MatrixSet_t *set)
Free a Matrix Set.
Definition: mscore.c:159
void * SysMalloc(size_t nbytes)
Allocate memory.
Definition: os.c:370
void FfCleanRow(PTR row, PTR matrix, int nor, const int *piv)
Clean Row.
Definition: zcleanrow.c:36
Matrix_t * MatDup(const Matrix_t *src)
Duplicate a matrix This function creates a copy of an existing matrix.
Definition: matdup.c:30
int BsAnd(BitString_t *dest, const BitString_t *src)
Intersection of two bit strings.
Definition: bsand.c:32
FPoly_t * CharPol(const Matrix_t *mat)
Characteristic Polynomial.
Definition: charpol.c:274
Matrix_t * MatTensor(const Matrix_t *m1, const Matrix_t *m2)
Tensor Product.
Definition: mtensor.c:36
int PermFree(Perm_t *p)
Free a permutation.
Definition: permcore.c:143
void FfFree(PTR x)
Free memory.
Definition: zzz2.c:110
long gcd(long a, long b)
Greatest Common Divisor.
Definition: gcd.c:31
FPoly_t * FpMulP(FPoly_t *dest, const Poly_t *src, int pwr)
Multiply With an Irreducible Polynomial.
Definition: fpmul.c:36
int AppGetOption(MtxApplication_t *app, const char *spec)
Check for command line option.
Definition: args.c:468
long SysTimeUsed(void)
CPU time.
Definition: os.c:104
Matrix_t * QProjection(const Matrix_t *subspace, const Matrix_t *vectors)
Projection on Quotient.
Definition: quotient.c:57
int ImatWrite(const IntMatrix_t *mat, FILE *f)
Write an integer matrix to a file.
Definition: imatwrite.c:30
FEL FfScalarProduct(PTR a, PTR b)
Scalar Product of Two Vectors.
Definition: kernel-0.c:1232
Perm_t * PermRead(FILE *f)
Read a Permutation from a File.
Definition: permread.c:60
Matrix_t * MatAlloc(int field, int nor, int noc)
Create a new matrix.
Definition: matcore.c:109
int BsCompare(const BitString_t *a, const BitString_t *b)
Compare two bit strings.
Definition: bsop.c:50
int WgFree(WgData_t *b)
Terminate the word generator.
Definition: wgen.c:467
PTR FfAlloc(int nor)
Allocate memory and initialize This function allocates a block of memory for a vector (if nrows is 1)...
Definition: zzz2.c:78
MtxApplicationInfo_t const * AppInfo
Program name and description.
Definition: meataxe.h:300
int StfWriteString(StfData *f, const char *name, const char *value)
Write a String.
Definition: stfwrite.c:239
const char * WgSymbolicName(WgData_t *b, long n)
Symbolic name of a word.
Definition: wgen.c:257
int FfSeekRow(FILE *f, int pos)
Move to a Row.
Definition: ffio.c:139
FEL FfGen
Generator.
Definition: zzz2.c:53
int NCf
Number of relevant constituents.
Definition: meataxe.h:1078
int MrAddGenerator(MatRep_t *rep, Matrix_t *gen, int flags)
Add a Matrix to a Representation.
Definition: mraddgen.c:37
long int MtxRandom(void)
Get the next (Pseudo-)Random number.
Definition: random.c:69
int PolGcdEx(const Poly_t *a, const Poly_t *b, Poly_t **result)
Greatest Common Divisor of two Polynomials.
Definition: polgcd.c:138
int PolWrite(const Poly_t *p, FILE *f)
Write a polynomial to a file.
Definition: polwrite.c:58
void SysSetTimeLimit(long nsecs)
Set CPU time limit.
Definition: os.c:175
void SysInit(void)
OS-specific initialization.
Definition: os.c:88
void * SysRealloc(void *buf, size_t nbytes)
Resize memory block.
Definition: os.c:392
PTR FfSubRow(PTR dest, PTR src)
Subtract two rows.
Definition: kernel-0.c:724
int MakeEndomorphisms(const MatRep_t *rep, const Matrix_t *nsp, Matrix_t *endo[])
Calculate the endomorphism ring.
Definition: mkendo.c:67
long nmount
Number of mountains.
Definition: meataxe.h:1024
Matrix_t * SAction(const Matrix_t *sub, const Matrix_t *gen)
Action on a subspace.
Definition: saction.c:44
Matrix_t * MatNullSpace__(Matrix_t *mat)
Null-space of a matrix This function calculates the null-space of a matrix and deletes the original m...
Definition: matnull.c:224
unsigned long Magic
Used internally.
Definition: meataxe.h:736
int LineNo
Line in which the error is raised.
Definition: meataxe.h:379
int MatIsValid(const Matrix_t *m)
Check if the matrix is valid.
Definition: matcore.c:81
Matrix_t * MatInverse(const Matrix_t *src)
Inverse of a matrix This function calculates the inverse of a matrix.
Definition: matinv.c:98
const char ** ArgV
Arguments.
Definition: meataxe.h:304
const MtxFileInfo_t * FileInfo
File that is raising the error.
Definition: meataxe.h:378
const char * BaseName
Base name of the file.
Definition: meataxe.h:366
const char * StfGetName(StfData *f)
Get Entry Name.
Definition: stfread.c:93
Matrix_t * MatInsert_(Matrix_t *mat, const Poly_t *pol)
Insert a matrix into a polynomial Given a square matrix A and a polynomial p over the same field...
Definition: matins.c:31
const char * Name
Path to the file.
Definition: meataxe.h:365
FPoly_t * MinPol(Matrix_t *mat)
Minimal polynomial.
Definition: minpol.c:266
const GrExtractionTable_t * GrGetExtractionTable(int fl, int grrows)
Calculate extraction table for grease.
Definition: grtable.c:168
FEL mtx_taddinv[256]
table for field element negation
Definition: maketabF.c:32
char * LineBuf
Buffers one &#39;line&#39;.
Definition: meataxe.h:471
Matrix_t * QAction(const Matrix_t *sub, const Matrix_t *gen)
Action on Quotient.
Definition: quotient.c:135
int StfMatch(StfData *f, const char *pattern)
Skip text.
Definition: stfread.c:291
void FfInsert(PTR row, int col, FEL mark)
This function inserts the field element mark at position col into row.
Definition: kernel-0.c:1328
int GrMatFree(GreasedMatrix_t *mat)
Free a greased matrix.
Definition: grmatcore.c:84
Poly_t * PolRead(FILE *f)
Read a Polynomial from a File.
Definition: polread.c:60
Poly_t * MinPolFactor(Matrix_t *mat)
Minimal Polynomial.
Definition: minpol.c:211
int StfGetInt(StfData *f, int *buf)
Read an Integer.
Definition: stfread.c:155
BitString_t * BsCopy(BitString_t *dest, const BitString_t *src)
Copy a bit string.
Definition: bsop.c:70
Poly_t * PolMod(Poly_t *a, const Poly_t *b)
Polynomial division.
Definition: poldiv.c:109
GreasedMatrix_t * GrMatAlloc(const Matrix_t *M, int gr_rows)
Create a greased matrix.
Definition: grmatcore.c:115
const char * OptArg
Used internally.
Definition: meataxe.h:307
FEL * Data
Coefficients.
Definition: meataxe.h:684
Word Generator Data.
Definition: meataxe.h:897
FILE * SysFopen(const char *name, int mode)
Open a file.
Definition: os.c:218
FEL mtx_tadd[256][256]
table for field element addition
Definition: maketabF.c:32
int * Head
Mult.
Definition: meataxe.h:1040
BitString_t * BsDup(const BitString_t *src)
Duplicate a bit string.
Definition: bsdup.c:30
void GrMapRow(PTR v, GreasedMatrix_t *M, PTR w)
Multiply a vector by a greased matrix.
Definition: grmaprow.c:131
unsigned long Magic
Used internally.
Definition: meataxe.h:612
int SysRemoveFile(const char *name)
Remove a file This function deletes a file.
Definition: os.c:287
Extraction table for greasing.
Definition: meataxe.h:597
A matrix over a finite field.
Definition: meataxe.h:532
int * nrvals
number of values produced by each table
Definition: meataxe.h:599
Matrix_t * MatNullSpace(const Matrix_t *mat)
Null-space of a matrix This function calculates the null-space of a matrix.
Definition: matnull.c:195
int StfPutVector(StfData *f, int size, const int *value)
Write a Vector.
Definition: stfwrite.c:107
int StfPutString(StfData *f, const char *text)
Write a String.
Definition: stfwrite.c:71
MtxFile_t * MfCreate(const char *name, int field, int nor, int noc)
Open a File for Writing.
Definition: mfcore.c:135
void PolPrint(char *name, const Poly_t *p)
Print a Polynomial This function prints a polynomial on the standard output in a human-readable form...
Definition: polprint.c:38
void FfMulRow(PTR row, FEL mark)
Multiply a row by a coefficient.
Definition: kernel-0.c:986
A matrix representation.
Definition: meataxe.h:873
int StfReadLine(StfData *f)
Read Next Line.
Definition: stfread.c:35
Perm_t * PermLoad(const char *fn)
Read a permutation.
Definition: permread.c:105
int Lat_ReadInfo(Lat_Info *li, const char *basename)
Read a Lattice Information File.
Definition: cfinfo.c:152
int MtxRandomInt(int max)
Random number.
Definition: random.c:97
int OrigArgC
Original argc from main().
Definition: meataxe.h:301
size_t FfTrueRowSize(int noc)
Number of used bytes in a row.
Definition: kernel-0.c:460
Application data.
Definition: meataxe.h:298
int SysReadLong32(FILE *f, long *buf, int n)
Read long integers.
Definition: intio.c:44
void FfCopyRow(PTR dest, PTR src)
Copy a row.
Definition: zzz2.c:127
MtxErrorHandler_t * MtxSetErrorHandler(MtxErrorHandler_t *h)
Define an error handler.
Definition: error.c:111
Perm_t * PermInverse(const Perm_t *src)
Inverse of a permutation This function calulates the inverse of a permutation.
Definition: perminv.c:33
Matrix_t * WgMakeWord(WgData_t *b, long n)
Calculates a Word.
Definition: wgen.c:366
int TK_ReadInfo(TkData_t *tki, const char *name)
Read a .tki file.
Definition: tkinfo.c:126
const MatRep_t * Rep
The representation.
Definition: meataxe.h:899
FEL mtx_tmultinv[256]
table for field element inversion
Definition: maketabF.c:32
A Permutation.
Definition: meataxe.h:644
Poly_t * PolDup(const Poly_t *p)
Duplicate a Polynomial.
Definition: poldup.c:33
PTR FfGetPtr(PTR base, int row)
Get row pointer.
Definition: zzz2.c:180
MtxApplication_t * AppAlloc(MtxApplicationInfo_t const *ai, int argc, const char **argv)
Initialize the application.
Definition: args.c:337
int BsMinus(BitString_t *dest, const BitString_t *src)
Difference of two bit strings.
Definition: bsminus.c:34
unsigned long Magic
Used internally.
Definition: meataxe.h:646
void WgMakeFingerPrint(WgData_t *b, int fp[6])
Calculate finger print.
Definition: wgen.c:506
unsigned long Magic
Used internally.
Definition: meataxe.h:512
void Mat_DeletePivotTable(Matrix_t *mat)
Delete the pivot table of a matrix.
Definition: matcore.c:187
int Dim
Dimension of condensed module.
Definition: meataxe.h:1077
Matrix_t * MatCut(const Matrix_t *src, int row1, int col1, int nrows, int ncols)
Cut a rectangle out of a matrix.
Definition: matcut.c:47
void BsPrint(const char *name, const BitString_t *bs)
Print a bit string on stdout.
Definition: bsprint.c:35
int MatPivotize(Matrix_t *mat)
Reduce to echelon form.
Definition: matpivot.c:72
int PermOrder(const Perm_t *perm)
Order of a permutation.
Definition: permorder.c:32
int Degree
Degree of the polynomial.
Definition: meataxe.h:683
Matrix_t * MatId(int fl, int nor)
Identity matrix This function creates an identity matrix with nor nows over GF(fl).
Definition: matid.c:34
int Noc
Number of columns.
Definition: meataxe.h:615
Graphical lattice representation.
Definition: meataxe.h:1135
FEL FfMul(FEL a, FEL b)
Finite field multiplication.
int PermSave(const Perm_t *perm, const char *fn)
Write a Permutation to a File.
Definition: permwrite.c:69
int Field
Field order or type id.
Definition: meataxe.h:513
int MatCompare(const Matrix_t *a, const Matrix_t *b)
Compare two matrices If the matrices are equal, the return value is 0.
Definition: matcmp.c:44
Perm_t * PermAlloc(int deg)
Allocate a permutation This function creates a permutation of the specified degree.
Definition: permcore.c:101
FILE * FfWriteHeader(const char *name, int fld, int nor, int noc)
Open File and Write Header.
Definition: ffio.c:221
int NFactors
Number of different irreducible factors.
Definition: meataxe.h:719
int FfCurrentRowSizeIo
I/O row size.
Definition: kernel-0.c:224
long ndotl
Number of dotted lines.
Definition: meataxe.h:1025
const char * AppCreateTempDir(MtxApplication_t *app)
Create a temporary directory.
Definition: args.c:712
Perm_t * PermMul(Perm_t *dest, const Perm_t *src)
Multiply permutations.
Definition: permmul.c:35
long * Data
Marks (row by row).
Definition: meataxe.h:803
char MtxLibDir[1024]
MeatAxe library directory (for multiplication tables etc.)
Definition: args.c:142
int Field
Field order.
Definition: meataxe.h:682
long MatNullity(const Matrix_t *mat)
Nullity of a matrix.
Definition: matech.c:154
MatrixSet_t * MsAlloc()
Allocate a Matrix Set.
Definition: mscore.c:134
An element of a matrix set.
Definition: meataxe.h:843
int Field
Field size.
Definition: meataxe.h:613
Matrix_t * TensorMap(Matrix_t *vec, const Matrix_t *a, const Matrix_t *b)
Map Under Tensor Product.
Definition: temap.c:40
void FfAddMulRowPartial(PTR dest, PTR src, FEL f, int first, int len)
Add a multiple of a part of a row.
Definition: kernel-0.c:944
FILE * File
File to read frmo/write to.
Definition: meataxe.h:516
int FfStepPtr(PTR *x)
Advance to next row.
Definition: zzz2.c:209
Constituent data structure.
Definition: meataxe.h:1017
const char * FfToGap(FEL f)
Convert to GAP format.
Definition: zgap.c:27
int MtxError(MtxFileInfo_t *fi, int line, const char *text,...)
Signal an error.
Definition: error.c:135
A Set of Integers.
Definition: meataxe.h:776
Matrix_t * VectorToMatrix(Matrix_t *vecs, int n, int noc)
Convert vector to matrix.
Definition: vec2mat.c:41
void MtxErrorHandler_t(const MtxErrorRecord_t *)
Error handlers.
Definition: meataxe.h:388
int FpFree(FPoly_t *x)
Free a Factored Polynomial.
Definition: fpcore.c:133
void FfAddMulRow(PTR dest, PTR src, FEL f)
Add a multiple of a row.
Definition: kernel-0.c:1022
int BsIsValid(const BitString_t *bs)
Check if a bit string is valid.
Definition: bscore.c:54
FEL FfInv(FEL a)
Finite field inversion.
int AppGetCountedOption(MtxApplication_t *app, const char *spec)
Count repeatable command line option.
Definition: args.c:494
int MatOrder(const Matrix_t *mat)
Order of a matrix.
Definition: matorder.c:38
int StfEndEntry(StfData *f)
End Entry.
Definition: stfwrite.c:180
FEL FfDiv(FEL a, FEL b)
Finite field division.
int FpIsValid(const FPoly_t *p)
Check a Factored Polynomial.
Definition: fpcore.c:41
FEL FfEmbed(FEL a, int subfield)
Embed a subfield.
Definition: kernel-0.c:479
int MrFree(MatRep_t *rep)
Delete a Matrix Representation.
Definition: mrcore.c:221
int AppGetIntOption(MtxApplication_t *app, const char *spec, int dflt, int min, int max)
Check for integer-valued option.
Definition: args.c:567
int StfClose(StfData *f)
Close a Structured Text File.
Definition: stfcore.c:71
void SysFree(void *x)
Free memory block.
Definition: os.c:411
FPoly_t * FpAlloc()
Allocate a Factored Polynomial.
Definition: fpcore.c:92
int FfSetNoc(int noc)
Set the row length.
Definition: kernel-0.c:413
Matrix_t * MatPower(const Matrix_t *mat, long n)
!section obj.mat Power of a matrix.
Definition: matpwr.c:96
FILE * FfReadHeader(const char *name, int *fld, int *nor, int *noc)
Open File and Read Header.
Definition: ffio.c:169
long peakword
Peak word.
Definition: meataxe.h:1022
Matrix_t * MatNullSpace_(Matrix_t *mat, int flags)
Null-space of a matrix This function calculates the null-space of a matrix.
Definition: matnull.c:139
int Lat_AddHead(Lat_Info *li, int *mult)
Add a Layer to the Radical Series.
Definition: cfinfo.c:476
int BsClearAll(BitString_t *bs)
Clear a bit string This function clears all bits in a bit string.
Definition: bsop.c:33
PTR FfAddRowPartial(PTR dest, PTR src, int first, int len)
Add a part of two rows.
Definition: kernel-0.c:666
int MtxMessageLevel
Message level.
Definition: message.c:31
PTR MatGetPtr(const Matrix_t *mat, int row)
Pointer to a row of a matrix.
Definition: matcore.c:162
int Size
Number of bits.
Definition: meataxe.h:737
int MatrixToVector(const Matrix_t *mat, Matrix_t *vecs, int n)
Convert matrix to vector.
Definition: mat2vec.c:40
FEL FfSub(FEL a, FEL b)
Finite field subtraction.
unsigned long Magic
Used internally.
Definition: meataxe.h:681
int LineNo
Current line number (reading and writing)
Definition: meataxe.h:475
Poly_t * PolAdd(Poly_t *dest, const Poly_t *src)
Add Polynomials.
Definition: poladd.c:63
int SysGetPid()
Get process id.
Definition: os.c:427
int AppGetArguments(MtxApplication_t *app, int min_argc, int max_argc)
Get command line arguments.
Definition: args.c:648
Poly_t * PolAlloc(int fl, int n)
Allocate a polynomial This function creates the polynomial p(x)=x^n over the current field...
Definition: polcore.c:102
int Nor
Number of rows.
Definition: meataxe.h:514
int MtxPrintMessage(FILE *f, const char *fmt,...)
Print a message.
Definition: message.c:218
size_t RowSize
Size (in bytes) of one row.
Definition: meataxe.h:539
const char * Name
Program name.
Definition: meataxe.h:286
int Nor
Number of rows.
Definition: meataxe.h:801
const char * AppGetTextOption(MtxApplication_t *app, const char *spec, const char *dflt)
Check for command line option.
Definition: args.c:521
void PermPrint(const char *name, const Perm_t *perm)
Print a permutation This function prints a permutation on the standard output using cycle notation...
Definition: permprint.c:44
long idword
Identifying word.
Definition: meataxe.h:1020
MatRep_t * MrTransposed(const MatRep_t *rep)
Transpose a Representation.
Definition: mrtranspose.c:29
int TK_WriteInfo(TkData_t *tki, const char *name)
Write a .tki file.
Definition: tkinfo.c:163
MatRep_t * MrAlloc(int ngen, Matrix_t **gen, int flags)
Create a Matrix Representation.
Definition: mrcore.c:149
int FpPrint(const char *name, const FPoly_t *p)
Print a factored polynomial.
Definition: fpprint.c:35
int SysCreateDirectory(const char *name)
Create a directory.
Definition: os.c:331
int FfSumAndIntersection(PTR wrk1, int *nor1, int *nor2, PTR wrk2, int *piv)
Sum and Intersection of Two Vector Spaces.
Definition: sumint.c:48
int Split(Matrix_t *subspace, const MatRep_t *rep, MatRep_t **sub, MatRep_t **quot)
Split a Representation.
Definition: split.c:102
int OptEnd
Used internally.
Definition: meataxe.h:305
A Factored Polynomial.
Definition: meataxe.h:716
Perm_t * PermDup(const Perm_t *src)
Duplicate a permutation.
Definition: permdup.c:32
Matrix_t * MatRead(FILE *f)
Read a matrix from a file.
Definition: matread.c:29
int Degree
Degree of the permutation.
Definition: meataxe.h:647
int GrRows
Grease level (# of rows, 0=no grease)
Definition: meataxe.h:616
long * Data
Images of 0,1,2,...
Definition: meataxe.h:648
Matrix_t * MatMul(Matrix_t *dest, const Matrix_t *src)
Multiply matrices This function multiplies dest from the right by src.
Definition: matmul.c:41
Matrix_t * MatInsert(const Matrix_t *mat, const Poly_t *pol)
Insert a matrix into a polynomial Given a square matrix A and a polynomial p over the same field...
Definition: matins.c:119
int Lat_AddSocle(Lat_Info *li, int *mult)
Add a Layer to the Socle Series.
Definition: cfinfo.c:459
char MtxBinDir[1024]
MeatAxe program directory.
Definition: args.c:128
Matrix_t * MatAdd(Matrix_t *dest, const Matrix_t *src)
Sum of two matrices.
Definition: matadd.c:32
int SetFree(Set_t *x)
Destroy a set.
Definition: setcore.c:115
Set_t * SetDup(const Set_t *s)
Duplicate a set.
Definition: setcore.c:134
int MatCopyRegion(Matrix_t *dest, int destrow, int destcol, const Matrix_t *src, int row1, int col1, int nrows, int ncols)
Copy a rectangular region of a matrix This function copies a rectangular region of src tp dest...
Definition: matcopy.c:48
long MatNullity__(Matrix_t *mat)
Nullity of a matrix.
Definition: matech.c:169
void Pol_Normalize(Poly_t *p)
Normalize a polynomial.
Definition: polcore.c:161
char * GetPtr
Current input position.
Definition: meataxe.h:472
int SetContains(const Set_t *set, long elem)
Check if a number is in a set.
Definition: settest.c:31
int SetInsert(Set_t *set, long elem)
Insert an element into a set.
Definition: setinsert.c:33
int MfIsValid(const MtxFile_t *file)
Check a File Object.
Definition: mfcore.c:42
int BsSet(BitString_t *bs, int i)
Set one bit in a bit string.
int StfWriteValue(StfData *f, const char *name, const char *value)
Write a String.
Definition: stfwrite.c:206
unsigned long Magic
Used internally.
Definition: meataxe.h:534
int MatEchelonize(Matrix_t *mat)
Reduce to echelon form This function performs a Gaussian elimination on the matrix |mat|...
Definition: matech.c:90
int Field
Field order.
Definition: meataxe.h:1033
int BsIsSub(const BitString_t *a, const BitString_t *b)
Bit string incidence relation.
Definition: bsissub.c:32
void StrPrintF(String *s, const char *fmt,...)
snprintf() replacement.
Definition: string.c:248
void StrAppendF(String *s, const char *fmt,...)
snprintf() replacement.
Definition: string.c:206
void FfMapRow(PTR row, PTR matrix, int nor, PTR result)
Multiply a vector by a matrix.
Definition: kernel-0.c:1093
FEL MatTrace(const Matrix_t *mat)
Trace of a Matrix.
Definition: mattrace.c:27
int OutPos
Number of chars in current line (writing only)
Definition: meataxe.h:474
int PermWrite(const Perm_t *perm, FILE *f)
Write a Permutation to a File.
Definition: permwrite.c:34
int Lat_WriteInfo(const Lat_Info *li)
Write a Lattice Information File.
Definition: cfinfo.c:312
int BsTest(const BitString_t *bs, int i)
Test a bit in a bit string.
int NGen
Number of generators.
Definition: meataxe.h:1034
FEL FfAdd(FEL a, FEL b)
Long ints per row.
int MsCleanAndAppend(MatrixSet_t *set, Matrix_t *mat)
Extend a Matrix Set.
Definition: msclean.c:109
MtxFile_t * MfOpen(const char *name)
Open a File for Reading.
Definition: mfcore.c:90
int BsOr(BitString_t *dest, const BitString_t *src)
Union of two bit strings.
Definition: bsor.c:33
int PolSave(const Poly_t *pol, const char *fn)
Write a Polynomial to a File.
Definition: polwrite.c:102
A greased matrix.
Definition: meataxe.h:610
int MsIsValid(const MatrixSet_t *set)
Check a Matrix Set.
Definition: mscore.c:64
int FfCleanRowAndRepeat(PTR row, PTR mat, int nor, const int *piv, PTR row2, PTR mat2)
Clean Row and Repeat Operations.
Definition: zcleanrow.c:107
void MatPrint(const char *name, const Matrix_t *m)
Print a Matrix on stdout.
Definition: matprint.c:35
int FfNoc
Current number of columns for row ops.
Definition: zzz2.c:63
int BsIntersectionCount(const BitString_t *a, const BitString_t *b)
Intersection count.
Definition: bsmatch.c:54
int MrIsValid(const MatRep_t *rep)
Check a Matrix Representation.
Definition: mrcore.c:107
int GrBlockSize
Vectors per block (= Field^GrRows)
Definition: meataxe.h:617
const char * Description
One-line description of the program.
Definition: meataxe.h:287
int BufSize
Used internally for memory management.
Definition: meataxe.h:738
PTR PrecalcData
Precalculated data.
Definition: meataxe.h:619
int LineBufSize
Current buffer size.
Definition: meataxe.h:473
int ImatSave(const IntMatrix_t *mat, const char *file_name)
Write an Integer Matrix to a File.
Definition: imatwrite.c:62
int Noc
Number of colums.
Definition: meataxe.h:802
void FfSwapRows(PTR dest, PTR src)
Exchange two rows This function exchanges the contents of two rows.
Definition: zzz2.c:145
int FfCmpRows(PTR p1, PTR p2)
Compare two Rows.
Definition: zcmprow.c:37
An Integer Matrix.
Definition: meataxe.h:798
IntMatrix_t * ImatRead(FILE *f)
Read an integer matrix from a file.
Definition: imatread.c:30
Poly_t * PolMul(Poly_t *dest, const Poly_t *src)
Multiply Polynomials.
Definition: polmul.c:35
A set of matrices.
Definition: meataxe.h:855
int SysWriteLong32(FILE *f, const long *buf, int n)
Write long integers.
Definition: intio.c:102
PTR FfSubRowPartialReverse(PTR dest, PTR src, int first, int len)
Subtract a part of two rows.
Definition: kernel-0.c:877
int StfGetVector(StfData *f, int *bufsize, int *buf)
Read a vector.
Definition: stfread.c:361
int Field
Field order.
Definition: meataxe.h:535
Run-time errors.
Definition: meataxe.h:376
long spl
Degree of splitting field.
Definition: meataxe.h:1026
Spin-up Parameters.
Definition: meataxe.h:935
long lcm(long a, long b)
Least Common Multiple.
Definition: gcd.c:57
MatRep_t * Lat_ReadCfGens(Lat_Info *info, int cf, int flags)
Load a Constituent.
Definition: rdcfgen.c:37
Poly_t * PolLoad(const char *fn)
Read a Polynomial from a File.
Definition: polread.c:115
Module Structure Information.
Definition: meataxe.h:1030
int NCf
Number of irred.
Definition: meataxe.h:1035
unsigned long Magic
Used internally.
Definition: meataxe.h:778

SharedMeatAxe 1.0 documentation, generated on Sat Dec 30 2017 12:13:21