Пример #1
0
void addR_Pri(ADDvector& r_t, Plan& P, ADDvector& x, ADDvector& lambda, bool phase1 = false) {
	//note phase 1 and 2 are the same here but the parameter is added for
	//symetry with the other calls
	int offset = lambda.count() + x.count();
	ADDvector R_Pri = *(P.A()) * x; // - b?
	for(int i = 0; i < lambda.count(); i++) {
		r_t[i+offset] = R_Pri[i];
	}
}
Пример #2
0
void addAandAT(int offset, SparceMatrix& lhs, Plan& P) {
	P.A()->insertWithOffset(lhs, offset, 0);
	P.A()->Transpose().insertWithOffset(lhs, 0, offset);
}
Пример #3
0
void addR_Dual(ADDvector& r_t, Plan& P, ADDvector& x, ADDvector& lambda, ADDvector& mu, bool phase1 = false) {
	ADDvector R_Dual = P.DeltaF_0(x, phase1) + P.DF_x(phase1).Transpose() * lambda + P.A()->Transpose() * mu;
	for(int i = 0; i < R_Dual.count(); i++) {
		r_t[i] = R_Dual[i];
	}
}