Epetra_OskiMatrix.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 // Author: Ian Karlin ikarlin@sandia.gov 05-28-2008
00033 
00034 #ifndef EPETRA_OSKIMATRIX_H
00035 #define EPETRA_OSKIMATRIX_H
00036 
00037 #include "Epetra_OskiMultiVector.h"
00038 #include "Epetra_OskiVector.h"
00039 #include "Epetra_CrsMatrix.h"
00040 #include "Epetra_OskiPermutation.h"
00041 #include "Teuchos_ParameterList.hpp"
00042 #include "Epetra_Comm.h"
00043 extern "C" {
00044   #include "oski/oski.h"
00045 }
00046 
00047 class Epetra_OskiVector;
00048 class Epetra_OskiMultiVector;
00049 class Teuchos_ParameterList;
00050 class Epetra_OskiPermutation;
00051 
00053 
00082 class Epetra_OskiMatrix: public Epetra_CrsMatrix{
00083  public:
00085 
00086 
00087         Epetra_OskiMatrix(const Epetra_OskiMatrix& Source); //not in use for now
00088  
00090 
00104   Epetra_OskiMatrix(const Epetra_CrsMatrix& Source, const Teuchos::ParameterList& List);
00105   
00107   virtual ~Epetra_OskiMatrix();
00109 
00111 
00112 
00113 
00132   int ReplaceMyValues(int MyRow, 
00133           int NumEntries, 
00134           double* Values, 
00135           int* Indices);
00136 
00138 
00155   int SumIntoMyValues(int MyRow, 
00156           int NumEntries, 
00157           double* Values, 
00158           int* Indices);
00159 
00160 
00162 
00167   int ExtractDiagonalCopy(Epetra_Vector& Diagonal) const;
00168   
00170 
00180   int ReplaceDiagonalValues(const Epetra_OskiVector& Diagonal);
00182 
00184 
00185 
00186 
00195     int Multiply(bool TransA,
00196              const Epetra_Vector& x, 
00197          Epetra_Vector& y) const;
00198   
00200 
00211     int Multiply(bool TransA,
00212              const Epetra_Vector& x, 
00213          Epetra_Vector& y,
00214          double Alpha,
00215          double Beta = 0.0) const;
00216   
00218 
00227     int Multiply(bool TransA,
00228                const Epetra_MultiVector& X, 
00229              Epetra_MultiVector& Y) const;
00230 
00232 
00243     int Multiply(bool TransA,
00244                const Epetra_MultiVector& X, 
00245              Epetra_MultiVector& Y,
00246          double Alpha,
00247              double Beta = 0.0) const;
00248 
00250 
00261         int Solve(bool Upper, bool TransA, bool UnitDiagonal, const Epetra_Vector& x, Epetra_Vector &y) const;
00262         
00264 
00274         int Solve(bool TransA, const Epetra_Vector& x, Epetra_Vector& y, double Alpha = 1.0) const;
00275         
00277 
00288         int Solve(bool Upper, bool TransA, bool UnitDiagonal, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00289         
00291 
00301         int Solve(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y, double Alpha = 1.0) const;
00302         
00303 
00305 
00322   int MatTransMatMultiply(bool ATA, 
00323         const Epetra_Vector& x,
00324         Epetra_Vector& y,
00325         Epetra_Vector* t,
00326         double Alpha = 1.0,
00327         double Beta = 0.0) const;
00328 
00330 
00347   int MatTransMatMultiply(bool ATA, 
00348         const Epetra_MultiVector& X,
00349         Epetra_MultiVector& Y,
00350         Epetra_MultiVector* T,
00351         double Alpha = 1.0,
00352         double Beta = 0.0) const;
00353   
00355 
00371   int MultiplyAndMatTransMultiply(bool TransA,
00372           const Epetra_Vector& x,
00373           Epetra_Vector& y,
00374           const Epetra_Vector& w,
00375           Epetra_Vector& z,
00376           double Alpha = 1.0,
00377           double Beta = 0.0,
00378           double Omega = 1.0,
00379           double Zeta = 0.0) const;
00380 
00382 
00398   int MultiplyAndMatTransMultiply(bool TransA,
00399           const Epetra_MultiVector& X,
00400           Epetra_MultiVector& Y,
00401           const Epetra_MultiVector& W,
00402           Epetra_MultiVector& Z,
00403           double Alpha = 1.0,
00404           double Beta = 0.0,
00405           double Omega = 1.0,
00406           double Zeta = 0.0) const;
00407 
00409 
00427   int MatPowMultiply(bool TransA,
00428          const Epetra_Vector& x,
00429          Epetra_Vector& y,
00430          Epetra_MultiVector& T,
00431          int Power = 2,
00432          double Alpha = 1.0,
00433          double Beta = 0.0) const;
00434 
00436 
00451   int MatPowMultiply(bool TransA,
00452          const Epetra_Vector& x,
00453          Epetra_Vector& y,
00454          int Power = 2,
00455          double Alpha = 1.0,
00456          double Beta = 0.0) const;
00458 
00460 
00461 
00462 
00495   int SetHint(const Teuchos::ParameterList& List);
00496 
00497   
00499 
00533   int SetHintMultiply(bool TransA,
00534           double Alpha,
00535           const Epetra_OskiMultiVector& InVec,
00536           double Beta,
00537           const Epetra_OskiMultiVector& OutVec,
00538           int NumCalls,
00539           const Teuchos::ParameterList& List);
00540   
00542 
00571   int SetHintSolve(bool TransA,
00572              double Alpha,
00573              const Epetra_OskiMultiVector& Vector,
00574          int NumCalls,
00575          const Teuchos::ParameterList& List);
00576   
00578 
00618   int SetHintMatTransMatMultiply(bool ATA,
00619                      double Alpha,
00620                  const Epetra_OskiMultiVector& InVec,
00621                  double Beta,
00622                const Epetra_OskiMultiVector& OutVec,
00623                const Epetra_OskiMultiVector& Intermediate,
00624                  int NumCalls,
00625                  const Teuchos::ParameterList& List);
00626 
00628 
00675   int SetHintMultiplyAndMatTransMultiply(bool TransA,
00676                          double Alpha,
00677                      const Epetra_OskiMultiVector& InVec,
00678                      double Beta,
00679                      const Epetra_OskiMultiVector& OutVec,
00680                          double Omega,
00681                      const Epetra_OskiMultiVector& InVec2,
00682                      double Zeta,
00683                      const Epetra_OskiMultiVector& OutVec2,
00684                      int NumCalls,
00685                      const Teuchos::ParameterList& List);
00686 
00688 
00729   int SetHintPowMultiply(bool TransA,
00730              double Alpha,
00731              const Epetra_OskiMultiVector& InVec,
00732              double Beta,
00733              const Epetra_OskiMultiVector& OutVec,
00734              const Epetra_OskiMultiVector& Intermediate,
00735              int Power,
00736              int NumCalls,
00737              const Teuchos::ParameterList& List);
00738 
00740 
00745   int TuneMatrix();
00747 
00749 
00750 
00751   int IsMatrixTransformed() const;
00752 
00754   const Epetra_OskiMatrix& ViewTransformedMat() const;
00755 
00757   const Epetra_OskiPermutation& ViewRowPermutation() const;
00758   
00760   const Epetra_OskiPermutation& ViewColumnPermutation() const;
00761   
00763 
00768   char* GetMatrixTransforms() const;
00769 
00771 
00779   int ApplyMatrixTransforms(const char* Transforms);
00781 
00782  protected:
00783 
00784  private:
00785   const Epetra_CrsMatrix* Epetra_View_;
00786   oski_matrix_t A_tunable_;
00787   bool Copy_Created_; 
00788 };
00789 #endif /* EPETRA_OSKIMATRIX_H */

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7