/[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

revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC 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 68  void Paso_SystemMatrixPattern_mis(Paso_S Line 73  void Paso_SystemMatrixPattern_mis(Paso_S
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;

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

  ViewVC Help
Powered by ViewVC 1.1.26