Somewhat fast updating and downdating of Cholesky factors in Python
Project description
choldate
Somewhat fast updating and downdating of Cholesky factors in Python
##installation
Clone the GitHub repository and install from source, e.g.,
git clone git://github.com/jcrudy/choldate.gitcd choldate && make sync && make install-pre-commit && make
The Makefile makes it easy to perform the most common operations:
make check-allruns linting anduv.lockchecksmake check-lintchecks for linting issuesmake check-lockverifies theuv.lockis aligned topyproject.tomlmake cleancleans the virtual environment and cachesmake defaultruns a default set of checks on the codemake fix-allformats the code, fixes lint errors and runs locksuv.locktopyproject.tomlmake fix-formatformats the codemake fix-lintfixes linting issuesmake fix-lint-unsafefixes linting issues potentially adding inadvertant bugsmake helpoutputs the different make optionsmake installbuild install the distributionmake install-pre-commitinstalls pre-commit hooksmake locklocksuv.locktopyproject.tomlmake install-pre-commitinstalls pre-commit hooksmake run-testsruns the unit testsmake syncsyncs the python environment withuv.lock
.vscode/settings.json is set so that unit tests can be run without further configuration.
##usage
from choldate import cholupdate, choldowndate
import numpy
#Create a random positive definite matrix, V
numpy.random.seed(1)
X = numpy.random.normal(size=(100,10))
V = numpy.dot(X.transpose(),X)
#Calculate the upper Cholesky factor, R
R = numpy.linalg.cholesky(V).transpose()
#Create a random update vector, u
u = numpy.random.normal(size=R.shape[0])
#Calculate the updated positive definite matrix, V1, and its Cholesky factor, R1
V1 = V + numpy.outer(u,u)
R1 = numpy.linalg.cholesky(V1).transpose()
#The following is equivalent to the above
R1_ = R.copy()
cholupdate(R1_,u.copy())
assert(numpy.all((R1 - R1_)**2 < 1e-16))
#And downdating is the inverse of updating
R_ = R1.copy()
choldowndate(R_,u.copy())
assert(numpy.all((R - R_)**2 < 1e-16))
Important Note
This modules was originally developed by modusdatascience and the original repo can be found at https://github.com/modusdatascience/choldate
This fork is being maintained by jamieleecho.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jlc_choldate-0.4.tar.gz.
File metadata
- Download URL: jlc_choldate-0.4.tar.gz
- Upload date:
- Size: 70.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89608af446ac65aa4f8a07b0246eed1866f35dcfac9447981e48a82ae8f9bd8f
|
|
| MD5 |
3f87da2968502c734e4b97cbdd9bbc2e
|
|
| BLAKE2b-256 |
b65563599387e9b94d472c2765381c43fddf762678bd78b0496c609271e52712
|
Provenance
The following attestation bundles were made for jlc_choldate-0.4.tar.gz:
Publisher:
make-release.yml on jamieleecho/choldate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jlc_choldate-0.4.tar.gz -
Subject digest:
89608af446ac65aa4f8a07b0246eed1866f35dcfac9447981e48a82ae8f9bd8f - Sigstore transparency entry: 191315966
- Sigstore integration time:
-
Permalink:
jamieleecho/choldate@50c187439450c7ecebd20bcf20c6f5ebf304e2ba -
Branch / Tag:
refs/tags/0.4 - Owner: https://github.com/jamieleecho
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
make-release.yml@50c187439450c7ecebd20bcf20c6f5ebf304e2ba -
Trigger Event:
workflow_dispatch
-
Statement type: