Пример #1
0
 internal  oplogical__uint64 ( UInt64 parameter,
          ILLogicalFunctionUInt64UInt64 applyFunc) {
     m_parameter = parameter;
     m_applyFun = applyFunc;
 }
Пример #2
0
// DO NOT EDIT INSIDE THIS REGION !! CHANGES WILL BE LOST !! 
        private static ILLogicalArray  LogicalBinaryUInt64Operator (
            ILArray<UInt64> A,
            ILArray<UInt64> B,
            ILLogicalFunctionUInt64UInt64 operation) {
            ILDimension inDim = A.m_dimensions;
            if (!inDim.IsSameSize ( B.m_dimensions ))
                throw new ILDimensionMismatchException ();
            byte [] retSystemArr;
            // build ILDimension
            int newLength = inDim.NumberOfElements;
            retSystemArr = new byte [newLength];
            int leadDim = 0;
            int leadDimLen = inDim [0];
            if (A.IsReference || B.IsReference) {
                // this will most probably be not very fast, but .... :|
                #region Reference storage
                // walk along the longest dimension (for performance reasons)
                for (int i = 1; i < inDim.NumberOfDimensions; i++) {
                    if (leadDimLen < inDim [i]) {
                        leadDimLen = inDim [i];
                        leadDim = i;
                    }
                }
                unsafe {
                    fixed (byte* pOutArr = retSystemArr) {
                        int c = 0; 
                        byte* poutarr = pOutArr;
                        byte* outEnd = poutarr + newLength;
                        while (poutarr < outEnd) {
                            *poutarr++ = operation ( A.GetValue(c), B.GetValue(c++) );
                        }
                    }
                }
                // ==============================================================
                #endregion
            } else {
                // physical -> pointer arithmetic
                #region physical storage
                unsafe {
                    fixed ( UInt64 * pInArr1 = A.m_data)
                    fixed ( UInt64 * pInArr2 = B.m_data)
                    fixed (byte* pOutArr = retSystemArr) {
                        byte* poutarr = pOutArr;
                        byte* poutend = poutarr + newLength;
                        UInt64 * pIn1 = pInArr1;
                        UInt64 * pIn2 = pInArr2;
                        while (poutarr < poutend)
                            *poutarr++ = operation ( *pIn1++, *pIn2++ );
                    }
                }
                #endregion
            }
            return new ILLogicalArray ( retSystemArr, inDim.ToIntArray () );
        }