Exemple #1
0
//        /// <summary>
//        /// and operator of <![CDATA[ILArray<>]]> with <![CDATA[ILArray<>]]>
//        /// </summary>
//        /// <param name="in1"><![CDATA[ILArray<>]]></param>
//        /// <param name="in2"><![CDATA[ILArray<>]]></param>
//        /// <returns>ILLogicalArray of same size than in1 or in2, with the rsult of in1 & in2.
//        /// </returns>
//        /// <remarks>Dimension of in1 and in2 must match with the exception of scalar values. This operator is overloaded for
//        /// all numeric types of <![CDATA[ILArray<>]]>. The type of in1 must be the same as the
//        /// type of in2.</remarks>
//        public static ILLogicalArray operator &(ILArray<BaseT> in1, ILArray<BaseT> in2) {
//            if (false) {
//                #region HYCALPER LOOPSTART LT
//            } else if (in1 is /*!HC:inCls1*/ ILArray<double> && in2 is /*!HC:inCls2*/ ILArray<double> ) {
//                    return ILMath.and ( in1 as /*!HC:inCls1*/ ILArray<double> , in2 as /*!HC:inCls2*/ ILArray<double> );
//                #endregion HYCALPER LOOPEND LT
        #region HYCALPER AUTO GENERATED CODE
// DO NOT EDIT INSIDE THIS REGION !! CHANGES WILL BE LOST !!
//            } else if (in1 is  ILArray<complex> && in2 is  ILArray<complex> ) {
//                    return ILMath.and ( in1 as  ILArray<complex> , in2 as  ILArray<complex> );
//            } else if (in1 is  ILArray<byte> && in2 is  ILArray<byte> ) {
//                    return ILMath.and ( in1 as  ILArray<byte> , in2 as  ILArray<byte> );

        #endregion HYCALPER AUTO GENERATED CODE
//            } else {
//                throw new ILArgumentTypeException("Operator '&' is not defined for ILArrays of type "
//                        + in1.GetType().Name + " and " + in2.GetType().Name );
//            }
//        }

//        /// <summary>
//        /// or operator of <![CDATA[ILArray<>]]> with <![CDATA[ILArray<>]]>
//        /// </summary>
//        /// <param name="in1"><![CDATA[ILArray<>]]></param>
//        /// <param name="in2"><![CDATA[ILArray<>]]></param>
//        /// <returns>ILLogicalArray of same size than in1 or in2, with result of in1 | in2's.
//        /// </returns>
//        /// <remarks>Dimension of in1 and in2 must match with the exception of scalar values. This operator is overloaded for
//        /// all numeric types of <![CDATA[ILArray<>]]>. The type of in1 must be the same as the
//        /// type of in2.</remarks>
//        public static ILLogicalArray operator |(ILArray<BaseT> in1, ILArray<BaseT> in2) {
//            if (false) {
//                #region HYCALPER LOOPSTART LT
//            } else if (in1 is /*!HC:inCls1*/ ILArray<double> && in2 is /*!HC:inCls2*/ ILArray<double> ) {
//                    return ILMath.or ( in1 as /*!HC:inCls1*/ ILArray<double> , in2 as /*!HC:inCls2*/ ILArray<double> );
//                #endregion HYCALPER LOOPEND LT
        #region HYCALPER AUTO GENERATED CODE
// DO NOT EDIT INSIDE THIS REGION !! CHANGES WILL BE LOST !!
//            } else if (in1 is  ILArray<complex> && in2 is  ILArray<complex> ) {
//                    return ILMath.or ( in1 as  ILArray<complex> , in2 as  ILArray<complex> );
//            } else if (in1 is  ILArray<byte> && in2 is  ILArray<byte> ) {
//                    return ILMath.or ( in1 as  ILArray<byte> , in2 as  ILArray<byte> );

        #endregion HYCALPER AUTO GENERATED CODE
//            } else {
//                throw new ILArgumentTypeException("Operator '|' is not defined for ILArrays of type "
//                        + in1.GetType().Name + " and " + in2.GetType().Name );
//            }
//        }


        /// <summary>
        /// Equalty operator of <![CDATA[ILArray<>]]> with scalar
        /// </summary>
        /// <param name="in1">ILArray</param>
        /// <param name="in2">Scalar</param>
        /// <returns>ILLogicalArray of same size than in1, with elements having 'true' values
        /// for all corresponding elements of in1 equal in2, false if they are not.
        /// </returns>
        /// <remarks>This operator is overloaded for
        /// all numeric types of <![CDATA[ILArray<>]]> for in1. The type of in2 is always double. </remarks>
        public static ILLogicalArray operator ==(ILArray <BaseT> in1, double in2)
        {
            if (false)
            {
                #region HYCALPER LOOPSTART
            }
            else if (in1 is /*!HC:inCls1*/ ILArray <double> )
            {
                return(ILMath.eq(in1 as /*!HC:inCls1*/ ILArray <double>, (/*!HC:inArr2*/ double )in2));

                #endregion HYCALPER LOOPEND
                #region HYCALPER AUTO GENERATED CODE
// DO NOT EDIT INSIDE THIS REGION !! CHANGES WILL BE LOST !!
            }
            else if (in1 is  ILArray <complex> )
            {
                return(ILMath.eq(in1 as  ILArray <complex>, ( complex )in2));
            }
            else if (in1 is  ILArray <byte> )
            {
                return(ILMath.eq(in1 as  ILArray <byte>, ( byte )in2));

                #endregion HYCALPER AUTO GENERATED CODE
            }
            else
            {
                throw new ILArgumentTypeException("Operator '==' is not defined for ILArrays of type "
                                                  + in1.GetType().Name);
            }
        }
Exemple #2
0
        /// <summary>
        /// Equalty operator of <![CDATA[ILArray<>]]> with <![CDATA[ILArray<>]]>
        /// </summary>
        /// <param name="in1">first input array</param>
        /// <param name="in2">second input array</param>
        /// <returns>ILLogicalArray of same size than in1, with elements having 'true' values
        /// for all corresponding elements of in1 equal in2's elements, false if they are not equal.
        /// </returns>
        /// <remarks>Dimension of in1 and in2 must match. This operator is valid for
        /// all numeric types of <![CDATA[ILArray<>]]>. The type of in1 must be the same as the
        /// type of in2.</remarks>
        /// <exception cref="ILNumerics.Exceptions.ILArgumentTypeException">thrown if the types
        /// of input arguments do not match or the operator does not support the ILArray inner type.
        /// </exception>
        public static ILLogicalArray operator ==(ILArray <BaseT> in1, ILArray <BaseT> in2)
        {
            if (object.Equals(in1, null))
            {
                if (object.Equals(in2, null))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if (object.Equals(in2, null))
                {
                    return(false);
                }
            }
            if (false)
            {
                #region HYCALPER LOOPSTART EQ
            }
            else if (in1 is /*!HC:inCls1*/ ILArray <double> && in2 is /*!HC:inCls2*/ ILArray <double> )
            {
                return(ILMath.eq(in1 as /*!HC:inCls1*/ ILArray <double>, in2 as /*!HC:inCls2*/ ILArray <double>));

                #endregion HYCALPER LOOPEND EQ
                #region HYCALPER AUTO GENERATED CODE
// DO NOT EDIT INSIDE THIS REGION !! CHANGES WILL BE LOST !!
            }
            else if (in1 is  ILArray <complex> && in2 is  ILArray <complex> )
            {
                return(ILMath.eq(in1 as  ILArray <complex>, in2 as  ILArray <complex>));
            }
            else if (in1 is  ILArray <byte> && in2 is  ILArray <byte> )
            {
                return(ILMath.eq(in1 as  ILArray <byte>, in2 as  ILArray <byte>));

                #endregion HYCALPER AUTO GENERATED CODE
            }
            else if (in1 is ILArray <String> && in2 is ILArray <String> )
            {
                return(ILMath.eq(in1 as ILArray <String>, in2 as ILArray <String>));
            }
            else
            {
                throw new ILArgumentTypeException("Operator '==' is not defined for ILArrays of type "
                                                  + in1.GetType().Name + " and " + in2.GetType().Name);
            }
        }