Restructured the project to use cargo workspace, math module is now a separate crate
This commit is contained in:
parent
a998ec4339
commit
211fc67cf2
11 changed files with 17 additions and 20 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
||||
|
||||
[[package]]
|
||||
name = "mathematical"
|
||||
name = "math"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"num",
|
||||
|
|
12
Cargo.toml
12
Cargo.toml
|
@ -1,7 +1,5 @@
|
|||
[package]
|
||||
name = "mathematical"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
num = "0.4.3"
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"math"
|
||||
]
|
||||
|
|
7
math/Cargo.toml
Normal file
7
math/Cargo.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "math"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
num = "0.4.3"
|
2
math/src/lib.rs
Normal file
2
math/src/lib.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
pub mod matrix;
|
||||
pub mod sq_matrix;
|
|
@ -108,7 +108,7 @@ impl<T: Num> IndexMut<(usize, usize)> for Matrix<T> {
|
|||
#[macro_export]
|
||||
macro_rules! matrix {
|
||||
[ $w:expr; $( $x:expr ),+ ] => {
|
||||
$crate::math::Matrix::new(vec![$( $x, )+], $w)
|
||||
$crate::matrix::Matrix::new(vec![$( $x, )+], $w)
|
||||
};
|
||||
}
|
||||
|
|
@ -45,8 +45,6 @@ fn check_size(order: usize) -> usize {
|
|||
#[macro_export]
|
||||
macro_rules! sq_matrix {
|
||||
[ $o:expr; $( $x:expr ),+ ] => {
|
||||
$crate::math::SquareMatrix::new(vec![$( $x, )+], $o)
|
||||
$crate::matrix::SquareMatrix::new(vec![$( $x, )+], $o)
|
||||
};
|
||||
}
|
||||
|
||||
pub use sq_matrix;
|
|
@ -1 +0,0 @@
|
|||
pub mod math;
|
|
@ -1,7 +0,0 @@
|
|||
mod matrix;
|
||||
pub use matrix::Matrix;
|
||||
pub use matrix::matrix;
|
||||
|
||||
mod sq_matrix;
|
||||
pub use sq_matrix::SquareMatrix;
|
||||
pub use sq_matrix::sq_matrix;
|
Loading…
Reference in a new issue