MsPASS C++ API  2.4.4.dev122+gb075c5a7b
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
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:
Collaboration diagram for mspass::utility::dmatrix_size_error:

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

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