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_BaseTriMatrix_H 24 #define TMV_BaseTriMatrix_H 25 26 #include "tmv/TMV_BaseMatrix.h" 27 28 namespace tmv { 29 30 template <typename T> 31 class GenUpperTriMatrix; 32 33 template <typename T> 34 class GenLowerTriMatrix; 35 36 template <typename T, int A=0> 37 class ConstUpperTriMatrixView; 38 39 template <typename T, int A=0> 40 class ConstLowerTriMatrixView; 41 42 template <typename T, int A=0> 43 class UpperTriMatrixView; 44 45 template <typename T, int A=0> 46 class LowerTriMatrixView; 47 48 template <typename T, int A=0> 49 class UpperTriMatrix; 50 51 template <typename T, int A=0> 52 class LowerTriMatrix; 53 54 template <typename T> 55 class UpperTriDiv; 56 57 template <typename T> 58 class LowerTriDiv; 59 60 template <typename T, typename Tm> 61 class QuotXU; 62 63 template <typename T, typename Tm> 64 class QuotXL; 65 66 template <typename T1, typename T2> 67 void Copy( 68 const GenUpperTriMatrix<T1>& m1, UpperTriMatrixView<T2> m2); 69 70 template <typename T> 71 struct AssignableToUpperTriMatrix : 72 virtual public AssignableToMatrix<T> 73 { 74 typedef TMV_RealType(T) RT; 75 typedef TMV_ComplexType(T) CT; 76 virtual ptrdiff_t size() const = 0; 77 virtual DiagType dt() const = 0; 78 virtual void assignToU(UpperTriMatrixView<RT> m) const = 0; 79 virtual void assignToU(UpperTriMatrixView<CT> m) const = 0; ~AssignableToUpperTriMatrixAssignableToUpperTriMatrix80 virtual inline ~AssignableToUpperTriMatrix() {} 81 }; 82 83 template <typename T> 84 struct AssignableToLowerTriMatrix : 85 virtual public AssignableToMatrix<T> 86 { 87 typedef TMV_RealType(T) RT; 88 typedef TMV_ComplexType(T) CT; 89 virtual ptrdiff_t size() const = 0; 90 virtual DiagType dt() const = 0; 91 virtual void assignToL(LowerTriMatrixView<RT> m) const = 0; 92 virtual void assignToL(LowerTriMatrixView<CT> m) const = 0; ~AssignableToLowerTriMatrixAssignableToLowerTriMatrix93 virtual inline ~AssignableToLowerTriMatrix() {} 94 }; 95 96 template <typename T, int A> TMV_Text(const UpperTriMatrix<T,A> &)97 inline std::string TMV_Text(const UpperTriMatrix<T,A>& ) 98 { 99 return std::string("UpperTriMatrix<") + 100 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 101 } 102 template <typename T, int A> TMV_Text(const LowerTriMatrix<T,A> &)103 inline std::string TMV_Text(const LowerTriMatrix<T,A>& ) 104 { 105 return std::string("LowerTriMatrix<") + 106 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 107 } 108 109 template <typename T> TMV_Text(const GenUpperTriMatrix<T> &)110 inline std::string TMV_Text(const GenUpperTriMatrix<T>& ) 111 { 112 return std::string("GenUpperTriMatrix<") + TMV_Text(T()) + ">"; 113 } 114 template <typename T> TMV_Text(const GenLowerTriMatrix<T> &)115 inline std::string TMV_Text(const GenLowerTriMatrix<T>& ) 116 { 117 return std::string("GenLowerTriMatrix<") + TMV_Text(T()) + ">"; 118 } 119 120 template <typename T, int A> TMV_Text(const ConstUpperTriMatrixView<T,A> &)121 inline std::string TMV_Text(const ConstUpperTriMatrixView<T,A>& ) 122 { 123 return std::string("ConstUpperTriMatrixView<") + 124 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 125 } 126 template <typename T, int A> TMV_Text(const ConstLowerTriMatrixView<T,A> &)127 inline std::string TMV_Text(const ConstLowerTriMatrixView<T,A>& ) 128 { 129 return std::string("ConstLowerTriMatrixView<") + 130 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 131 } 132 133 template <typename T, int A> TMV_Text(const UpperTriMatrixView<T,A> &)134 inline std::string TMV_Text(const UpperTriMatrixView<T,A>& ) 135 { 136 return std::string("UpperTriMatrixView<") + 137 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 138 } 139 template <typename T, int A> TMV_Text(const LowerTriMatrixView<T,A> &)140 inline std::string TMV_Text(const LowerTriMatrixView<T,A>& ) 141 { 142 return std::string("LowerTriMatrixView<") + 143 TMV_Text(T()) + "," + Attrib<A>::text() + ">"; 144 } 145 146 } // namespace tmv 147 148 #endif 149