Example #1
0
SmartPtr<Vector> NLPScalingObject::apply_vector_scaling_d_LU_NonConst(
   const Matrix&                 Pd_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace&            d_space
   )
{
   DBG_START_METH("NLPScalingObject::apply_vector_scaling_d_LU_NonConst", dbg_verbosity);
   SmartPtr<Vector> scaled_d_LU = lu->MakeNew();
   if( have_d_scaling() )
   {
      SmartPtr<Vector> tmp_d = d_space.MakeNew();

      // move to full d space
      Pd_LU.MultVector(1.0, *lu, 0.0, *tmp_d);

      // scale in full x space
      tmp_d = apply_vector_scaling_d_NonConst(ConstPtr(tmp_d));

      // move back to x_L space
      Pd_LU.TransMultVector(1.0, *tmp_d, 0.0, *scaled_d_LU);
   }
   else
   {
      scaled_d_LU->Copy(*lu);
   }

   return scaled_d_LU;
}
Example #2
0
 SmartPtr<const Vector> NLPScalingObject::apply_vector_scaling_d_LU(
   const Matrix& Pd_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace& d_space)
 {
   if (have_d_scaling()) {
     return ConstPtr(apply_vector_scaling_d_LU_NonConst(Pd_LU, lu, d_space));
   }
   else {
     return lu;
   }
 }
Example #3
0
 SmartPtr<const Vector> NLPScalingObject::apply_vector_scaling_d_LU(
   const Matrix& Pd_LU,
   const SmartPtr<const Vector>& lu,
   const VectorSpace& d_space)
 {
   DBG_START_METH("NLPScalingObject::apply_vector_scaling_d_LU", dbg_verbosity);
   if (have_d_scaling()) {
     return ConstPtr(apply_vector_scaling_d_LU_NonConst(Pd_LU, lu, d_space));
   }
   else {
     return lu;
   }
 }