CColVector.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1994-2012 John W. Eaton
00004 Copyright (C) 2010 VZLU Prague
00005 
00006 This file is part of Octave.
00007 
00008 Octave is free software; you can redistribute it and/or modify it
00009 under the terms of the GNU General Public License as published by the
00010 Free Software Foundation; either version 3 of the License, or (at your
00011 option) any later version.
00012 
00013 Octave is distributed in the hope that it will be useful, but WITHOUT
00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00015 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00016 for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with Octave; see the file COPYING.  If not, see
00020 <http://www.gnu.org/licenses/>.
00021 
00022 */
00023 
00024 #if !defined (octave_ComplexColumnVector_h)
00025 #define octave_ComplexColumnVector_h 1
00026 
00027 #include "MArray.h"
00028 
00029 #include "mx-defs.h"
00030 
00031 class
00032 OCTAVE_API
00033 ComplexColumnVector : public MArray<Complex>
00034 {
00035 friend class ComplexMatrix;
00036 friend class ComplexRowVector;
00037 
00038 public:
00039 
00040   ComplexColumnVector (void) : MArray<Complex> (dim_vector (0, 1)) { }
00041 
00042   explicit ComplexColumnVector (octave_idx_type n)
00043     : MArray<Complex> (dim_vector (n, 1)) { }
00044 
00045   explicit ComplexColumnVector (const dim_vector& dv)
00046     : MArray<Complex> (dv.as_column ()) { }
00047 
00048   ComplexColumnVector (octave_idx_type n, const Complex& val)
00049     : MArray<Complex> (dim_vector (n, 1), val) { }
00050 
00051   ComplexColumnVector (const ComplexColumnVector& a) : MArray<Complex> (a) { }
00052 
00053   ComplexColumnVector (const MArray<Complex>& a)
00054     : MArray<Complex> (a.as_column ()) { }
00055 
00056   ComplexColumnVector (const Array<Complex>& a)
00057     : MArray<Complex> (a.as_column ()) { }
00058 
00059   explicit ComplexColumnVector (const ColumnVector& a);
00060 
00061   ComplexColumnVector& operator = (const ComplexColumnVector& a)
00062     {
00063       MArray<Complex>::operator = (a);
00064       return *this;
00065     }
00066 
00067   bool operator == (const ComplexColumnVector& a) const;
00068   bool operator != (const ComplexColumnVector& a) const;
00069 
00070   // destructive insert/delete/reorder operations
00071 
00072   ComplexColumnVector& insert (const ColumnVector& a, octave_idx_type r);
00073   ComplexColumnVector& insert (const ComplexColumnVector& a, octave_idx_type r);
00074 
00075   ComplexColumnVector& fill (double val);
00076   ComplexColumnVector& fill (const Complex& val);
00077   ComplexColumnVector& fill (double val, octave_idx_type r1, octave_idx_type r2);
00078   ComplexColumnVector& fill (const Complex& val, octave_idx_type r1, octave_idx_type r2);
00079 
00080   ComplexColumnVector stack (const ColumnVector& a) const;
00081   ComplexColumnVector stack (const ComplexColumnVector& a) const;
00082 
00083   ComplexRowVector hermitian (void) const;
00084   ComplexRowVector transpose (void) const;
00085 
00086   friend OCTAVE_API ComplexColumnVector conj (const ComplexColumnVector& a);
00087 
00088   // resize is the destructive equivalent for this one
00089 
00090   ComplexColumnVector extract (octave_idx_type r1, octave_idx_type r2) const;
00091 
00092   ComplexColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const;
00093 
00094   // column vector by column vector -> column vector operations
00095 
00096   ComplexColumnVector& operator += (const ColumnVector& a);
00097   ComplexColumnVector& operator -= (const ColumnVector& a);
00098 
00099   // matrix by column vector -> column vector operations
00100 
00101   friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
00102                                          const ColumnVector& b);
00103 
00104   friend OCTAVE_API ComplexColumnVector operator * (const ComplexMatrix& a,
00105                                          const ComplexColumnVector& b);
00106 
00107   // matrix by column vector -> column vector operations
00108 
00109   friend OCTAVE_API ComplexColumnVector operator * (const Matrix& a,
00110                                          const ComplexColumnVector& b);
00111 
00112   // diagonal matrix by column vector -> column vector operations
00113 
00114   friend OCTAVE_API ComplexColumnVector operator * (const DiagMatrix& a,
00115                                          const ComplexColumnVector& b);
00116 
00117   friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
00118                                          const ColumnVector& b);
00119 
00120   friend OCTAVE_API ComplexColumnVector operator * (const ComplexDiagMatrix& a,
00121                                          const ComplexColumnVector& b);
00122 
00123   // other operations
00124 
00125   Complex min (void) const;
00126   Complex max (void) const;
00127 
00128   ColumnVector abs (void) const;
00129 
00130   // i/o
00131 
00132   friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ComplexColumnVector& a);
00133   friend OCTAVE_API std::istream& operator >> (std::istream& is, ComplexColumnVector& a);
00134 
00135   void resize (octave_idx_type n,
00136                const Complex& rfv = Array<Complex>::resize_fill_value ())
00137   {
00138     Array<Complex>::resize (dim_vector (n, 1), rfv);
00139   }
00140 
00141   void clear (octave_idx_type n)
00142     { Array<Complex>::clear (n, 1); }
00143 
00144 };
00145 
00146 MARRAY_FORWARD_DEFS (MArray, ComplexColumnVector, Complex)
00147 
00148 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines