Exemplo n.º 1
0
		public void GetIndex()
		{
			ComplexFloatVector a = new ComplexFloatVector(new float[4] { 1, 2, 3, 4 });
			ComplexFloatVector b = new ComplexFloatVector(new float[4] { 3, 2, 1, 0 });
			ComplexFloatVector c = new ComplexFloatVector(new float[4] { 0, -1, -2, -3 });
			ComplexFloatVector d = new ComplexFloatVector(new float[4] { -3, -2, -1, 0 });

			Assert.AreEqual(a.GetAbsMaximumIndex(), 3);
			Assert.AreEqual(b.GetAbsMaximumIndex(), 0);
			Assert.AreEqual(c.GetAbsMaximumIndex(), 3);
			Assert.AreEqual(d.GetAbsMaximumIndex(), 0);

			Assert.AreEqual(a.GetAbsMaximum(), (ComplexFloat)4);
			Assert.AreEqual(b.GetAbsMaximum(), (ComplexFloat)3);
			Assert.AreEqual(c.GetAbsMaximum(), (ComplexFloat)(-3));
			Assert.AreEqual(d.GetAbsMaximum(), (ComplexFloat)(-3));

			Assert.AreEqual(a.GetAbsMinimumIndex(), 0);
			Assert.AreEqual(b.GetAbsMinimumIndex(), 3);
			Assert.AreEqual(c.GetAbsMinimumIndex(), 0);
			Assert.AreEqual(d.GetAbsMinimumIndex(), 3);

			Assert.AreEqual(a.GetAbsMinimum(), (ComplexFloat)1);
			Assert.AreEqual(b.GetAbsMinimum(), (ComplexFloat)0);
			Assert.AreEqual(c.GetAbsMinimum(), (ComplexFloat)0);
			Assert.AreEqual(d.GetAbsMinimum(), (ComplexFloat)0);
		}