Skip to content

Commit 0bffaba

Browse files
committed
add github workflow for test-pypi cross-OS wheel builds
1 parent 59ea56d commit 0bffaba

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

include/fdaPDE-cpp/fdaPDE/core/fdaPDE/src/geoframe/data_layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ class scalar_data_layer {
11171117
if (coltype == dtype::flt32) { print.template operator()<float >(out[i], "flt32", desc); }
11181118
if (coltype == dtype::int64) { print.template operator()<std::int64_t>(out[i], "int64", desc); }
11191119
if (coltype == dtype::int32) { print.template operator()<std::int32_t>(out[i], "int32", desc); }
1120-
if (coltype == dtype::bin) { print.template operator()<bool >(out[i], "bin" , desc); }
1120+
// if (coltype == dtype::bin) { print.template operator()<bool >(out[i], "bin" , desc); }
11211121
if (coltype == dtype::str) { print.template operator()<std::string >(out[i], "str" , desc); }
11221122
}
11231123
// pretty format (compute maximum number of chars to print)

include/fdaPDE-cpp/fdaPDE/src/distributions.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,12 @@ struct bernoulli_distribution : public internals::distribution_base<std::bernoul
189189
for (int i = 0, n = x.rows(); i < n; ++i) { dev_ += deviance(x(i, 0), y(i, 0)); }
190190
return dev_;
191191
}
192+
template <typename Derived> matrix_t transform(const Eigen::MatrixBase<Derived>& data) const {
193+
return 0.5 * (data.array() + 0.5);
194+
}
192195
#endif
193-
template <typename T> auto transform(const T& data) const {
194-
if (internals::is_eigen_dense_xpr_v<T>) {
195-
return 0.5 * (data.array() + 0.5);
196-
} else {
197-
return Base::apply_(data, [](auto v) { return 0.5 * (v + 0.5); });
198-
}
196+
template <typename T> std::vector<T> transform(const std::vector<T>& data) const {
197+
return Base::apply_(data, [](auto v) { return 0.5 * (v + 0.5); });
199198
}
200199
void set_param(param_type p) { p_ = p; }
201200
};
@@ -284,13 +283,12 @@ struct poisson_distribution : public internals::distribution_base<std::poisson_d
284283
return ((y.array() > 0).select(y.array() * ((y.array() / x.array()).log() - 1) + x.array(), x.array()))
285284
.sum();
286285
}
286+
template <typename Derived> matrix_t transform(const Eigen::MatrixBase<Derived>& data) const {
287+
return matrix_t((data.array() <= 0).select(1.0, data));
288+
}
287289
#endif
288-
template <typename T> auto transform(const T& data) const {
289-
if (internals::is_eigen_dense_xpr_v<T>) {
290-
return matrix_t((data.array() <= 0).select(1.0, data));
291-
} else {
292-
return Base::apply_(data, [](auto v) { return v <= 0 ? 1.0 : v; });
293-
}
290+
template <typename T> std::vector<T> transform(const std::vector<T>& data) const {
291+
return Base::apply_(data, [](auto v) { return v <= 0 ? 1.0 : v; });
294292
}
295293
void set_param(param_type l) { l_ = l; }
296294
};

0 commit comments

Comments
 (0)