GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
fColVector.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_fColVector_h)
27#define octave_fColVector_h 1
28
29#include "octave-config.h"
30
31#include "MArray.h"
32#include "mx-defs.h"
33
34class OCTAVE_API FloatColumnVector : public MArray<float>
35{
36public:
37
39
41 : MArray<float> (dim_vector (n, 1)) { }
42
43 explicit FloatColumnVector (const dim_vector& dv)
44 : MArray<float> (dv.as_column ()) { }
45
47 : MArray<float> (dim_vector (n, 1), val) { }
48
50
52 : MArray<float> (a.as_column ()) { }
53
55 : MArray<float> (a.as_column ()) { }
56
58 {
60 return *this;
61 }
62
63 ~FloatColumnVector () = default;
64
65 OCTAVE_API bool operator == (const FloatColumnVector& a) const;
66 OCTAVE_API bool operator != (const FloatColumnVector& a) const;
67
68 // destructive insert/delete/reorder operations
69
72
75 fill (float val, octave_idx_type r1, octave_idx_type r2);
76
77 OCTAVE_API FloatColumnVector stack (const FloatColumnVector& a) const;
78
80
83
84 // resize is the destructive equivalent for this one
85
87 extract (octave_idx_type r1, octave_idx_type r2) const;
88
90 extract_n (octave_idx_type r1, octave_idx_type n) const;
91
92 // matrix by column vector -> column vector operations
93
95 operator * (const FloatMatrix& a, const FloatColumnVector& b);
96
97 // diagonal matrix by column vector -> column vector operations
98
101
102 // other operations
103
104 OCTAVE_API float min () const;
105 OCTAVE_API float max () const;
106
108
109 // i/o
110
111 friend OCTAVE_API std::ostream&
112 operator << (std::ostream& os, const FloatColumnVector& a);
113 friend OCTAVE_API std::istream&
114 operator >> (std::istream& is, FloatColumnVector& a);
115
116 void resize (octave_idx_type n, const float& rfv = 0)
117 {
118 Array<float>::resize (dim_vector (n, 1), rfv);
119 }
120
122 { Array<float>::clear (n, 1); }
123
124};
125
126// Publish externally used friend functions.
127
130
132
133#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
~FloatColumnVector()=default
FloatColumnVector(octave_idx_type n)
Definition fColVector.h:40
void clear(octave_idx_type n)
Definition fColVector.h:121
FloatColumnVector(octave_idx_type n, float val)
Definition fColVector.h:46
FloatColumnVector(const FloatColumnVector &a)
Definition fColVector.h:49
void resize(octave_idx_type n, const float &rfv=0)
Definition fColVector.h:116
FloatColumnVector(const MArray< float > &a)
Definition fColVector.h:51
FloatColumnVector(const Array< float > &a)
Definition fColVector.h:54
FloatColumnVector(const dim_vector &dv)
Definition fColVector.h:43
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
FloatColumnVector real(const FloatComplexColumnVector &a)
FloatColumnVector imag(const FloatComplexColumnVector &a)
#define OCTAVE_API
Definition main.in.cc:55
template int8_t abs(int8_t)