Skip to content

Commit d09bb70

Browse files
committed
Merge branch 'Jordan08-dev-clean-v2-12' into codac2_dev
2 parents 7af3c8c + 7437342 commit d09bb70

9 files changed

Lines changed: 132 additions & 250 deletions

File tree

‎doc/CMakeLists.txt‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@
3434

3535
message(STATUS "Building API Documentation (mandatory for Python binding or for building the manual)")
3636

37-
set(SPHINX_EXTRA_API ${CMAKE_CURRENT_BINARY_DIR}/manual/extra_html/api)
38-
file(MAKE_DIRECTORY ${SPHINX_EXTRA_API})
39-
40-
execute_process(COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)
37+
execute_process(
38+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
39+
OUTPUT_QUIET
40+
ERROR_VARIABLE DOXYGEN_ERROR
41+
RESULT_VARIABLE DOXYGEN_RESULT
42+
)
43+
if(NOT DOXYGEN_RESULT EQUAL 0)
44+
if(EXISTS "${CMAKE_BINARY_DIR}/doc/api/xml/index.xml")
45+
message(WARNING "Doxygen exited with '${DOXYGEN_RESULT}' but generated XML output. Continuing so Python docstrings can still be generated.")
46+
else()
47+
message(FATAL_ERROR "Doxygen failed to generate the API documentation (exit code ${DOXYGEN_RESULT}), which is required for the Python docstrings. Doxygen errors: ${DOXYGEN_ERROR}")
48+
endif()
49+
endif()
4150
add_custom_target(api COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)
4251

4352
endif()

‎python/CMakeLists.txt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464
execute_process(COMMAND ${PYTHON_EXECUTABLE}
6565
${PROJECT_SOURCE_DIR}/scripts/doxygen/doxygen2docstring.py
6666
${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
67-
${CMAKE_CURRENT_BINARY_DIR}/docstring)
67+
${CMAKE_CURRENT_BINARY_DIR}/docstring
68+
RESULT_VARIABLE DOCSTRING_RESULT)
69+
if(NOT DOCSTRING_RESULT EQUAL 0)
70+
message(FATAL_ERROR "doxygen2docstring.py failed (exit code ${DOCSTRING_RESULT}) while generating the Python docstring headers.")
71+
endif()
6872

6973
endif()
7074

‎src/core/contractors/codac2_CtcInverse_.h‎

Lines changed: 0 additions & 224 deletions
This file was deleted.

‎src/core/domains/paving/codac2_Paving.cpp‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ namespace codac2
1818
// PavingOut class
1919

2020
PavingOut::PavingOut(Index n)
21-
: Paving<PavingOut,IntervalVector>(n)
21+
: Paving<PavingOut,IntervalVector>()
2222
{
2323
assert_release(n > 0);
24+
this->init_tree(IntervalVector(n));
2425
}
2526

2627
PavingOut::PavingOut(const IntervalVector& x)
27-
: Paving<PavingOut,IntervalVector>(x)
28-
{ }
28+
: Paving<PavingOut,IntervalVector>()
29+
{
30+
this->init_tree(x);
31+
}
2932

3033
std::list<PavingOut::ConnectedSubset_> PavingOut::connected_subsets(const PavingOut::NodeValue_& node_value) const
3134
{
@@ -77,20 +80,23 @@ namespace codac2
7780
IntervalVector operator&(const IntervalVector& x, const PavingOut& p)
7881
{
7982
return p & x;
80-
};
83+
}
8184

8285

8386
// PavingInOut class
8487

8588
PavingInOut::PavingInOut(Index n)
86-
: Paving<PavingInOut,IntervalVector,IntervalVector>(n)
89+
: Paving<PavingInOut,IntervalVector,IntervalVector>()
8790
{
8891
assert_release(n > 0);
92+
this->init_tree(IntervalVector(n));
8993
}
9094

9195
PavingInOut::PavingInOut(const IntervalVector& x)
92-
: Paving<PavingInOut,IntervalVector,IntervalVector>(x)
93-
{ }
96+
: Paving<PavingInOut,IntervalVector,IntervalVector>()
97+
{
98+
this->init_tree(x);
99+
}
94100

95101
std::list<PavingInOut::ConnectedSubset_> PavingInOut::connected_subsets(const PavingInOut::NodeValue_& node_value) const
96102
{
@@ -141,4 +147,4 @@ namespace codac2
141147
l.push_back(n->unknown());
142148
return l;
143149
};
144-
}
150+
}

‎src/core/domains/paving/codac2_Paving.h‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ namespace codac2
3232
using NodeValue_ = std::function<std::list<IntervalVector>(Node_)>;
3333
using ConnectedSubset_ = Subpaving<P>;
3434

35-
Paving(Index n)
36-
: Paving(IntervalVector(n))
37-
{
38-
assert_release(n > 0);
39-
}
35+
protected:
4036

41-
Paving(const IntervalVector& x)
42-
: _tree(std::make_shared<PavingNode<P>>(*static_cast<P*>(this), x))
37+
Paving()
4338
{ }
39+
40+
public:
4441

4542
inline Index size() const
4643
{
@@ -128,6 +125,11 @@ namespace codac2
128125

129126
friend class PavingNode<P>;
130127

128+
inline void init_tree(const IntervalVector& x)
129+
{
130+
_tree = std::make_shared<PavingNode<P>>(*static_cast<P*>(this), x);
131+
}
132+
131133
inline static NodeTuple_ init_tuple(const IntervalVector& x)
132134
{
133135
return std::make_tuple(((X)x)...);
@@ -196,4 +198,4 @@ namespace codac2
196198

197199
static const NodeValue_ outer, outer_complem, inner, bound, all;
198200
};
199-
}
201+
}

‎src/core/domains/paving/codac2_PavingNode.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace codac2
6161

6262
std::shared_ptr<const PavingNode<P>> top() const
6363
{
64-
return _top;
64+
return _top.lock();
6565
}
6666

6767
std::shared_ptr<PavingNode<P>> top()
@@ -102,7 +102,7 @@ namespace codac2
102102

103103
void visit(std::function<bool(std::shared_ptr<const PavingNode<P>>)> visitor) const
104104
{
105-
if(!_top && !_right && _left && left()->boxes() == _x)
105+
if(_top.expired() && !_right && _left && left()->boxes() == _x)
106106
left()->visit(visitor);
107107

108108
else if(visitor(this->shared_from_this()))
@@ -114,7 +114,7 @@ namespace codac2
114114

115115
void visit(std::function<bool(std::shared_ptr<PavingNode<P>>)> visitor)
116116
{
117-
if(!_top && !_right && _left && left()->boxes() == _x)
117+
if(_top.expired() && !_right && _left && left()->boxes() == _x)
118118
_left->visit(visitor);
119119

120120
else if(visitor(this->shared_from_this()))
@@ -157,7 +157,7 @@ namespace codac2
157157

158158
const P& _paving;
159159
typename P::NodeTuple_ _x;
160-
std::shared_ptr<PavingNode<P>> _top = nullptr;
160+
std::weak_ptr<PavingNode<P>> _top;
161161
std::shared_ptr<PavingNode<P>> _left = nullptr, _right = nullptr;
162162
};
163-
}
163+
}

0 commit comments

Comments
 (0)