コード例 #1
0
        /// <summary>
        /// Are less to the array
        /// </summary>
        /// <param name="a">source</param>
        /// <param name="b">array</param>
        /// <returns></returns>
        public static HypArrayBase <bool> AreLess(this HypArrayBase <double> a, HypArrayBase <double> b)
        {
            HypArrayBase <bool> outArray = new HypArrayBase <bool>(a.GetDimensions());

            Parallel.For(0, a.GetNumberOfElements(), i =>
            {
                if (a.Data[i] < b.Data[i])
                {
                    outArray.Data[i] = true;
                }
            });
            return(outArray);
        }
コード例 #2
0
        /// <summary>
        /// Area equal to the scalar
        /// </summary>
        /// <param name="a">source</param>
        /// <param name="b">scalar</param>
        /// <returns></returns>
        public static HypArrayBase <bool> AreEqual(this HypArrayBase <float> a, float b)
        {
            HypArrayBase <bool> outArray = new HypArrayBase <bool>(a.GetDimensions());

            Parallel.For(0, a.GetNumberOfElements(), i =>
            {
                if (a.Data[i] == b)
                {
                    outArray.Data[i] = true;
                }
            });
            return(outArray);
        }
コード例 #3
0
        /// <summary>
        /// Area  greater of equal to the scalar
        /// </summary>
        /// <param name="a">source</param>
        /// <param name="b">scalar</param>
        public static HypArrayBase <bool> AreGreaterOrEqual(this HypArrayBase <double> a, double b)
        {
            HypArrayBase <bool> outArray = new HypArrayBase <bool>(a.GetDimensions());

            Parallel.For(0, a.GetNumberOfElements(), i =>
            {
                if (a.Data[i] >= b)
                {
                    outArray.Data[i] = true;
                }
            });
            return(outArray);
        }