25typedef Eigen::Array<bool,Eigen::Dynamic,1>
ArrayXb;
26using Eigen::ArrayBase;
46 template<Brush::NodeType N>
49 template<
typename T1,
typename...
Tn>
56 template<
typename T1,
typename T2>
65 template<
typename T1,
typename T2>
72 template<
typename T1,
typename T2>
79 template<
typename T1,
typename T2>
88 template<
typename T1,
typename T2,
typename...
Tn>
92 inline auto operator()(
const T&
t) {
return t.rowwise().minCoeff(); }
102 template<
typename T1,
typename T2,
typename...
Tn>
132 template<
typename Derived>
133 typename Derived::Scalar
median( Eigen::DenseBase<Derived>&
d ){
134 auto r {
d.reshaped() };
135 std::sort(
r.begin(),
r.end() );
136 return r.size() % 2 == 0 ?
137 r.segment( (
r.size()-2)/2, 2 ).mean() :
141 template<
typename Derived>
142 typename Derived::Scalar
median(
const Eigen::DenseBase<Derived>&
d ){
143 typename Derived::PlainObject m {
d.replicate(1,1) };
147 template<
typename Derived,
typename T=Derived::Scalar>
149 Eigen::Array<T,-1,1>
tmp(
t.rows());
150 std::transform(
t.rowwise().begin(),
t.rowwise().end(),
152 [&](
const auto&
i){return this->median(i);}
179 return (
t.rowwise().count().cast <
float> ());
224 for (
int i = 0;
i <
t.rows(); ++
i)
225 t.row(
i).maxCoeff(&
idx(
i));
233 template<
typename T1,
typename T2>
380 template<
typename T1,
typename T2>
387 template<
typename T1,
typename T2>
394 template<
typename T1,
typename T2>
401 template<
typename T1,
typename T2>
408 constexpr auto Stack = [](
auto m,
auto...
ms) {
409 return ((Array<T,-1,-1>(m.rows(),1+
sizeof...(ms))<<m),...,
ms).finished();
415 template <
typename T>
418 auto tMinusMax =
t.rowwise() -
t.colwise().maxCoeff();
422 template <
typename T>
483 auto trues = ArrayXb::Constant(
t.size(),
true);
void bind_engine(py::module &m, string name)
Eigen::Array< bool, Eigen::Dynamic, 1 > ArrayXb
namespace containing various utility functions
vector< T > softmax(const vector< T > &w)
return the softmax transformation of a vector.
Scalar median(const T &v)
calculate median
< nsga2 selection operator for getting the front
constexpr auto Stack
Stacks Eigen arrays into a 2d-array, where each array is a column.
Eigen::Array< bool, Eigen::Dynamic, Eigen::Dynamic > ArrayXXb
Eigen::Array< int, Eigen::Dynamic, 1 > ArrayXi
Stores time series data and implements operators over it.
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const ArrayBase< T > &t1, const ArrayBase< T > &t2)
auto operator()(const ArrayBase< T > &t1, const ArrayBase< T > &t2)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(ArrayXXb t)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T1 &t1, const T2 &t2, Tn... tn)
auto operator()(const T &t)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T &t)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T &t)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T1 &t1, const T2 &t2, Tn... tn)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const ArrayBase< T > &t)
auto operator()(const ArrayBase< T > &t)
auto operator()(const T &t)
auto operator()(const ArrayBase< T > &t1, const ArrayBase< T > &t2)
auto operator()(const ArrayBase< T > &t1, const ArrayBase< T > &t2)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const ArrayBase< T > &t)
auto softmax(const ArrayBase< T > &t) const
auto operator()(const T1 &t1, const T2 &t2, const T2 &t3)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T1 &t1, const T2 &t2)
auto operator()(const TimeSeries< T > &t)
auto operator()(const T &t)
auto operator()(ArrayXXb t)
auto operator()(const T &t)
auto operator()(const T &t)
auto operator()(const T1 &t1, Tn... tn)