{"id":17595198,"url":"https://github.com/dcasella/sparse-matrix","last_synced_at":"2025-07-31T12:09:45.307Z","repository":{"id":74791489,"uuid":"79220164","full_name":"dcasella/sparse-matrix","owner":"dcasella","description":"Sparse matrix implementation with ordered linked-list","archived":false,"fork":false,"pushed_at":"2019-02-12T23:08:09.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T08:18:43.226Z","etag":null,"topics":["cpp","sparse-matrix"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcasella.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":"2017-01-17T11:17:28.000Z","updated_at":"2022-12-15T01:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"fec0400d-cd95-486a-8238-61e510fa2b7f","html_url":"https://github.com/dcasella/sparse-matrix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcasella/sparse-matrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasella%2Fsparse-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasella%2Fsparse-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasella%2Fsparse-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasella%2Fsparse-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcasella","download_url":"https://codeload.github.com/dcasella/sparse-matrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcasella%2Fsparse-matrix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268036201,"owners_count":24185172,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp","sparse-matrix"],"created_at":"2024-10-22T07:43:52.760Z","updated_at":"2025-07-31T12:09:45.219Z","avatar_url":"https://github.com/dcasella.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sparse Matrix\n\n\u003e Project's specifications are taken from the 2017 February C++ exam of the course \"Programmazione e Amministrazione di Sistema\"\n\nA 2D sparse matrix is a matrix in which only the elements explicitly inserted  are physically stored.  \nIn this implementation we use a ordered linked-list, where the order of the elements depends on their coordinates in the matrix.\n\nTime complexity:  \nEmpty matrix creation `ϴ(1)`.  \nElement insertion `O(size)`, where size is the number of stored elements.  \nMatrix inspection `O(size)`.  \nMatrix clear `ϴ(size)`.\n\nSpace complexity:  \nMatrix `ϴ(size)`.\n\nSince `size` is always less than `n * m`, the class is clearly more efficient space-wise than time-wise.\n\n## List of contents\n \n- [Interface](#interface)\n- [Examples](#examples)\n\n## Interface\n\n### Template\n\n`T`: type of the values stored in the matrix.\n\n### Member classes\n\n#### Element\n\n```cpp\nelement(size_t, size_t, const T\u0026);\n\nstd::ostream\u0026 operator\u003c\u003c(std::ostream\u0026, const element\u0026);\n```\n\n### Member functions\n\n```cpp\nSparseMatrix(const T\u0026);\n\nSparseMatrix(size_t, size_t, const T\u0026);\n\nSparseMatrix(const SparseMatrix\u0026);\n\nSparseMatrix(const SparseMatrix\u003cQ\u003e\u0026);\n\n~SparseMatrix();\n\nSparseMatrix\u0026 operator=(const SparseMatrix\u0026);\n\nsize_t rows() const;\n\nsize_t cols() const;\n\nsize_t size() const;\n\nconst T D() const;\n\nvoid add(const element\u0026);\n\nvoid add(size_t, size_t, const T\u0026);\n\nconst T operator()(size_t, size_t);\n\nSparseMatrix operator*(const SparseMatrix\u003cQ\u003e\u0026) const;\n\nvoid clear();\n```\n\n### Iterators\n\n```cpp\niterator begin();\n\niterator end();\n\nconst_iterator begin() const;\n\nconst_iterator end() const;\n```\n\n### Non member functions\n\n```cpp\nstd::ostream\u0026 operator\u003c\u003c(std::ostream\u0026, const SparseMatrix\u003cT\u003e);\n\nint evaluate(const SparseMatrix\u003cT\u003e, P);\n```\n\n## Examples\n\nFile: `main.cpp`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasella%2Fsparse-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcasella%2Fsparse-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcasella%2Fsparse-matrix/lists"}