1 /////////////////////////////////////////////////////////////////////////////// 2 // // 3 // The Template Matrix/Vector Library for C++ was created by Mike Jarvis // 4 // Copyright (C) 1998 - 2016 // 5 // All rights reserved // 6 // // 7 // The project is hosted at https://code.google.com/p/tmv-cpp/ // 8 // where you can find the current version and current documention. // 9 // // 10 // For concerns or problems with the software, Mike may be contacted at // 11 // mike_jarvis17 [at] gmail. // 12 // // 13 // This software is licensed under a FreeBSD license. The file // 14 // TMV_LICENSE should have bee included with this distribution. // 15 // It not, you can get a copy from https://code.google.com/p/tmv-cpp/. // 16 // // 17 // Essentially, you can use this software however you want provided that // 18 // you include the TMV_LICENSE file in any distribution that uses it. // 19 // // 20 /////////////////////////////////////////////////////////////////////////////// 21 22 23 #ifndef TMV_BaseBandMatrix_H 24 #define TMV_BaseBandMatrix_H 25 26 #include "tmv/TMV_BaseMatrix.h" 27 28 namespace tmv { 29 30 template <typename T> 31 class GenBandMatrix; 32 33 template <typename T, int A=0> 34 class ConstBandMatrixView; 35 36 template <typename T, int A=0> 37 class BandMatrixView; 38 39 template <typename T, int A=0> 40 class BandMatrix; 41 42 template <typename T> 43 class BandLUDiv; 44 45 template <typename T> 46 class BandSVDiv; 47 48 template <typename T> 49 class BandQRDiv; 50 51 template <typename T, typename Tm> 52 class QuotXB; 53 54 ptrdiff_t BandStorageLength(StorageType s, ptrdiff_t cs, ptrdiff_t rs, ptrdiff_t lo, ptrdiff_t hi); 55 ptrdiff_t BandNumElements(ptrdiff_t cs, ptrdiff_t rs, ptrdiff_t lo, ptrdiff_t hi); 56 57 template <typename T1, typename T2> 58 void Copy(const GenBandMatrix<T1>& m1, BandMatrixView<T2> m2); 59 60 template <typename T> 61 struct AssignableToBandMatrix : virtual public AssignableToMatrix<T> 62 { 63 typedef TMV_RealType(T) RT; 64 typedef TMV_ComplexType(T) CT; 65 virtual ptrdiff_t nlo() const = 0; 66 virtual ptrdiff_t nhi() const = 0; 67 virtual void assignToB(BandMatrixView<RT> m) const = 0; 68 virtual void assignToB(BandMatrixView<CT> m) const = 0; ~AssignableToBandMatrixAssignableToBandMatrix69 virtual inline ~AssignableToBandMatrix() {} 70 }; 71 72 template <typename T, int A> TMV_Text(const BandMatrix<T,A> &)73 inline std::string TMV_Text(const BandMatrix<T,A>& ) 74 { 75 return std::string("BandMatrix<") + 76 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 77 } 78 79 template <typename T> TMV_Text(const GenBandMatrix<T> &)80 inline std::string TMV_Text(const GenBandMatrix<T>& ) 81 { 82 return std::string("GenBandMatrix<") + TMV_Text(T()) + ">"; 83 } 84 template <typename T, int A> TMV_Text(const ConstBandMatrixView<T,A> &)85 inline std::string TMV_Text(const ConstBandMatrixView<T,A>& ) 86 { 87 return std::string("ConstBandMatrixView<") + 88 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 89 } 90 template <typename T, int A> TMV_Text(const BandMatrixView<T,A> &)91 inline std::string TMV_Text(const BandMatrixView<T,A>& ) 92 { 93 return std::string("BandMatrixView<") + 94 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 95 } 96 97 } // namespace tmv 98 99 #endif 100