Skip to content
Snippets Groups Projects
Commit 96cb4733 authored by Kutalmış Berçin's avatar Kutalmış Berçin Committed by Mark OLESEN
Browse files

ENH: Matrix: add non-conjugate transpose function

parent addfcf1b
No related branches found
No related tags found
1 merge request!540ENH: QRMatrix: refactor the QR decomposition algorithms
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -405,6 +405,23 @@ Form Foam::Matrix<Form, Type>::T() const
}
template<class Form, class Type>
Form Foam::Matrix<Form, Type>::transpose() const
{
Form At(labelPair{n(), m()});
for (label i = 0; i < m(); ++i)
{
for (label j = 0; j < n(); ++j)
{
At(j, i) = (*this)(i, j);
}
}
return At;
}
template<class Form, class Type>
Foam::List<Type> Foam::Matrix<Form, Type>::diag() const
{
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -372,9 +372,12 @@ public:
// Operations
//- Return (conjugate) transpose of Matrix
//- Return conjugate transpose of Matrix
Form T() const;
//- Return non-conjugate transpose of Matrix
Form transpose() const;
//- Right-multiply Matrix by a column vector (A * x)
inline tmp<Field<Type>> Amul(const UList<Type>& x) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment