Esempio n. 1
0
		public void Equals()
		{
			ComplexDoubleMatrix a = new ComplexDoubleMatrix(2, 2, new Complex(4, 4));
			ComplexDoubleMatrix b = new ComplexDoubleMatrix(2, 2, new Complex(4, 4));
			ComplexDoubleMatrix c = new ComplexDoubleMatrix(2, 2);
			c[0, 0] = new Complex(4, 4);
			c[0, 1] = new Complex(4, 4);
			c[1, 0] = new Complex(4, 4);
			c[1, 1] = new Complex(4, 4);

			ComplexDoubleMatrix d = new ComplexDoubleMatrix(2, 2, 5);
			ComplexDoubleMatrix e = null;
			FloatMatrix f = new FloatMatrix(2, 2, 4);
			Assert.IsTrue(a.Equals(b));
			Assert.IsTrue(b.Equals(a));
			Assert.IsTrue(a.Equals(c));
			Assert.IsTrue(b.Equals(c));
			Assert.IsTrue(c.Equals(b));
			Assert.IsTrue(c.Equals(a));
			Assert.IsFalse(a.Equals(d));
			Assert.IsFalse(d.Equals(b));
			Assert.IsFalse(a.Equals(e));
			Assert.IsFalse(a.Equals(f));
		}