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.
Metadata
Release files for jlc-choldate 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jlc_choldate-0.4.tar.gz | 70.0 kB | Details |
Release files / jlc_choldate-0.4.tar.gz
| Download URL | jlc_choldate-0.4.tar.gz |
|---|---|
| Size | 70.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89608af446ac65aa4f8a07b0246eed1866f35dcfac9447981e48a82ae8f9bd8f
|
|
BLAKE2b-256 checksum How to use checksums |
b65563599387e9b94d472c2765381c43fddf762678bd78b0496c609271e52712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 2, 2025.
Transparency log