Exemplo n.º 1
0
 private void InitializeFromSixthLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     EPSL = UtilLib.ConvertToDouble(values[0], EPSL);
     EPSU = UtilLib.ConvertToDouble(values[1], EPSU);
     EPSS = UtilLib.ConvertToDouble(values[2], EPSS);
 }
Exemplo n.º 2
0
 private void InitializeFromSeventhLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     DS    = UtilLib.ConvertToDouble(values[0], DS);
     DSMIN = UtilLib.ConvertToDouble(values[1], DSMIN);
     DSMAX = UtilLib.ConvertToDouble(values[2], DSMAX);
     IADS  = UtilLib.ConvertToInt(values[3], IADS);
 }
Exemplo n.º 3
0
 private void InitializeFromFourthLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NMX = UtilLib.ConvertToInt(values[0], NMX);
     RL0 = UtilLib.ConvertToDouble(values[1], RL0);
     RL1 = UtilLib.ConvertToDouble(values[2], RL1);
     A0  = UtilLib.ConvertToDouble(values[3], A0);
     A1  = UtilLib.ConvertToDouble(values[4], A1);
 }
Exemplo n.º 4
0
 private void InitializeFromEighthLine(string line, StreamReader reader)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NTHL = UtilLib.ConvertToInt(values[0], 0);
     THL  = new IntDoublePairCollection();
     for (int i = 0; i < NTHL; i++)
     {
         string   newLine   = reader.ReadLine();
         string[] newValues = newLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
         THL.Add(new IntDoublePair(UtilLib.ConvertToInt(newValues[0]), UtilLib.ConvertToDouble(newValues[1])));
     }
 }
Exemplo n.º 5
0
        private void AnalyzeFort7File(string sFort7Content)
        {
            _Fort7 = sFort7Content;

            CurrentRun = AllRuns[AllRuns.Count - 1];

            string[] sLines        = UtilLib.Split(sFort7Content, '\n');
            int      nCount        = 0;
            bool     readSomething = false;

            foreach (string line in sLines)
            {
                try
                {
                    //if (line.Contains("0    PT  TY LAB"))
                    //{
                    //    AllRuns.Add(new AutoResultRun());
                    //    CurrentRun = AllRuns[AllRuns.Count - 1];
                    //    nCount = 0;
                    //}

                    string[] sColumns = UtilLib.Split(line, ' ');
                    if (sColumns[0].Trim() == "0" || sColumns.Length < 7)
                    {
                        //if (readSomething) break;
                        continue; // skip over comments
                    }


                    int nPoint = UtilLib.ConvertToInt(sColumns[1], 0);
                    if (Data.Count > 1 && Math.Sign(Data[nCount - 1].Point) != Math.Sign(nPoint))
                    {
                        Positions.Add(new IntPair(nCount, nPoint));
                        //System.Diagnostics.Debug.WriteLine("Stability change: " + nCount + " point: " + nPoint);
                    }

                    int nType  = UtilLib.ConvertToInt(sColumns[2], 0);
                    int nLabel = UtilLib.ConvertToInt(sColumns[3], 0);



                    if (nType == -9 && !readSomething)
                    {
                        _ErrorOccured = true;
                    }

                    double dPar    = UtilLib.ConvertToDouble(sColumns[4], double.NaN);
                    double dL2Norm = UtilLib.ConvertToDouble(sColumns[5], double.NaN);

                    NumVariables = sColumns.Length - 6;
                    var dVariables = new double[NumVariables];
                    for (int i = 0; i < NumVariables; i++)
                    {
                        dVariables[i] = UtilLib.ConvertToDouble(sColumns[6 + i], double.NaN);
                    }

                    Data.Add(new DataPoint(nPoint, nType, nLabel, dPar, dVariables));

                    if (nLabel != 0 && nType != 4 && nType != 9 && nType != -9)
                    {
                        Labels.Add(new IntTripple(Math.Abs(nPoint) - 1, nLabel, nType));
                    }


                    readSomething = true;
                    nCount++;
                }
                catch
                {
                    continue;
                }
            }
        }