Exemple #1
0
 internal SampleListEnumerator(SampleList sampleList, int index, int count, EnumerationMode mode)
 {
     _sampleList = sampleList;
     _index      = index;
     _startIndex = index;
     _endIndex   = index + count;
     _mode       = mode;
 }
 InterpolationSingleDimension(
     SampleList samples
     )
 {
     _samples = samples;
     _samples.SampleAltered += samples_SampleAltered;
     _algorithm = new PolynomialInterpolationAlgorithm(); 
 }
Exemple #3
0
 internal SampleListEnumerator(SampleList sampleList, int index, int count, EnumerationMode mode)
 {
     this.sampleList = sampleList;
     this.index      = index;
     this.startIndex = index;
     this.endIndex   = index + count;
     this.mode       = mode;
 }
Exemple #4
0
        public virtual SampleList Clone()
        {
            SampleList list = new SampleList(size);

            Array.Copy(sampleCount, 0, list.sampleCount, 0, size);
            Array.Copy(sampleT, 0, list.sampleT, 0, size);
            Array.Copy(sampleX, 0, list.sampleX, 0, size);
            list.size = size;
            return(list);
        }
Exemple #5
0
        Clone()
        {
            SampleList list = new SampleList(_size);

            Array.Copy(_sampleCount, 0, list._sampleCount, 0, _size);
            Array.Copy(_sampleT, 0, list._sampleT, 0, _size);
            Array.Copy(_sampleX, 0, list._sampleX, 0, _size);
            list._size = _size;
            return(list);
        }
        Prepare(
            SampleList samples
            )
        {
            if(null == samples)
            {
                throw new ArgumentNullException("samples");
            }

            _samples = samples;
            _effectiveOrder = Math.Min(_maximumOrder, samples.Count);
        }
        public void IRID119_PolynomialExtrapolatePositiveDirection()
        {
            double[] x = new double[] { -6.060771484, -5.855378418, -1.794238281, -1.229428711, 0.89935791, 2.912121582, 4.699230957, 4.788347168, 7.728830566, 11.70989502 };
            double[] y = new double[] { 0.959422052, 0.959447861, 0.959958017, 0.960028946, 0.960323274, 0.960636258, 0.960914195, 0.960928023, 0.96138531, 0.962004483 };

            PolynomialInterpolationAlgorithm pia = new PolynomialInterpolationAlgorithm(10);
            SampleList sl = new SampleList(10);

            for(int i = 0; i < 10; i++)
            {
                sl.Add(x[i], y[i]);
            }

            pia.Prepare(sl);
            Assert.That(pia.Extrapolate(12), NumericIs.AlmostEqualTo(0.9622, 1e-3), "extrapolate(12)");
        }
 InterpolationSingleDimension(
     double[] t,
     double[] x
     )
 {
     _samples = new SampleList(t, x);
     _algorithm = new PolynomialInterpolationAlgorithm();
 }
Exemple #9
0
 internal ValueList(SampleList sampleList)
 {
     this.sampleList = sampleList;
 }
 InterpolationSingleDimension(
     double[] t,
     double[] x,
     InterpolationMode mode
     )
 {
     _samples = new SampleList(t, x);
     _algorithm = SelectAlgorithm(mode);
 }
 InterpolationSingleDimension(
     SampleList samples,
     InterpolationMode mode
     )
 {
     _samples = samples;
     _samples.SampleAltered += samples_SampleAltered;
     _algorithm = SelectAlgorithm(mode);
 }
Exemple #12
0
 internal ValueList(SampleList sampleList)
 {
     this.sampleList = sampleList;
 }
 InterpolationSingleDimension(
     IDictionary samples
     )
 {
     _samples = new SampleList(samples);
     _algorithm = new PolynomialInterpolationAlgorithm();
 }
 InterpolationSingleDimension(
     SampleList samples,
     InterpolationMode mode,
     int maximumOrder
     )
 {
     _samples = samples;
     _samples.SampleAltered += samples_SampleAltered;
     _algorithm = SelectAlgorithm(mode);
     _algorithm.MaximumOrder = maximumOrder;
 }
Exemple #15
0
 Clone()
 {
     SampleList list = new SampleList(_size);
     Array.Copy(_sampleCount, 0, list._sampleCount, 0, _size);
     Array.Copy(_sampleT, 0, list._sampleT, 0, _size);
     Array.Copy(_sampleX, 0, list._sampleX, 0, _size);
     list._size = _size;
     return list;
 }
Exemple #16
0
 internal KeyList(SampleList sampleList)
 {
     this.sampleList = sampleList;
 }
 InterpolationSingleDimension(
     double[] t,
     double[] x,
     InterpolationMode mode,
     int maximumOrder
     )
 {
     _samples = new SampleList(t, x);
     _algorithm = SelectAlgorithm(mode);
     _algorithm.MaximumOrder = maximumOrder;
 }
 samples_SampleAltered(
     object sender,
     SampleList.SampleAlteredEventArgs e
     )
 {
     _dirty = true; // require new preparation
 }
 InterpolationSingleDimension(
     double[] t,
     double[] x,
     IInterpolationAlgorithm algorithm
     )
 {
     _samples = new SampleList(t, x);
     _algorithm = algorithm;
 }
 InterpolationSingleDimension(
     SampleList samples,
     IInterpolationAlgorithm algorithm
     )
 {
     _samples = samples;
     _samples.SampleAltered += samples_SampleAltered;
     _algorithm = algorithm;
 }
Exemple #21
0
 internal ValueList(SampleList sampleList)
 {
     _sampleList = sampleList;
 }
 internal ValueList(SampleList sampleList)
 {
     _sampleList = sampleList;
 }
Exemple #23
0
 internal SampleListEnumerator(SampleList sampleList, int index, int count, EnumerationMode mode)
 {
     this.sampleList = sampleList;
     this.index = index;
     this.startIndex = index;
     this.endIndex = index + count;
     this.mode = mode;
 }
 internal SampleListEnumerator(SampleList sampleList, int index, int count, EnumerationMode mode)
 {
     _sampleList = sampleList;
     _index = index;
     _startIndex = index;
     _endIndex = index + count;
     _mode = mode;
 }
Exemple #25
0
 internal KeyList(SampleList sampleList)
 {
     this.sampleList = sampleList;
 }
		public void Prepare(SampleList samples)
		{
			this.samples = samples;
			this.effectiveOrder = Math.Min(order,samples.Count);
		}
 public SampleProvider()
 {
     _samples = new SampleList();
 }
Exemple #28
0
		public virtual SampleList Clone()
		{
			SampleList list = new SampleList(size);
			Array.Copy(sampleCount,0,list.sampleCount,0,size);
			Array.Copy(sampleT,0,list.sampleT,0,size);
			Array.Copy(sampleX,0,list.sampleX,0,size);
			list.size = size;
			return list;
		}