-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexception.cpp
50 lines (39 loc) · 1005 Bytes
/
exception.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "exception.h"
#include <string>
#include "stdafx.h"
MatrixException::MatrixException()
{
}
MatrixException::MatrixException(const std::string & str)
{
message = message + "\n" + str;
}
const std::string & MatrixException::getMessage()
{
return message;
}
outOfRangeExcep::outOfRangeExcep()
{
}
outOfRangeExcep::outOfRangeExcep(const std::string & str):MatrixException(str){
}
dimenDismatchExcep::dimenDismatchExcep()
{
}
dimenDismatchExcep::dimenDismatchExcep(const std::string & str) :MatrixException(str) {
}
dimenDismatchExcep::dimenDismatchExcep(int a, int b, int c, int d)
{
setMessage(a, b, c, d);
}
void dimenDismatchExcep::setMessage(int r1, int c1, int r2, int c2)
{
message = message + "\n" +
"Dimension (" + std::to_string(r1) + ", " + std::to_string(c1) + ") and (" +
std::to_string(r2) + ", " + std::to_string(c2)+ ") dismatch.";
}
invalidParamExcep::invalidParamExcep()
{
}
invalidParamExcep::invalidParamExcep(const std::string & str):MatrixException(str){
}