Replies: 5 comments 5 replies
-
Please provide an example that compiles. In the code you provided, i1, i2, i3, i4 are undefined. #include <blitz/array.h>
int main()
{
using namespace blitz;
...
} |
Beta Was this translation helpful? Give feedback.
-
ForBlitzDev.tar.gz The trouble is that both paths give the same wrong answer (rjac.out holds the correct result from the real application).
Many thanks for taking a look at this. |
Beta Was this translation helpful? Give feedback.
-
forgot to include the blitz patch in the tarball |
Beta Was this translation helpful? Give feedback.
-
Correct. I was hoping there was some obvious error in the reproducer that
you could spot. If not, then I'll need to dig deeper into the real
application to figure out whats going on.
…On Fri, Dec 11, 2020, 6:20 PM Sylwester Arabas ***@***.***> wrote:
Dan, IIUC, both the blitz-based and hand-coded-loops versions give the
same result, but it is not what you expect? right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#167 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACODV2CRASCLFEYXIBWGPG3SUKZMDANCNFSM4UVF27JQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Perhaps there is some Array.reindex() or .reindexSelf() call in between in the "real application"? |
Beta Was this translation helpful? Give feedback.
-
I'm hoping some blitz++ expert can help me unravel the following calculation.
int ub1=46+1, ub2=18+1, ub3=5+1, ub4=6+1;
Array<double, 4> rjac(ub1,ub2,ub3,ub4);
Array<double, 2> fjac(ub2,ub4);
Array<double, 3> pv(ub1,ub2,ub3);
rjac += fjac(i2,i4) * pv(i1,i2,i3);
My attempt to convert this into a simple loop nest gives the wrong results. Can anyone tell me what I'm doing wrong?
const double * restrict pvp = pv.data();
const double * restrict fjacp = fjac.data();
double * restrict rjacp = rjac.data();
for (int o=0; o<oub; ++o) { // 0:46
for (int n=0; n<nub; ++n) { // 0:18
for (int m=0; m<mub; ++m) { // 0:5
for (int l=0; l<lub; ++l) { // 0:6
rjacp[o*(lubmubnub) + n*(lubmub) + mlub + l] += fjacp[nlub + l] * pvp[o(nubmub) + nmub + m];
}
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions