#include "Riostream.h"
#include "TQpLinSolverSparse.h"
ClassImp(TQpLinSolverSparse)
TQpLinSolverSparse::TQpLinSolverSparse(TQpProbSparse *factory,TQpDataSparse *data) :
TQpLinSolverBase(factory,data)
{
const Int_t n = factory->fNx+factory->fMy+factory->fMz;
fKkt.ResizeTo(n,n);
if (fMy > 0) data->PutAIntoAt(fKkt,fNx, 0);
if (fMz > 0) data->PutCIntoAt(fKkt,fNx+fMy,0);
if (fMy > 0 || fMz > 0) {
TMatrixDSparse tmp(TMatrixDSparse::kTransposed,fKkt);
fKkt += tmp;
}
data->PutQIntoAt(fKkt,0,0);
}
TQpLinSolverSparse::TQpLinSolverSparse(const TQpLinSolverSparse &another) :
TQpLinSolverBase(another)
{
*this = another;
}
void TQpLinSolverSparse::Factor(TQpDataBase *prob,TQpVar *vars)
{
TQpLinSolverBase::Factor(prob,vars);
fSolveSparse.SetMatrix(fKkt);
}
void TQpLinSolverSparse::PutXDiagonal(TVectorD &xdiag)
{
TMatrixDSparseDiag diag(fKkt);
for (Int_t i = 0; i < xdiag.GetNrows(); i++)
diag[i] = xdiag[i];
}
void TQpLinSolverSparse::PutZDiagonal(TVectorD &zdiag)
{
TMatrixDSparseDiag diag(fKkt);
for (Int_t i = 0; i < zdiag.GetNrows(); i++)
diag[i+fNx+fMy] = zdiag[i];
}
void TQpLinSolverSparse::SolveCompressed(TVectorD &compressedRhs)
{
fSolveSparse.Solve(compressedRhs);
}
TQpLinSolverSparse &TQpLinSolverSparse::operator=(const TQpLinSolverSparse &source)
{
if (this != &source) {
TQpLinSolverBase::operator=(source);
fKkt.ResizeTo(source.fKkt); fKkt = source.fKkt;
fSolveSparse = source.fSolveSparse;
}
return *this;
}
TQpLinSolverSparse.cxx:10 TQpLinSolverSparse.cxx:11 TQpLinSolverSparse.cxx:12 TQpLinSolverSparse.cxx:13 TQpLinSolverSparse.cxx:14 TQpLinSolverSparse.cxx:15 TQpLinSolverSparse.cxx:16 TQpLinSolverSparse.cxx:17 TQpLinSolverSparse.cxx:18 TQpLinSolverSparse.cxx:19 TQpLinSolverSparse.cxx:20 TQpLinSolverSparse.cxx:21 TQpLinSolverSparse.cxx:22 TQpLinSolverSparse.cxx:23 TQpLinSolverSparse.cxx:24 TQpLinSolverSparse.cxx:25 TQpLinSolverSparse.cxx:26 TQpLinSolverSparse.cxx:27 TQpLinSolverSparse.cxx:28 TQpLinSolverSparse.cxx:29 TQpLinSolverSparse.cxx:30 TQpLinSolverSparse.cxx:31 TQpLinSolverSparse.cxx:32 TQpLinSolverSparse.cxx:33 TQpLinSolverSparse.cxx:34 TQpLinSolverSparse.cxx:35 TQpLinSolverSparse.cxx:36 TQpLinSolverSparse.cxx:37 TQpLinSolverSparse.cxx:38 TQpLinSolverSparse.cxx:39 TQpLinSolverSparse.cxx:40 TQpLinSolverSparse.cxx:41 TQpLinSolverSparse.cxx:42 TQpLinSolverSparse.cxx:43 TQpLinSolverSparse.cxx:44 TQpLinSolverSparse.cxx:45 TQpLinSolverSparse.cxx:46 TQpLinSolverSparse.cxx:47 TQpLinSolverSparse.cxx:48 TQpLinSolverSparse.cxx:49 TQpLinSolverSparse.cxx:50 TQpLinSolverSparse.cxx:51 TQpLinSolverSparse.cxx:52 TQpLinSolverSparse.cxx:53 TQpLinSolverSparse.cxx:54 TQpLinSolverSparse.cxx:55 TQpLinSolverSparse.cxx:56 TQpLinSolverSparse.cxx:57 TQpLinSolverSparse.cxx:58 TQpLinSolverSparse.cxx:59 TQpLinSolverSparse.cxx:60 TQpLinSolverSparse.cxx:61 TQpLinSolverSparse.cxx:62 TQpLinSolverSparse.cxx:63 TQpLinSolverSparse.cxx:64 TQpLinSolverSparse.cxx:65 TQpLinSolverSparse.cxx:66 TQpLinSolverSparse.cxx:67 TQpLinSolverSparse.cxx:68 TQpLinSolverSparse.cxx:69 TQpLinSolverSparse.cxx:70 TQpLinSolverSparse.cxx:71 TQpLinSolverSparse.cxx:72 TQpLinSolverSparse.cxx:73 TQpLinSolverSparse.cxx:74 TQpLinSolverSparse.cxx:75 TQpLinSolverSparse.cxx:76 TQpLinSolverSparse.cxx:77 TQpLinSolverSparse.cxx:78 TQpLinSolverSparse.cxx:79 TQpLinSolverSparse.cxx:80 TQpLinSolverSparse.cxx:81 TQpLinSolverSparse.cxx:82 TQpLinSolverSparse.cxx:83 TQpLinSolverSparse.cxx:84 TQpLinSolverSparse.cxx:85 TQpLinSolverSparse.cxx:86 TQpLinSolverSparse.cxx:87 TQpLinSolverSparse.cxx:88 TQpLinSolverSparse.cxx:89 TQpLinSolverSparse.cxx:90 TQpLinSolverSparse.cxx:91 TQpLinSolverSparse.cxx:92 TQpLinSolverSparse.cxx:93 TQpLinSolverSparse.cxx:94 TQpLinSolverSparse.cxx:95 TQpLinSolverSparse.cxx:96 TQpLinSolverSparse.cxx:97 TQpLinSolverSparse.cxx:98 TQpLinSolverSparse.cxx:99 TQpLinSolverSparse.cxx:100 TQpLinSolverSparse.cxx:101 TQpLinSolverSparse.cxx:102 TQpLinSolverSparse.cxx:103 TQpLinSolverSparse.cxx:104 TQpLinSolverSparse.cxx:105 TQpLinSolverSparse.cxx:106 TQpLinSolverSparse.cxx:107 TQpLinSolverSparse.cxx:108 TQpLinSolverSparse.cxx:109 TQpLinSolverSparse.cxx:110 TQpLinSolverSparse.cxx:111 TQpLinSolverSparse.cxx:112 TQpLinSolverSparse.cxx:113 TQpLinSolverSparse.cxx:114 TQpLinSolverSparse.cxx:115 TQpLinSolverSparse.cxx:116 TQpLinSolverSparse.cxx:117 TQpLinSolverSparse.cxx:118 TQpLinSolverSparse.cxx:119 TQpLinSolverSparse.cxx:120 TQpLinSolverSparse.cxx:121 TQpLinSolverSparse.cxx:122 TQpLinSolverSparse.cxx:123 TQpLinSolverSparse.cxx:124 TQpLinSolverSparse.cxx:125 TQpLinSolverSparse.cxx:126 TQpLinSolverSparse.cxx:127 TQpLinSolverSparse.cxx:128 TQpLinSolverSparse.cxx:129 TQpLinSolverSparse.cxx:130 TQpLinSolverSparse.cxx:131 TQpLinSolverSparse.cxx:132 TQpLinSolverSparse.cxx:133 TQpLinSolverSparse.cxx:134 TQpLinSolverSparse.cxx:135 TQpLinSolverSparse.cxx:136 TQpLinSolverSparse.cxx:137 TQpLinSolverSparse.cxx:138 TQpLinSolverSparse.cxx:139 TQpLinSolverSparse.cxx:140 TQpLinSolverSparse.cxx:141 TQpLinSolverSparse.cxx:142 TQpLinSolverSparse.cxx:143