This commit is contained in:
Aik-Siong Koh
2023-06-18 01:06:39 -06:00
parent 3b08cd72df
commit 371b13a9e0
147 changed files with 2555 additions and 238 deletions

View File

@@ -6,6 +6,7 @@
#include "MatrixSolver.h"
#include "SparseMatrix.h"
#include "FullMatrix.h"
#include "SingularMatrixError.h"
using namespace MbD;
@@ -15,6 +16,10 @@ void MbD::MatrixSolver::initialize()
singularPivotTolerance = 4 * std::numeric_limits<double>::epsilon();
}
void MbD::MatrixSolver::setSystem(Solver* sys)
{
}
FColDsptr MbD::MatrixSolver::solvewithsaveOriginal(SpMatDsptr spMat, FColDsptr fullCol, bool saveOriginal)
{
this->timedSolvewithsaveOriginal(spMat, fullCol, saveOriginal);
@@ -44,3 +49,15 @@ FColDsptr MbD::MatrixSolver::timedSolvewithsaveOriginal(FMatDsptr fullMat, FColD
{
return FColDsptr();
}
void MbD::MatrixSolver::findScalingsForRowRange(int begin, int end)
{
//"Row element * scaling <= 1.0."
rowScalings = std::make_shared<FullColumn<double>>(m);
for (int i = begin; i < end; i++)
{
auto maxRowMagnitude = this->getmatrixArowimaxMagnitude(i);
if (maxRowMagnitude == 0.0) throw SingularMatrixError("");
rowScalings->at(i) = 1.0 / maxRowMagnitude;
}
}