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
00024 #if !defined (octave_ColumnVector_h)
00025 #define octave_ColumnVector_h 1
00026
00027 #include "MArray.h"
00028
00029 #include "mx-defs.h"
00030
00031 class
00032 OCTAVE_API
00033 ColumnVector : public MArray<double>
00034 {
00035 public:
00036
00037 ColumnVector (void) : MArray<double> (dim_vector (0, 1)) { }
00038
00039 explicit ColumnVector (octave_idx_type n)
00040 : MArray<double> (dim_vector (n, 1)) { }
00041
00042 explicit ColumnVector (const dim_vector& dv)
00043 : MArray<double> (dv.as_column ()) { }
00044
00045 ColumnVector (octave_idx_type n, double val)
00046 : MArray<double> (dim_vector (n, 1), val) { }
00047
00048 ColumnVector (const ColumnVector& a) : MArray<double> (a) { }
00049
00050 ColumnVector (const MArray<double>& a) : MArray<double> (a.as_column ()) { }
00051 ColumnVector (const Array<double>& a) : MArray<double> (a.as_column ()) { }
00052
00053 ColumnVector& operator = (const ColumnVector& a)
00054 {
00055 MArray<double>::operator = (a);
00056 return *this;
00057 }
00058
00059 bool operator == (const ColumnVector& a) const;
00060 bool operator != (const ColumnVector& a) const;
00061
00062
00063
00064 ColumnVector& insert (const ColumnVector& a, octave_idx_type r);
00065
00066 ColumnVector& fill (double val);
00067 ColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2);
00068
00069 ColumnVector stack (const ColumnVector& a) const;
00070
00071 RowVector transpose (void) const;
00072
00073 friend OCTAVE_API ColumnVector real (const ComplexColumnVector& a);
00074 friend OCTAVE_API ColumnVector imag (const ComplexColumnVector& a);
00075
00076
00077
00078 ColumnVector extract (octave_idx_type r1, octave_idx_type r2) const;
00079
00080 ColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const;
00081
00082
00083
00084 friend OCTAVE_API ColumnVector operator * (const Matrix& a, const ColumnVector& b);
00085
00086
00087
00088 friend OCTAVE_API ColumnVector operator * (const DiagMatrix& a, const ColumnVector& b);
00089
00090
00091
00092 double min (void) const;
00093 double max (void) const;
00094
00095 ColumnVector abs (void) const;
00096
00097
00098
00099 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ColumnVector& a);
00100 friend OCTAVE_API std::istream& operator >> (std::istream& is, ColumnVector& a);
00101
00102 void resize (octave_idx_type n,
00103 const double& rfv = Array<double>::resize_fill_value ())
00104 {
00105 Array<double>::resize (dim_vector (n, 1), rfv);
00106 }
00107
00108 void clear (octave_idx_type n)
00109 { Array<double>::clear (n, 1); }
00110
00111 };
00112
00113
00114
00115 extern OCTAVE_API ColumnVector real (const ComplexColumnVector& a);
00116 extern OCTAVE_API ColumnVector imag (const ComplexColumnVector& a);
00117
00118 MARRAY_FORWARD_DEFS (MArray, ColumnVector, double)
00119
00120 #endif