00001 /* @HEADER@ */ 00002 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_BLOCKOPERATORBASE_DECL_HPP 00006 #define PLAYA_BLOCKOPERATORBASE_DECL_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 00010 00011 namespace Playa 00012 { 00013 00014 00015 template <class Scalar> 00016 class LinearOperator; 00017 00018 /** 00019 * Class BlockOperatorBase provides an abstract interface for accessing 00020 * blocks of block operators 00021 * 00022 * @author Paul T Boggs (ptboggs@sandia.gov) 00023 */ 00024 template <class Scalar> 00025 class BlockOperatorBase 00026 { 00027 public: 00028 00029 /** */ 00030 virtual int numBlockRows() const = 0 ; 00031 00032 /** */ 00033 virtual int numBlockCols() const = 0 ; 00034 00035 /** */ 00036 virtual const LinearOperator<Scalar>& getBlock(int i, int j) const = 0 ; 00037 /** */ 00038 virtual LinearOperator<Scalar> getNonconstBlock(int i, int j) = 0 ; 00039 00040 }; 00041 00042 /** 00043 * Class SetableBlockOperatorBase provides an abstract interface for setting 00044 * blocks of block operators 00045 * 00046 * @author Paul T Boggs (ptboggs@sandia.gov) 00047 */ 00048 template <class Scalar> 00049 class SetableBlockOperatorBase : public BlockOperatorBase<Scalar> 00050 { 00051 public: 00052 00053 /** */ 00054 virtual void setBlock(int i, int j, const LinearOperator<Scalar>& Aij) = 0 ; 00055 00056 /** Callback to finalize block fill. The default is a no-op. */ 00057 virtual void endBlockFill() {;} 00058 00059 00060 00061 }; 00062 00063 00064 00065 00066 00067 } 00068 00069 #endif