Sync public subset from Flux
This commit is contained in:
25
include/numerics/log.h
Normal file
25
include/numerics/log.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "./utils/vector.h"
|
||||
#include "./utils/matrix.h"
|
||||
|
||||
|
||||
namespace numerics{
|
||||
|
||||
|
||||
template <typename T>
|
||||
void inplace_log(T a){
|
||||
a = std::log(a);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T log(const T a){
|
||||
T b = a;
|
||||
inplace_log(b);
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
} // namespace numerics
|
||||
|
||||
Reference in New Issue
Block a user