-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpom.xml
More file actions
500 lines (481 loc) · 21.2 KB
/
pom.xml
File metadata and controls
500 lines (481 loc) · 21.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.yishape.lab</groupId>
<artifactId>yishape-math</artifactId>
<version>0.5.0</version>
<packaging>jar</packaging>
<name>YiShape Math</name>
<description>
Java library for numerical computation, statistics, linear algebra, optimization, plotting (JavaFX/ECharts), and related utilities.
Requires Java 25+; compile/runtime uses the incubator Vector API module (jdk.incubator.vector).
Optional native acceleration: enable Maven profile with-hpc (after installing com.yishape.lab:yishape-math-hpc locally or from your repository); applications add that artifact explicitly for native acceleration—it is not transitive. Core APIs use reflection and fall back to pure Java when the extension JAR or native library is absent. RereDoubleMatrix#svd uses EJML for large dense matrices (≥ about 400×400 elements) when HPC is unavailable, otherwise Commons Math3. Tuning: yishape.hpc.gemm.minFlops (~1e6), yishape.hpc.cholesky.minDim (768), yishape.hpc.svd.minTotalElements (10001), yishape.hpc.solve.minDim (512, dense Ax=b via solveSquare); yishape.hpc.decomp.minDim aliases Cholesky when cholesky.minDim is unset.
</description>
<url>https://github.com/scalefree-tech/yishape-math</url>
<inceptionYear>2014</inceptionYear>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<!-- Sonatype 后台核准 groupId 后,建议补充 developer id / email / organizationUrl -->
<developers>
<developer>
<id>scale-free-tech</id>
<name>Maintainer</name>
<organization>Scale-Free Tech</organization>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/scalefree-tech/yishape-math.git</connection>
<developerConnection>scm:git:ssh://git@github.com:ScaleFree-Tech/yishape-math.git</developerConnection>
<url>https://github.com/scalefree-tech/yishape-math</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/scalefree-tech/yishape-math/issues</url>
</issueManagement>
<!-- 部署地址以 Sonatype / Maven Central 注册邮箱中的说明为准(可能是 ossrh 或 s01.oss.sonatype.org) -->
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>25</maven.compiler.release>
<maven.surefire.argLine>--enable-native-access=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-modules jdk.incubator.vector</maven.surefire.argLine>
<!-- JaCoCo 与 Surefire 共用:prepare-agent 会注入 agent 前缀 -->
<argLine>${maven.surefire.argLine}</argLine>
<!-- GitHub Packages:仓库 URL 中的 owner/repo 须与发布目标一致 -->
<github.owner>scalefree-tech</github.owner>
<github.repo.math>yishape-math</github.repo.math>
<github.repo.hpc>yishape-math-hpc</github.repo.hpc>
</properties>
<!-- 发布到 Maven Central 的 POM 不应声明额外仓库;依赖须可从 Maven Central 解析 -->
<dependencies>
<!-- Support for OpenCL GPUs -->
<!--
<dependency>
<groupId>com.aparapi</groupId>
<artifactId>aparapi</artifactId>
<version>3.0.2</version>
<optional>true</optional>
</dependency>
-->
<!--Support for high performance computing-->
<dependency>
<groupId>com.yishape.lab</groupId>
<artifactId>yishape-math-hpc</artifactId>
<version>0.5.0</version>
<optional>true</optional>
</dependency>
<!-- Support for CSV files reading -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.10.0</version>
</dependency>
<!-- Support for ECharts.js plotting -->
<dependency>
<groupId>org.icepear.echarts</groupId>
<artifactId>echarts-java</artifactId>
<version>1.1.0</version>
</dependency>
<!-- JavaFX dependencies for plotting -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>26.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>26.0.1</version>
</dependency>
<!-- SvgPlot 窗口内预览:SVG→位图(不引入 javafx-web / WebKit) -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId>
<version>1.17</version>
</dependency>
<!-- PNGTranscoder 写出 PNG 依赖 codec 模块注册的 WriteAdapter,否则运行时报 no WriteAdapter is available -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-codec</artifactId>
<version>1.17</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.4</version>
</dependency>
<!-- yishape-math-hpc 见 profile with-hpc:未发布到 Central,默认 POM 不声明以免 CI/中央仓库解析失败 -->
<!-- SLF4J API:库内记录日志,由应用提供绑定实现 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<!--
仅测试使用:scope=test 的依赖不会参与主代码编译产物的传递解析,
发布到仓库的 POM 中虽会列出,但引用本库时 Maven 不会拉取这些依赖;
主 JAR 仅含 src/main,不含 JUnit 与 src/test。
-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.16</version>
<scope>test</scope>
</dependency>
<!-- Apache Commons Math 4 (legacy) for benchmark comparison: test-scope only -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math4-legacy</artifactId>
<version>4.0-beta1</version>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.40</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
</dependency>
-->
<!-- JMH benchmarks -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.37</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.37</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<release>25</release>
<encoding>utf8</encoding>
<!-- bench 包直接 import hpc API,无 with-hpc 时跳过 test 编译 -->
<testExcludes>
<testExclude>**/bench/**</testExclude>
</testExcludes>
<!-- 如果你的项目使用了类似Vector API这样的孵化模块,需要额外配置编译器参数 -->
<compilerArgs>
<arg>--add-modules</arg>
<arg>jdk.incubator.vector</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<classpathScope>test</classpathScope>
<jvmArguments>
<jvmArgument>--add-modules</jvmArgument>
<jvmArgument>jdk.incubator.vector</jvmArgument>
<jvmArgument>--enable-native-access=ALL-UNNAMED</jvmArgument>
</jvmArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
<argLine>${argLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<compress>true</compress> <!-- 启用压缩 -->
<index>true</index> <!-- 创建索引加快加载 -->
<manifestEntries>
<Automatic-Module-Name>com.yishape.lab.math</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.3</version>
<configuration>
<!-- 使用 release;勿再使用已过时的 -source 1.1 / -1.1 等选项 -->
<release>25</release>
<doclint>none</doclint>
<quiet>true</quiet>
<tags>
<tag>
<name>apiNote</name>
<placement>a</placement>
<head>API Note:</head>
</tag>
<tag>
<name>implSpec</name>
<placement>a</placement>
<head>Implementation Requirements:</head>
</tag>
</tags>
<!-- 与 compiler 一致:否则 javadoc 无法解析 jdk.incubator.vector -->
<additionalOptions>
<additionalOption>--add-modules</additionalOption>
<additionalOption>jdk.incubator.vector</additionalOption>
</additionalOptions>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>jacoco-prepare</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>
</limit>
</limits>
<excludes>
<exclude>com.yishape.lab.math.plot.*</exclude>
<exclude>com.yishape.lab.math.viz.*</exclude>
<exclude>com.yishape.lab.math.signal.*</exclude>
</excludes>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.9.3.0</version>
<configuration>
<effort>Max</effort>
<threshold>Medium</threshold>
<failOnError>false</failOnError>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<!-- 未指定 includeScope 时默认复制全部作用域(含 test);runtime = compile+runtime,不含 test -->
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- 中央仓库发布:本地先配置 ~/.m2/settings.xml 中 server id=ossrh 的用户名/密码(Token);再执行 -Prelease-sign -->
<profiles>
<!-- 本地:先 cd yishape-math-hpc && mvn install,再 mvn test -Pwith-hpc -->
<profile>
<id>with-hpc</id>
<dependencies>
<dependency>
<groupId>com.yishape.lab</groupId>
<artifactId>yishape-math-hpc</artifactId>
<version>${project.version}</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<testExcludes combine.children="override"/>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- 从 GitHub Packages 解析 hpc(~/.m2/settings.xml 中配置 server id=github-hpc,见 .github/maven-settings.example.xml) -->
<profile>
<id>with-hpc-from-github</id>
<dependencies>
<dependency>
<groupId>com.yishape.lab</groupId>
<artifactId>yishape-math-hpc</artifactId>
<version>${project.version}</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>github-hpc</id>
<url>https://maven.pkg.github.com/${github.owner}/${github.repo.hpc}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<testExcludes combine.children="override"/>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>github-packages</id>
<distributionManagement>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/${github.owner}/${github.repo.math}</url>
</repository>
<snapshotRepository>
<id>github</id>
<url>https://maven.pkg.github.com/${github.owner}/${github.repo.math}</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>release-sign</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- CI 无 TTY 时可改用 pinentry-mode loopback + MAVEN_GPG_PASSPHRASE 环境变量 -->
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>