Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core/geometry): implement alignment algorithms #378

Merged
merged 16 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 125 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,55 @@ project.
limitations under the License.
```

## Eigen

- Project URL: <http://eigen.tuxfamily.org>

Eigen uses multiple licenses. See the
[Eigen website](http://eigen.tuxfamily.org) for more information.

## Spectra

- Project URL: <https://spectralib.org>

Spectra is under the MPLv2 license.

## GoogleTest

- Project URL: <https://github.com/google/googletest>
- Full license text:

```txt
Copyright 2008, Google Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

## pybind11

- Project URL: <https://github.com/pybind/pybind11>
Expand Down Expand Up @@ -313,7 +362,8 @@ project.

### L-BFGS-B

- Project URL: <http://github.com/scipy/scipy>, <http://users.iems.northwestern.edu/~nocedal/lbfgsb.html>
- Project URL: <http://github.com/scipy/scipy>,
<http://users.iems.northwestern.edu/~nocedal/lbfgsb.html>
- Full license text:

```txt
Expand Down Expand Up @@ -349,3 +399,77 @@ project.
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

### Kabsch

Our implementation of the Kabsch algorithm is based on the TM-align software.

- Project URL: <https://zhanggroup.org/TM-align>
- Full license text:

```txt
TM-align: sequence-independent structure alignment of monomer proteins by
TM-score superposition. Please report issues to [email protected]

References to cite:
Y Zhang, J Skolnick. Nucl Acids Res 33, 2302-9 (2005)

DISCLAIMER:
Permission to use, copy, modify, and distribute the Software for any
purpose, with or without fee, is hereby granted, provided that the
notices on the head, the reference information, and this copyright
notice appear in all copies or substantial portions of the Software.
It is provided "as is" without express or implied warranty.
```

Also, D Eberly's eigenvector solver is integrated into the Kabsch algorithm.

- Project URL: <https://www.geometrictools.com/Documentation/RobustEigenSymmetric3x3.pdf>
- Full license text:

```txt
David Eberly, Geometric Tools, Redmond WA 98052
Copyright (c) 1998-2024
Distributed under the Boost Software License, Version 1.0.
https://www.boost.org/LICENSE_1_0.txt
https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
Version: 6.0.2023.08.08
```

### QCP

- Project URL: <https://theobald.brandeis.edu/qcp>
- Full license text:

```txt
Copyright (c) 2009-2016 Pu Liu and Douglas L. Theobald
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
147 changes: 83 additions & 64 deletions include/nuri/algo/optim.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,44 +182,54 @@ namespace internal {
/**
* @brief L-BFGS-B minimizer
* @sa l_bfgs_b
* @note This implementation is based on the C implementation of L-BFGS-B
* in the SciPy library, which is a translation of the original Fortran
* code by Ciyou Zhu, Richard Byrd, and Jorge Noceda. Both are released
* under the BSD 3-Clause License and the original license is included
* below.
*
* Copyright (c) 2011 Ciyou Zhu, Richard Byrd, Jorge Nocedal and
* Jose Luis Morales.
* Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
* All rights reserved.
* References:
* - RH Byrd, P Lu, J Nocedal and C Zhu. *SIAM J. Sci. Stat. Comput.* **1995**,
* *16* (5), 1190-1208. DOI:[10.1137/0916069](https://doi.org/10.1137/0916069)
* - C Zhu, RH Byrd, J Nocedal. *ACM Trans. Math. Softw.* **1997**, *23* (4),
* 550-560. DOI:[10.1145/279232.279236](https://doi.org/10.1145/279232.279236)
* - JL Morales, J Nocedal. *ACM Trans. Math. Softw.* **2011**, *38* (1), 7.
* DOI:[10.1145/2049662.2049669](https://doi.org/10.1145/2049662.2049669)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* This implementation is based on the C implementation of L-BFGS-B in the SciPy
* library, which is a translation of the original Fortran code by Ciyou Zhu,
* Richard Byrd, and Jorge Noceda. Both are released under the BSD 3-Clause
* License and the original license is included below.
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* \code{.unparsed}
* Copyright (c) 2011 Ciyou Zhu, Richard Byrd, Jorge Nocedal and Jose Luis
* Morales.
* Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
* All rights reserved.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* \endcode
*/
class LBfgsB {
public:
Expand Down Expand Up @@ -477,44 +487,53 @@ LbfgsbResult LBfgsB::minimize(FuncGrad fg, const double factr,
* @note The input `x` will be modified in-place.
* @sa LBfgsB
*
* @note This implementation is based on the C implementation of L-BFGS-B
* in the SciPy library, which is a translation of the original Fortran
* code by Ciyou Zhu, Richard Byrd, and Jorge Noceda. Both are released
* under the BSD 3-Clause License and the original license is included
* below.
* References:
* - RH Byrd, P Lu, J Nocedal and C Zhu. *SIAM J. Sci. Stat. Comput.* **1995**,
* *16* (5), 1190-1208. DOI:[10.1137/0916069](https://doi.org/10.1137/0916069)
* - C Zhu, RH Byrd, J Nocedal. *ACM Trans. Math. Softw.* **1997**, *23* (4),
* 550-560. DOI:[10.1145/279232.279236](https://doi.org/10.1145/279232.279236)
* - JL Morales, J Nocedal. *ACM Trans. Math. Softw.* **2011**, *38* (1), 7.
* DOI:[10.1145/2049662.2049669](https://doi.org/10.1145/2049662.2049669)
*
* This implementation is based on the C implementation of L-BFGS-B in the SciPy
* library, which is a translation of the original Fortran code by Ciyou Zhu,
* Richard Byrd, and Jorge Noceda. Both are released under the BSD 3-Clause
* License and the original license is included below.
*
* Copyright (c) 2011 Ciyou Zhu, Richard Byrd, Jorge Nocedal and
* Jose Luis Morales.
* Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
* All rights reserved.
* \code{.unparsed}
* Copyright (c) 2011 Ciyou Zhu, Richard Byrd, Jorge Nocedal and Jose Luis
* Morales.
* Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* \endcode
*/
template <class FuncGrad>
LbfgsbResult l_bfgs_b(FuncGrad &&fg, MutRef<ArrayXd> x, const ArrayXi &nbd,
Expand Down
Loading
Loading