10 #ifndef ROL_SIMULATED_BOUND_CONSTRAINT_H
11 #define ROL_SIMULATED_BOUND_CONSTRAINT_H
28 const Ptr<BoundConstraint<Real>>
bnd_;
36 catch (
const std::bad_cast &e) {
45 catch (
const std::bad_cast &e) {
56 int nsamp =
sampler_->numMySamples();
57 std::vector<Ptr<Vector<Real>>> lvec(nsamp), uvec(nsamp);
58 for (
int k=0; k<
sampler_->numMySamples(); ++k) {
59 lvec[k] =
bnd_->getLowerBound()->clone();
60 lvec[k]->set(*
bnd_->getLowerBound());
61 uvec[k] =
bnd_->getUpperBound()->clone();
62 uvec[k]->set(*
bnd_->getUpperBound());
64 l_ = makePtr<SimulatedVector<Real>>(lvec,
sampler_->getBatchManager());
65 u_ = makePtr<SimulatedVector<Real>>(uvec,
sampler_->getBatchManager());
69 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
70 if(
bnd_->isActivated() ) {
77 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
78 if(
bnd_->isActivated() ) {
85 if(
bnd_->isActivated() ) {
86 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
93 if(
bnd_->isActivated() ) {
94 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
101 if(
bnd_->isActivated() ) {
102 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
109 if(
bnd_->isActivated() ) {
110 for(
int k=0; k<
sampler_->numMySamples(); ++k ) {
125 bool feasible =
true;
126 if(
bnd_->isActivated()) {
127 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 ) {
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.