error.h

Go to the documentation of this file.
00001 
00015 #if !defined(INC_OSKI_ERROR_H)
00016 
00017 #define INC_OSKI_ERROR_H
00018 
00024 
00049 typedef void (*oski_errhandler_t) (int, const char *,
00050                    const char *, unsigned long, const char *,
00051                    ...);
00052 
00059 oski_errhandler_t oski_GetErrorHandler (void);
00060 
00066 oski_errhandler_t oski_SetErrorHandler (oski_errhandler_t new_handler);
00067 
00073 void oski_HandleErrorDefault (int error_code, const char *message,
00074                   const char *source_filename,
00075                   unsigned long line_number,
00076                   const char *format_string, ...);
00077 
00081 const char *oski_GetErrorName (int error_code);
00082 
00084 #define oski_HandleError  (oski_GetErrorHandler())
00085 
00096 #define IS_VAL_IN_RANGE(x, a, b)  \
00097     ((((a) <= (b)) && ((x) >= (a)) && ((x) <= (b))) \
00098     || (((a) > (b)) && ((x) >= (b)) && ((x) <= (a))))
00099 
00107 #define ERR_OUT_OF_MEMORY -1 
00108 #define ERR_INIT_LIB -2 
00109 #define ERR_INIT_SHAREDLIB -3
00110 
00111 #define ERR_BAD_ID -4 
00112 #define ERR_LOAD_MOD -5 
00113 #define ERR_UNLOAD_MOD -6 
00114 #define ERR_LOAD_MATTYPE -7 
00115 #define ERR_UNLOAD_MATTYPE -8 
00116 #define ERR_NOT_IMPLEMENTED -9 
00117 #define ERR_BAD_ARG -10 
00118 #define ERR_INMATPROP_CONFLICT -11
00119 
00120 #define ERR_DIM_MISMATCH -12
00121 
00122 #define ERR_FALSE_INMATPROP -13
00123 
00124 #define ERR_BAD_LEADDIM -14
00125 
00126 #define ERR_BAD_MAT -15
00127 
00128 #define ERR_BAD_VECVIEW -16
00129 
00130 #define ERR_WRONG_ANS -17
00131 
00132 #define ERR_BAD_HINT_ARG -18
00133 
00134 #define ERR_CANT_CONVERT -19
00135 
00136 #define ERR_FILE_READ -20
00137 
00138 #define ERR_BAD_SYNTAX -21
00139 
00140 #define ERR_OLUA_NORET -22
00141 
00142 #define ERR_OLUA_STARTUP -23
00143 
00144 #define ERR_OLUA_TYPE_MISMATCH -24
00145 
00146 #define ERR_BAD_PERM -25
00147 
00148 #define ERR_BAD_ENTRY -26
00149 
00150 #define ERR_ZERO_ENTRY -27
00151 
00153 
00162 
00164 #define OSKI_ERR(method, err_code) \
00165     {if( (err_code) < 0 ) { \
00166         oski_HandleError( (err_code), "An error occurred", \
00167             __FILE__, __LINE__, "In call to '%s()': %s", \
00168             MACRO_TO_STRING(method), oski_GetErrorName(err_code) ); \
00169     }}
00170 
00172 #define OSKI_ERR_NOT_IMPLEMENTED(method, desc) \
00173     oski_HandleError( ERR_NOT_IMPLEMENTED, \
00174         "Feature not yet implemented", __FILE__, __LINE__, \
00175         "%s, %s()", desc, MACRO_TO_STRING(method) \
00176     )
00177 
00179 #define OSKI_ERR_MATTYPEID_MEMBER(method, id, member) \
00180     oski_HandleError( ERR_NOT_IMPLEMENTED, \
00181         "Can't find matrix type-specific method implementation", \
00182         __FILE__, __LINE__, \
00183         "In call to %s(): Could not load %s() for matrix type #%d\n", \
00184         MACRO_TO_STRING(method), "oski_" MACRO_TO_STRING(member), \
00185         (int)(id) \
00186     )
00187 
00189 #define OSKI_ERR_MATTYPE_MEMBER(method, name, member) \
00190     oski_HandleError( ERR_NOT_IMPLEMENTED, \
00191         "Can't find matrix type-specific method implementation", \
00192         __FILE__, __LINE__, \
00193         "In call to %s(): Could not load %s() for matrix type" \
00194             " %s(ind=%s, val=%s)" \
00195         MACRO_TO_STRING(method), "oski_" MACRO_TO_STRING(member), \
00196         name, MACRO_TO_STRING(IND_T), MACRO_TO_STRING(VAL_T) \
00197     )
00198 
00200 #define OSKI_ERR_BAD_INMATPROP(method, val) \
00201     oski_HandleError( ERR_BAD_ARG, \
00202         "Unrecognized input matrix property specified", __FILE__, __LINE__, \
00203         "Got '%d' in call to %s()", (int)(val), MACRO_TO_STRING(method) \
00204     )
00205 
00215 #define OSKI_ERR_INMATPROP_CONFLICT(method, arg_num) \
00216     oski_HandleError( ERR_INMATPROP_CONFLICT, \
00217         "Conflicting input matrix properties were specified", \
00218         __FILE__, __LINE__, \
00219         "Please check property #%d specified in the call to %s()", \
00220         (int)((arg_num)+1), MACRO_TO_STRING(method) \
00221     )
00222 
00228 #define OSKI_ERR_BAD_DIMS(method, m, n) \
00229     oski_HandleError( ERR_BAD_ARG, \
00230         "Matrix dimensions must be non-negative", \
00231         __FILE__, __LINE__, \
00232         "Dimensions specified in call to %s(): %d x %d\n", \
00233         MACRO_TO_STRING(method), (int)m, (int)n \
00234     )
00235 
00239 #define OSKI_ERR_BAD_COPYMODE(method, mode) \
00240     oski_HandleError( ERR_BAD_ARG, \
00241         "Unrecognized copy mode specified", \
00242         __FILE__, __LINE__, "Mode specified to %s(): %d", \
00243         MACRO_TO_STRING(method), (int)(mode) \
00244     )
00245 
00249 #define OSKI_ERR_BAD_STORAGE( method, mode ) \
00250     oski_HandleError( ERR_BAD_ARG, \
00251         "Unrecognized dense vector/multivector data layout specified", \
00252         __FILE__, __LINE__, "Layout specified to %s(): %d", \
00253         MACRO_TO_STRING(method), (int)(mode) \
00254     )
00255 
00259 #define OSKI_ERR_BAD_MATOP_MS( method, argnum, opA ) \
00260     oski_HandleError( ERR_BAD_ARG, \
00261         "Unrecognized matrix transpose operation", __FILE__, __LINE__, \
00262         "Please check parameter #%d passed to %s() which equals %d", \
00263         (int)(argnum), (method), (int)(opA) \
00264     )
00265 
00269 #define OSKI_ERR_BAD_MATOP( method, argnum, opA ) \
00270     OSKI_ERR_BAD_MATOP_MS( MACRO_TO_STRING(method), (argnum), (opA) )
00271 
00275 #define OSKI_ERR_BAD_ATAOP_MS( method, argnum, op ) \
00276     oski_HandleError( ERR_BAD_ARG, \
00277         "Unrecognized A^T*A transpose operation", __FILE__, __LINE__, \
00278         "Please check parameter #%d passed to %s() which equals %d", \
00279         (int)(argnum), (method), (int)(op) \
00280     )
00281 
00285 #define OSKI_ERR_BAD_ATAOP( method, argnum, op ) \
00286     OSKI_ERR_BAD_ATAOP_MS( MACRO_TO_STRING(method), argnum, op )
00287 
00291 #define OSKI_ERR_DIM_MISMATCH_MS(method, m_A, n_A, m_B, n_B, m_C, n_C) \
00292     oski_HandleError( ERR_DIM_MISMATCH, \
00293         "Cannot multiply matrices with incompatible dimensions", \
00294         __FILE__, __LINE__, \
00295         "In %s(), for C = A*B, C is %d x %d, A is %d x %d, and B is %d x %d", \
00296             method, m_C, n_C, m_A, n_A, m_B, n_B \
00297     )
00298 
00302 #define OSKI_ERR_DIM_MISMATCH(method, m_A, n_A, m_B, n_B, m_C, n_C) \
00303     OSKI_ERR_DIM_MISMATCH_MS( MACRO_TO_STRING(method), \
00304         m_A, n_A, m_B, n_B, m_C, n_C )
00305 
00306 #define OSKI_ERR_DIM_UNEQUAL(method, m_A, n_A, m_B, n_B) \
00307     oski_HandleError( ERR_DIM_MISMATCH, \
00308         "The vector/matrix operands have incompatible dimensions", \
00309         __FILE__, __LINE__, \
00310         "In call to %s(), the operand dimensions are %dx%d and %dx%d", \
00311         (int)(m_A), (int)(n_A), (int)(m_B), (int)(n_B) \
00312     )
00313 
00317 #define OSKI_ERR_DIM_MISMATCH_TRANS_MS(method, m_A, n_A, m_B, n_B, m_C, n_C) \
00318     oski_HandleError( ERR_DIM_MISMATCH, \
00319         "Cannot multiply matrices with incompatible dimensions", \
00320         __FILE__, __LINE__, \
00321         "In %s(), for C = op(A)*B, C is %d x %d," \
00322             "op(A) is %d x %d, and B is %d x %d", \
00323             method, m_C, n_C, n_A, m_A, m_B, n_B \
00324     )
00325 
00329 #define OSKI_ERR_DIM_MISMATCH_TRANS(method, m_A, n_A, m_B, n_B, m_C, n_C) \
00330     OSKI_ERR_DIM_MISMATCH_TRANS_MS( MACRO_TO_STRING(method), \
00331         m_A, n_A, m_B, n_B, m_C, n_C )
00332 
00345 #define OSKI_ERR_DIM_MISMATCH_OBJ_MS(method, A, B, C) \
00346     OSKI_ERR_DIM_MISMATCH_MS( method, (A)->num_rows, (A)->num_cols, \
00347         ((B) == INVALID_VEC) ? (A)->num_cols : (B)->num_rows, \
00348         ((B) == INVALID_VEC) ? (C)->num_cols : (B)->num_cols, \
00349         ((C) == INVALID_VEC) ? (A)->num_rows : (C)->num_rows, \
00350         ((C) == INVALID_VEC) ? (B)->num_cols : (C)->num_cols \
00351     )
00352 
00365 #define OSKI_ERR_DIM_MISMATCH_OBJ(method, A, B, C) \
00366     OSKI_ERR_DIM_MISMATCH_OBJ_MS( MACRO_TO_STRING(method), A, B, C )
00367 
00380 #define OSKI_ERR_DIM_MISMATCH_TRANS_OBJ_MS(method, A, B, C) \
00381     OSKI_ERR_DIM_MISMATCH_TRANS_MS(method, (A)->num_rows, (A)->num_cols, \
00382         ((B) == INVALID_VEC) ? (A)->num_rows : (B)->num_rows, \
00383         ((B) == INVALID_VEC) ? (C)->num_cols : (B)->num_cols, \
00384         ((C) == INVALID_VEC) ? (A)->num_cols : (C)->num_rows, \
00385         ((C) == INVALID_VEC) ? (B)->num_cols : (C)->num_cols \
00386     )
00387 
00400 #define OSKI_ERR_DIM_MISMATCH_TRANS_OBJ(method, A, B, C) \
00401     OSKI_ERR_DIM_MISMATCH_TRANS_OBJ_MS( MACRO_TO_STRING(method), A, B, C )
00402 
00410 #define OSKI_ERR_NULL_ARG_MS(method, argnum, argname) \
00411     oski_HandleError( ERR_BAD_ARG, \
00412         "Parameter should not equal NULL", __FILE__, __LINE__, \
00413         "Please check parameter #%d (%s) passed to %s()", \
00414         (int)(argnum), (const char *)((argname) ? (argname) : "?"), method \
00415     )
00416 
00418 #define OSKI_ERR_NULL_ARG( method, argnum, argname ) \
00419     OSKI_ERR_NULL_ARG_MS( MACRO_TO_STRING(method), argnum, argname )
00420 
00429 #define OSKI_ERR_SMALL_ARG_MS(method, argnum, argname, min_val) \
00430     oski_HandleError( ERR_BAD_ARG, \
00431         ((min_val) == 0 ? "Parameter must be non-negative" \
00432             : (min_val) == 1 ? "Parameter must be positive" \
00433             : "Parameter value too small"), \
00434         __FILE__, __LINE__, \
00435         "Please check parameter #%d (%s) passed to %s()", \
00436         (int)(argnum), (const char *)((argname) ? (argname) : "?"), method \
00437     )
00438 
00440 #define OSKI_ERR_SMALL_ARG( method, argnum, argname, min_val ) \
00441     OSKI_ERR_SMALL_ARG_MS(MACRO_TO_STRING(method), argnum, argname, min_val)
00442 
00451 #define OSKI_ERR_BAD_STRIDE( method, argnum, stride, min_val ) \
00452     oski_HandleError( ERR_BAD_LEADDIM, \
00453         "Illegal leading dimension (stride) specified", __FILE__, __LINE__, \
00454         "Stride passed to %s() equals %d, but should be at least %d", \
00455         MACRO_TO_STRING(method), (int)stride, (int)min_val \
00456     )
00457 
00464 #define OSKI_ERR_BAD_MAT_MS( method, argnum ) \
00465     oski_HandleError( ERR_BAD_MAT, \
00466         "Invalid matrix handle", __FILE__, __LINE__, \
00467         "Please check matrix object, parameter #%d in call to %s()", \
00468         (int)(argnum), (method) \
00469     )
00470 
00477 #define OSKI_ERR_BAD_MAT( method, argnum ) \
00478     OSKI_ERR_BAD_MAT_MS( MACRO_TO_STRING(method), argnum )
00479 
00484 #define OSKI_ERR_NO_REPR( method, argnum ) \
00485     oski_HandleError( ERR_BAD_ARG, \
00486         "Matrix handle does not have any representations", __FILE__, __LINE__, \
00487         "Please check parameter #%d in call to %s()", \
00488         (int)(argnum), MACRO_TO_STRING(method) \
00489     )
00490 
00497 #define OSKI_ERR_BAD_PERM( method, argnum ) \
00498     oski_HandleError( ERR_BAD_MAT, \
00499         "Invalid permutation matrix object", __FILE__, __LINE__, \
00500         "Please check permutation object, parameter #%d in call to %s()", \
00501         (int)(argnum), MACRO_TO_STRING(method) \
00502     )
00503 
00510 #define OSKI_ERR_MAT_NOTSQUARE_MS( method, argnum ) \
00511     oski_HandleError( ERR_BAD_MAT, \
00512         "Expected a square input matrix object", __FILE__, __LINE__, \
00513         "Please check parameter #%d in call to %s()", \
00514         (int)(argnum), (method) \
00515     )
00516 
00523 #define OSKI_ERR_MAT_NOTSQUARE( method, argnum ) \
00524     OSKI_ERR_MAT_NOTSQUARE_MS( MACRO_TO_STRING(method), argnum )
00525 
00532 #define OSKI_ERR_BAD_VEC_MS( method, argnum ) \
00533     oski_HandleError( ERR_BAD_VECVIEW, \
00534         "Invalid vector view object", __FILE__, __LINE__, \
00535         "Please check vector view object, parameter #%d in call to %s()", \
00536         (int)(argnum), (method) \
00537     )
00538 
00545 #define OSKI_ERR_BAD_VEC( method, argnum ) \
00546     OSKI_ERR_BAD_VEC_MS( MACRO_TO_STRING(method), argnum )
00547 
00551 #define OSKI_ERR_WRONG_ANS_ELEM( method, x_true, x_calc, index ) \
00552     oski_HandleError( ERR_WRONG_ANS, \
00553         "Mistake detected in computation", __FILE__, __LINE__, \
00554         "Please check array element %d: " \
00555             "computed %g but expected %g.", index, x_calc, x_true \
00556     )
00557 
00561 #define OSKI_ERR_WRONG_ANS_ELEM_COMPLEX( method, x_true, x_calc, index ) \
00562     oski_HandleError( ERR_WRONG_ANS, \
00563         "Mistake detected in computation", __FILE__, __LINE__, \
00564         "Please check array element %d: " \
00565             "computed %g+%gi but expected %g+%gi.", \
00566         index, _RE(x_calc), _IM(x_calc), _RE(x_true), _IM(x_true) \
00567     )
00568 
00572 #define OSKI_ERR_BAD_HINT( method, argnum, hint ) \
00573     oski_HandleError( ERR_BAD_HINT_ARG, \
00574         "An unrecognized hint was specified", __FILE__, __LINE__, \
00575         "Please check the value (%d) of the hint " \
00576             "passed as argument %d in call to %s().", \
00577         (int)(hint), (int)(argnum), MACRO_TO_STRING(method) \
00578     )
00579 
00583 #define OSKI_ERR_BAD_HINT_ARG( method, argnum, hint, int_val ) \
00584     oski_HandleError( ERR_BAD_HINT_ARG, \
00585         "An invalid hint parameter was specified", __FILE__, __LINE__, \
00586         "Please check the parameter value %d (=%d) passed to the" \
00587             " structural hint '%s' in call to %s().", \
00588         (int)(argnum), (int)(int_val), MACRO_TO_STRING(hint), \
00589         MACRO_TO_STRING(method) \
00590     )
00591 
00596 #define OSKI_ERR_INCOMPAT_NUMVECS_MS( method, argnum_x, nv_x, argnum_y, nv_y ) \
00597     oski_HandleError( ERR_DIM_MISMATCH, \
00598         "Vector views have incompatible dimensions", __FILE__, __LINE__, \
00599         "In call to %s(), vector operands, parameters #%d and #%d," \
00600             " should have same number of vectors but don't" \
00601             " (%d and %d, respectively)", \
00602         (method), (int)(argnum_x), (int)(argnum_y), \
00603         (int)(nv_x), (int)(nv_y) \
00604     )
00605 
00610 #define OSKI_ERR_INCOMPAT_NUMVECS( method, argnum_x, nv_x, argnum_y, nv_y ) \
00611     OSKI_ERR_INCOMPAT_NUMVECS_MS( MACRO_TO_STRING(method), \
00612         argnum_x, nv_x, argnum_y, nv_y )
00613 
00617 #define OSKI_ERR_NO_APPLYHEUR( method, heur_desc ) \
00618     oski_HandleError( ERR_CANT_CONVERT, \
00619         "Can't convert to new data structure", __FILE__, __LINE__, \
00620         "In call to %s(), can't apply results of heuristic '%s'", \
00621         MACRO_TO_STRING(method), (heur_desc) \
00622     )
00623 
00625 #define OSKI_ERR_FILE_READ( method, filename ) \
00626     oski_HandleError( ERR_FILE_READ, \
00627         "Can't read a file", __FILE__, __LINE__, \
00628         "In call to %s(): Please check that the requested file" \
00629             ", '%s', exists and is properly formatted.", \
00630         MACRO_TO_STRING(method), filename )
00631 
00633 #define OSKI_ERR_BAD_ENTRY( method, argnum, i, j, m, n ) \
00634     oski_HandleError( ERR_BAD_ARG, \
00635         "Caller specified an invalid matrix entry", __FILE__, __LINE__, \
00636         "Parameter #%d in call to %s(): The entry (%d, %d) is invalid." \
00637             " (The row/column indices must be at least 1 and less than the" \
00638             " matrix dimensions, %d x %d.)", \
00639         (int)(argnum), MACRO_TO_STRING(method), (int)(i), (int)(j), \
00640         (int)(m), (int)(n) \
00641     )
00642 
00644 #define OSKI_ERR_MOD_UNIT_DIAG_REAL( method, row, col, val ) \
00645     oski_HandleError( ERR_INMATPROP_CONFLICT, \
00646         "Attempt to change the unit diagonal", __FILE__, __LINE__, \
00647         "In %s(): Attempt to change the (%d, %d) entry to %g", \
00648         MACRO_TO_STRING(method), (int)(row), (int)(col), \
00649         (double)(val) \
00650     )
00651 
00653 #define OSKI_ERR_MOD_UNIT_DIAG_COMPLEX( method, row, col, val ) \
00654     oski_HandleError( ERR_INMATPROP_CONFLICT, \
00655         "Attempt to change the unit diagonal", __FILE__, __LINE__, \
00656         "In %s(): Attempt to change the (%d, %d) entry to %g+%gi", \
00657         MACRO_TO_STRING(method), (int)(row), (int)(col), \
00658         (double)_RE(val), (double)_IM(val) \
00659     )
00660 
00662 #define OSKI_ERR_MOD_TRI_REAL( method, is_upper, row, col, val ) \
00663     oski_HandleError( ERR_ZERO_ENTRY, \
00664         "Attempt to change zero part of triangular matrix", \
00665         __FILE__, __LINE__, \
00666         "In %s(): Tried to change (%d, %d) entry of a %s-triangular" \
00667             " matrix to %g", \
00668         MACRO_TO_STRING(method), (int)(row), (int)(col), \
00669         (is_upper) ? "upper" : "lower", (double)(val) \
00670     )
00671 
00673 #define OSKI_ERR_MOD_TRI_COMPLEX( method, is_upper, row, col, val ) \
00674     oski_HandleError( ERR_ZERO_ENTRY, \
00675         "Attempt to change zero part of triangular matrix", \
00676         __FILE__, __LINE__, \
00677         "In %s(): Tried to change (%d, %d) entry of a %s-triangular" \
00678             " matrix to %g+%gi", \
00679         MACRO_TO_STRING(method), (int)(row), (int)(col), \
00680         (is_upper) ? "upper" : "lower", (double)_RE(val), (double)_IM(val) \
00681     )
00682 
00684 #define OSKI_ERR_ZERO_ENTRY_REAL( method, row, col, val ) \
00685     oski_HandleError( ERR_ZERO_ENTRY, \
00686         "Attempt to change an implicit zero entry", __FILE__, __LINE__, \
00687         "In %s(): Tried to change implicit entry (%d, %d) to %g", \
00688         MACRO_TO_STRING(method), (int)(row), (int)(col), (double)(val) \
00689     )
00690 
00692 #define OSKI_ERR_ZERO_ENTRY_COMPLEX( method, row, col, val ) \
00693     oski_HandleError( ERR_ZERO_ENTRY, \
00694         "Attempt to change an implicit zero entry", __FILE__, __LINE__, \
00695         "In %s(): Tried to change implicit entry (%d, %d) to %g+%gi", \
00696         MACRO_TO_STRING(method), (int)(row), (int)(col), \
00697         (double)_RE(val), (double)_IM(val) \
00698     )
00699 
00701 #define OSKI_ERR_BAD_ROW_MS( method, argnum, row, min, max ) \
00702     oski_HandleError( ERR_BAD_ENTRY, \
00703         "Caller specified an invalid row index", __FILE__, __LINE__, \
00704         "In %s(): The row index %d, given in parameter %d, is out of" \
00705             " the range [%d, %d]", \
00706         method, (int)(row), (int)(argnum), (int)(min), (int)(max) \
00707     )
00708 
00710 #define OSKI_ERR_BAD_ROW( method, argnum, row, min, max ) \
00711     OSKI_ERR_BAD_ROW_MS( MACRO_TO_STRING(method), argnum, row, min, max )
00712 
00714 #define OSKI_ERR_BAD_COL_MS( method, argnum, col, min, max ) \
00715     oski_HandleError( ERR_BAD_ENTRY, \
00716         "Caller specified an invalid column index", __FILE__, __LINE__, \
00717         "In %s(): The column index %d, given in parameter %d, is out of" \
00718             " the range [%d, %d]", \
00719         method, (int)(col), (int)(argnum), (int)(min), (int)(max) \
00720     )
00721 
00723 #define OSKI_ERR_BAD_COL( method, argnum, col, min, max ) \
00724     OSKI_ERR_BAD_COL_MS( MACRO_TO_STRING(method), argnum, col, min, max )
00725 
00727 #define OSKI_ERR_CLIQUE_VALMAT_SMALL_MS( method, argnum, V, r, c ) \
00728     oski_HandleError( ERR_BAD_VECVIEW, \
00729         "The array holding clique values is too small", __FILE__, __LINE__, \
00730         "In %s(): The array holding clique values (parameter #%d)" \
00731             " is %d x %d, but should be at least %d x %d", \
00732         method, (int)(argnum), \
00733         (int)((V)->num_rows), (int)((V)->num_cols), (int)(r), (int)(c) \
00734     )
00735 
00737 #define OSKI_ERR_CLIQUE_VALMAT_SMALL( method, argnum, V, r, c ) \
00738     OSKI_ERR_CLIQUE_VALMAT_SMALL( MACRO_TO_STRING(method), argnum, V, r, c )
00739 
00741 #define OSKI_ERR_BAD_DIAG_MS( method, argnum, d, m, n ) \
00742     oski_HandleError( ERR_BAD_ARG, \
00743         "The specified diagonal does not exist", __FILE__, __LINE__, \
00744         "In %s(): The specified diagonal (parameter #%d), %d, is not" \
00745             " in the proper range of [%d, %d] for an %d x %d matrix", \
00746         method, (int)(argnum), (int)(d), \
00747             (int)(1-(m)), (int)((n)-1), (m), (n) \
00748     )
00749 
00751 #define OSKI_ERR_BAD_DIAG( method, argnum, d, m, n ) \
00752     OSKI_ERR_BAD_DIAG_MS( MACRO_TO_STRING(method), (argnum), (d), (m), (n) )
00753 
00755 #define OSKI_ERR_DIAG_VALMAT_SMALL_MS( method, argnum, V, r, c ) \
00756     oski_HandleError( ERR_BAD_VECVIEW, \
00757         "The array to hold the diagonal values is too small", \
00758             __FILE__, __LINE__, \
00759         "In %s(): The array to hold the diagonal values (parameter #%d)" \
00760             " is %d x %d, but should be at least %d x %d", \
00761         method, (int)(argnum), \
00762         (int)((V)->num_rows), (int)((V)->num_cols), (int)(r), (int)(c) \
00763     )
00764 
00766 #define OSKI_ERR_DIAG_VALMAT_SMALL( method, argnum, V, r, c ) \
00767     OSKI_ERR_DIAG_VALMAT_SMALL( MACRO_TO_STRING(method), argnum, V, r, c )
00768 
00770 #define OSKI_ERR_MAT_NOTTRI_MS( method, argnum ) \
00771     oski_HandleError( ERR_BAD_MAT, \
00772         "The matrix may not be triangular", __FILE__, __LINE__, \
00773         "Please check parameter #%d in the call to %s().", \
00774         (int)(argnum), (method) \
00775     )
00776 
00778 #define OSKI_ERR_MAT_NOTTRI( method, argnum ) \
00779     OSKI_ERR_MAT_NOTTRI_MS( MACRO_TO_STRING(method), argnum )
00780 
00782 #define OSKI_ERR_BAD_POWER_MS( method, argnum, power ) \
00783     oski_HandleError( ERR_BAD_ARG, \
00784         "Matrix power must be non-negative", __FILE__, __LINE__, \
00785         "Please check paramter #%d (power == %d) in the call to %s().", \
00786         (int)(argnum), (int)(power), (method) \
00787     )
00788 
00790 #define OSKI_ERR_BAD_POWER( method, argnum, power ) \
00791     OSKI_ERR_BAD_POWER_MS( MACRO_TO_STRING(method), argnum, power )
00792 
00794 #define OSKI_ERR_VEC1_ONLY( method, argnum, num_vecs ) \
00795     oski_HandleError( ERR_BAD_VECVIEW, \
00796         "Only single-vectors supported", \
00797         "Please check parameter #%d in call to %s(): " \
00798             "Caller passed in a multivector object (%d vectors) " \
00799             "where a single vector was expected.", \
00800             (int)(argnum), (method), (num_vecs) \
00801     )
00802 
00804 #define OSKI_ERR_VEC1_ONLY_MS( method, argnum, num_vecs ) \
00805     OSKI_ERR_VEC1_ONLY( MACRO_TO_STRING(method), argnum, num_vecs )
00806 
00808 #define OSKI_ERR_VEC_FEW_MS( method, argnum, num_vecs, num_needed ) \
00809     oski_HandleError( ERR_BAD_VECVIEW, \
00810         "Too few vectors provided", \
00811         "Please check parameter #%d in call to %s(): " \
00812             "Caller passed a %d-vector object, but at least %d required.", \
00813         (int)(argnum), (method), (int)(num_vecs), (int)(num_needed) \
00814     )
00815 
00817 #define OSKI_ERR_VEC_FEW( method, argnum, num_vecs, num_needed ) \
00818     OSKI_ERR_VEC_FEW_MS( MACRO_TO_STRING(method), \
00819         argnum, num_vecs, num_needed )
00820 
00823 #endif /* !defined(INC_BEBOP_OSKI_ERROR_H) */
00824 
00825 /* eof */

Generated on Wed Sep 19 16:41:18 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6