Skip to content

Commit

Permalink
Ver 0.38.0
Browse files Browse the repository at this point in the history
- complex support (#35)
- parallel support (#72)
- More generic matrix
- Update puruspe
- Add some polynomials
  • Loading branch information
Axect committed Oct 31, 2024
2 parents 8d7816b + 398eb2b commit cf183cf
Show file tree
Hide file tree
Showing 88 changed files with 6,491 additions and 1,580 deletions.
21 changes: 15 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "peroxide"
version = "0.37.9"
version = "0.38.0"
authors = ["axect <[email protected]>"]
edition = "2018"
description = "Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax"
Expand All @@ -10,21 +10,29 @@ categories = ["science"]
readme = "README.md"
documentation = "https://axect.github.io/Peroxide_Doc"
keywords = ["Numeric", "Science", "Dataframe", "Plot", "LinearAlgebra"]
exclude = ["example_data/", "src/bin/", "benches/", "example/", "test_data/", "peroxide-ad2"]
exclude = [
"example_data/",
"src/bin/",
"benches/",
"example/",
"test_data/",
"peroxide-ad2",
]

[badges]
travis-ci = { repository = "axect/peroxide" }
maintenance = { status = "actively-developed" }

[dev-dependencies]
float-cmp = "0.9"
float-cmp = "0.10"
criterion = { version = "0.5.1", features = ["html_reports"] }

[dependencies]
csv = { version = "1.3", optional = true, default-features = false }
rand = { version = "0.8", features = ["small_rng"] }
rand_distr = "0.4"
order-stat = "0.1"
puruspe = "0.2"
puruspe = "0.3"
matrixmultiply = { version = "0.3", features = ["threading"] }
peroxide-ad = "0.3"
peroxide-num = "0.1"
Expand All @@ -39,10 +47,10 @@ serde = { version = "1.0", features = ["derive"], optional = true }
json = { version = "0.12", optional = true }
arrow2 = { version = "0.18", features = ["io_parquet", "io_parquet_compression"], optional = true }
num-complex = { version = "0.4", optional = true }
lambert_w = { version = "0.3.0", default-features = false, features = ["24bits", "50bits"] }
rayon = { version = "1.10", optional = true }

[package.metadata.docs.rs]
rustdoc-args = [ "--html-in-header", "katex-header.html", "--cfg", "docsrs"]
rustdoc-args = ["--html-in-header", "katex-header.html", "--cfg", "docsrs"]

[features]
default = []
Expand All @@ -51,3 +59,4 @@ plot = ["pyo3"]
nc = ["netcdf"]
parquet = ["arrow2"]
complex = ["num-complex", "matrixmultiply/cgemm"]
parallel = ["rayon"]
79 changes: 35 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Peroxide provides various features.
- `default` - Pure Rust (No dependencies of architecture - Perfect cross compilation)
- `O3` - BLAS & LAPACK (Perfect performance but little bit hard to set-up - Strongly recommend to look [Peroxide with BLAS](https://github.com/Axect/Peroxide_BLAS))
- `plot` - With matplotlib of python, we can draw any plots.
- `complex` - With complex numbers (vector, matrix and integral)
- `parallel` - With some parallel functions
- `nc` - To handle netcdf file format with DataFrame
- `csv` - To handle csv file format with Matrix or DataFrame
- `parquet` - To handle parquet file format with DataFrame
Expand Down Expand Up @@ -311,7 +313,7 @@ How's that? Let me know if there's anything else you'd like me to improve!

## Latest README version

Corresponding to `0.37.7`
Corresponding to `0.38.0`

## Pre-requisite

Expand All @@ -321,55 +323,38 @@ Corresponding to `0.37.7`

## Install

- Run below commands in your project directory

1. Default

```bash
cargo add peroxide
```

2. OpenBLAS

```bash
cargo add peroxide --features O3
```

3. Plot

```bash
cargo add peroxide --features plot
```

4. NetCDF dependency for DataFrame

```bash
cargo add peroxide --features nc
```

5. CSV dependency for DataFrame

```bash
cargo add peroxide --features csv
```
### Basic Installation
```bash
cargo add peroxide
```

6. Parquet dependency for DataFrame
### Featured Installation
```bash
cargo add peroxide --features "<FEATURES>"
```

```bash
cargo add peroxide --features parquet
```
### Available Features

7. Serialize or Deserialize with Matrix or polynomial
* `O3`: Adds OpenBLAS support
* `plot`: Enables plotting functionality
* `complex`: Supports complex number operations
* `parallel`: Enables parallel processing capabilities
* `nc`: Adds NetCDF support for DataFrame
* `csv`: Adds CSV support for DataFrame
* `parquet`: Adds Parquet support for DataFrame
* `serde`: Enables serialization/deserialization for Matrix and polynomial

```bash
cargo add peroxide --features serde
```
### Install Examples

8. All features
Single feature installation:
```bash
cargo add peroxide --features "plot"
```

```bash
cargo add peroxide --features "O3 plot nc csv parquet serde"
```
Multiple features installation:
```bash
cargo add peroxide --features "O3 plot nc csv parquet serde"
```

## Useful tips for features

Expand All @@ -388,6 +373,11 @@ Corresponding to `0.37.7`

- __src__
- [lib.rs](src/lib.rs) : `mod` and `re-export`
- __complex__: For complex vector, matrix & integrals.
- [mod.rs](src/complex/mod.rs)
- [integrate.rs](src/complex/integrate.rs) : Complex integral
- [matrix.rs](src/complex/matrix.rs) : Complex matrix
- [vector.rs](src/complex/vector.rs) : Complex vector
- __fuga__ : Fuga for controlling numerical algorithms.
- [mod.rs](src/fuga/mod.rs)
- __macros__ : Macro files
Expand Down Expand Up @@ -434,6 +424,7 @@ Corresponding to `0.37.7`
- [fp.rs](src/traits/fp.rs) : Functional programming toolbox
- [general.rs](src/traits/general.rs) : General algorithms
- [math.rs](src/traits/math.rs) : Mathematics
- [matrix.rs](src/traits/matrix.rs) : Matrix traits
- [mutable.rs](src/traits/mutable.rs) : Mutable toolbox
- [num.rs](src/traits/num.rs) : Number, Real and more operations
- [pointer.rs](src/traits/pointer.rs) : Matrix pointer and Vector pointer for convenience
Expand Down
22 changes: 22 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Release 0.38.0

## New features - Complex & Parallel

- `complex` feature
- Implement complex vector, matrix and integral [#35](https://github.com/Axect/Peroxide/issues/35) (Thanks to [@GComitini](https://github.com/GComitini) and [@soumyasen1809](https://github.com/soumyasen1809))

- `parallel` feature
- Implement some parallel functions [#72](https://github.com/Axect/Peroxide/issues/72) (Thanks to [@soumyasen1809](https://github.com/soumyasen1809))

## Generic Matrix - MatrixTrait

- Implement `MatrixTrait` for Matrix (Scalar = f64)
- Implement `MatrixTrait` for ComplexMatrix (Scalar = C64)
- `LinearAlgebra` and `solve` depend on `MatrixTrait`

## Other changes

- Update `puruspe` dependency to `0.3.0`, remove `lambert_w` dependency [#79](https://github.com/Axect/Peroxide/pull/79) (Thanks to [@JSorngard](https://github.com/JSorngard))

- Add `hermite_polynomial` and `bessel_polynomial` [#80](https://github.com/Axect/Peroxide/pull/80) (Thanks to [@jgrage](https://github.com/jgrage))

# Release 0.37.9 (2024-07-31)

- Fix inconsistent lambert w function name [#65](https://github.com/Axect/Peroxide/issues/65) (Thanks to [@JSorngard](https://github.com/JSorngard))
Expand Down
194 changes: 194 additions & 0 deletions benches/data/rayon_matrix_benchmark_results.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
Lib used for benchmarking: Criterion
Matrix size: 1000x1000

Running benches/parallel_rayon/matrix_benchmark.rs

ser_matrix_bench time: [535.12 µs 544.51 µs 556.68 µs]
Found 11 outliers among 100 measurements (11.00%)
4 (4.00%) high mild
7 (7.00%) high severe

par_matrix_bench time: [5.0912 ms 5.1431 ms 5.1995 ms]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low mild
5 (5.00%) high mild
1 (1.00%) high severe

ser_py_matrix_bench time: [4.3100 ms 4.3309 ms 4.3544 ms]
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe

par_py_matrix_bench time: [11.667 ms 11.789 ms 11.920 ms]
Found 10 outliers among 100 measurements (10.00%)
6 (6.00%) high mild
4 (4.00%) high severe

ser_matrix_change_shape_bench
time: [7.3630 ms 7.4075 ms 7.4608 ms]
Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) high mild
4 (4.00%) high severe

par_matrix_change_shape_bench
time: [10.276 ms 10.385 ms 10.499 ms]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe

ser_matrix_extract_row_bench
time: [613.39 µs 622.44 µs 633.72 µs]
Found 7 outliers among 100 measurements (7.00%)
7 (7.00%) high severe

par_matrix_extract_row_bench
time: [5.4321 ms 5.4851 ms 5.5399 ms]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild

ser_matrix_from_index_bench
time: [2.4174 ms 2.4490 ms 2.4851 ms]
Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) high mild
13 (13.00%) high severe

par_matrix_from_index_bench
time: [2.3912 ms 2.4090 ms 2.4304 ms]
Found 9 outliers among 100 measurements (9.00%)
2 (2.00%) high mild
7 (7.00%) high severe

ser_matrix_to_vec_bench time: [2.4800 ms 2.5082 ms 2.5423 ms]
Found 10 outliers among 100 measurements (10.00%)
4 (4.00%) high mild
6 (6.00%) high severe

par_matrix_to_vec_bench time: [6.4041 ms 6.4618 ms 6.5250 ms]
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe

ser_matrix_to_diag_bench
time: [2.4335 ms 2.4526 ms 2.4750 ms]
Found 14 outliers among 100 measurements (14.00%)
6 (6.00%) high mild
8 (8.00%) high severe

par_matrix_to_diag_bench
time: [13.514 ms 13.684 ms 13.868 ms]
Found 10 outliers among 100 measurements (10.00%)
7 (7.00%) high mild
3 (3.00%) high severe

Benchmarking ser_matrix_submat_bench: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.3s, enable flat sampling, or reduce sample count to 50.
ser_matrix_submat_bench time: [1.6077 ms 1.6243 ms 1.6451 ms]
Found 16 outliers among 100 measurements (16.00%)
3 (3.00%) high mild
13 (13.00%) high severe

par_matrix_submat_bench time: [10.611 ms 10.761 ms 10.942 ms]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

ser_matrix_add_vec_bench
time: [7.3077 ms 7.3485 ms 7.3946 ms]
Found 12 outliers among 100 measurements (12.00%)
2 (2.00%) high mild
10 (10.00%) high severe

par_matrix_add_vec_bench
time: [11.331 ms 11.480 ms 11.636 ms]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild

ser_matrix_norm_bench time: [5.1600 ms 5.1864 ms 5.2165 ms]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) high mild
6 (6.00%) high severe

par_matrix_norm_bench time: [2.6565 ms 2.6810 ms 2.7091 ms]
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) high mild
3 (3.00%) high severe

Benchmarking ser_matrix_norm_bench #2: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 8.9s, enable flat sampling, or reduce sample count to 50.
ser_matrix_norm_bench #2
time: [1.7262 ms 1.7391 ms 1.7541 ms]
Found 15 outliers among 100 measurements (15.00%)
10 (10.00%) high mild
5 (5.00%) high severe

par_matrix_norm_bench #2
time: [6.7071 ms 6.7883 ms 6.8703 ms]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

ser_matrix_norm_bench #3
time: [9.7582 ms 9.9006 ms 10.057 ms]
Found 12 outliers among 100 measurements (12.00%)
5 (5.00%) high mild
7 (7.00%) high severe

par_matrix_norm_bench #3
time: [9.3004 ms 9.4088 ms 9.5239 ms]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

ser_matrix_inner_prod_bench
time: [5.2730 ms 5.3590 ms 5.4583 ms]
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) high mild
11 (11.00%) high severe

par_matrix_inner_prod_bench
time: [5.0987 ms 5.1644 ms 5.2402 ms]
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe

ser_matrix_hadamard_bench
time: [5.6521 ms 5.6870 ms 5.7262 ms]
Found 12 outliers among 100 measurements (12.00%)
3 (3.00%) high mild
9 (9.00%) high severe

par_matrix_hadamard_bench
time: [14.155 ms 14.335 ms 14.527 ms]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe

ser_matrix_take_row_bench
time: [3.7894 ms 3.8234 ms 3.8613 ms]
Found 15 outliers among 100 measurements (15.00%)
7 (7.00%) high mild
8 (8.00%) high severe

par_matrix_take_row_bench
time: [8.4008 ms 8.5171 ms 8.6523 ms]
Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) high mild
3 (3.00%) high severe

ser_matrix_fpmap_bench time: [3.2526 ms 3.2739 ms 3.2977 ms]
Found 12 outliers among 100 measurements (12.00%)
2 (2.00%) high mild
10 (10.00%) high severe

par_matrix_fpmap_bench time: [10.604 ms 10.765 ms 10.937 ms]
Found 11 outliers among 100 measurements (11.00%)
8 (8.00%) high mild
3 (3.00%) high severe

ser_matrix_reduce_bench time: [2.6748 ms 2.6964 ms 2.7201 ms]
Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) high mild
3 (3.00%) high severe

par_matrix_reduce_bench time: [6.2453 ms 6.3198 ms 6.4034 ms]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
Loading

0 comments on commit cf183cf

Please sign in to comment.