327 lines
9.9 KiB
Java
327 lines
9.9 KiB
Java
package androidx.constraintlayout.solver;
|
|
|
|
import androidx.constraintlayout.solver.LinearSystem;
|
|
import androidx.constraintlayout.solver.SolverVariable;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ArrayRow implements LinearSystem.Row {
|
|
boolean c;
|
|
public final ArrayLinkedVariables d;
|
|
SolverVariable a = null;
|
|
float b = 0.0f;
|
|
boolean e = false;
|
|
|
|
public ArrayRow(Cache cache) {
|
|
this.d = new ArrayLinkedVariables(this, cache);
|
|
}
|
|
|
|
public ArrayRow a(SolverVariable solverVariable, SolverVariable solverVariable2, int i) {
|
|
boolean z = false;
|
|
if (i != 0) {
|
|
if (i < 0) {
|
|
i *= -1;
|
|
z = true;
|
|
}
|
|
this.b = i;
|
|
}
|
|
if (z) {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
} else {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
boolean b() {
|
|
SolverVariable solverVariable = this.a;
|
|
return solverVariable != null && (solverVariable.g == SolverVariable.Type.UNRESTRICTED || this.b >= 0.0f);
|
|
}
|
|
|
|
public ArrayRow c(SolverVariable solverVariable, int i) {
|
|
if (i < 0) {
|
|
this.b = i * (-1);
|
|
this.d.a(solverVariable, 1.0f);
|
|
} else {
|
|
this.b = i;
|
|
this.d.a(solverVariable, -1.0f);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.LinearSystem.Row
|
|
public void clear() {
|
|
this.d.a();
|
|
this.a = null;
|
|
this.b = 0.0f;
|
|
}
|
|
|
|
public void d() {
|
|
this.a = null;
|
|
this.d.a();
|
|
this.b = 0.0f;
|
|
this.e = false;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:21:0x00be */
|
|
/* JADX WARN: Removed duplicated region for block: B:25:0x00ce */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
java.lang.String e() {
|
|
/*
|
|
Method dump skipped, instructions count: 254
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.ArrayRow.e():java.lang.String");
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.LinearSystem.Row
|
|
public SolverVariable getKey() {
|
|
return this.a;
|
|
}
|
|
|
|
public String toString() {
|
|
return e();
|
|
}
|
|
|
|
boolean b(SolverVariable solverVariable) {
|
|
return this.d.a(solverVariable);
|
|
}
|
|
|
|
ArrayRow b(SolverVariable solverVariable, int i) {
|
|
this.a = solverVariable;
|
|
float f = i;
|
|
solverVariable.e = f;
|
|
this.b = f;
|
|
this.e = true;
|
|
return this;
|
|
}
|
|
|
|
SolverVariable c(SolverVariable solverVariable) {
|
|
return this.d.a((boolean[]) null, solverVariable);
|
|
}
|
|
|
|
void d(SolverVariable solverVariable) {
|
|
SolverVariable solverVariable2 = this.a;
|
|
if (solverVariable2 != null) {
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.a = null;
|
|
}
|
|
float a = this.d.a(solverVariable, true) * (-1.0f);
|
|
this.a = solverVariable;
|
|
if (a == 1.0f) {
|
|
return;
|
|
}
|
|
this.b /= a;
|
|
this.d.a(a);
|
|
}
|
|
|
|
ArrayRow a(SolverVariable solverVariable, int i) {
|
|
this.d.a(solverVariable, i);
|
|
return this;
|
|
}
|
|
|
|
public boolean c() {
|
|
return this.a == null && this.b == 0.0f && this.d.a == 0;
|
|
}
|
|
|
|
public ArrayRow a(SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, int i) {
|
|
boolean z = false;
|
|
if (i != 0) {
|
|
if (i < 0) {
|
|
i *= -1;
|
|
z = true;
|
|
}
|
|
this.b = i;
|
|
}
|
|
if (!z) {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f);
|
|
this.d.a(solverVariable3, 1.0f);
|
|
} else {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.d.a(solverVariable3, -1.0f);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public ArrayRow b(SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, int i) {
|
|
boolean z = false;
|
|
if (i != 0) {
|
|
if (i < 0) {
|
|
i *= -1;
|
|
z = true;
|
|
}
|
|
this.b = i;
|
|
}
|
|
if (!z) {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f);
|
|
this.d.a(solverVariable3, -1.0f);
|
|
} else {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.d.a(solverVariable3, 1.0f);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public ArrayRow a(float f, float f2, float f3, SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, SolverVariable solverVariable4) {
|
|
this.b = 0.0f;
|
|
if (f2 == 0.0f || f == f3) {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.d.a(solverVariable4, 1.0f);
|
|
this.d.a(solverVariable3, -1.0f);
|
|
} else if (f == 0.0f) {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
} else if (f3 == 0.0f) {
|
|
this.d.a(solverVariable3, 1.0f);
|
|
this.d.a(solverVariable4, -1.0f);
|
|
} else {
|
|
float f4 = (f / f2) / (f3 / f2);
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.d.a(solverVariable4, f4);
|
|
this.d.a(solverVariable3, -f4);
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public ArrayRow b(SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, SolverVariable solverVariable4, float f) {
|
|
this.d.a(solverVariable3, 0.5f);
|
|
this.d.a(solverVariable4, 0.5f);
|
|
this.d.a(solverVariable, -0.5f);
|
|
this.d.a(solverVariable2, -0.5f);
|
|
this.b = -f;
|
|
return this;
|
|
}
|
|
|
|
ArrayRow a(SolverVariable solverVariable, SolverVariable solverVariable2, int i, float f, SolverVariable solverVariable3, SolverVariable solverVariable4, int i2) {
|
|
if (solverVariable2 == solverVariable3) {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable4, 1.0f);
|
|
this.d.a(solverVariable2, -2.0f);
|
|
return this;
|
|
}
|
|
if (f == 0.5f) {
|
|
this.d.a(solverVariable, 1.0f);
|
|
this.d.a(solverVariable2, -1.0f);
|
|
this.d.a(solverVariable3, -1.0f);
|
|
this.d.a(solverVariable4, 1.0f);
|
|
if (i > 0 || i2 > 0) {
|
|
this.b = (-i) + i2;
|
|
}
|
|
} else if (f <= 0.0f) {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f);
|
|
this.b = i;
|
|
} else if (f >= 1.0f) {
|
|
this.d.a(solverVariable3, -1.0f);
|
|
this.d.a(solverVariable4, 1.0f);
|
|
this.b = i2;
|
|
} else {
|
|
float f2 = 1.0f - f;
|
|
this.d.a(solverVariable, f2 * 1.0f);
|
|
this.d.a(solverVariable2, f2 * (-1.0f));
|
|
this.d.a(solverVariable3, (-1.0f) * f);
|
|
this.d.a(solverVariable4, 1.0f * f);
|
|
if (i > 0 || i2 > 0) {
|
|
this.b = ((-i) * f2) + (i2 * f);
|
|
}
|
|
}
|
|
return this;
|
|
}
|
|
|
|
public ArrayRow a(LinearSystem linearSystem, int i) {
|
|
this.d.a(linearSystem.a(i, "ep"), 1.0f);
|
|
this.d.a(linearSystem.a(i, "em"), -1.0f);
|
|
return this;
|
|
}
|
|
|
|
ArrayRow a(SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, float f) {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f - f);
|
|
this.d.a(solverVariable3, f);
|
|
return this;
|
|
}
|
|
|
|
public ArrayRow a(SolverVariable solverVariable, SolverVariable solverVariable2, SolverVariable solverVariable3, SolverVariable solverVariable4, float f) {
|
|
this.d.a(solverVariable, -1.0f);
|
|
this.d.a(solverVariable2, 1.0f);
|
|
this.d.a(solverVariable3, f);
|
|
this.d.a(solverVariable4, -f);
|
|
return this;
|
|
}
|
|
|
|
void a() {
|
|
float f = this.b;
|
|
if (f < 0.0f) {
|
|
this.b = f * (-1.0f);
|
|
this.d.b();
|
|
}
|
|
}
|
|
|
|
boolean a(LinearSystem linearSystem) {
|
|
boolean z;
|
|
SolverVariable a = this.d.a(linearSystem);
|
|
if (a == null) {
|
|
z = true;
|
|
} else {
|
|
d(a);
|
|
z = false;
|
|
}
|
|
if (this.d.a == 0) {
|
|
this.e = true;
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.LinearSystem.Row
|
|
public SolverVariable a(LinearSystem linearSystem, boolean[] zArr) {
|
|
return this.d.a(zArr, (SolverVariable) null);
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.LinearSystem.Row
|
|
public void a(LinearSystem.Row row) {
|
|
if (!(row instanceof ArrayRow)) {
|
|
return;
|
|
}
|
|
ArrayRow arrayRow = (ArrayRow) row;
|
|
this.a = null;
|
|
this.d.a();
|
|
int i = 0;
|
|
while (true) {
|
|
ArrayLinkedVariables arrayLinkedVariables = arrayRow.d;
|
|
if (i >= arrayLinkedVariables.a) {
|
|
return;
|
|
}
|
|
this.d.a(arrayLinkedVariables.a(i), arrayRow.d.b(i), true);
|
|
i++;
|
|
}
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.solver.LinearSystem.Row
|
|
public void a(SolverVariable solverVariable) {
|
|
int i = solverVariable.d;
|
|
float f = 1.0f;
|
|
if (i != 1) {
|
|
if (i == 2) {
|
|
f = 1000.0f;
|
|
} else if (i == 3) {
|
|
f = 1000000.0f;
|
|
} else if (i == 4) {
|
|
f = 1.0E9f;
|
|
} else if (i == 5) {
|
|
f = 1.0E12f;
|
|
}
|
|
}
|
|
this.d.a(solverVariable, f);
|
|
}
|
|
}
|