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

            a.Copy(b);
        }
Beispiel #2
0
        public void CopyException()
        {
            Assert.Throws(typeof(ArgumentException), () =>
            {
                var a = new ComplexFloatVector(new float[4] {
                    0, 1, 2, 3
                });
                var b = new ComplexFloatVector(5);

                a.Copy(b);
            });
        }
Beispiel #3
0
        public void CopySwap()
        {
            ComplexFloatVector a = new ComplexFloatVector(new float[4] {
                0, 1, 2, 3
            });
            ComplexFloatVector b = new ComplexFloatVector(new float[4] {
                4, 5, 6, 7
            });
            ComplexFloatVector c = new ComplexFloatVector(4);
            ComplexFloatVector d = new ComplexFloatVector(4);

            a.Copy(c);
            b.Copy(d);

            Assert.AreEqual(a.Length, c.Length);
            Assert.AreEqual(a[0], c[0]);
            Assert.AreEqual(a[1], c[1]);
            Assert.AreEqual(a[2], c[2]);
            Assert.AreEqual(a[3], c[3]);

            Assert.AreEqual(b.Length, d.Length);
            Assert.AreEqual(b[0], d[0]);
            Assert.AreEqual(b[1], d[1]);
            Assert.AreEqual(b[2], d[2]);
            Assert.AreEqual(b[3], d[3]);

            a.Swap(b);

            Assert.AreEqual(b.Length, c.Length);
            Assert.AreEqual(b[0], c[0]);
            Assert.AreEqual(b[1], c[1]);
            Assert.AreEqual(b[2], c[2]);
            Assert.AreEqual(b[3], c[3]);

            Assert.AreEqual(a.Length, d.Length);
            Assert.AreEqual(a[0], d[0]);
            Assert.AreEqual(a[1], d[1]);
            Assert.AreEqual(a[2], d[2]);
            Assert.AreEqual(a[3], d[3]);
        }