35 lines
522 B
C++
35 lines
522 B
C++
#pragma once
|
|
|
|
|
|
#include "./utils/vector.h"
|
|
#include "./utils/matrix.h"
|
|
|
|
|
|
namespace numerics{
|
|
|
|
|
|
template <typename T>
|
|
void inplace_matlog(utils::Matrix<T>& A){
|
|
|
|
const uint64_t rows = A.rows();
|
|
const uint64_t cols = A.cols();
|
|
|
|
for (uint64_t i = 0; i < rows; ++i){
|
|
for (uint64_t j = 0; j < cols; ++j){
|
|
numerics::inplace_log(A(i,j));
|
|
}
|
|
}
|
|
}
|
|
|
|
template <typename T>
|
|
utils::Matrix<T> log(const utils::Matrix<T>& A){
|
|
|
|
utils::Matrix<T> B = A;
|
|
inplace_matlog(B);
|
|
return B;
|
|
}
|
|
|
|
|
|
} // namespace numerics
|
|
|