57 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
107 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
157 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
248 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
277 while( P_itr != P_end && x_itr != x_end ) {
281 if( j < x_itr->index() + x_off ) {
285 else if( j > x_itr->
index() + x_off ) {
290 (*y)(i) += a * x_itr->
value();
316 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
319 switch( P_ordered_by ) {
335 return opP_ordered_by;
357 namespace GPMSIP = AbstractLinAlgPack::GenPermMatrixSliceIteratorPack;
373 opP1_ordered_by = ordered_by(P1.
ordered_by(),P1_trans),
374 opP2_ordered_by = ordered_by(P2.
ordered_by(),P2_trans);
378 if( !P1.
nz() || !P2.
nz() ) {
381 Q->
initialize(opP1_rows,opP2_cols,GenPermMatrixSlice::ZERO_MATRIX);
389 Q->
initialize(opP1_rows,opP2_cols,GenPermMatrixSlice::IDENTITY_MATRIX);
413 while( P1_itr != P1_end && P2_itr != P2_end ) {
416 opP2_row_i =
rows(P2_itr->row_i(),P2_itr->col_j(),P2_trans);
417 if( opP1_col_j < opP2_row_i ) {
421 if( opP1_col_j > opP2_row_i ) {
440 &oP1 = opP1_cols > opP2_rows ? P1 : P2,
441 &oP2 = opP1_cols > opP2_rows ? P2 : P1;
443 oP1_trans = opP1_cols > opP2_rows ? P1_trans :
trans_not(P1_trans),
444 oP2_trans = opP1_cols > opP2_rows ? P2_trans :
trans_not(P2_trans);
446 typedef std::vector<size_type> oP2_col_j_lookup_t;
447 oP2_col_j_lookup_t oP2_col_j_lookup(
rows(oP2.rows(),oP2.rows(),oP2_trans));
448 std::fill( oP2_col_j_lookup.begin(), oP2_col_j_lookup.end(), 0 );
453 while( itr != itr_end ) {
466 while( itr != itr_end ) {
468 oP2_col_j = oP2_col_j_lookup[
cols(itr->
row_i(),itr->
col_j(),oP1_trans)];
element_type * lookup_element(size_type i)
difference_type offset() const
Return the offset for the indexes (ith real index = begin()[i-1]->index() + offset()# ...
void Vp_StV(DVectorSlice *vs_lhs, value_type alpha, const DVectorSlice &vs_rhs)
vs_lhs += alpha * vs_rhs (BLAS xAXPY)
void resize(size_type size, size_type max_nz, difference_type offset=0)
Resize to #size# with a maximum of max_nz# non-zero elements.
size_type dim() const
Returns the number of elements of the VectorSliceTmpl.
void V_StMtV(SpVector *sv_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const DVectorSlice &vs_rhs2)
sv_lhs = alpha * op(P_rhs1) * vs_rhs2.
size_type dim() const
Return the number of elements in the full vector.
void MtM_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2)
op(m_lhs) += op(m_rhs1)
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
RTOp_value_type value_type
Sparse Vector Slice class template.
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
void initialize(index_type rows, index_type cols, EIdentityOrZero type)
Initialize an identity or zero permutation.
bool is_sorted() const
Return true if the sequence is sorted.
size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return rows of a possible transposed matrix.
ptrdiff_t difference_type
void add_element(element_type ele)
Add an unsorted element.
const_iterator end() const
Return the end of this->const_iterator_begin().
bool is_sorted() const
Return true if the sequence is assumed sorted.
const index_type & index() const
This is a full random access iterator for accessing row and colunmn indices.
RTOp_index_type size_type
size_type dim() const
Return the number of elements in the full vector.
const_iterator begin() const
Return a random access iterator for accessing which row and column that each nonzero 1...
void assume_sorted(bool assume_is_sorted)
Called by the client to inform this sparse vector object that the elements be assumed to be in sequen...
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
const f_int f_dbl_prec a[]
Sparse Vector class template.
Transp trans_not(Transp _trans)
Return the opposite of the transpose argument.
void Vt_S(DVectorSlice *vs_lhs, value_type alpha)
vs_lhs *= alpha (BLAS xSCAL) (*** Note that alpha == 0.0 is handeled as vs_lhs = 0.0)
Sparse storage element type.
void Vp_MtV_assert_sizes(size_type v_lhs_size, size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size)
v_lhs += op(m_rhs1) * v_rhs2
void add_elements(SpVector *sv_lhs, value_type alpha, const DVectorSlice &vs_rhs, size_type offset=0, bool add_zeros=true)
Add elements from a dense vector to a sparse vector.
void MtV_assert_sizes(size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size)
op(m_rhs1) * v_rhs2
void intersection(const GenPermMatrixSlice &P1, BLAS_Cpp::Transp P1_trans, const GenPermMatrixSlice &P2, BLAS_Cpp::Transp P2_trans, size_type *Q_nz, const size_type Q_max_nz=0, size_type Q_row_i[]=NULL, size_type Q_col_j[]=NULL, GenPermMatrixSlice *Q=NULL)
Find the intersection between two GenPermMatrixSlice objects.
size_type cols(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return columns of a possible transposed matrix.
EOrderedBy ordered_by() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Concrete matrix type to represent general permutation (mapping) matrices.