rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
SQPstep.cpp
1 #include "SQPstep.hpp"
2 
3 #include <Eigen>
4 #include <cmath>
5 
6 using namespace Eigen;
7 
8 void ResizeLagrangianMultiplier(const RSVScalc &calcobj, VectorXd &lagMultAct, bool &isLarge, bool &isNan)
9 {
10  /*
11  Resizes the lagrangian multiplier LagMultAct based on whether any of its
12  values are nan or too large.
13 
14  This uses the RSVScalc object to guide it.
15  */
16  int ii, ni;
17 
18  isLarge = false;
19  isNan = false;
20  ni = lagMultAct.size();
21  for (ii = 0; ii < ni; ++ii)
22  {
23  if (lagMultAct[ii] < -calcobj.limLag)
24  {
25  lagMultAct[ii] = -calcobj.limLag;
26  isLarge = true;
27  }
28  else if (lagMultAct[ii] > calcobj.limLag)
29  {
30  lagMultAct[ii] = calcobj.limLag;
31  isLarge = true;
32  }
33  else if (std::isnan(lagMultAct[ii]))
34  {
35  lagMultAct[ii] = 0.0;
36  isNan = true;
37  }
38  }
39 }
Provides the infrastructure for calculation of the RSVS equations.
void ResizeLagrangianMultiplier(const RSVScalc &calcobj, Eigen::VectorXd &lagMultAct, bool &isLarge, bool &isNan)
Resizes the lagrangian multiplier LagMultAct based on whether any of its values are nan or too large.
Class to handle the RSVS calculation.
Definition: RSVScalc.hpp:130
double limLag
Value at which a Lagrangian multiplier is considered problematically large.
Definition: RSVScalc.hpp:192