<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
larnv.hpp
Go to the documentation of this file.
1
6// Copyright (c) 2021-2023, University of Colorado Denver. All rights reserved.
7//
8// This file is part of <T>LAPACK.
9// <T>LAPACK is free software: you can redistribute it and/or modify it under
10// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
11
12#ifndef TLAPACK_LEGACY_LARNV_HH
13#define TLAPACK_LEGACY_LARNV_HH
14
17
18namespace tlapack {
19namespace legacy {
20
48 template <typename T>
49 void larnv(idx_t idist, idx_t* iseed, idx_t n, T* x)
50 {
51 using internal::create_vector;
52
53 auto x_ = create_vector(x, n);
54
55 if (idist == 1)
56 return larnv<1>(*iseed, x_);
57 else if (idist == 2)
58 return larnv<2>(*iseed, x_);
59 else if (idist == 3)
60 return larnv<3>(*iseed, x_);
61 else if (idist == 4)
62 return larnv<4>(*iseed, x_);
63 else if (idist == 5)
64 return larnv<5>(*iseed, x_);
65 }
66
67} // namespace legacy
68} // namespace tlapack
69
70#endif // TLAPACK_LEGACY_LARNV_HH
void larnv(idx_t idist, idx_t *iseed, idx_t n, T *x)
Returns a vector of n random numbers from a uniform or normal distribution.
Definition larnv.hpp:49
Returns a vector of random numbers from a uniform or normal distribution.
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113