Refactor matrix handling: replace instances of 'b' with 'Matrix' and introduce Matrix, MatrixInverter, and MatrixOrthogonalizer classes for improved linear algebra operations

This commit is contained in:
2026-01-11 09:08:27 +00:00
parent 5f18b30e85
commit 2778da4304
6 changed files with 66 additions and 66 deletions

View File

@@ -6,7 +6,7 @@ import G.aG;
import G.bT;
import G.cu;
import M.a;
import a.b;
import linear_algebra.Matrix;
import java.util.LinkedList;
import java.util.Queue;
@@ -41,7 +41,7 @@ public class f implements aF, aG {
f1 = i * 1.0E9F / (float)(l - ((Long)this.c.remove()).longValue());
}
float f2 = this.b / 8.0F;
this.e.i(new b(new double[][] { { f1 }, { 0.0D }, { 0.0D }, { 0.0D } }));
this.e.i(new Matrix(new double[][] { { f1 }, { 0.0D }, { 0.0D }, { 0.0D } }));
this.e.a();
this.b = (this.b * f2 + (float)this.e.b().a(0, 0)) / (f2 + 1.0F);
cu.a().a(a, (this.b * 1.0F));

View File

@@ -1,7 +1,7 @@
package L;
import M.a;
import a.b;
import linear_algebra.Matrix;
import ax.S;
import ax.ab;
import ax.ac;
@@ -33,12 +33,12 @@ public class SmoothFilteredFunction extends ac {
if (Double.isNaN(this.a) || this.a != d) {
if (Double.isNaN(this.f)) {
this.f = this.d.b(paramS);
this.c.i(new b(new double[][] { { this.f }, { 0.0D }, { 0.0D }, { 0.0D } }));
this.c.i(new Matrix(new double[][] { { this.f }, { 0.0D }, { 0.0D }, { 0.0D } }));
} else {
this.c.a();
double d1 = this.d.b(paramS);
if (!Double.isNaN(d1) && !Double.isNaN(this.f) && !Double.isInfinite(d1) && !Double.isInfinite(this.f))
this.c.a(new b(new double[][] { { d1 }, { this.f } }));
this.c.a(new Matrix(new double[][] { { d1 }, { this.f } }));
this.f = d1;
}
this.b = this.c.b().a(0, 0);

View File

@@ -1,27 +1,27 @@
package M;
import a.b;
import linear_algebra.Matrix;
public class a {
protected b a;
protected Matrix a;
protected b b;
protected Matrix b;
protected b c;
protected Matrix c;
protected b d;
protected Matrix d;
protected b e;
protected Matrix e;
protected b f;
protected Matrix f;
protected b g;
protected Matrix g;
protected b h;
protected Matrix h;
protected b i;
protected Matrix i;
protected b j;
protected Matrix j;
public static a a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5) {
a a1 = new a();
@@ -41,47 +41,47 @@ public class a {
this.j = this.c.c(this.i).c(this.c.f()).a(this.f);
}
public void a(b paramb) {
b b1 = this.g.c(this.j).c(this.g.f()).a(this.h);
b b2 = this.j.c(this.g.f()).c(b1.g());
public void a(Matrix paramb) {
Matrix b1 = this.g.c(this.j).c(this.g.f()).a(this.h);
Matrix b2 = this.j.c(this.g.f()).c(b1.g());
this.a = this.b.a(b2.c(paramb.b(this.g.c(this.b))));
b b3 = b.b(this.j.d(), this.j.e());
Matrix b3 = b.b(this.j.d(), this.j.e());
this.i = b3.b(b2.c(this.g)).c(this.j);
}
public void b(b paramb) {
public void b(Matrix paramb) {
this.d = paramb;
}
public void c(b paramb) {
public void c(Matrix paramb) {
this.c = paramb;
}
public void d(b paramb) {
public void d(Matrix paramb) {
this.g = paramb;
}
public void e(b paramb) {
public void e(Matrix paramb) {
this.i = paramb;
}
public void f(b paramb) {
public void f(Matrix paramb) {
this.f = paramb;
}
public void g(b paramb) {
public void g(Matrix paramb) {
this.h = paramb;
}
public void h(b paramb) {
public void h(Matrix paramb) {
this.e = paramb;
}
public b b() {
public Matrix b() {
return this.a;
}
public void i(b paramb) {
public void i(Matrix paramb) {
this.a = paramb;
}
}

View File

@@ -1,21 +1,21 @@
package a;
package linear_algebra;
import java.io.Serializable;
public class b implements Serializable, Cloneable {
public class Matrix implements Serializable, Cloneable {
private double[][] a;
private int b;
private int c;
public b(int paramInt1, int paramInt2) {
public Matrix(int paramInt1, int paramInt2) {
this.b = paramInt1;
this.c = paramInt2;
this.a = new double[paramInt1][paramInt2];
}
public b(double[][] paramArrayOfdouble) {
public Matrix(double[][] paramArrayOfdouble) {
this.b = paramArrayOfdouble.length;
this.c = (paramArrayOfdouble[0]).length;
for (byte b1 = 0; b1 < this.b; b1++) {
@@ -25,14 +25,14 @@ public class b implements Serializable, Cloneable {
this.a = paramArrayOfdouble;
}
public b(double[][] paramArrayOfdouble, int paramInt1, int paramInt2) {
public Matrix(double[][] paramArrayOfdouble, int paramInt1, int paramInt2) {
this.a = paramArrayOfdouble;
this.b = paramInt1;
this.c = paramInt2;
}
public b a() {
b b1 = new b(this.b, this.c);
public Matrix a() {
Matrix b1 = new Matrix(this.b, this.c);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < this.b; b2++) {
for (byte b3 = 0; b3 < this.c; b3++)
@@ -70,8 +70,8 @@ public class b implements Serializable, Cloneable {
return this.a[paramInt1][paramInt2];
}
public b a(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
b b1 = new b(paramInt2 - paramInt1 + 1, paramInt4 - paramInt3 + 1);
public Matrix a(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
Matrix b1 = new Matrix(paramInt2 - paramInt1 + 1, paramInt4 - paramInt3 + 1);
double[][] arrayOfDouble = b1.b();
try {
for (int i = paramInt1; i <= paramInt2; i++) {
@@ -84,8 +84,8 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b a(int[] paramArrayOfint, int paramInt1, int paramInt2) {
b b1 = new b(paramArrayOfint.length, paramInt2 - paramInt1 + 1);
public Matrix a(int[] paramArrayOfint, int paramInt1, int paramInt2) {
Matrix b1 = new Matrix(paramArrayOfint.length, paramInt2 - paramInt1 + 1);
double[][] arrayOfDouble = b1.b();
try {
for (byte b2 = 0; b2 < paramArrayOfint.length; b2++) {
@@ -98,8 +98,8 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b f() {
b b1 = new b(this.c, this.b);
public Matrix f() {
Matrix b1 = new Matrix(this.c, this.b);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < this.b; b2++) {
for (byte b3 = 0; b3 < this.c; b3++)
@@ -108,9 +108,9 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b a(b paramb) {
public Matrix a(Matrix paramb) {
e(paramb);
b b1 = new b(this.b, this.c);
Matrix b1 = new Matrix(this.b, this.c);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < this.b; b2++) {
for (byte b3 = 0; b3 < this.c; b3++)
@@ -119,9 +119,9 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b b(b paramb) {
public Matrix b(Matrix paramb) {
e(paramb);
b b1 = new b(this.b, this.c);
Matrix b1 = new Matrix(this.b, this.c);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < this.b; b2++) {
for (byte b3 = 0; b3 < this.c; b3++)
@@ -130,8 +130,8 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b a(double paramDouble) {
b b1 = new b(this.b, this.c);
public Matrix a(double paramDouble) {
Matrix b1 = new Matrix(this.b, this.c);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < this.b; b2++) {
for (byte b3 = 0; b3 < this.c; b3++)
@@ -140,10 +140,10 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b c(b paramb) {
public Matrix c(Matrix paramb) {
if (paramb.b != this.c)
throw new IllegalArgumentException("Matrix inner dimensions must agree.");
b b1 = new b(this.b, paramb.c);
Matrix b1 = new Matrix(this.b, paramb.c);
double[][] arrayOfDouble = b1.b();
double[] arrayOfDouble1 = new double[this.c];
for (byte b2 = 0; b2 < paramb.c; b2++) {
@@ -161,16 +161,16 @@ public class b implements Serializable, Cloneable {
return b1;
}
public b d(b paramb) {
return (this.b == this.c) ? (new a(this)).a(paramb) : (new c(this)).a(paramb);
public Matrix d(Matrix paramb) {
return (this.b == this.c) ? (new MatrixInverter(this)).a(paramb) : (new MatrixOrthogonalizer(this)).a(paramb);
}
public b g() {
public Matrix g() {
return d(b(this.b, this.b));
}
public static b b(int paramInt1, int paramInt2) {
b b1 = new b(paramInt1, paramInt2);
public static Matrix b(int paramInt1, int paramInt2) {
Matrix b1 = new Matrix(paramInt1, paramInt2);
double[][] arrayOfDouble = b1.b();
for (byte b2 = 0; b2 < paramInt1; b2++) {
for (byte b3 = 0; b3 < paramInt2; b3++)
@@ -179,7 +179,7 @@ public class b implements Serializable, Cloneable {
return b1;
}
private void e(b paramb) {
private void e(Matrix paramb) {
if (paramb.b != this.b || paramb.c != this.c)
throw new IllegalArgumentException("Matrix dimensions must agree.");
}

View File

@@ -1,8 +1,8 @@
package a;
package linear_algebra;
import java.io.Serializable;
public class a implements Serializable {
public class MatrixInverter implements Serializable {
private double[][] a;
private int b;
@@ -13,7 +13,7 @@ public class a implements Serializable {
private int[] e;
public a(b paramb) {
public MatrixInverter(Matrix paramb) {
// Byte code:
// 0: aload_0
// 1: invokespecial <init> : ()V
@@ -267,13 +267,13 @@ public class a implements Serializable {
return true;
}
public b a(b paramb) {
public Matrix a(Matrix paramb) {
if (paramb.d() != this.b)
throw new IllegalArgumentException("Matrix row dimensions must agree.");
if (!a())
throw new RuntimeException("Matrix is singular.");
int i = paramb.e();
b b1 = paramb.a(this.e, 0, i - 1);
Matrix b1 = paramb.a(this.e, 0, i - 1);
double[][] arrayOfDouble = b1.b();
int j;
for (j = 0; j < this.c; j++) {

View File

@@ -1,9 +1,9 @@
package a;
package linear_algebra;
import b.a;
import java.io.Serializable;
public class c implements Serializable {
public class MatrixOrthogonalizer implements Serializable {
private double[][] a;
private int b;
@@ -12,7 +12,7 @@ public class c implements Serializable {
private double[] d;
public c(b paramb) {
public MatrixOrthogonalizer(Matrix paramb) {
this.a = paramb.c();
this.b = paramb.d();
this.c = paramb.e();
@@ -50,7 +50,7 @@ public class c implements Serializable {
return true;
}
public b a(b paramb) {
public Matrix a(Matrix paramb) {
if (paramb.d() != this.b)
throw new IllegalArgumentException("Matrix row dimensions must agree.");
if (!a())
@@ -78,7 +78,7 @@ public class c implements Serializable {
arrayOfDouble[b1][b2] = arrayOfDouble[b1][b2] - arrayOfDouble[j][b2] * this.a[b1][j];
}
}
return (new b(arrayOfDouble, this.c, i)).a(0, this.c - 1, 0, i - 1);
return (new Matrix(arrayOfDouble, this.c, i)).a(0, this.c - 1, 0, i - 1);
}
}