Example #1
0
    /**
     * Apply rowwise the sketching transform that is described by the
     * the transform with output sketch_of_A.
     */
    void apply (const matrix_type& A,
                output_matrix_type& sketch_of_A,
                rowwise_tag dimension) const {

        const value_type *a = A.LockedBuffer();
        El::Int lda = A.LDim();
        value_type *sa = sketch_of_A.Buffer();
        El::Int ldsa = sketch_of_A.LDim();

        for (El::Int j = 0; j < data_type::_S; j++)
            for (El::Int i = 0; i < A.Height(); i++)
                sa[j * ldsa + i] = a[data_type::_samples[j] * lda + i];
    }
Example #2
0
    /**
     * Apply columnwise the sketching transform that is described by the
     * the transform with output sketch_of_A.
     */
    void apply (const matrix_type& A,
                output_matrix_type& sketch_of_A,
                columnwise_tag dimension) const {

        const value_type *a = A.LockedBuffer();
        El::Int lda = A.LDim();
        value_type *sa = sketch_of_A.Buffer();
        El::Int ldsa = sketch_of_A.LDim();

        for (El::Int j = 0; j < A.Width(); j++)
            for (El::Int i = 0; i < data_type::_S; i++)
                sa[j * ldsa + i] = a[j * lda + data_type::_samples[i]];
    }