@@ -63,7 +63,7 @@ VectorSpace::VectorSpace(hiopNlpFormulation* nlp)
6363{
6464 assert (nlp);
6565 M_lump_ = nullptr ;
66- if (nlp->useWeightedVectorSpace ()) {
66+ if (nlp->get_weighted_space_type ()) {
6767 vec_n_ = nlp_->alloc_primal_vec ();
6868 vec_n2_ = nlp_->alloc_primal_vec ();
6969 } else {
@@ -81,7 +81,7 @@ VectorSpace::~VectorSpace()
8181
8282// bool VectorSpace::apply_M(const hiopVector& x, hiopVector& y) const
8383// {
84- // if(nlp_->useWeightedVectorSpace ()) {
84+ // if(nlp_->get_weighted_space_type ()) {
8585// return nlp_->eval_M(x, y);
8686// } else {
8787// y.copyFrom(x);
@@ -100,7 +100,7 @@ bool VectorSpace::apply_M_lumped(const hiopVector& x, hiopVector& y) const
100100// Computes H primal norm
101101double VectorSpace::norm_H_primal (const hiopVector& x) const
102102{
103- if (nlp_->useWeightedVectorSpace ()) {
103+ if (nlp_->get_weighted_space_type ()) {
104104 nlp_->eval_H (x, *vec_n_);
105105 auto dp = x.dotProductWith (*vec_n_);
106106 return ::std::sqrt (dp);
@@ -111,7 +111,7 @@ double VectorSpace::norm_H_primal(const hiopVector& x) const
111111// Computes H dual norm
112112double VectorSpace::norm_H_dual (const hiopVector& x) const
113113{
114- if (nlp_->useWeightedVectorSpace ()) {
114+ if (nlp_->get_weighted_space_type ()) {
115115 nlp_->eval_H_inv (x, *vec_n_);
116116 auto dp = x.dotProductWith (*vec_n_);
117117 return ::std::sqrt (dp);
@@ -122,7 +122,7 @@ double VectorSpace::norm_H_dual(const hiopVector& x) const
122122
123123double VectorSpace::norm_stationarity (const hiopVector& x) const
124124{
125- if (nlp_->useWeightedVectorSpace ()) {
125+ if (nlp_->get_weighted_space_type ()) {
126126 vec_n_->copyFrom (x);
127127 vec_n_->componentDiv (*M_lumped ());
128128 return vec_n_->infnorm ();
@@ -134,7 +134,7 @@ double VectorSpace::norm_stationarity(const hiopVector& x) const
134134// Compute norm one weighted by M, i.e., 1^T*M*|x|
135135double VectorSpace::norm_M_one (const hiopVector& x) const
136136{
137- if (nlp_->useWeightedVectorSpace ()) {
137+ if (nlp_->get_weighted_space_type ()) {
138138 // use vec_n2_ since vec_n_ may be changed in M_lumped_
139139 vec_n2_->copyFrom (x);
140140 vec_n2_->component_abs ();
@@ -147,7 +147,7 @@ double VectorSpace::norm_M_one(const hiopVector& x) const
147147
148148double VectorSpace::norm_complementarity (const hiopVector& x) const
149149{
150- if (nlp_->useWeightedVectorSpace ()) {
150+ if (nlp_->get_weighted_space_type ()) {
151151 // since both x (slacks) and the bound duals are in the same (primal) space, inf norm "is
152152 // mesh independent".
153153 return x.infnorm ();
@@ -159,7 +159,7 @@ double VectorSpace::norm_complementarity(const hiopVector& x) const
159159// Computes the "volume" of the space, 1^T M*1
160160double VectorSpace::volume () const
161161{
162- if (nlp_->useWeightedVectorSpace ()) {
162+ if (nlp_->get_weighted_space_type ()) {
163163 double vol_total = nlp_->m_ineq_low () + nlp_->m_ineq_upp ();
164164 if (nlp_->n_low () > 0 || nlp_->n_upp () > 0 ) {
165165 // compute ||1||_M
@@ -184,7 +184,7 @@ const hiopVector* VectorSpace::M_lumped() const
184184{
185185 if (M_lump_ == nullptr ) {
186186 M_lump_ = nlp_->alloc_primal_vec ();
187- if (nlp_->useWeightedVectorSpace ()) {
187+ if (nlp_->get_weighted_space_type ()) {
188188 vec_n_->setToConstant (1 .);
189189 nlp_->eval_M (*vec_n_, *M_lump_);
190190 } else {
@@ -197,7 +197,7 @@ const hiopVector* VectorSpace::M_lumped() const
197197void VectorSpace::
198198add_linear_damping_term (const hiopVector& ixl, const hiopVector& ixu, const double & ct, hiopVector& x) const
199199{
200- if (nlp_->useWeightedVectorSpace ()) {
200+ if (nlp_->get_weighted_space_type ()) {
201201 vec_n_->copyFrom (ixl);
202202 vec_n_->axpy (-1.0 , ixu);
203203 vec_n_->componentMult (*M_lumped ());
@@ -209,7 +209,7 @@ add_linear_damping_term(const hiopVector& ixl, const hiopVector& ixu, const doub
209209
210210double VectorSpace::log_barrier_eval_local (const hiopVector& x, const hiopVector& ix) const
211211{
212- if (nlp_->useWeightedVectorSpace ()) {
212+ if (nlp_->get_weighted_space_type ()) {
213213 return x.logBarrierWeighted_local (ix, *M_lumped ());
214214 } else {
215215 return x.logBarrier_local (ix);
@@ -219,7 +219,7 @@ double VectorSpace::log_barrier_eval_local(const hiopVector& x, const hiopVector
219219// Adds (to `gradx`) the gradient of the weighted log, namely gradx = gradx - mu * M_lumped * ix/s
220220void VectorSpace::log_barrier_grad_add (const double & mu, const hiopVector& s, const hiopVector& ix, hiopVector& gradx) const
221221{
222- if (nlp_->useWeightedVectorSpace ()) {
222+ if (nlp_->get_weighted_space_type ()) {
223223 vec_n_->copyFrom (ix);
224224 vec_n_->componentDiv (s);
225225 vec_n_->componentMult (*M_lumped ());
@@ -235,7 +235,7 @@ double VectorSpace::linear_damping_term_local(const hiopVector& s,
235235 const double & mu,
236236 const double & kappa_d) const
237237{
238- if (nlp_->useWeightedVectorSpace ()) {
238+ if (nlp_->get_weighted_space_type ()) {
239239 vec_n_->copyFrom (s);
240240 vec_n_->componentMult (*M_lumped ());
241241 return vec_n_->linearDampingTerm_local (ixl, ixr, mu, kappa_d);
0 commit comments