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

Convenience class for dmatrix use errors. More...

#include <dmatrix.h>

Inheritance diagram for mspass::utility::dmatrix_size_error:
mspass::utility::MsPASSError

Public Member Functions

 dmatrix_size_error (const size_t nr1, const size_t nc1, const size_t nr2, const size_t nc2)
 
- 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

Convenience class for dmatrix use errors.

Thrown by a dmatrix when two matrices have a size mismatch.

Author
Gary L. Pavlis

Constructor & Destructor Documentation

◆ dmatrix_size_error()

mspass::utility::dmatrix_size_error::dmatrix_size_error ( const size_t  nr1,
const size_t  nc1,
const size_t  nr2,
const size_t  nc2 
)
inline

Basic constructor for this error object.

Parameters
nr1number of rows in matrix 1
nc1number of columns in matrix 1
nr1number of rows in matrix 2
nc1number of columns in matrix 2
71  {
72  nrow1=nr1; ncol1=nc1;nrow2=nr2;ncol2=nc2;
73  std::ostringstream oss;
74  oss << "dmatrix class: size mismatch error in binary operator"<<std::endl
75  << "matrix on left is "<< nrow1 << "X" << ncol1
76  << " while matrix on right is "
77  << nrow2 << "X" << ncol2 << std::endl;
78  message = oss.str();
79  badness = ErrorSeverity::Invalid;
80  };
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: