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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4257 - (show annotations)
Wed Feb 27 03:42:40 2013 UTC (6 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3214 byte(s)
Some simple experiments for c++ Finley

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

  ViewVC Help
Powered by ViewVC 1.1.26