From 477f7dd0799c67882f67742b30feb004a658f9f7 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Mon, 1 Mar 2021 13:01:15 +0000 Subject: [PATCH 1/3] Deprecating div methods --- .../kscience/kmath/operations/Algebra.kt | 1 + .../kscience/kmath/nd4j/Nd4jArrayAlgebra.kt | 1 + .../src/cppMain/.vscode/c_cpp_properties.json | 21 ++++++ kmath-torch/src/cppMain/.vscode/settings.json | 71 ++++++++++++++++++ .../java/kscience/kmath/torch/JTorch.class | Bin 0 -> 3022 bytes 5 files changed, 94 insertions(+) create mode 100644 kmath-torch/src/cppMain/.vscode/c_cpp_properties.json create mode 100644 kmath-torch/src/cppMain/.vscode/settings.json create mode 100644 kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt index 201e39314..572f7089a 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt @@ -175,6 +175,7 @@ public interface SpaceOperations : Algebra { * @param k the divisor. * @return the quotient. */ + @Deprecated("Dividing not allowed in a Ring") public operator fun T.div(k: Number): T = multiply(this, 1.0 / k.toDouble()) /** diff --git a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt index 1e9818a4a..c50174b95 100644 --- a/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt +++ b/kmath-nd4j/src/main/kotlin/space/kscience/kmath/nd4j/Nd4jArrayAlgebra.kt @@ -96,6 +96,7 @@ public interface Nd4jArraySpace> : NDSpace, Nd4jArrayAlgeb return a.ndArray.mul(k).wrap() } + @Deprecated("Avoid using this method, underlying array get casted to Doubles") public override operator fun NDStructure.div(k: Number): Nd4jArrayStructure { return ndArray.div(k).wrap() } diff --git a/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json b/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json new file mode 100644 index 000000000..711f47bff --- /dev/null +++ b/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "${env:HOME}/miniconda3/envs/ghmc/include", + "${env:HOME}/miniconda3/envs/ghmc/include/python3.8", + "${env:HOME}/miniconda3/envs/ghmc/include/torch/csrc/api/include", + "${env:HOME}/.jdks/openjdk-15.0.2/include", + "${env:HOME}/.jdks/openjdk-15.0.2/include/linux" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu11", + "cppStandard": "gnu++17", + "intelliSenseMode": "gcc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/kmath-torch/src/cppMain/.vscode/settings.json b/kmath-torch/src/cppMain/.vscode/settings.json new file mode 100644 index 000000000..fd26c7488 --- /dev/null +++ b/kmath-torch/src/cppMain/.vscode/settings.json @@ -0,0 +1,71 @@ +{ + "python.linting.pylintEnabled": false, + "python.linting.mypyEnabled": true, + "python.linting.enabled": false, + "files.associations": { + "chrono": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "array": "cpp", + "atomic": "cpp", + "*.tcc": "cpp", + "cinttypes": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp", + "variant": "cpp", + "future": "cpp", + "bit": "cpp" + }, + "python.pythonPath": "${env:HOME}/miniconda3/envs/ghmc/bin/python" +} \ No newline at end of file diff --git a/kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class b/kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class new file mode 100644 index 0000000000000000000000000000000000000000..d3ce6fcc9b61d2acc35c9bd9c5d5978314a56454 GIT binary patch literal 3022 zcmZWrXL}n(5T1*za*{0B0n3E0MfO*=_z>1^pvxjV@*z4zXG z@89?Y4ci-WM)$w3bC87LHB42nBK7dE3<^(@GD z1GhEjH9|Msv|!Si+frYML(gwdPc3C&+=4ypQPWd?QMsZA|mcyrKlYtih`^}0G73tF}y zgVPt3YGJyn*N-_N+m`az_O0ws>B zY22BLhev>H+>@-{Db>XVak$WN`)U^J=ZesuClZfDi&>kZrDodW8lEQ8e-f-t6P@(X+@dV8+nUHnGee|w(cGPU?DbS+WK&Ls6Ui|vswt<+q|Kxj+R=zP!f2a%aDvCT>p20lIp z$7mWJFSn6QE+u0#wG`t)+VOG0Q>4GVlmBs<5Iq5#YpYZ8slz=<#%7w`4caEjQZi1w z5k4vM2$Yhs@uu;C>J9KaR?q{(PiS-AYjux0d-rCWm; z7oyFc@{+XJvCNK8og8?fijIaZ>d==CU#${;O6GSs@G$fIQcJ~dvs1-)3nTjYeiq$9 z9JDdotV*|WnLqR7>8L2#h3rhTE6;syAsB>BRrTnl&Fi=L06pNa7fSf6f&Q)HAO3Ct zy!1Fa578oK|LpD4=!T77%pMF6fR?Q#GVq|FL=4&6>ufbI{;)?9E8w78Jo7lct z@D|~xVTSoz;UME}qJO*iXWw<6Uq!RHe&}o#x+=H>_U&x zhk&sUCmBPC7-JYP4yDf Date: Mon, 1 Mar 2021 15:03:10 +0000 Subject: [PATCH 2/3] Adding .vscode to .gitignore --- .gitignore | 1 + .../src/cppMain/.vscode/c_cpp_properties.json | 21 ------ kmath-torch/src/cppMain/.vscode/settings.json | 71 ------------------ .../java/kscience/kmath/torch/JTorch.class | Bin 3022 -> 0 bytes 4 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 kmath-torch/src/cppMain/.vscode/c_cpp_properties.json delete mode 100644 kmath-torch/src/cppMain/.vscode/settings.json delete mode 100644 kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class diff --git a/.gitignore b/.gitignore index bade7f08c..ea8e65fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build/ out/ .idea/ +.vscode/ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) !gradle-wrapper.jar diff --git a/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json b/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json deleted file mode 100644 index 711f47bff..000000000 --- a/kmath-torch/src/cppMain/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**", - "${env:HOME}/miniconda3/envs/ghmc/include", - "${env:HOME}/miniconda3/envs/ghmc/include/python3.8", - "${env:HOME}/miniconda3/envs/ghmc/include/torch/csrc/api/include", - "${env:HOME}/.jdks/openjdk-15.0.2/include", - "${env:HOME}/.jdks/openjdk-15.0.2/include/linux" - ], - "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "gnu11", - "cppStandard": "gnu++17", - "intelliSenseMode": "gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/kmath-torch/src/cppMain/.vscode/settings.json b/kmath-torch/src/cppMain/.vscode/settings.json deleted file mode 100644 index fd26c7488..000000000 --- a/kmath-torch/src/cppMain/.vscode/settings.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "python.linting.pylintEnabled": false, - "python.linting.mypyEnabled": true, - "python.linting.enabled": false, - "files.associations": { - "chrono": "cpp", - "cctype": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "array": "cpp", - "atomic": "cpp", - "*.tcc": "cpp", - "cinttypes": "cpp", - "complex": "cpp", - "condition_variable": "cpp", - "cstdint": "cpp", - "deque": "cpp", - "forward_list": "cpp", - "list": "cpp", - "unordered_map": "cpp", - "unordered_set": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "map": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "optional": "cpp", - "random": "cpp", - "ratio": "cpp", - "set": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "fstream": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "ostream": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "typeindex": "cpp", - "typeinfo": "cpp", - "valarray": "cpp", - "variant": "cpp", - "future": "cpp", - "bit": "cpp" - }, - "python.pythonPath": "${env:HOME}/miniconda3/envs/ghmc/bin/python" -} \ No newline at end of file diff --git a/kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class b/kmath-torch/src/jvmMain/java/kscience/kmath/torch/JTorch.class deleted file mode 100644 index d3ce6fcc9b61d2acc35c9bd9c5d5978314a56454..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3022 zcmZWrXL}n(5T1*za*{0B0n3E0MfO*=_z>1^pvxjV@*z4zXG z@89?Y4ci-WM)$w3bC87LHB42nBK7dE3<^(@GD z1GhEjH9|Msv|!Si+frYML(gwdPc3C&+=4ypQPWd?QMsZA|mcyrKlYtih`^}0G73tF}y zgVPt3YGJyn*N-_N+m`az_O0ws>B zY22BLhev>H+>@-{Db>XVak$WN`)U^J=ZesuClZfDi&>kZrDodW8lEQ8e-f-t6P@(X+@dV8+nUHnGee|w(cGPU?DbS+WK&Ls6Ui|vswt<+q|Kxj+R=zP!f2a%aDvCT>p20lIp z$7mWJFSn6QE+u0#wG`t)+VOG0Q>4GVlmBs<5Iq5#YpYZ8slz=<#%7w`4caEjQZi1w z5k4vM2$Yhs@uu;C>J9KaR?q{(PiS-AYjux0d-rCWm; z7oyFc@{+XJvCNK8og8?fijIaZ>d==CU#${;O6GSs@G$fIQcJ~dvs1-)3nTjYeiq$9 z9JDdotV*|WnLqR7>8L2#h3rhTE6;syAsB>BRrTnl&Fi=L06pNa7fSf6f&Q)HAO3Ct zy!1Fa578oK|LpD4=!T77%pMF6fR?Q#GVq|FL=4&6>ufbI{;)?9E8w78Jo7lct z@D|~xVTSoz;UME}qJO*iXWw<6Uq!RHe&}o#x+=H>_U&x zhk&sUCmBPC7-JYP4yDf Date: Mon, 1 Mar 2021 15:15:19 +0000 Subject: [PATCH 3/3] JNI generated files added to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index ea8e65fb4..07589aa00 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ out/ # Cache of project .gradletasknamecache + +# Generated by javac -h and runtime +*.class +*.log -- 2.34.1