fColVector.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_FloatColumnVector_h)
00025 #define octave_FloatColumnVector_h 1
00026 
00027 #include "MArray.h"
00028 
00029 #include "mx-defs.h"
00030 
00031 class
00032 OCTAVE_API
00033 FloatColumnVector : public MArray<float>
00034 {
00035 public:
00036 
00037   FloatColumnVector (void) : MArray<float> (dim_vector (0, 1)) { }
00038 
00039   explicit FloatColumnVector (octave_idx_type n)
00040     : MArray<float> (dim_vector (n, 1)) { }
00041 
00042   explicit FloatColumnVector (const dim_vector& dv)
00043     : MArray<float> (dv.as_column ()) { }
00044 
00045   FloatColumnVector (octave_idx_type n, float val)
00046     : MArray<float> (dim_vector (n, 1), val) { }
00047 
00048   FloatColumnVector (const FloatColumnVector& a) : MArray<float> (a) { }
00049 
00050   FloatColumnVector (const MArray<float>& a)
00051     : MArray<float> (a.as_column ()) { }
00052 
00053   FloatColumnVector (const Array<float>& a)
00054     : MArray<float> (a.as_column ()) { }
00055 
00056   FloatColumnVector& operator = (const FloatColumnVector& a)
00057     {
00058       MArray<float>::operator = (a);
00059       return *this;
00060     }
00061 
00062   bool operator == (const FloatColumnVector& a) const;
00063   bool operator != (const FloatColumnVector& a) const;
00064 
00065   // destructive insert/delete/reorder operations
00066 
00067   FloatColumnVector& insert (const FloatColumnVector& a, octave_idx_type r);
00068 
00069   FloatColumnVector& fill (float val);
00070   FloatColumnVector& fill (float val, octave_idx_type r1, octave_idx_type r2);
00071 
00072   FloatColumnVector stack (const FloatColumnVector& a) const;
00073 
00074   FloatRowVector transpose (void) const;
00075 
00076   friend OCTAVE_API FloatColumnVector real (const FloatComplexColumnVector& a);
00077   friend OCTAVE_API FloatColumnVector imag (const FloatComplexColumnVector& a);
00078 
00079   // resize is the destructive equivalent for this one
00080 
00081   FloatColumnVector extract (octave_idx_type r1, octave_idx_type r2) const;
00082 
00083   FloatColumnVector extract_n (octave_idx_type r1, octave_idx_type n) const;
00084 
00085   // matrix by column vector -> column vector operations
00086 
00087   friend OCTAVE_API FloatColumnVector operator * (const FloatMatrix& a, const FloatColumnVector& b);
00088 
00089   // diagonal matrix by column vector -> column vector operations
00090 
00091   friend OCTAVE_API FloatColumnVector operator * (const FloatDiagMatrix& a, const FloatColumnVector& b);
00092 
00093   // other operations
00094 
00095   float min (void) const;
00096   float max (void) const;
00097 
00098   FloatColumnVector abs (void) const;
00099 
00100   // i/o
00101 
00102   friend OCTAVE_API std::ostream& operator << (std::ostream& os, const FloatColumnVector& a);
00103   friend OCTAVE_API std::istream& operator >> (std::istream& is, FloatColumnVector& a);
00104 
00105   void resize (octave_idx_type n,
00106                const float& rfv = Array<float>::resize_fill_value ())
00107   {
00108     Array<float>::resize (dim_vector (n, 1), rfv);
00109   }
00110 
00111   void clear (octave_idx_type n)
00112     { Array<float>::clear (n, 1); }
00113 
00114 };
00115 
00116 // Publish externally used friend functions.
00117 
00118 extern OCTAVE_API FloatColumnVector real (const FloatComplexColumnVector& a);
00119 extern OCTAVE_API FloatColumnVector imag (const FloatComplexColumnVector& a);
00120 
00121 MARRAY_FORWARD_DEFS (MArray, FloatColumnVector, float)
00122 
00123 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines