title: Update values of array when a specific element is changed
body: <p>Let us assume that I have defined a function named <code>computeValue (double x)</code>:</p>
  
  <ol>
  <li>whose input is a double value</li>
  <li>that returns a value obtained by performing a certain set of operations using the elements of an array, to be described below.</li>
  </ol>
  
  <p>Also, we have the above mentioned <strong>array</strong> that </p>
  
  <ol>
  <li>is some class's member</li>
  <li>contains only 4 positions.</li>
  <li>The 1st position contains a certain value, the 4th contains another value that will be the input to our function</li>
  <li>(here comes the tricky bit), the 2nd and 3rd values of the array should be the result of a linear interpolation between positions 1 and 4 of the array. That is, if we modify the position 1 or 4 of the array, then positions 2 and 3 should change their values automatically according to the interpolation method.</li>
  </ol>
  
  <p>My aim is to invoke a root-finding algorithm (such as Newton-Raphson, Secant Method, etc) that will aim to minimize the following expression: </p>
  
  <pre><code>f = CONSTANT - computeValue(array[4])
  </code></pre>
  
  <p>As you may have already observed, the problem is that every time my root-finding routine modifies the 4th element of my array to obtain a new solution, the positions 2 and 3 of my array should be modified accordingly given that they are the result of a interpolation (as mentioned in point 4 above), thus changing the result of <code>computeValue</code>.</p>
  
  <p>What is a possible way of making the values of the array change dynamically as the root finding algorithm works its way towards the root? Maybe something to do with an array storing lambda expressions defining the interpolation?</p>