GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
CRowVector.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_CRowVector_h)
27#define octave_CRowVector_h 1
28
29#include "octave-config.h"
30
31#include "MArray.h"
32#include "dRowVector.h"
33#include "mx-defs.h"
34
35class OCTAVE_API ComplexRowVector : public MArray<Complex>
36{
37 friend class ComplexColumnVector;
38
39public:
40
42
44 : MArray<Complex> (dim_vector (1, n)) { }
45
46 explicit ComplexRowVector (const dim_vector& dv) : MArray<Complex> (dv) { }
47
49 : MArray<Complex> (dim_vector (1, n), val) { }
50
52
54 : MArray<Complex> (a.as_row ()) { }
55
57 : MArray<Complex> (a.as_row ()) { }
58
59 explicit ComplexRowVector (const RowVector& a) : MArray<Complex> (a) { }
60
62 {
64 return *this;
65 }
66
67 ~ComplexRowVector () = default;
68
69 OCTAVE_API bool operator == (const ComplexRowVector& a) const;
70 OCTAVE_API bool operator != (const ComplexRowVector& a) const;
71
72 // destructive insert/delete/reorder operations
73
75 insert (const RowVector& a, octave_idx_type c);
78
79 OCTAVE_API ComplexRowVector& fill (double val);
82 fill (double val, octave_idx_type c1, octave_idx_type c2);
84 fill (const Complex& val, octave_idx_type c1, octave_idx_type c2);
85
86 OCTAVE_API ComplexRowVector append (const RowVector& a) const;
87 OCTAVE_API ComplexRowVector append (const ComplexRowVector& a) const;
88
91
93
94 // resize is the destructive equivalent for this one
95
97 extract (octave_idx_type c1, octave_idx_type c2) const;
98
100 extract_n (octave_idx_type c1, octave_idx_type n) const;
101
102 // row vector by row vector -> row vector operations
103
106
107 // row vector by matrix -> row vector
108
110 operator * (const ComplexRowVector& a, const ComplexMatrix& b);
111
113 operator * (const RowVector& a, const ComplexMatrix& b);
114
115 // other operations
116
117 OCTAVE_API Complex min () const;
118 OCTAVE_API Complex max () const;
119
120 // i/o
121
122 friend OCTAVE_API std::ostream&
123 operator << (std::ostream& os, const ComplexRowVector& a);
124 friend OCTAVE_API std::istream&
125 operator >> (std::istream& is, ComplexRowVector& a);
126
127 void resize (octave_idx_type n, const Complex& rfv = Complex (0))
128 {
130 }
131
134
135};
136
137// row vector by column vector -> scalar
138
140 const ColumnVector& b);
141
143 const ComplexColumnVector& b);
144
145// other operations
146
149
151
152#endif
template std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexColumnVector conj(const ComplexColumnVector &a)
ComplexRowVector linspace(const Complex &x1, const Complex &x2, octave_idx_type n)
Complex operator*(const ComplexRowVector &a, const ColumnVector &b)
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition MArray.h:128
MArray< T > operator*(const MArray< T > &, const T &)
Definition MArray.cc:329
MArray< T > & operator-=(MArray< T > &, const T &)
Definition MArray.cc:240
MArray< T > & operator+=(MArray< T > &, const T &)
Definition MArray.cc:229
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.
Array< T, Alloc > & insert(const Array< T, Alloc > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
void fill(const T &val)
Definition Array-base.cc:96
ComplexRowVector(octave_idx_type n)
Definition CRowVector.h:43
ComplexRowVector(const ComplexRowVector &a)
Definition CRowVector.h:51
void resize(octave_idx_type n, const Complex &rfv=Complex(0))
Definition CRowVector.h:127
void clear(octave_idx_type n)
Definition CRowVector.h:132
ComplexRowVector(const Array< Complex > &a)
Definition CRowVector.h:56
ComplexRowVector(const RowVector &a)
Definition CRowVector.h:59
ComplexRowVector(const dim_vector &dv)
Definition CRowVector.h:46
ComplexRowVector(const MArray< Complex > &a)
Definition CRowVector.h:53
ComplexRowVector(octave_idx_type n, const Complex &val)
Definition CRowVector.h:48
~ComplexRowVector()=default
Template for N-dimensional array classes with like-type math operators.
Definition MArray.h:61
MArray< T > transpose() const
Definition MArray.h:97
MArray< T > & operator=(const MArray< T > &a)
Definition MArray.h:79
MArray< T > hermitian(T(*fcn)(const T &)=nullptr) const
Definition MArray.h:100
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