comparison liboctave/array/MatrixType.h @ 22246:fa917f1f0faf

MatrixType: remove duplicate code for SparseMatrix and ComplexSparseMatrix. * liboctave/array/MatrixType.cc: constructor for SparseMatrix and ComplexSparseMatrix is exactly the same. With C++11, we have conj, norm, real, and imag functions overloaded for double and float that behave as we would want them to.
author Carnë Draug <carandraug@octave.org>
date Wed, 10 Aug 2016 00:56:51 +0100
parents 1473547f50f5
children bac0d6f07a3e
comparison
equal deleted inserted replaced
22245:3d287a11ea18 22246:fa917f1f0faf
23 23
24 #if ! defined (octave_MatrixType_h) 24 #if ! defined (octave_MatrixType_h)
25 #define octave_MatrixType_h 1 25 #define octave_MatrixType_h 1
26 26
27 #include "octave-config.h" 27 #include "octave-config.h"
28
29 #include "MSparse.h"
28 30
29 class Matrix; 31 class Matrix;
30 class ComplexMatrix; 32 class ComplexMatrix;
31 class FloatMatrix; 33 class FloatMatrix;
32 class FloatComplexMatrix; 34 class FloatComplexMatrix;
66 68
67 MatrixType (const FloatMatrix &a); 69 MatrixType (const FloatMatrix &a);
68 70
69 MatrixType (const FloatComplexMatrix &a); 71 MatrixType (const FloatComplexMatrix &a);
70 72
71 MatrixType (const SparseMatrix &a); 73 template <typename T>
72 74 MatrixType (const MSparse<T> &a);
73 MatrixType (const SparseComplexMatrix &a);
74 75
75 MatrixType (const matrix_type t, bool _full = false); 76 MatrixType (const matrix_type t, bool _full = false);
76 77
77 MatrixType (const matrix_type t, const octave_idx_type np, 78 MatrixType (const matrix_type t, const octave_idx_type np,
78 const octave_idx_type *p, bool _full = false); 79 const octave_idx_type *p, bool _full = false);