version  0.0.1
Defines the C++ API for MsPASS
Public Member Functions | List of all members
mspass::utility::dmatrix_index_error Class Reference

special convenience class for matrix indexing errors. More...

#include <dmatrix.h>

Inheritance diagram for mspass::utility::dmatrix_index_error:
mspass::utility::MsPASSError

Public Member Functions

 dmatrix_index_error (const size_t nrmax, const size_t ncmax, const size_t ir, const size_t ic)
 
- Public Member Functions inherited from mspass::utility::MsPASSError
 MsPASSError ()
 
 MsPASSError (const std::string mess, const char *howbad)
 Construct from a std::string with badness defined by keywords in a string. More...
 
 MsPASSError (const std::string mess, const ErrorSeverity s=ErrorSeverity::Invalid)
 
 MsPASSError (const char *mess, const ErrorSeverity s)
 
void log_error ()
 
void log_error (std::ostream &ofs)
 
const char * what () const noexcept
 
ErrorSeverity severity () const
 

Additional Inherited Members

- Protected Attributes inherited from mspass::utility::MsPASSError
std::string message
 
ErrorSeverity badness
 

Detailed Description

special convenience class for matrix indexing errors.

Thrown by a dmatrix if a requested index is outside the bounds of the matrix dimension.

\author Gary L. Pavlis

Constructor & Destructor Documentation

◆ dmatrix_index_error()

mspass::utility::dmatrix_index_error::dmatrix_index_error ( const size_t  nrmax,
const size_t  ncmax,
const size_t  ir,
const size_t  ic 
)
inline

Basic constructor for this error object.

Parameters
nrmaxnumber of rows in matrix
ncmaxnumber of columns in matrix
irrow index requested
iccolumn index requested
38  {
39  row = ir; column=ic; nrr=nrmax; ncc=ncmax;
40  std::ostringstream oss;
41  oss << "dmatrix object: indexing error"<<std::endl
42  << "Matrix index (" << row << "," << column
43  << ")is outside range = " << nrr << "," << ncc << std::endl;
44  message = oss.str();
45  badness = ErrorSeverity::Invalid;
46  };
std::string message
Definition: MsPASSError.h:109
ErrorSeverity badness
Definition: MsPASSError.h:116

References mspass::utility::MsPASSError::badness, and mspass::utility::MsPASSError::message.


The documentation for this class was generated from the following file: