https://github.com/erdemkeren/matmul
https://github.com/erdemkeren/matmul
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/erdemkeren/matmul
- Owner: erdemkeren
- Created: 2020-12-15T01:52:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-15T10:04:42.000Z (over 4 years ago)
- Last Synced: 2025-01-17T19:44:23.272Z (5 months ago)
- Language: PHP
- Size: 72.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A laravel API app that multiplies the given matrices.
## Validation
The application validates the given matrices before multiplying them.
## API request
The commands `composer install` and `php artisan serve` could be run respectively
on command-line to serve the application.```bash
$ composer install
$ php artisan serve --host=127.0.0.1 --port=8000
```A postman collection can be found on the root level to send a call to the API:
| Method | Url |
|--------|-------------------------------------|
| POST | http://127.0.0.1:8000/api/multiply |See: mat-mul.postman_collection.json
**Example Data:**
```json
{
"first_matrix": [[1, 1]],
"second_matrix": [[1, 1], [0, 25]]
}
```## Resulting matrix
The application returns the product of the multiplication as a matrix of 0-indexed-letters.
If the results are not integers; the result will be the string representation of
`intval(result)`**Example for **`[[1, 26]]`
```json
{
"product": [
[
"B",
"AA"
]
]
}
```## How to run tests
```bash
$ php artisan test
```## Technical Details
* PHP 7.4
* Laravel
* PSR-12 coding standard
* strict type hinting
* unit tests