00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <config.h>
00021
00022 #ifdef HAVE_PETSC
00023
00024 #ifndef PETSC_MATRIX_HPP
00025 #define PETSC_MATRIX_HPP
00026
00027 #include <BaseMatrix.hpp>
00028 #include <DoubleHashedMatrix.hpp>
00029
00030 extern "C"
00031 {
00032 #include <petscksp.h>
00033 }
00034
00035 class PETScMatrix
00036 : public BaseMatrix
00037 {
00038 private:
00039 Mat* __petscMatrix;
00040
00041 public:
00042 const Mat& mat() const
00043 {
00044 return *__petscMatrix;
00045 }
00046
00047 void getDiagonal(BaseVector& X) const
00048 {
00049 throw ErrorHandler(__FILE__, __LINE__,
00050 "not implemented",
00051 ErrorHandler::unexpected);
00052 }
00053
00054 void transposedTimesX(const BaseVector& X, BaseVector& Z) const
00055 {
00056 throw ErrorHandler(__FILE__, __LINE__,
00057 "not implemented",
00058 ErrorHandler::unexpected);
00059 }
00060
00061 void timesX(const BaseVector& X,
00062 BaseVector& Z) const;
00063
00064
00065 PETScMatrix(const DoubleHashedMatrix& A);
00066 ~PETScMatrix();
00067 };
00068
00069 #endif // PETSC_MATRIX_HPP
00070 #endif // HAVE_PETSC