Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_RowVector_h)
00024 #define octave_RowVector_h 1
00025
00026 #include "MArray.h"
00027
00028 #include "mx-defs.h"
00029
00030 class
00031 OCTAVE_API
00032 RowVector : public MArray<double>
00033 {
00034 public:
00035
00036 RowVector (void) : MArray<double> (dim_vector (1, 0)) { }
00037
00038 explicit RowVector (octave_idx_type n)
00039 : MArray<double> (dim_vector (1, n)) { }
00040
00041 explicit RowVector (const dim_vector& dv) : MArray<double> (dv.as_row ()) { }
00042
00043 RowVector (octave_idx_type n, double val)
00044 : MArray<double> (dim_vector (1, n), val) { }
00045
00046 RowVector (const RowVector& a) : MArray<double> (a) { }
00047
00048 RowVector (const MArray<double>& a) : MArray<double> (a.as_row ()) { }
00049
00050 RowVector (const Array<double>& a) : MArray<double> (a.as_row ()) { }
00051
00052 RowVector& operator = (const RowVector& a)
00053 {
00054 MArray<double>::operator = (a);
00055 return *this;
00056 }
00057
00058 bool operator == (const RowVector& a) const;
00059 bool operator != (const RowVector& a) const;
00060
00061
00062
00063 RowVector& insert (const RowVector& a, octave_idx_type c);
00064
00065 RowVector& fill (double val);
00066 RowVector& fill (double val, octave_idx_type c1, octave_idx_type c2);
00067
00068 RowVector append (const RowVector& a) const;
00069
00070 ColumnVector transpose (void) const;
00071
00072 friend OCTAVE_API RowVector real (const ComplexRowVector& a);
00073 friend OCTAVE_API RowVector imag (const ComplexRowVector& a);
00074
00075
00076
00077 RowVector extract (octave_idx_type c1, octave_idx_type c2) const;
00078
00079 RowVector extract_n (octave_idx_type c1, octave_idx_type n) const;
00080
00081
00082
00083 friend OCTAVE_API RowVector operator * (const RowVector& a, const Matrix& b);
00084
00085
00086
00087 double min (void) const;
00088 double max (void) const;
00089
00090
00091
00092 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const RowVector& a);
00093 friend OCTAVE_API std::istream& operator >> (std::istream& is, RowVector& a);
00094
00095 void resize (octave_idx_type n,
00096 const double& rfv = Array<double>::resize_fill_value ())
00097 {
00098 Array<double>::resize (dim_vector (1, n), rfv);
00099 }
00100
00101 void clear (octave_idx_type n)
00102 { Array<double>::clear (1, n); }
00103
00104 };
00105
00106
00107
00108 double OCTAVE_API operator * (const RowVector& a, const ColumnVector& b);
00109
00110 Complex OCTAVE_API operator * (const RowVector& a, const ComplexColumnVector& b);
00111
00112
00113
00114 OCTAVE_API RowVector linspace (double x1, double x2, octave_idx_type n);
00115
00116 MARRAY_FORWARD_DEFS (MArray, RowVector, double)
00117
00118 #endif