示例#1
0
 public                    KeyWrapper(HashSet <T> content)
 {
     m_data     = new HashSet <T>();
     m_hashCode = 0;
     foreach (var item in content)
     {
         m_data.Add(item);
         m_hashCode += item.GetHashCode();
     }
 }
示例#2
0
        public void FunctionMinimizerTest()
        {
            const double Dx = 10.0;

            for (var i = 0; i < SamplesCount; i++)
            {
                Func <double, double> f = Parabola;
                var x0 = RND(Dx, Dx);
                var y0 = RND(Dx, Dx);
                f = f.ArgumentShift(x0);
                f = f.Add(y0);

                f.Minimize(x0 - Dx / 2, x0 + Dx / 2, 100, out var x, out var y);

                Assert.That.Value(x).IsEqual(x0, 0.5, "x != x0");
                Assert.That.Value(y).IsEqual(y0, 0.2, "y != y0");
            }
        }
示例#3
0
文件: Adm.cs 项目: Ezequiel1057/Agili
 public void AddFunc(Funcionarios funcionarios)
 {
     Func.Add(funcionarios);
 }
示例#4
0
 public ISolidHttpRequest OnHttpResponse(Func <IServiceProvider, HttpResponseMessage, ValueTask> handler)
 {
     _onHttpResponseAsync = _onHttpResponseAsync.Add(handler);
     return(this);
 }
 public void AddPropertyValidator(Func <T, bool> propValidator)
 {
     _validators.Add(propValidator);
 }
 /// <summary>
 /// Adds a load function
 /// </summary>
 /// <param name="function">The function</param>
 public static void AddSaveFunction(this Func <object, object> function)
 {
     function.Add(saveList);
 }
 /// <summary>
 /// Adds a load function
 /// </summary>
 /// <param name="function">The function</param>
 public static void AddLoadFunction(this Func <object, object> function)
 {
     function.Add(loadList);
 }