// for( Index i = 0; i < matrix.values.getSize(); i++ ) {
// // Random values are stored with the column index of getColumns(). e.g. a matrix has 4 columns, values are at column indexes 0, 1, 2, 3 and junk data at index 4.
// if( matrix.columnIndexes.getElement( i ) != matrix.getColumns() )
// std::cout << "values.getElement( " << i << " ) = " << matrix.values.getElement( i )
// << "\tcolumnIndexes.getElement( " << i << " ) = " << matrix.columnIndexes.getElement( i ) << std::endl;
// }
//
// std::cout << std::endl;
// for( Index i = 0; i < matrix.rowToChunkMapping.getSize(); i++ )
// std::cout << "rowToChunkMapping.getElement( " << i << " ) = " << matrix.rowToChunkMapping.getElement( i ) << std::endl;
// std::cout << std::endl;
// for( Index i = 0; i < matrix.rowToSliceMapping.getSize(); i++ )
// std::cout << "rowToSliceMapping.getElement( " << i << " ) = " << matrix.rowToSliceMapping.getElement( i ) << std::endl;
// std::cout << std::endl;
// for( Index i = 0; i < matrix.rowPointers.getSize(); i++ )
// std::cout << "rowPointers.getElement( " << i << " ) = " << matrix.rowPointers.getElement( i ) << std::endl;
throwExceptions::NotImplementedError("Cross-device assignment for the ChunkedEllpack format is not implemented yet.");
// std::cout << std::endl;
// for( Index i = 0; i < matrix.slices.getSize(); i++ ) {
// std::cout << "slices.getElement( " << i << " ):"
// << "\n\tchunkSize = " << matrix.slices.getElement( i ).chunkSize
// << "\n\tfirstRow = " << matrix.slices.getElement( i ).firstRow
// << "\n\tpointer = " << matrix.slices.getElement( i ).pointer
// << "\n\tsize = " << matrix.slices.getElement( i ).size
// for( Index i = 0; i < this->values.getSize(); i++ ) {
// // Random values are stored with the column index of getColumns(). e.g. a matrix has 4 columns, values are at column indexes 0, 1, 2, 3 and junk data at index 4.
// if( this->columnIndexes.getElement( i ) != this->getColumns() )
// std::cout << "values.getElement( " << i << " ) = " << this->values.getElement( i )
// << "\tcolumnIndexes.getElement( " << i << " ) = " << this->columnIndexes.getElement( i ) << std::endl;
// }
//
// cuda -> host
if(std::is_same<Device,Devices::Host>::value){
ValuesVectortmpValues;
ColumnIndexesVectortmpColumnIndexes;
tmpValues.setLike(matrix.values);
tmpColumnIndexes.setLike(matrix.columnIndexes);
tmpValues=matrix.values;
tmpColumnIndexes=matrix.columnIndexes;
#ifdef HAVE_OPENMP
#pragma omp parallel for if( Devices::Host::isOMPEnabled() )