Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge improvements for jmatrix 🎉 #3

Merged
merged 38 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e4bb919
Delete `lib` directory recursively
mitsuki31 Apr 7, 2023
dcf24aa
Create `src/com/mitsuki/jmatrix/` directory
mitsuki31 Apr 7, 2023
3f5a7b3
Add files via upload
mitsuki31 Apr 7, 2023
7f18609
Create `core` directory
mitsuki31 Apr 7, 2023
cadf949
Delete .nomedia
mitsuki31 Apr 7, 2023
d030c7d
Delete .nomedia
mitsuki31 Apr 7, 2023
00d68ed
Add `JMBaseException.java` into `core` directory
mitsuki31 Apr 7, 2023
14d9f41
Create `util` directory
mitsuki31 Apr 7, 2023
65c303b
Upload some files into `util` directory
mitsuki31 Apr 7, 2023
c322e14
Delete .nomedia
mitsuki31 Apr 7, 2023
4d5cde9
Add `get_sources.py` into `src/python` directory
mitsuki31 Apr 7, 2023
26a9a1e
Add `fix_version.py` into `src/python` directory
mitsuki31 Apr 7, 2023
0c33a8f
Add `config.xml` into `assets/configuration/` directory
mitsuki31 Apr 7, 2023
5b0395a
Add `source_files.list` into `assets/properties/` directory
mitsuki31 Apr 7, 2023
4b13b5e
Create `assets/contents/` directory
mitsuki31 Apr 7, 2023
0166a8e
Add some files into `assets/contents/`
mitsuki31 Apr 7, 2023
4811198
Delete .nomedia
mitsuki31 Apr 7, 2023
a90cbc2
Update MANIFEST.MF
mitsuki31 Apr 7, 2023
bb3e1a1
Update Makefile
mitsuki31 Apr 7, 2023
2335011
Update README.md
mitsuki31 Apr 7, 2023
d0f862e
Small fix at `JMBaseException.java`
mitsuki31 Apr 7, 2023
4762185
Add `requirements.txt`
mitsuki31 Apr 8, 2023
b4838d1
Update `README.md`
mitsuki31 Apr 8, 2023
ee350df
Update `Options.java`
mitsuki31 Apr 18, 2023
a996d91
Update XMLParser.java
mitsuki31 Apr 18, 2023
c707627
Update `OSUtils.java`
mitsuki31 Apr 18, 2023
2adb059
Update README.md
mitsuki31 Apr 18, 2023
d7075ee
Update README.md
mitsuki31 Apr 18, 2023
185355d
Update `additional.content`
mitsuki31 Apr 19, 2023
3dd27f8
Added `removeComment` to `Options.java`
mitsuki31 Apr 19, 2023
320976f
Excluding `Makefile` while creating `jar`
mitsuki31 Apr 19, 2023
9cd39d1
Move `IllegalMatrixSizeException.java` to `core/` directory and fixes…
mitsuki31 Apr 19, 2023
1ebe224
`JMBaseException` now extends to `RuntimeException` and fixes error
mitsuki31 Apr 19, 2023
67aea65
Move `NullMatrixException.java` to `core/` directory
mitsuki31 Apr 19, 2023
e1c1d79
Move `MatrixArrayFullException.java` to `core/` directory
mitsuki31 Apr 19, 2023
1eec444
Move `InvalidIndexException.java` to `core/` directory
mitsuki31 Apr 19, 2023
3a2f830
Fixes import path for local packages
mitsuki31 Apr 19, 2023
431e4ff
Fixes code that uses removed method
mitsuki31 Apr 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Program-Name: JMatrix
Version: v0.2.0
Main-Class: lib.matrix.ExampleMatrix
Version: v1.0.0
Main-Class: com.mitsuki.jmatrix.Main
Created-By: Ryuu Mitsuki
Manifest-Version: 1.0
Manifest-Version: 1.1
35 changes: 23 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
# MAKEFILE FOR JMATRIX
# Created by Ryuu Mitsuki
VERSION = v1.0.0

SRC_DIR = lib/matrix/
MANIFEST = META-INF/MANIFEST.MF
SRC_DIR = com/mitsuki/jmatrix/
BIN_DIR = bin/

PY = src/python/
BIN := $(wildcard $(BIN_DIR)$(SRC_DIR)*.class)
SRCTXT = assets/properties/source_files.list

SRC = $(SRC_DIR)*.java
BIN = $(SRC_DIR)*.class
MANIFEST = META-INF/MANIFEST.MF
JAR = jars/jmatrix-$(VERSION).jar

JAR = Matrix.jar

all: $(SRC)
all: $(SRCTXT) $(MANIFEST)
$(info Creating jar files...)
javac $(SRC)
jar cvfm $(JAR) $(MANIFEST) $(BIN)
mkdir -p jars/
python $(PY)get_sources.py
python $(PY)fix_version.py
javac -d $(BIN_DIR) @$<
jar cvfm $(JAR) $(MANIFEST) \
LICENSE assets/ -C bin/ .


run: $(JAR)
java -jar $(JAR)
clean-bin:
rm -r $(BIN_DIR)
$(info Cleaning "$(BIN_DIR)" only...)

clean:
rm -r $(BIN) $(JAR)
rm -r $(JAR) $(BIN_DIR)
$(info Cleaning "$(JAR)" "$(BIN_DIR)"...)


.PHONY: all run clean
.PHONY: all clean clean-bin
79 changes: 44 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# JMatrix
**Author : Ryuu Mitsuki<br>**
**Developed by Ryuu Mitsuki<br>**

> JMatrix is a matrix builder written in Java.<br>
> Developed by Ryuu Mitsuki.<br>
> It can create, summarize, subtract, multiply and clear the matrix array.<br>
> Check `LIST FUNCTION` below to see all functions.
**Operating System: `Linux`<br>**
**Java version: `openjdk-17`<br>**
**Python version: `python-3.11.2`**

---
> **Note**
> JMatrix is a matrix builder written in Java.<br>
> It can create, operate addition, subtract, multiply and clear the matrix array.<br>
>
> [See all methods](https://github.com/mitsuki31/jmatrix#list-methodsrocket)&nbsp; | &nbsp;
> [See usages](https://github.com/mitsuki31/jmatrix#usage)

Make sure you've `Java` installed in your device:warning:<br>
If not, download here:<br>
1. [https://openjdk.org](https://openjdk.org)
2. [https://developers.redhat.com/products/openjdk/download](https://developers.redhat.com/products/openjdk/download)
> **Warning** Make sure you've installed these on your device
> - Java&nbsp; \[[Download here](https://oracle.com/java/)\]
> - Python&nbsp; \[[Download here](https://python.org/)\]
> - Make&nbsp; *(for Windows you need to install Chocolatey)*
> - Chocolatey&nbsp; \[[Download here](https://chocolatey.org/install)\]

## LIST FUNCTION:rocket:
## LIST METHODS:rocket:

### add()
Fill column of matrix array with push method.<br>
If you attempt to call `add()` function again and you've matrix size 2x3, but you've already call `add()` 2 times (same as total rows), it'll throw `MatrixArrayFullException`.<br>
> **Note** If you attempt to call `add()` function again and you've matrix size 2x3, but you've already call `add()` 2 times (same as total rows), it'll throw `MatrixArrayFullException`.<br>
<br>

Function parameters:
- void add(int... values)
- void add(int value)
Expand All @@ -28,32 +34,32 @@ Summarize current matrix array with other matrix.<br>
<br>
Function parameters:
- void sum(Matrix object)
- void sum(int[ ][ ] array)
- void sum(int\[ ]\[ ] array)
<br>

- static int[ ][ ] sum(int[ ][ ] array, int[ ][ ] array)
- static int[ ]\[ ] sum(int\[ ]\[ ] array, int\[ ]\[ ] array)
- static Matrix sum(Matrix obj1, Matrix obj2)

### sub()
Subtract current matrix array with other matrix.<br>
<br>
Function parameters:
- void sub(Matrix obj)
- void sub(int[ ][ ] arr)
- void sub(int\[ ]\[ ] arr)
<br>

- static int[ ][ ] sub(int[ ][ ] arr, int[ ][ ] arr)
- static int\[ ]\[ ] sub(int\[ ]\[ ] arr, int\[ ]\[ ] arr)
- static Matrix sub(Matrix obj1, Matrix obj2)

### mult()
Multiply current matrix with other matrix.<br>
<br>
Function parameters:
- void mult(Matrix obj)
- void mult(int[ ][ ] arr)
- void mult(int\[ ]\[ ] arr)
<br>

- static int[ ][ ] mult(int[ ][ ] arr, int[ ][ ] arr)
- static int\[ ]\[ ] mult(int\[ ]\[ ] arr, int\[ ]\[ ] arr)
- static Matrix mult(Matrix obj1, Matrix obj2)

### transpose()
Expand All @@ -63,7 +69,7 @@ Function parameters:
- void transpose()
<br>

- static int[ ][ ] transpose(int[ ][ ] arr)
- static int\[ ]\[ ] transpose(int\[ ]\[ ] arr)
- static Matrix transpose(Matrix obj)


Expand All @@ -77,11 +83,11 @@ Function parametera:
Select row matrix by given index.<br>
<br>
Function parameters:
- void select()
- Matrix select(int index)

### change()
Change values of selected row with given values.<br>
> Use this together with `select` function.<br>
> **Note** Use this together with `select` function.<br>
> Example: `matrixA.select(<index>).change(<values>)`
<br>

Expand All @@ -100,13 +106,13 @@ Sort all columns inside matrix array.<br>
<br>
Function parameters:
- void sort()
- static void sort(int[ ][ ] arr)
- static void sort(int\[ ]\[ ] arr)

### getSize()
Return list of matrix size [rows, columns].<br>
Return list of matrix size \[rows, columns].<br>
<br>
Function parameters:
- int[ ] getSize()
- int\[ ] getSize()

### clear()
Clear all each column inside matrix array, and change all values with 0.<br>
Expand All @@ -122,23 +128,26 @@ Function parameters:
- void display(int index)
<br>

- static void display(int[ ][ ] arr)
- static void display(int[ ][ ] arr, int index)
- static void display(int\[ ]\[ ] arr)
- static void display(int\[ ]\[ ] arr, int index)

<br>

## USAGE
Compile and create a `JAR` file with `Makefile`
```bash|powershell
### Makefile Options
Compile and create new `JAR` file
```bash
make
```

Run the program
```bash|powershell
make run
Clearing binary files in `bin/` directory and `JAR` file
> **Warning** This will delete `bin/` directory recursively<br>
> Make sure you don't save any important file(s) to `bin/` directory
```bash
make clean
```

## EDIT MANIFEST
If you want to change the `Main` file while running the program,
change `Main-Class` in `META-INF/MANIFEST.MF`.<br>
Default: `lib.matrix.ExampleMatrix`
Clearing binary files only
```bash
make clean-bin
```
8 changes: 8 additions & 0 deletions assets/configuration/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>

<configuration>
<program_name>JMatrix</program_name>
<version type="release">v1.0.0</version>
<package>com.mitsuki.jmatrix</package>
<author>Ryuu Mitsuki</author>
</configuration>
3 changes: 3 additions & 0 deletions assets/contents/additional.content
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Don't change this file directly
4A4D6174726978202D20436F707972696768742028432920323032332052797575204D697473756B69
4D4954204C6963656E7365
10 changes: 10 additions & 0 deletions assets/contents/help.content
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Usage:
java -jar <jar_file> [options]

Options:
-h, help display this help
-cr, copyright print the copyright
-V, ver, version display version number with release type

JMatrix - com.mitsuki.jmatrix
Developed by Ryuu Mitsuki
10 changes: 10 additions & 0 deletions assets/properties/source_files.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
src/com/mitsuki/jmatrix/IllegalMatrixSizeException.java
src/com/mitsuki/jmatrix/InvalidIndexException.java
src/com/mitsuki/jmatrix/Main.java
src/com/mitsuki/jmatrix/Matrix.java
src/com/mitsuki/jmatrix/MatrixArrayFullException.java
src/com/mitsuki/jmatrix/NullMatrixException.java
src/com/mitsuki/jmatrix/core/JMBaseException.java
src/com/mitsuki/jmatrix/util/OSUtils.java
src/com/mitsuki/jmatrix/util/Options.java
src/com/mitsuki/jmatrix/util/XMLParser.java
101 changes: 0 additions & 101 deletions lib/matrix/ExampleMatrix.java

This file was deleted.

31 changes: 0 additions & 31 deletions lib/matrix/IllegalMatrixSizeException.java

This file was deleted.

Loading