public FunctionOutput<string>[] FastReplace(Excel.Range com, DAG dag, InputSample original, InputSample sample, AST.Address[] outputs, bool replace_original)
{
FunctionOutput<string>[] fo_arr;
if (!_d.TryGetValue(sample, out fo_arr))
{
// replace the COM value
ReplaceExcelRange(com, sample);
// initialize array
fo_arr = new FunctionOutput<string>[outputs.Length];
// grab all outputs
for (var k = 0; k < outputs.Length; k++)
{
// save the output
fo_arr[k] = new FunctionOutput<string>(dag.readCOMValueAtAddress(outputs[k]), sample.GetExcludes());
}
// Add function values to cache
// Don't care about return value
_d.Add(sample, fo_arr);
// restore the COM value
if (replace_original)
{
ReplaceExcelRange(com, original);
}
}
return fo_arr;
}