Beispiel #1
0
    public ComponentSeries ExtractSeries(TimeSeries global, float timestamp, bool mirrored)
    {
        if (Data.IsPrecomputable(timestamp))
        {
            int index = Data.GetPrecomputedIndex(timestamp);
            if (mirrored && PrecomputedInverseComponentSeries[index] == null)
            {
                PrecomputedInverseComponentSeries[index] = new Precomputable <ComponentSeries>(Compute());
            }
            if (!mirrored && PrecomputedRegularComponentSeries[index] == null)
            {
                PrecomputedRegularComponentSeries[index] = new Precomputable <ComponentSeries>(Compute());
            }
            return(mirrored ? PrecomputedInverseComponentSeries[index].Value : PrecomputedRegularComponentSeries[index].Value);
        }

        return(Compute());

        ComponentSeries Compute()
        {
            return(DerivedExtractSeries(global, timestamp, mirrored));
        }
    }