Skip to content
Snippets Groups Projects

To/matrices

Merged Tomáš Oberhuber requested to merge TO/matrices into develop
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
52 typename Device,
53 typename Index,
54 bool RowMajorOrder,
55 typename RealAllocator >
56 void
57 Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::
58 setElements( std::initializer_list< std::initializer_list< RealType > > data )
59 {
60 IndexType rows = data.size();
61 IndexType columns = 0;
62 for( auto row : data )
63 columns = max( columns, row.size() );
64 this->setDimensions( rows, columns );
65 if( ! std::is_same< DeviceType, Devices::Host >::value )
66 {
67 Dense< RealType, Devices::Host, IndexType > hostDense( rows, columns );
  • 271 typename MatrixType,
    272 template< typename, typename, typename > class Segments,
    273 typename RealAllocator,
    274 typename IndexAllocator >
    275 template< typename MapIndex,
    276 typename MapValue >
    277 void
    278 SparseMatrix< Real, Device, Index, MatrixType, Segments, RealAllocator, IndexAllocator >::
    279 setElements( const std::map< std::pair< MapIndex, MapIndex > , MapValue >& map )
    280 {
    281 Containers::Vector< IndexType, Devices::Host, IndexType > rowsCapacities( this->getRows(), 0 );
    282 for( auto element : map )
    283 rowsCapacities[ element.first.first ]++;
    284 if( !std::is_same< DeviceType, Devices::Host >::value )
    285 {
    286 SparseMatrix< Real, Devices::Host, Index, MatrixType, Segments > hostMatrix( this->getRows(), this->getColumns() );
    Please register or sign in to reply
    Loading