47 namespace DenseLinAlgPack {
73 if( !raw_ptr1 || !raw_ptr2 )
85 if(raw_ptr1 > raw_ptr2) {
92 if( raw_ptr2 > (raw_ptr1 + (cols1 - 1) * max_rows1 + (rows1 - 1)) ) {
98 start2 = raw_ptr2 - raw_ptr1;
100 if(start1 == start2 && max_rows1 == max_rows2 && rows1 == rows2 && cols1 == cols2)
102 if(start1 + (rows1 - 1) + (cols1 - 1) * max_rows1 < start2)
109 size_type row_i = (start2 - start1 + 1) % max_rows1;
113 size_type lower_rows = max_rows1 - (start1 % max_rows1 + rows1);
114 if(row_i < rows1 + lower_rows)
118 if(row_i + rows2 - 1 <= max_rows1)
123 #ifdef LINALGPACK_CHECK_RANGE
126 if( i >
rows() || !i )
127 throw std::out_of_range(
"DMatrixSlice::validate_row_subscript(i) :"
128 "row index i is out of bounds" );
132 #ifdef LINALGPACK_CHECK_RANGE
135 if( j >
cols() || !j )
136 throw std::out_of_range(
"DMatrixSlice::validate_col_subscript(j) :"
137 "column index j is out of bounds" );
141 #ifdef LINALGPACK_CHECK_SLICE_SETUP
147 throw std::out_of_range(
"DMatrixSlice::validate_setup() : "
148 " DMatrixSlice constructed that goes past end of array" );
172 #ifdef LINALGPACK_CHECK_RANGE
174 if( i >
rows() || !i )
175 throw std::out_of_range(
"DMatrix::validate_row_subscript(i) : row index out of bounds");
179 #ifdef LINALGPACK_CHECK_RANGE
181 if( j >
cols() || !j )
182 throw std::out_of_range(
"DMatrix::validate_col_subscript(j) : column index out of bounds");
201 throw std::length_error(
"Matrix sizes are not the compatible");
EOverLap overlap(const DMatrixSlice &gms) const
DVectorSlice p_diag(difference_type k) const
value_type * col_ptr(size_type j)
DenseLinAlgPack::size_type size_type
size_type cols() const
Return the number of columns.
ptrdiff_t difference_type
VectorSliceTmpl< value_type > DVectorSlice
void assert_gms_sizes(const DMatrixSlice &gms1, BLAS_Cpp::Transp trans1, const DMatrixSlice &gms2, BLAS_Cpp::Transp trans2)
Assert two matrices are the same size and throws length_error if they are not (LINALGPACK_CHECK_RHS_S...
DenseLinAlgPack::size_type size_type
DVectorSlice p_diag(difference_type k) const
void validate_col_subscript(size_type j) const
ptrdiff_t difference_type
size_type max_rows() const
Return the number of rows in the full matrix. Equivalent to BLAS LDA argument.
void validate_col_subscript(size_type j) const
size_type rows() const
Return the number of rows.
value_type * col_ptr(size_type j)
EOverLap
Enumeration for returning the amount of overlap between two objects.
DenseLinAlgPack::size_type size_type
size_type rows() const
Return the number of rows.
void swap(row_col_value_type< T > &v1, row_col_value_type< T > &v2)
Swap row_col_value_type<T> objects.
void validate_setup(size_type size) const
void validate_row_subscript(size_type i) const
EOverLap overlap(const DMatrixSlice &gms) const
size_type cols() const
Return the number of columns.
void validate_row_subscript(size_type i) const