Giter Site home page Giter Site logo

infamousbeargr / scientific_computing Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 314 KB

Fun Matlab exercise by our teacher at CEID.

MATLAB 100.00%
matlab matlab-functions matlab-script scientific-computing linear-algebra csr csc bccs toeplitz-matrices tridiagonal

scientific_computing's Introduction

Scientific Computing

A Matlab exercise given by our teacher.

sp_mat2latex takes a square sparse matrix and converts it to CSR or CSC depending on the sp_type ('csc' or 'csr). The output is val,row_ip,col_ip. Lastly the results are saved in a tex file called erot1.tex.

blkToeplitzTrid takes 3 matrices (A, B, C) size m x m and makes a tridagonial Toeplitz matrix with A, B, C blocks in the diagonal region, n is the number for creating the final nm x nm matrix.

sp_mx2bccs takes a sparse square matrix and converts it to BCCS, nb is the size of the blocks for BCCS. The output is val,brow_idx,bcol_ptr.

spmv_bccs uses the output of a BCCS matrix, 2 arrays (x, y) and nb (the size of the blocks of BCCS) to calculate the equation y <- y + Ax.

erotima5 creates a Toeplitz matrix T and and the another S matrix based on blkToeplitzTrid, then 2 arrays are created (x, y) with values. The user defines m, n which you can see in the code where they are used and then the equation y=y+Sx is done in 2 ways, the Matlab way (just y=y+Sx) and after using sp_mx2bccs on S and then spmv_bccs. In the end the norm-2 difference is calculated in the 2 different methods to determine the error.

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.