protected internal override double doFirstDerivative(double xValue) { ArgChecker.isTrue(Math.Abs(xValue) > SMALL, "magnitude of xValue must not be small"); ValueDerivatives resValue = FUNCTION.evaluateAndDifferentiate(poly, xValue); return(-resValue.Value / (xValue * xValue) + resValue.getDerivative(0) / xValue); }
protected internal override DoubleArray doParameterSensitivity(double xValue) { ArgChecker.isTrue(Math.Abs(xValue) > SMALL, "magnitude of xValue must not be small"); DoubleArray resSense = FUNCTION.nodeSensitivity(polySens.get(), xValue); return(resSense.multipliedBy(DoubleArray.of(resSense.size(), i => xValues[i] / xValue))); }
private void Update() { switch (function) { case FUNCTION.Enable: if (c.a < 1.00f) { c.a += Time.deltaTime * SPEED * speedModifier; } else { c.a = 1.00f; function = FUNCTION.Sleep; } break; case FUNCTION.Disable: if (c.a > 0.00f) { c.a -= Time.deltaTime * SPEED * speedModifier; } else { c.a = 0.00f; function = FUNCTION.Sleep; Deactivate(); } break; default: enabled = false; break; } VaryColour(); }
//------------------------------------------------------------------------- protected internal override double doInterpolate(double xValue) { ArgChecker.isTrue(Math.Abs(xValue) > SMALL, "magnitude of xValue must not be small"); double resValue = FUNCTION.evaluate(poly, xValue).get(0); return(resValue / xValue); }
/* * Parses TYPEDEF commands (First token, then delegates rest to specific TYPEDEF implementations). * Populates typedef table. */ public static TYPEDEF Parse(string code, Dictionary <string, TYPEDEF> typedefTable) { if (String.IsNullOrEmpty(code)) { throw new ArgumentNullException("code"); } if (null == typedefTable) { throw new ArgumentNullException("typedefTable"); } string[] tokens = code.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); if (tokens.Length < 3) { throw new ArgumentException("TYPEDEF statements must consist of at least three tokens (TYPEDEF <NAME> <TYPE>), received: " + code); } if (tokens[0].ToUpper() != "TYPEDEF") { throw new ArgumentException("TYPEDEFs must start with keyword TYPEDEF, but received: " + tokens[0]); } TYPEDEF parsedType = null; string Type = tokens[2].ToUpper(); if (Type == "BASIC") { parsedType = new BASIC(tokens, typedefTable); } else if (Type == "PRODUCT") { parsedType = new PRODUCT(tokens, typedefTable); } else if (Type == "SUM") { parsedType = new SUM(tokens, typedefTable); } else if (Type == "SEQUENCE") { parsedType = new SEQUENCE(tokens, typedefTable); } else if (Type == "FUNCTION") { parsedType = new FUNCTION(tokens, typedefTable); } else if (Type == "SUBTYPE") { parsedType = new SUBTYPE(tokens, typedefTable); } else { throw new SyntacticException("Not a valid TYPEDEF: " + code); } return(parsedType); }
// Snappy enable public void TurnOn() { Activate(); c.a = 1.00f; if (col2D) { col2D.enabled = true; } function = FUNCTION.Sleep; VaryColour(); }
// Snappy disable public void TurnOff() { c.a = 0.00f; if (col2D) { col2D.enabled = false; } function = FUNCTION.Sleep; VaryColour(); Deactivate(); }
public LinearRegressionFunction(FUNCTION function) { this.function = function; }
public FunctionService(FUNCTION item) { _item = item; }
public LinearRegressionFunction(FUNCTION function) { this.function = function; }
// Progressive disable public void Disable() { function = FUNCTION.Disable; WhenDisabled(); enabled = true; }
// Progressive enable public void Enable() { function = FUNCTION.Enable; WhenEnabled(); enabled = true; }
/// <summary> /// Run a function on the pre-processor DLL without any arguments. /// </summary> /// <param name="fn">Specifies the function to run.</param> public void Run(FUNCTION fn) { m_iextension.RunExtension(m_hExtension, (long)fn, null); }
/// <summary> /// Run a function on the pre-processor DLL with arguments. /// </summary> /// <param name="fn">Specifies the function to run.</param> /// <param name="rgParam">Specifies the arguments.</param> /// <returns>The return values from the pre-processor DLL are returned.</returns> public float[] Run(FUNCTION fn, float[] rgParam) { return(m_iextension.RunExtensionF(m_hExtension, (long)fn, rgParam)); }
/// <summary> /// Run a function on the pre-processor DLL with arguments. /// </summary> /// <param name="fn">Specifies the function to run.</param> /// <param name="rgParam">Specifies the arguments.</param> /// <returns>The return values from the pre-processor DLL are returned.</returns> public double[] Run(FUNCTION fn, double[] rgParam) { return(m_iextension.RunExtensionD(m_hExtension, (long)fn, rgParam)); }