Tpetra Matrix/Vector Services Version of the Day
TpetraExt_MatrixMatrix_decl.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2008) Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 
00042 #ifndef TPETRA_MATRIXMATRIX_DECL_HPP
00043 #define TPETRA_MATRIXMATRIX_DECL_HPP
00044 
00045 #include <Teuchos_RCP.hpp>
00046 #include <Teuchos_Array.hpp>
00047 #include "Tpetra_ConfigDefs.hpp"
00048 #include "Tpetra_CrsMatrix.hpp"
00049 #include "Tpetra_Vector.hpp"
00050 #include "TpetraExt_MMHelpers.hpp"
00051 
00057 namespace Tpetra {
00058 
00059 namespace MatrixMatrix {
00060 
00091 template <class Scalar,
00092     class LocalOrdinal,
00093     class GlobalOrdinal,
00094     class Node,
00095     class SpMatOps >
00096 void Multiply(
00097   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00098   bool transposeA,
00099   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00100   bool transposeB,
00101   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& C,
00102   bool call_FillComplete_on_result=true);
00103 
00117 template <class Scalar,
00118           class LocalOrdinal,
00119           class GlobalOrdinal,
00120           class Node,
00121           class SpMatOps >
00122 void Add(
00123   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00124   bool transposeA,
00125   Scalar scalarA,
00126   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00127   Scalar scalarB );
00128 
00129 
00159 template <class Scalar,
00160           class LocalOrdinal,
00161           class GlobalOrdinal,
00162           class Node,
00163           class SpMatOps >
00164 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps> >
00165 add (const Scalar& alpha,
00166      const bool transposeA,
00167      const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00168      const Scalar& beta,
00169      const bool transposeB,
00170      const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00171      const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap=Teuchos::null,
00172      const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap=Teuchos::null,
00173      const Teuchos::RCP<Teuchos::ParameterList>& params=Teuchos::null);
00174 
00204 template <class Scalar,
00205           class LocalOrdinal,
00206           class GlobalOrdinal,
00207           class Node,
00208           class SpMatOps>
00209 void Add(
00210   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00211   bool transposeA,
00212   Scalar scalarA,
00213   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00214   bool transposeB,
00215   Scalar scalarB,
00216   RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps> > C);
00217 
00218 
00240   template <class Scalar,
00241       class LocalOrdinal,
00242       class GlobalOrdinal,
00243       class Node,
00244       class SpMatOps >
00245   void Jacobi(Scalar omega,
00246         const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
00247         const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00248         const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00249         CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& C,
00250         bool call_FillComplete_on_result=true);
00251 
00252 } // namespace MatrixMatrix
00253 
00254 namespace MMdetails{
00255 
00256 template<class Scalar,
00257          class LocalOrdinal,
00258          class GlobalOrdinal,
00259          class Node,
00260          class SpMatOps>
00261 void mult_AT_B_newmatrix(
00262   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00263   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00264   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& C);
00265 
00266 
00267 template<class Scalar,
00268          class LocalOrdinal,
00269          class GlobalOrdinal,
00270          class Node,
00271          class SpMatOps>
00272 void mult_A_B(
00273   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Aview,
00274   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Bview,
00275   CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00276 
00277 template<class Scalar,
00278          class LocalOrdinal,
00279          class GlobalOrdinal,
00280          class Node,
00281          class SpMatOps>
00282 void mult_A_B_newmatrix(
00283   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Aview,
00284   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Bview,
00285   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00286 
00287 
00288 template<class Scalar,
00289          class LocalOrdinal,
00290          class GlobalOrdinal,
00291          class Node,
00292          class SpMatOps>
00293 void jacobi_A_B_newmatrix(
00294   Scalar omega,
00295   const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
00296   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Aview,
00297   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Bview,
00298   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00299 
00300 
00301 template<class Scalar,
00302          class LocalOrdinal,
00303          class GlobalOrdinal,
00304          class Node,
00305          class SpMatOps>
00306 void import_and_extract_views(
00307   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& M,
00308   RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > targetMap,
00309   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Mview,
00310   RCP<const Import<LocalOrdinal,GlobalOrdinal, Node> > prototypeImporter = Teuchos::null,
00311   bool userAssertsThereAreNoRemotes=false);
00312 
00313 template<class Scalar,
00314          class LocalOrdinal,
00315          class GlobalOrdinal,
00316          class Node,
00317          class SpMatOps>
00318 void setMaxNumEntriesPerRow(
00319   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Mview);
00320 
00321 }//end namespace MMdetails
00322 
00323 } // end of Tpetra namespace
00324 
00325 #endif // TPETRA_MATRIXMATRIX_DECL_HPP
00326 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines