Amesos Package Browser (Single Doxygen Collection)
Development
src
SuiteSparse
CHOLMOD
Core
amesos_cholmod_l_error.c
Go to the documentation of this file.
1
/* ========================================================================== */
2
/* === Core/cholmod_error =================================================== */
3
/* ========================================================================== */
4
5
/* -----------------------------------------------------------------------------
6
* CHOLMOD/Core Module. Copyright (C) 2005-2006,
7
* Univ. of Florida. Author: Timothy A. Davis
8
* The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU
9
* Lesser General Public License. See lesser.txt for a text of the license.
10
* CHOLMOD is also available under other licenses; contact authors for details.
11
* http://www.cise.ufl.edu/research/sparse
12
* -------------------------------------------------------------------------- */
13
14
/* CHOLMOD error-handling routine. */
15
16
/* This file should make the long int version of CHOLMOD */
17
#define DLONG 1
18
19
#include "
amesos_cholmod_internal.h
"
20
#include "
amesos_cholmod_core.h
"
21
22
/* ========================================================================== */
23
/* ==== cholmod_error ======================================================= */
24
/* ========================================================================== */
25
26
/* An error has occurred. Set the status, optionally print an error message,
27
* and call the user error-handling routine (if it exists). If
28
* Common->try_catch is TRUE, then CHOLMOD is inside a try/catch block.
29
* The status is set, but no message is printed and the user error handler
30
* is not called. This is not (yet) an error, since CHOLMOD may recover.
31
*
32
* In the current version, this try/catch mechanism is used internally only in
33
* cholmod_analyze, which tries multiple ordering methods and picks the best
34
* one. If one or more ordering method fails, it keeps going. Only one
35
* ordering needs to succeed for cholmod_analyze to succeed.
36
*/
37
38
int
CHOLMOD
(
error
)
39
(
40
/* ---- input ---- */
41
int
status,
/* error status */
42
char
*file,
/* name of source code file where error occured */
43
int
line,
/* line number in source code file where error occured*/
44
char
*message,
/* error message */
45
/* --------------- */
46
cholmod_common
*
Common
47
)
48
{
49
RETURN_IF_NULL_COMMON
(
FALSE
) ;
50
51
Common
->status = status ;
52
53
if
(!(
Common
->try_catch))
54
{
55
56
#ifndef NPRINT
57
/* print a warning or error message */
58
if
(
Common
->print_function !=
NULL
)
59
{
60
if
(status > 0 &&
Common
->print > 1)
61
{
62
(
Common
->print_function) (
"CHOLMOD warning: %s\n"
, message) ;
63
fflush (stdout) ;
64
fflush (stderr) ;
65
}
66
else
if
(
Common
->print > 0)
67
{
68
(
Common
->print_function) (
"CHOLMOD error: %s\n"
, message) ;
69
fflush (stdout) ;
70
fflush (stderr) ;
71
}
72
}
73
#endif
74
75
/* call the user error handler, if it exists */
76
if
(
Common
->error_handler !=
NULL
)
77
{
78
Common
->error_handler (status, file, line, message) ;
79
}
80
}
81
82
return
(
TRUE
) ;
83
}
cholmod_common_struct
Definition:
amesos_cholmod_core.h:393
Common
FALSE
#define FALSE
Definition:
amesos_amd_internal.h:141
RETURN_IF_NULL_COMMON
#define RETURN_IF_NULL_COMMON(result)
Definition:
amesos_cholmod_internal.h:126
amesos_cholmod_core.h
CHOLMOD
#define CHOLMOD(name)
Definition:
amesos_cholmod_internal.h:272
NULL
#define NULL
Definition:
amesos_amd_internal.h:153
amesos_cholmod_internal.h
error
int CHOLMOD() error(int status, char *file, int line, char *message, cholmod_common *Common)
Definition:
amesos_cholmod_l_error.c:39
TRUE
#define TRUE
Definition:
amesos_amd_internal.h:140
Generated by
1.8.14