Go to the documentation of this file.
65 for (
Index i = 0; i < m; i++) {
66 for (
Index j = 0; j < n; j++) {
77 for (
Index i = 0; i < m; i++) {
78 for (
Index j = 0; j < n; j++) {
109 A.
rw(m1, n1) = random_number();
130 assert(B.
nrows() == m);
131 assert(B.
ncols() == n);
142 A(m1, n1) = random_number();
143 B.
rw(m1, n1) = A(m1, n1);
193 for (
Index i = 0; i < n; i++) {
235 for (
Index i = 0; i < n; i++) {
253 assert((0 <= m) && (m <= m0));
254 assert((0 <= n) && (m <= n0));
256 Rand<Index> rand_m(0, (m0 - m - 1)), rand_n(0, (n0 - n - 1));
261 Range r1(m1, m), r2(n1, n);
278 if (0 <= (n - e - 1)) {
304 for (
Index i = 0; i < n; i++) {
309 err =
abs((v2[i] - v1[i]) / v2[i]);
313 err =
abs(v2[i] - v2[i]);
343 for (
Index i = 0; i < m; i++) {
344 for (
Index j = 0; j < n; j++) {
348 if (A2(i, j) != 0.0) {
349 err =
abs((A2(i, j) - A1(i, j)) / A2(i, j));
353 err = A2(i, j) - A1(i, j);
372 for (
Index i = 0; i < m; i++) {
373 for (
Index j = 0; j < n; j++) {
377 if (A2(i, j).real() != 0.0 && A2(i, j).imag() != 0.0) {
378 err =
abs((A2(i, j) - A1(i, j)) / A2(i, j));
382 err =
abs(A2(i, j) - A1(i, j));
void random_fill_matrix_symmetric(MatrixView A, Numeric range, bool positive)
Generate random, symmetric matrix.
Index ncols() const
Returns the number of columns.
Utility functions for testing.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
void random_fill_vector(VectorView v, Numeric range, bool positive)
Fill vector with random values.
Index nrows() const
Returns the number of rows.
std::complex< Numeric > Complex
void random_fill_matrix_pos_semi_def(MatrixView A, Numeric range, bool positive)
Generate random, positive semi-definite matrix.
Index nelem(const Lines &l)
Number of lines.
void random_fill_matrix(MatrixView A, Numeric range, bool positive)
Fill matrix with random values.
Index ncols() const
Returns the number of columns.
void add_noise(VectorView v, Numeric scale)
Add noise to vector.
Index nelem() const
Returns the number of elements.
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
A constant view of a Matrix.
The ComplexMatrixView class.
Index nrows() const
Returns the number of rows.
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
Numeric & rw(Index r, Index c)
Read and write index operator.
Range random_range(Index n)
Generate random sub-range of the range [0, n-1].
Header file for sparse matrices.
A constant view of a ComplexMatrix.
Numeric get_maximum_error(ConstVectorView v1, ConstVectorView v2, bool relative)
Maximum element-wise error of two vectors.
INDEX Index
The type to use for all integer numbers and indices.
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
A constant view of a Vector.
void random_fill_matrix_pos_def(MatrixView A, Numeric range, bool positive)
Generate random, positive definite matrix.
MatrixView random_submatrix(MatrixView A, int m, int n)
Pick random random submatrix of size m times n.
The global header file for ARTS.