Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / tas / trc / trc_awematrice.h
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI AVERTEC */
4 /* */
5 /* Produit : RCX - AWE support. */
6 /* Fichier : trc_awematrice.h */
7 /* */
8 /* (c) copyright 2000 AVERTEC */
9 /* Tous droits reserves */
10 /* */
11 /* Auteur(s) : Grégoire Avot */
12 /* */
13 /****************************************************************************/
14
15 /* CVS informations :
16
17 Revision : $Revision: 1.6 $
18 Author : $Author: gregoire $
19 Date : $Date: 2002/12/06 14:52:38 $
20
21 */
22
23 /* Le champs data est défini par :
24
25 [ 0 1 2 ]
26 [ 3 4 5 ]
27 [ 6 7 8 ]
28
29 on accède à l'élément (ligne,colonne) par la macro
30 MATELEM( matrice, ligne, colonne )
31 */
32
33 #define MATELEM(a,l,c) (a->data[c+l*a->col])
34
35 /*
36 * La réservation mémoire est unique, elle correspond à une matrice de dimension
37 * MAT_ALLOCLINE et MAT_ALLOCCOL. Seule une partie correspondant à la taille
38 * rééelle de la matrice est utilisée. */
39
40 #define MAT_ALLOCLINE 10
41 #define MAT_ALLOCCOL 10
42
43 typedef struct smatrice {
44 struct smatrice *NEXT;
45 int lin, col ;
46 RCXFLOAT *data ;
47 } matrice ;
48
49 matrice* mat_create( int, int );
50 void mat_free( matrice* );
51 int mat_solve( matrice*, matrice*, matrice* );
52 void mat_mult(matrice*, matrice*, matrice* );
53 matrice* mat_dup( matrice* );
54 void mat_sub( matrice*, matrice*, matrice* );
55 RCXFLOAT mat_sq( matrice* );