version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
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.
 
 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
70 {
71 nrow1 = nr1;
72 ncol1 = nc1;
73 nrow2 = nr2;
74 ncol2 = nc2;
75 std::ostringstream oss;
76 oss << "dmatrix class: size mismatch error in binary operator"
77 << std::endl
78 << "matrix on left is " << nrow1 << "X" << ncol1
79 << " while matrix on right is " << nrow2 << "X" << ncol2 << std::endl;
80 message = oss.str();
81 badness = ErrorSeverity::Invalid;
82 };
std::string message
Definition MsPASSError.h:108
ErrorSeverity badness
Definition MsPASSError.h:110

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

◆ ~dmatrix_size_error()

mspass::utility::dmatrix_size_error::~dmatrix_size_error ( )
throw (
)
inline
84{};

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