Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TpetraExt_MatrixMatrix_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_MATRIXMATRIX_DECL_HPP
43 #define TPETRA_MATRIXMATRIX_DECL_HPP
44 
45 #include <string>
46 #include <Teuchos_RCP.hpp>
47 #include <Teuchos_Array.hpp>
48 #include "Tpetra_ConfigDefs.hpp"
49 #include "Tpetra_CrsMatrix.hpp"
50 #include "Tpetra_Vector.hpp"
51 #include "TpetraExt_MMHelpers.hpp"
52 
53 
59 namespace Tpetra {
60 
61 namespace MatrixMatrix {
62 
93 template <class Scalar,
94  class LocalOrdinal,
95  class GlobalOrdinal,
96  class Node>
97 void Multiply(
98  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
99  bool transposeA,
100  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
101  bool transposeB,
102  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
103  bool call_FillComplete_on_result = true,
104  const std::string& label = std::string(),
105  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
106 
120 template <class Scalar,
121  class LocalOrdinal,
122  class GlobalOrdinal,
123  class Node>
124 void Add(
125  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
126  bool transposeA,
127  Scalar scalarA,
128  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
129  Scalar scalarB );
130 
131 namespace AddDetails
132 {
133 
134 template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
135 struct AddKernels
136 {
139  typedef typename Node::device_type device_type;
140  typedef typename device_type::execution_space execution_space;
141  typedef typename execution_space::memory_space memory_space;
142  typedef typename crs_matrix_type::impl_scalar_type impl_scalar_type;
143  typedef typename crs_matrix_type::local_matrix_type KCRS;
144  typedef typename KCRS::values_type::non_const_type values_array;
145  typedef typename KCRS::row_map_type::non_const_type row_ptrs_array;
146  typedef typename KCRS::row_map_type row_ptrs_array_const;
147  typedef typename KCRS::index_type::non_const_type col_inds_array;
148  typedef typename Kokkos::View<const GlobalOrdinal*, device_type> local_map_type;
149  typedef typename Kokkos::View<GlobalOrdinal*, device_type> global_col_inds_array;
150  typedef Kokkos::RangePolicy<execution_space, size_t> range_type;
151 
165  static void addSorted(
166  const values_array& Avals,
167  const row_ptrs_array_const& Arowptrs,
168  const col_inds_array& Acolinds,
169  const impl_scalar_type scalarA,
170  const values_array& Bvals,
171  const row_ptrs_array_const& Browptrs,
172  const col_inds_array& Bcolinds,
173  const impl_scalar_type scalarB,
174  values_array& Cvals,
175  row_ptrs_array& Crowptrs,
176  col_inds_array& Ccolinds);
177 
189  static void convertToGlobalAndAdd(
190  const KCRS& A,
191  const impl_scalar_type scalarA,
192  const KCRS& B,
193  const impl_scalar_type scalarB,
194  const local_map_type& AcolMap,
195  const local_map_type& BcolMap,
196  GlobalOrdinal minGlobalCol,
197  GlobalOrdinal globalNumCols,
198  values_array& Cvals,
199  row_ptrs_array& Crowptrs,
200  global_col_inds_array& Ccolinds);
201 
216  static void addUnsorted(
217  const values_array& Avals,
218  const row_ptrs_array_const& Arowptrs,
219  const col_inds_array& Acolinds,
220  const impl_scalar_type scalarA,
221  const values_array& Bvals,
222  const row_ptrs_array_const& Browptrs,
223  const col_inds_array& Bcolinds,
224  const impl_scalar_type scalarB,
225  GlobalOrdinal numGlobalCols,
226  values_array& Cvals,
227  row_ptrs_array& Crowptrs,
228  col_inds_array& Ccolinds);
229 
230  static Teuchos::RCP<map_type> makeColMapAndConvertGids(GlobalOrdinal ncols, const global_col_inds_array& gids, col_inds_array& lids, const Teuchos::RCP<const Teuchos::Comm<int>>& comm);
231 };
232 }//end AddDetails
233 
263 template <class Scalar,
264  class LocalOrdinal,
265  class GlobalOrdinal,
266  class Node>
267 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
268 add (const Scalar& alpha,
269  const bool transposeA,
270  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
271  const Scalar& beta,
272  const bool transposeB,
273  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
274  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
275  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
276  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
277 
278 
310 template <class Scalar,
311  class LocalOrdinal,
312  class GlobalOrdinal,
313  class Node>
314 void
315 add (const Scalar& alpha,
316  const bool transposeA,
317  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
318  const Scalar& beta,
319  const bool transposeB,
320  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
321  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> & C,
322  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
323  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
324  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
325 
326 
356 template <class Scalar,
357  class LocalOrdinal,
358  class GlobalOrdinal,
359  class Node>
360 void Add(
361  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
362  bool transposeA,
363  Scalar scalarA,
364  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
365  bool transposeB,
366  Scalar scalarB,
367  Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > C);
368 
369 
391  template <class Scalar,
392  class LocalOrdinal,
393  class GlobalOrdinal,
394  class Node>
395  void Jacobi(Scalar omega,
396  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
397  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
398  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
399  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
400  bool call_FillComplete_on_result = true,
401  const std::string& label = std::string(),
402  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
403 
404 } // namespace MatrixMatrix
405 
406 namespace MMdetails{
407 
408  // Matrix multiplication functions
409 template<class Scalar,
410  class LocalOrdinal,
411  class GlobalOrdinal,
412  class Node>
413 void mult_AT_B_newmatrix(
414  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
415  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
416  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
417  const std::string& label = std::string(),
418  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
419 
420 
421 template<class Scalar,
422  class LocalOrdinal,
423  class GlobalOrdinal,
424  class Node>
425 void mult_A_B(
426  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
427  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
428  CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
429  const std::string& label = std::string(),
430  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
431 
432 template<class Scalar,
433  class LocalOrdinal,
434  class GlobalOrdinal,
435  class Node>
436 void mult_A_B_newmatrix(
437  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
438  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
439  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
440  const std::string& label = std::string(),
441  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
442 
443 
444 
445 
446 template<class Scalar,
447  class LocalOrdinal,
448  class GlobalOrdinal,
449  class Node>
450 void mult_A_B_reuse(
451  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
452  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
453  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
454  const std::string& label = std::string(),
455  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
456 
457 
458 
459 
460  // Matrix jacobi functions
461 template<class Scalar,
462  class LocalOrdinal,
463  class GlobalOrdinal,
464  class Node>
465 void jacobi_A_B_newmatrix(
466  Scalar omega,
467  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
468  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
469  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
470  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
471  const std::string & label = std::string(),
472  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
473 
474 
475 template<class Scalar,
476  class LocalOrdinal,
477  class GlobalOrdinal,
478  class Node>
479 void jacobi_A_B_reuse(
480  Scalar omega,
481  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
482  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
483  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
484  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
485  const std::string & label = std::string(),
486  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
487 
488  // Other functions
489 template<class Scalar,
490  class LocalOrdinal,
491  class GlobalOrdinal,
492  class Node>
493 void import_and_extract_views(
494  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& M,
495  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > targetMap,
496  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview,
497  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal, Node> > prototypeImporter = Teuchos::null,
498  bool userAssertsThereAreNoRemotes = false,
499  const std::string& label = std::string(),
500  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
501 
502 template<class Scalar,
503  class LocalOrdinal,
504  class GlobalOrdinal,
505  class Node>
506 void setMaxNumEntriesPerRow(
507  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview);
508 
509 
510  // MMM Kernel wrappers struct
511  // Because C++ doesn't support partial template specialization of functions.
512  template<class Scalar,
513  class LocalOrdinal,
514  class GlobalOrdinal,
515  class Node,
516  class LocalOrdinalViewType>
517  struct KernelWrappers {
518  static inline void mult_A_B_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
519  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
520  const LocalOrdinalViewType & Acol2Brow,
521  const LocalOrdinalViewType & Acol2Irow,
522  const LocalOrdinalViewType & Bcol2Ccol,
523  const LocalOrdinalViewType & Icol2Ccol,
524  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
525  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
526  const std::string& label = std::string(),
527  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
528 
529  static inline void mult_A_B_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
530  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
531  const LocalOrdinalViewType & Acol2Brow,
532  const LocalOrdinalViewType & Acol2Irow,
533  const LocalOrdinalViewType & Bcol2Ccol,
534  const LocalOrdinalViewType & Icol2Ccol,
535  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
536  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
537  const std::string& label = std::string(),
538  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
539  };
540 
541  // Jacobi Kernel wrappers struct
542  // Because C++ doesn't support partial template specialization of functions.
543 
544  template<class Scalar,
545  class LocalOrdinal,
546  class GlobalOrdinal,
547  class Node,
548  class LocalOrdinalViewType>
549  struct KernelWrappers2 {
550  static inline void jacobi_A_B_newmatrix_kernel_wrapper(Scalar omega,
551  const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> & Dinv,
552  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
553  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
554  const LocalOrdinalViewType & Acol2Brow,
555  const LocalOrdinalViewType & Acol2Irow,
556  const LocalOrdinalViewType & Bcol2Ccol,
557  const LocalOrdinalViewType & Icol2Ccol,
558  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
559  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
560  const std::string& label = std::string(),
561  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
562 
563  static inline void jacobi_A_B_reuse_kernel_wrapper(Scalar omega,
564  const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> & Dinv,
565  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
566  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
567  const LocalOrdinalViewType & Acol2Brow,
568  const LocalOrdinalViewType & Acol2Irow,
569  const LocalOrdinalViewType & Bcol2Ccol,
570  const LocalOrdinalViewType & Icol2Ccol,
571  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
572  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
573  const std::string& label = std::string(),
574  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
575  };
576 
577 
578  // Triple-Product Kernel wrappers struct
579  // Because C++ doesn't support partial template specialization of functions.
580  template<class Scalar,
581  class LocalOrdinal,
582  class GlobalOrdinal,
583  class Node,
584  class LocalOrdinalViewType>
585  struct KernelWrappers3 {
586  static inline void mult_R_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
587  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
588  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
589  const LocalOrdinalViewType & Acol2Prow,
590  const LocalOrdinalViewType & Acol2PIrow,
591  const LocalOrdinalViewType & Pcol2Ccol,
592  const LocalOrdinalViewType & PIcol2Ccol,
593  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
594  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
595  const std::string& label = std::string(),
596  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
597 
598  static inline void mult_R_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
599  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
600  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
601  const LocalOrdinalViewType & Acol2Prow,
602  const LocalOrdinalViewType & Acol2PIrow,
603  const LocalOrdinalViewType & Pcol2Ccol,
604  const LocalOrdinalViewType & PIcol2Ccol,
605  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
606  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
607  const std::string& label = std::string(),
608  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
609 
610 
611  static inline void mult_PT_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
612  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
613  const LocalOrdinalViewType & Acol2Prow,
614  const LocalOrdinalViewType & Acol2PIrow,
615  const LocalOrdinalViewType & Pcol2Ccol,
616  const LocalOrdinalViewType & PIcol2Ccol,
617  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
618  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
619  const std::string& label = std::string(),
620  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
621 
622  static inline void mult_PT_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
623  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
624  const LocalOrdinalViewType & Acol2Prow,
625  const LocalOrdinalViewType & Acol2PIrow,
626  const LocalOrdinalViewType & Pcol2Ccol,
627  const LocalOrdinalViewType & PIcol2Ccol,
628  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
629  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
630  const std::string& label = std::string(),
631  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
632  };
633 
634  // This only merges matrices that look like B & Bimport, aka, they have no overlapping rows
635  template<class Scalar,class LocalOrdinal,class GlobalOrdinal,class Node, class LocalOrdinalViewType>
637  merge_matrices(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
638  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
639  const LocalOrdinalViewType & Acol2Brow,
640  const LocalOrdinalViewType & Acol2Irow,
641  const LocalOrdinalViewType & Bcol2Ccol,
642  const LocalOrdinalViewType & Icol2Ccol,
643  const size_t mergedNodeNumCols);
644 
645 
646 
647 
648 template<class CrsMatrixType>
649 size_t C_estimate_nnz(CrsMatrixType & A, CrsMatrixType &B);
650 
651 }//end namespace MMdetails
652 
653 } // end of Tpetra namespace
654 
655 #endif // TPETRA_MATRIXMATRIX_DECL_HPP
656 
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
void Jacobi(Scalar omega, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Dinv, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &C, bool call_FillComplete_on_result=true, const std::string &label=std::string(), const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
typename Kokkos::ArithTraits< Scalar >::val_type impl_scalar_type
The type used internally in place of Scalar.
void Add(const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, bool transposeA, Scalar scalarA, CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarB)
void Multiply(const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, bool transposeA, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, bool transposeB, CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &C, bool call_FillComplete_on_result=true, const std::string &label=std::string(), const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Sparse matrix-matrix multiply.
A parallel distribution of indices over processes.
KokkosSparse::CrsMatrix< impl_scalar_type, local_ordinal_type, execution_space, void, typename local_graph_type::size_type > local_matrix_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > add(const Scalar &alpha, const bool transposeA, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const bool transposeB, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Compute the sparse matrix sum C = scalarA * Op(A) + scalarB * Op(B), where Op(X) is either X or its t...