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(); } }
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"); } }
public void AddFunc(Funcionarios funcionarios) { Func.Add(funcionarios); }
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); }