/[escript]/branches/domexper/paso/src/Pattern.h
ViewVC logotype

Contents of /branches/domexper/paso/src/Pattern.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3234 - (show annotations)
Mon Oct 4 01:46:30 2010 UTC (9 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 3508 byte(s)
Some subdirs need to have changes pulled over but all of the unit tests 
except for modellib appear to work

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: pattern */
18
19 /**************************************************************/
20
21 /* Author: Lutz Gross, l.gross@uq.edu.au */
22
23 /**************************************************************/
24
25 #ifndef INC_PASO_PATTERN
26 #define INC_PASO_PATTERN
27
28 #include "Common.h"
29
30 /**************************************************************/
31
32 #define PATTERN_FORMAT_DEFAULT 0
33 #define PATTERN_FORMAT_SYM 1
34 #define PATTERN_FORMAT_OFFSET1 2
35
36 typedef struct Paso_Pattern {
37 int type;
38 dim_t numOutput; /* Number of rows the ptr array [CSR] for CSC it's the number of cols*/
39 dim_t numInput; /* Number of cols [CSR] */
40 dim_t len; /* number of non-zeros */
41 index_t* ptr; /* ptr[n] to ptr[n+1] lists indicies (in index) of non-zeros in row n*/
42 index_t* index; /* Non-major indicies of non-zeros (in CSR this will be col numbers) */
43 index_t *main_iptr; /* pointer to main diagonal entry */
44 dim_t numColors; /* number of colors */
45 index_t* coloring; /* coloring index: input with the same color are not connected */
46 dim_t reference_counter;
47 } Paso_Pattern;
48
49 #define INDEXLIST_LENGTH 85
50
51 typedef struct Paso_IndexList {
52 index_t index[INDEXLIST_LENGTH];
53 dim_t n;
54 struct Paso_IndexList *extension;
55 } Paso_IndexList;
56 /* interfaces: */
57
58
59 PASO_DLL_API
60 Paso_Pattern* Paso_Pattern_alloc(int type, dim_t numOutput, dim_t numInput, index_t* ptr, index_t* index);
61
62 PASO_DLL_API
63
64 PASO_DLL_API
65 Paso_Pattern* Paso_Pattern_getReference(Paso_Pattern*);
66
67 PASO_DLL_API
68 void Paso_Pattern_free(Paso_Pattern*);
69
70 PASO_DLL_API
71 int Paso_comparIndex(const void *,const void *);
72
73 PASO_DLL_API
74 Paso_Pattern* Paso_Pattern_unrollBlocks(Paso_Pattern*,int, dim_t,dim_t);
75
76 PASO_DLL_API
77 Paso_Pattern* Paso_Pattern_getSubpattern(Paso_Pattern*,dim_t,dim_t,index_t*,index_t*);
78
79 PASO_DLL_API
80 bool_t Paso_Pattern_isEmpty(Paso_Pattern* in);
81
82 PASO_DLL_API
83 void Paso_Pattern_mis(Paso_Pattern* pattern_p, index_t* mis_marker);
84
85 PASO_DLL_API
86 void Paso_Pattern_reduceBandwidth(Paso_Pattern* self,index_t* oldToNew);
87
88 PASO_DLL_API
89 void Paso_Pattern_color(Paso_Pattern* patter, index_t* num_colors, index_t* colorOf);
90 Paso_Pattern* Paso_Pattern_multiply(int type, Paso_Pattern* A, Paso_Pattern* B);
91
92 PASO_DLL_API
93 Paso_Pattern* Paso_Pattern_binop(int type, Paso_Pattern* A, Paso_Pattern* B);
94
95 PASO_DLL_API
96 index_t* Paso_Pattern_borrowMainDiagonalPointer(Paso_Pattern* A);
97
98 PASO_DLL_API
99 void Paso_IndexList_insertIndex(Paso_IndexList*, index_t);
100
101 PASO_DLL_API
102 void Paso_IndexList_toArray(Paso_IndexList*, index_t*, index_t, index_t, index_t);
103
104 PASO_DLL_API
105 dim_t Paso_IndexList_count(Paso_IndexList*, index_t, index_t);
106
107 PASO_DLL_API
108 void Paso_IndexList_free(Paso_IndexList*);
109
110 PASO_DLL_API
111 Paso_Pattern* Paso_IndexList_createPattern(dim_t n0, dim_t n,Paso_IndexList* index_list,index_t range_min,index_t range_max, index_t index_offset);
112
113 PASO_DLL_API
114 dim_t Paso_Pattern_getNumColors(Paso_Pattern* A);
115
116 PASO_DLL_API
117 index_t* Paso_Pattern_borrowColoringPointer(Paso_Pattern* A);
118
119 #endif /* #ifndef INC_PASO_PATTERN */

  ViewVC Help
Powered by ViewVC 1.1.26