Replace
arrayT ~= rowT;
with
arrayT ~= rowT.dup;
Also, you may want to look into ndslice package [1].
[1] https://github.com/libmir/mir-algorithm
Best regards,
Ilya Yaroshenko
Works! Thanks Ilya. I'll take a look on the difference. Also soon
will get bit familiar with the mir-algorithm...
B
On Sunday, 1 October 2017 at 14:23:54 UTC, thorstein wrote:
[...]
Sorry, I'm still really confused with the results from my
function:
[...]
Replace
arrayT ~= rowT;
with
arrayT ~= rowT.dup;
Also, you may want to look into ndslice package [1].
[1] https://github.com/libmir/mir-algorith
Bes
Guyes, I obviously made a mistake. Forget my post!
Sorry, I'm still really confused with the results from my
function:
double[][] transp(double[][] array)
{
double[][] arrayT;
double[] rowT;
// initialize rowT
foreach(i; 0..array.length)
{
rowT ~= 0;
}
foreach(col; 0..arra
On Sunday, 1 October 2017 at 13:53:57 UTC, thorstein wrote:
Why is that
Thanks!
Guyes, I obviously made a mistake. Forget my post!
They are not alternatives. They are the only way of doing
things.
Yes, sounds logic - static arrays require a size before
compilation.
However, I tried another variation with a totally unexpected
result:
double[][] transp3(double[][] array)
{
double[][] arrayT;
double[] rowT;
// initi
On Sunday, 1 October 2017 at 10:07:40 UTC, thorstein wrote:
Hi,
assumed, I need the size of a dynamic array for further
processing, which is unknown at compile time. Below are my
example, which doesn't work and two alternatives.
[...]
They are not alternatives. They are the only way of doin
Hi,
assumed, I need the size of a dynamic array for further
processing, which is unknown at compile time. Below are my
example, which doesn't work and two alternatives.
Alternative1: may create large rowT-arrays depending on original
array size.
Alternative2: overrides rowT after exiting the