Started on Random Library

I made seed and uniform functions, but they are not omp friendly. They are runnning omp themself, but is not safe for threading/parallizing. Uniform is aproximated and is NOT validaded up against a real uniform distribution.
This commit is contained in:
2026-07-28 17:32:49 +02:00
parent 52684e6b8a
commit 441540a996
7 changed files with 1359 additions and 15 deletions
+20 -13
View File
@@ -99,20 +99,27 @@ template bool print_vector<panic::types::real_t>(const panic::tensor::vector<pan
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool print_matrix(const panic::tensor::matrix<T>& A){
std::cout << "[";
for (panic::types::uint_t i = 0; i < A.rows(); ++i){
std::cout << "[";
for (panic::types::uint_t j = 0; j < A.cols(); ++j){
std::cout << A(i,j) << ", ";
}
if (i < A.rows()-1){
std::cout << A(A.rows()-1,A.cols()-1) << "]" << std::endl;
}else{
std::cout << A(A.rows()-1,A.cols()-1) << "]]" << std::endl;
}
}
return true;
std::cout << "[";
for (panic::types::uint_t i = 0; i < A.rows(); ++i){
std::cout << "[";
for (panic::types::uint_t j = 0; j < A.cols(); ++j){
std::cout << A(i, j);
if (j + 1 < A.cols()){
std::cout << ", ";
}
}
std::cout << "]";
if (i + 1 < A.rows())
std::cout << "," << std::endl;
}
std::cout << "]" << std::endl;
return true;
}
//--------------------------------------------------------------------------------------------------------------------------