Can't find mistake. The value spontaneously changes
<p>Here is the code</p>

<pre><code>for (j = 0; j &lt; n_sign; j++)
{
    line = new List&lt;double&gt;();
    for (i = 0; i &lt; n_vec; i++)
    {
        if (data_gap[i][j] != gap)
            line.Add(data_gap[i][j]);
        else
        {
            grad.Add(0);
            List&lt;int&gt; point = new List&lt;int&gt;();
            point.Add(i);
            point.Add(j);
            gaps.Add(point);
        }
    }

    List&lt;double&gt; mm = new List&lt;double&gt;();
    mm.Add(line.Min());
    mm.Add(line.Max());
    minmax.Add(mm);

    for (i = 0; i &lt; n_vec; i++)
    {
        if (data_gap[i][j] == gap)
            data[i][j] = line[rand.Next(line.Count)];
    }
}
</code></pre>

<p>I can't understand, why after this function the values of data_gap change to the values of data!
data_gap has been created this way</p>

<pre><code>data_gap = new List&lt;List&lt;double&gt;&gt;(data);
</code></pre>

<p>so it seems to be a unique object...</p>
