MFEM v2.0
|
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at 00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights 00003 // reserved. See file COPYRIGHT for details. 00004 // 00005 // This file is part of the MFEM library. For more information and source code 00006 // availability see http://mfem.googlecode.com. 00007 // 00008 // MFEM is free software; you can redistribute it and/or modify it under the 00009 // terms of the GNU Lesser General Public License (as published by the Free 00010 // Software Foundation) version 2.1 dated February 1999. 00011 00012 #ifndef MFEM_MATRIX 00013 #define MFEM_MATRIX 00014 00015 // Abstract data types matrix, inverse matrix 00016 00017 #include "../general/array.hpp" 00018 #include "operator.hpp" 00019 00020 class MatrixInverse; 00021 00023 class Matrix : public Operator 00024 { 00025 friend class MatrixInverse; 00026 public: 00028 explicit Matrix (int s) { size=s; } 00029 00031 virtual double& Elem (int i, int j) = 0; 00032 00034 virtual const double& Elem (int i, int j) const = 0; 00035 00037 virtual MatrixInverse * Inverse() const = 0; 00038 00040 virtual void Finalize(int) { } 00041 00043 virtual void Print (ostream & out = cout, int width = 4) const; 00044 00046 virtual ~Matrix() { } 00047 }; 00048 00049 00051 class MatrixInverse : public Operator 00052 { 00053 protected: 00054 const Matrix *a; 00055 00056 public: 00058 MatrixInverse (const Matrix &mat) { size = mat.size; a = &mat; } 00059 00061 virtual ~MatrixInverse() { } 00062 }; 00063 00064 #endif