PHP Classes

How to Implement a PHP Matrix Multiplication Service using the Package Matrix Multiplication: Provide matrix multiplication as a Web service

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-05-13 (10 months ago) RSS 2.0 feedNot enough user ratingsTotal: 21 All time: 11,324 This week: 45Up
Version License PHP version Categories
matrix-multiplicatio 1.0.0The PHP License7Web services, Math, PHP 7
Description 

Author

This package can provide matrix multiplication as a Web service.

It provides a service class that can take two matrices as parameters and calculate the multiplication between matrices.

The package provides the matrix multiplication as Web service.

Innovation Award
PHP Programming Innovation award nominee
May 2024
Number 6
Matrices are data elements that may contain numeric values stored in a grid like PHP arrays of two dimensions.

Matrix operations are used in many applications that process statistic values, such as image processing.

This package provides a matrix multiplication as a Web service with a REST API.

Manuel Lemos
Picture of Busari Ridwan
  Performance   Level  
Innovation award
Innovation award
Nominee: 4x

 

Documentation

Matrix Multiplication

Create a Laravel application for Matrix multiplication. The app should feature a REST API with authentication. For Matrix multiplication, the column count in the first matrix should be equal to the row count of the second matrix. If this condition is not met, the app should throw a validation error. The resulting matrix should contain characters rather than numbers, similar to excel columns. Examples: 1 => A, 26 => Z, 27 => AA, 28 => AB, etc.

Expectation

  • At least PHP 7.4 or 8.0 for coding (8.0 recommended).
  • PSR-2 coding standard.
  • Strict type hinting.
  • Tests.

How to run the application

Below are the steps you need to successfully setup and run the application.

  • Clone the app from the repository and cd into the root directory of the app
  • Run composer install
  • Copy .env.example into .env
  • Update DB credentials to match with your db
  • Run php artisan migrate to migrate database tables
  • Run php artisan db:seed to seed the default user record
  • Run php artisan jwt:secret to generate the key

API Endpoints

The api endpoint collection is extracted by importing this link Postman Collection on your postman.

Running Test

The test is setup to use the refresh database trait, please ensure you create a db for running the test and updating it on the .env. To run the test simply run /vendor/bin/phpunit

Login Access

The default login access are email : test@test.com and password : password

Enjoy!!!


  Files folder image Files (82)  
File Role Description
Files folder imageapp (7 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (15 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (4 files)
Files folder imageresources (3 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:21
This week:0
All time:11,324
This week:45Up