From e17087b73347ea5bec98179e81a1f43ec2e93681 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Fri, 24 Jul 2020 00:22:44 +0900 Subject: [PATCH 1/2] Setup CI for dev-0.12 branch --- .github/workflows/ndarray-linalg.yml | 53 ++++++++++++++++++++++++++++ .github/workflows/rust.yml | 53 ++++------------------------ 2 files changed, 59 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/ndarray-linalg.yml diff --git a/.github/workflows/ndarray-linalg.yml b/.github/workflows/ndarray-linalg.yml new file mode 100644 index 00000000..a44efefa --- /dev/null +++ b/.github/workflows/ndarray-linalg.yml @@ -0,0 +1,53 @@ +name: ndarray-linalg + +on: + push: + branches: + - master + - dev-* + pull_request: {} + +jobs: + windows: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/cargo@v1 + with: + command: test + args: --features=intel-mkl --no-default-features + + macos: + runs-on: macos-10.15 + strategy: + fail-fast: false + matrix: + feature: + - intel-mkl + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/cargo@v1 + with: + command: test + args: --features=${{ matrix.feature }} --no-default-features --all-targets + + linux: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + feature: + - netlib + - openblas + - intel-mkl + steps: + - uses: actions/checkout@v1 + - name: apt-install gfortran + run: | + sudo apt update + sudo apt install -y gfortran + if: ${{ matrix.feature != 'intel-mkl' }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: --features=${{ matrix.feature }} --no-default-features --all-targets diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5deaac55..722e5d55 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -4,64 +4,23 @@ on: push: branches: - master + - dev-* pull_request: {} jobs: - windows: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features=intel-mkl --no-default-features - - macos: - runs-on: macos-10.15 - env: - CC: gcc-9 - FC: gfortran-9 - LIBRARY_PATH: /usr/local/opt/gcc/lib/gcc/9 - strategy: - fail-fast: false - matrix: - feature: - - netlib - - openblas - - intel-mkl - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features=${{ matrix.feature }} --no-default-features - - linux: + check-format: runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - feature: - - netlib - - openblas - - intel-mkl steps: - uses: actions/checkout@v1 - - name: apt-install gfortran - run: | - sudo apt update - sudo apt install -y gfortran - if: ${{ matrix.feature != 'intel-mkl' }} - uses: actions-rs/cargo@v1 with: - command: test - args: --features=${{ matrix.feature }} --no-default-features + command: fmt + args: -- --check - check-format: + clippy: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - uses: actions-rs/cargo@v1 with: - command: fmt - args: -- --check + command: clippy From 7219590127867b570120024a967877d902b26137 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Fri, 24 Jul 2020 15:46:37 +0900 Subject: [PATCH 2/2] Add LeastSquaresSvdDivideConquer_ into Lapack trait (back port of #232) --- src/lapack/mod.rs | 1 + src/least_squares.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/lapack/mod.rs b/src/lapack/mod.rs index 18fd9eda..de4f9819 100644 --- a/src/lapack/mod.rs +++ b/src/lapack/mod.rs @@ -44,6 +44,7 @@ pub trait Lapack: + Eigh_ + Triangular_ + Tridiagonal_ + + LeastSquaresSvdDivideConquer_ { } diff --git a/src/least_squares.rs b/src/least_squares.rs index 549c8e08..6a57a0af 100644 --- a/src/least_squares.rs +++ b/src/least_squares.rs @@ -152,7 +152,7 @@ where /// valid representation for `ArrayBase`. impl LeastSquaresSvd for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: Data, { /// Solve a least squares problem of the form `Ax = rhs` @@ -175,7 +175,7 @@ where /// valid representation for `ArrayBase`. impl LeastSquaresSvd for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: Data, { /// Solve a least squares problem of the form `Ax = rhs` @@ -200,7 +200,7 @@ where /// valid representation for `ArrayBase`. impl LeastSquaresSvdInto for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: DataMut, { /// Solve a least squares problem of the form `Ax = rhs` @@ -226,7 +226,7 @@ where /// valid representation for `ArrayBase`. impl LeastSquaresSvdInto for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: DataMut, { /// Solve a least squares problem of the form `Ax = rhs` @@ -252,7 +252,7 @@ where /// valid representation for `ArrayBase`. impl LeastSquaresSvdInPlace for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: DataMut, { /// Solve a least squares problem of the form `Ax = rhs` @@ -284,7 +284,7 @@ fn compute_least_squares_srhs( rhs: &mut ArrayBase, ) -> Result> where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D1: DataMut, D2: DataMut, { @@ -292,7 +292,7 @@ where singular_values, rank, } = unsafe { - ::least_squares( + E::least_squares( a.layout()?, a.as_allocated_mut()?, rhs.as_slice_memory_order_mut() @@ -333,7 +333,7 @@ fn compute_residual_scalar>( /// valid representation for `ArrayBase`. impl LeastSquaresSvdInPlace for ArrayBase where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D: DataMut, { /// Solve a least squares problem of the form `Ax = rhs` @@ -366,7 +366,7 @@ fn compute_least_squares_nrhs( rhs: &mut ArrayBase, ) -> Result> where - E: Scalar + Lapack + LeastSquaresSvdDivideConquer_, + E: Scalar + Lapack, D1: DataMut, D2: DataMut, { @@ -376,7 +376,7 @@ where singular_values, rank, } = unsafe { - ::least_squares_nrhs( + E::least_squares_nrhs( a_layout, a.as_allocated_mut()?, rhs_layout,