From 2cf01eb4d9dd923602f5ce16b18a1ad401ca874d Mon Sep 17 00:00:00 2001 From: Ulrich Hetmaniuk Date: Thu, 5 Aug 2021 21:50:56 -0600 Subject: [PATCH] Add comments --- example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp b/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp index 6cda8e23b6..c6025be3a8 100644 --- a/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp +++ b/example/wiki/sparse/KokkosSparse_wiki_bsrmatrix.cpp @@ -76,6 +76,19 @@ int main() { Ordinal numRows = 10; + // + // This code will generate a tri-diagonal matrix + // + // [ 1 -1 0 ....... 0 ] + // [ -1 2 -1 0 ... 0 ] + // [ ... ] + // [ 0 ... 0 -1 2 -1 ] + // [ 0 ..... 0 -1 1 ] + // + // The matrix will be stored as `KokkosSparse_CrsMatrix` (10 x 10 matrix). + // Then we will construct a `KokkosSparse_BsrMatrix` with block size 2. + // + { const Offset numNNZ = 2 + (numRows - 2) * 3 + 2; typename row_map_type::non_const_type row_map("row pointers", numRows + 1);