78 fG .ResizeTo(c_in) ;
fG = c_in;
79 fBa .ResizeTo(bA_in) ;
fBa = bA_in;
126 fQ.SetSparseIndex(nnzQ);
127 fA.SetSparseIndex(nnzA);
128 fC.SetSparseIndex(nnzC);
138 if (
fQ.GetNoElements() > 0)
149 if (
fA.GetNoElements() > 0)
160 if (
fC.GetNoElements() > 0)
171 if (
fA.GetNoElements() > 0)
182 if (
fC.GetNoElements() > 0)
195 if (componentNorm > norm) norm = componentNorm;
198 componentNorm = (fQ_abs.
Abs()).Max();
199 if (componentNorm > norm) norm = componentNorm;
201 componentNorm =
fBa.NormInf();
202 if (componentNorm > norm) norm = componentNorm;
205 componentNorm = (fA_abs.
Abs()).Max();
206 if (componentNorm > norm) norm = componentNorm;
209 componentNorm = (fC_abs.
Abs()).Max();
210 if (componentNorm > norm) norm = componentNorm;
214 if (componentNorm > norm) norm = componentNorm;
218 if (componentNorm > norm) norm = componentNorm;
222 if (componentNorm > norm) norm = componentNorm;
226 if (componentNorm > norm) norm = componentNorm;
264 m.SetSub(row,col,
fQ);
274 m.SetSub(row,col,
fA);
284 m.SetSub(row,col,
fC);
305 this->
Qmult(1.0,tmp,0.5,vars->
fX);
324 fQ.RandomizePD(0.0,1.0,ix);
325 fA.Randomize(-10.0,10.0,ix);
326 fC.Randomize(-10.0,10.0,ix);
327 y .Randomize(-10.0,10.0,ix);
357 if (
this != &source) {
359 fQ.ResizeTo(source.
fQ);
fQ = source.
fQ;
360 fA.ResizeTo(source.
fA);
fA = source.
fA;
361 fC.ResizeTo(source.
fC);
fC = source.
fC;
TMatrixTBase< Double_t > TMatrixDBase
TMatrixTSparse< Double_t > TMatrixDSparse
TMatrixTSparseDiag< Double_t > TMatrixDSparseDiag
TVectorT< Double_t > TVectorD
virtual TMatrixTBase< Element > & Abs()
Take an absolute value of a matrix, i.e. apply Abs() to each element.
TQpDataBase & operator=(const TQpDataBase &source)
Assignment operator.
TQpDataBase()
Default constructor.
static void RandomlyChooseBoundedVariables(TVectorD &x, TVectorD &dualx, TVectorD &blx, TVectorD &ixlow, TVectorD &bux, TVectorD &ixupp, Double_t &ix, Double_t percentLowerOnly, Double_t percentUpperOnly, Double_t percentBound)
Randomly choose x and its boundaries.
Data for the sparse QP formulation.
Double_t ObjectiveValue(TQpVar *vars) override
Return value of the objective function.
Double_t DataNorm() override
Return the largest component of several vectors in the data class.
void PutAIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the constraint matrix A into the matrix M at index (row,col) for the fundamental linear system...
void Amult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fA*x)
void PutQIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the Hessian Q into the matrix M at index (row,col) for the fundamental linear system.
void DataRandom(TVectorD &x, TVectorD &y, TVectorD &z, TVectorD &s) override
Choose randomly a QP problem.
void Print(Option_t *opt="") const override
Print class members.
void PutCIntoAt(TMatrixDBase &M, Int_t row, Int_t col) override
Insert the constraint matrix C into the matrix M at index (row,col) for the fundamental linear system...
TQpDataSparse & operator=(const TQpDataSparse &source)
Assignment operator.
void SetNonZeros(Int_t nnzQ, Int_t nnzA, Int_t nnzC)
Allocate space for the appropriate number of non-zeros in the matrices.
void Cmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fC*x)
void Qmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fQ*x)
void GetDiagonalOfQ(TVectorD &dQ) override
Return in vector dq the diagonal of matrix fQ.
void CTransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fC^T*x)
void ATransmult(Double_t beta, TVectorD &y, Double_t alpha, const TVectorD &x) override
calculate y = beta*y + alpha*(fA^T*x)
Class containing the variables for the general QP formulation.
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.