Giter VIP home page Giter VIP logo

choleskydecompositionhilbertmatrix's Introduction

Cholesky Decomposition for the Hilbert Matrix ๐Ÿง

๐Ÿ”ฆ Introduction

This is my project for Numerical Linear Algebra course (Fall, 2018 taught by Prof. Saeed Kazem) at Amirkabir University of Technology (Tehran Polytechnic). It contains 2 Python programs for performing Cholesky decompostion on Hilbert matrix of any order.

โžก๏ธ NOTE: A more theoretical description is available in this Medium blog I wrote ๐Ÿค“.

Both of the programs print out the lower-triangular matrix resulted from the Cholesky method.

  • "CholeskyDecompositionHilbertMatrix.py" has the functions all coded by me and does not use any special libraries.
  • "CDHM_numpy.py" is much more concise and uses Numpy & Scipy libraries in order to perform the task. Therefore these two famous libraries have to be installed on your operating system before running the code (Both of these libraries are avaiable in Anaconda).

๐Ÿ”˜ Installation

Open up the command line and run the following:

  • pip install numpy
  • pip install scipy

๐Ÿ’ญ My thoughts on the code

The second program might work better and faster on large Hilbert matrices (as the order increases) because it uses Scipy & Numpy which perform matrix operations perfectly.

It was a cool experience having two programs doing the same task and one has almost 30 lines of code, while the other has only 4.

choleskydecompositionhilbertmatrix's People

Contributors

arashmath avatar

Stargazers

 avatar

Watchers

 avatar

choleskydecompositionhilbertmatrix's Issues

Not working with high rank Hilbert Matrix.

Hi there, I am doing a numerical analysis assignment recently and accidentally found this repo, it's really helpful. But when I test with a rank 30/40 Hilbert Matrix, the program encounters a value error with the message "Matrix is not positive definite", Even with the library. Could u help me solve this problem? Thanks!
from scipy.linalg import hilbert
print(np.linalg.cholesky(hilbert(30)))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.