11 (
const Array<double, 1>& S,
35 if(s.rows() !=
P->expected_parameter_size()) {
37 e <<
"Parameter space scaling diagonal matrix and parameters not equal in size:\n" 38 <<
" Parameter size " <<
P->expected_parameter_size()
39 <<
" Parameter space scaling diagonal matrix size " << s.rows();
49 Array<double, 1> R(
P->residual());
69 Array<double, 2>
J(
P->jacobian());
70 firstIndex i1; secondIndex i2;
89 Array<double,1> _x_(x.copy());
90 for(
int i=0; i<_x_.rows(); i++)
91 if(
S(i)) _x_(i) /=
S(i);
98 Array<double,1> _x_(x.copy());
99 for(
int i=0; i<_x_.rows(); i++)
100 if(
S(i)) _x_(i) *=
S(i);
virtual blitz::Array< double, 1 > residual()
Return the residual of the scaled NLLS problem at the current set point.
virtual void set_num_der1_evaluations(int count)
Sets the gradient evaluation counter to a desired value.
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
virtual void assert_parameter_set_correctly() const
Checks that the parameters are set correctly.
virtual void set_num_cost_evaluations(int count)
Sets the cost evaluation counter to a desired value.
NLLSProblemScaled(const blitz::Array< double, 1 > &s, const boost::shared_ptr< NLLSProblem > &p)
Default Constructor.
blitz::Array< double, 1 > X
virtual blitz::Array< double, 2 > jacobian()
Return the Jacobian of the residual of the scaled NLLS problem at the current set point...
The base class for all problem classes that implement a cost function.
virtual blitz::Array< double, 1 > parameters() const
Returns the current parameters.
This is the base of the exception hierarchy for Full Physics code.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
virtual blitz::Array< double, 1 > parameters() const
Just returns the current values of parameters.
Apply value function to a blitz array.
The base class for the Non-Linear Least Squares problem.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
def(luabind::constructor< int >()) .def("rows"
virtual blitz::Array< double, 1 > scale_parameters(const blitz::Array< double, 1 > &x) const
If x is the input to the NLLS problem that this class is trying to scale, then this method scales the...
boost::shared_ptr< NLLSProblem > P
virtual blitz::Array< double, 1 > unscale_parameters(const blitz::Array< double, 1 > &x) const
The input is correctly scaled to be used as input to this scaled NLLS problem.
blitz::Array< double, 1 > S