Beispiel #1
0
        public static Double[,] IsGreaterOrEqual(this Double[,] a, Double[,] b)
        {
            if (a.Fits(b))
            {
                var rows   = a.GetRows();
                var cols   = a.GetColumns();
                var result = new Double[rows, cols];

                for (var i = 0; i < rows; i++)
                {
                    for (var j = 0; j < cols; j++)
                    {
                        result[i, j] = (a[i, j] >= b[i, j]).ToNumber();
                    }
                }

                return(result);
            }

            return(null);
        }
Beispiel #2
0
        public static Double[,] Or(this Double[,] a, Double[,] b)
        {
            if (a.Fits(b))
            {
                var rows   = a.GetRows();
                var cols   = a.GetColumns();
                var result = new Double[rows, cols];

                for (var i = 0; i < rows; i++)
                {
                    for (var j = 0; j < cols; j++)
                    {
                        result[i, j] = (a[i, j].ToBoolean() || b[i, j].ToBoolean()).ToNumber();
                    }
                }

                return(result);
            }

            return(null);
        }
Beispiel #3
0
        public static Double[,] Pow(this Double[,] a, Double[,] b)
        {
            if (a.Fits(b))
            {
                var rows   = a.GetRows();
                var cols   = a.GetColumns();
                var result = new Double[rows, cols];

                for (var i = 0; i < rows; i++)
                {
                    for (var j = 0; j < cols; j++)
                    {
                        result[i, j] = Math.Pow(a[i, j], b[i, j]);
                    }
                }

                return(result);
            }

            return(null);
        }