/[escript]/trunk/esys2/finley/src/finleyC/System_copy.c
ViewVC logotype

Diff of /trunk/esys2/finley/src/finleyC/System_copy.c

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

revision 101 by jgs, Wed Dec 15 03:48:48 2004 UTC revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC
# Line 17  Line 17 
17    
18    
19  void Finley_SystemMatrix_copy(Finley_SystemMatrix* in,double* array) {  void Finley_SystemMatrix_copy(Finley_SystemMatrix* in,double* array) {
20    maybelong i,j,iptr,len_index_list=0;    maybelong i,j,iptr;
   maybelong block_size=in->row_block_size*in->col_block_size;  
   switch(in->type) {  
     case CSR:  
         len_index_list=in->num_rows;  
         break;  
     case CSC:  
         len_index_list=in->num_cols;  
         break;  
     default:  
         Finley_ErrorCode = TYPE_ERROR;  
         sprintf(Finley_ErrorMsg, "Unknown matrix type.");  
         return;  
   }  
21    #pragma omp parallel for private(i,iptr,j) schedule(static)    #pragma omp parallel for private(i,iptr,j) schedule(static)
22    for (i=0;i< len_index_list;i++) {    for (i=0;i< in->pattern->n_ptr;++i) {
23       for (iptr=in->ptr[i]-PTR_OFFSET;iptr<in->ptr[i+1]-PTR_OFFSET; iptr++) {       for (iptr=(in->pattern->ptr[i])-PTR_OFFSET;iptr<(in->pattern->ptr[i+1])-PTR_OFFSET; ++iptr) {
24           for (j=0;j<block_size;j++) array[iptr*block_size+j]=in->val[iptr*block_size+j];           for (j=0;j<in->block_size;j++) array[iptr*(in->block_size)+j]=in->val[iptr*(in->block_size)+j];
25       }       }
26    }    }
27  }  }
28  /*  /*
29   * $Log$   * $Log$
30   * Revision 1.3  2004/12/15 03:48:46  jgs   * Revision 1.4  2004/12/15 07:08:33  jgs
31   * *** empty log message ***   * *** empty log message ***
32   *   *
  * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
  * initial import of project esys2  
  *  
  * Revision 1.1  2004/07/02 04:21:13  gross  
  * Finley C code has been included  
33   *   *
34   *   *
35   */   */

Legend:
Removed from v.101  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.26