operator * method
Multiply two arrays
Examples
var list = ArrayComplex([
Complex(real: 2, imaginary: 5),
Complex(real: 2, imaginary: 5) ,
Complex(real: 2, imaginary: 5)]);
var list2 = ArrayComplex([
Complex(real: 4, imaginary: -3),
Complex(real: 4, imaginary: -3),
Complex(real: 4, imaginary: -3)]);
var cList = list * list2;
print(clist)
/* output:
ArrayComplex([Complex(real: 23.0, imaginary: 14.0), Complex(real: 23.0, imaginary: 14.0), Complex(real: 23.0, imaginary: 14.0)])
*/
Implementation
ArrayComplex operator *(ArrayComplex b) {
_checkArray(b);
var c = ArrayComplex.fixed(length);
for (var i = 0; i < length; i++) {
c[i] = this[i] * b[i];
}
return c;
}