Example to show how to define an spm matrix out of a matrix allocated by the user.
- Copyright
- 2020-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
- Version
- 1.2.4
- Author
- Mathieu Faverge
-
Tony Delarue
- Date
- 2024-06-26
/
values[l] *= alpha;
l++;
if ( i < mdim1 ) {
rowptr[l] = (i+1) + dim1 * j + dim1 * dim2 * k + 1;
colptr[l] = i + dim1 * j + dim1 * dim2 * k + 1;
values[l] = - beta;
l++;
}
if ( j < mdim2 ) {
rowptr[l] = i + dim1 * (j+1) + dim1 * dim2 * k + 1;
colptr[l] = i + dim1 * j + dim1 * dim2 * k + 1;
values[l] = - beta;
l++;
}
if ( k < mdim3 ) {
rowptr[l] = i + dim1 * j + dim1 * dim2 * (k+1) + 1;
colptr[l] = i + dim1 * j + dim1 * dim2 * k + 1;
values[l] = - beta;
l++;
}
}
}
}
assert( l == ((2*(dim1)-1) * dim2 * dim3 + (dim2-1)*dim1*dim3 + dim2*dim1*(dim3-1)) );
}
spm->replicated = 1;
Definition in file example_lap2.c.