Skip to content

Commit d4dfc04

Browse files
committed
format
1 parent 0c573fa commit d4dfc04

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

cpp/memilio/epidemiology/populations.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ class Populations : public CustomIndexArray<UncertainValue<FP>, Categories...>
7575
* @tparam OtherType The type to convert into.
7676
* @return New Populations of OtherType with copy of internal data.
7777
*/
78-
template <class OtherType> requires std::convertible_to<typename Base::Type::Type, OtherType>
78+
template <class OtherType>
79+
requires std::convertible_to<typename Base::Type::Type, OtherType>
7980
Populations<OtherType, Categories...> convert() const
8081
{
81-
return Populations<OtherType, Categories...>(Base::template convert<typename Base::Type::Type>().template convert<UncertainValue<OtherType>>());
82+
return Populations<OtherType, Categories...>(
83+
Base::template convert<typename Base::Type::Type>().template convert<UncertainValue<OtherType>>());
8284
}
8385

8486
/**

cpp/memilio/mobility/graph.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ class Graph
180180
/**
181181
* @brief Construct graph without edges, creating a node for each id in node_ids from the same node_args.
182182
*/
183-
template <class... Args> requires std::constructible_from<NodePropertyT, Args...>
183+
template <class... Args>
184+
requires std::constructible_from<NodePropertyT, Args...>
184185
Graph(const std::vector<int>& node_ids, Args&&... node_args)
185186
{
186187
for (int id : node_ids) {
@@ -191,7 +192,8 @@ class Graph
191192
/**
192193
* @brief Construct graph without edges, creating each node from the same node_args with default node ids [0, 1, ...].
193194
*/
194-
template <class... Args> requires std::constructible_from<NodePropertyT, Args...>
195+
template <class... Args>
196+
requires std::constructible_from<NodePropertyT, Args...>
195197
Graph(const int number_of_nodes, Args&&... args)
196198
{
197199
for (int id = 0; id < number_of_nodes; ++id) {
@@ -213,7 +215,8 @@ class Graph
213215
* @param id id for the node
214216
* @tparam args additional arguments for node construction
215217
*/
216-
template <class... Args> requires std::constructible_from<NodePropertyT, Args...>
218+
template <class... Args>
219+
requires std::constructible_from<NodePropertyT, Args...>
217220
void add_node(int id, Args&&... args)
218221
{
219222
m_nodes.emplace_back(id, std::forward<Args>(args)...);
@@ -227,7 +230,8 @@ class Graph
227230
*
228231
* If an edge with the same start and end node indices already exists, it is replaced by the newly constructed edge.
229232
*/
230-
template <class... Args> requires std::constructible_from<EdgePropertyT, Args...>
233+
template <class... Args>
234+
requires std::constructible_from<EdgePropertyT, Args...>
231235
void add_edge(size_t start_node_idx, size_t end_node_idx, Args&&... args)
232236
{
233237
assert(m_nodes.size() > start_node_idx && m_nodes.size() > end_node_idx);

cpp/memilio/utils/custom_index_array.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ class CustomIndexArray
349349
* @tparam OtherType The type to convert into.
350350
* @return New CustomIndexArray of OtherType with copy of internal data.
351351
*/
352-
template <class OtherType> requires std::convertible_to<Type, OtherType>
352+
template <class OtherType>
353+
requires std::convertible_to<Type, OtherType>
353354
CustomIndexArray<OtherType, Tags...> convert() const
354355
{
355356
CustomIndexArray<OtherType, Tags...> other;

cpp/memilio/utils/stl_util.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,13 @@ constexpr std::array<T, size_t(T::Count)> enum_members()
322322
* the const_iterator is used. std::conditional tries to compile both cases, thus
323323
* we also need std::remove_const for the case where T is not const.
324324
*/
325-
template<class T>
326-
using VectorRange = std::conditional_t<std::is_const_v<T>,
327-
typename mio::Range<std::pair<typename std::vector<std::remove_const_t<T>>::const_iterator,
328-
typename std::vector<std::remove_const_t<T>>::const_iterator>>,
329-
typename mio::Range<std::pair<typename std::vector<std::remove_const_t<T>>::iterator,
330-
typename std::vector<std::remove_const_t<T>>::iterator>>>;
331-
325+
template <class T>
326+
using VectorRange =
327+
std::conditional_t<std::is_const_v<T>,
328+
typename mio::Range<std::pair<typename std::vector<std::remove_const_t<T>>::const_iterator,
329+
typename std::vector<std::remove_const_t<T>>::const_iterator>>,
330+
typename mio::Range<std::pair<typename std::vector<std::remove_const_t<T>>::iterator,
331+
typename std::vector<std::remove_const_t<T>>::iterator>>>;
332332

333333
} // namespace mio
334334

cpp/models/ode_secirvvs/parameters_io.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ IOResult<void> read_input_data(std::vector<Model>& model, Date date, const std::
10591059
return success();
10601060
}
10611061

1062-
10631062
/**
10641063
* @brief Converts input data from one range of models to another with different type.
10651064
*
@@ -1082,8 +1081,7 @@ IOResult<void> convert_model_data_type(mio::VectorRange<Node<Model<ScalarType>>>
10821081
for (size_t region_idx = 0; region_idx < model_from.size(); ++region_idx) {
10831082
// convert populations to mio::UncertainValue<FP>
10841083
// needs 2 converts as mio::UncertainValue<ScalarType> -> mio::UncertainValue<FP> does not work
1085-
model_to[region_idx].property.populations = model_from[region_idx]
1086-
.property.populations.template convert<FP>();
1084+
model_to[region_idx].property.populations = model_from[region_idx].property.populations.template convert<FP>();
10871085
}
10881086
return mio::success();
10891087
}

0 commit comments

Comments
 (0)