Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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 
160 template <class Scalar,
161  class LocalOrdinal,
162  class GlobalOrdinal,
163  class Node>
164 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
165 add (const Scalar& alpha,
166  const bool transposeA,
167  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
168  const Scalar& beta,
169  const bool transposeB,
170  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
171  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
172  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
173  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
174 
175 
211 template <class Scalar,
212  class LocalOrdinal,
213  class GlobalOrdinal,
214  class Node>
215 void
216 add (const Scalar& alpha,
217  const bool transposeA,
218  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
219  const Scalar& beta,
220  const bool transposeB,
221  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
222  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> & C,
223  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
224  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
225  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
226 
227 
257 template <class Scalar,
258  class LocalOrdinal,
259  class GlobalOrdinal,
260  class Node>
261 void Add(
262  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
263  bool transposeA,
264  Scalar scalarA,
265  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
266  bool transposeB,
267  Scalar scalarB,
268  Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > C);
269 
270 
292  template <class Scalar,
293  class LocalOrdinal,
294  class GlobalOrdinal,
295  class Node>
296  void Jacobi(Scalar omega,
297  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
298  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
299  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
300  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
301  bool call_FillComplete_on_result = true,
302  const std::string& label = std::string(),
303  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
304 
305 } // namespace MatrixMatrix
306 
307 namespace MMdetails{
308 
309  // Matrix multiplication functions
310 template<class Scalar,
311  class LocalOrdinal,
312  class GlobalOrdinal,
313  class Node>
314 void mult_AT_B_newmatrix(
315  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
316  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
317  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
318  const std::string& label = std::string(),
319  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
320 
321 
322 template<class Scalar,
323  class LocalOrdinal,
324  class GlobalOrdinal,
325  class Node>
326 void mult_A_B(
327  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
328  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
329  CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
330  const std::string& label = std::string(),
331  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
332 
333 template<class Scalar,
334  class LocalOrdinal,
335  class GlobalOrdinal,
336  class Node>
337 void mult_A_B_newmatrix(
338  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
339  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
340  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
341  const std::string& label = std::string(),
342  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
343 
344 
345 
346 
347 template<class Scalar,
348  class LocalOrdinal,
349  class GlobalOrdinal,
350  class Node>
351 void mult_A_B_reuse(
352  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
353  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
354  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
355  const std::string& label = std::string(),
356  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
357 
358 
359 
360 
361  // Matrix jacobi functions
362 template<class Scalar,
363  class LocalOrdinal,
364  class GlobalOrdinal,
365  class Node>
366 void jacobi_A_B_newmatrix(
367  Scalar omega,
368  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
369  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
370  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
371  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
372  const std::string & label = std::string(),
373  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
374 
375 
376 template<class Scalar,
377  class LocalOrdinal,
378  class GlobalOrdinal,
379  class Node>
380 void jacobi_A_B_reuse(
381  Scalar omega,
382  const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
383  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
384  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
385  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
386  const std::string & label = std::string(),
387  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
388 
389  // Other functions
390 template<class Scalar,
391  class LocalOrdinal,
392  class GlobalOrdinal,
393  class Node>
394 void import_and_extract_views(
395  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& M,
396  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > targetMap,
397  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview,
398  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal, Node> > prototypeImporter = Teuchos::null,
399  bool userAssertsThereAreNoRemotes = false,
400  const std::string& label = std::string(),
401  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
402 
403 template<class Scalar,
404  class LocalOrdinal,
405  class GlobalOrdinal,
406  class Node>
407 void setMaxNumEntriesPerRow(
408  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview);
409 
410 
411  // MMM Kernel wrappers struct
412  // Because C++ doesn't support partial template specialization of functions.
413  template<class Scalar,
414  class LocalOrdinal,
415  class GlobalOrdinal,
416  class Node,
417  class LocalOrdinalViewType>
418  struct KernelWrappers {
419  static inline void mult_A_B_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
420  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
421  const LocalOrdinalViewType & Acol2Brow,
422  const LocalOrdinalViewType & Acol2Irow,
423  const LocalOrdinalViewType & Bcol2Ccol,
424  const LocalOrdinalViewType & Icol2Ccol,
425  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
426  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
427  const std::string& label = std::string(),
428  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
429 
430  static inline void mult_A_B_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
431  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
432  const LocalOrdinalViewType & Acol2Brow,
433  const LocalOrdinalViewType & Acol2Irow,
434  const LocalOrdinalViewType & Bcol2Ccol,
435  const LocalOrdinalViewType & Icol2Ccol,
436  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
437  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
438  const std::string& label = std::string(),
439  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
440  };
441 
442  // Jacobi Kernel wrappers struct
443  // Because C++ doesn't support partial template specialization of functions.
444 
445  template<class Scalar,
446  class LocalOrdinal,
447  class GlobalOrdinal,
448  class Node,
449  class LocalOrdinalViewType>
450  struct KernelWrappers2 {
451  static inline void jacobi_A_B_newmatrix_kernel_wrapper(Scalar omega,
452  const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> & Dinv,
453  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
454  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
455  const LocalOrdinalViewType & Acol2Brow,
456  const LocalOrdinalViewType & Acol2Irow,
457  const LocalOrdinalViewType & Bcol2Ccol,
458  const LocalOrdinalViewType & Icol2Ccol,
459  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
460  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
461  const std::string& label = std::string(),
462  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
463 
464  static inline void jacobi_A_B_reuse_kernel_wrapper(Scalar omega,
465  const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> & Dinv,
466  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
467  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
468  const LocalOrdinalViewType & Acol2Brow,
469  const LocalOrdinalViewType & Acol2Irow,
470  const LocalOrdinalViewType & Bcol2Ccol,
471  const LocalOrdinalViewType & Icol2Ccol,
472  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
473  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Cimport,
474  const std::string& label = std::string(),
475  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
476  };
477 
478 
479  // Triple-Product Kernel wrappers struct
480  // Because C++ doesn't support partial template specialization of functions.
481  template<class Scalar,
482  class LocalOrdinal,
483  class GlobalOrdinal,
484  class Node,
485  class LocalOrdinalViewType>
486  struct KernelWrappers3 {
487  static inline void mult_R_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
488  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
489  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
490  const LocalOrdinalViewType & Acol2Prow,
491  const LocalOrdinalViewType & Acol2PIrow,
492  const LocalOrdinalViewType & Pcol2Ccol,
493  const LocalOrdinalViewType & PIcol2Ccol,
494  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
495  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
496  const std::string& label = std::string(),
497  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
498 
499  static inline void mult_R_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
500  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
501  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
502  const LocalOrdinalViewType & Acol2Prow,
503  const LocalOrdinalViewType & Acol2PIrow,
504  const LocalOrdinalViewType & Pcol2Ccol,
505  const LocalOrdinalViewType & PIcol2Ccol,
506  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
507  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
508  const std::string& label = std::string(),
509  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
510 
511 
512  static inline void mult_PT_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
513  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
514  const LocalOrdinalViewType & Acol2Prow,
515  const LocalOrdinalViewType & Acol2PIrow,
516  const LocalOrdinalViewType & Pcol2Ccol,
517  const LocalOrdinalViewType & PIcol2Ccol,
518  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
519  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
520  const std::string& label = std::string(),
521  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
522 
523  static inline void mult_PT_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
524  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
525  const LocalOrdinalViewType & Acol2Prow,
526  const LocalOrdinalViewType & Acol2PIrow,
527  const LocalOrdinalViewType & Pcol2Ccol,
528  const LocalOrdinalViewType & PIcol2Ccol,
529  CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
530  Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
531  const std::string& label = std::string(),
532  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
533  };
534 
535  // This only merges matrices that look like B & Bimport, aka, they have no overlapping rows
536  template<class Scalar,class LocalOrdinal,class GlobalOrdinal,class Node, class LocalOrdinalViewType>
538  merge_matrices(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
539  CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
540  const LocalOrdinalViewType & Acol2Brow,
541  const LocalOrdinalViewType & Acol2Irow,
542  const LocalOrdinalViewType & Bcol2Ccol,
543  const LocalOrdinalViewType & Icol2Ccol,
544  const size_t mergedNodeNumCols);
545 
546 
547 
548 
549 template<class CrsMatrixType>
550 size_t C_estimate_nnz(CrsMatrixType & A, CrsMatrixType &B);
551 
552 template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
553 struct AddKernels
554 {
557  typedef typename Node::device_type device_type;
558  typedef typename device_type::execution_space execution_space;
559  typedef typename execution_space::memory_space memory_space;
560  typedef typename crs_matrix_type::impl_scalar_type impl_scalar_type;
561  typedef typename crs_matrix_type::local_matrix_type KCRS;
562  typedef typename KCRS::values_type::non_const_type values_array;
563  typedef typename KCRS::row_map_type::non_const_type row_ptrs_array;
564  typedef typename KCRS::row_map_type row_ptrs_array_const;
565  typedef typename KCRS::index_type::non_const_type col_inds_array;
566  typedef typename map_type::local_map_type local_map_type;
567  typedef typename Kokkos::View<GlobalOrdinal*, device_type> global_col_inds_array;
568  typedef Kokkos::RangePolicy<execution_space> range_type;
569 
583  static void addSorted(
584  const values_array& Avals,
585  const row_ptrs_array_const& Arowptrs,
586  const col_inds_array& Acolinds,
587  const impl_scalar_type scalarA,
588  const values_array& Bvals,
589  const row_ptrs_array_const& Browptrs,
590  const col_inds_array& Bcolinds,
591  const impl_scalar_type scalarB,
592  values_array& Cvals,
593  row_ptrs_array& Crowptrs,
594  col_inds_array& Ccolinds);
595 
607  static void convertToGlobalAndAdd(
608  const KCRS& A,
609  const impl_scalar_type scalarA,
610  const KCRS& B,
611  const impl_scalar_type scalarB,
612  const local_map_type& AcolMap,
613  const local_map_type& BcolMap,
614  values_array& Cvals,
615  row_ptrs_array& Crowptrs,
616  global_col_inds_array& Ccolinds);
617 
632  static void addUnsorted(
633  const values_array& Avals,
634  const row_ptrs_array_const& Arowptrs,
635  const col_inds_array& Acolinds,
636  const impl_scalar_type scalarA,
637  const values_array& Bvals,
638  const row_ptrs_array_const& Browptrs,
639  const col_inds_array& Bcolinds,
640  const impl_scalar_type scalarB,
641  GlobalOrdinal numGlobalCols,
642  values_array& Cvals,
643  row_ptrs_array& Crowptrs,
644  col_inds_array& Ccolinds);
645 };
646 
647 }//end namespace MMdetails
648 
649 } // end of Tpetra namespace
650 
651 #endif // TPETRA_MATRIXMATRIX_DECL_HPP
652 
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
KokkosSparse::CrsMatrix< impl_scalar_type, local_ordinal_type, device_type, 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...
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.
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...
::Tpetra::Details::LocalMap< local_ordinal_type, global_ordinal_type, device_type > local_map_type
Type of the &quot;local&quot; Map.