44 #ifndef ROL_LINEARREGRESSION_H
45 #define ROL_LINEARREGRESSION_H
68 const Ptr<RegressionError<Real>>
error_;
69 const Ptr<SampleGenerator<Real>>
data_;
71 Ptr<RandVarFunctional<Real>>
em_;
72 Ptr<StochasticObjective<Real>>
obj_;
74 Ptr<RiskVector<Real>>
c_;
78 Ptr<BoundConstraint<Real>>
bnd_;
79 Ptr<RiskBoundConstraint<Real>>
rbnd_;
88 int dim =
data_->getMyPoint(0).size();
89 cdata_ = makePtr<std::vector<Real>>(dim,0);
90 c_ = makePtr<RiskVector<Real>>(makePtr<StdVector<Real>>(
cdata_));
95 em_ = ErrorMeasureFactory<Real>(parlist);
102 lower_ = makePtr<std::vector<Real>>(lower);
106 upper_ = makePtr<std::vector<Real>>(upper);
119 bnd_ = makePtr<StdBoundConstraint<Real>>(*
lower_,
true);
122 bnd_ = makePtr<StdBoundConstraint<Real>>(*
upper_,
false);
127 if (
bnd_ != nullPtr) {
128 rbnd_ = makePtr<RiskBoundConstraint<Real>>(
bnd_);
129 return makePtr<OptimizationProblem<Real>>(
obj_,
c_,
rbnd_);
131 return makePtr<OptimizationProblem<Real>>(
obj_,
c_);
138 void print(std::ostream &out = std::cout,
const std::string delim =
" ")
const {
141 for (
int i = 0; i < dim; ++i) {
142 out << delim << (*cdata_)[i];
144 out << std::endl << std::endl;