Beispiel #1
0
        public void Negate()
        {
            float[] vec = new float[4] {
                0, 1, 2, 3
            };
            ComplexFloatVector a = new ComplexFloatVector(vec);
            ComplexFloatVector b = -a;

            a = ComplexFloatVector.Negate(a);

            Assert.AreEqual(-(ComplexFloat)vec[0], a[0]);
            Assert.AreEqual(-(ComplexFloat)vec[1], a[1]);
            Assert.AreEqual(-(ComplexFloat)vec[2], a[2]);
            Assert.AreEqual(-(ComplexFloat)vec[3], a[3]);

            Assert.AreEqual(-(ComplexFloat)vec[0], b[0]);
            Assert.AreEqual(-(ComplexFloat)vec[1], b[1]);
            Assert.AreEqual(-(ComplexFloat)vec[2], b[2]);
            Assert.AreEqual(-(ComplexFloat)vec[3], b[3]);
        }