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_BaseDiagMatrix_H 24 #define TMV_BaseDiagMatrix_H 25 26 #include "tmv/TMV_BaseMatrix.h" 27 28 namespace tmv { 29 30 template <typename T> 31 class GenDiagMatrix; 32 33 template <typename T, int A=0> 34 class ConstDiagMatrixView; 35 36 template <typename T, int A=0> 37 class DiagMatrixView; 38 39 template <typename T, int A=0> 40 class DiagMatrix; 41 42 template <typename T, typename Tm> 43 class QuotXD; 44 45 template <typename T> 46 struct AssignableToDiagMatrix : 47 virtual public AssignableToMatrix<T> 48 { 49 typedef TMV_RealType(T) RT; 50 typedef TMV_ComplexType(T) CT; 51 virtual ptrdiff_t size() const = 0; 52 virtual void assignToD(DiagMatrixView<RT> m) const = 0; 53 virtual void assignToD(DiagMatrixView<CT> m) const = 0; ~AssignableToDiagMatrixAssignableToDiagMatrix54 virtual inline ~AssignableToDiagMatrix() {} 55 }; 56 57 template <typename T, int A> TMV_Text(const DiagMatrix<T,A> &)58 inline std::string TMV_Text(const DiagMatrix<T,A>& ) 59 { 60 return std::string("DiagMatrix<") + 61 TMV_Text(T()) + "," + Attrib<A>::vtext() + ">"; 62 } 63 64 template <typename T> TMV_Text(const GenDiagMatrix<T> &)65 inline std::string TMV_Text(const GenDiagMatrix<T>& ) 66 { 67 return std::string("GenDiagMatrix<") + TMV_Text(T()) + ">"; 68 } 69 70 template <typename T, int A> TMV_Text(const ConstDiagMatrixView<T,A> &)71 inline std::string TMV_Text(const ConstDiagMatrixView<T,A>& ) 72 { 73 return std::string("ConstDiagMatrixView<") + 74 TMV_Text(T()) + "," + Attrib<A>::vtext() + ">"; 75 } 76 77 template <typename T, int A> TMV_Text(const DiagMatrixView<T,A> &)78 inline std::string TMV_Text(const DiagMatrixView<T,A>& ) 79 { 80 return std::string("DiagMatrixView<") + 81 TMV_Text(T()) + "," + Attrib<A>::vtext() + ">"; 82 } 83 84 } // namespace tmv 85 86 #endif 87