On 7/21/21 2:17 AM, drug wrote:
> auto z = zip(x, y) // concatenate two ranges
> .map!(a=>Complex!double(a[0],a[1])) // take the current first
> element of the first range as the real part and the current first
> element of the second range as the imaginary
I wouldn't state it is the best way but you can try something like that:
```D
import std.complex;
import std.range : zip;
import std.algorithm : equal, map;
import std.array : array;
void main(){
auto N=2;
double[] x,y;
x.length = N;
y.length = N;
x[0] = 1.1;
x[1] =
I am trying to initialize a complex dynamic array, from two
strictly real dynamic arrays (one to be the real part, the other
to be the imaginary part.
Here is simple sample of what I have tried:
-
import std.stdio;
import std.math;