core/vnl/vnl_error.cxx
Go to the documentation of this file.
00001 // This is core/vnl/vnl_error.cxx
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005 //:
00006 // \file
00007 //
00008 // Copyright (C) 1991 Texas Instruments Incorporated.
00009 // Copyright (C) 1993 General Electric Company.
00010 //
00011 // Permission is granted to any individual or institution to use, copy, modify,
00012 // and distribute this software, provided that this complete copyright and
00013 // permission notice is maintained, intact, in all copies and supporting
00014 // documentation.
00015 //
00016 // Texas Instruments Incorporated and General Electric Company
00017 // provides this software "as is" without express or implied warranty.
00018 
00019 #include "vnl_error.h"
00020 #include <vcl_iostream.h>
00021 #include <vcl_cstdlib.h> // for vcl_abort()
00022 
00023 //: Raise exception for invalid index
00024 void vnl_error_vector_index (char const* fcn, int index)
00025 {
00026   //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Index),
00027   vcl_cerr << "vnl_error_vector_index:" << fcn
00028            << ": Invalid value " << index << " specified for index.\n";
00029   vcl_abort();
00030 }
00031 
00032 //: Raise exception for invalid dimensions
00033 void vnl_error_vector_dimension (char const* fcn, int l1, int l2)
00034 {
00035   //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Dim),
00036   vcl_cerr << "vnl_error_vector_dimension:" << fcn << ": Dimensions ["
00037            << l1 << "] and [" << l2 << "] do not match.\n";
00038   vcl_abort();
00039 }
00040 
00041 
00042 //: Raise exception for using class objects, or chars in (...)
00043 void vnl_error_vector_va_arg (int n)
00044 {
00045   //RAISE Error, SYM(vnl_error_vector), SYM(Invalid_Va_Arg),
00046   vcl_cerr << "vnl_error_vector_va_arg: Invalid type in ..."
00047            << " or wrong alignment with " << n << " bytes.\n";
00048   vcl_abort();
00049 }
00050 
00051 //--------------------------------------------------------------------------------
00052 
00053 void vnl_error_matrix_row_index (char const* fcn, int r)
00054 {
00055   //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Row),
00056   vcl_cerr << "vnl_error_matrix_row_index:" << fcn
00057            << ": Invalid value " << r << " specified for row.\n";
00058   vcl_abort();
00059 }
00060 
00061 
00062 //: Raise exception for invalid col index.
00063 void vnl_error_matrix_col_index (char const* fcn, int c)
00064 {
00065   //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Col),
00066   vcl_cerr << "vnl_error_matrix_col_index:" << fcn << ": Invalid value "
00067            << c << " specified for column.\n";
00068   vcl_abort();
00069 }
00070 
00071 //: Raise exception for invalid dimensions
00072 void vnl_error_matrix_dimension (char const* fcn, int r1, int c1, int r2, int c2)
00073 {
00074   //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Dim),
00075   vcl_cerr << "vnl_error_matrix_dimension:" << fcn << ": Dimensions [" << r1
00076            << ',' << c1 << "] and [" << r2 << ',' << c2 << "] do not match.\n";
00077   vcl_abort();
00078 }
00079 
00080 
00081 //: Raise exception for invalid dimensions
00082 void vnl_error_matrix_nonsquare (char const* fcn)
00083 {
00084   //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Dim),
00085   vcl_cerr << "vnl_error_matrix_nonsquare:" << fcn
00086            << ": Matrix must be square.\n";
00087   vcl_abort();
00088 }
00089 
00090 //: Raise exception for using class objects, or chars in (...)
00091 void vnl_error_matrix_va_arg (int n)
00092 {
00093   //RAISE Error, SYM(vnl_error_matrix), SYM(Invalid_Va_Arg),
00094   vcl_cerr << "vnl_error_matrix_va_arg: Invalid type in ..."
00095            << " or wrong alignment with " << n << " bytes.\n";
00096   vcl_abort();
00097 }