annotate liboctave/array/dRowVector.h @ 33634:4a70f390c85e default tip @

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 28 May 2024 15:25:54 +0200
parents 4b601ca024d5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31855
diff changeset
3 // Copyright (C) 1994-2024 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #if ! defined (octave_dRowVector_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17769
diff changeset
27 #define octave_dRowVector_h 1
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
30
1214
0bf4d2b7def4 [project @ 1995-04-06 02:33:59 by jwe]
jwe
parents: 1205
diff changeset
31 #include "MArray.h"
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
32 #include "mx-defs.h"
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
33
32628
ae4e19c0a2b1 maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents: 31855
diff changeset
34 class OCTAVE_API RowVector : public MArray<double>
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
35 {
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
36 public:
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
37
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
38 RowVector () : MArray<double> (dim_vector (1, 0)) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
39
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
40 explicit RowVector (octave_idx_type n)
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
41 : MArray<double> (dim_vector (1, n)) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
42
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
43 explicit RowVector (const dim_vector& dv) : MArray<double> (dv.as_row ()) { }
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 RowVector (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 (1, n), val) { }
3585
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
47
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
48 RowVector (const RowVector& a) : MArray<double> (a) { }
d9803711e047 [project @ 2000-02-08 04:35:39 by jwe]
jwe
parents: 3580
diff changeset
49
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
50 RowVector (const MArray<double>& a) : MArray<double> (a.as_row ()) { }
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
51
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
52 RowVector (const Array<double>& a) : MArray<double> (a.as_row ()) { }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
53
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
54 RowVector& operator = (const RowVector& a)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
55 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 MArray<double>::operator = (a);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
58 }
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
59
31855
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31771
diff changeset
60 ~RowVector () = default;
1daf8bfceac3 default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents: 31771
diff changeset
61
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
62 OCTAVE_API bool operator == (const RowVector& a) const;
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
63 OCTAVE_API bool operator != (const RowVector& a) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
64
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
65 // destructive insert/delete/reorder operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
66
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
67 OCTAVE_API RowVector& insert (const RowVector& a, octave_idx_type c);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
68
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
69 OCTAVE_API RowVector& fill (double val);
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
70 OCTAVE_API RowVector& fill (double val, octave_idx_type c1, octave_idx_type c2);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
71
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
72 OCTAVE_API RowVector append (const RowVector& a) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
73
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
74 OCTAVE_API ColumnVector transpose () const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
75
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
76 friend OCTAVE_API RowVector real (const ComplexRowVector& a);
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
77 friend OCTAVE_API RowVector imag (const ComplexRowVector& a);
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
78
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
79 // resize is the destructive equivalent for this one
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
80
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
81 OCTAVE_API RowVector extract (octave_idx_type c1, octave_idx_type c2) const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
82
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
83 OCTAVE_API RowVector extract_n (octave_idx_type c1, octave_idx_type n) const;
4316
236c10efcde2 [project @ 2003-02-10 21:57:15 by jwe]
jwe
parents: 4192
diff changeset
84
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
85 // row vector by matrix -> row vector
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
86
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
87 friend OCTAVE_API RowVector operator * (const RowVector& a, const Matrix& b);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
88
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
89 // other operations
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
90
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
91 OCTAVE_API double min () const;
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
92 OCTAVE_API double max () const;
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
93
1359
a6994c934a50 [project @ 1995-09-05 21:30:26 by jwe]
jwe
parents: 1315
diff changeset
94 // i/o
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
95
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
96 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
97 const RowVector& a);
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
98 friend OCTAVE_API std::istream& operator >> (std::istream& is, RowVector& a);
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
99
14616
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
100 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
101 {
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
102 Array<double>::resize (dim_vector (1, n), rfv);
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
103 }
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
104
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
105 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
106 { Array<double>::clear (1, n); }
10350
12884915a8e4 merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10158
diff changeset
107
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
108 };
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
109
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
110 // row vector by column vector -> scalar
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
111
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
112 OCTAVE_API double operator * (const RowVector& a, const ColumnVector& b);
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
113
29646
3e8bc8bee8e9 liboctave/array: Add visibility flags to functions declared in headers (bug #60567).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
114 OCTAVE_API Complex operator * (const RowVector& a,
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
115 const ComplexColumnVector& b);
1205
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
116
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
117 // other operations
8302fab9fe24 [project @ 1995-04-04 02:05:01 by jwe]
jwe
parents: 1196
diff changeset
118
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
119 OCTAVE_API RowVector linspace (double x1, double x2, octave_idx_type n);
1196
c01e881ccbb1 [project @ 1995-03-31 17:12:19 by jwe]
jwe
parents: 1195
diff changeset
120
3573
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
121 MARRAY_FORWARD_DEFS (MArray, RowVector, double)
6ae6f1180e62 [project @ 2000-02-04 09:01:59 by jwe]
jwe
parents: 3504
diff changeset
122
458
38cb88095913 [project @ 1994-06-06 00:41:10 by jwe]
jwe
parents:
diff changeset
123 #endif