cb65174cf4
fixed rowwise/colswise mean/sum and implemented binomial_corssentrhopy. Next up is regression.
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "core/omp_config.h"
|
|
#include "detail/binary_threshold_serial.h"
|
|
|
|
|
|
namespace numerics{
|
|
|
|
// ---------------- Elementwise ----------------
|
|
template <typename T>
|
|
inline void inplace_greater_than(T& a, const T c) {
|
|
detail::inplace_greater_than_serial(a, c);
|
|
}
|
|
|
|
template <typename T>
|
|
inline T greater_than(const T a, const T c) {
|
|
T out = a;
|
|
inplace_greater_than(out, c);
|
|
return out;
|
|
}
|
|
|
|
template <typename T>
|
|
inline void inplace_greater_than(utils::Vector<T>& v, const T c) {
|
|
detail::inplace_greater_than_serial(v, c);
|
|
}
|
|
|
|
template <typename T>
|
|
inline utils::Vector<T> greater_than(const utils::Vector<T>& v, const T c) {
|
|
utils::Vector<T> out = v;
|
|
inplace_greater_than(out, c);
|
|
return out;
|
|
}
|
|
|
|
|
|
|
|
template <typename T>
|
|
inline void inplace_greater_than(utils::Matrix<T>& A, const T c) {
|
|
detail::inplace_greater_than_serial(A, c);
|
|
}
|
|
|
|
template <typename T>
|
|
inline utils::Matrix<T> greater_than(const utils::Matrix<T>& A, const T c) {
|
|
utils::Matrix<T> out = A;
|
|
inplace_greater_than(out, c);
|
|
return out;
|
|
}
|
|
|
|
|
|
|
|
|
|
} |