/usr/include/openturns/ComplexMatrix.hxx is in libopenturns-dev 1.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | // -*- C++ -*-
/**
* @file ComplexMatrix.hxx
* @brief ComplexMatrix implements the classical mathematical matrix with complex values
*
* Copyright (C) 2005-2013 EDF-EADS-Phimeca
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* @author schueller
* @date 2012-04-18 17:56:46 +0200 (Wed, 18 Apr 2012)
*/
#ifndef OPENTURNS_COMPLEXMATRIX_HXX
#define OPENTURNS_COMPLEXMATRIX_HXX
#include "ComplexMatrixImplementation.hxx"
#include "TypedInterfaceObject.hxx"
#include "Matrix.hxx"
#include "SymmetricMatrix.hxx"
#include "IdentityMatrix.hxx"
#include "NumericalPoint.hxx"
BEGIN_NAMESPACE_OPENTURNS
class HermitianMatrix;
class TriangularComplexMatrix;
/**
* @class ComplexMatrix
*
* ComplexMatrix implements the classical mathematical matrix with complex values
*/
class ComplexMatrix :
public TypedInterfaceObject<ComplexMatrixImplementation>
{
CLASSNAME;
#ifndef SWIG
/** Declaration of friend operators */
friend ComplexMatrix operator * (const NumericalComplex s,
const ComplexMatrix & m);
#endif
public:
typedef Collection<NumericalComplex> NumericalComplexCollection;
typedef Collection<NumericalScalar> NumericalScalarCollection;
typedef TypedInterfaceObject<ComplexMatrixImplementation>::Implementation Implementation ;
/** Default constructor */
ComplexMatrix();
/** Constructor with implementation */
ComplexMatrix(const Implementation & i);
/** Constructor with implementation */
ComplexMatrix(const ComplexMatrixImplementation & i);
/** Constructor with size (rowDim and colDim) */
ComplexMatrix(const UnsignedLong rowDim,
const UnsignedLong colDim);
/** Constructor from range of external collection */
template <class InputIterator>
ComplexMatrix(const UnsignedLong rowDim,
const UnsignedLong colDim,
const InputIterator first,
const InputIterator last);
/** Constructor from external collection */
/** If the dimensions of the matrix and of the collection */
/** do not correspond, either the collection is truncated */
/** or the rest of the matrix is filled with zeros */
ComplexMatrix(const UnsignedLong rowDim,
const UnsignedLong colDim,
const NumericalComplexCollection & elementsValues);
/** Constructor from external collection */
/** If the dimensions of the matrix and of the collection */
/** do not correspond, either the collection is truncated */
/** or the rest of the matrix is filled with zeros */
ComplexMatrix(const UnsignedLong rowDim,
const UnsignedLong colDim,
const NumericalScalarCollection & elementsValues);
/** Set small elements to zero */
virtual ComplexMatrix clean(const NumericalScalar threshold) const;
/** String converter */
virtual String __repr__() const;
virtual String __str__(const String & offset = "") const;
#ifndef SWIG
/** Operator () gives access to the elements of the matrix (to modify these elements) */
/** The element of the matrix is designated by its row number i and its column number j */
NumericalComplex & operator () (const UnsignedLong i,
const UnsignedLong j);
/** Operator () gives access to the elements of the matrix (read only) */
/** The element of the matrix is designated by its row number i and its column number j */
const NumericalComplex & operator () (const UnsignedLong i,
const UnsignedLong j) const;
#endif
/** Get the dimensions of the matrix */
/** Number of rows */
const UnsignedLong getNbRows() const ;
/** Number of columns */
const UnsignedLong getNbColumns() const ;
/** ComplexMatrix transpose */
ComplexMatrix transpose () const ;
/** ComplexMatrix conjugate */
ComplexMatrix conjugate () const ;
/** ComplexMatrix conjugate and transpose */
ComplexMatrix conjugateTranspose () const ;
/** Get the real part of the matrix */
Matrix real() const;
/** Get the imaginary part of the matrix */
Matrix imag() const;
/** ComplexMatrix additions (must have the same dimensions) */
ComplexMatrix operator + (const ComplexMatrix & m) const;
/** ComplexMatrix additions with Matrix */
ComplexMatrix operator + (const Matrix & m) const;
/** ComplexMatrix substractions (must have the same dimensions) */
ComplexMatrix operator - (const ComplexMatrix & m) const;
/** ComplexMatrix substractions with Matrix */
ComplexMatrix operator - (const Matrix & m) const;
/** ComplexMatrix multiplications (must have consistent dimensions) */
ComplexMatrix operator * (const ComplexMatrix & m) const;
/** ComplexMatrix multiplications with Hermitian Matrix */
ComplexMatrix operator * (const HermitianMatrix & m) const;
/** ComplexMatrix multiplications with Triangular Matrix */
ComplexMatrix operator * (const TriangularComplexMatrix & m) const;
/** ComplexMatrix multiplication with Matrix argument */
virtual ComplexMatrix operator * (const Matrix & m) const;
/** ComplexMatrix multiplication with SymmetricMatrix argument */
ComplexMatrix operator * (const SymmetricMatrix & m) const;
/** ComplexMatrix multiplication with IdentityMatrix argument */
ComplexMatrix operator * (const IdentityMatrix & m) const;
/** Multiplication with a NumericalPoint */
virtual NumericalComplexCollection operator* (const NumericalPoint & point) const;
/** Multiplication with a NumericalScalarCollection */
virtual NumericalComplexCollection operator* (const NumericalScalarCollection & collection) const;
/** Multiplication with a NumericalComplexCollection (must have consistent dimensions) */
virtual NumericalComplexCollection operator* (const NumericalComplexCollection & collection) const;
/** Multiplication with a NumericalComplex */
ComplexMatrix operator * (const NumericalComplex s) const ;
/** Division by a NumericalComplex*/
ComplexMatrix operator / (const NumericalComplex s) const ;
/** Comparison operators */
Bool operator == (const ComplexMatrix & rhs) const ;
/** Empty returns true if there is no element in the matrix */
const Bool isEmpty() const;
// These functions are only intended to be used by SWIG, DO NOT use them for your own purpose !
// INTENTIONALY NOT DOCUMENTED
const NumericalComplex * __baseaddress__ () const;
UnsignedLong __elementsize__ () const;
UnsignedLong __stride__ (UnsignedLong dim) const;
}; /* class ComplexMatrix */
/** Declaration of friend operators */
inline ComplexMatrix operator * (const NumericalComplex s,
const ComplexMatrix & m)
{
return m.operator * (s);
}
/** Constructor from range of external collection */
template <class InputIterator>
ComplexMatrix::ComplexMatrix(const UnsignedLong rowDim,
const UnsignedLong colDim,
const InputIterator first,
const InputIterator last)
: TypedInterfaceObject<ComplexMatrixImplementation>(new ComplexMatrixImplementation(rowDim, colDim, first, last))
{
// Nothing to do
}
END_NAMESPACE_OPENTURNS
#endif /* OPENTURNS_COMPLEXMATRIX_HXX */
|