Пример #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;
}
Пример #2
0
 SmartPtr<const Vector> NLPScalingObject::apply_vector_scaling_x_LU(
   const Matrix& Px_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace& x_space)
 {
   if (have_x_scaling()) {
     return ConstPtr(apply_vector_scaling_x_LU_NonConst(Px_LU, lu, x_space));
   }
   else {
     return lu;
   }
 }
Пример #3
0
 SmartPtr<const Vector> NLPScalingObject::apply_vector_scaling_x_LU(
   const Matrix& Px_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace& x_space)
 {
   DBG_START_METH("NLPScalingObject::apply_vector_scaling_x_LU", dbg_verbosity);
   if (have_x_scaling()) {
     return ConstPtr(apply_vector_scaling_x_LU_NonConst(Px_LU, lu, x_space));
   }
   else {
     return lu;
   }
 }