{"id":25098214,"url":"https://github.com/antosser/diagonal-rs","last_synced_at":"2025-04-02T04:10:12.286Z","repository":{"id":225918465,"uuid":"767221534","full_name":"Antosser/diagonal-rs","owner":"Antosser","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-04T23:00:39.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T02:48:33.659Z","etag":null,"topics":["algorithm","array","cross-platform","diagonal","matrix"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/diagonal","language":"Rust","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/Antosser.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}},"created_at":"2024-03-04T22:57:04.000Z","updated_at":"2024-03-04T23:10:16.000Z","dependencies_parsed_at":"2024-03-05T01:30:24.711Z","dependency_job_id":"7676029d-8938-4892-800a-eaf305556d70","html_url":"https://github.com/Antosser/diagonal-rs","commit_stats":null,"previous_names":["antosser/diagonal-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiagonal-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiagonal-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiagonal-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiagonal-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Antosser","download_url":"https://codeload.github.com/Antosser/diagonal-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752657,"owners_count":20827987,"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":["algorithm","array","cross-platform","diagonal","matrix"],"created_at":"2025-02-07T18:30:42.262Z","updated_at":"2025-04-02T04:10:12.270Z","avatar_url":"https://github.com/Antosser.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diagonal Operations\n\nThis Rust module provides functions to perform operations on diagonals in matrices. It includes functions for extracting diagonals with positive slope, diagonals with positive and negative slope, as well as straight rows and columns.\n\n## Diagonals with Positive Slope (Bottom-Left to Top-Right)\n\nThe `diagonal_pos_pos` function extracts diagonals with positive slope from a matrix starting from the bottom-left corner (x: maximum, y: 0).\n\n### Example\n\n```rust\nuse diagonal::diagonal_pos_pos;\n\nlet matrix = vec![\n    vec![1, 2, 3],\n    vec![4, 5, 6],\n    vec![7, 8, 9],\n];\n\nlet result = diagonal_pos_pos(\u0026matrix);\nassert_eq!(result, vec![\n    vec![\u00267],\n    vec![\u00264, \u00268],\n    vec![\u00261, \u00265, \u00269],\n    vec![\u00262, \u00266],\n    vec![\u00263],\n]);\n```\n\n## Diagonals with Positive and Negative Slope (Top-Left to Bottom-Right and Bottom-Left to Top-Right)\n\nThe `diagonal_pos_neg` function extracts diagonals with positive and negative slope from a matrix starting from the top-left corner (x \u0026 y: 0).\n\n### Example\n\n```rust\nuse diagonal::diagonal_pos_neg;\n\nlet matrix = vec![\n    vec![1, 2, 3],\n    vec![4, 5, 6],\n    vec![7, 8, 9],\n];\n\nlet result = diagonal_pos_neg(\u0026matrix);\nassert_eq!(result, vec![\n    vec![\u00261],\n    vec![\u00262, \u00264],\n    vec![\u00263, \u00265, \u00267],\n    vec![\u00266, \u00268],\n    vec![\u00269],\n]);\n```\n\n## Straight Rows and Columns\n\nThe `straight_x` and `straight_y` functions extract elements from a matrix in row-major and column-major orders, respectively.\n\n### Example\n\n```rust\nuse diagonal::{straight_x, straight_y};\n\nlet matrix = vec![\n    vec![1, 2, 3],\n    vec![4, 5, 6],\n    vec![7, 8, 9],\n];\n\nlet result_x = straight_x(\u0026matrix);\nassert_eq!(result_x, vec![\n    vec![\u00261, \u00262, \u00263],\n    vec![\u00264, \u00265, \u00266],\n    vec![\u00267, \u00268, \u00269],\n]);\n\nlet result_y = straight_y(\u0026matrix);\nassert_eq!(result_y, vec![\n    vec![\u00261, \u00264, \u00267],\n    vec![\u00262, \u00265, \u00268],\n    vec![\u00263, \u00266, \u00269],\n]);\n```\n\nThe provided functions enable convenient extraction and manipulation of matrix diagonals, making it easier to perform various operations on matrix elements.\n\n## Getting Started\n\nTo use this module, add the `diagonal` crate to your `Cargo.toml` file:\n\n```toml\n[dependencies]\ndiagonal = \"0.1.0\"\n```\n\nNow, you can import the necessary functions and start working with matrix diagonals in Rust!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosser%2Fdiagonal-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantosser%2Fdiagonal-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosser%2Fdiagonal-rs/lists"}