DPsim
DenseLUAdapter.cpp
1 /* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2  * EONERC, RWTH Aachen University
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7  *********************************************************************************/
8 
9 #include <dpsim/DenseLUAdapter.h>
10 
11 using namespace DPsim;
12 
13 namespace DPsim {
14 
16 
18  SparseMatrix &systemMatrix,
19  std::vector<std::pair<UInt, UInt>> &listVariableSystemMatrixEntries) {
20  /* No preprocessing phase needed by PartialPivLU */
21 }
22 
23 void DenseLUAdapter::factorize(SparseMatrix &systemMatrix) {
24  LUFactorized.compute(Matrix(systemMatrix));
25 }
26 
27 void DenseLUAdapter::refactorize(SparseMatrix &systemMatrix) {
28  /* only a simple dense factorization */
29  LUFactorized.compute(Matrix(systemMatrix));
30 }
31 
33  SparseMatrix &systemMatrix,
34  std::vector<std::pair<UInt, UInt>> &listVariableSystemMatrixEntries) {
35  /* only a simple dense factorization */
36  LUFactorized.compute(Matrix(systemMatrix));
37 }
38 
39 Matrix DenseLUAdapter::solve(Matrix &mRightHandSideVector) {
40  return LUFactorized.solve(mRightHandSideVector);
41 }
42 } // namespace DPsim
void partialRefactorize(SparseMatrix &systemMatrix, std::vector< std::pair< UInt, UInt >> &listVariableSystemMatrixEntries) override
partial refactorization withouth partial pivoting
void factorize(SparseMatrix &systemMatrix) override
factorization function with partial pivoting
~DenseLUAdapter() override
Destructor.
void refactorize(SparseMatrix &systemMatrix) override
refactorization without partial pivoting
Matrix solve(Matrix &rightSideVector) override
solution function for a right hand side
void preprocessing(SparseMatrix &systemMatrix, std::vector< std::pair< UInt, UInt >> &listVariableSystemMatrixEntries) override
preprocessing function pre-ordering and scaling the matrix