Maniverse 0.2.8__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Maniverse might be problematic. Click here for more details.
- maniverse-0.3.0/Maniverse.egg-info/PKG-INFO +96 -0
- maniverse-0.3.0/Maniverse.egg-info/SOURCES.txt +17 -0
- maniverse-0.3.0/PKG-INFO +96 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/README.md +18 -1
- maniverse-0.3.0/pyproject.toml +3 -0
- maniverse-0.3.0/setup.cfg +4 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/setup.py +8 -16
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Manifold/TransRotInvPointCloud.cpp +2 -1
- Maniverse-0.2.8/Maniverse.egg-info/PKG-INFO +0 -8
- Maniverse-0.2.8/Maniverse.egg-info/SOURCES.txt +0 -41
- Maniverse-0.2.8/PKG-INFO +0 -8
- Maniverse-0.2.8/pyproject.toml +0 -3
- Maniverse-0.2.8/setup.cfg +0 -7
- Maniverse-0.2.8/src/Macro.h +0 -19
- Maniverse-0.2.8/src/Manifold/Grassmann.h +0 -27
- Maniverse-0.2.8/src/Manifold/Manifold.h +0 -47
- Maniverse-0.2.8/src/Manifold/Orthogonal.h +0 -23
- Maniverse-0.2.8/src/Manifold/PyManifoldIn.h +0 -5
- Maniverse-0.2.8/src/Manifold/PyManifoldOut.h +0 -5
- Maniverse-0.2.8/src/Manifold/Simplex.h +0 -24
- Maniverse-0.2.8/src/Manifold/TransRotInvPointCloud.h +0 -23
- Maniverse-0.2.8/src/Manifold/makefile +0 -18
- Maniverse-0.2.8/src/Maniverse.egg-info/PKG-INFO +0 -8
- Maniverse-0.2.8/src/Maniverse.egg-info/SOURCES.txt +0 -8
- Maniverse-0.2.8/src/Maniverse.egg-info/dependency_links.txt +0 -1
- Maniverse-0.2.8/src/Maniverse.egg-info/top_level.txt +0 -2
- Maniverse-0.2.8/src/Optimizer/HessUpdate.h +0 -21
- Maniverse-0.2.8/src/Optimizer/PyOptimizerIn.h +0 -3
- Maniverse-0.2.8/src/Optimizer/PyOptimizerOut.h +0 -3
- Maniverse-0.2.8/src/Optimizer/SubSolver.h +0 -16
- Maniverse-0.2.8/src/Optimizer/TrustRegion.h +0 -33
- Maniverse-0.2.8/src/Optimizer/makefile +0 -12
- Maniverse-0.2.8/src/makefile +0 -12
- {Maniverse-0.2.8 → maniverse-0.3.0}/LICENSE +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/Maniverse.egg-info/dependency_links.txt +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/Maniverse.egg-info/top_level.txt +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Manifold/Grassmann.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Manifold/Manifold.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Manifold/Orthogonal.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Manifold/Simplex.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Optimizer/HessUpdate.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Optimizer/SubSolver.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/Optimizer/TrustRegion.cpp +0 -0
- {Maniverse-0.2.8 → maniverse-0.3.0}/src/PyManiverse.cpp +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Maniverse
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Numerical optimization on manifolds
|
|
5
|
+
Home-page: https://github.com/FreemanTheMaverick/Maniverse.git
|
|
6
|
+
Author: FreemanTheMaverick
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: classifier
|
|
12
|
+
Dynamic: description
|
|
13
|
+
Dynamic: description-content-type
|
|
14
|
+
Dynamic: home-page
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
Dynamic: summary
|
|
17
|
+
|
|
18
|
+
# Maniverse
|
|
19
|
+
> Numerical optimization on manifolds
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
Maniverse is a library for optimization on manifolds (OOM).
|
|
23
|
+
|
|
24
|
+
### What is Maniverse intended for?
|
|
25
|
+
I wrote Maniverse primarily for my quantum chemistry packages [Chinium](https://github.com/FreemanTheMaverick/Chinium) and [Orbaplaw](https://github.com/FreemanTheMaverick/Orbaplaw), which take care of some classic constraints in quantum chemistry via OOM.
|
|
26
|
+
However, Maniverse is intended for more general use than merely quantum chemistry.
|
|
27
|
+
|
|
28
|
+
### Why another library for OOM?
|
|
29
|
+
The two packages mentioned above are written in C++ and Python separately, so I hoped to have a single library for both C++ and Python.
|
|
30
|
+
As far as I know, none of the existing libraries are 2-in-1.
|
|
31
|
+
|
|
32
|
+
### How will Maniverse be maintained?
|
|
33
|
+
Optimization on manifolds has two aspects: the manifolds and the optimization algorithms.
|
|
34
|
+
Therefore, this question should be divided into two: how will the two aspects be maintained separately?
|
|
35
|
+
|
|
36
|
+
For the manifolds, as a quantum chemist, I focused more on the Stiefel manifold and the Grassmann manifold (and their derivatives), so major emphasis will be laid on these two.
|
|
37
|
+
However, users are welcomed to give advice on more manifolds to be supported.
|
|
38
|
+
Additionally, Maniverse provides a base class `Manifold` from which users can derive their own manifold class.
|
|
39
|
+
|
|
40
|
+
For the optimization algorithms, the attention is paid to the second-order methods, because nearly all the functions to be optimized in quantum chemistry are smooth and well-behaved.
|
|
41
|
+
These methods include Riemannian trust region method and Riemannian BFGS.
|
|
42
|
+
I would like to keep track of the popular field of OOM and implement more efficient algorithms as they are being proposed, as long as they enhance the performance in my projects on quantum chemistry.
|
|
43
|
+
|
|
44
|
+
### Are you an expert on OOM?
|
|
45
|
+
No.
|
|
46
|
+
It has just occurred to me that OOM can be extremely powerful in some topics in quantum chemistry in middle 2024, so I set out to develop Maniverse.
|
|
47
|
+
However, my knowledge in OOM is deficient, and I am still learning through textbooks, papers and discussions on webs.
|
|
48
|
+
For helping make Maniverse real, I have a long namelist to thank.
|
|
49
|
+
The good thing is that the current codes do work as they are expected, at least in my projects.
|
|
50
|
+
|
|
51
|
+
## Prerequisites
|
|
52
|
+
* A C++ compiler that supports C++17 standard
|
|
53
|
+
* GNU make
|
|
54
|
+
* [Eigen3](https://eigen.tuxfamily.org/index.php?title=Main_Page) >= 3.4.90
|
|
55
|
+
* [PyBind11](https://pybind11.readthedocs.io/en/stable/index.html#) >= 2.13.6 (For interface to python)
|
|
56
|
+
* Python3 with numpy (For interface to python)
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
### Manual build
|
|
60
|
+
* Cloning the repository
|
|
61
|
+
```
|
|
62
|
+
$ git clone https://github.com/FreemanTheMaverick/Maniverse.git
|
|
63
|
+
```
|
|
64
|
+
* Edit the first few lines of `/Maniverse/makefile` for your own computer configuration, including
|
|
65
|
+
* the commands that call the C++ compiler, the GNU make and `ar`
|
|
66
|
+
* the option that indicates whether to build for C++ use or python use
|
|
67
|
+
* the directories that contain the necessary libraries
|
|
68
|
+
* ```make -j[N]``` and you will find the newly created directories `/Maniverse/include` and `/Maniverse/lib`.
|
|
69
|
+
* Utilize Maniverse in your project
|
|
70
|
+
* For C++,
|
|
71
|
+
```
|
|
72
|
+
$ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -l:libmaniverse.a # Static linking
|
|
73
|
+
$ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -lmaniverse # Shared linking
|
|
74
|
+
```
|
|
75
|
+
* For Python,
|
|
76
|
+
```
|
|
77
|
+
$ export PYTHONPATH=$PYTHONPATH:$(MANIVERSE)/lib/
|
|
78
|
+
$ python
|
|
79
|
+
>>> import Maniverse as mv
|
|
80
|
+
```
|
|
81
|
+
### Pip (for Python use only)
|
|
82
|
+
* Setting environment variables
|
|
83
|
+
```
|
|
84
|
+
$ export PYTHON3=[The path where you can find "Python.h".] # You may check this by the command "locate Python.h".
|
|
85
|
+
$ export EIGEN3=[The path where you can find "Eigen/", "signature_of_eigen3_matrix_library" and "unsupported/".] # This is optional. If this is not set, the Eigen3 library will be downloaded automatically.
|
|
86
|
+
```
|
|
87
|
+
* Installation with `pip`
|
|
88
|
+
```
|
|
89
|
+
pip install Maniverse
|
|
90
|
+
```
|
|
91
|
+
Usually `pip` installs packages to a `lib/` directory that is already in `$PYTHONPATH`, so you do not need to set the environment variable for Maniverse.
|
|
92
|
+
* Utilize Maniverse in your project
|
|
93
|
+
```
|
|
94
|
+
$ python
|
|
95
|
+
>>> import Maniverse as mv
|
|
96
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
Maniverse.egg-info/PKG-INFO
|
|
6
|
+
Maniverse.egg-info/SOURCES.txt
|
|
7
|
+
Maniverse.egg-info/dependency_links.txt
|
|
8
|
+
Maniverse.egg-info/top_level.txt
|
|
9
|
+
src/PyManiverse.cpp
|
|
10
|
+
src/Manifold/Grassmann.cpp
|
|
11
|
+
src/Manifold/Manifold.cpp
|
|
12
|
+
src/Manifold/Orthogonal.cpp
|
|
13
|
+
src/Manifold/Simplex.cpp
|
|
14
|
+
src/Manifold/TransRotInvPointCloud.cpp
|
|
15
|
+
src/Optimizer/HessUpdate.cpp
|
|
16
|
+
src/Optimizer/SubSolver.cpp
|
|
17
|
+
src/Optimizer/TrustRegion.cpp
|
maniverse-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Maniverse
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Numerical optimization on manifolds
|
|
5
|
+
Home-page: https://github.com/FreemanTheMaverick/Maniverse.git
|
|
6
|
+
Author: FreemanTheMaverick
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: classifier
|
|
12
|
+
Dynamic: description
|
|
13
|
+
Dynamic: description-content-type
|
|
14
|
+
Dynamic: home-page
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
Dynamic: summary
|
|
17
|
+
|
|
18
|
+
# Maniverse
|
|
19
|
+
> Numerical optimization on manifolds
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
22
|
+
Maniverse is a library for optimization on manifolds (OOM).
|
|
23
|
+
|
|
24
|
+
### What is Maniverse intended for?
|
|
25
|
+
I wrote Maniverse primarily for my quantum chemistry packages [Chinium](https://github.com/FreemanTheMaverick/Chinium) and [Orbaplaw](https://github.com/FreemanTheMaverick/Orbaplaw), which take care of some classic constraints in quantum chemistry via OOM.
|
|
26
|
+
However, Maniverse is intended for more general use than merely quantum chemistry.
|
|
27
|
+
|
|
28
|
+
### Why another library for OOM?
|
|
29
|
+
The two packages mentioned above are written in C++ and Python separately, so I hoped to have a single library for both C++ and Python.
|
|
30
|
+
As far as I know, none of the existing libraries are 2-in-1.
|
|
31
|
+
|
|
32
|
+
### How will Maniverse be maintained?
|
|
33
|
+
Optimization on manifolds has two aspects: the manifolds and the optimization algorithms.
|
|
34
|
+
Therefore, this question should be divided into two: how will the two aspects be maintained separately?
|
|
35
|
+
|
|
36
|
+
For the manifolds, as a quantum chemist, I focused more on the Stiefel manifold and the Grassmann manifold (and their derivatives), so major emphasis will be laid on these two.
|
|
37
|
+
However, users are welcomed to give advice on more manifolds to be supported.
|
|
38
|
+
Additionally, Maniverse provides a base class `Manifold` from which users can derive their own manifold class.
|
|
39
|
+
|
|
40
|
+
For the optimization algorithms, the attention is paid to the second-order methods, because nearly all the functions to be optimized in quantum chemistry are smooth and well-behaved.
|
|
41
|
+
These methods include Riemannian trust region method and Riemannian BFGS.
|
|
42
|
+
I would like to keep track of the popular field of OOM and implement more efficient algorithms as they are being proposed, as long as they enhance the performance in my projects on quantum chemistry.
|
|
43
|
+
|
|
44
|
+
### Are you an expert on OOM?
|
|
45
|
+
No.
|
|
46
|
+
It has just occurred to me that OOM can be extremely powerful in some topics in quantum chemistry in middle 2024, so I set out to develop Maniverse.
|
|
47
|
+
However, my knowledge in OOM is deficient, and I am still learning through textbooks, papers and discussions on webs.
|
|
48
|
+
For helping make Maniverse real, I have a long namelist to thank.
|
|
49
|
+
The good thing is that the current codes do work as they are expected, at least in my projects.
|
|
50
|
+
|
|
51
|
+
## Prerequisites
|
|
52
|
+
* A C++ compiler that supports C++17 standard
|
|
53
|
+
* GNU make
|
|
54
|
+
* [Eigen3](https://eigen.tuxfamily.org/index.php?title=Main_Page) >= 3.4.90
|
|
55
|
+
* [PyBind11](https://pybind11.readthedocs.io/en/stable/index.html#) >= 2.13.6 (For interface to python)
|
|
56
|
+
* Python3 with numpy (For interface to python)
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
### Manual build
|
|
60
|
+
* Cloning the repository
|
|
61
|
+
```
|
|
62
|
+
$ git clone https://github.com/FreemanTheMaverick/Maniverse.git
|
|
63
|
+
```
|
|
64
|
+
* Edit the first few lines of `/Maniverse/makefile` for your own computer configuration, including
|
|
65
|
+
* the commands that call the C++ compiler, the GNU make and `ar`
|
|
66
|
+
* the option that indicates whether to build for C++ use or python use
|
|
67
|
+
* the directories that contain the necessary libraries
|
|
68
|
+
* ```make -j[N]``` and you will find the newly created directories `/Maniverse/include` and `/Maniverse/lib`.
|
|
69
|
+
* Utilize Maniverse in your project
|
|
70
|
+
* For C++,
|
|
71
|
+
```
|
|
72
|
+
$ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -l:libmaniverse.a # Static linking
|
|
73
|
+
$ g++ test.cpp -isystem $(MANIVERSE)/include/ -L$(MANIVERSE)/lib/ -lmaniverse # Shared linking
|
|
74
|
+
```
|
|
75
|
+
* For Python,
|
|
76
|
+
```
|
|
77
|
+
$ export PYTHONPATH=$PYTHONPATH:$(MANIVERSE)/lib/
|
|
78
|
+
$ python
|
|
79
|
+
>>> import Maniverse as mv
|
|
80
|
+
```
|
|
81
|
+
### Pip (for Python use only)
|
|
82
|
+
* Setting environment variables
|
|
83
|
+
```
|
|
84
|
+
$ export PYTHON3=[The path where you can find "Python.h".] # You may check this by the command "locate Python.h".
|
|
85
|
+
$ export EIGEN3=[The path where you can find "Eigen/", "signature_of_eigen3_matrix_library" and "unsupported/".] # This is optional. If this is not set, the Eigen3 library will be downloaded automatically.
|
|
86
|
+
```
|
|
87
|
+
* Installation with `pip`
|
|
88
|
+
```
|
|
89
|
+
pip install Maniverse
|
|
90
|
+
```
|
|
91
|
+
Usually `pip` installs packages to a `lib/` directory that is already in `$PYTHONPATH`, so you do not need to set the environment variable for Maniverse.
|
|
92
|
+
* Utilize Maniverse in your project
|
|
93
|
+
```
|
|
94
|
+
$ python
|
|
95
|
+
>>> import Maniverse as mv
|
|
96
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Maniverse
|
|
2
|
-
>
|
|
2
|
+
> Numerical optimization on manifolds
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
5
|
Maniverse is a library for optimization on manifolds (OOM).
|
|
@@ -39,6 +39,7 @@ The good thing is that the current codes do work as they are expected, at least
|
|
|
39
39
|
* Python3 with numpy (For interface to python)
|
|
40
40
|
|
|
41
41
|
## Installation
|
|
42
|
+
### Manual build
|
|
42
43
|
* Cloning the repository
|
|
43
44
|
```
|
|
44
45
|
$ git clone https://github.com/FreemanTheMaverick/Maniverse.git
|
|
@@ -60,3 +61,19 @@ $ git clone https://github.com/FreemanTheMaverick/Maniverse.git
|
|
|
60
61
|
$ python
|
|
61
62
|
>>> import Maniverse as mv
|
|
62
63
|
```
|
|
64
|
+
### Pip (for Python use only)
|
|
65
|
+
* Setting environment variables
|
|
66
|
+
```
|
|
67
|
+
$ export PYTHON3=[The path where you can find "Python.h".] # You may check this by the command "locate Python.h".
|
|
68
|
+
$ export EIGEN3=[The path where you can find "Eigen/", "signature_of_eigen3_matrix_library" and "unsupported/".] # This is optional. If this is not set, the Eigen3 library will be downloaded automatically.
|
|
69
|
+
```
|
|
70
|
+
* Installation with `pip`
|
|
71
|
+
```
|
|
72
|
+
pip install Maniverse
|
|
73
|
+
```
|
|
74
|
+
Usually `pip` installs packages to a `lib/` directory that is already in `$PYTHONPATH`, so you do not need to set the environment variable for Maniverse.
|
|
75
|
+
* Utilize Maniverse in your project
|
|
76
|
+
```
|
|
77
|
+
$ python
|
|
78
|
+
>>> import Maniverse as mv
|
|
79
|
+
```
|
|
@@ -8,23 +8,17 @@ from setuptools.command.build import build
|
|
|
8
8
|
import pybind11
|
|
9
9
|
from pybind11.setup_helpers import Pybind11Extension, ParallelCompile, naive_recompile
|
|
10
10
|
|
|
11
|
-
__version__ = "0.
|
|
11
|
+
__version__ = "0.3.0"
|
|
12
12
|
pwd = os.path.dirname(__file__)
|
|
13
13
|
|
|
14
14
|
# Checking dependencies
|
|
15
|
-
PYTHON3 = os.getenv("PYTHON3", default = '')
|
|
16
|
-
print("Looking for Python.h at %s ..." % PYTHON3, end='')
|
|
17
|
-
if os.path.isfile(PYTHON3 + "/Python.h"):
|
|
18
|
-
print("Found!")
|
|
19
|
-
else:
|
|
20
|
-
raise RuntimeError("Python.h does not exist!")
|
|
21
15
|
EIGEN3 = os.getenv("EIGEN3", default = '')
|
|
22
16
|
if len(EIGEN3) > 0:
|
|
23
17
|
print("Looking for Eigen3 at %s ..." % EIGEN3, end='')
|
|
24
18
|
if os.path.exists(EIGEN3 + "/Eigen/") and os.path.exists(EIGEN3 + "/unsupported/") and os.path.isfile(EIGEN3 + "/signature_of_eigen3_matrix_library"):
|
|
25
19
|
print("Found!")
|
|
26
20
|
else:
|
|
27
|
-
raise RuntimeError("
|
|
21
|
+
raise RuntimeError("Eigen3 does not exist!")
|
|
28
22
|
else:
|
|
29
23
|
print("The environment variable $EIGEN3 is not set. -> Downloading ...")
|
|
30
24
|
filename = wget.download("https://gitlab.com/libeigen/eigen/-/archive/3.4-rc1/eigen-3.4-rc1.tar.gz", bar = None)
|
|
@@ -32,11 +26,8 @@ else:
|
|
|
32
26
|
tar.extractall(path = pwd) # Directory: eigen-3.4-rc1
|
|
33
27
|
EIGEN3 = pwd + "/eigen-3.4-rc1/"
|
|
34
28
|
print("EIGEN3 is %s." % EIGEN3)
|
|
35
|
-
PYBIND11 = pybind11.get_include()
|
|
36
|
-
print("PYBIND11 is %s." % PYBIND11)
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
os.chdir(BASE_DIR)
|
|
30
|
+
pwd = os.path.abspath(pwd)
|
|
40
31
|
|
|
41
32
|
ParallelCompile(
|
|
42
33
|
"NPY_NUM_BUILD_JOBS",
|
|
@@ -44,12 +35,11 @@ ParallelCompile(
|
|
|
44
35
|
).install()
|
|
45
36
|
|
|
46
37
|
MV_CPP = sorted(glob("src/*.cpp") + glob("src/*/*.cpp"))
|
|
47
|
-
MV_HEADER = sorted(glob("src/*.h") + glob("src/*/*.h"))
|
|
48
38
|
ext_modules = [ Pybind11Extension(
|
|
49
39
|
"Maniverse",
|
|
50
40
|
MV_CPP,
|
|
51
41
|
undef_macros = ["DEBUG"],
|
|
52
|
-
include_dirs = [
|
|
42
|
+
include_dirs = [EIGEN3],
|
|
53
43
|
extra_compile_args = ["-O3", "-D__PYTHON__", "-DEIGEN_INITIALIZE_MATRICES_BY_ZERO"],
|
|
54
44
|
cxx_std = 17,
|
|
55
45
|
language = "c++"
|
|
@@ -59,8 +49,10 @@ setup(
|
|
|
59
49
|
name = "Maniverse",
|
|
60
50
|
version = __version__,
|
|
61
51
|
author = "FreemanTheMaverick",
|
|
62
|
-
description = "
|
|
63
|
-
|
|
52
|
+
description = "Numerical optimization on manifolds",
|
|
53
|
+
long_description = open("README.md").read(),
|
|
54
|
+
long_description_content_type = "text/markdown",
|
|
64
55
|
url = "https://github.com/FreemanTheMaverick/Maniverse.git",
|
|
56
|
+
ext_modules = ext_modules,
|
|
65
57
|
classifiers = ["Programming Language :: Python :: 3"]
|
|
66
58
|
)
|
|
@@ -120,7 +120,8 @@ EigenMatrix TransRotInvPointCloud::TransportManifold(EigenMatrix X, Manifold& N)
|
|
|
120
120
|
|
|
121
121
|
void TransRotInvPointCloud::Update(EigenMatrix p, bool purify){
|
|
122
122
|
const int rank = getRank(p);
|
|
123
|
-
|
|
123
|
+
if ( rank == p.cols() )
|
|
124
|
+
throw std::runtime_error("The matrix is column-rank-deficient!");
|
|
124
125
|
this->P = p;
|
|
125
126
|
if (purify) this->P = this->TangentPurification(p);
|
|
126
127
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Maniverse
|
|
3
|
-
Version: 0.2.8
|
|
4
|
-
Summary: Function optimization on manifolds
|
|
5
|
-
Home-page: https://github.com/FreemanTheMaverick/Maniverse.git
|
|
6
|
-
Author: FreemanTheMaverick
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
License-File: LICENSE
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
pyproject.toml
|
|
4
|
-
setup.cfg
|
|
5
|
-
setup.py
|
|
6
|
-
Maniverse.egg-info/PKG-INFO
|
|
7
|
-
Maniverse.egg-info/SOURCES.txt
|
|
8
|
-
Maniverse.egg-info/dependency_links.txt
|
|
9
|
-
Maniverse.egg-info/top_level.txt
|
|
10
|
-
src/Macro.h
|
|
11
|
-
src/Manifold
|
|
12
|
-
src/Maniverse.egg-info
|
|
13
|
-
src/Optimizer
|
|
14
|
-
src/PyManiverse.cpp
|
|
15
|
-
src/makefile
|
|
16
|
-
src/Manifold/Grassmann.cpp
|
|
17
|
-
src/Manifold/Grassmann.h
|
|
18
|
-
src/Manifold/Manifold.cpp
|
|
19
|
-
src/Manifold/Manifold.h
|
|
20
|
-
src/Manifold/Orthogonal.cpp
|
|
21
|
-
src/Manifold/Orthogonal.h
|
|
22
|
-
src/Manifold/PyManifoldIn.h
|
|
23
|
-
src/Manifold/PyManifoldOut.h
|
|
24
|
-
src/Manifold/Simplex.cpp
|
|
25
|
-
src/Manifold/Simplex.h
|
|
26
|
-
src/Manifold/TransRotInvPointCloud.cpp
|
|
27
|
-
src/Manifold/TransRotInvPointCloud.h
|
|
28
|
-
src/Manifold/makefile
|
|
29
|
-
src/Maniverse.egg-info/PKG-INFO
|
|
30
|
-
src/Maniverse.egg-info/SOURCES.txt
|
|
31
|
-
src/Maniverse.egg-info/dependency_links.txt
|
|
32
|
-
src/Maniverse.egg-info/top_level.txt
|
|
33
|
-
src/Optimizer/HessUpdate.cpp
|
|
34
|
-
src/Optimizer/HessUpdate.h
|
|
35
|
-
src/Optimizer/PyOptimizerIn.h
|
|
36
|
-
src/Optimizer/PyOptimizerOut.h
|
|
37
|
-
src/Optimizer/SubSolver.cpp
|
|
38
|
-
src/Optimizer/SubSolver.h
|
|
39
|
-
src/Optimizer/TrustRegion.cpp
|
|
40
|
-
src/Optimizer/TrustRegion.h
|
|
41
|
-
src/Optimizer/makefile
|
Maniverse-0.2.8/PKG-INFO
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Maniverse
|
|
3
|
-
Version: 0.2.8
|
|
4
|
-
Summary: Function optimization on manifolds
|
|
5
|
-
Home-page: https://github.com/FreemanTheMaverick/Maniverse.git
|
|
6
|
-
Author: FreemanTheMaverick
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
License-File: LICENSE
|
Maniverse-0.2.8/pyproject.toml
DELETED
Maniverse-0.2.8/setup.cfg
DELETED
Maniverse-0.2.8/src/Macro.h
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#define EigenArray Eigen::ArrayXd
|
|
2
|
-
#define EigenVector Eigen::VectorXd
|
|
3
|
-
#define EigenDiagonal Eigen::DiagonalMatrix<double, -1, -1>
|
|
4
|
-
#define EigenMatrix Eigen::MatrixXd
|
|
5
|
-
#define EigenZero Eigen::MatrixXd::Zero
|
|
6
|
-
#define EigenOne Eigen::MatrixXd::Identity
|
|
7
|
-
|
|
8
|
-
#define Diag(X) (X).diagonal().asDiagonal()
|
|
9
|
-
#define Dot(X, Y) ( (X).transpose() * (Y) ).trace()
|
|
10
|
-
|
|
11
|
-
#define __Not_Implemented__\
|
|
12
|
-
std::string func_name = __func__;\
|
|
13
|
-
std::string class_name = typeid(*this).name();\
|
|
14
|
-
throw std::runtime_error(func_name + " for " + class_name + " is not implemented!");
|
|
15
|
-
|
|
16
|
-
#define __True_False__(x) ( x ? "True" : "False" )
|
|
17
|
-
|
|
18
|
-
#define __now__ std::chrono::high_resolution_clock::now()
|
|
19
|
-
#define __duration__(start, end) std::chrono::duration<double>(end - start).count()
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#include "Manifold.h"
|
|
2
|
-
|
|
3
|
-
class Grassmann: public Manifold{ public:
|
|
4
|
-
EigenMatrix Projector;
|
|
5
|
-
mutable std::vector<std::tuple<EigenMatrix, EigenMatrix>> LogCache;
|
|
6
|
-
mutable std::vector<std::tuple<EigenMatrix, EigenMatrix, EigenMatrix>> TransportTangentCache;
|
|
7
|
-
|
|
8
|
-
Grassmann(EigenMatrix p, bool matrix_free);
|
|
9
|
-
|
|
10
|
-
int getDimension() const override;
|
|
11
|
-
double Inner(EigenMatrix X, EigenMatrix Y) const override;
|
|
12
|
-
|
|
13
|
-
EigenMatrix Exponential(EigenMatrix X) const override;
|
|
14
|
-
EigenMatrix Logarithm(Manifold& N) const override;
|
|
15
|
-
|
|
16
|
-
EigenMatrix TangentProjection(EigenMatrix A) const override;
|
|
17
|
-
EigenMatrix TangentPurification(EigenMatrix A) const override;
|
|
18
|
-
|
|
19
|
-
EigenMatrix TransportTangent(EigenMatrix X, EigenMatrix Y) const override;
|
|
20
|
-
EigenMatrix TransportManifold(EigenMatrix X, Manifold& N) const override;
|
|
21
|
-
|
|
22
|
-
void Update(EigenMatrix p, bool purify) override;
|
|
23
|
-
void getGradient() override;
|
|
24
|
-
void getHessian() override;
|
|
25
|
-
|
|
26
|
-
std::unique_ptr<Manifold> Clone() const override;
|
|
27
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#define __Check_Log_Map__\
|
|
4
|
-
if ( typeid(N) != typeid(*this) )\
|
|
5
|
-
throw std::runtime_error("The point to logarithm map is not in " + std::string(typeid(*this).name()) + "but in " + std::string(typeid(N).name()) + "!");
|
|
6
|
-
|
|
7
|
-
#define __Check_Vec_Transport__\
|
|
8
|
-
if ( typeid(N) != typeid(*this) )\
|
|
9
|
-
throw std::runtime_error("The destination of vector transport is not in " + std::string(typeid(*this).name()) + "but in " + std::string(typeid(N).name()) + "!");
|
|
10
|
-
|
|
11
|
-
class Manifold{ public:
|
|
12
|
-
std::string Name;
|
|
13
|
-
EigenMatrix P;
|
|
14
|
-
EigenMatrix Ge;
|
|
15
|
-
EigenMatrix Gr;
|
|
16
|
-
bool MatrixFree;
|
|
17
|
-
EigenMatrix Hem;
|
|
18
|
-
std::vector<std::tuple<double, EigenMatrix>> Hrm;
|
|
19
|
-
std::function<EigenMatrix (EigenMatrix)> He;
|
|
20
|
-
std::function<EigenMatrix (EigenMatrix)> Hr;
|
|
21
|
-
std::vector<EigenMatrix> BasisSet;
|
|
22
|
-
|
|
23
|
-
Manifold(EigenMatrix p, bool matrix_free);
|
|
24
|
-
virtual int getDimension() const;
|
|
25
|
-
virtual double Inner(EigenMatrix X, EigenMatrix Y) const;
|
|
26
|
-
void getBasisSet();
|
|
27
|
-
void getHessianMatrix();
|
|
28
|
-
|
|
29
|
-
virtual EigenMatrix Exponential(EigenMatrix X) const;
|
|
30
|
-
virtual EigenMatrix Logarithm(Manifold& N) const;
|
|
31
|
-
|
|
32
|
-
virtual EigenMatrix TangentProjection(EigenMatrix A) const;
|
|
33
|
-
virtual EigenMatrix TangentPurification(EigenMatrix A) const;
|
|
34
|
-
|
|
35
|
-
virtual EigenMatrix TransportTangent(EigenMatrix X, EigenMatrix Y) const;
|
|
36
|
-
virtual EigenMatrix TransportManifold(EigenMatrix X, Manifold& N) const;
|
|
37
|
-
|
|
38
|
-
virtual void Update(EigenMatrix p, bool purify);
|
|
39
|
-
virtual void getGradient();
|
|
40
|
-
virtual void getHessian();
|
|
41
|
-
|
|
42
|
-
virtual ~Manifold() = default;
|
|
43
|
-
virtual std::unique_ptr<Manifold> Clone() const;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
std::vector<std::tuple<double, EigenMatrix>> Diagonalize(
|
|
47
|
-
EigenMatrix& A, std::vector<EigenMatrix>& basis_set);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#include "Manifold.h"
|
|
2
|
-
|
|
3
|
-
class Orthogonal: public Manifold{ public:
|
|
4
|
-
Orthogonal(EigenMatrix p, bool matrix_free);
|
|
5
|
-
|
|
6
|
-
int getDimension() const override;
|
|
7
|
-
double Inner(EigenMatrix X, EigenMatrix Y) const override;
|
|
8
|
-
|
|
9
|
-
EigenMatrix Exponential(EigenMatrix X) const override;
|
|
10
|
-
EigenMatrix Logarithm(Manifold& N) const override;
|
|
11
|
-
|
|
12
|
-
EigenMatrix TangentProjection(EigenMatrix A) const override;
|
|
13
|
-
EigenMatrix TangentPurification(EigenMatrix A) const override;
|
|
14
|
-
|
|
15
|
-
EigenMatrix TransportTangent(EigenMatrix X, EigenMatrix Y) const override;
|
|
16
|
-
EigenMatrix TransportManifold(EigenMatrix X, Manifold& N) const override;
|
|
17
|
-
|
|
18
|
-
void Update(EigenMatrix p, bool purify) override;
|
|
19
|
-
void getGradient() override;
|
|
20
|
-
void getHessian() override;
|
|
21
|
-
|
|
22
|
-
std::unique_ptr<Manifold> Clone() const override;
|
|
23
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#include "Manifold.h"
|
|
2
|
-
|
|
3
|
-
class Simplex: public Manifold{ public:
|
|
4
|
-
EigenMatrix Hem;
|
|
5
|
-
Simplex(EigenMatrix p, bool hess_transport_matrix);
|
|
6
|
-
|
|
7
|
-
int getDimension() const override;
|
|
8
|
-
double Inner(EigenMatrix X, EigenMatrix Y) const override;
|
|
9
|
-
|
|
10
|
-
EigenMatrix Exponential(EigenMatrix X) const override;
|
|
11
|
-
EigenMatrix Logarithm(Manifold& N) const override;
|
|
12
|
-
|
|
13
|
-
EigenMatrix TangentProjection(EigenMatrix A) const override;
|
|
14
|
-
EigenMatrix TangentPurification(EigenMatrix A) const override;
|
|
15
|
-
|
|
16
|
-
//EigenMatrix TransportTangent(EigenMatrix X, EigenMatrix Y) override;
|
|
17
|
-
//EigenMatrix TransportManifold(EigenMatrix X, Manifold& N) override;
|
|
18
|
-
|
|
19
|
-
void Update(EigenMatrix p, bool purify) override;
|
|
20
|
-
void getGradient() override;
|
|
21
|
-
void getHessian() override;
|
|
22
|
-
|
|
23
|
-
std::unique_ptr<Manifold> Clone() const override;
|
|
24
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#include "Manifold.h"
|
|
2
|
-
|
|
3
|
-
class TransRotInvPointCloud: public Manifold{ public:
|
|
4
|
-
TransRotInvPointCloud(EigenMatrix p, bool matrix_free);
|
|
5
|
-
|
|
6
|
-
int getDimension() const override;
|
|
7
|
-
double Inner(EigenMatrix X, EigenMatrix Y) const override;
|
|
8
|
-
|
|
9
|
-
EigenMatrix Exponential(EigenMatrix X) const override;
|
|
10
|
-
EigenMatrix Logarithm(Manifold& N) const override;
|
|
11
|
-
|
|
12
|
-
EigenMatrix TangentProjection(EigenMatrix A) const override;
|
|
13
|
-
EigenMatrix TangentPurification(EigenMatrix A) const override;
|
|
14
|
-
|
|
15
|
-
//EigenMatrix TransportTangent(EigenMatrix X, EigenMatrix Y) override const;
|
|
16
|
-
EigenMatrix TransportManifold(EigenMatrix X, Manifold& N) const override;
|
|
17
|
-
|
|
18
|
-
void Update(EigenMatrix p, bool purify) override;
|
|
19
|
-
void getGradient() override;
|
|
20
|
-
void getHessian() override;
|
|
21
|
-
|
|
22
|
-
std::unique_ptr<Manifold> Clone() const override;
|
|
23
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
.PHONY: all
|
|
2
|
-
|
|
3
|
-
all: Manifold Simplex Orthogonal Grassmann TransRotInvPointCloud
|
|
4
|
-
|
|
5
|
-
Manifold: Manifold.cpp
|
|
6
|
-
$(CXX) -o ../../obj/$(OBJ)Manifold.o Manifold.cpp -c $(Flags)
|
|
7
|
-
|
|
8
|
-
Simplex: Simplex.cpp
|
|
9
|
-
$(CXX) -o ../../obj/$(OBJ)Simplex.o Simplex.cpp -c $(Flags)
|
|
10
|
-
|
|
11
|
-
Orthogonal: Orthogonal.cpp
|
|
12
|
-
$(CXX) -o ../../obj/$(OBJ)Orthogonal.o Orthogonal.cpp -c $(Flags)
|
|
13
|
-
|
|
14
|
-
Grassmann: Grassmann.cpp
|
|
15
|
-
$(CXX) -o ../../obj/$(OBJ)Grassmann.o Grassmann.cpp -c $(Flags)
|
|
16
|
-
|
|
17
|
-
TransRotInvPointCloud: TransRotInvPointCloud.cpp
|
|
18
|
-
$(CXX) -o ../../obj/$(OBJ)TransRotInvPointCloud.o TransRotInvPointCloud.cpp -c $(Flags)
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Maniverse
|
|
3
|
-
Version: 0.2.1
|
|
4
|
-
Summary: Function optimization on manifolds
|
|
5
|
-
Home-page: https://github.com/FreemanTheMaverick/Maniverse.git
|
|
6
|
-
Author: FreemanTheMaverick
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
License-File: LICENSE
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
class HessUpdate{ public:
|
|
2
|
-
int Size = 0;
|
|
3
|
-
bool Verbose = 1;
|
|
4
|
-
std::vector<std::unique_ptr<Manifold>> Ms;
|
|
5
|
-
std::vector<std::map<std::string, EigenMatrix>> Caches; // For matrix-free
|
|
6
|
-
std::vector<std::tuple<double, EigenMatrix>> EigenPairs; // For non-matrix-free
|
|
7
|
-
std::function<double (double)> CautiousThreshold = [](double gnorm){ return -gnorm; };
|
|
8
|
-
HessUpdate(int n);
|
|
9
|
-
void Append(Manifold& M, EigenMatrix Step);
|
|
10
|
-
virtual void AdmittedAppend(Manifold& M, EigenMatrix Step);
|
|
11
|
-
EigenMatrix Hessian(EigenMatrix v);
|
|
12
|
-
virtual EigenMatrix HessianMatrixFree(EigenMatrix v);
|
|
13
|
-
void Clear();
|
|
14
|
-
virtual ~HessUpdate() = default;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
class BroydenFletcherGoldfarbShanno: public HessUpdate{ public:
|
|
18
|
-
BroydenFletcherGoldfarbShanno(int n): HessUpdate(n){}
|
|
19
|
-
void AdmittedAppend(Manifold& M, EigenMatrix Step) override;
|
|
20
|
-
EigenMatrix HessianMatrixFree(EigenMatrix v) override;
|
|
21
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class TruncatedConjugateGradient{ public:
|
|
2
|
-
Manifold* M;
|
|
3
|
-
std::function<EigenMatrix (EigenMatrix)>* Func;
|
|
4
|
-
bool Verbose;
|
|
5
|
-
bool ShowTarget;
|
|
6
|
-
double Radius;
|
|
7
|
-
std::function<bool (double, double, double, double)> Tolerance;
|
|
8
|
-
std::vector<std::tuple<double, EigenMatrix, EigenMatrix>> Sequence; // Step size, S, P.
|
|
9
|
-
TruncatedConjugateGradient(){};
|
|
10
|
-
TruncatedConjugateGradient(
|
|
11
|
-
Manifold* m, std::function<EigenMatrix (EigenMatrix)>* func,
|
|
12
|
-
bool verbose, bool showtarget
|
|
13
|
-
): M(m), Func(func), Verbose(verbose), ShowTarget(showtarget){};
|
|
14
|
-
void Run();
|
|
15
|
-
std::tuple<double, EigenMatrix> Find(); // Step size, S.
|
|
16
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
class TrustRegionSetting{ public:
|
|
2
|
-
double R0;
|
|
3
|
-
double RhoThreshold;
|
|
4
|
-
std::function<double (double, double, double)> Update;
|
|
5
|
-
TrustRegionSetting();
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
bool TrustRegion(
|
|
9
|
-
std::function<
|
|
10
|
-
std::tuple<
|
|
11
|
-
double,
|
|
12
|
-
EigenMatrix,
|
|
13
|
-
std::function<EigenMatrix (EigenMatrix)>
|
|
14
|
-
> (EigenMatrix, int)
|
|
15
|
-
>& func,
|
|
16
|
-
TrustRegionSetting& tr_setting,
|
|
17
|
-
std::tuple<double, double, double> tol,
|
|
18
|
-
double tcg_tol,
|
|
19
|
-
int recalc_hess, int max_iter,
|
|
20
|
-
double& L, Manifold& M, int output);
|
|
21
|
-
|
|
22
|
-
bool TrustRegionRationalFunction(
|
|
23
|
-
std::function<
|
|
24
|
-
std::tuple<
|
|
25
|
-
double,
|
|
26
|
-
EigenMatrix,
|
|
27
|
-
std::function<EigenMatrix (EigenMatrix)>
|
|
28
|
-
> (EigenMatrix, int)
|
|
29
|
-
>& func,
|
|
30
|
-
TrustRegionSetting& tr_setting,
|
|
31
|
-
std::tuple<double, double, double> tol,
|
|
32
|
-
int recalc_hess, int max_iter,
|
|
33
|
-
double& L, Manifold& M, int output);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
.PHONY: all
|
|
2
|
-
|
|
3
|
-
all: TrustRegion SubSolver HessUpdate
|
|
4
|
-
|
|
5
|
-
TrustRegion: TrustRegion.cpp
|
|
6
|
-
$(CXX) -o ../../obj/$(OBJ)TrustRegion.o TrustRegion.cpp -c $(Flags)
|
|
7
|
-
|
|
8
|
-
SubSolver: SubSolver.cpp
|
|
9
|
-
$(CXX) -o ../../obj/$(OBJ)SubSolver.o SubSolver.cpp -c $(Flags)
|
|
10
|
-
|
|
11
|
-
HessUpdate: HessUpdate.cpp
|
|
12
|
-
$(CXX) -o ../../obj/$(OBJ)HessUpdate.o HessUpdate.cpp -c $(Flags)
|
Maniverse-0.2.8/src/makefile
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|