10 #ifndef ROL_REGRESSIONERROR_H
11 #define ROL_REGRESSIONERROR_H
31 if (data.size() != x.size()) {
39 Real
value(
const std::vector<Real> &x, Real &tol ) {
42 std::vector<Real> c; c.assign(x.begin()+1,x.end());
46 std::vector<Real> X; X.assign(data.begin()+1,data.end());
51 for (
int i = 0; i < Xdim; ++i) {
57 void gradient( std::vector<Real> &g,
const std::vector<Real> &x, Real &tol ) {
61 std::vector<Real> X; X.assign(data.begin()+1,data.end());
64 g[0] =
static_cast<Real
>(-1);
65 for (
int i = 0; i < Xdim; ++i) {
70 void hessVec( std::vector<Real> &hv,
const std::vector<Real> &v,
const std::vector<Real> &x, Real &tol ) {
71 hv.assign(hv.size(),
static_cast<Real
>(0));
void gradient(std::vector< Real > &g, const std::vector< Real > &x, Real &tol)
Provides the interface to evaluate linear regression error.
void hessVec(std::vector< Real > &hv, const std::vector< Real > &v, const std::vector< Real > &x, Real &tol)
Real value(const std::vector< Real > &x, Real &tol)
Specializes the ROL::Objective interface for objective functions that operate on ROL::StdVector's.
const std::vector< Real > getParameter(void) const
void checkSize(const std::vector< Real > &x)