Skip to content

Commit 6a62111

Browse files
1.29 版本发布 (#18)
* 1.29 版本发布
1 parent 2ebecff commit 6a62111

File tree

15 files changed

+520
-105
lines changed

15 files changed

+520
-105
lines changed

README-Chinese.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AS库目录有多个版本,如果希望查询不同版本的更新日志以及
2323
<dependency>
2424
<groupId>io.github.BeardedManZhao</groupId>
2525
<artifactId>algorithmStar</artifactId>
26-
<version>1.28</version>
26+
<version>1.29</version>
2727
</dependency>
2828
</dependencies>
2929
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ can add it to your maven project, or you can download it from Releases and manua
2929
<dependency>
3030
<groupId>io.github.BeardedManZhao</groupId>
3131
<artifactId>algorithmStar</artifactId>
32-
<version>1.28</version>
32+
<version>1.29</version>
3333
</dependency>
3434
</dependencies>
3535
```

src_code/README-Chinese.md

Lines changed: 69 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,96 @@
88

99
### 更新日志
1010

11-
* 框架版本:1.27 - 1.28
12-
* 新增分数操作数计算组件,支持对于分数操作数的创建以及计算操作
11+
* 框架版本:1.28 - 1.29
12+
* 修正矩阵工厂类的名字
13+
14+
```java
15+
public class MAIN1 {
16+
public static void main(String[] args) {
17+
final MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
18+
}
19+
}
20+
```
21+
22+
* 修复在进行向量中的不拷贝反转操作时,打印出来的数据不正确问题,这是由于向量内部的数据没有自动刷新,1.29 版本已解决此问题!
23+
24+
```java
25+
package com.zhao;
26+
27+
import zhao.algorithmMagic.core.AlgorithmStar;
28+
import zhao.algorithmMagic.core.VectorFactory;
29+
import zhao.algorithmMagic.operands.vector.IntegerVector;
30+
31+
public class MAIN {
32+
public static void main(String[] args) {
33+
// 创建向量对象
34+
final VectorFactory vectorFactory = AlgorithmStar.vectorFactory();
35+
final IntegerVector integerVector = vectorFactory.parseVector(1, 2, 43, 4);
36+
// 向量整体反转 这里的参数代表的就是是否需要在拷贝的新向量中进行转换 1.28 以及 1.28 之前的版本
37+
// 打印出的字符串不太正确 1.29版本中会修复此问题
38+
System.out.println(integerVector.reverseLR(false));
39+
}
40+
}
41+
```
42+
43+
* 针对矩阵工厂,增加了一些创建方式,您可以直接通过工厂类中进行稀疏矩阵的解析,当然,这个操作在1.29之前的版本中也是支持的!!!
1344

1445
```java
1546
package zhao.algorithmMagic;
1647

1748
import zhao.algorithmMagic.core.AlgorithmStar;
18-
import zhao.algorithmMagic.core.FractionFactory;
19-
import zhao.algorithmMagic.operands.fraction.Fraction;
49+
import zhao.algorithmMagic.core.MatrixFactory;
50+
import zhao.algorithmMagic.operands.matrix.DoubleMatrix;
51+
import zhao.algorithmMagic.operands.matrix.IntegerMatrix;
2052

2153
public class MAIN1 {
2254
public static void main(String[] args) {
23-
// 获取分数操作数工厂
24-
final FractionFactory fractionFactory = AlgorithmStar.fractionFactory();
25-
// 准备三个操作数
26-
final Fraction parse1 = fractionFactory.parse(1, 2);
27-
final Fraction parse2 = fractionFactory.parse(2);
28-
final Fraction parse3 = fractionFactory.parse("1 / 2");
29-
30-
System.out.println("打印三个分数");
31-
System.out.println(parse1);
32-
System.out.println(parse2);
33-
System.out.println(parse3);
34-
35-
System.out.println("全部通分 分别将分母变为 10 5 1 在这里我们将第一个分数保存一下 稍后用于约分");
36-
final Fraction cf1 = parse1.cf(10);
37-
System.out.println(cf1);
38-
System.out.println(parse2.cf(5));
39-
System.out.println(parse3.cf(1));
40-
41-
System.out.println("将被通分的 cf1 进行约分 不出意外的话 这里打印的值为 1 / 2");
42-
System.out.println(cf1.simplify());
43-
44-
System.out.println("在这里将 parse1 以及 parse2 进行加减乘除计算");
45-
System.out.println(parse1.add(parse2));
46-
System.out.println(parse1.diff(parse2));
47-
System.out.println(parse1.multiply(parse2));
48-
System.out.println(parse1.divide(parse2));
49-
50-
System.out.println("在这里将 parse1 做为Java中的数值类型进行使用");
51-
System.out.println(parse1.doubleValue());
55+
final MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
56+
// 通过 工厂类 以及稀疏矩阵的方式创建两个矩阵
57+
final IntegerMatrix integerMatrix = matrixFactory.sparseMatrix(
58+
// 在坐标 (2,3) 的位置创建一个元素 1
59+
new int[]{1, 2, 3},
60+
// 在坐标 (1,2) 的位置创建一个元素 2
61+
new int[]{2, 1, 2}
62+
);
63+
final DoubleMatrix doubleMatrix = matrixFactory.sparseMatrix(
64+
// 在坐标 (2,3) 的位置创建一个元素 1
65+
new double[]{1, 2, 3},
66+
// 在坐标 (1,2) 的位置创建一个元素 2
67+
new double[]{2, 1, 2}
68+
);
69+
System.out.println(integerMatrix);
70+
System.out.println(doubleMatrix);
5271
}
5372
}
5473
```
5574

56-
* 新增帮助信息的获取,您可以直接通过下面的方式获取到帮助文档,其中有更全的API说明
75+
* 您也可以使用矩阵工厂来进行一个矩阵的填充和随机创建
5776

5877
```java
5978
package zhao.algorithmMagic;
6079

6180
import zhao.algorithmMagic.core.AlgorithmStar;
62-
import zhao.algorithmMagic.core.HelpFactory;
81+
import zhao.algorithmMagic.core.MatrixFactory;
82+
import zhao.algorithmMagic.operands.matrix.DoubleMatrix;
83+
import zhao.algorithmMagic.operands.matrix.IntegerMatrix;
6384

6485
public class MAIN1 {
6586
public static void main(String[] args) {
66-
// 获取帮助信息工厂类
67-
final HelpFactory helpFactory = AlgorithmStar.helpFactory();
68-
// 下载帮助文档 到 C:\Users\zhao\Desktop\fsdownload 目录中
69-
final String path = helpFactory.saveHelpFile(
70-
HelpFactory.ALL,
71-
"C:\\Users\\zhao\\Desktop\\fsdownload"
72-
);
73-
System.out.println("文件已保存到:" + path);
87+
final MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
88+
// 通过 工厂类 以及稀疏矩阵的方式创建两个矩阵 4行5列 元素全是 2
89+
final IntegerMatrix integerMatrix = matrixFactory.fill(2, 4, 5);
90+
final DoubleMatrix doubleMatrix = matrixFactory.fill(2.0, 4, 5);
91+
System.out.println(integerMatrix);
92+
System.out.println(doubleMatrix);
93+
// 使用随机的方式创建矩阵
94+
final IntegerMatrix integerMatrix1 = matrixFactory.randomGetInt(4, 5, 100);
95+
final DoubleMatrix doubleMatrix1 = matrixFactory.randomGetDouble(4, 5, 100);
96+
System.out.println(integerMatrix1);
97+
System.out.println(doubleMatrix1);
7498
}
7599
}
100+
76101
```
77102

78-
### Version update date : 2024-01-09
103+
### Version update date : 2024-01-13

src_code/README.md

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,72 +7,88 @@
77
</a>
88

99
### Update log:
10-
* Framework version: 1.27 - 1.28
11-
* New component for calculating fraction operands, supporting the creation and calculation of fraction operands
10+
* Framework version: 1.28 - 1.29
11+
* Fix the issue of incorrect printed data when performing non copy inversion operations in vectors. This is because the
12+
data inside the vector is not automatically refreshed. Version 1.29 has resolved this issue!
1213

1314
```java
14-
package zhao.algorithmMagic;
15+
package com.zhao;
1516

1617
import zhao.algorithmMagic.core.AlgorithmStar;
17-
import zhao.algorithmMagic.core.FractionFactory;
18-
import zhao.algorithmMagic.operands.fraction.Fraction;
18+
import zhao.algorithmMagic.core.VectorFactory;
19+
import zhao.algorithmMagic.operands.vector.IntegerVector;
1920

20-
public class MAIN1 {
21+
public class MAIN {
2122
public static void main(String[] args) {
22-
// 获取分数操作数工厂
23-
final FractionFactory fractionFactory = AlgorithmStar.fractionFactory();
24-
// 准备三个操作数
25-
final Fraction parse1 = fractionFactory.parse(1, 2);
26-
final Fraction parse2 = fractionFactory.parse(2);
27-
final Fraction parse3 = fractionFactory.parse("1 / 2");
28-
29-
System.out.println("打印三个分数");
30-
System.out.println(parse1);
31-
System.out.println(parse2);
32-
System.out.println(parse3);
23+
// 创建向量对象
24+
final VectorFactory vectorFactory = AlgorithmStar.vectorFactory();
25+
final IntegerVector integerVector = vectorFactory.parseVector(1, 2, 43, 4);
26+
// 向量整体反转 这里的参数代表的就是是否需要在拷贝的新向量中进行转换 1.28 以及 1.28 之前的版本
27+
// 打印出的字符串不太正确 1.29版本中会修复此问题
28+
System.out.println(integerVector.reverseLR(false));
29+
}
30+
}
31+
```
3332

34-
System.out.println("全部通分 分别将分母变为 10 5 1 在这里我们将第一个分数保存一下 稍后用于约分");
35-
final Fraction cf1 = parse1.cf(10);
36-
System.out.println(cf1);
37-
System.out.println(parse2.cf(5));
38-
System.out.println(parse3.cf(1));
33+
* For matrix factories, some creation methods have been added, allowing you to directly parse sparse matrices through
34+
the factory class. Of course, this operation is also supported in versions before 1.29!!!
3935

40-
System.out.println("将被通分的 cf1 进行约分 不出意外的话 这里打印的值为 1 / 2");
41-
System.out.println(cf1.simplify());
36+
```java
37+
package zhao.algorithmMagic;
4238

43-
System.out.println("在这里将 parse1 以及 parse2 进行加减乘除计算");
44-
System.out.println(parse1.add(parse2));
45-
System.out.println(parse1.diff(parse2));
46-
System.out.println(parse1.multiply(parse2));
47-
System.out.println(parse1.divide(parse2));
39+
import zhao.algorithmMagic.core.AlgorithmStar;
40+
import zhao.algorithmMagic.core.MatrixFactory;
41+
import zhao.algorithmMagic.operands.matrix.DoubleMatrix;
42+
import zhao.algorithmMagic.operands.matrix.IntegerMatrix;
4843

49-
System.out.println("在这里将 parse1 做为Java中的数值类型进行使用");
50-
System.out.println(parse1.doubleValue());
44+
public class MAIN1 {
45+
public static void main(String[] args) {
46+
final MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
47+
// 通过 工厂类 以及稀疏矩阵的方式创建两个矩阵
48+
final IntegerMatrix integerMatrix = matrixFactory.sparseMatrix(
49+
// 在坐标 (2,3) 的位置创建一个元素 1
50+
new int[]{1, 2, 3},
51+
// 在坐标 (1,2) 的位置创建一个元素 2
52+
new int[]{2, 1, 2}
53+
);
54+
final DoubleMatrix doubleMatrix = matrixFactory.sparseMatrix(
55+
// 在坐标 (2,3) 的位置创建一个元素 1
56+
new double[]{1, 2, 3},
57+
// 在坐标 (1,2) 的位置创建一个元素 2
58+
new double[]{2, 1, 2}
59+
);
60+
System.out.println(integerMatrix);
61+
System.out.println(doubleMatrix);
5162
}
5263
}
5364
```
5465

55-
* To obtain new help information, you can directly obtain the help document through the following methods, which
56-
includes more comprehensive API instructions
66+
* You can also use a matrix factory to fill and randomly create a matrix.
5767

5868
```java
5969
package zhao.algorithmMagic;
6070

6171
import zhao.algorithmMagic.core.AlgorithmStar;
62-
import zhao.algorithmMagic.core.HelpFactory;
72+
import zhao.algorithmMagic.core.MatrixFactory;
73+
import zhao.algorithmMagic.operands.matrix.DoubleMatrix;
74+
import zhao.algorithmMagic.operands.matrix.IntegerMatrix;
6375

6476
public class MAIN1 {
6577
public static void main(String[] args) {
66-
// 获取帮助信息工厂类
67-
final HelpFactory helpFactory = AlgorithmStar.helpFactory();
68-
// 下载帮助文档 到 C:\Users\zhao\Desktop\fsdownload 目录中
69-
final String path = helpFactory.saveHelpFile(
70-
HelpFactory.ALL,
71-
"C:\\Users\\zhao\\Desktop\\fsdownload"
72-
);
73-
System.out.println("文件已保存到:" + path);
78+
final MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
79+
// 通过 工厂类 以及稀疏矩阵的方式创建两个矩阵 4行5列 元素全是 2
80+
final IntegerMatrix integerMatrix = matrixFactory.fill(2, 4, 5);
81+
final DoubleMatrix doubleMatrix = matrixFactory.fill(2.0, 4, 5);
82+
System.out.println(integerMatrix);
83+
System.out.println(doubleMatrix);
84+
// 使用随机的方式创建矩阵
85+
final IntegerMatrix integerMatrix1 = matrixFactory.randomGetInt(4, 5, 100);
86+
final DoubleMatrix doubleMatrix1 = matrixFactory.randomGetDouble(4, 5, 100);
87+
System.out.println(integerMatrix1);
88+
System.out.println(doubleMatrix1);
7489
}
7590
}
91+
7692
```
7793

78-
### Version update date : 2024-01-09
94+
### Version update date : 2024-01-13

src_code/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.github.BeardedManZhao</groupId>
77
<artifactId>algorithmStar</artifactId>
8-
<version>1.28</version>
8+
<version>1.29</version>
99
<packaging>jar</packaging>
1010
<name>algorithmStar</name>
1111
<description>algorithmStar-java</description>

src_code/src/main/java/zhao/algorithmMagic/algorithm/OperationAlgorithmManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class OperationAlgorithmManager implements OperationAlgorithm {
2121
/**
2222
* AS version
2323
*/
24-
public final static float VERSION = 1.28f;
24+
public final static float VERSION = 1.29f;
2525

2626
/**
2727
* 计算组件的日志打印开关,当此处值为false的时候,计算组件中的日志将不会被打印,logger也不会被调用,一般来说,这里为了减少冗余的字符串实例化操作,会设置为false,当需要调试的时候才需要打开此处的数值。

src_code/src/main/java/zhao/algorithmMagic/core/AlgorithmStar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public static VectorFactory vectorFactory() {
7777
* @return 矩阵工厂类
7878
* @author 赵凌宇
7979
*/
80-
public static MatixFactory matixFactory() {
81-
return new MatixFactory();
80+
public static MatrixFactory matrixFactory() {
81+
return new MatrixFactory();
8282
}
8383

8484
/**

src_code/src/main/java/zhao/algorithmMagic/core/FractionFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public class FractionFactory {
1414
* <p>
1515
* You can parse out a fraction object without passing the denominator, where the denominator will be set to 1
1616
*
17-
* @param molecule 分子的数值
18-
* <p>
19-
* Numeric values of molecules
20-
* @param denominator 分母的数值
21-
* <p>
22-
* Numeric values of denominators
17+
* @param molecule 分子的数值
18+
* <p>
19+
* Numeric values of molecules
20+
* @param denominator 分母的数值
21+
* <p>
22+
* Numeric values of denominators
2323
* @return 解析出来的分数对象
2424
* <p>
2525
* Parse out a score object

0 commit comments

Comments
 (0)