Loading...
Searching...
No Matches
Go to the documentation of this file. 1#ifndef MATRIX_LAPACK_ETC_H
2#define MATRIX_LAPACK_ETC_H
11#include <R_ext/Lapack.h>
16#include <R_ext/Error.h>
18#define ERROR_LAPACK_1(_ROUTINE_, _INFO_) \
21 Rf_error(_("LAPACK routine '%s': argument %d had illegal value"), \
22 #_ROUTINE_, -(_INFO_)); \
25#define ERROR_LAPACK_2(_ROUTINE_, _INFO_, _WARN_, _LETTER_) \
27 ERROR_LAPACK_1(_ROUTINE_, _INFO_); \
28 if ((_INFO_) > 0 && (_WARN_) > 0) { \
30 Rf_error (_("LAPACK routine '%s': matrix is exactly singular, %s[i,i]=0, i=%d"), \
31 #_ROUTINE_, #_LETTER_, (_INFO_)); \
33 Rf_warning(_("LAPACK routine '%s': matrix is exactly singular, %s[i,i]=0, i=%d"), \
34 #_ROUTINE_, #_LETTER_, (_INFO_)); \
38#define ERROR_LAPACK_3(_ROUTINE_, _INFO_, _WARN_) \
40 ERROR_LAPACK_1(_ROUTINE_, _INFO_); \
41 if ((_INFO_) > 0 && (_WARN_) > 0) { \
43 Rf_error (_("LAPACK routine '%s': leading principal minor of order %d is not positive"), \
44 #_ROUTINE_, (_INFO_)); \
46 Rf_warning(_("LAPACK routine '%s': leading principal minor of order %d is not positive"), \
47 #_ROUTINE_, (_INFO_)); \
51#define ERROR_LAPACK_4(_ROUTINE_, _INFO_, _WARN_, _RANK_) \
53 ERROR_LAPACK_1(_ROUTINE_, _INFO_); \
54 if ((_INFO_) > 0 && (_WARN_) > 0) { \
56 Rf_error (_("LAPACK routine '%s': matrix is rank deficient or not positive definite, the _computed_ rank is %d"), \
57 #_ROUTINE_, (_RANK_)); \
59 Rf_warning(_("LAPACK routine '%s': matrix is rank deficient or not positive definite, the _computed_ rank is %d"), \
60 #_ROUTINE_, (_RANK_)); \
64#define ERROR_LAPACK_5(_ROUTINE_, _INFO_, _WARN_) \
66 ERROR_LAPACK_1(_ROUTINE_, _INFO_); \
67 if ((_INFO_) > 0 && (_WARN_) > 0) { \
69 Rf_error (_("LAPACK routine '%s': failed to compute all eigenvalues"), \
72 Rf_warning(_("LAPACK routine '%s': failed to compute all eigenvalues"), \