Exemplo n.º 1
0
        public Vector <F> EntryWiseApply <F>(MonoFunction <R, F> func) where F : FieldLikeObject <F>
        {
            var ent = new F[Length()];

            Parallel.For(0, Length(), i => {
                ent[i] = func.evaluate(entries[i]);
            });
            return(ent);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Create a combined random variable with given function and random variable
 /// </summary>
 /// <param name="real">Function to apply random variable to</param>
 /// <param name="var">Random variable</param>
 internal ComposedRandomVariable(MonoFunction <D, E> real, RandomVariable <D> var)
 {
     this.real = real;
     this.var  = var;
 }
Exemplo n.º 3
0
 public RandomVariable <C> apply_function <C>(MonoFunction <E, C> function) where C : ValueType
 {
     return(new ComposedRandomVariable <E, C>(function, this));
 }