77 fG .ResizeTo(c_in) ;
fG = c_in;
78 fBa .ResizeTo(bA_in) ;
fBa = bA_in;
125 fQ.SetSparseIndex(nnzQ);
126 fA.SetSparseIndex(nnzA);
127 fC.SetSparseIndex(nnzC);
137 if (
fQ.GetNoElements() > 0)
148 if (
fA.GetNoElements() > 0)
159 if (
fC.GetNoElements() > 0)
170 if (
fA.GetNoElements() > 0)
181 if (
fC.GetNoElements() > 0)
194 if (componentNorm > norm) norm = componentNorm;
197 componentNorm = (fQ_abs.
Abs()).Max();
198 if (componentNorm > norm) norm = componentNorm;
200 componentNorm =
fBa.NormInf();
201 if (componentNorm > norm) norm = componentNorm;
204 componentNorm = (fA_abs.
Abs()).Max();
205 if (componentNorm > norm) norm = componentNorm;
208 componentNorm = (fC_abs.
Abs()).Max();
209 if (componentNorm > norm) norm = componentNorm;
213 if (componentNorm > norm) norm = componentNorm;
217 if (componentNorm > norm) norm = componentNorm;
221 if (componentNorm > norm) norm = componentNorm;
225 if (componentNorm > norm) norm = componentNorm;
263 m.SetSub(row,col,
fQ);
273 m.SetSub(row,col,
fA);
283 m.SetSub(row,col,
fC);
304 this->
Qmult(1.0,tmp,0.5,vars->
fX);
323 fQ.RandomizePD(0.0,1.0,ix);
324 fA.Randomize(-10.0,10.0,ix);
325 fC.Randomize(-10.0,10.0,ix);
326 y .Randomize(-10.0,10.0,ix);
356 if (
this != &source) {
358 fQ.ResizeTo(source.
fQ);
fQ = source.
fQ;
359 fA.ResizeTo(source.
fA);
fA = source.
fA;
360 fC.ResizeTo(source.
fC);
fC = source.
fC;
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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.
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.