rindow / rindow-math-matrix

The fundamental package for scientific matrix operation
https://rindow.github.io/mathematics/
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

Floating numbers in cross calculations #2

Closed GajowyJ closed 1 year ago

GajowyJ commented 1 year ago

Hi! I succesfully set up the enviroment and started play with the library. I hope to use it my scientific research - matrix operations consumes 99.8% of time of my algorithms execution :|. One of the most time consuming operation is cross product of matrices. My matrices are filled with float numbers and unfortunatelly I can not run the Rindow for floats. It works perfectly for int64, however if I switch type to float is hangs completly (for float32) or produce ** On entry to SSYR2K parameter number 1 had an illegal value message (for float64). Is it the known issue? Can I workaroud it in any way? My env, Win10+PHP 8.1

Here is the test script:

<?php

include('vendor/autoload.php');

use Rindow\Math\Matrix\MatrixOperator;
use Interop\Polite\Math\Matrix\NDArray;

$mo = new MatrixOperator;
$mo->setDefaultFloatType(NDArray::float64);

print('A');
$a = $mo->array([[1,2,3],[4,5,6],[7,8,9]]);
print('B');
$b = $mo->array([[2,3,4],[5,6,7],[8,9,1]]);
print('C');
$c = $mo->cross($a,$b);
print('D');
print_r($c->toArray());

?>
yuichiis commented 1 year ago

Hi,

Thanks for using rindow-math.

Maybe the openblas library version is not compatible with the rindow-openblas extension. The Windows version of the DLL in the openblas library does not have a function to determine the version. The DLLs in the openblas library are completely incompatible with different versions.

Read the rindow-openblas README.

If you are using Windows, you must Download the version of OpenBLAS binaries that correspond to the rindow_openblas binaries. The compatible OpenBLAS Library release number is included in the filename of the rindow-openblas pre-built archive file. If you use the wrong OpenBLAS release number DLL, it will not work properly.

The rindow-openblas extension you are probably using is;

You need openblas version 0.3.20.

Exactly the same problem occurs with clbrast library

Thx,

GajowyJ commented 1 year ago

In the cmake file of my OpenBLAS installation there is SET(OpenBLAS_VERSION "0.3.21")

Should I downgrade to 0.3.20 ? Yes, I should! After downgrade, the problem disappeared! Thank you for support!