Click here to Skip to main content
15,893,904 members
Articles / Programming Languages / C# 4.0

Grandiose projects 5. Audio support

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
3 Feb 2012CPOL8 min read 23.2K   2K   8  
Audio support for grandiose projects
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;

using CategoryTheory;
using DiagramUI;
using GeneralLinearMethod;
using AnalyticPolynom;
using BaseTypes;
using DataPerformer;
using DataPerformer.Interfaces;


namespace Regression
{
    /// <summary>
    /// Array selection
    /// </summary>
    public class ArraySelection : IMeasure, IStructuredSelection
    {

        #region Fields

        /// <summary>
        /// Name of object
        /// </summary>
        protected string name = "";

        /// <summary>
        /// Selection data
        /// </summary>
        protected double[] data;

        private Func<object> p;
        private ArrayReturnType type;
 
        #endregion

        #region Constructors

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">Selection name</param>
        /// <param name="data">Selection data</param>
        public ArraySelection(string name, double[] data)
        {
            p = parameter;
            this.name = name + "";
            Array = data;
        }

        #endregion

        #region IMeasure Members

        /// <summary>
        /// Function of selection
        /// </summary>
        public Func<object> Parameter
        {
            get
            {
                return p;
            }
        }

        /// <summary>
        /// Derivation function
        /// </summary>
        public Func<object> Derivation
        {
            get
            {
                return null;
            }
        }

        /// <summary>
        /// Name
        /// </summary>
        public string Name
        {
            get
            {
                return name;
            }
        }
        

        /// <summary>
        /// Factor
        /// </summary>
        public double Factor
        {
            get
            {
                return 1;
            }
        }

        /// <summary>
        /// Measure type
        /// </summary>
        public object Type
        {
            get
            {
                return type;
            }
        }

        #endregion

        #region IStructuredSelection Members

        /// <summary>
        /// The "is fixed amount" sign
        /// </summary>
        public bool HasFixedAmount
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// Access to n - th element
        /// </summary>
        public double? this[int n]
        {
            get
            {
                return data[n];
            }
        }

        /// <summary>
        /// Tolerance of it - th element
        /// </summary>
        /// <param name="n">Element number</param>
        /// <returns>Tolerance</returns>
        public int GetTolerance(int n)
        {
            return 0;
        }

        /// <summary>
        /// Sets tolerance of n - th element
        /// </summary>
        /// <param name="n">Element number</param>
        /// <param name="tolerance">Tolerance to set</param>
        public void SetTolerance(int n, int tolerance)
        {
        }

        /// <summary>
        /// Weight of n - th element
        /// </summary>
        /// <param name="n">Element number</param>
        /// <returns>The weight</returns>
        public double GetWeight(int n)
        {
            return 1;
        }

        /// <summary>
        /// Dimension of data
        /// </summary>
        public int DataDimension
        {
            get
            {
                return data.Length;
            }
        }

        /// <summary>
        /// Aprior weight of n - th element
        /// </summary>
        /// <param name="n">Element number</param>
        /// <returns>The weight</returns>
        public double GetApriorWeight(int n)
        {
            return 0;
        }

        #endregion

        #region Specific Members

        /// <summary>
        /// Data array
        /// </summary>
        public double[] Array
        {
            set
            {
                Double a = 0;
                data = new double[value.Length];
                type = new ArrayReturnType(a, new int[]{value.Length}, false);
                for (int i = 0; i < value.Length; i++)
                {
                    data[i] = value[i];
                    //type[i] = 0;
                }
            }
        }

        /// <summary>
        /// Name of measure
        /// </summary>
        public string MeasureName
        {
            set
            {
                name = value;
            }
        }

        private object parameter()
        {
            return data;
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Russian Federation Russian Federation
Ph. D. Petr Ivankov worked as scientific researcher at Russian Mission Control Centre since 1978 up to 2000. Now he is engaged by Aviation training simulators http://dinamika-avia.com/ . His additional interests are:

1) Noncommutative geometry

http://front.math.ucdavis.edu/author/P.Ivankov

2) Literary work (Russian only)

http://zhurnal.lib.ru/editors/3/3d_m/

3) Scientific articles
http://arxiv.org/find/all/1/au:+Ivankov_Petr/0/1/0/all/0/1

Comments and Discussions