GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
CColVector.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1994-2025 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
34class OCTAVE_API ComplexColumnVector : public MArray<Complex>
35{
36 friend class ComplexMatrix;
37 friend class ComplexRowVector;
38
39public:
40
42
45
46 explicit ComplexColumnVector (const dim_vector& dv)
47 : MArray<Complex> (dv.as_column ()) { }
48
50 : MArray<Complex> (dim_vector (n, 1), val) { }
51
53
55 : MArray<Complex> (a.as_column ()) { }
56
58 : MArray<Complex> (a.as_column ()) { }
59
61
63 {
65 return *this;
66 }
67
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
76 insert (const ColumnVector& a, octave_idx_type r);
78 insert (const ComplexColumnVector& a, octave_idx_type r);
79
80 OCTAVE_API ComplexColumnVector& fill (double val);
81 OCTAVE_API ComplexColumnVector& fill (const Complex& 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;
89
90 OCTAVE_API ComplexRowVector hermitian () const;
91 OCTAVE_API ComplexRowVector transpose () const;
92
94
95 // resize is the destructive equivalent for this one
96
98 extract (octave_idx_type r1, octave_idx_type r2) const;
99
101 extract_n (octave_idx_type r1, octave_idx_type n) const;
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 () const;
135 OCTAVE_API Complex max () const;
136
137 OCTAVE_API ColumnVector abs () 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 {
149 }
150
153
154};
155
157
158#endif
template std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexColumnVector conj(const ComplexColumnVector &a)
ComplexColumnVector operator*(const ComplexMatrix &m, const ColumnVector &a)
ComplexColumnVector operator+=(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:128
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
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
void clear()
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
ComplexColumnVector(octave_idx_type n)
Definition CColVector.h:43
~ComplexColumnVector()=default
ComplexColumnVector(const ComplexColumnVector &a)
Definition CColVector.h:52
void clear(octave_idx_type n)
Definition CColVector.h:151
ComplexColumnVector(octave_idx_type n, const Complex &val)
Definition CColVector.h:49
ComplexColumnVector(const dim_vector &dv)
Definition CColVector.h:46
ComplexColumnVector(const Array< Complex > &a)
Definition CColVector.h:57
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition CColVector.h:146
ComplexColumnVector(const MArray< Complex > &a)
Definition CColVector.h:54
Template for N-dimensional array classes with like-type math operators.
Definition MArray.h:61
MArray< T > & operator=(const MArray< T > &a)
Definition MArray.h:79
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:532
bool operator==(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:516
#define OCTAVE_API
Definition main.in.cc:55
std::complex< double > Complex
Definition oct-cmplx.h:33
template int8_t abs(int8_t)