You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
1.5 KiB

2 years ago
# mmathlib
2 years ago
***get repo***
4 years ago
```bash
2 years ago
git clone https://code.smolnet.org/micke/mmathlib.git
cd mmathlib
4 years ago
```
4 years ago
2 years ago
***Compile and run***
2 years ago
```
g++ main.cpp vector.cpp -o example
./example
2 years ago
```
2 years ago
*Output*
4 years ago
```
4 years ago
7/3=(7/3)
7/3=2.333333333
1/11=(1/11)
1/11=0.09090909091
(7/3)+(1/11)=(80/33)
(7/3)+(1/11)=2.424242424
(7/3)-(1/11)=(74/33)
(7/3)-(1/11)=2.242424242
(7/3)*(1/11)=(7/33)
(7/3)*(1/11)=0.2121212121
(7/3)/(1/11)=(77/3)
(7/3)/(1/11)=25.66666667
0.75=(3/4)
4 years ago
a = 3+2i
a* = 3-2i
a*a* = 13
b = 4-3i
b* = 4+3i
b*b* = 25
a + b = 7-i
(a + b)* = 7+i
a - b = -1+5i
(a - b)* = -1-5i
a * b = 18-i
(a * b)* = 18+i
a / b = (6/25)+(17/25)i
(a / b)* = (6/25)-(17/25)i
2 years ago
v:
|1|
|2|
|i|
2 years ago
w:
|3|
|4|
|5|
2 years ago
v + w:
|4 |
|6 |
|5+i|
2 years ago
v - w:
|-2 |
|-2 |
|-5+i|
2 years ago
v * w:
11+5i
2 years ago
w * i:
|3i|
|4i|
|5i|
2 years ago
Element 0 of v:
1
Element 1 of v:
2
Element 2 of v:
i
A temp vector of dimension 3
|0|
|0|
|0|
2 years ago
Assignment of w to k
|3|
|4|
|5|
2 years ago
Manually set elements of k to elements of v
|1|
|2|
|i|
The matrix m
|1|1|
|1|1|
2 years ago
The determinant of matrix m:
0
The matrix n:
|2 |1+i|
|1-i|5 |
The matrix n roted by one pi radian:
|1+i|5 |
|2 |1-i|
2 years ago
The determinant of matrix n:
8
The matrix n's transpose:
|2 |1-i|
|1+i|5 |
The matrix n's diagonal:
|2|
|5|
The matrix n's off diagonal:
|1+i|
|1-i|
The vector d:
|1-i|
|5 |
The matrix n * the vector d
|2-2i|2 |
|5-5i|25 |
The vector d * the matrix n
|7-7i|
|27 |
2 years ago
The matrix m * n
|3-i|6+i|
|3-i|6+i|
The matrix m + n
|3 |2+i|
|2-i|6 |
Is 2 an eigenvalue of m?
Yes!
2 years ago
The matrix n is hermitian, here is the hermitian conjugate:
|2 |1+i|
|1-i|5 |
4 years ago
```