diff --git a/math/matrix.md b/math/matrix.md index e69de29..6eb53d7 100644 --- a/math/matrix.md +++ b/math/matrix.md @@ -0,0 +1,134 @@ +# Matrix + +The `Matrix` class implements matrices of the form `m x n`. + +```php +$matrix = new Matrix(); +$matrix->setMatrix([ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], +); +``` + +The implementation implements `ArrayAccess` for direct access and an `Iterator` for iteration. + +```php +$matrix[0][2]; // = 3 +``` + +```php +foreach($matrix as $rowId => $row) { + foreach($row as $columnId => $value) { + ... + } +} +``` + +## Addition + +The matrix addition supports matrix and scalar addition. The scalar addition adds a scalar to every element in the matrix. + +```php +$matrix->add(4); +``` + +The matrix addition requires both matrices to have the same dimensions and adds every index to the same index in the base matrix. + +```php +$matrix->add($matrixB); +``` + +## Subtraction + +The matrix subtraction supports matrix and scalar subtraction. The scalar subtraction subtracts a scalar to every element in the matrix. + +```php +$matrix->sub(4); +``` + +The matrix subtraction requires both matrices to have the same dimensions and subtracts every index to the same index in the base matrix. + +```php +$matrix->sub($matrixB); +``` + +## Multiplication + +The matrix multiplication supports matrix/vector and scalar multiplication. The scalar multiplication subtracts a scalar to every element in the matrix. + +```php +$matrix->mult(4); +``` + +The matrix multiplication performs a normal matrix multiplication. + +```php +$matrix->mult($matrixB); +``` + +## Solve + +In order to solve `A x = b` the matrix implements `solve` which automatically selects an appropriate algorithm (LU or QR decomposition) to solve the equation. + +```php +$matrix->solve($matrixB); +``` + +## Inverse + +The inverse calculates the inverse if possible. + +```php +$matrix->inverse(); +``` + +## Transpose + +The transpose function transposes the matrix. + +```php +$matrix->transpose(); +``` + +## Determinant + +The determinant of a matrix is calculated via the `det` function. + +```php +$matrix->det(); +``` + +## Diagonalize + +The diagonalize function diagonalizes the matrix if possible. + +```php +$matrix->diagonalize(); +``` + +## Triangulize + +### Upper Triangular + +The upper triangular of a matrix can be created via the `upperTriangular` function. + +```php +$matrix->upperTriangular(); +``` + +### Lower Triangular + +The lower triangular of a matrix can be created via the `lowerTriangular` function. + +```php +$matrix->lowerTriangular(); +``` + +## Vector + +The `Vector` class is a extension of the `Matrix` class `m x 1` and implements vectors. + +## Identity Matrix + +The `IdentityMatrix` class is a extension of the `Matrix` class and implements the identity matrix `m x n`. \ No newline at end of file diff --git a/quality/code_quality.md b/quality/code_quality.md deleted file mode 100644 index efdee5c..0000000 --- a/quality/code_quality.md +++ /dev/null @@ -1,9 +0,0 @@ -# Code Quality - -## General - -## Modules - -### Langauge Files - -Every provided language element in the language files SHOULD be used at least once by the module itself. Don't provide language elments that are only used by *optional* 3rd party modules. diff --git a/quality/inspections.md b/quality/inspections.md index 5f690fd..9af370a 100644 --- a/quality/inspections.md +++ b/quality/inspections.md @@ -6,18 +6,15 @@ Code inspections are very important in order to maintain the same code quality t Tools used for the code inspection are: -* PhpMessDetector +* PhpLoc * PhpMetrics -* PhpDepend -* PhpCS -* PhpCPD +* PDepend * PhpUnit (see tests) * Jasmine (see tests) * Custom scripts/tools These tools are all installed by running the `setup.sh` script from the Build repository. -## Configurations - -### PhpMessDetector +## External Tools +As external tool scrutinizer is used to automate code inspection and provide insight on issues, bugs, best practices etc. \ No newline at end of file diff --git a/services/codes.md b/services/codes.md index e69de29..620c1b9 100644 --- a/services/codes.md +++ b/services/codes.md @@ -0,0 +1,28 @@ +# Codes + +Supported codes are: + +* C25 +* C39 +* C128 (C128a and C128b) +* Codebar +* Datamatrix +* Aztec +* QR + +All codes expect the string to encode as parameter, the basic dimensions (width, height) and optionally the orientation for barcodes. The hoirzontal barcode image size will be adjusted automatically based on its length. + +```php +$c128b = new C128b('ABcdeFG0123+-!@?', 200, 50); +$c128b->saveToPngFile('path/code.png'); +``` + +The barcodes can be either saved as `png` and `jpeg` or outputted directly. + +```php +$c128b = new C128b('ABcdeFG0123+-!@?', 200, 50); +$c128b = $C128a->get(); +header ('Content-type: image/png'); +imagepng($c128b); +imagedestroy($c128b); +``` diff --git a/setup/configuration.md b/setup/configuration.md deleted file mode 100644 index e69de29..0000000 diff --git a/setup/dev_environment.md b/setup/dev_environment.md deleted file mode 100644 index 7f4ac05..0000000 --- a/setup/dev_environment.md +++ /dev/null @@ -1 +0,0 @@ -# Dev Environment \ No newline at end of file