Skip to content

Commit

Permalink
Upgraded to xtensor 0.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Oct 20, 2021
1 parent 9db35e2 commit 8a2dc14
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install:
- conda update -q conda
- conda info -a
- conda install cmake -c conda-forge
- conda install xtensor=0.23.0 -c conda-forge
- conda install xtensor=0.24.0 -c conda-forge
- conda install m2w64-openblas -c msys2
# Patch OpenBLASConfig.cmake
- ps: (Get-Content $Env:MINICONDA\Library\mingw-w64\lib\cmake\openblas\OpenBLASConfig.cmake).replace('mingw64', 'mingw-w64') | Set-Content $Env:MINICONDA\Library\mingw-w64\lib\cmake\openblas\OpenBLASConfig.cmake
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
conda install cmake==3.14.0 ^
mkl-devel ^
ninja ^
xtensor=0.23.0 ^
xtensor=0.24.0 ^
python=3.6
conda list
displayName: "Install conda packages"
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message(STATUS "xtensor-blas v${${PROJECT_NAME}_VERSION}")
# Dependencies
# ============

set(xtensor_REQUIRED_VERSION 0.23.0)
set(xtensor_REQUIRED_VERSION 0.24.0)
if(TARGET xtensor)
set(xtensor_VERSION ${XTENSOR_VERSION_MAJOR}.${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH})
# Note: This is not SEMVER compatible comparison
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ http://xtensor-blas.readthedocs.io/

| `xtensor-blas` | `xtensor` |
|-----------------|-----------|
| master | ^0.23.3 |
| master | ^0.24.0 |
| 0.19.2 | ^0.23.3 |
| 0.19.1 | ^0.23.3 |
| 0.19.0 | ^0.23.0 |
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- conda-forge
dependencies:
- cmake
- xtensor=0.23.3
- xtensor=0.24.0
31 changes: 30 additions & 1 deletion include/xtensor-blas/xlinalg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,35 @@ namespace linalg
return std::make_tuple(std::move(std::get<1>(result)), std::move(std::get<2>(result)), std::move(std::get<3>(result)));
}

namespace detail
{
template <bool>
struct conj_eval_impl
{
template <class E>
static const E& run(const E& e)
{
return e;
}
};

template <>
struct conj_eval_impl<true>
{
template <class E>
static auto run(const E& e)
{
return xt::conj(e);
}
};

template <class E>
inline decltype(auto) conj_eval(const E& e)
{
return conj_eval_impl<xtl::is_complex<typename E::value_type>::value>::run(e);
}
}

/**
* Calculate Moore-Rose pseudo inverse using LAPACK SVD.
*/
Expand All @@ -1335,7 +1364,7 @@ namespace linalg
using value_type = typename T::value_type;
const auto& dA = A.derived_cast();

xtensor<value_type, 2, layout_type::column_major> M = xt::conj(dA);
xtensor<value_type, 2, layout_type::column_major> M = detail::conj_eval(dA);

auto gesdd_res = svd(M, false, true);

Expand Down

0 comments on commit 8a2dc14

Please sign in to comment.