/[escript]/trunk/paso/src/SystemMatrixPattern_mis.c
ViewVC logotype

Diff of /trunk/paso/src/SystemMatrixPattern_mis.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/paso/src/SystemMatrixPattern_mis.c revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC trunk/paso/src/SystemMatrixPattern_mis.c revision 415 by gross, Wed Jan 4 05:37:33 2006 UTC
# Line 34  static double Paso_SystemMatrixPattern_m Line 34  static double Paso_SystemMatrixPattern_m
34    
35  void Paso_SystemMatrixPattern_mis(Paso_SystemMatrixPattern* pattern_p, index_t* mis_marker) {  void Paso_SystemMatrixPattern_mis(Paso_SystemMatrixPattern* pattern_p, index_t* mis_marker) {
36    
37      index_t index_offset=(pattern_p->type & PATTERN_FORMAT_OFFSET1 ? 1:0);
38    dim_t i;    dim_t i;
39    index_t naib,iptr;    index_t naib,iptr;
40    bool_t flag;    bool_t flag;
41    dim_t n=pattern_p->n_ptr;    dim_t n=pattern_p->n_ptr;
42      if (pattern_p->type & PATTERN_FORMAT_SYM) {
43        Paso_setError(TYPE_ERROR,"Paso_SystemMatrixPattern_mis: symmetric matrix pattern is not supported yet");
44        return;
45      }
46    double *value=TMPMEMALLOC(n,double);    double *value=TMPMEMALLOC(n,double);
47    if (!Paso_checkPtr(value)) {    if (!Paso_checkPtr(value)) {
48       #pragma omp parallel for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)
# Line 62  void Paso_SystemMatrixPattern_mis(Paso_S Line 67  void Paso_SystemMatrixPattern_mis(Paso_S
67                   }                   }
68             }             }
69             /* update the seed */             /* update the seed */
70             Paso_SystemMatrixPattern_mis_seed=fmod(sqrt(Paso_SystemMatrixPattern_mis_seed*(n+1)),1.);             /* Paso_SystemMatrixPattern_mis_seed=fmod(sqrt(Paso_SystemMatrixPattern_mis_seed*(n+1)),1.); */
71             /* detect independent vertices as those vertices that have a value less than all values of its naigbours */             /* detect independent vertices as those vertices that have a value less than all values of its naigbours */
72             #pragma omp parallel for private(naib,i,iptr,flag) schedule(static)             #pragma omp parallel for private(naib,i,iptr,flag) schedule(static)
73             for (i=0;i<n;++i) {             for (i=0;i<n;++i) {
74                if (mis_marker[i]==IS_AVAILABLE) {                if (mis_marker[i]==IS_AVAILABLE) {
75                   flag=IS_IN_MIS_NOW;                   flag=IS_IN_MIS_NOW;
76                   for (iptr=pattern_p->ptr[i];iptr<pattern_p->ptr[i+1]; ++iptr) {                   for (iptr=pattern_p->ptr[i]-index_offset;iptr<pattern_p->ptr[i+1]-index_offset; ++iptr) {
77                       naib=pattern_p->index[iptr];                       naib=pattern_p->index[iptr]-index_offset;
78                       if (naib!=i && value[naib]<=value[i]) {                       if (naib!=i && value[naib]<=value[i]) {
79                          flag=IS_AVAILABLE;                          flag=IS_AVAILABLE;
80                          break;                          break;
# Line 82  void Paso_SystemMatrixPattern_mis(Paso_S Line 87  void Paso_SystemMatrixPattern_mis(Paso_S
87             #pragma omp parallel for private(naib,i,iptr) schedule(static)             #pragma omp parallel for private(naib,i,iptr) schedule(static)
88             for (i=0;i<n;i++) {             for (i=0;i<n;i++) {
89                if (mis_marker[i]==IS_IN_MIS_NOW) {                if (mis_marker[i]==IS_IN_MIS_NOW) {
90                   for (iptr=pattern_p->ptr[i];iptr<pattern_p->ptr[i+1]; ++iptr) {                   for (iptr=pattern_p->ptr[i]-index_offset;iptr<pattern_p->ptr[i+1]-index_offset; ++iptr) {
91                       naib=pattern_p->index[iptr];                       naib=pattern_p->index[iptr]-index_offset;
92                       if (naib!=i) mis_marker[naib]=IS_CONNECTED_TO_MIS;                       if (naib!=i) mis_marker[naib]=IS_CONNECTED_TO_MIS;
93                   }                   }
94                   mis_marker[i]=IS_IN_MIS;                   mis_marker[i]=IS_IN_MIS;
# Line 100  void Paso_SystemMatrixPattern_mis(Paso_S Line 105  void Paso_SystemMatrixPattern_mis(Paso_S
105  #undef IS_IN_MIS_NOW  #undef IS_IN_MIS_NOW
106  #undef IS_IN_MIS  #undef IS_IN_MIS
107  #undef IS_CONNECTED_TO_MIS  #undef IS_CONNECTED_TO_MIS
   
 /*  
  * $Log$  
  * Revision 1.2  2005/09/15 03:44:39  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.1.2.1  2005/09/05 06:29:47  gross  
  * These files have been extracted from finley to define a stand alone libray for iterative  
  * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but  
  * has not been tested yet.  
  *  
  *  
  */  

Legend:
Removed from v.150  
changed lines
  Added in v.415

  ViewVC Help
Powered by ViewVC 1.1.26