Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Namespaces | Functions
Tpetra_Details_crsUtils.hpp File Reference

Functions for manipulating CRS arrays. More...

#include <numeric>
#include <type_traits>
#include "TpetraCore_config.h"
#include "Kokkos_Core.hpp"
#include "Tpetra_Details_Behavior.hpp"
#include "Tpetra_Details_CrsPadding.hpp"
#include "Tpetra_Details_WrappedDualView.hpp"
#include <iostream>
#include <memory>
#include <unordered_map>

Go to the source code of this file.

Namespaces

namespace  Tpetra
 Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
namespace  Tpetra::Details
 Nonmember function that computes a residual Computes R = B - A * X.
 

Functions

template<class RowPtr , class Indices , class Values , class Padding >
void Tpetra::Details::impl::pad_crs_arrays (const PadCrsAction action, const RowPtr &row_ptr_beg, const RowPtr &row_ptr_end, Indices &indices_wdv, Values &values_wdv, const Padding &padding, const int my_rank, const bool verbose)
 Implementation of padCrsArrays.
 
template<class Pointers , class InOutIndices , class InIndices , class IndexMap >
size_t Tpetra::Details::impl::insert_crs_indices (typename Pointers::value_type const row, Pointers const &row_ptrs, InOutIndices &cur_indices, size_t &num_assigned, InIndices const &new_indices, IndexMap &&map, std::function< void(size_t const, size_t const, size_t const)> cb)
 Implementation of insertCrsIndices.
 
template<class Pointers , class Indices1 , class Indices2 , class IndexMap , class Callback >
size_t Tpetra::Details::impl::find_crs_indices (typename Pointers::value_type const row, Pointers const &row_ptrs, const size_t curNumEntries, Indices1 const &cur_indices, Indices2 const &new_indices, IndexMap &&map, Callback &&cb)
 Implementation of findCrsIndices.
 
template<class RowPtr , class Indices , class Padding >
void Tpetra::Details::padCrsArrays (const RowPtr &rowPtrBeg, const RowPtr &rowPtrEnd, Indices &indices_wdv, const Padding &padding, const int my_rank, const bool verbose)
 Determine if the row pointers and indices arrays need to be resized to accommodate new entries. If they do need to be resized, resize the indices arrays and shift the existing contents to accommodate new entries. Modify values in the row pointers array to point to the newly shifted locations in the indices arrays.
 
template<class Pointers , class InOutIndices , class InIndices >
size_t Tpetra::Details::insertCrsIndices (typename Pointers::value_type const row, Pointers const &rowPtrs, InOutIndices &curIndices, size_t &numAssigned, InIndices const &newIndices, std::function< void(const size_t, const size_t, const size_t)> cb=std::function< void(const size_t, const size_t, const size_t)>())
 Insert new indices in to current list of indices.
 
template<class Pointers , class Indices1 , class Indices2 , class Callback >
size_t Tpetra::Details::findCrsIndices (typename Pointers::value_type const row, Pointers const &rowPtrs, const size_t curNumEntries, Indices1 const &curIndices, Indices2 const &newIndices, Callback &&cb)
 Finds offsets in to current list of indices.
 

Detailed Description

Functions for manipulating CRS arrays.

Warning
This file, and its contents, are implementation details of Tpetra. The file itself or its contents may disappear or change at any time.

Definition in file Tpetra_Details_crsUtils.hpp.

Function Documentation

◆ pad_crs_arrays()

template<class RowPtr , class Indices , class Values , class Padding >
void Tpetra::Details::impl::pad_crs_arrays ( const PadCrsAction  action,
const RowPtr &  row_ptr_beg,
const RowPtr &  row_ptr_end,
Indices &  indices_wdv,
Values &  values_wdv,
const Padding &  padding,
const int  my_rank,
const bool  verbose 
)

Implementation of padCrsArrays.

Parameters
row_ptr_beg[in] Offset to beginning of each row.
row_ptr_end[in] Offset to end of each row.

Each row lclRow has row_ptr_end[lclRow] - row_ptr_beg[lclRow] entries. Offsets row_ptr_end[lclRow] to row_ptr_beg[lclRow+1] - 1 (inclusive) are extra space.

Definition at line 151 of file Tpetra_Details_crsUtils.hpp.

◆ insert_crs_indices()

template<class Pointers , class InOutIndices , class InIndices , class IndexMap >
size_t Tpetra::Details::impl::insert_crs_indices ( typename Pointers::value_type const  row,
Pointers const &  row_ptrs,
InOutIndices &  cur_indices,
size_t &  num_assigned,
InIndices const &  new_indices,
IndexMap &&  map,
std::function< void(size_t const, size_t const, size_t const)>  cb 
)

Implementation of insertCrsIndices.

Definition at line 403 of file Tpetra_Details_crsUtils.hpp.

◆ find_crs_indices()

template<class Pointers , class Indices1 , class Indices2 , class IndexMap , class Callback >
size_t Tpetra::Details::impl::find_crs_indices ( typename Pointers::value_type const  row,
Pointers const &  row_ptrs,
const size_t  curNumEntries,
Indices1 const &  cur_indices,
Indices2 const &  new_indices,
IndexMap &&  map,
Callback &&  cb 
)

Implementation of findCrsIndices.

Definition at line 502 of file Tpetra_Details_crsUtils.hpp.