pyarpack: improve README documentation.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user