Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
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 void Multiply(
00096   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00097   bool transposeA,
00098   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00099   bool transposeB,
00100   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
00101   bool call_FillComplete_on_result=true);
00102 
00116 template <class Scalar,
00117           class LocalOrdinal,
00118           class GlobalOrdinal,
00119           class Node>
00120 void Add(
00121   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00122   bool transposeA,
00123   Scalar scalarA,
00124   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00125   Scalar scalarB );
00126 
00127 
00157 template <class Scalar,
00158           class LocalOrdinal,
00159           class GlobalOrdinal,
00160           class Node>
00161 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
00162 add (const Scalar& alpha,
00163      const bool transposeA,
00164      const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00165      const Scalar& beta,
00166      const bool transposeB,
00167      const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00168      const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap=Teuchos::null,
00169      const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap=Teuchos::null,
00170      const Teuchos::RCP<Teuchos::ParameterList>& params=Teuchos::null);
00171 
00201 template <class Scalar,
00202           class LocalOrdinal,
00203           class GlobalOrdinal,
00204           class Node>
00205 void Add(
00206   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00207   bool transposeA,
00208   Scalar scalarA,
00209   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00210   bool transposeB,
00211   Scalar scalarB,
00212   RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > C);
00213 
00214 
00236   template <class Scalar,
00237             class LocalOrdinal,
00238             class GlobalOrdinal,
00239             class Node>
00240   void Jacobi(Scalar omega,
00241               const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
00242               const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00243               const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00244               CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
00245               bool call_FillComplete_on_result=true);
00246 
00247 } // namespace MatrixMatrix
00248 
00249 namespace MMdetails{
00250 
00251 template<class Scalar,
00252          class LocalOrdinal,
00253          class GlobalOrdinal,
00254          class Node>
00255 void mult_AT_B_newmatrix(
00256   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
00257   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& B,
00258   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00259 
00260 
00261 template<class Scalar,
00262          class LocalOrdinal,
00263          class GlobalOrdinal,
00264          class Node>
00265 void mult_A_B(
00266   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
00267   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
00268   CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00269 
00270 template<class Scalar,
00271          class LocalOrdinal,
00272          class GlobalOrdinal,
00273          class Node>
00274 void mult_A_B_newmatrix(
00275   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
00276   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
00277   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00278 
00279 
00280 template<class Scalar,
00281          class LocalOrdinal,
00282          class GlobalOrdinal,
00283          class Node>
00284 void jacobi_A_B_newmatrix(
00285   Scalar omega,
00286   const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> & Dinv,
00287   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
00288   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Bview,
00289   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
00290 
00291 
00292 template<class Scalar,
00293          class LocalOrdinal,
00294          class GlobalOrdinal,
00295          class Node>
00296 void import_and_extract_views(
00297   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& M,
00298   RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > targetMap,
00299   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview,
00300   RCP<const Import<LocalOrdinal,GlobalOrdinal, Node> > prototypeImporter = Teuchos::null,
00301   bool userAssertsThereAreNoRemotes=false);
00302 
00303 template<class Scalar,
00304          class LocalOrdinal,
00305          class GlobalOrdinal,
00306          class Node>
00307 void setMaxNumEntriesPerRow(
00308   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Mview);
00309 
00310 }//end namespace MMdetails
00311 
00312 } // end of Tpetra namespace
00313 
00314 #endif // TPETRA_MATRIXMATRIX_DECL_HPP
00315 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines