{"id":22725277,"url":"https://github.com/furkancosgun/abap-matrix","last_synced_at":"2025-03-29T23:41:59.802Z","repository":{"id":267415421,"uuid":"900871285","full_name":"furkancosgun/ABAP-MATRIX","owner":"furkancosgun","description":"The ABAP Matrix Package is a library for performing matrix operations in ABAP. It supports arithmetic calculations, structural manipulations, and property checks, making it ideal for applications involving matrix calculations and data processing.","archived":false,"fork":false,"pushed_at":"2024-12-10T07:24:03.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T23:41:52.609Z","etag":null,"topics":["abap","abapgit","matrix","matrix-multiplication"],"latest_commit_sha":null,"homepage":"","language":"ABAP","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/furkancosgun.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":"2024-12-09T16:14:33.000Z","updated_at":"2024-12-10T07:24:06.000Z","dependencies_parsed_at":"2024-12-10T08:34:53.923Z","dependency_job_id":null,"html_url":"https://github.com/furkancosgun/ABAP-MATRIX","commit_stats":null,"previous_names":["furkancosgun/abap-matrix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkancosgun%2FABAP-MATRIX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkancosgun%2FABAP-MATRIX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkancosgun%2FABAP-MATRIX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkancosgun%2FABAP-MATRIX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkancosgun","download_url":"https://codeload.github.com/furkancosgun/ABAP-MATRIX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258862,"owners_count":20748573,"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":["abap","abapgit","matrix","matrix-multiplication"],"created_at":"2024-12-10T16:09:03.206Z","updated_at":"2025-03-29T23:41:59.782Z","avatar_url":"https://github.com/furkancosgun.png","language":"ABAP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ABAP Matrix Library\n\nThe **ABAP Matrix Package** is a comprehensive library designed to handle matrix operations in ABAP. It offers a wide range of functionalities, including basic arithmetic operations (addition, subtraction, multiplication, division), structural manipulations (reshaping, transposing, swapping rows/columns), and property checks (e.g., checking if a matrix is square, diagonal, or empty). This package is particularly useful for applications that involve matrix calculations and manipulations in ABAP, making it a powerful tool for mathematical and data processing tasks.\n\n\n## Features\n\n### Arithmetic Operations\n- **Scalar Operations:** Add, subtract, multiply, or divide a matrix by a scalar value.\n- **Matrix Operations:** Element-wise addition, subtraction, multiplication, and division between two matrices.\n- **Dot Product:** Compute the dot product between matrices or specific rows/columns.\n\n### Structural Manipulations\n- **Reshape:** Change the dimensions of a matrix without altering its data.\n- **Transpose:** Convert rows into columns and vice versa.\n- **Swap Rows/Columns:** Swap specific rows or columns.\n- **Merge:** Combine two matrices into one.\n- **Clear and Copy:** Clear a matrix or create an exact copy.\n\n### Property Checks\n- Verify if a matrix is:\n  - Square\n  - Rectangular\n  - Row/Column Vector\n  - Diagonal\n  - Empty\n  - Single Item\n\n### Utility Methods\n- Retrieve specific rows, columns, or elements.\n- Generate pre-defined matrices (zeros, ones, diagonal).\n- Check equality or similarity between matrices.\n\n---\n\n## Getting Started\n\n### Installation\n-  Install **ABAPGit** in your SAP system if it's not already installed.\n-  Open the **ABAPGit** application in your system.\n-  Clone the repository URL of this project into **ABAPGit**.\n-  Pull the code into your system. **ABAPGit** will automatically create the necessary objects in your package.\n\n---\n\n## Usage\n\n### Creating a Matrix\n```abap\nDATA lo_matrix TYPE REF TO zcl_matrix.\n\n\" Create a 3x3 matrix filled with zeros\nlo_matrix = zcl_matrix=\u003ezeros( iv_rows = 3\n                               iv_cols = 3 ).\n\n\" Create a 2x2 diagonal matrix\nlo_matrix = zcl_matrix=\u003ediagonal( iv_rows = 2\n                                  iv_cols = 2 ).\n```\n\n### Basic Arithmetic\n```abap\nDATA lo_matrix       TYPE REF TO zcl_matrix.\nDATA lo_other_matrix TYPE REF TO zcl_matrix.\n\nlo_matrix = zcl_matrix=\u003ezeros( iv_rows = 3\n                               iv_cols = 3 ).\n\n\" Add a scalar to all elements\nlo_matrix = lo_matrix-\u003eadd_by_scalar( iv_val = 5 ).\n\nlo_other_matrix = zcl_matrix=\u003eones( iv_rows = 3\n                                    iv_cols = 3 ).\n\n\" Add two matrices\nlo_matrix = lo_matrix-\u003eadd_matrix( io_matrix = lo_other_matrix ).\n```\n\n### Structural Manipulation\n```abap\nDATA lo_matrix TYPE REF TO zcl_matrix.\n\nlo_matrix = zcl_matrix=\u003eones( iv_rows = 6\n                              iv_cols = 3 ).\n\n\" Transpose the matrix\nlo_matrix = lo_matrix-\u003etranspose_matrix( ).\n\n\" Reshape the matrix to 1x9\nlo_matrix = lo_matrix-\u003ereshape( iv_rows = 1\n                                iv_cols = 9 ).\n```\n\n### Property Checks\n```abap\nDATA lo_matrix TYPE REF TO zcl_matrix.\n\nlo_matrix = zcl_matrix=\u003ediagonal( iv_rows = 3\n                                  iv_cols = 3 ).\n\nIF lo_matrix-\u003eis_square( ).\n  WRITE 'Matrix is square'.\nENDIF.\n\nIF lo_matrix-\u003eis_diagonal( ).\n  WRITE 'Matrix is diagonal'.\nENDIF.\n```\n\n---\n\n## API Documentation\n\n### **Math Methods**\n\n| Method Name       | Description                               |\n|--------------------|-------------------------------------------|\n| **ADD**           | Adds a value to the specified cell.       |\n| **SUB**           | Subtracts a value from the specified cell.|\n| **MUL**           | Multiplies the specified cell by a value. |\n| **DIV**           | Divides the specified cell by a value.    |\n| **ADD_BY_SCALAR** | Adds a scalar value to all matrix cells.  |\n| **SUB_BY_SCALAR** | Subtracts a scalar value from all cells.  |\n| **MUL_BY_SCALAR** | Multiplies all matrix cells by a scalar.  |\n| **DIV_BY_SCALAR** | Divides all matrix cells by a scalar.     |\n| **ADD_MATRIX**    | Adds another matrix to the current one.   |\n| **SUB_MATRIX**    | Subtracts another matrix from the current one.|\n| **MUL_MATRIX**    | Multiplies the current matrix with another.|\n| **DIV_MATRIX**    | Divides the current matrix by another one.|\n| **DOT**           | Performs dot product with another matrix.|\n| **DOT_ROW**       | Performs dot product for a specific row.  |\n| **DOT_COL**       | Performs dot product for a specific column.|\n\n---\n\n### **Properties Methods**\n\n| Method Name        | Description                                    |\n|---------------------|------------------------------------------------|\n| **IS_SQUARE**      | Checks if the matrix is square.                |\n| **IS_RECTANGLE**   | Checks if the matrix is rectangular.           |\n| **IS_ROW_VECTOR**  | Checks if the matrix is a row vector.          |\n| **IS_COL_VECTOR**  | Checks if the matrix is a column vector.       |\n| **IS_VECTOR**      | Checks if the matrix is a vector.              |\n| **IS_DIAGONAL**    | Checks if the matrix is diagonal.              |\n| **IS_EMPTY**       | Checks if the matrix is empty.                 |\n| **IS_SINGLE_ITEM** | Checks if the matrix contains a single item.   |\n| **SIZE**           | Returns the size of the matrix.                |\n\n---\n\n### **Structure Methods**\n\n| Method Name          | Description                                     |\n|-----------------------|-------------------------------------------------|\n| **RESHAPE**          | Reshapes the matrix to specified dimensions.    |\n| **SWAP_ROW**         | Swaps two rows in the matrix.                   |\n| **SWAP_COL**         | Swaps two columns in the matrix.                |\n| **TRANSPOSE_MATRIX** | Returns the transpose of the matrix.            |\n| **MERGE**            | Merges the matrix with another matrix.          |\n| **CLEAR**            | Clears all values in the matrix.                |\n| **COPY**             | Creates a copy of the matrix.                   |\n| **IS_SAME**          | Checks if another matrix has the same structure.|\n| **IS_EQUALS**        | Checks if another matrix is equal in values.    |\n\n---\n\n### **Instance Methods**\n\n| Method Name      | Description                                      |\n|-------------------|--------------------------------------------------|\n| **FULL**         | Creates a matrix filled with a specified value.  |\n| **ONES**         | Creates a matrix filled with ones.               |\n| **ZEROS**        | Creates a matrix filled with zeros.              |\n| **DIAGONAL**     | Creates a diagonal matrix with given dimensions. |\n| **FROM_TABLE**   | Creates a matrix from a given internal table.    |\n\n---\n\n## Contributing\nContributions are welcome! Please fork the repository and submit a pull request with a detailed explanation of your changes.\n\n---\n\n## License\nThis project is open-source and available under the [MIT](LICENSE) License.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkancosgun%2Fabap-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkancosgun%2Fabap-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkancosgun%2Fabap-matrix/lists"}