CmplxSVD.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_ComplexSVD_h)
00024 #define octave_ComplexSVD_h 1
00025 
00026 #include <iosfwd>
00027 
00028 #include "dDiagMatrix.h"
00029 #include "CMatrix.h"
00030 #include "dbleSVD.h"
00031 
00032 class
00033 OCTAVE_API
00034 ComplexSVD
00035 {
00036 public:
00037 
00038   ComplexSVD (void)
00039     : type_computed (), sigma (), left_sm (), right_sm ()
00040     { }
00041 
00042   ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std,
00043               SVD::driver svd_driver = SVD::GESVD)
00044     : type_computed (), sigma (), left_sm (), right_sm ()
00045     {
00046       init (a, svd_type, svd_driver);
00047     }
00048 
00049   ComplexSVD (const ComplexMatrix& a, octave_idx_type& info,
00050               SVD::type svd_type = SVD::std,
00051               SVD::driver svd_driver = SVD::GESVD)
00052     : type_computed (), sigma (), left_sm (), right_sm ()
00053     {
00054       info = init (a, svd_type, svd_driver);
00055     }
00056 
00057   ComplexSVD (const ComplexSVD& a)
00058     : type_computed (a.type_computed), sigma (a.sigma),
00059       left_sm (a.left_sm), right_sm (a.right_sm)
00060     { }
00061 
00062   ComplexSVD& operator = (const ComplexSVD& a)
00063     {
00064       if (this != &a)
00065         {
00066           type_computed = a.type_computed;
00067           sigma = a.sigma;
00068           left_sm = a.left_sm;
00069           right_sm = a.right_sm;
00070         }
00071       return *this;
00072     }
00073 
00074   ~ComplexSVD (void) { }
00075 
00076   DiagMatrix singular_values (void) const { return sigma; }
00077 
00078   ComplexMatrix left_singular_matrix (void) const;
00079 
00080   ComplexMatrix right_singular_matrix (void) const;
00081 
00082   friend std::ostream&  operator << (std::ostream& os, const ComplexSVD& a);
00083 
00084 private:
00085 
00086   SVD::type type_computed;
00087 
00088   DiagMatrix sigma;
00089   ComplexMatrix left_sm;
00090   ComplexMatrix right_sm;
00091 
00092   octave_idx_type init (const ComplexMatrix& a,
00093                         SVD::type svd_type = SVD::std,
00094                         SVD::driver svd_driver = SVD::GESVD);
00095 };
00096 
00097 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines