Beispiel #1
0
/*
**** Test to assess the quality of the Reset member of the TwoSampleStats
**** class which is designed to return a TwoSampleStats intance to an
**** unmodified state

**** This test finishes indirectly testing the rest of MinX, MaxX
**** MinY, MaxY,AverageX,AverageY,VarianceX,VarianceY,StdDevX,StdDevY 
**** which are all members of the TwoSampleStats class.
*/
void xStats :: reset2Test (void)
{
	gpstk::TwoSampleStats<double> resetTest1;
  	resetTest1.Add(10.,20.);
	gpstk::Vector<double> resetx(1,20.);
	gpstk::Vector<double> resety(1,30.);
	resetTest1.Add(resetx,resety);
	
	CPPUNIT_ASSERT_NO_THROW(resetTest1.Reset());
	CPPUNIT_ASSERT_EQUAL((unsigned) 0, resetTest1.N());
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.MinimumX(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.MaximumX(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.MinimumY(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.MaximumY(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.AverageX(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.AverageY(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.VarianceX(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.VarianceY(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.StdDevX(), 1e-6);
	CPPUNIT_ASSERT_DOUBLES_EQUAL(0., resetTest1.StdDevY(), 1e-6);	
	
}
Beispiel #2
0
Datei: ng.c Projekt: agn453/simh
void delta (uint16 inst)
{
  int delta = inst & 01777;

  if (inst & 01000)
    delta |= -1 << 10;

  switch (inst & 014000) {
  case 000000:
    if (inst & 02000)
      resetx ();
    if (inst & 01000)
      resety ();
    if (inst & 00400)
      stop ();
    if (inst & 00200)
        pop ();
    if (inst & 00100)
      popj ();
    return;
  case 004000:
    y[console] += delta;
    break;
  case 010000:
    x[console] += delta;
    break;
  case 014000:
    x[console] += delta;
    y[console] += delta;
    break;
  }

  DEBUGF("[%d] DELTA %d\n", console, delta);

  if (inst & 02000) {
    point ();
  }
}