Ejemplo n.º 1
0
        static public FloatParallelArray Append(FloatParallelArray f1, FloatParallelArray f2, int Dimension)
        {
            FloatParallelArray a = ParallelArrays.Replicate(f1, f2.Shape[0] + f1.Shape[0]);

            a = ParallelArrays.ShiftDefault(a, 0.0f, new int[] { -f2.Shape[0] });
            a = ParallelArrays.ShiftDefault(a, 0.0f, new int[] { f2.Shape[0] });
            FloatParallelArray b = ParallelArrays.Replicate(f2, f2.Shape[0] + f1.Shape[0]);

            b = ParallelArrays.ShiftDefault(b, 0.0f, new int[] { f1.Shape[0] });
            b = ParallelArrays.ShiftDefault(b, 0.0f, new int[] { -f1.Shape[0] });
            return(a + b);
        }
Ejemplo n.º 2
0
        public FloatParallelArray Pop()
        {
            if (IsEmpty)
            {
                throw new UnexpectedOperation();
            }

            if (m_ContArray.Shape[0] - 1 == 0)
            {
                IsEmpty = true;
                return(m_ContArray);
            }

            Slice slc = new Slice(0, m_ContArray.Shape[0] - 1);
            FloatParallelArray popelem = ParallelArrays.Section(m_ContArray, slc);

            m_ContArray = ParallelArrays.Replicate(m_ContArray, m_ContArray.Shape[0] - 1);
            return(popelem);
        }