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 #define RT TMV_RealType(T)
24 #define CT TMV_ComplexType(T)
25
26 #define DefDivEq(T) \
27 inline void LDivEq(MatrixView<T> m) const \
28 { \
29 TMVAssert(colsize() == rowsize()); \
30 TMVAssert(m.colsize() == colsize()); \
31 doLDivEq(m); \
32 } \
33 inline void RDivEq(MatrixView<T> m) const \
34 { \
35 TMVAssert(colsize() == rowsize()); \
36 TMVAssert(m.rowsize() == rowsize()); \
37 doRDivEq(m); \
38 } \
39 inline void makeInverse(MatrixView<T> minv) const \
40 { \
41 TMVAssert(minv.rowsize() == colsize()); \
42 TMVAssert(minv.colsize() == rowsize()); \
43 doMakeInverse(minv); \
44 } \
45
46
47 DefDivEq(RT);
48 DefDivEq(CT);
49 #undef DefDivEq
50
51 #define DefDiv(T1,T2) \
52 inline void LDiv(const GenMatrix<T1>& m1, MatrixView<T2> m0) const \
53 { \
54 TMVAssert(m0.rowsize() == m1.rowsize()); \
55 TMVAssert(m0.colsize() == rowsize()); \
56 TMVAssert(m1.colsize() == colsize()); \
57 doLDiv(m1,m0); \
58 } \
59 inline void RDiv(const GenMatrix<T1>& m1, MatrixView<T2> m0) const \
60 { \
61 TMVAssert(m0.colsize() == m1.colsize()); \
62 TMVAssert(m1.rowsize() == rowsize()); \
63 TMVAssert(m0.rowsize() == colsize()); \
64 doRDiv(m1,m0); \
65 }
66 DefDiv(RT,RT);
67 DefDiv(RT,CT);
68 DefDiv(CT,CT);
69 #undef DefDiv
70
71 #undef RT
72 #undef CT
73
makeInverseATA(MatrixView<T> minv)74 inline void makeInverseATA(MatrixView<T> minv) const
75 {
76 if (colsize() < rowsize()) {
77 TMVAssert(minv.rowsize() == colsize());
78 TMVAssert(minv.colsize() == colsize());
79 } else {
80 TMVAssert(minv.rowsize() == rowsize());
81 TMVAssert(minv.colsize() == rowsize());
82 }
83 doMakeInverseATA(minv);
84 }
85
86