33 lines
734 B
C++
33 lines
734 B
C++
#pragma once
|
|
|
|
#include "core/omp_config.h"
|
|
#include "detail/sum_serial.h"
|
|
|
|
|
|
|
|
namespace numerics{
|
|
|
|
// ---------------- Vector -> Scalar ----------------
|
|
template <typename T>
|
|
inline T sum(const utils::Vector<T>& v) {
|
|
return detail::sum_serial(v);
|
|
}
|
|
|
|
|
|
// ---------------- Matrix -> Scalar ----------------
|
|
template <typename T>
|
|
inline T sum(const utils::Matrix<T>& A) {
|
|
return detail::sum_serial(A);
|
|
}
|
|
|
|
// ---------------- Matrix -> Vector ----------------
|
|
template <typename T>
|
|
inline utils::Vector<T> sum_rowwise(const utils::Matrix<T>& A) {
|
|
return detail::sum_rowwise_serial(A);
|
|
}
|
|
|
|
template <typename T>
|
|
inline utils::Vector<T> sum_colwise(const utils::Matrix<T>& A) {
|
|
return detail::sum_colwise_serial(A);
|
|
}
|
|
} |