3
3
4
4
> JMatrix is a matrix builder written in Java.<br >
5
5
> Developed by Ryuu Mitsuki.<br >
6
- > It can create, summarize, subtract and clear the matrix array
6
+ > It can create, summarize, subtract, multiply and clear the matrix array.<br >
7
+ > Check ` LIST FUNCTION ` below to see all functions.
7
8
8
9
---
9
10
@@ -13,12 +14,6 @@ If not, download here:<br>
13
14
2 . [ https://developers.redhat.com/products/openjdk/download ] ( https://developers.redhat.com/products/openjdk/download )
14
15
15
16
## LIST FUNCTION:rocket :
16
- > NOTE:<br >
17
- > All below functions isn't static, so create a new Matrix object first :)<br >
18
- > Except for:
19
- > - static void display(int[ ] [ ] array)
20
- > - static void sort(int[ ] [ ] array)
21
-
22
17
23
18
### add()
24
19
Fill column of matrix array with push method.<br >
@@ -27,35 +22,91 @@ If you attempt to call `add()` function again and you've matrix size 2x3, but yo
27
22
Function parameters:
28
23
- void add(int... values)
29
24
- void add(int value)
30
- > For the second parameter, it would create a single column with same value and for size equal to total matrix rows, then assign to matrix array.
31
-
32
25
33
26
### sum()
34
- Summarize current matrix array with other matrix array .<br >
27
+ Summarize current matrix array with other matrix.<br >
35
28
<br >
36
29
Function parameters:
37
- - int[ ] [ ] sum(Matrix object)
38
- - int[ ] [ ] sum(int[ ] [ ] array)
30
+ - void sum(Matrix object)
31
+ - void sum(int[ ] [ ] array)
32
+ <br >
33
+
34
+ - static int[ ] [ ] sum(int[ ] [ ] array, int[ ] [ ] array)
35
+ - static Matrix sum(Matrix obj1, Matrix obj2)
39
36
40
37
### sub()
41
- Subtract current matrix array with other matrix array.<br >
38
+ Subtract current matrix array with other matrix.<br >
39
+ <br >
40
+ Function parameters:
41
+ - void sub(Matrix obj)
42
+ - void sub(int[ ] [ ] arr)
43
+ <br >
44
+
45
+ - static int[ ] [ ] sub(int[ ] [ ] arr, int[ ] [ ] arr)
46
+ - static Matrix sub(Matrix obj1, Matrix obj2)
47
+
48
+ ### mult()
49
+ Multiply current matrix with other matrix.<br >
50
+ <br >
51
+ Function parameters:
52
+ - void mult(Matrix obj)
53
+ - void mult(int[ ] [ ] arr)
54
+ <br >
55
+
56
+ - static int[ ] [ ] mult(int[ ] [ ] arr, int[ ] [ ] arr)
57
+ - static Matrix mult(Matrix obj1, Matrix obj2)
58
+
59
+ ### transpose()
60
+ Transpose current matrix or current matrix transpose to other matrix.<br >
61
+ <br >
62
+ Function parameters:
63
+ - void transpose()
64
+ <br >
65
+
66
+ - static int[ ] [ ] transpose(int[ ] [ ] arr)
67
+ - static Matrix transpose(Matrix obj)
68
+
69
+
70
+ ### create()
71
+ Create a new matrix with specified rows and columns.<br >
72
+ <br >
73
+ Function parametera:
74
+ - void create(int rows, int cols)
75
+
76
+ ### select()
77
+ Select row matrix by given index.<br >
78
+ <br >
79
+ Function parameters:
80
+ - void select()
81
+
82
+ ### change()
83
+ Change values of selected row with given values.<br >
84
+ > Use this together with ` select ` function.<br >
85
+ > Example: ` matrixA.select(<index>).change(<values>) `
86
+ <br>
87
+
88
+ Function parameters:
89
+ - void change(int... values)
90
+ - void change(int value)
91
+
92
+ ### copy()
93
+ Copy current matrix to another matrix object.<br >
42
94
<br >
43
95
Function parameters:
44
- - int[ ] [ ] sub(Matrix object)
45
- - int[ ] [ ] sub(int[ ] [ ] array)
96
+ - Matrix copy()
46
97
47
98
### sort()
48
99
Sort all columns inside matrix array.<br >
49
100
<br >
50
101
Function parameters:
51
102
- void sort()
52
- - static void sort(int[ ] [ ] array )
103
+ - static void sort(int[ ] [ ] arr )
53
104
54
105
### getSize()
55
- Return list of matrix size.<br >
106
+ Return list of matrix size [ rows, columns ] .<br >
56
107
<br >
57
108
Function parameters:
58
- - int[ ] getSize() <- return [ \< rows \> , \< cols \> ]
109
+ - int[ ] getSize()
59
110
60
111
### clear()
61
112
Clear all each column inside matrix array, and change all values with 0.<br >
@@ -68,32 +119,26 @@ Display the matrix to console output.<br>
68
119
<br >
69
120
Function parameters:
70
121
- void display()
71
- - static void display(int[ ] [ ] array)
72
-
73
-
74
- ## EXAMPLE USAGE
122
+ - void display(int index)
123
+ <br >
75
124
76
- I've created example for ` JMatrix ` usage in ` examples ` directory (just for references).<br >
125
+ - static void display(int[ ] [ ] arr)
126
+ - static void display(int[ ] [ ] arr, int index)
77
127
78
- ---
128
+ < br >
79
129
80
- ** Clone this repository and goto ` jmatrix ` directory< br > **
81
- ``` shell|powershell
82
- git clone https://github.com/mitsuki31/jmatrix.git
83
- cd jmatrix
130
+ ## USAGE
131
+ Compile and create a ` JAR ` file with ` Makefile `
132
+ ``` bash|powershell
133
+ make
84
134
```
85
135
86
- ** Compile the program<br >**
87
- - Linux / Unix
88
- ``` shell
89
- javac examples/ExampleMatrix.java
90
- ```
91
- - Windows
92
- ``` powershell
93
- javac "examples\ExampleMatrix.java"
136
+ Run the program
137
+ ``` bash|powershell
138
+ make run
94
139
```
95
140
96
- ** Run the program< br > **
97
- ``` shell|powershell
98
- java examples.ExampleMatrix
99
- `` `
141
+ ## EDIT MANIFEST
142
+ If you want to change the ` Main ` file while running the program,
143
+ change ` Main-Class ` in ` META-INF/MANIFEST.MF ` .< br >
144
+ Default: ` lib.matrix.ExampleMatrix `
0 commit comments