{"id":16064395,"url":"https://github.com/timstr/slicemath","last_synced_at":"2025-04-05T09:20:50.273Z","repository":{"id":218429516,"uuid":"683515403","full_name":"timstr/slicemath","owner":"timstr","description":"A basic rust library for element-wise operations on slices of numbers","archived":false,"fork":false,"pushed_at":"2024-01-21T22:40:18.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T18:10:31.811Z","etag":null,"topics":["arrays","math","numeric","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/slicemath/0.1.0/slicemath/","language":"Rust","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/timstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-08-26T20:17:13.000Z","updated_at":"2024-01-22T05:50:55.000Z","dependencies_parsed_at":"2024-01-21T22:54:19.754Z","dependency_job_id":"fcc3f1a3-d011-46ff-b24c-b87d60e2974c","html_url":"https://github.com/timstr/slicemath","commit_stats":null,"previous_names":["timstr/slicemath","timstr/numeric"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fslicemath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fslicemath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fslicemath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fslicemath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timstr","download_url":"https://codeload.github.com/timstr/slicemath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247313034,"owners_count":20918557,"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":["arrays","math","numeric","rust"],"created_at":"2024-10-09T05:06:58.373Z","updated_at":"2025-04-05T09:20:50.207Z","avatar_url":"https://github.com/timstr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slicemath\n\nA library for element-wise operations on arrays of numeric values. Includes generic functions filling, copying, and applying unary, binary, and ternary functions on slices of equal length, both in-place and out-of-place. Common numeric operations are included such as addition, subtraction, multiplication and division between slices and scalars. Also included are inclusive and exclusive scans and linspace. Array bounds are checked only once, and the functions will panic if multiple functions with unequal length are given.\n\n```rust\nlet src: [u8; 4] = [1, 2, 3, 4];\nlet mut dst: [u8; 4] = [0, 0, 0, 0];\napply_unary(\u0026src, |i| i * 2, \u0026mut dst);\nassert_eq!(\u0026dst, \u0026[2, 4, 6, 8]);\n\nlet src: [u8; 4] = [1, 2, 3, 4];\nlet mut dst: [u8; 4] = [10, 20, 30, 40];\napply_binary_inplace(\u0026mut dst, \u0026src, |i, j| i + j);\nassert_eq!(\u0026dst, \u0026[11, 22, 33, 44]);\n\nlet mut dst: [i64; 4] = [-100, -10, 0, 10];\nadd_scalar_inplace(\u0026mut dst, 3);\nassert_eq!(\u0026dst, [-97, -7, 3, 13]);\n\nlet mut dst: [u32; 4] = [0, 0, 0, 0];\nlinspace(\u0026mut dst, 20, 24, EndPoint::Excluded);\nassert_eq!(\u0026dst, \u0026[20, 21, 22, 23]);\n\nlet mut dst: [f32; 4] = [0.0, 0.0, 0.0, 0.0];\nlinspace(\u0026mut dst, 1.0, 2.5, EndPoint::Included);\nassert_eq!(\u0026dst, \u0026[1.0, 1.5, 2.0, 2.5]);\n```\n\n## Features not included\n\n-   Fused multiply add (for now)\n-   Expression templates\n-   SIMD intrinsics\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstr%2Fslicemath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimstr%2Fslicemath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstr%2Fslicemath/lists"}