Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added a comentary given credit to the author of CSDP library. At the
[simgrid.git] / include / csdp / blockmat.h
1 /*
2   This file is part of the CSDP 5.0 package developed by Dr. Brian Borchers.
3   Which can be distributed under the LGPL licence. The source code and 
4   manual can be downloaded at http://euler.nmt.edu/~brian/csdp.html.
5
6   This file contains definitions for the block matrix data structures used
7   in CSDP 3.0.  Note that there are an additional set of definitions used
8   for sparse constraint matrices.
9 */
10
11
12 /*
13   Each block is a diagonal block or a matrix
14 */
15
16 enum blockcat {DIAG, MATRIX, PACKEDMATRIX};
17
18 /*
19   A block data record contains a pointer to the actual data for the block.
20   Note that matrices are stored in Fortran form, while vectors are stored
21   using indices 1, 2, ..., n.
22 */
23
24 union blockdatarec {
25   double *vec;
26   double *mat;
27 };
28
29 /*
30   A block record describes an individual block within a matrix. 
31 */
32
33 struct blockrec {
34   union blockdatarec data;
35   enum blockcat blockcategory;
36 #ifndef NOSHORTS
37   unsigned short blocksize;
38 #else
39   int blocksize;
40 #endif
41 };
42
43 /*
44   A block matrix contains an entire matrix in block diagonal form.
45  */
46
47 struct blockmatrix {
48   int nblocks;
49   struct blockrec *blocks;
50 };
51
52 /*
53    Definition for constraint matrices.
54  */
55
56 /*
57  * There's one of these for each nonzero block in each constraint matrix.
58  */
59 struct sparseblock {
60   struct sparseblock *next;
61   struct sparseblock *nextbyblock;
62   double *entries;
63 #ifndef NOSHORTS
64   unsigned short *iindices;
65   unsigned short *jindices;
66   int numentries;
67   unsigned short blocknum;
68   unsigned short blocksize;
69   unsigned short constraintnum;
70   unsigned short issparse;
71 #else
72   int *iindices;
73   int *jindices;
74   int numentries;
75   int blocknum;
76   int blocksize;
77   int constraintnum;
78   int issparse;
79 #endif
80 };
81
82
83 /*
84  * A constraint matrix is just an array of pointers to linked lists of
85  * the constraint blocks.  
86  */
87
88 struct constraintmatrix {
89   struct sparseblock *blocks;
90 };
91
92
93
94