vnl_error.cxx
Go to the documentation of this file.
1 // This is core/vnl/vnl_error.cxx
2 //:
3 // \file
4 //
5 // Copyright (C) 1991 Texas Instruments Incorporated.
6 // Copyright (C) 1993 General Electric Company.
7 //
8 // Permission is granted to any individual or institution to use, copy, modify,
9 // and distribute this software, provided that this complete copyright and
10 // permission notice is maintained, intact, in all copies and supporting
11 // documentation.
12 //
13 // Texas Instruments Incorporated and General Electric Company
14 // provides this software "as is" without express or implied warranty.
15 
16 #include <iostream>
17 
18 #include "vnl/vnl_error.h"
19 
20 //: Raise exception for invalid index.
21 void vnl_error_vector_index (char const* fcn, int index)
22 {
23  //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Index),
24  std::cerr << "vnl_error_vector_index:" << fcn
25  << ": Invalid value " << index << " specified for index.\n";
26  throw 0;
27 }
28 
29 //: Raise exception for invalid dimension.
30 void vnl_error_vector_dimension (char const* fcn, int l1, int l2)
31 {
32  //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Dim),
33  std::cerr << "vnl_error_vector_dimension:" << fcn << ": Dimensions ["
34  << l1 << "] and [" << l2 << "] do not match.\n";
35  throw 0;
36 }
37 
38 
39 //: Raise exception for using class objects, or chars in (...).
41 {
42  //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Va_Arg),
43  std::cerr << "vnl_error_vector_va_arg: Invalid type in ..."
44  << " or wrong alignment with " << n << " bytes.\n";
45  throw 0;
46 }
47 
48 //--------------------------------------------------------------------------------
49 
50 //: Raise exception for invalid row index.
51 void vnl_error_matrix_row_index (char const* fcn, int r)
52 {
53  //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Row),
54  std::cerr << "vnl_error_matrix_row_index:" << fcn
55  << ": Invalid value " << r << " specified for row.\n";
56  throw 0;
57 }
58 
59 
60 //: Raise exception for invalid col index.
61 void vnl_error_matrix_col_index (char const* fcn, int c)
62 {
63  //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Col),
64  std::cerr << "vnl_error_matrix_col_index:" << fcn << ": Invalid value "
65  << c << " specified for column.\n";
66  throw 0;
67 }
68 
69 //: Raise exception for invalid dimensions.
70 void vnl_error_matrix_dimension (char const* fcn, int r1, int c1, int r2, int c2)
71 {
72  //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Dim),
73  std::cerr << "vnl_error_matrix_dimension:" << fcn << ": Dimensions [" << r1
74  << ',' << c1 << "] and [" << r2 << ',' << c2 << "] do not match.\n";
75  throw 0;
76 }
77 
78 
79 //: Raise exception for a nonsquare matrix.
80 void vnl_error_matrix_nonsquare (char const* fcn)
81 {
82  //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Dim),
83  std::cerr << "vnl_error_matrix_nonsquare:" << fcn
84  << ": Matrix must be square.\n";
85  throw 0;
86 }
87 
88 //: Raise exception for using class objects, or chars in (...).
90 {
91  //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Va_Arg),
92  std::cerr << "vnl_error_matrix_va_arg: Invalid type in ..."
93  << " or wrong alignment with " << n << " bytes.\n";
94  throw 0;
95 }
void vnl_error_matrix_nonsquare(char const *fcn)
Raise exception for a nonsquare matrix.
Definition: vnl_error.cxx:80
void vnl_error_matrix_row_index(char const *fcn, int r)
Raise exception for invalid row index.
Definition: vnl_error.cxx:51
void vnl_error_matrix_col_index(char const *fcn, int c)
Raise exception for invalid col index.
Definition: vnl_error.cxx:61
void vnl_error_vector_dimension(char const *fcn, int l1, int l2)
Raise exception for invalid dimension.
Definition: vnl_error.cxx:30
void vnl_error_matrix_dimension(char const *fcn, int r1, int c1, int r2, int c2)
Raise exception for invalid dimensions.
Definition: vnl_error.cxx:70
void vnl_error_vector_index(char const *fcn, int index)
Raise exception for invalid index.
Definition: vnl_error.cxx:21
void vnl_error_matrix_va_arg(int n)
Raise exception for using class objects, or chars in (...).
Definition: vnl_error.cxx:89
void vnl_error_vector_va_arg(int n)
Raise exception for using class objects, or chars in (...).
Definition: vnl_error.cxx:40