Пример #1
0
// Bound2D constructor (Flow2D,uint,uint,uint,uint)
Bound2D::Bound2D(char* name,   
                 UMatrix2D< FlowNode2D<FP, NUM_COMPONENTS> >* J,
                 unsigned int X1, unsigned int Y1,
                 unsigned int X2, unsigned int Y2,
                 int      bt,
                 Flow2D*  pInFlow2D,
                 FP*  p_Y,
                 int     btc) {
    pBoundFlow2D = pInFlow2D;

    pBoundFlow   = NULL;

    InitBound(name,J,bt,p_Y,btc);
    
    Start.SetX(X1);
    Start.SetY(Y1);

    End.SetX(X2);
    End.SetY(Y2);

    fStart.SetX((FP)X1);
    fStart.SetY((FP)Y1);

    fEnd.SetX((FP)X2);
    fEnd.SetY((FP)Y2);
}
Пример #2
0
// Bound constructor (Flow2D,FP,FP,FP,FP)
Bound2D::Bound2D(char* name,   
                 UMatrix2D< FlowNode2D<FP, NUM_COMPONENTS> >* J,
                 FP  x1,
                 FP  y1,
                 FP  x2,
                 FP  y2,
                 int     bt,
                 Flow2D*           pInFlow2D,
                 FP* p_Y,
                 int     btc) {

    pBoundFlow2D = pInFlow2D;

    pBoundFlow   = NULL;

    InitBound(name, J, bt,p_Y,btc);
    
    Start.SetX(static_cast<unsigned int>(x1/dx));
    Start.SetY(static_cast<unsigned int>(y1/dy));

    End.SetX(static_cast<unsigned int>(x2/dx));
    End.SetY(static_cast<unsigned int>(y2/dy));
    
    fStart.SetX(x1);
    fStart.SetY(y1);

    fEnd.SetX(x2);
    fEnd.SetY(y2);
}
Пример #3
0
VectorXd VoxelSolver::solveEx()
{
  VectorXd res(num);
  real_1d_array x;
  minbleicstate state;
  minbleicreport rep;
  double epsg = 0;
  double epsf = 0;
  double epsx = 0;
  ae_int_t maxits = 0;

  x.setlength(num);
  for (int i=0;i<num;i++)
  {
    x[i]=0;
  }
  minbleiccreate(x, state);

  InitBound();
  minbleicsetbc(state, lb, ub);

  InitConstrainEx();
  minbleicsetlc(state, cs, ct);

  minbleicsetcond(state, epsg, epsf, epsx, maxits);
  alglib::minbleicoptimize(state, function_grad2);
  minbleicresults(state, x, rep);

  for (int i=0;i<num;i++)
  {
    res[i]=x[i];
  }

  return res;
}
Пример #4
0
// Bound2D constructor (Flow2D,XY<uint,uint>,XY<uint,uint>)
Bound2D::Bound2D(char* name,   
                 UMatrix2D< FlowNode2D<FP, NUM_COMPONENTS> >* J,
                 XY<FP>*  p_start,
                 XY<FP>*  p_end,
                 int      bt,
                 Flow2D*  pInFlow2D,
                 FP*      p_Y,
                 int      btc) {

    pBoundFlow2D = pInFlow2D;

    pBoundFlow   = NULL;

    InitBound(name, J, bt,p_Y,btc);
    fStart.SetXY(p_start);
    fEnd.SetXY(p_end);
    Start.SetX(static_cast<unsigned int>(fStart.GetX()));
    Start.SetY(static_cast<unsigned int>(fStart.GetY()));

    End.SetX(static_cast<unsigned int>(fEnd.GetX()));
    End.SetY(static_cast<unsigned int>(fEnd.GetY()));
}