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; }
SmartPtr<Vector> NLPScalingObject::apply_vector_scaling_x_LU_NonConst( const Matrix& Px_LU, const SmartPtr<const Vector>& lu, const VectorSpace& x_space) { 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; }