GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fCColVector.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_fCColVector_h)
27 #define octave_fCColVector_h 1
28 
29 #include "octave-config.h"
30 
31 #include "MArray.h"
32 #include "mx-defs.h"
33 
34 class
35 OCTAVE_API
37 {
38  friend class FloatComplexMatrix;
39  friend class FloatComplexRowVector;
40 
41 public:
42 
44  : MArray<FloatComplex> (dim_vector (0, 1)) { }
45 
47  : MArray<FloatComplex> (dim_vector (n, 1)) { }
48 
49  explicit FloatComplexColumnVector (const dim_vector& dv)
50  : MArray<FloatComplex> (dv.as_column ()) { }
51 
53  : MArray<FloatComplex> (dim_vector (n, 1), val) { }
54 
56  : MArray<FloatComplex> (a) { }
57 
59  : MArray<FloatComplex> (a.as_column ()) { }
60 
62  : MArray<FloatComplex> (a.as_column ()) { }
63 
64  explicit FloatComplexColumnVector (const FloatColumnVector& a);
65 
67  {
69  return *this;
70  }
71 
72  bool operator == (const FloatComplexColumnVector& a) const;
73  bool operator != (const FloatComplexColumnVector& a) const;
74 
75  // destructive insert/delete/reorder operations
76 
81 
82  FloatComplexColumnVector& fill (float val);
84  FloatComplexColumnVector& fill (float val,
88 
89  FloatComplexColumnVector stack (const FloatColumnVector& a) const;
91 
92  FloatComplexRowVector hermitian (void) const;
93  FloatComplexRowVector transpose (void) const;
94 
95  friend OCTAVE_API FloatComplexColumnVector
96  conj (const FloatComplexColumnVector& a);
97 
98  // resize is the destructive equivalent for this one
99 
101  octave_idx_type r2) const;
102 
104  octave_idx_type n) const;
105 
106  // column vector by column vector -> column vector operations
107 
110 
111  // matrix by column vector -> column vector operations
112 
113  friend OCTAVE_API FloatComplexColumnVector
115 
116  friend OCTAVE_API FloatComplexColumnVector
118 
119  // matrix by column vector -> column vector operations
120 
121  friend OCTAVE_API FloatComplexColumnVector
123 
124  // diagonal matrix by column vector -> column vector operations
125 
126  friend OCTAVE_API FloatComplexColumnVector
128 
129  friend OCTAVE_API FloatComplexColumnVector
131 
132  friend OCTAVE_API FloatComplexColumnVector
134 
135  // other operations
136 
137  FloatComplex min (void) const;
138  FloatComplex max (void) const;
139 
140  FloatColumnVector abs (void) const;
141 
142  // i/o
143 
144  friend OCTAVE_API std::ostream&
145  operator << (std::ostream& os, const FloatComplexColumnVector& a);
146  friend OCTAVE_API std::istream& operator >> (std::istream& is,
148 
150  {
152  }
153 
155  { Array<FloatComplex>::clear (n, 1); }
156 
157 };
158 
160 
161 #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
Array< T > as_column(void) const
Return the array as a column vector.
Definition: Array.h:381
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
void resize(octave_idx_type n, const FloatComplex &rfv=FloatComplex(0))
Definition: fCColVector.h:149
FloatComplexColumnVector(octave_idx_type n)
Definition: fCColVector.h:46
FloatComplexColumnVector(const MArray< FloatComplex > &a)
Definition: fCColVector.h:58
void clear(octave_idx_type n)
Definition: fCColVector.h:154
FloatComplexColumnVector(const dim_vector &dv)
Definition: fCColVector.h:49
FloatComplexColumnVector(const Array< FloatComplex > &a)
Definition: fCColVector.h:61
FloatComplexColumnVector(const FloatComplexColumnVector &a)
Definition: fCColVector.h:55
FloatComplexColumnVector(octave_idx_type n, const FloatComplex &val)
Definition: fCColVector.h:52
FloatComplexColumnVector hermitian(void) const
Definition: fCRowVector.cc:197
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:67
FloatComplexRowVector & fill(float val)
Definition: fCRowVector.cc:100
FloatComplexRowVector & insert(const FloatRowVector &a, octave_idx_type c)
Definition: fCRowVector.cc:61
FloatComplexRowVector extract_n(octave_idx_type c1, octave_idx_type n) const
Definition: fCRowVector.cc:232
FloatComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: fCRowVector.cc:217
friend class FloatComplexColumnVector
Definition: fCRowVector.h:39
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
FloatComplexColumnVector operator*(const FloatComplexColumnVector &x, const FloatComplex &y)
Definition: fCColVector.h:159
FloatComplexColumnVector operator+=(FloatComplexColumnVector &x, const FloatComplex &y)
Definition: fCColVector.h:159
FloatComplexColumnVector operator-=(FloatComplexColumnVector &x, const FloatComplex &y)
Definition: fCColVector.h:159
octave_idx_type n
Definition: mx-inlines.cc:753
T * r
Definition: mx-inlines.cc:773
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
static T abs(T x)
Definition: pr-output.cc:1678
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