/// <summary> /// to power /// </summary> /// <param name="power">power</param> public void RaiseTo(CommonF power) { if (!(power is Pow)) { baseAndPower.Add(power); } else { baseAndPower.AddRange(((Pow)power).baseAndPower); } }
/// <summary> /// constructor /// </summary> /// <param name="function">function delegate</param> /// <param name="arg">argument of function</param> /// <param name="performance">string function performance, which has 'argument' instead of variable</param> public OneVar(Func <double, double> function, CommonF arg, string performance) { if (performance == "") { throw new ArgumentException("empty string of performance"); } this.performance = performance; if (arg == null || function == null) { throw new ArgumentException("function or argiment is null"); } compute = function; this.arg = arg; staticDelegate = p => compute(arg.Invoke(p)); }
public SVector3(CommonF x, CommonF y, CommonF z) : base(new List <CommonF>()) { this[0] = x; this[1] = y; this[2] = z; }
public static OneVar _log10(CommonF arg) { return(new OneVar(Math.Log10, arg, "log10(argument)")); }
public static OneVar _floor(CommonF arg) { return(new OneVar(Math.Floor, arg, "floor(argument)")); }
public static OneVar _exp(CommonF arg) { return(new OneVar(Math.Exp, arg, "exp(argument)")); }
public static OneVar _cosh(CommonF arg) { return(new OneVar(Math.Cosh, arg, "cosh(argument)")); }
public static OneVar _ceil(CommonF arg) { return(new OneVar(Math.Ceiling, arg, "ceil(argument)")); }
public static OneVar _sqrt(CommonF arg) { return(new OneVar(Math.Sqrt, arg, "sqrt(argument)")); }
public static OneVar _atanh(CommonF arg) { return(new OneVar(MathNet.Numerics.Trig.Atanh, arg, "atanh(argument)")); }
public static OneVar _atan(CommonF arg) { return(new OneVar(Math.Atan, arg, "atan(argument)")); }
public static OneVar _acos(CommonF arg) { return(new OneVar(Math.Acos, arg, "acos(argument)")); }
public static OneVar _sin(CommonF arg) { return(new OneVar(Math.Sin, arg, "sin(argument)")); }
public static Pow _pow(CommonF b, CommonF p) { return(b ^ p); }
public static OneVar _tanh(CommonF arg) { return(new OneVar(Math.Tanh, arg, "tanh(argument)")); }
public static OneVar _cbrt(CommonF arg) { return(new OneVar(x => Math.Pow(x, 1 / 3), arg, "cbrt(argument)")); }
public static OneVar _signum(CommonF arg) { return(new OneVar(x => Math.Sign(x), arg, "signum(argument)")); }