Tpetra: add a matching maps check to CrsGraph
Created by: aprokop
@trilinos/tpetra
Recording the issue so that I won't forget.
This is coming from #1669. This is a check for whether row and column maps are compatible, i.e. whether colGIDs = [rowGIDs, ghosts].
My thinking is that you add a tri-state (UNKNOWN, FALSE, TRUE) mutable variable to the CrsGraph, lets call it matchingMaps_. If you construct a CrsMatrix with just a row, it's automatically set to TRUE. If you provide a column map, it's set to UNKNOWN. We add a public function to CrsGraph
bool matchingMap() const {
if (matchingMaps_ == UNKNOWN) {
// Execute matching kernel
// Set matchingMaps_ to TRUE or FALSE)
}
return matchnigMaps_;
}
I think that while in our case we only check matching for the case numRows <= numCols, it still makes sense even for numRows > numCols.