{"id":16707433,"url":"https://github.com/cometscome/fortran_csr","last_synced_at":"2026-03-18T21:38:53.397Z","repository":{"id":115248187,"uuid":"575203702","full_name":"cometscome/fortran_csr","owner":"cometscome","description":"CSR format in Fortran","archived":false,"fork":false,"pushed_at":"2022-12-08T09:53:28.000Z","size":199,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T17:40:14.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cometscome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-07T01:29:51.000Z","updated_at":"2023-05-04T23:18:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a0ecfe5-8d7f-4716-b699-efbb353f1774","html_url":"https://github.com/cometscome/fortran_csr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cometscome/fortran_csr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2Ffortran_csr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2Ffortran_csr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2Ffortran_csr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2Ffortran_csr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometscome","download_url":"https://codeload.github.com/cometscome/fortran_csr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometscome%2Ffortran_csr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29788264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T19:39:30.618Z","updated_at":"2026-02-24T15:36:46.061Z","avatar_url":"https://github.com/cometscome.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fortran library for CSR format\nThis module can construct a sparce matrix with CSR format. The example is written in main.f90.\nPlease see CMakeList.txt if you want to know how to link it.\n\n\nHow to test it.\n```\nmkdir build\ncd build\ncmake ..\n./test\n```\n\nIf you want to use MKL, use DMKLUSE flag:\n```\nmkdir build\ncd build\ncmake -DMKLUSE=on ..\n./test\n```\n\n# example \n\n```fortran\nprogram main\n    use csrmodule\n    implicit none\n    type(CSRcomplex)::H\n    integer::N\n    complex(8)::v,alpha,beta\n    integer::i,j\n    real(8)::mu,t\n    complex(8),allocatable::x(:)\n    complex(8),allocatable::y(:)\n    complex(8),allocatable::ytemp(:)\n    complex(8),allocatable::z(:)\n    complex(8),allocatable::Hdense(:,:)\n    complex(8),allocatable::ytemp2(:)\n\n    N = 10\n    v = -1d0\n    t = -1d0\n    mu = -1.5d0\n    allocate(Hdense(2*N,2*N))\n\n    H = CSRcomplex(2*N)\n    do i = 1,N\n        j = i\n        v = -mu\n\n        call H%set(v,i,j)\n        Hdense(i,j) = v\n        call H%set(-v,i+N,j+N)\n        Hdense(i+N,j+N) = -v\n\n        v = t\n        j = i+1\n        if (j \u003e 0 .and. j \u003c N+1) then\n            call H%set(v,i,j)\n            Hdense(i,j) = v\n            call H%set(v,j,i)\n            Hdense(j,i) = v\n\n            call H%set(-v,i+N,j+N)\n            Hdense(i+N,j+N) = -v\n            call H%set(-v,j+N,i+N)\n            Hdense(j+N,i+N) = -v\n        end if\n\n        j = i-1\n        v =t\n\n        if (j \u003e 0 .and. j \u003c N+1) then\n            call H%set(v,i,j)\n            Hdense(i,j) = v\n            call H%set(v,j,i)\n            Hdense(j,i) = v\n\n            call H%set(-v,i+N,j+N)\n            Hdense(i+N,j+N) = -v\n            call H%set(-v,j+N,i+N)\n            Hdense(j+N,i+N) = -v\n        end if\n\n        j = i+N\n        v = 0.5d0\n        call H%set(v,i,j)\n        Hdense(i,j) = v\n        call H%set(v,j,i)\n        Hdense(j,i) = v\n\n    end do\n\n    call H%print()\n\n    do i=1,N\n        j = i+N\n        v = 0.6d0\n        call H%update(v,i,j)\n        Hdense(i,j) = v\n        call H%update(v,j,i)\n        Hdense(j,i) = v\n\n\n    end do\n    call H%print()\n\n    allocate(x(1:2*N))\n    x = 0d0\n    allocate(y(1:2*N))\n    allocate(ytemp(1:2*N))\n    allocate(ytemp2(1:2*N))\n    y = 0d0\n    ytemp = 0d0\n    allocate(z(1:2*N))\n    z(5) = 10d0\n    x(3) = 1d0\n    call H%matmul(x,y)\n    !write(*,*) \"matmul(x,y) \", y\n\n\n    ytemp = H*x\n    write(*,*) \"H*x\", ytemp\n\n    ytemp2 = matmul(Hdense,x)\n    do i=1,2*N\n        write(*,*) i,ytemp(i),ytemp2(i)\n    end do\n    write(*,*) \"diff = \",dot_product(ytemp-ytemp2,ytemp-ytemp2)/N\n\n\n\n\n    alpha = 2d0\n    beta = 3d0\n    call H%matmul2(x,y,z,alpha,beta)\n    !write(*,*) \"y = alpha*A*x+beta*z\",y\n\n\nend program main\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometscome%2Ffortran_csr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometscome%2Ffortran_csr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometscome%2Ffortran_csr/lists"}