Esempio n. 1
0
SmartPtr<Vector> NLPScalingObject::apply_vector_scaling_x_LU_NonConst(
   const Matrix&                 Px_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace&            x_space
   )
{
   DBG_START_METH("NLPScalingObject::apply_vector_scaling_x_LU_NonConst", dbg_verbosity);
   SmartPtr<Vector> scaled_x_LU = lu->MakeNew();
   if( have_x_scaling() )
   {
      SmartPtr<Vector> tmp_x = x_space.MakeNew();

      // move to full x space
      Px_LU.MultVector(1.0, *lu, 0.0, *tmp_x);

      // scale in full x space
      tmp_x = apply_vector_scaling_x_NonConst(ConstPtr(tmp_x));

      // move back to x_L space
      Px_LU.TransMultVector(1.0, *tmp_x, 0.0, *scaled_x_LU);
   }
   else
   {
      scaled_x_LU->Copy(*lu);
   }

   return scaled_x_LU;
}
Esempio n. 2
0
 SmartPtr<const Vector> StandardScalingBase::apply_vector_scaling_x(
   const SmartPtr<const Vector>& v)
 {
   if (IsValid(dx_)) {
     return ConstPtr(apply_vector_scaling_x_NonConst(v));
   }
   else {
     return v;
   }
 }
Esempio n. 3
0
 SmartPtr<Vector> NLPScalingObject::unapply_grad_obj_scaling_NonConst(
   const SmartPtr<const Vector>& v)
 {
   SmartPtr<Vector> unscaled_v = apply_vector_scaling_x_NonConst(v);
   Number df = unapply_obj_scaling(1.);
   if (df != 1.) {
     unscaled_v->Scal(df);
   }
   return unscaled_v;
 }
Esempio n. 4
0
 SmartPtr<const Vector> StandardScalingBase::apply_vector_scaling_x(
   const SmartPtr<const Vector>& v)
 {
   DBG_START_METH("NLPScalingObject::apply_vector_scaling_x", dbg_verbosity);
   if (IsValid(dx_)) {
     return ConstPtr(apply_vector_scaling_x_NonConst(v));
   }
   else {
     return v;
   }
 }
Esempio n. 5
0
 SmartPtr<Vector> NLPScalingObject::unapply_grad_obj_scaling_NonConst(
   const SmartPtr<const Vector>& v)
 {
   DBG_START_METH("NLPScalingObject::unapply_grad_obj_scaling_NonConst", dbg_verbosity);
   SmartPtr<Vector> unscaled_v = apply_vector_scaling_x_NonConst(v);
   Number df = unapply_obj_scaling(1.);
   if (df != 1.) {
     unscaled_v->Scal(df);
   }
   return unscaled_v;
 }