ReFRACtor
bard_nlls_problem.cc
Go to the documentation of this file.
1 #include "bard_nlls_problem.h"
2 
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 // See base class for description.
8 Array<double, 1> BardNLLSProblem::residual()
9 {
10  if(R.size() <= 0) {
11  assert_parameter_set_correctly();
12  increment_num_cost_evaluations();
13  R.resize(residual_size());
14 
15  Array<double, 1> y(residual_size());
16  y = 0.14,0.18,0.22, 0.25,0.29,0.32,0.35,0.39,0.37,0.58,0.73,0.96,1.34,2.10,4.39;
17  for(int i=1; i<=residual_size(); i++)
18  R(i-1) = y(i-1) - (X(0) + i/((16-i)*X(1) + (8-abs(8-i))*X(2)));
19  }
20  return R.copy();
21 }
22 
23 // See base class for description.
24 Array<double, 2> BardNLLSProblem::jacobian()
25 {
26  if(J.size() <= 0) {
27  assert_parameter_set_correctly();
28  increment_num_der1_evaluations();
29  J.resize(residual_size(), parameter_size());
30 
31  for(int i=1; i<=residual_size(); i++) {
32  double denom = (16-i)*X(1) + (8-abs(8-i))*X(2);
33  denom = denom*denom;
34  J(i-1,0) = -1.0; J(i-1,1) = (16-i)*i/denom; J(i-1,2) = (8-abs(8-i))*i/denom;
35  }
36  }
37  return J.copy();
38 }
virtual blitz::Array< double, 1 > residual()
The residual vector function.
const Unit J("J", N *m)
virtual blitz::Array< double, 2 > jacobian()
The Jacobian matrix function.
Apply value function to a blitz array.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08