Sync public subset from Flux
This commit is contained in:
22
include/numerics/vecmax.h
Normal file
22
include/numerics/vecmax.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "./utils/vector.h"
|
||||
|
||||
namespace numerics{
|
||||
|
||||
|
||||
|
||||
template <typename T>
|
||||
T vecmax(const utils::Vector<T>& a){
|
||||
T max_value(T{0});
|
||||
uint64_t N = a.size();
|
||||
|
||||
for (uint64_t i = 0; i < N; ++i){
|
||||
max_value = numerics::max(max_value, a[i]);
|
||||
}
|
||||
return max_value;
|
||||
}
|
||||
|
||||
} // namespace numerics
|
||||
|
||||
Reference in New Issue
Block a user