81 |
/* function to print the actual data in the right format */ |
/* function to print the actual data in the right format */ |
82 |
void print_data( FILE *fp, int n_perline, int width, int nval, char *fmt, void *ptr, int integer, int adjust ) |
void print_data( FILE *fp, int n_perline, int width, int nval, char *fmt, void *ptr, int integer, int adjust ) |
83 |
{ |
{ |
84 |
|
double *data = ptr; |
85 |
int entries_done = 0; |
int entries_done = 0; |
86 |
int padding; |
int padding, i, j; |
87 |
char pad_fmt[10]; |
char pad_fmt[10]; |
88 |
|
|
89 |
padding = 80 - n_perline*width; |
padding = 80 - n_perline*width; |
95 |
if( integer ) |
if( integer ) |
96 |
{ |
{ |
97 |
dim_t *data = ptr; |
dim_t *data = ptr; |
98 |
for( int i=0; i<nval; i++ ) |
for(i=0; i<nval; i++ ) |
99 |
{ |
{ |
100 |
fprintf( fp, fmt, data[i]+adjust ); |
fprintf( fp, fmt, data[i]+adjust ); |
101 |
entries_done++; |
entries_done++; |
110 |
} |
} |
111 |
else |
else |
112 |
{ |
{ |
113 |
double *data = ptr; |
for(i=0; i<nval; i++ ) |
|
for( int i=0; i<nval; i++ ) |
|
114 |
{ |
{ |
115 |
fprintf( fp, fmt, data[i] ); |
fprintf( fp, fmt, data[i] ); |
116 |
entries_done++; |
entries_done++; |
177 |
|
|
178 |
void Paso_SystemMatrix_saveHB( Paso_SystemMatrix *A_p, char *filename_p ) |
void Paso_SystemMatrix_saveHB( Paso_SystemMatrix *A_p, char *filename_p ) |
179 |
{ |
{ |
180 |
|
int i, curr_col,j ; |
181 |
|
int iPtr, iCol, ir, ic; |
182 |
index_t index_offset=(A_p->type & MATRIX_FORMAT_OFFSET1 ? 1:0); |
index_t index_offset=(A_p->type & MATRIX_FORMAT_OFFSET1 ? 1:0); |
183 |
/* open the file */ |
/* open the file */ |
184 |
FILE *fileHandle_p = fopen( filename_p, "w" ); |
FILE *fileHandle_p = fopen( filename_p, "w" ); |
202 |
} |
} |
203 |
else |
else |
204 |
{ |
{ |
|
int i, curr_col; |
|
|
int iPtr, iCol, ir, ic; |
|
205 |
|
|
206 |
// fprintf( fileHandle_p, "NEED unrolling!\n" ); |
// fprintf( fileHandle_p, "NEED unrolling!\n" ); |
207 |
M = A_p->num_rows*A_p->row_block_size; |
M = A_p->num_rows*A_p->row_block_size; |
226 |
dim_t *col_ptr = MEMALLOC( (N+1), dim_t ); |
dim_t *col_ptr = MEMALLOC( (N+1), dim_t ); |
227 |
|
|
228 |
curr_col = 0; |
curr_col = 0; |
229 |
for( int j=0; (j<nz && curr_col<N); curr_col++ ) |
for(j=0; (j<nz && curr_col<N); curr_col++ ) |
230 |
{ |
{ |
231 |
while( col_ind[j] != curr_col ) |
while( col_ind[j] != curr_col ) |
232 |
j++; |
j++; |