GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
CColVector.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1994-2023 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_CColVector_h)
27 #define octave_CColVector_h 1
28 
29 #include "octave-config.h"
30 
31 #include "MArray.h"
32 #include "mx-defs.h"
33 
34 class
37 {
38  friend class ComplexMatrix;
39  friend class ComplexRowVector;
40 
41 public:
42 
44 
46  : MArray<Complex> (dim_vector (n, 1)) { }
47 
48  explicit ComplexColumnVector (const dim_vector& dv)
49  : MArray<Complex> (dv.as_column ()) { }
50 
52  : MArray<Complex> (dim_vector (n, 1), val) { }
53 
55 
57  : MArray<Complex> (a.as_column ()) { }
58 
60  : MArray<Complex> (a.as_column ()) { }
61 
62  explicit OCTAVE_API ComplexColumnVector (const ColumnVector& a);
63 
65  {
67  return *this;
68  }
69 
70  OCTAVE_API bool operator == (const ComplexColumnVector& a) const;
71  OCTAVE_API bool operator != (const ComplexColumnVector& a) const;
72 
73  // destructive insert/delete/reorder operations
74 
79 
80  OCTAVE_API ComplexColumnVector& fill (double val);
83  fill (double val, octave_idx_type r1, octave_idx_type r2);
85  fill (const Complex& val, octave_idx_type r1, octave_idx_type r2);
86 
87  OCTAVE_API ComplexColumnVector stack (const ColumnVector& a) const;
88  OCTAVE_API ComplexColumnVector stack (const ComplexColumnVector& a) const;
89 
92 
94 
95  // resize is the destructive equivalent for this one
96 
99 
102 
103  // column vector by column vector -> column vector operations
104 
107 
108  // matrix by column vector -> column vector operations
109 
111  const ColumnVector& b);
112 
114  const ComplexColumnVector& b);
115 
116  // matrix by column vector -> column vector operations
117 
119  const ComplexColumnVector& b);
120 
121  // diagonal matrix by column vector -> column vector operations
122 
124  const ComplexColumnVector& b);
125 
127  const ColumnVector& b);
128 
130  const ComplexColumnVector& b);
131 
132  // other operations
133 
134  OCTAVE_API Complex min (void) const;
135  OCTAVE_API Complex max (void) const;
136 
137  OCTAVE_API ColumnVector abs (void) const;
138 
139  // i/o
140 
141  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
142  const ComplexColumnVector& a);
143  friend OCTAVE_API std::istream& operator >> (std::istream& is,
145 
146  void resize (octave_idx_type n, const Complex& rfv = Complex (0))
147  {
148  Array<Complex>::resize (dim_vector (n, 1), rfv);
149  }
150 
152  { Array<Complex>::clear (n, 1); }
153 
154 };
155 
157 
158 #endif
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:217
ComplexColumnVector operator+=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:156
ComplexColumnVector operator*(const ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:156
ComplexColumnVector operator-=(ComplexColumnVector &x, const Complex &y)
Definition: CColVector.h:156
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray.h:130
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
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:130
OCTARRAY_API void clear(void)
Definition: Array-base.cc:109
OCTARRAY_OVERRIDABLE_FUNC_API Array< T, Alloc > as_column(void) const
Return the array as a column vector.
Definition: Array.h:420
OCTARRAY_API void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
Definition: Array-base.cc:1032
ComplexColumnVector(octave_idx_type n)
Definition: CColVector.h:45
ComplexColumnVector(const ComplexColumnVector &a)
Definition: CColVector.h:54
void clear(octave_idx_type n)
Definition: CColVector.h:151
ComplexColumnVector(octave_idx_type n, const Complex &val)
Definition: CColVector.h:51
ComplexColumnVector(void)
Definition: CColVector.h:43
ComplexColumnVector(const dim_vector &dv)
Definition: CColVector.h:48
ComplexColumnVector(const Array< Complex > &a)
Definition: CColVector.h:59
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition: CColVector.h:146
ComplexColumnVector(const MArray< Complex > &a)
Definition: CColVector.h:56
OCTAVE_API ComplexRowVector extract(octave_idx_type c1, octave_idx_type c2) const
Definition: CRowVector.cc:216
ComplexRowVector & operator=(const ComplexRowVector &a)
Definition: CRowVector.h:63
OCTAVE_API ComplexRowVector extract_n(octave_idx_type c1, octave_idx_type n) const
Definition: CRowVector.cc:231
OCTAVE_API ComplexRowVector & fill(double val)
Definition: CRowVector.cc:99
OCTAVE_API ComplexColumnVector hermitian(void) const
Definition: CRowVector.cc:196
OCTAVE_API ComplexRowVector & insert(const RowVector &a, octave_idx_type c)
Definition: CRowVector.cc:61
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:81
Definition: dMatrix.h:42
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:536
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:520
#define OCTAVE_API
Definition: main.in.cc:55
class OCTAVE_API ComplexColumnVector
Definition: mx-fwd.h:46
octave_idx_type n
Definition: mx-inlines.cc:753
T * r
Definition: mx-inlines.cc:773
std::complex< double > Complex
Definition: oct-cmplx.h:33
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:391