TaPAS  0.2
group.h
Go to the documentation of this file.
1 /*
2  * group.h -- Groups
3  *
4  * This file is a part of the Talence Linear Algebra Library.
5  *
6  * Copyright (C) 2010 CNRS UMR 5800 & Universit√© Bordeaux I (see AUTHORS file).
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  */
23 
29 #ifndef __GROUP_H__
30 # define __GROUP_H__
31 
32 # include <talalib/matrix.h>
33 # include <talalib/vsp.h>
34 
35 BEGIN_C_DECLS
36 
37 /*
38  * A group is given by an hermite square matrix with size*(size+1) coefficients
39  * size+1 allow the add a new vector to the group easilly
40  * dim is the dimension of the vector space generated by the group.
41  * Thus only the first dim columns are non-zero.
42  */
43 typedef struct tla_group_st {
44  int dim;
45  tla_matrix_t Hermite;
46 } tla_group_t[1];
47 
48  /* --------------- */
49 
50 extern void
51 tla_group_init(tla_group_t G, int size);
52 extern void
53 tla_group_init_set(tla_group_t res, const tla_group_t G);
54 extern void
55 tla_group_set(tla_group_t res, const tla_group_t G);
56 extern void
57 tla_group_clear(tla_group_t G);
58 extern void
59 tla_group_Z_cap_vsp(tla_group_t G, const tla_vsp_t vsp);
60 extern void
61 tla_group_z_mul (tla_group_t R, const tla_group_t G, const mpz_t scale);
62 extern void
63 tla_group_z_mul_ui (tla_group_t R, const tla_group_t G, unsigned int scale);
64 
65 extern void
66 tla_group_add_generator(tla_group_t res, const tla_group_t G,
67  const tla_vec_t x);
68 extern int
69 tla_group_has(tla_group_t G, const tla_vec_t x, tla_vec_t lambda);
70 extern unsigned int
71 tla_group_hash (const tla_group_t G);
72 extern int
73 tla_group_are_equal (const tla_group_t G, const tla_group_t GO);
74 # define tla_group_get_size(G) (tla_matrix_get_nb_lines((G)->Hermite))
75 # define tla_group_get_dim(G) ((G)->dim)
76 
77 extern int
78 tla_group_alpha_min(const tla_group_t G, const tla_vec_t alpha, const mpz_t c,
79  tla_vec_t x);
80 
81 END_C_DECLS
82 
83 #endif /* ! __GROUP_H__ */