Mercurial > hg > octave-nkf
annotate liboctave/array/dColVector.h @ 20158:857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
* main-window.h, main-window.cc (main_window::_start_gui): New member
variable.
(main_window::main_window): New argument, start_gui.
Skip most initialization if start_gui is false.
(main_window::confirm_shutdown_octave): Skip interactive confirmation
if _start_gui is false.
(main_window::connect_uiwidget_links, main_window::construct,
main_window::construct_octave_qt_link): Skip most initialization if
_start_gui is false.
(main_window::handle_octave_ready): Handle non-gui case.
* octave-gui.cc (octave_start_gui): Unify gui/non-gui options.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 17 Mar 2015 10:13:58 -0400 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
458 | 1 /* |
2 | |
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
3 Copyright (C) 1994-2015 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
4 Copyright (C) 2010 VZLU Prague |
458 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
458 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
458 | 21 |
22 */ | |
23 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
24 #if !defined (octave_dColVector_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17769
diff
changeset
|
25 #define octave_dColVector_h 1 |
458 | 26 |
1214 | 27 #include "MArray.h" |
458 | 28 |
29 #include "mx-defs.h" | |
30 | |
3585 | 31 class |
6108 | 32 OCTAVE_API |
3585 | 33 ColumnVector : public MArray<double> |
458 | 34 { |
35 public: | |
36 | |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
37 ColumnVector (void) : MArray<double> (dim_vector (0, 1)) { } |
3585 | 38 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
39 explicit ColumnVector (octave_idx_type n) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
40 : MArray<double> (dim_vector (n, 1)) { } |
3585 | 41 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11574
diff
changeset
|
42 explicit ColumnVector (const dim_vector& dv) |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
43 : MArray<double> (dv.as_column ()) { } |
9612
66970dd627f6
further liboctave design improvements
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
44 |
11570
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 ColumnVector (octave_idx_type n, double val) |
57632dea2446
attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
46 : MArray<double> (dim_vector (n, 1), val) { } |
3585 | 47 |
48 ColumnVector (const ColumnVector& a) : MArray<double> (a) { } | |
49 | |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
50 ColumnVector (const MArray<double>& a) : MArray<double> (a.as_column ()) { } |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
51 ColumnVector (const Array<double>& a) : MArray<double> (a.as_column ()) { } |
458 | 52 |
53 ColumnVector& operator = (const ColumnVector& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
54 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
55 MArray<double>::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 } |
458 | 58 |
2386 | 59 bool operator == (const ColumnVector& a) const; |
60 bool operator != (const ColumnVector& a) const; | |
458 | 61 |
1359 | 62 // destructive insert/delete/reorder operations |
458 | 63 |
5275 | 64 ColumnVector& insert (const ColumnVector& a, octave_idx_type r); |
458 | 65 |
66 ColumnVector& fill (double val); | |
5275 | 67 ColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2); |
458 | 68 |
69 ColumnVector stack (const ColumnVector& a) const; | |
70 | |
71 RowVector transpose (void) const; | |
72 | |
6108 | 73 friend OCTAVE_API ColumnVector real (const ComplexColumnVector& a); |
74 friend OCTAVE_API ColumnVector imag (const ComplexColumnVector& a); | |
1205 | 75 |
1359 | 76 // resize is the destructive equivalent for this one |
458 | 77 |
5275 | 78 ColumnVector extract (octave_idx_type r1, octave_idx_type r2) const; |
458 | 79 |
5275 | 80 ColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const; |
4316 | 81 |
1359 | 82 // matrix by column vector -> column vector operations |
458 | 83 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
84 friend OCTAVE_API ColumnVector operator * (const Matrix& a, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 const ColumnVector& b); |
458 | 86 |
1359 | 87 // diagonal matrix by column vector -> column vector operations |
458 | 88 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 friend OCTAVE_API ColumnVector operator * (const DiagMatrix& a, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 const ColumnVector& b); |
458 | 91 |
1359 | 92 // other operations |
458 | 93 |
94 double min (void) const; | |
95 double max (void) const; | |
96 | |
10363
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
97 ColumnVector abs (void) const; |
a0728e81ed25
improve diag matrix interface & implementation
Jaroslav Hajek <highegg@gmail.com>
parents:
10350
diff
changeset
|
98 |
1359 | 99 // i/o |
458 | 100 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
101 friend OCTAVE_API std::ostream& operator << (std::ostream& os, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
102 const ColumnVector& a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 friend OCTAVE_API std::istream& operator >> (std::istream& is, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
104 ColumnVector& a); |
458 | 105 |
14616
13cc11418393
improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
106 void resize (octave_idx_type n, const double& rfv = 0) |
11574
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
107 { |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
108 Array<double>::resize (dim_vector (n, 1), rfv); |
a83bad07f7e3
attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents:
11570
diff
changeset
|
109 } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
110 |
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
111 void clear (octave_idx_type n) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
112 { Array<double>::clear (n, 1); } |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
113 |
458 | 114 }; |
115 | |
5508 | 116 // Publish externally used friend functions. |
117 | |
6108 | 118 extern OCTAVE_API ColumnVector real (const ComplexColumnVector& a); |
119 extern OCTAVE_API ColumnVector imag (const ComplexColumnVector& a); | |
5508 | 120 |
3573 | 121 MARRAY_FORWARD_DEFS (MArray, ColumnVector, double) |
122 | |
458 | 123 #endif |