示例#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);
 }
示例#2
0
 private void InitializeFromFirstLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NDIM = UtilLib.ConvertToInt(values[0], NDIM);
     IPS  = UtilLib.ConvertToInt(values[1], IPS);
     IRS  = UtilLib.ConvertToInt(values[2], IRS);
     ILP  = UtilLib.ConvertToInt(values[3], ILP);
 }
示例#3
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);
 }
示例#4
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);
 }
示例#5
0
 private void InitializeFromSecondLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NICP = UtilLib.ConvertToInt(values[0], 0);
     ICP  = new IntCollection();
     for (int i = 0; i < NICP; i++)
     {
         ICP.Add(UtilLib.ConvertToInt(values[1 + i], 11));
     }
 }
示例#6
0
 private void InitializeFromFifthLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NPR  = UtilLib.ConvertToInt(values[0], NPR);
     MXBF = UtilLib.ConvertToInt(values[1], MXBF);
     IID  = UtilLib.ConvertToInt(values[2], IID);
     ITMX = UtilLib.ConvertToInt(values[3], ITMX);
     ITNW = UtilLib.ConvertToInt(values[4], ITNW);
     NWTN = UtilLib.ConvertToInt(values[5], NWTN);
     JAC  = UtilLib.ConvertToInt(values[6], JAC);
 }
示例#7
0
 private void InitializeFromThirdLine(string line)
 {
     string[] values = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     NTST = UtilLib.ConvertToInt(values[0], NTST);
     NCOL = UtilLib.ConvertToInt(values[1], NCOL);
     IAD  = UtilLib.ConvertToInt(values[2], IAD);
     ISP  = UtilLib.ConvertToInt(values[3], ISP);
     ISW  = UtilLib.ConvertToInt(values[4], ISW);
     IPLT = UtilLib.ConvertToInt(values[5], IPLT);
     NBC  = UtilLib.ConvertToInt(values[6], NBC);
     NINT = UtilLib.ConvertToInt(values[7], NINT);
 }
示例#8
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])));
     }
 }
示例#9
0
 public override string ToString()
 {
     return(String.Format("{0} {1}: {2}", UtilLib.ConvertIntTypeToShortString(_Value2), UtilLib.ConvertIntTypeToString(_Value2), _Value1));
 }
示例#10
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;
                }
            }
        }