Ejemplo n.º 1
0
        public static MFullArray <double> hypot(MFullArray <double> x, MFullArray <double> y)
        {
            ElementaryOperations.MatchShapes(ref x, ref y);
            var result = new MFullArray <double>(x.Shape);

            for (int i = 0; i < result.Count; ++i)
            {
                result[i] = Math.Sqrt(x[i] * x[i] + y[i] * y[i]);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static MFullArray <bool> le(MFullArray <double> a, MFullArray <double> b)
        {
            ElementaryOperations.MatchShapes(ref a, ref b);

            var result = new MFullArray <bool>(a.Shape);

            for (int i = 0; i < result.Count; ++i)
            {
                result[i] = a[i] <= b[i];
            }
            return(result);
        }