"Fossies" - the Fresh Open Source Software Archive 
Member "laspack/matrix.h" (27 Mar 1995, 2865 Bytes) of package /linux/privat/old/laspack.tgz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /****************************************************************************/
2 /* matrix.h */
3 /****************************************************************************/
4 /* */
5 /* type MATRIX */
6 /* */
7 /* Copyright (C) 1992-1995 Tomas Skalicky. All rights reserved. */
8 /* */
9 /****************************************************************************/
10 /* */
11 /* ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS */
12 /* OF THE COPYRIGHT NOTICE (SEE FILE COPYRGHT.H) */
13 /* */
14 /****************************************************************************/
15
16 #ifndef MATRIX_H
17 #define MATRIX_H
18
19 #include <stdlib.h>
20
21 #include "laspack/lastypes.h"
22 #include "laspack/elcmp.h"
23 #include "laspack/copyrght.h"
24
25 typedef struct {
26 char *Name;
27 size_t RowDim;
28 size_t ClmDim;
29 ElOrderType ElOrder;
30 InstanceType Instance;
31 int LockLevel;
32 double Multipl;
33 Boolean OwnData;
34 size_t *Len;
35 ElType **El;
36 Boolean *ElSorted;
37 } Matrix;
38
39 void M_Constr(Matrix *M, char *Name, size_t RowDim, size_t ClmDim,
40 ElOrderType ElOrder, InstanceType Instance, Boolean OwnData);
41 void M_Destr(Matrix *M);
42 void M_SetName(Matrix *M, char *Name);
43 char *M_GetName(Matrix *M);
44 size_t M_GetRowDim(Matrix *M);
45 size_t M_GetClmDim(Matrix *M);
46 ElOrderType M_GetElOrder(Matrix *M);
47 void M_SetLen(Matrix *M, size_t RoC, size_t Len);
48 size_t M_GetLen(Matrix *M, size_t RoC);
49 void M_SetEntry(Matrix *M, size_t RoC, size_t Entry, size_t Pos, Real Val);
50 size_t M_GetPos(Matrix *M, size_t RoC, size_t Entry);
51 Real M_GetVal(Matrix *M, size_t RoC, size_t Entry);
52 void M_AddVal(Matrix *M, size_t RoC, size_t Entry, Real Val);
53
54 /* macros for fast access */
55 #define M__GetLen(PtrM, RoC) (PtrM)->Len[RoC]
56 #define M__SetEntry(PtrM, RoC, Entry, Pos_, Val_) { \
57 (PtrM)->El[RoC][Entry].Pos = (Pos_); \
58 (PtrM)->El[RoC][Entry].Val = (Val_); \
59 }
60 #define M__GetPos(PtrM, RoC, Entry) (PtrM)->El[RoC][Entry].Pos
61 #define M__GetVal(PtrM, RoC, Entry) (PtrM)->El[RoC][Entry].Val
62 #define M__AddVal(PtrM, RoC, Entry, Val_) { \
63 (PtrM)->El[RoC][Entry].Val += (Val_); \
64 }
65
66 Real M_GetEl(Matrix *M, size_t Row, size_t Clm);
67
68 void M_SortEl(Matrix *M);
69
70 void M_Lock(Matrix *M);
71 void M_Unlock(Matrix *M);
72
73 #endif /* MATRIX_H */