예제 #1
0
flag C3DPoly::ReFit()
  {
  if (NPts()>=C3DPolyNoOfParms)
    {
    CDVector DP;
    flag b = False;//pFn->LBEst(DP, dSa, iIter, iMaxIter);
    if (!b)
      iIter = -1;   //singularity
    }
  else
    iIter = -2;  //insufficient points
  return True;
  }
예제 #2
0
flag C2DPoly::ReFit()
  {
  if (NPts()>Order)
    {
    SetOrder(Order);
    CDVector DP;
    if (!pFn->LBEst(DP, dSa, iIter, iMaxIter))
      iIter = -1;   //singularity
    }
  else
    iIter = -2;  //insufficient points
  return True;
  }
예제 #3
0
flag C2DNorm::InitParms(flag DoIt)
  {
  if (DoIt)
    {
    double MaxY = 0.0;
    const long Pts = NPts();
    for (long i=0; i<Pts; i++)
      {
      if (pFn->Yp(i) > MaxY)
        MaxY = pFn->Yp(i); 
      }
    double Variance = 0.0;
    for (i=0; i<Pts; i++)
      Variance = Variance + Sqr(MaxY - pFn->Yp(i));
    Parms[0] = sqrt(Variance);
    Parms[1] = MaxY;
    Parms[2] = 1.0;
    Parms[3] = 0.0;
    }
  return True;
  }