Ejemplo n.º 1
0
bool
FLDRMG::FInit(int cbBuf, BYTE * pbBuf)
	{

	cbSigBuf = cbBuf;
	pbSigBuf = pbBuf;
	ClearStat();
	ClearXclExt();
	ClearXclFile();
	ClearXclDir();

	return fTrue;

}
Ejemplo n.º 2
0
void ClearInterfaceStat()
{
  long loc0, loc1, ptr, type;

  /* Check that interfaces are defined */

  if ((loc0 = (long)RDB[DATA_PTR_IFC0]) < VALID_PTR)
    return;
  
  /* Loop over interfaces */

  while(loc0 > VALID_PTR)
    {

      /* Get interface type */

      type = (long)RDB[loc0 + IFC_TYPE];

      /* Only handle fuel behavior interfaces atm. */

      if((type == IFC_TYPE_FUEP) || (type == IFC_TYPE_FPIP))
	{

	  /* Get pointer to first rod */

	  loc1 = (long)RDB[loc0 + IFC_PTR_FUEP];

	  /* Loop over pins to relax power */

	  while(loc1 > VALID_PTR)
	    {

	      /* Get pointers to power tally */

	      ptr = (long)RDB[loc1 + IFC_FUEP_PTR_POWER];
	      CheckPointer(FUNCTION_NAME, "(Pptr)", DATA_ARRAY, ptr);

	      /* Clear statistics */
	      
	      ClearStat(ptr);

	      /* Next pin */

	      loc1 = NextItem(loc1);
	    }
	}
      else
	{

	  /* Get pointer to power tally */

	  ptr = (long)RDB[loc0 + IFC_PTR_STAT];
	  CheckPointer(FUNCTION_NAME, "(Pptr)", DATA_ARRAY, ptr);

	  /* Clear statistics */
	      
	  ClearStat(ptr);

	}
	
      /* Next interface */

      loc0 = NextItem(loc0);
    }

  return;

  /***************************************************************************/
}
Ejemplo n.º 3
0
bool  cOneTestLSQ::OneLSQItere()
{
   if (!OK(Pt2dr(0,0))) return false;

   ClearStat();
   int aCpt=0;

   RMat_Inertie aMat;
   double aDif = 0;

   for(int aKx=-mNbW; aKx<=mNbW; aKx++)
   {
       for(int aKy=-mNbW; aKy<=mNbW; aKy++)
       {
          Pt2dr aP2 = mIm2->PVois(aKx,aKy);

          Pt3dr aGV2 =  mIm2->GetValDer(aP2);


           double aV1 = mValsIm1[aCpt];
          // double aV1 = mIm1.GetVal(mIm1.PVois(aKx,aKy));
          double aV2 = aGV2.z;
          double aGx = aGV2.x;
          double aGy = aGV2.y;

          aDif += ElSquare(aV1-aV2);
          aMat.add_pt_en_place(aV1,aV2);

          // Pour verifier la justesse des moindres carres
          if (0)
          {
              aV2 = 50 + 2 * aV1  - 0.5* aGx -0.25 * aGy;
          }

          mCov[IndK0][IndK0] += 1;
          mCov[IndK0][IndK1] += aV1;
          mCov[IndK0][IndKx] -= aGx;
          mCov[IndK0][IndKy] -= aGy;

          mCov[IndK1][IndK1] += aV1*aV1;
          mCov[IndK1][IndKx] -= aV1*aGx;
          mCov[IndK1][IndKy] -= aV1*aGy;

          mCov[IndKx][IndKx] += aGx*aGx;
          mCov[IndKx][IndKy] += aGx*aGy;

          mCov[IndKy][IndKy] += aGy*aGy;

          mSomI2[IndK0] += aV2;
          mSomI2[IndK1] += aV1 * aV2;
          mSomI2[IndKx] -= aV2 * aGx;
          mSomI2[IndKy] -= aV2 * aGy;

          aCpt++;
       }
   }

   for(int aK1=0; aK1<NbInc; aK1++)
   {
       mMatI2(0,aK1) = mSomI2[aK1];
       for(int aK2=0; aK2<=aK1; aK2++)
       {
           mMatCov(aK1,aK2) =  mMatCov(aK2,aK1) = mCov[aK2][aK1];
       }
   }


   jacobi_diag(mMatCov,mValP,mVecP);

   double aVPMin = 1e10;
   for(int aK1=0; aK1<NbInc; aK1++)
      aVPMin = std::min(aVPMin,mValP(aK1,aK1));

   if (aVPMin<1e-8) return false;


   mSolLSQ = gaussj(mMatCov) * mMatI2;
   mCorel0LSQ = aMat.correlation();


   mDepLSQ = Pt2dr(mSolLSQ(0,2), mSolLSQ(0,3));



   mDeps.push_back(mDepLSQ);

   return true;
}