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