mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Matrix: add non-conjugate transpose function
This commit is contained in:
committed by
Mark Olesen
parent
addfcf1bc2
commit
96cb473305
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user