/// <summary>
        /// Clones RAData object
        /// </summary>
        public RAData CloneData()
        {
            // Inputs
            RAData temp = new RAData();

            if (Inputs != null)
            {
                if (Inputs.Length != 0)
                {
                    temp.Inputs = new double[Inputs.Length][];
                    for (int i = 0; i < Inputs.Length; i++)
                    {
                        temp.Inputs[i] = (double[])Inputs[i].Clone();
                    }
                }
                else
                {
                    temp.Inputs = (double[][])Inputs.Clone();
                }
            }
            // Outputs
            if (Outputs != null)
            {
                temp.Outputs = (double[])Outputs.Clone();
            }
            // Valuations
            if (Valuations != null)
            {
                temp.Valuations = (double[])Valuations.Clone();
            }
            return(temp);
        }
Beispiel #2
0
 /// <summary>
 /// Creates RAResult object with prefilled input regression analysis data and validate initial data set
 /// </summary>
 /// <param name="initData">Prefilled regression analysis data</param>
 public RAResultBase(RAData initData)
 {
     if (initData == null)
     {
         throw new ArgumentNullException("'initData' parameter could NOT be equals null");
     }
     if (initData.Inputs == null || initData.Inputs.Length == 0)
     {
         throw new ArgumentException("'initData' parameter could NOT contains null or empty Inputs array");
     }
     if (initData.Outputs == null || initData.Outputs.Length == 0)
     {
         throw new ArgumentException("'initData' parameter could NOT contains null or empty Outputs array");
     }
     if (initData.Inputs.Length != initData.Outputs.Length)
     {
         throw new ArgumentException("'initData' parameter could NOT contains Inputs and Outputs arrays with not equal length)");
     }
     Data = initData;
     NumberOfObservations = initData.Inputs.Length;
 }
 /// <summary>
 /// Create new RAData object with prefilled RAData object
 /// </summary>
 /// <param name="init">Initial RAData object</param>
 public RAProcessorLinear(RAData init) : base(init)
 {
 }
 public RAResultNonLinear(RAData initData) : base(initData)
 {
     RAProcessor = new RAProcessorNonLinear(initData);
 }
        }                           // Base constructor is needed for supporting clone functionality

        /// <summary>
        /// Creates new RAData object that refers to already existing RAData object
        /// </summary>
        /// <param name="initRAData">Initial RAData object</param>
        public RAData(RAData initRAData)
        {
            Inputs     = initRAData.Inputs;
            Outputs    = initRAData.Outputs;
            Valuations = initRAData.Valuations;
        }