Skip to content
This repository was archived by the owner on Aug 6, 2023. It is now read-only.

Commit 3c12f4c

Browse files
committed
update Ellalgo version to 1.3.5; add set_witness_vec()
1 parent 2a328fe commit 3c12f4c

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ option(INSTALL_ONLY "Enable for installation only" OFF)
1212
# Note: update this to your new project's name and version
1313
project(
1414
LmiSolver
15-
VERSION 1.3.3
15+
VERSION 1.3.4
1616
LANGUAGES CXX
1717
)
1818

include/lmisolver/ldlt_ext.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ template <typename Arr036> class ldlt_ext {
120120
*/
121121
auto witness() -> double;
122122

123+
auto set_witness_vec(Arr036 &v) const -> void {
124+
for (auto i = 0U; i != this->_n; ++i) {
125+
v[i] = this->witness_vec[i];
126+
}
127+
}
128+
123129
/**
124130
* @brief Calculate v'*{A}(p,p)*v
125131
*

specific.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ endif(xtensor_ADDED)
1919

2020
CPMAddPackage(
2121
NAME EllAlgo
22-
GIT_TAG 1.3.4
22+
GIT_TAG 1.3.5
2323
GITHUB_REPOSITORY luk036/ellalgo-cpp
2424
OPTIONS "INSTALL_ONLY YES" # create an installable target
2525
)

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ set_target_properties(${PROJECT_NAME}Tests PROPERTIES CXX_STANDARD 17)
2424
# enable compiler warnings
2525
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
2626
# target_compile_options(${PROJECT_NAME} PUBLIC -Wall -Wpedantic -Wextra -Werror)
27-
target_compile_options(${PROJECT_NAME} PUBLIC -Wall -Wextra)
27+
target_compile_options(${PROJECT_NAME} PUBLIC -Wall -Wextra -Wconversion)
2828
elseif(MSVC)
2929
target_compile_options(${PROJECT_NAME} PUBLIC /W4 /WX /wd4819 /wd4146 /wd4127)
3030
target_compile_definitions(${PROJECT_NAME}Tests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)

test/source/test_ldlt.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ TEST_CASE("Cholesky test 3") {
3232
Q3.factorize(m3);
3333
CHECK(!Q3.is_spd());
3434
const auto ep3 = Q3.witness();
35+
Arr v = xt::zeros<double>({m3.shape()[0]});
36+
Q3.set_witness_vec(v);
37+
3538
// CHECK(Q3.p.second == 1);
36-
CHECK(ep3 == 0.);
39+
CHECK_EQ(ep3, 0.0);
40+
CHECK_EQ(v[0], 1.0);
3741
}

0 commit comments

Comments
 (0)