Coder Social home page Coder Social logo

choleskydecompositionexistencecheck's Introduction

Cholesky decomposition existence check

About The Project

I wrote this Fortran code for a friend´s university project. It is clearly not the best Fortran code out there, but the code works with every quadratic matrices. You can test whether there is a Cholesky decomposition or not. I am uploading this project because if someone gets a similar task in the following semesters, this code could help. Also, I have not found a standard solution for this problem via Google.

Usually you don't comment every line of code, but it was requested that way. I leave the comments like this because I think it helps a lot if you don't understand Fortran well.

Installation

  • Install at least Fortran 90
  • Go to the root folder of the project
  • Compile (Windows)
 gfortran code.f90
  • Execute (Windows)
  a.exe

How to use it

  • Change this variable to the length of your quadratic matrix (Line 3)
    integer , parameter:: columnRowLength = 4
  • Put your matrix formatted in .txt or .csv in the root folder of the project and change it to your file name (line 15)
    open(10,file='CholeskyPossible.txt')
    For test purposes you can use the matrices: CholeskyNotPossible.txt, CholeskyPossible.txt & 5x5Matrix.txt (with the last one you have to change the variable to 5)
  • Compile and run/execute the project
  • The results are now printed out in your command line

How it works

If the matrix is quadratic, symmetric and positiv definit => then there is a Cholesky decomposition.

Quadratic:

  • square matrices are required (there is no test that sort out non-square matrices!)

Test symmetry:

  • compare the matrix to its own transposition

Test positiv definit:

  • via Laplace expansion:
    • If Laplace expansion is greater than 0 then the matrix is semi postiv definit
    • And if Laplace expansion is is greater than 0 and the matrix is symmetric then the matrix is postiv definit

License

Distributed under the MIT License. See LICENSE for more information.

choleskydecompositionexistencecheck's People

Contributors

jonasgreim avatar

Watchers

 avatar

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.