class_docstr: Scalar function and its derivatives.
  
  This class defines a scalar function F: R^n->R and methods for
  computing or approximating its first and second derivatives.
  
  Notes
  -----
  This class implements a memoization logic. There are methods `fun`,
  `grad`, hess` and corresponding attributes `f`, `g` and `H`. The following
  things should be considered:
  
      1. Use only public methods `fun`, `grad` and `hess`.
      2. After one of the methods is called, the corresponding attribute
         will be set. However, a subsequent call with a different argument
         of *any* of the methods may overwrite the attribute.
class_docstr_tok: ["Scalar","function","and","its","derivatives",".","This","class","defines","a","scalar","function","F",":","R^n-",">","R","and","methods","for","computing","or","approximating","its","first","and","second","derivatives",".","Notes","--","--","-","This","class","implements","a","memoization","logic",".","There","are","methods","`","fun","`",",","`","grad","`",",","hess","`","and","corresponding","attributes","`","f","`",",","`","g","`","and","`","H","`",".","The","following","things","should","be","considered",":","1",".","Use","only","public","methods","`","fun","`",",","`","grad","`","and","`","hess","`",".","2",".","After","one","of","the","methods","is","called",",","the","corresponding","attribute","will","be","set",".","However",",","a","subsequent","call","with","a","different","argument","of","*","any","*","of","the","methods","may","overwrite","the","attribute","."]
code: def hess(self, x):
      if not np.array_equal(x, self.x):
          self._update_x_impl(x)
      self._update_hess()
      return self.H
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import scipy.sparse
  from ._numdiff import approx_derivative, group_columns
  from ._hessian_update_strategy import HessianUpdateStrategy
  from scipy.sparse.linalg import LinearOperator
label_desc: Use image node_id 7 for calling the ScalarFunction obj's underlying member method code with example usage: obj.hess(x) and returns: self