static_assert
This commit is contained in:
@@ -131,6 +131,7 @@ inline PIVector<double> abs(const PIVector<double> & v) {
|
||||
|
||||
template <typename T>
|
||||
bool OLS_Linear(const PIVector<PIPair<T, T> > & input, T * out_a, T * out_b) {
|
||||
static_assert(std::is_arithmetic<T>::value, "Type must be arithmetic");
|
||||
if (input.size_s() < 2)
|
||||
return false;
|
||||
int n = input.size_s();
|
||||
@@ -154,6 +155,7 @@ bool OLS_Linear(const PIVector<PIPair<T, T> > & input, T * out_a, T * out_b) {
|
||||
|
||||
template <typename T>
|
||||
bool WLS_Linear(const PIVector<PIPair<T, T> > & input, const PIVector<T> & weights, T * out_a, T * out_b) {
|
||||
static_assert(std::is_arithmetic<T>::value, "Type must be arithmetic");
|
||||
if (input.size_s() < 2)
|
||||
return false;
|
||||
if (input.size_s() != weights.size_s())
|
||||
|
||||
Reference in New Issue
Block a user