Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
        /// <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));
        }
Exemple #3
0
 public SVector3(CommonF x, CommonF y, CommonF z) : base(new List <CommonF>())
 {
     this[0] = x;
     this[1] = y;
     this[2] = z;
 }
Exemple #4
0
 public static OneVar _log10(CommonF arg)
 {
     return(new OneVar(Math.Log10, arg, "log10(argument)"));
 }
Exemple #5
0
 public static OneVar _floor(CommonF arg)
 {
     return(new OneVar(Math.Floor, arg, "floor(argument)"));
 }
Exemple #6
0
 public static OneVar _exp(CommonF arg)
 {
     return(new OneVar(Math.Exp, arg, "exp(argument)"));
 }
Exemple #7
0
 public static OneVar _cosh(CommonF arg)
 {
     return(new OneVar(Math.Cosh, arg, "cosh(argument)"));
 }
Exemple #8
0
 public static OneVar _ceil(CommonF arg)
 {
     return(new OneVar(Math.Ceiling, arg, "ceil(argument)"));
 }
Exemple #9
0
 public static OneVar _sqrt(CommonF arg)
 {
     return(new OneVar(Math.Sqrt, arg, "sqrt(argument)"));
 }
Exemple #10
0
 public static OneVar _atanh(CommonF arg)
 {
     return(new OneVar(MathNet.Numerics.Trig.Atanh, arg, "atanh(argument)"));
 }
Exemple #11
0
 public static OneVar _atan(CommonF arg)
 {
     return(new OneVar(Math.Atan, arg, "atan(argument)"));
 }
Exemple #12
0
 public static OneVar _acos(CommonF arg)
 {
     return(new OneVar(Math.Acos, arg, "acos(argument)"));
 }
Exemple #13
0
 public static OneVar _sin(CommonF arg)
 {
     return(new OneVar(Math.Sin, arg, "sin(argument)"));
 }
Exemple #14
0
 public static Pow _pow(CommonF b, CommonF p)
 {
     return(b ^ p);
 }
Exemple #15
0
 public static OneVar _tanh(CommonF arg)
 {
     return(new OneVar(Math.Tanh, arg, "tanh(argument)"));
 }
Exemple #16
0
 public static OneVar _cbrt(CommonF arg)
 {
     return(new OneVar(x => Math.Pow(x, 1 / 3), arg, "cbrt(argument)"));
 }
Exemple #17
0
 public static OneVar _signum(CommonF arg)
 {
     return(new OneVar(x => Math.Sign(x), arg, "signum(argument)"));
 }