diff liboctave/numeric/sparse-qr.h @ 29242:f207504ae98d

sparse-qr: Export member function instantiations (patch #8919). * liboctave/numeric/sparse-qr.cc: Do not export class instatiation before specializations. Explicitly instantiate all exported member functions of sparse_qr class. * liboctave/numeric/sparse-qr.h: Import/export template class instantiation with clang or for Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 01 Jan 2021 16:05:31 +0100
parents 5c14f81e0937
children 66f162b6fa03
line wrap: on
line diff
--- a/liboctave/numeric/sparse-qr.h	Tue Dec 29 19:51:08 2020 +0100
+++ b/liboctave/numeric/sparse-qr.h	Fri Jan 01 16:05:31 2021 +0100
@@ -32,8 +32,8 @@
 
 class Matrix;
 class ComplexMatrix;
+class SparseMatrix;
 class SparseComplexMatrix;
-class SparseMatrix;
 class ColumnVector;
 template <typename T> class MArray;
 
@@ -98,6 +98,14 @@
       wide_solve (const RHS_T& b, octave_idx_type& info) const;
     };
 
+#if defined (__clang__) || defined (_WIN32)
+    // extern instantiations with set visibility/export/import attribute
+
+    extern template class OCTAVE_API sparse_qr<SparseMatrix>;
+
+    extern template class OCTAVE_API sparse_qr<SparseComplexMatrix>;
+#endif
+
     // Provide qrsolve for backward compatibility.
 
     extern OCTAVE_API Matrix
@@ -132,8 +140,8 @@
     qrsolve (const SparseComplexMatrix& a, const SparseComplexMatrix& b,
              octave_idx_type& info);
 
-    //typedef sparse_qr<SparseMatrix> SparseQR;
-    //typedef sparse_qr<SparseComplexMatrix> SparseComplexQR;
+    typedef sparse_qr<SparseMatrix> SparseQR;
+    typedef sparse_qr<SparseComplexMatrix> SparseComplexQR;
   }
 }