GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fCRowVector.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1994-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_fCRowVector_h)
27 #define octave_fCRowVector_h 1
28 
29 #include "octave-config.h"
30 
31 #include "MArray.h"
32 #include "fRowVector.h"
33 #include "mx-defs.h"
34 
35 class
36 OCTAVE_API
38 {
40 
41 public:
42 
44  : MArray<FloatComplex> (dim_vector (1, 0)) { }
45 
47  : MArray<FloatComplex> (dim_vector (1, n)) { }
48 
49  explicit FloatComplexRowVector (const dim_vector& dv)
50  : MArray<FloatComplex> (dv.as_row ()) { }
51 
53  : MArray<FloatComplex> (dim_vector (1, n), val) { }
54 
56  : MArray<FloatComplex> (a) { }
57 
59  : MArray<FloatComplex> (a.as_row ()) { }
60 
62  : MArray<FloatComplex> (a.as_row ()) { }
63 
65  : MArray<FloatComplex> (a) { }
66 
68  {
70  return *this;
71  }
72 
73  bool operator == (const FloatComplexRowVector& a) const;
74  bool operator != (const FloatComplexRowVector& a) const;
75 
76  // destructive insert/delete/reorder operations
77 
80  octave_idx_type c);
81 
82  FloatComplexRowVector& fill (float val);
84  FloatComplexRowVector& fill (float val,
88 
89  FloatComplexRowVector append (const FloatRowVector& a) const;
90  FloatComplexRowVector append (const FloatComplexRowVector& a) const;
91 
94 
96 
97  // resize is the destructive equivalent for this one
98 
100 
102 
103  // row vector by row vector -> row vector operations
104 
107 
108  // row vector by matrix -> row vector
109 
111  const FloatComplexMatrix& b);
112 
114  const FloatComplexMatrix& b);
115 
116  // other operations
117 
118  FloatComplex min (void) const;
119  FloatComplex max (void) const;
120 
121  // i/o
122 
123  friend std::ostream& operator << (std::ostream& os,
124  const FloatComplexRowVector& a);
125  friend std::istream& operator >> (std::istream& is,
127 
129  {
131  }
132 
134  { Array<FloatComplex>::clear (1, n); }
135 
136 };
137 
138 // row vector by column vector -> scalar
139 
141  const ColumnVector& b);
142 
144  const FloatComplexColumnVector& b);
145 
146 // other operations
147 
148 OCTAVE_API FloatComplexRowVector linspace (const FloatComplex& x1,
149  const FloatComplex& x2, octave_idx_type n);
150 
152 
153 #endif
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:217
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray.h:128
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:281
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:207
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:128
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Definition: Array.cc:1011
void clear(void)
Definition: Array.cc:87
Array< T > as_row(void) const
Return the array as a row vector.
Definition: Array.h:391
FloatComplexColumnVector extract_n(octave_idx_type r1, octave_idx_type n) const
Definition: fCColVector.cc:242
FloatComplexColumnVector & operator=(const FloatComplexColumnVector &a)
Definition: fCColVector.h:66
FloatComplexRowVector hermitian(void) const
Definition: fCColVector.cc:201
FloatComplexColumnVector & insert(const FloatColumnVector &a, octave_idx_type r)
Definition: fCColVector.cc:64
FloatComplexColumnVector & fill(float val)
Definition: fCColVector.cc:103
FloatComplexColumnVector extract(octave_idx_type r1, octave_idx_type r2) const
Definition: fCColVector.cc:227
void clear(octave_idx_type n)
Definition: fCRowVector.h:133
FloatComplexRowVector(octave_idx_type n)
Definition: fCRowVector.h:46
void resize(octave_idx_type n, const FloatComplex &rfv=FloatComplex(0))
Definition: fCRowVector.h:128
FloatComplexRowVector(const Array< FloatComplex > &a)
Definition: fCRowVector.h:61
FloatComplexRowVector(const FloatComplexRowVector &a)
Definition: fCRowVector.h:55
FloatComplexRowVector(const MArray< FloatComplex > &a)
Definition: fCRowVector.h:58
FloatComplexRowVector(const FloatRowVector &a)
Definition: fCRowVector.h:64
FloatComplexRowVector(octave_idx_type n, const FloatComplex &val)
Definition: fCRowVector.h:52
FloatComplexRowVector(const dim_vector &dv)
Definition: fCRowVector.h:49
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:87
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:95
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:601
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:585
FloatComplexRowVector operator-=(FloatComplexRowVector &x, const FloatComplex &y)
Definition: fCRowVector.h:151
FloatComplex OCTAVE_API operator*(const FloatComplexRowVector &a, const ColumnVector &b)
FloatComplexRowVector operator+=(FloatComplexRowVector &x, const FloatComplex &y)
Definition: fCRowVector.h:151
OCTAVE_API FloatComplexRowVector linspace(const FloatComplex &x1, const FloatComplex &x2, octave_idx_type n)
Definition: fCRowVector.cc:430
octave_idx_type n
Definition: mx-inlines.cc:753
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
Definition: symrcm.cc:389