fCRowVector.h

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