Melang

Logo

A script language of preemptive scheduling coroutine in single thread

View the Project on GitHub Water-Melon/Melang

Matrix

mln_matrix_mul

Matrix multiplication.

@mln_matrix_mul(array1, array2);

Input:

Return value:

Error:

Example:

array1 = ['row': 3, 'col': 2, 'data':[1,0,0,1,1,1]];
array2 = ['row': 2, 'col': 2, 'data':[1,2,3,4]];
res_array = @mln_matrix_mul(array1, array2);
@mln_print(res_array['row']);
@mln_print(res_array['col']);
@mln_print(res_array['data']);

The output is:

3
2
[1.000000, 2.000000, 3.000000, 4.000000, 4.000000, 6.000000, ]
mln_matrix_inv

Matrix inversion.

@mln_matrix_inv(array);

Input:

Return value:

Error:

Example:

array = ['row': 2, 'col': 2, 'data':[1,0,1,1]];
res_array = @mln_matrix_inv(array);
@mln_print(res_array['row']);
@mln_print(res_array['col']);
@mln_print(res_array['data']);

The output is:

2
2
[1.000000, 0.000000, -1.000000, 1.000000, ]