{"id":21417254,"url":"https://github.com/konstantin8105/sparse","last_synced_at":"2026-01-06T20:36:04.186Z","repository":{"id":57481276,"uuid":"157513253","full_name":"Konstantin8105/sparse","owner":"Konstantin8105","description":"Transpilated CSparse from C to Go","archived":false,"fork":false,"pushed_at":"2024-05-30T14:17:39.000Z","size":3301,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T13:29:51.652Z","etag":null,"topics":["c","c4go","golang","linear-algebra","sparse"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Konstantin8105.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-11-14T08:07:25.000Z","updated_at":"2024-05-30T14:17:37.000Z","dependencies_parsed_at":"2024-06-20T18:54:55.024Z","dependency_job_id":"7cf92a9b-faa0-4bc3-b423-d2d371d0be88","html_url":"https://github.com/Konstantin8105/sparse","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konstantin8105%2Fsparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konstantin8105%2Fsparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konstantin8105%2Fsparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Konstantin8105%2Fsparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Konstantin8105","download_url":"https://codeload.github.com/Konstantin8105/sparse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245813015,"owners_count":20676736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c","c4go","golang","linear-algebra","sparse"],"created_at":"2024-11-22T19:14:18.750Z","updated_at":"2026-01-06T20:36:04.156Z","avatar_url":"https://github.com/Konstantin8105.png","language":"C","readme":"# sparse\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/Konstantin8105/sparse)](https://goreportcard.com/report/github.com/Konstantin8105/sparse)\n[![codecov](https://codecov.io/gh/Konstantin8105/sparse/branch/master/graph/badge.svg)](https://codecov.io/gh/Konstantin8105/sparse)\n[![GitHub license](https://img.shields.io/badge/license-LGPL%20v2.1-blue.svg)](https://github.com/Konstantin8105/sparse/blob/master/LICENSE)\n[![Go](https://github.com/Konstantin8105/sparse/actions/workflows/codecov.yml/badge.svg?branch=master)](https://github.com/Konstantin8105/sparse/actions/workflows/codecov.yml)\n[![GoDoc](https://godoc.org/github.com/Konstantin8105/sparse?status.svg)](https://godoc.org/github.com/Konstantin8105/sparse)\n\n**This package based on program CSparse from [SuiteSparse 5.4.0](http://faculty.cse.tamu.edu/davis/SuiteSparse/)**\n\n### Comparation with `gonum.mat.LU`\n\n```cmd\ngo test -v -cpuprofile cpu.prof -memprofile mem.prof -coverprofile=coverage.out -run=BenchmarkLU -bench=BenchmarkLU -benchmem\n```\n```result\ngoos: linux\ngoarch: amd64\npkg: github.com/Konstantin8105/sparse\nBenchmarkLU/Sparse:__30:__300-4         \t   37153\t     30785 ns/op\t   51328 B/op\t      28 allocs/op\nBenchmarkLU/Dense_:__30:__300-4         \t   41449\t     29516 ns/op\t    9236 B/op\t      11 allocs/op\nBenchmarkLU/Sparse:_100:_1070-4         \t    9572\t    108839 ns/op\t  201328 B/op\t      28 allocs/op\nBenchmarkLU/Dense_:_100:_1070-4         \t    4323\t    233880 ns/op\t   85005 B/op\t      11 allocs/op\nBenchmarkLU/Sparse:_300:_3270-4         \t    3404\t    324523 ns/op\t  566384 B/op\t      28 allocs/op\nBenchmarkLU/Dense_:_300:_3270-4         \t     476\t   2494250 ns/op\t  739173 B/op\t      20 allocs/op\nBenchmarkLU/Sparse:1000:10970-4         \t    1029\t   1065713 ns/op\t 1794812 B/op\t      28 allocs/op\nBenchmarkLU/Dense_:1000:10970-4         \t      18\t  63434980 ns/op\t 8061283 B/op\t      47 allocs/op\nBenchmarkLU/Sparse:3000:32970-4         \t     378\t   3206861 ns/op\t 5382921 B/op\t      28 allocs/op\nBenchmarkLU/Dense_:3000:32970-4         \t       2\t 802618764 ns/op\t72295580 B/op\t     111 allocs/op\n```\n\nUsing sparse algorithm is effective in test case for square matrixes with size more 50.\n\n### Example of comparing CSparse and CXSparse\n\n```cmd\nrm -rf /tmp/CXSparse\ncp -R ./CXSparse/ /tmp/\nsed -i 's/CS_ENTRY/double/g' /tmp/CXSparse/Source/*.c\nsed -i 's/CS_INT/csi/g'   /tmp/CXSparse/Source/*.c\nmeld  /tmp/CXSparse/ ./CSparse/\n```\n\n### How updating package\n\n* Check new version of `CSparse` is exist on [page](http://faculty.cse.tamu.edu/davis/SuiteSparse/).\n* Download new version.\n* Compare file-by-file with file in folder `CSparse` of that package.\n* Inject changes into Go files of package.\n\n\u003e Note:\n\u003e CSparse haven`t any updates at the last few years, so\n\u003e that package is actual at the future.\n\u003e\n\n### Just for information\n\n**This package transpiled CSparse from C to Go by [c4go](https://github.com/Konstantin8105/c4go).**\n\n### Profiling\n\n```\ngo test -v -cpuprofile=cpu.prof -memprofile=mem.prof -run=Benchmark -bench=Benchmark -benchmem\ngo tool pprof cpu.prof\ngo tool pprof mem.prof\n```\n\n### Coverage\n\n```\ngo test -coverprofile=coverage.out -run=TestLU\ngo tool cover -html=coverage.out\n```\n\n### Questions for CSparse\n\n* Variables `css.lnz` and `css.unz` is not float type `double`, better to use integer type like `int`.\n* \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantin8105%2Fsparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonstantin8105%2Fsparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonstantin8105%2Fsparse/lists"}