Next step is ramdom and equal. I also need to have a look at add and the serial naming of the functions.
This commit is contained in:
+27
-10
@@ -1,16 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
namespace numerics{
|
||||
|
||||
template <typename T>
|
||||
T max(const T a, const T b){
|
||||
#include "./core/omp_config.h"
|
||||
#include "detail/max_serial.h"
|
||||
|
||||
if(a < b){
|
||||
return b;
|
||||
}else{
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
namespace numerics{
|
||||
|
||||
// ---------------- Vector -> Scalar ----------------
|
||||
template <typename T>
|
||||
inline T max(const utils::Vector<T>& v) {
|
||||
return detail::max_serial(v);
|
||||
}
|
||||
|
||||
} // namespace numerics
|
||||
|
||||
// ---------------- Matrix -> Scalar ----------------
|
||||
template <typename T>
|
||||
inline T max(const utils::Matrix<T>& A) {
|
||||
return detail::max_serial(A);
|
||||
}
|
||||
|
||||
// ---------------- Matrix -> Vector ----------------
|
||||
template <typename T>
|
||||
inline utils::Vector<T> max_rowwise(const utils::Matrix<T>& A) {
|
||||
return detail::max_rowwise_serial(A);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline utils::Vector<T> max_colwise(const utils::Matrix<T>& A) {
|
||||
return detail::max_colwise_serial(A);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user