Put() public method

Save a list of doubles.
public Put ( String key, double list ) : void
key String The key to save them under.
list double The list of doubles.
return void
        /// <inheritdoc/>
        public Object Read(Stream mask0)
        {
            var result = new TrainingContinuation();
            var ins0 = new EncogReadHelper(mask0);
            EncogFileSection section;

            while ((section = ins0.ReadNextSection()) != null)
            {
                if (section.SectionName.Equals("CONT")
                    && section.SubSectionName.Equals("PARAMS"))
                {
                    IDictionary<String, String> paras = section.ParseParams();

                    foreach (String key  in  paras.Keys)
                    {
                        if (key.Equals("type", StringComparison.InvariantCultureIgnoreCase))
                        {
                            result.TrainingType = paras[key];
                        }
                        else
                        {
                            double[] list = EncogFileSection
                                .ParseDoubleArray(paras, key);
                            result.Put(key, list);
                        }
                    }
                }
            }

            return result;
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public Object Read(Stream mask0)
        {
            var result = new TrainingContinuation();
            var ins0   = new EncogReadHelper(mask0);
            EncogFileSection section;

            while ((section = ins0.ReadNextSection()) != null)
            {
                if (section.SectionName.Equals("CONT") &&
                    section.SubSectionName.Equals("PARAMS"))
                {
                    IDictionary <String, String> paras = section.ParseParams();

                    foreach (String key  in  paras.Keys)
                    {
                        if (key.Equals("type", StringComparison.InvariantCultureIgnoreCase))
                        {
                            result.TrainingType = paras[key];
                        }
                        else
                        {
                            double[] list = section.ParseDoubleArray(paras, key);
                            result.Put(key, list);
                        }
                    }
                }
            }

            return(result);
        }
Exemplo n.º 3
0
 public object Read(Stream mask0)
 {
     EncogReadHelper helper;
     EncogFileSection section;
     IDictionary<string, string> dictionary;
     TrainingContinuation continuation = new TrainingContinuation();
     if (3 != 0)
     {
         helper = new EncogReadHelper(mask0);
         goto Label_001E;
     }
     Label_0010:
     if ((-2 == 0) || (4 == 0))
     {
         goto Label_005C;
     }
     Label_001E:
     if ((section = helper.ReadNextSection()) == null)
     {
         return continuation;
     }
     if (!section.SectionName.Equals("CONT"))
     {
         if (1 != 0)
         {
             if (0xff == 0)
             {
                 return continuation;
             }
             goto Label_0010;
         }
         if (0 == 0)
         {
             goto Label_0077;
         }
         goto Label_001E;
     }
     Label_005C:
     if (section.SubSectionName.Equals("PARAMS"))
     {
         dictionary = section.ParseParams();
     }
     else if ((0 == 0) && ((0 != 0) || (3 != 0)))
     {
         goto Label_001E;
     }
     Label_0077:
     using (IEnumerator<string> enumerator = dictionary.Keys.GetEnumerator())
     {
         string current;
         double[] numArray;
         goto Label_0090;
     Label_0086:
         continuation.Put(current, numArray);
     Label_0090:
         if (enumerator.MoveNext())
         {
             current = enumerator.Current;
             if (current.Equals("type", StringComparison.InvariantCultureIgnoreCase))
             {
                 continuation.TrainingType = dictionary[current];
                 goto Label_0090;
             }
             numArray = EncogFileSection.ParseDoubleArray(dictionary, current);
             if (0xff != 0)
             {
             }
             goto Label_0086;
         }
     }
     goto Label_001E;
 }