Mercurial > octave
changeset 29667:1311b9a3590e
MSparse.cc: Remove API flags from template definitions.
* liboctave/array/MSparse.h (MSparse<T>): Forward declare template with
visibility attributes.
(map): Change return type to Sparse<U>.
* liboctave/array/MSparse.cc: Remove API flags from template definitions that
are included in every compilation unit that instantiates the templates.
* liboctave/array/boolSparse.h: Remove unused include.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 14 May 2021 10:47:28 +0200 |
parents | b0024e96ed31 |
children | d3a02b27fa6a |
files | liboctave/array/MSparse.cc liboctave/array/MSparse.h liboctave/array/boolSparse.h |
diffstat | 3 files changed, 7 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/MSparse.cc Fri May 14 12:51:17 2021 -0400 +++ b/liboctave/array/MSparse.cc Fri May 14 10:47:28 2021 +0200 @@ -28,7 +28,6 @@ // Element by element MSparse by MSparse ops. template <typename T, typename OP> -OCTAVE_API MSparse<T>& plus_or_minus (MSparse<T>& a, const MSparse<T>& b, OP op, const char *op_name) { @@ -99,7 +98,6 @@ } template <typename T> -OCTAVE_API MSparse<T>& operator += (MSparse<T>& a, const MSparse<T>& b) { @@ -107,7 +105,6 @@ } template <typename T> -OCTAVE_API MSparse<T>& operator -= (MSparse<T>& a, const MSparse<T>& b) { @@ -117,7 +114,6 @@ // Element by element MSparse by scalar ops. template <typename T, typename OP> -OCTAVE_API MArray<T> plus_or_minus (const MSparse<T>& a, const T& s, OP op) { @@ -133,7 +129,6 @@ } template <typename T> -OCTAVE_API MArray<T> operator + (const MSparse<T>& a, const T& s) { @@ -141,7 +136,6 @@ } template <typename T> -OCTAVE_API MArray<T> operator - (const MSparse<T>& a, const T& s) { @@ -149,7 +143,6 @@ } template <typename T, typename OP> -OCTAVE_API MSparse<T> times_or_divide (const MSparse<T>& a, const T& s, OP op) { @@ -171,7 +164,6 @@ } template <typename T> -OCTAVE_API MSparse<T> operator * (const MSparse<T>& a, const T& s) { @@ -179,7 +171,6 @@ } template <typename T> -OCTAVE_API MSparse<T> operator / (const MSparse<T>& a, const T& s) { @@ -189,7 +180,6 @@ // Element by element scalar by MSparse ops. template <typename T, typename OP> -OCTAVE_API MArray<T> plus_or_minus (const T& s, const MSparse<T>& a, OP op) { @@ -205,7 +195,6 @@ } template <typename T> -OCTAVE_API MArray<T> operator + (const T& s, const MSparse<T>& a) { @@ -213,7 +202,6 @@ } template <typename T> -OCTAVE_API MArray<T> operator - (const T& s, const MSparse<T>& a) { @@ -221,7 +209,6 @@ } template <typename T, typename OP> -OCTAVE_API MSparse<T> times_or_divides (const T& s, const MSparse<T>& a, OP op) { @@ -243,7 +230,6 @@ } template <typename T> -OCTAVE_API MSparse<T> operator * (const T& s, const MSparse<T>& a) { @@ -251,7 +237,6 @@ } template <typename T> -OCTAVE_API MSparse<T> operator / (const T& s, const MSparse<T>& a) { @@ -261,7 +246,6 @@ // Element by element MSparse by MSparse ops. template <typename T, typename OP> -OCTAVE_API MSparse<T> plus_or_minus (const MSparse<T>& a, const MSparse<T>& b, OP op, const char *op_name, bool negate) @@ -381,23 +365,20 @@ } template <typename T> -OCTAVE_API MSparse<T> -operator+ (const MSparse<T>& a, const MSparse<T>& b) +operator + (const MSparse<T>& a, const MSparse<T>& b) { return plus_or_minus (a, b, std::plus<T> (), "operator +", false); } template <typename T> -OCTAVE_API MSparse<T> -operator- (const MSparse<T>& a, const MSparse<T>& b) +operator - (const MSparse<T>& a, const MSparse<T>& b) { return plus_or_minus (a, b, std::minus<T> (), "operator -", true); } template <typename T> -OCTAVE_API MSparse<T> product (const MSparse<T>& a, const MSparse<T>& b) { @@ -495,7 +476,6 @@ } template <typename T> -OCTAVE_API MSparse<T> quotient (const MSparse<T>& a, const MSparse<T>& b) { @@ -612,7 +592,6 @@ // Unary MSparse ops. template <typename T> -OCTAVE_API MSparse<T> operator + (const MSparse<T>& a) { @@ -620,7 +599,6 @@ } template <typename T> -OCTAVE_API MSparse<T> operator - (const MSparse<T>& a) {
--- a/liboctave/array/MSparse.h Fri May 14 12:51:17 2021 -0400 +++ b/liboctave/array/MSparse.h Fri May 14 10:47:28 2021 +0200 @@ -35,6 +35,9 @@ #include "quit.h" +// forward declare template with visibility attributes +template <typename T> class OCTAVE_API MSparse; + // Two dimensional sparse array with math ops. template <typename T> class @@ -112,12 +115,12 @@ // FIXME: should go away. template <typename U> - MSparse<U> + Sparse<U> map (U (&fcn) (T)) const { return Sparse<T>::template map<U> (fcn); } template <typename U> - MSparse<U> + Sparse<U> map (U (&fcn) (const T&)) const { return Sparse<T>::template map<U> (fcn); } };