Mercurial > octave
comparison liboctave/numeric/svd.h @ 22248:60986498af9e
svd: use std::vector instead of Matrix when a std::vector is enough.
* liboctave/numeric/svd.cc, liboctave/numeric/svd.h: Matrix<T> was
being used only to create an array for work by the fortran subroutines.
Use std::vector which is lighter but still provides RIIA idiom.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Wed, 10 Aug 2016 03:56:38 +0100 |
parents | e43199618777 |
children | da201af35c97 |
comparison
equal
deleted
inserted
replaced
22247:c8fc60a183a3 | 22248:60986498af9e |
---|---|
23 | 23 |
24 #if ! defined (octave_svd_h) | 24 #if ! defined (octave_svd_h) |
25 #define octave_svd_h 1 | 25 #define octave_svd_h 1 |
26 | 26 |
27 #include "octave-config.h" | 27 #include "octave-config.h" |
28 | |
29 #include "vector" | |
28 | 30 |
29 template <typename T> | 31 template <typename T> |
30 class | 32 class |
31 svd | 33 svd |
32 { | 34 { |
93 DM_T sigma; | 95 DM_T sigma; |
94 T right_sm; | 96 T right_sm; |
95 | 97 |
96 void gesvd (char& jobu, char& jobv, octave_idx_type m, octave_idx_type n, | 98 void gesvd (char& jobu, char& jobv, octave_idx_type m, octave_idx_type n, |
97 P* tmp_data, octave_idx_type m1, DM_P* s_vec, P* u, P* vt, | 99 P* tmp_data, octave_idx_type m1, DM_P* s_vec, P* u, P* vt, |
98 octave_idx_type nrow_vt1, T& work, octave_idx_type& lwork, | 100 octave_idx_type nrow_vt1, std::vector<P>& work, octave_idx_type& lwork, |
99 octave_idx_type& info); | 101 octave_idx_type& info); |
100 | 102 |
101 void gesdd (char& jobz, octave_idx_type m, octave_idx_type n, | 103 void gesdd (char& jobz, octave_idx_type m, octave_idx_type n, |
102 P* tmp_data, octave_idx_type m1, DM_P* s_vec, P* u, P* vt, | 104 P* tmp_data, octave_idx_type m1, DM_P* s_vec, P* u, P* vt, |
103 octave_idx_type nrow_vt1, T& work, octave_idx_type& lwork, | 105 octave_idx_type nrow_vt1, std::vector<P>& work, |
106 octave_idx_type& lwork, | |
104 octave_idx_type* iwork, octave_idx_type& info); | 107 octave_idx_type* iwork, octave_idx_type& info); |
105 | 108 |
106 }; | 109 }; |
107 | 110 |
108 #endif | 111 #endif |