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