GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
fRowVector.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_fRowVector_h)
27#define octave_fRowVector_h 1
28
29#include "octave-config.h"
30
31#include "MArray.h"
32#include "mx-defs.h"
33
34class OCTAVE_API FloatRowVector : public MArray<float>
35{
36public:
37
39
41 : MArray<float> (dim_vector (1, n)) { }
42
43 explicit FloatRowVector (const dim_vector& dv)
44 : MArray<float> (dv.as_row ()) { }
45
47 : MArray<float> (dim_vector (1, n), val) { }
48
50
51 FloatRowVector (const MArray<float>& a) : MArray<float> (a.as_row ()) { }
52
53 FloatRowVector (const Array<float>& a) : MArray<float> (a.as_row ()) { }
54
56 {
58 return *this;
59 }
60
61 ~FloatRowVector () = default;
62
63 OCTAVE_API bool operator == (const FloatRowVector& a) const;
64 OCTAVE_API bool operator != (const FloatRowVector& a) const;
65
66 // destructive insert/delete/reorder operations
67
70
71 OCTAVE_API FloatRowVector& fill (float val);
73 fill (float val, octave_idx_type c1, octave_idx_type c2);
74
75 OCTAVE_API FloatRowVector append (const FloatRowVector& a) const;
76
78
81
82 // resize is the destructive equivalent for this one
83
85 extract (octave_idx_type c1, octave_idx_type c2) const;
86
88 extract_n (octave_idx_type c1, octave_idx_type n) const;
89
90 // row vector by matrix -> row vector
91
93 operator * (const FloatRowVector& a, const FloatMatrix& b);
94
95 // other operations
96
97 OCTAVE_API float min () const;
98 OCTAVE_API float max () const;
99
100 // i/o
101
102 friend OCTAVE_API std::ostream&
103 operator << (std::ostream& os, const FloatRowVector& a);
104 friend OCTAVE_API std::istream&
105 operator >> (std::istream& is, FloatRowVector& a);
106
107 void resize (octave_idx_type n, const float& rfv = 0)
108 {
109 Array<float>::resize (dim_vector (1, n), rfv);
110 }
111
113 { Array<float>::clear (1, n); }
114
115};
116
117// row vector by column vector -> scalar
118
120 const FloatColumnVector& b);
121
123 const ComplexColumnVector& b);
124
125// other operations
126
127OCTAVE_API FloatRowVector linspace (float x1, float x2, octave_idx_type n);
128
130
131#endif
template std::ostream & operator<<(std::ostream &, const Array< bool > &)
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition MArray.h:128
MArray< T > operator*(const MArray< T > &, const T &)
Definition MArray.cc:329
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
FloatRowVector(const dim_vector &dv)
Definition fRowVector.h:43
FloatRowVector(const Array< float > &a)
Definition fRowVector.h:53
~FloatRowVector()=default
FloatRowVector(octave_idx_type n)
Definition fRowVector.h:40
void clear(octave_idx_type n)
Definition fRowVector.h:112
FloatRowVector(const FloatRowVector &a)
Definition fRowVector.h:49
FloatRowVector(octave_idx_type n, float val)
Definition fRowVector.h:46
void resize(octave_idx_type n, const float &rfv=0)
Definition fRowVector.h:107
FloatRowVector(const MArray< float > &a)
Definition fRowVector.h:51
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
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
ColumnVector real(const ComplexColumnVector &a)
ColumnVector imag(const ComplexColumnVector &a)
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
FloatRowVector linspace(float x1, float x2, octave_idx_type n)
float operator*(const FloatRowVector &a, const FloatColumnVector &b)
#define OCTAVE_API
Definition main.in.cc:55
std::complex< double > Complex
Definition oct-cmplx.h:33