Do not calculate matrix for node more than one times.