public void Divide() { ComplexFloatVector a = new ComplexFloatVector(new float[4] { 0, 1, 2, 3 }); ComplexFloatVector c = new ComplexFloatVector(a); ComplexFloatVector d = new ComplexFloatVector(a); float scal = -4; c = a / scal; d = ComplexFloatVector.Divide(a, scal); Assert.AreEqual(c[0], a[0] / scal); Assert.AreEqual(c[1], a[1] / scal); Assert.AreEqual(c[2], a[2] / scal); Assert.AreEqual(c[3], a[3] / scal); Assert.AreEqual(d[0], a[0] / scal); Assert.AreEqual(d[1], a[1] / scal); Assert.AreEqual(d[2], a[2] / scal); Assert.AreEqual(d[3], a[3] / scal); }
public void ScalarMultiplyAndDivide() { ComplexFloatVector a = new ComplexFloatVector(new float[4] { 0, 1, 2, 3 }); ComplexFloatVector c = new ComplexFloatVector(a); ComplexFloatVector d = new ComplexFloatVector(a); float scal = -4; c.Multiply(scal); d.Divide(scal); Assert.AreEqual(c[0], a[0] * scal); Assert.AreEqual(c[1], a[1] * scal); Assert.AreEqual(c[2], a[2] * scal); Assert.AreEqual(c[3], a[3] * scal); Assert.AreEqual(d[0], a[0] / scal); Assert.AreEqual(d[1], a[1] / scal); Assert.AreEqual(d[2], a[2] / scal); Assert.AreEqual(d[3], a[3] / scal); c = a * scal; Assert.AreEqual(c[0], a[0] * scal); Assert.AreEqual(c[1], a[1] * scal); Assert.AreEqual(c[2], a[2] * scal); Assert.AreEqual(c[3], a[3] * scal); c = scal * a; Assert.AreEqual(c[0], a[0] * scal); Assert.AreEqual(c[1], a[1] * scal); Assert.AreEqual(c[2], a[2] * scal); Assert.AreEqual(c[3], a[3] * scal); }