Skip to content
Snippets Groups Projects
Commit a97151b5 authored by Holger Obermaier's avatar Holger Obermaier Committed by Holger Obermaier
Browse files

Remove NR_END padding from f3tensor_aligned

parent 9bd44b22
No related branches found
No related tags found
No related merge requests found
......@@ -415,30 +415,30 @@ float ***f3tensor_aligned(
}
/* allocate pointers to pointers to rows */
float ***tensor1 = (float ***)malloc((size_t)((nrow + NR_END) * sizeof(float **)));
float ***tensor1 = (float ***)malloc((size_t)((nrow) * sizeof(float **)));
if (!tensor1) {
log_fatal("Allocation failure 1 in function f3tensor_aligned().\n");
exit(EXIT_FAILURE); // just to silence a static code checker
}
/* allocate pointers to rows and set pointers to them */
float ** tensor2 = (float **)malloc((size_t)((nrow * ncol + NR_END) * sizeof(float *)));
float ** tensor2 = (float **)malloc((size_t)((nrow * ncol) * sizeof(float *)));
if (!tensor2) {
log_fatal("Allocation failure 2 in function f3tensor_aligned().\n");
exit(EXIT_FAILURE); // just to silence a static code checker
}
/* allocate rows and set pointers to them */
float *tensor3 = (float *)aligned_alloc(falignment, (size_t)((nrow * ncol * ndep_aligned + NR_END) * sizeof(float)));
float *tensor3 = (float *)aligned_alloc(falignment, (size_t)((nrow * ncol * ndep_aligned) * sizeof(float)));
if (!tensor3) {
log_fatal("Allocation failure 3 in function f3tensor_aligned().\n");
exit(EXIT_FAILURE); // just to silence a static code checker
}
// Initialize pointer structure and float tensor
float ***p1 = tensor1 + NR_END - nrl;
float **p2 = tensor2 + NR_END - ncl;
float *p3 = tensor3 + NR_END - ndl;
float ***p1 = tensor1 - nrl;
float **p2 = tensor2 - ncl;
float *p3 = tensor3 - ndl;
float ***t = p1;
for (int i = nrl; i <= nrh; i++) {
t[i] = p2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment