pyarpack: improve README documentation.

This commit is contained in:
Franck HOUSSEN
2020-03-03 13:17:45 +01:00
parent 35bffac439
commit 259a1596a5
+11
View File
@@ -38,6 +38,17 @@ You can also:
Note:
1. arpack data type (float, double, ...) must be consistent with A/B numpy dtypes (float32, float64, ...).
at python side, the data MUST be casted in the EXACT expected type (int32, int64, float, double, ...).
otherwise, C++ may not get the data the way it expects them: C++ will not know how to read python data.
if you are not sure how data have been passed from python to C++, set arpackSlv.debug = 1 and check out debug traces.
in other words, pyarpack users MUST :
1.1. create numpy arrays specifying explicitly the type:
>> Aij = np.array([], dtype='complex128')
1.2. filling numpy arrays casting value on append:
>> Aij = np.append(Aij, np.complex128(np.complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
1.3. calling the solver flavor which is consistent with the numpy array data type:
>> arpackSlv = pyarpackSlv.complexDouble() # Caution: complexDouble <=> np.array(..., dtype='complex128')
note: NO data type check can be done at C++ side, the pyarpack user MUST insure data consistency.
2. sparse matrices must be provided in coo format (n, i, j, Mij), that is, as a tuple where:
2.1. n is an integer.
2.2. i, j, Mij are 1 x nnz numpy arrays.