44 #ifndef ROL_SIMULATED_BOUND_CONSTRAINT_H
45 #define ROL_SIMULATED_BOUND_CONSTRAINT_H
62 const Ptr<BoundConstraint<Real>>
bnd_;
70 catch (
const std::bad_cast &e) {
79 catch (
const std::bad_cast &e) {
90 int nsamp =
sampler_->numMySamples();
91 std::vector<Ptr<Vector<Real>>> lvec(nsamp), uvec(nsamp);
92 for (
int k=0; k<
sampler_->numMySamples(); ++k) {
93 lvec[k] =
bnd_->getLowerBound()->clone();
94 lvec[k]->set(*
bnd_->getLowerBound());
95 uvec[k] =
bnd_->getUpperBound()->clone();
96 uvec[k]->set(*
bnd_->getUpperBound());
98 l_ = makePtr<SimulatedVector<Real>>(lvec,
sampler_->getBatchManager());
99 u_ = makePtr<SimulatedVector<Real>>(uvec,
sampler_->getBatchManager());
103 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
104 if(
bnd_->isActivated() ) {
111 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
112 if(
bnd_->isActivated() ) {
119 if(
bnd_->isActivated() ) {
120 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
127 if(
bnd_->isActivated() ) {
128 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
135 if(
bnd_->isActivated() ) {
136 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
143 if(
bnd_->isActivated() ) {
144 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
159 bool feasible =
true;
160 if(
bnd_->isActivated()) {
161 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
169 if(
bnd_->isActivated() ) {
170 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
177 if(
bnd_->isActivated() ) {
178 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the lower -active set.
Vector< Real > & getVector(Vector< Real > &x, int k) const
void project(Vector< Real > &x)
Project optimization variables onto the bounds.
A BoundConstraint formed from a single bound constraint replacated according to a SampleGenerator...
void projectInterior(Vector< Real > &x)
Project optimization variables into the interior of the feasible set.
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the upper -binding set.
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the -binding set.
SimulatedBoundConstraint(const Ptr< SampleGenerator< Real >> &sampler, const Ptr< BoundConstraint< Real >> &bnd)
Defines the linear algebra or vector space interface.
const Ptr< SampleGenerator< Real > > sampler_
Defines the linear algebra of a vector space on a generic partitioned vector where the individual vec...
const Vector< Real > & getVector(const Vector< Real > &x, int k) const
~SimulatedBoundConstraint()
bool isFeasible(const Vector< Real > &v)
Check if the vector, v, is feasible.
Provides the interface to apply upper and lower bound constraints.
void applyScalingFunctionJacobian(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply scaling function Jacobian.
const Ptr< BoundConstraint< Real > > bnd_
const Ptr< const Vector< Real > > getLowerBound(void) const
Return the ref count pointer to the lower bound vector.
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the upper -active set.
const Ptr< const Vector< Real > > getUpperBound(void) const
Return the ref count pointer to the upper bound vector.
void applyInverseScalingFunction(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply inverse scaling function.