Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Improved `xmldocchecker` with XSD schema validation for XML files.

- [#1458](http://github.com/nelson-lang/nelson/issues/1458): Eigen 5.0.0 used if detected.

### Fixed

- `ans` variable: Fixed issue to ensure 'ans' is only created for expressions, preventing unintended variable creation in the workspace.
Expand Down
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,20 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif()
endif()
# ==============================================================================
find_package(Eigen3 3.3 REQUIRED)
find_package(Eigen3 3.3 QUIET NO_MODULE)
if (NOT Eigen3_FOUND)
find_package(Eigen3 REQUIRED)
endif()
if (TARGET Eigen3::Eigen)
message(STATUS "Found Eigen3 target: Eigen3::Eigen")
get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
else()
# In case we found Eigen3 but not as a target
if (NOT DEFINED EIGEN3_INCLUDE_DIR AND DEFINED EIGEN3_INCLUDE_DIRS)
set(EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIRS})
endif()
endif()
message(STATUS "Eigen3 include directory: ${EIGEN3_INCLUDE_DIR}")
# ==============================================================================
if(NOT WITHOUT_GUI_MODULE)
include(QtConfig)
Expand Down
35 changes: 0 additions & 35 deletions modules/operators/src/cpp/LeftDivide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,6 @@
//=============================================================================
namespace Nelson {
//=============================================================================
// static bool
// promoteCommonType(ArrayOf& A, ArrayOf& B)
//{
// bool wasPromoted = true;
// if (A.getDataClass() != B.getDataClass()) {
// if (A.isComplex() || B.isComplex()) {
// if (A.isComplex()) {
// if (B.getDataClass() == NLS_DOUBLE) {
// B.promoteType(NLS_DCOMPLEX);
// } else if (B.getDataClass() == NLS_SINGLE) {
// B.promoteType(NLS_SCOMPLEX);
// } else {
// wasPromoted = false;
// }
// } else {
// if (A.getDataClass() == NLS_DOUBLE) {
// A.promoteType(NLS_DCOMPLEX);
// } else if (A.getDataClass() == NLS_SINGLE) {
// A.promoteType(NLS_SCOMPLEX);
// } else {
// wasPromoted = false;
// }
// }
// } else {
// if (A.getDataClass() == NLS_SINGLE || B.getDataClass() == NLS_SINGLE) {
// A.promoteType(NLS_SINGLE);
// B.promoteType(NLS_SINGLE);
// } else {
// wasPromoted = false;
// }
// }
// }
// return wasPromoted;
//}
////=============================================================================
ArrayOf
LeftDivide(ArrayOf A, ArrayOf B, bool& needToOverload)
{
Expand Down
7 changes: 3 additions & 4 deletions modules/operators/src/cpp/SVDDecompositionComplexTemplate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ solveSVDDecompositionComplex(NelsonType destinationClass, const ArrayOf& matA, c
Eigen::Map<Eigen::Matrix<std::complex<T>, Eigen::Dynamic, Eigen::Dynamic>> matCz(
ptrCz, outDim.getRows(), outDim.getColumns());

matCz = matAz
.bdcSvd(Eigen::DecompositionOptions::ComputeThinU
| Eigen::DecompositionOptions::ComputeThinV)
.solve(matBz);
Eigen::JacobiSVD<Eigen::Matrix<std::complex<T>, Eigen::Dynamic, Eigen::Dynamic>> svd(
matAz, Eigen::ComputeThinU | Eigen::ComputeThinV);
matCz = svd.solve(matBz);
return res;
}
//=============================================================================
Expand Down
7 changes: 3 additions & 4 deletions modules/operators/src/cpp/SVDDecompositionRealTemplate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ solveSVDDecompositionReal(NelsonType destinationClass, const ArrayOf& matA, cons
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>> matCz(
ptrC, outDim.getRows(), outDim.getColumns());

matCz = matAz
.bdcSvd(Eigen::DecompositionOptions::ComputeThinU
| Eigen::DecompositionOptions::ComputeThinV)
.solve(matBz);
Eigen::JacobiSVD<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>> svd(
matAz, Eigen::ComputeFullU | Eigen::ComputeFullV);
matCz = svd.solve(matBz);
return res;
}
//=============================================================================
Expand Down