ESYS13  Revision_
Pattern.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 
00015 /**************************************************************/
00016 
00017 /*   Paso: pattern                                            */
00018 
00019 /**************************************************************/
00020 
00021 /*   Author: Lutz Gross, l.gross@uq.edu.au */
00022 
00023 /**************************************************************/
00024 
00025 #ifndef INC_PASO_PATTERN
00026 #define INC_PASO_PATTERN
00027 
00028 #include "Paso.h"
00029 #include "IndexList.h"
00030 
00031 /**************************************************************/
00032 
00033 typedef struct Paso_Pattern {
00034   int type;
00035   dim_t numOutput;  /* Number of rows the ptr array [CSR] for CSC it's the number of cols*/
00036   dim_t numInput;   /* Number of cols [CSR] */
00037   dim_t len;        /* number of non-zeros */
00038   index_t* ptr;     /* ptr[n] to ptr[n+1] lists indices (in index) of non-zeros in row n*/
00039   index_t* index;   /* Non-major indices of non-zeros (in CSR this will be col numbers) */ 
00040   index_t *main_iptr;  /* pointer to main diagonal entry */
00041   dim_t numColors;     /* number of colors */
00042   index_t* coloring;   /* coloring index: input with the same color are not connected */
00043   dim_t reference_counter;
00044 } Paso_Pattern;
00045 
00046 PASO_DLL_API
00047 Paso_Pattern* Paso_Pattern_alloc(int type, dim_t numOutput, dim_t numInput, index_t* ptr, index_t* index);
00048 
00049 PASO_DLL_API
00050 
00051 PASO_DLL_API
00052 Paso_Pattern* Paso_Pattern_getReference(Paso_Pattern*);
00053 
00054 PASO_DLL_API
00055 void Paso_Pattern_free(Paso_Pattern*);
00056 
00057 PASO_DLL_API
00058 int Paso_comparIndex(const void *,const void *);
00059 
00060 PASO_DLL_API
00061 Paso_Pattern* Paso_Pattern_unrollBlocks(Paso_Pattern*,int, dim_t,dim_t);
00062 
00063 PASO_DLL_API
00064 Paso_Pattern* Paso_Pattern_getSubpattern(Paso_Pattern*,dim_t,dim_t,index_t*,index_t*);
00065 
00066 PASO_DLL_API
00067 bool_t Paso_Pattern_isEmpty(Paso_Pattern* in);
00068 
00069 PASO_DLL_API
00070 void Paso_Pattern_mis(Paso_Pattern* pattern_p, index_t* mis_marker);
00071 
00072 PASO_DLL_API
00073 void Paso_Pattern_reduceBandwidth(Paso_Pattern* self,index_t* oldToNew);
00074 
00075 PASO_DLL_API
00076 void Paso_Pattern_color(Paso_Pattern* patter, index_t* num_colors, index_t* colorOf);
00077 Paso_Pattern* Paso_Pattern_multiply(int type, Paso_Pattern* A, Paso_Pattern* B);
00078 
00079 PASO_DLL_API
00080 Paso_Pattern* Paso_Pattern_binop(int type, Paso_Pattern* A, Paso_Pattern* B);
00081 
00082 PASO_DLL_API
00083 index_t* Paso_Pattern_borrowMainDiagonalPointer(Paso_Pattern* A);
00084 
00085 PASO_DLL_API
00086 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);
00087 
00088 PASO_DLL_API
00089 dim_t Paso_Pattern_getNumColors(Paso_Pattern* A);
00090 
00091 PASO_DLL_API
00092 index_t* Paso_Pattern_borrowColoringPointer(Paso_Pattern* A);
00093 
00094 PASO_DLL_API
00095 dim_t Paso_Pattern_maxDeg(Paso_Pattern* A);
00096 
00097 #endif /* #ifndef INC_PASO_PATTERN */