From 717b1f3938a2b0327928bcd911d8d69ba2360d72 Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:33:05 +0000 Subject: [PATCH] feat: time to update running image to ubt-22.04 and ubt-24.04 and update compiler to gcc11 Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- .github/workflows/daily.yml | 6 +++--- .github/workflows/pull_request.yml | 8 ++++---- .github/workflows/release.yml | 6 +++--- .github/workflows/rust_build.yml | 2 +- .github/workflows/test.yml | 2 +- algorithm/matrix/matrix.hpp | 14 ++++++-------- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index abfd15ad..cef9a029 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -14,10 +14,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-22.04, ubuntu-24.04 ] env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-12 + CXX: g++-12 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 678aa846..7956d2ad 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,10 +15,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-22.04, ubuntu-24.04 ] env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-12 + CXX: g++-12 # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -105,7 +105,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-22.04, ubuntu-24.04 ] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e6f2f2b..a41815ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-22.04, ubuntu-24.04 ] env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-12 + CXX: g++-12 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml index b3436cf1..c4cfccc6 100644 --- a/.github/workflows/rust_build.yml +++ b/.github/workflows/rust_build.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-latest,ubuntu-20.04, ubuntu-22.04 ] + os: [ windows-latest,ubuntu-22.04, ubuntu-24.04 ] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c83d2082..626889cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: name: test dev # The type of runner that the job will run on - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/algorithm/matrix/matrix.hpp b/algorithm/matrix/matrix.hpp index 6cf5659f..0dd0bcdf 100644 --- a/algorithm/matrix/matrix.hpp +++ b/algorithm/matrix/matrix.hpp @@ -505,15 +505,14 @@ operator+(const Expression &lhs, const Expression &rhs) { template inline EXPRESSION::BinaryOp> operator+(const Expression &lhs, const T2 &rhs) { - return expToBinaryOp(lhs, number(rhs)); + return lhs + number(rhs); } template inline EXPRESSION::BinaryOp, T2> operator+(const T1 &lhs, const Expression &rhs) { - return expToBinaryOp(rhs, lhs); + return rhs + number(lhs); } - /** * matrix + matrix, must equal. * * input mat1,mat2 and will_return's type is same. @@ -522,8 +521,8 @@ operator+(const T1 &lhs, const Expression &rhs) { template inline EXPRESSION::BinaryOp, T2> -operator-(const T1 &lhs, const Expression &rhs) { - return expToBinaryOp(number(lhs * -1), rhs); +operator-(T1 lhs, const Expression &rhs) { + return number(lhs) - rhs; } /** @@ -538,11 +537,10 @@ operator-(const Expression &lhs, const Expression &rhs) { template inline EXPRESSION::BinaryOp> -operator-(const Expression &lhs, const T2 &rhs) { - return expToBinaryOp(lhs, number(rhs)); +operator-(const Expression &lhs, T2 rhs) { + return lhs + number(-1 * rhs); } - /** * matrix * number, need T1 can * T2 * */