Skip to content

Commit

Permalink
Version 1.0c
Browse files Browse the repository at this point in the history
  • Loading branch information
carat committed Nov 20, 2018
1 parent aec25b8 commit f6dae84
Show file tree
Hide file tree
Showing 165 changed files with 7,895 additions and 5,137 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
############################################################################


TOPDIR= /usb/carat/tmp/carat
CC = cc
TOPDIR= /usb/carat
CC = gcc

# There are some special preprocessor flags which set some
# memory diagnostics:
Expand All @@ -28,11 +28,11 @@ CC = cc
# have a general control whats going on. THIS IS VERY SLOW.
# For the normal user we recommend neither to use -DDIAG1 nor -DDIAG2!

# CFLAGS = -g -fwritable-strings -DDIAG1 # for a HP-UX-machine using gcc (momo)
CFLAGS = -g -fPIC -fwritable-strings -DDIAG1 # for a HP-UX-machine using gcc (momo)
# the flag -fwritable-strings is
# required for the use with gcc

CFLAGS = -g -Aa # for a HP-UX-machine using cc
# CFLAGS = -g -Aa # for a HP-UX-machine using cc

# CFLAGS = -m486 -O2 # on a Linux machine (i486)

Expand Down
27 changes: 16 additions & 11 deletions bin/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -fwritable-strings -DDIAG1
CFLAGS = -fwritable-strings -DDIAG1 -pg
TOPDIR = /usb/carat

# LIB = -L$(TOPDIR)/lib -lcarat -lm
Expand All @@ -24,14 +24,14 @@ ALL: Add Aut_grp Bravais_equiv\
Conv Datei\
Elt Extract Extensions\
First_perfect Form_space Form_elt\
Formtovec Full Gauss\
Formtovec Full Fundamental_domain Gauss\
Idem Inv Invar_space Isometry Is_finite\
Kron Long_solve Ltm\
Modp Mtl Mul Mink_red Minpol\
Normalizer Normalizer_in_N Normlin\
Orbit Order\
Pair_red Pdet Perfect_neighbours Polyeder P_lse_solve\
Presentation QtoZ Red_gen Rest_short Rein Rform Roundcor\
Pair_red Pdet Perfect_neighbours Poincare Polyeder P_lse_solve\
Presentation QtoZ Red_gen Rest_short Rein Rform\
Same_generators Scalarmul Scpr Short\
Shortest Short_reduce Signature\
Simplify_mat Symbol\
Expand Down Expand Up @@ -119,6 +119,10 @@ Full: $(SRC)/full.c
$(COMP) -o Full\
$(SRC)/full.c $(LIB)

Fundamental_domain: $(SRC)/fundamental_domain.c
$(COMP) -o Fundamental_domain\
$(SRC)/fundamental_domain.c $(LIB)

Gauss: $(SRC)/gauss.c
$(COMP) -o Gauss\
$(SRC)/gauss.c $(LIB)
Expand Down Expand Up @@ -227,6 +231,10 @@ Perfect_neighbours: $(SRC)/perfect_neighbours.c
$(COMP) -o Perfect_neighbours\
$(SRC)/perfect_neighbours.c $(LIB)

Poincare: $(SRC)/poincare.c
$(COMP) -o Poincare\
$(SRC)/poincare.c $(LIB)

Polyeder: $(SRC)/polyeder.c
$(COMP) -o Polyeder\
$(SRC)/polyeder.c $(LIB)
Expand All @@ -239,9 +247,9 @@ QtoZ: $(SRC)/qtoz.c
$(COMP) -o QtoZ\
$(SRC)/qtoz.c $(LIB)

Presentation: $(SRC)/kommureihe.c
Presentation: $(SRC)/presentation.c
$(COMP) -o Presentation\
$(SRC)/kommureihe.c $(LIB)
$(SRC)/presentation.c $(LIB)

Red_gen: $(SRC)/red_gen.c
$(COMP) -o Red_gen\
Expand All @@ -259,10 +267,6 @@ Rform: $(SRC)/rform.c
$(COMP) -o Rform\
$(SRC)/rform.c $(LIB)

Roundcor: $(SRC)/roundcor.c
$(COMP) -o Roundcor\
$(SRC)/roundcor.c $(LIB)

Same_generators: $(SRC)/same_generators.c
$(COMP) -o Same_generators\
$(SRC)/same_generators.c $(LIB)
Expand Down Expand Up @@ -371,6 +375,7 @@ clean:
rm -f Form_space
rm -f Formtovec
rm -f Full
rm -f Fundamental_domain
rm -f Gauss
rm -f Gittstab
rm -f Hypisom
Expand Down Expand Up @@ -401,6 +406,7 @@ clean:
rm -f Pdet
rm -f Perfect_neighbours
rm -f Polyeder
rm -f Poincare
rm -f Rein
rm -f Rest_short
rm -f Rform
Expand Down Expand Up @@ -429,7 +435,6 @@ clean:
rm -f Red_gen
rm -f Conjugated
rm -f Order
rm -f Roundcor
rm -f Malloc_liste
rm -f Presentation
rm -f QtoZ
Expand Down
5 changes: 4 additions & 1 deletion functions/Base/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extern void extend_bahn(bahn **a)
sizeof(matrix_TYP *) * a[0]->speicher);
a[0]->rep_invs = (matrix_TYP **) realloc(a[0]->rep_invs,
sizeof(matrix_TYP *) * a[0]->speicher);
a[0]->generators = (matrix_TYP **) realloc(a[0]->representatives,
a[0]->generators = (matrix_TYP **) realloc(a[0]->generators,
sizeof(matrix_TYP *) * a[0]->speicher);
}

Expand Down Expand Up @@ -273,6 +273,9 @@ int einordnen(bahn** erg,matrix_TYP *h, matrix_TYP *new_vec,int l,
if (l != (-1)){
if (erg[l]->speicher<=erg[l]->length){
extend_bahn(erg+l);

/* this is so seldom used that we might as well check wheter
the group is infinite, find a solution later !! */
}
erg[l]->orbit[erg[l]->length]=new_vec;
erg[l]->representatives[erg[l]->length]=h;
Expand Down
22 changes: 16 additions & 6 deletions functions/Bravais/bravais_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
@
@------------------------------------------------------------------------------
@
@ bravais_TYP *bravais_group(bravais_TYP *H)
@ bravais_TYP *bravais_group(bravais_TYP *H,int flag)
@
@ Calculates the bravais group of H. the result G of this function
@ will have G->gen and G->form assigned.
@ The program relies on H->form to be correct if it is given.
@ If flag>0, then the function will pair reduce the first form.
@ It is save to use this optiuon, but slower in well behaved examples.
@------------------------------------------------------------------------------
@
******************************************************************************/
bravais_TYP *bravais_group(bravais_TYP *H)
bravais_TYP *bravais_group(bravais_TYP *H,int flag)
{
int i,
F_no;
Expand All @@ -39,7 +41,10 @@ bravais_TYP *bravais_group(bravais_TYP *H)

ID = init_mat(H->dim,H->dim,"1");
PF = rform(H->gen,H->gen_no,ID,101);
SV = short_vectors(PF,max_diagonal_entry(PF),0,0,0,&i);

if (!flag){
SV = short_vectors(PF,max_diagonal_entry(PF),0,0,0,&i);
}

/* calculate the formspace if not given */
if (H->form_no == 0){
Expand All @@ -52,8 +57,13 @@ bravais_TYP *bravais_group(bravais_TYP *H)
for (i=0;i<F_no;i++) F[i+1] = copy_mat(H->form[i]);
F[0] = PF;

/* call autgrp to get the result */
G = autgrp(F,F_no+1,SV,NULL,0,NULL);
if (!flag){
/* call autgrp to get the result */
G = autgrp(F,F_no+1,SV,NULL,0,NULL);
}
else{
G = pr_aut(F,F_no+1,NULL,0,NULL);
}

/* copy the forms to G->form */
G->form = (matrix_TYP **) malloc(F_no * sizeof(matrix_TYP *));
Expand All @@ -63,7 +73,7 @@ bravais_TYP *bravais_group(bravais_TYP *H)
/* clean up */
free(F);
free_mat(PF);
free_mat(SV);
if (!flag) free_mat(SV);
free_mat(ID);

return G;
Expand Down
2 changes: 1 addition & 1 deletion functions/Datei/read_symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ for( i=0; i<MAXDIM; i++)
for(i=0; i<MAXDIM; i++)
for(j=0; j<5;j++)
zerleg[i][j] = 0;
printf("Please input the symbol for the cristal-family: ");
printf("Please input the symbol for the crystal-family: ");
fscanf (infile, "%[ \t\n]", string);
fscanf (infile, "%[^\n]",string);
strtok (string, "%");
Expand Down
1 change: 0 additions & 1 deletion functions/Gmp/m_alloc.h

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/add.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/cmp.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/gcd.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/mul.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/pow_ui.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/powm.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/sqrtrem.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpbsd/sub.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/add_n.s

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/addmul_1.S

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/bdivmod.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/cmp.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/divmod_1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/divrem.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/divrem_1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/dump.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/gcd.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/gcd_1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/gcdext.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/get_str.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/gmp-mparam.h

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/hamdist.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/inlines.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/lshift.s

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/mod_1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/mul.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/mul_1.s

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/mul_n.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/perfsqr.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/popcount.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/pre_mod_1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/random2.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/rshift.s

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/scan0.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/scan1.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/set_str.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/sqrtrem.c

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/sub_n.s

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/submul_1.S

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/sysdep.h

This file was deleted.

1 change: 0 additions & 1 deletion functions/Gmp/mpn/udiv_qrnnd.s

This file was deleted.

2 changes: 1 addition & 1 deletion functions/Idem/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ char *symbol(bravais_TYP *G,matrix_TYP *F)
/* calculate the bravais group for each homogenous module,
and search it in the list */
for (i=0;i<hom_no;i++){
brav = bravais_group(hom[i].group);
brav = bravais_group(hom[i].group,FALSE);
symb[i] = identify_hom(brav,i==(hom_no-1));
free_bravais(brav);
len += strlen(symb[i]);
Expand Down
19 changes: 13 additions & 6 deletions functions/Matrix/mul_mat.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ matrix_TYP *L_mat, *R_mat ;
{
matrix_TYP *P_mat;
int **L, **R, **P ;
int *L_i,
*R_j,
*P_i;
int rL, cL, rR, cR, rP, cP ;
int i, j, k ;

Expand All @@ -100,19 +103,23 @@ int i, j, k ;
R = R_mat->array.SZ;
P = P_mat->array.SZ;

for (i = 0; i < rL; i++)
for (j = 0; j < cL; j++ )
for (i = 0; i < rL; i++){
L_i = L[i];
P_i = P[i];
for (j = 0; j < cL; j++)
{
if ( L[i][j])
R_j = R[j];
if ( L_i[j])
if ( R_mat->flags.Diagonal )
{
if (R[j][j]) P[i][j] = L[i][j] * R[j][j];
if (R_j[j]) P_i[j] = L_i[j] * R_j[j];
}
else
for (k = 0; k < cR; k++)
if (R[j][k]) P[i][k] += L[i][j] * R[j][k];
if (R_j[k])
P_i[k] += L_i[j] * R_j[k];
}

}
P_mat->kgv = L_mat->kgv * R_mat->kgv;
P_mat->flags.Integral = (P_mat->kgv == 1);
P_mat->flags.Scalar = L_mat->flags.Scalar && R_mat->flags.Scalar;
Expand Down
6 changes: 2 additions & 4 deletions functions/Orbit/orb_division.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ int is_sorted;
extern int mat_comp();

erg = init_mat(2, Manz, "");
if((merk = (int *)malloc(Manz *sizeof(int))) == NULL)
if((merk = (int *)calloc(Manz , sizeof(int))) == NULL)
{
printf("malloc of 'merk' in 'orbit_representatives' failed\n");
printf("calloc of 'merk' in 'orbit_representatives' failed\n");
exit(2);
}
for(i=0;i<Manz;i++)
merk[i] = 0;

i = 0;
no = 0;
Expand Down
Loading

0 comments on commit f6dae84

Please sign in to comment.