mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 08:30:01 +00:00
Compare commits
32 Commits
adae6b455f
...
218948a075
Author | SHA1 | Date | |
---|---|---|---|
![]() |
218948a075 | ||
d2c2ebca0f | |||
aeaf936380 | |||
![]() |
3f24764a13 | ||
![]() |
25a2a0d831 | ||
![]() |
1dbe5d0efe | ||
![]() |
b17863dcdc | ||
![]() |
ac0eed2d56 | ||
![]() |
73a30d45c5 | ||
![]() |
3cb68be062 | ||
![]() |
ca734fbedf | ||
![]() |
36a0846efa | ||
![]() |
7f587a7b7e | ||
![]() |
a30a7101e8 | ||
![]() |
10c6116f8f | ||
![]() |
ecb1939ec2 | ||
![]() |
bdd0a23096 | ||
![]() |
4c02006153 | ||
![]() |
9fd3582061 | ||
![]() |
8574d86abc | ||
![]() |
20727a2b91 | ||
34cff9f05e | |||
f5f3f2c100 | |||
![]() |
f91ddc5c41 | ||
![]() |
ba1e2b3d43 | ||
![]() |
a0a551c7d9 | ||
![]() |
7cf41171a8 | ||
![]() |
38c5c28454 | ||
9fcb1ea2cf | |||
![]() |
623303cf72 | ||
![]() |
3c8b69d3ab | ||
![]() |
caaf8c9411 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,5 +12,6 @@ data/
|
|||||||
*.info
|
*.info
|
||||||
|
|
||||||
.venv/
|
.venv/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
tarpaulin-report.*
|
tarpaulin-report.*
|
28
README.md
28
README.md
@ -25,6 +25,12 @@ Rustframe keeps things simple, safe, and readable. It is handy for quick numeric
|
|||||||
- **Date‑centric row index** - business‑day ranges and calendar slicing built in.
|
- **Date‑centric row index** - business‑day ranges and calendar slicing built in.
|
||||||
- **Pure safe Rust** - 100 % safe, zero `unsafe`.
|
- **Pure safe Rust** - 100 % safe, zero `unsafe`.
|
||||||
|
|
||||||
|
### Coming soon
|
||||||
|
|
||||||
|
- **CSV I/O** - read/write CSV files with a simple API.
|
||||||
|
- **Date Utils** - date math, calendar slicing, indexing, and more.
|
||||||
|
- **More math** - more math functions and aggregations.
|
||||||
|
|
||||||
### Heads up
|
### Heads up
|
||||||
|
|
||||||
- **Not memory‑efficient (yet)** - footprint needs work.
|
- **Not memory‑efficient (yet)** - footprint needs work.
|
||||||
@ -34,6 +40,7 @@ Rustframe keeps things simple, safe, and readable. It is handy for quick numeric
|
|||||||
|
|
||||||
- Optional GPU help (Vulkan or similar) for heavier workloads.
|
- Optional GPU help (Vulkan or similar) for heavier workloads.
|
||||||
- Straightforward Python bindings using `pyo3`.
|
- Straightforward Python bindings using `pyo3`.
|
||||||
|
- Integration with common ML libraries, or introduce simple ML features.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -76,17 +83,26 @@ let total: f64 = result.sum_vertical().iter().sum::<f64>();
|
|||||||
assert_eq!(total, 184.0);
|
assert_eq!(total, 184.0);
|
||||||
|
|
||||||
// broadcast & reduce
|
// broadcast & reduce
|
||||||
let result: Matrix<f64> = &ma + 1.0; // add scalar
|
let result: Matrix<f64> = ma.clone() + 1.0; // add scalar
|
||||||
let result: Matrix<f64> = &result - 1.0; // subtract scalar
|
let result: Matrix<f64> = result + &ma - &ma; // add matrix
|
||||||
let result: Matrix<f64> = &result * 2.0; // multiply by scalar
|
let result: Matrix<f64> = result - 1.0; // subtract scalar
|
||||||
let result: Matrix<f64> = &result / 2.0; // divide by scalar
|
let result: Matrix<f64> = result * 2.0; // multiply by scalar
|
||||||
|
let result: Matrix<f64> = result / 2.0; // divide by scalar
|
||||||
|
|
||||||
let check: bool = result.eq_elementwise(ma.clone()).all();
|
let check: bool = result.eq_elem(ma.clone()).all();
|
||||||
assert!(check);
|
assert!(check);
|
||||||
|
|
||||||
// The above math can also be written as:
|
// The above math can also be written as:
|
||||||
let check: bool = (&(&(&(&ma + 1.0) - 1.0) * 2.0) / 2.0)
|
let check: bool = (&(&(&(&ma + 1.0) - 1.0) * 2.0) / 2.0)
|
||||||
.eq_elementwise(ma)
|
.eq_elem(ma.clone())
|
||||||
.all();
|
.all();
|
||||||
assert!(check);
|
assert!(check);
|
||||||
|
|
||||||
|
// The above math can also be written as:
|
||||||
|
let check: bool = ((((ma.clone() + 1.0) - 1.0) * 2.0) / 2.0)
|
||||||
|
.eq_elem(ma)
|
||||||
|
.all();
|
||||||
|
assert!(check);
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -96,9 +96,10 @@ impl BoolOps for Frame<bool> {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::frame::*;
|
use super::*;
|
||||||
use crate::matrix::*;
|
use crate::matrix::Matrix;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_series_ops() {
|
fn test_series_ops() {
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user