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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (show annotations)
Wed Dec 15 03:48:48 2004 UTC (14 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 1433 byte(s)
*** empty log message ***

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Finley: SystemMatrix : */
6 /* copies a SystemMatrix values into an output array */
7
8 /**************************************************************/
9
10 /* Copyrights by ACcESS Australia 2003 */
11 /* Author: gross@access.edu.au */
12
13 /**************************************************************/
14
15 #include "Finley.h"
16 #include "System.h"
17
18
19 void Finley_SystemMatrix_copy(Finley_SystemMatrix* in,double* array) {
20 maybelong i,j,iptr,len_index_list=0;
21 maybelong block_size=in->row_block_size*in->col_block_size;
22 switch(in->type) {
23 case CSR:
24 len_index_list=in->num_rows;
25 break;
26 case CSC:
27 len_index_list=in->num_cols;
28 break;
29 default:
30 Finley_ErrorCode = TYPE_ERROR;
31 sprintf(Finley_ErrorMsg, "Unknown matrix type.");
32 return;
33 }
34 #pragma omp parallel for private(i,iptr,j) schedule(static)
35 for (i=0;i< len_index_list;i++) {
36 for (iptr=in->ptr[i]-PTR_OFFSET;iptr<in->ptr[i+1]-PTR_OFFSET; iptr++) {
37 for (j=0;j<block_size;j++) array[iptr*block_size+j]=in->val[iptr*block_size+j];
38 }
39 }
40 }
41 /*
42 * $Log$
43 * Revision 1.3 2004/12/15 03:48:46 jgs
44 * *** empty log message ***
45 *
46 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
47 * initial import of project esys2
48 *
49 * Revision 1.1 2004/07/02 04:21:13 gross
50 * Finley C code has been included
51 *
52 *
53 */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26