fixed bug

This commit is contained in:
2023-05-28 17:08:32 +08:00
parent cea35eadb0
commit 0663ca200a
4 changed files with 18 additions and 19 deletions

View File

@@ -417,9 +417,8 @@ public class Matrix<T extends NumericType<T>> implements Iterable<Matrix.Element
int[] pivotValues = pivotImpl.getValues();
int size = getRows();
if (pivotValues.length != size) throw new SizeException(
String.format("Pivot length is %d must be %d instead", pivotValues.length, size));
String.format("Pivot length is %d, it must be %d instead", pivotValues.length, size));
for (int i = 0; i < pivotValues.length; i++) pivotValues[i] = i;
Vector<T> x = Vector.of(numericTypeFactory, size);
for (int i = 0; i < size; i++) {

View File

@@ -54,11 +54,11 @@ public class Rational implements NumericType<Rational> {
public Rational(BigInteger num, BigInteger den) {
this.num = num;
this.den = den;
simplify();
}
public Rational(long num, long den) {
this.num = BigInteger.valueOf(num);
this.den = BigInteger.valueOf(den);
this(BigInteger.valueOf(num), BigInteger.valueOf(den));
}
public static Rational of(long num, long den) {