/** Use this method to create a new const IteratesVector. You must pass in
  *  valid pointers for all of the entries.
  */
 const SmartPtr<const IteratesVector> MakeNewIteratesVector(const Vector& x, const Vector& s,
     const Vector& y_c, const Vector& y_d,
     const Vector& z_L, const Vector& z_U,
     const Vector& v_L, const Vector& v_U)
 {
   SmartPtr<IteratesVector> newvec = MakeNewIteratesVector(false);
   newvec->Set_x(x);
   newvec->Set_s(s);
   newvec->Set_y_c(y_c);
   newvec->Set_y_d(y_d);
   newvec->Set_z_L(z_L);
   newvec->Set_z_U(z_U);
   newvec->Set_v_L(v_L);
   newvec->Set_v_U(v_U);
   return ConstPtr(newvec);
 }
 /** This method creates a new vector (and allocates space in all
  *  the contained vectors. This is really only used for code that
  *  does not know what type of vector it is dealing with - for
  *  example, this method is called from Vector::MakeNew()
  */
 virtual Vector* MakeNew() const
 {
   return MakeNewIteratesVector();
 }
 /** This method overloads
  *  ComooundVectorSpace::MakeNewCompoundVector to make sure that
  *  we get a vector of the correct type
  */
 virtual CompoundVector* MakeNewCompoundVector(bool create_new = true) const
 {
   return MakeNewIteratesVector(create_new);
 }
 /** Use this method to create a new iterates vector with a copy of
  *  all the data.
  */
 SmartPtr<IteratesVector> MakeNewIteratesVectorCopy() const
 {
   SmartPtr<IteratesVector> ret = MakeNewIteratesVector(true);
   ret->Copy(*this);
   return ret;
 }
Example #5
0
  SmartPtr<IteratesVector> IteratesVector::MakeNewContainer() const
  {
    SmartPtr<IteratesVector> ret = MakeNewIteratesVector(false);

    if (IsValid(x())) {
      ret->Set_x(*x());
    }
    if (IsValid(s())) {
      ret->Set_s(*s());
    }
    if (IsValid(y_c())) {
      ret->Set_y_c(*y_c());
    }
    if (IsValid(y_d())) {
      ret->Set_y_d(*y_d());
    }
    if (IsValid(z_L())) {
      ret->Set_z_L(*z_L());
    }
    if (IsValid(z_U())) {
      ret->Set_z_U(*z_U());
    }
    if (IsValid(v_L())) {
      ret->Set_v_L(*v_L());
    }
    if (IsValid(v_U())) {
      ret->Set_v_U(*v_U());
    }

    return ret;

    // We may need a non const version
    //     if (IsCompConst(0)) {
    //       ret->Set_x(*x());
    //     }
    //     else {
    //       ret->Set_x_NonConst(*x_NonConst());
    //     }

    //     if (IsCompConst(1)) {
    //       ret->Set_s(*s());
    //     }
    //     else {
    //       ret->Set_s_NonConst(*s_NonConst());
    //     }

    //     if (IsCompConst(2)) {
    //       ret->Set_y_c(*y_c());
    //     }
    //     else {
    //       ret->Set_y_c_NonConst(*y_c_NonConst());
    //     }

    //     if (IsCompConst(3)) {
    //       ret->Set_y_d(*y_d());
    //     }
    //     else {
    //       ret->Set_y_d_NonConst(*y_d_NonConst());
    //     }

    //     if (IsCompConst(4)) {
    //       ret->Set_z_L(*z_L());
    //     }
    //     else {
    //       ret->Set_z_L_NonConst(*z_L_NonConst());
    //     }

    //     if (IsCompConst(5)) {
    //       ret->Set_z_U(*z_U());
    //     }
    //     else {
    //       ret->Set_z_U_NonConst(*z_U_NonConst());
    //     }

    //     if (IsCompConst(6)) {
    //       ret->Set_v_L(*v_L());
    //     }
    //     else {
    //       ret->Set_v_L_NonConst(*v_L_NonConst());
    //     }

    //     if (IsCompConst(7)) {
    //       ret->Set_v_U(*v_U());
    //     }
    //     else {
    //       ret->Set_v_U_NonConst(*v_U_NonConst());
    //     }

    //    return ret;
  }