QGpCoreTools/ComplexMatrix.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpCoreTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2008-07-15
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef COMPLEXMATRIX_H
00029 #define COMPLEXMATRIX_H
00030 
00031 #include "Matrix.h"
00032 #include "MatrixIterator.h"
00033 #include "Complex.h"
00034 #include "QGpCoreToolsDLLExport.h"
00035 
00036 namespace QGpCoreTools {
00037 
00038 class QGPCORETOOLS_EXPORT ComplexMatrix: public Matrix<Complex>
00039 {
00040 public:
00041   ComplexMatrix() : Matrix<Complex>() {}
00042   ComplexMatrix(int ndim) : Matrix<Complex>(ndim, ndim) {}
00043   ComplexMatrix(int nrow, int ncol) : Matrix<Complex>(nrow, ncol) {}
00044   ComplexMatrix(const Matrix<Complex> m) : Matrix<Complex>(m) {}
00045   ComplexMatrix(const ComplexMatrix& m) : Matrix<Complex>(m) {}
00046 
00047   inline ComplexMatrix conjugate() const;
00048 };
00049 
00050 inline ComplexMatrix ComplexMatrix::conjugate() const
00051 {
00052   ComplexMatrix r(rowCount(),columnCount());
00053   MatrixIterator<Complex> itThis(*this);
00054   MutableMatrixIterator<Complex> itR(r);
00055   while(itThis.hasNext()) {
00056     itThis.next();
00057     itR.next();
00058     *itR=QGpCoreTools::conjugate(*itThis);
00059   }
00060   return r;
00061 }
00062 
00063 QGPCORETOOLS_EXPORT QTextStream& operator<<(QTextStream& s, const ComplexMatrix& m);
00064 
00065 } // namespace QGpCoreTools
00066 
00067 #endif // COMPLEXMATRIX_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines