Mercurial > hg > octave-lyh
comparison liboctave/base-qr.cc @ 11505:9a308e96194e
more data member initialization fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Jan 2011 03:57:11 -0500 |
parents | 9f27172fbd1e |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11504:81ff63e43f54 | 11505:9a308e96194e |
---|---|
26 | 26 |
27 #include "base-qr.h" | 27 #include "base-qr.h" |
28 | 28 |
29 template <class qr_type> | 29 template <class qr_type> |
30 base_qr<qr_type>::base_qr (const qr_type& q_arg, const qr_type& r_arg) | 30 base_qr<qr_type>::base_qr (const qr_type& q_arg, const qr_type& r_arg) |
31 : q (q_arg), r (r_arg) | |
31 { | 32 { |
32 octave_idx_type qr = q_arg.rows (), qc = q_arg.columns (); | 33 octave_idx_type q_nr = q.rows (), q_nc = q.columns (); |
33 octave_idx_type rr = r_arg.rows (), rc = r_arg.columns (); | 34 octave_idx_type r_nr = r.rows (), r_nc = r.columns (); |
34 if (qc == rr && (qr == qc || (qr > qc && rr == rc))) | 35 |
36 if (! (q_nc == r_nr && (q_nr == q_nc || (q_nr > q_nc && r_nr == r_nc)))) | |
35 { | 37 { |
36 q = q_arg; | 38 q = qr_type (); |
37 r = r_arg; | 39 r = qr_type (); |
40 | |
41 (*current_liboctave_error_handler) ("QR dimensions mismatch"); | |
38 } | 42 } |
39 else | |
40 (*current_liboctave_error_handler) ("QR dimensions mismatch"); | |
41 } | 43 } |
42 | 44 |
43 template <class qr_type> | 45 template <class qr_type> |
44 qr_type_t | 46 qr_type_t |
45 base_qr<qr_type>::get_type (void) const | 47 base_qr<qr_type>::get_type (void) const |
46 { | 48 { |
47 qr_type_t retval; | 49 qr_type_t retval; |
50 | |
48 if (!q.is_empty () && q.is_square ()) | 51 if (!q.is_empty () && q.is_square ()) |
49 retval = qr_type_std; | 52 retval = qr_type_std; |
50 else if (q.rows () > q.columns () && r.is_square ()) | 53 else if (q.rows () > q.columns () && r.is_square ()) |
51 retval = qr_type_economy; | 54 retval = qr_type_economy; |
52 else | 55 else |
53 retval = qr_type_raw; | 56 retval = qr_type_raw; |
57 | |
54 return retval; | 58 return retval; |
55 } | 59 } |
56 | 60 |
57 template <class qr_type> | 61 template <class qr_type> |
58 bool | 62 bool |