16 for (
int i = 0; i < 3; i++) {
17 for (
int j = 0; j < 3; j++) {
18 int idx = i * m1.
stride + j;
30 assert(m3.get_data() != m1.
get_data());
31 assert(m3.rows == m1.
rows && m3.cols == m1.
cols);
34 for (
int i = 0; i < m1.
rows * m1.
cols; i++) {
35 assert(m3.data[i].real == m1.
data[i].
real);
36 assert(m3.data[i].imag == m1.
data[i].
imag);
60 assert(zero_mat.
size() == 0);
63 single[0].real = 42.0;
64 assert(single[0].
real == 42.0);
68 assert(rect1.
size() == rect2.
size());
70 std::cout <<
"All tests passed!" << std::endl;
int stride
The column stride of the array. (The array elements in one row are a_0, a_1, ... a_{cols-1}, 0, 0, 0, 0. The number of zeros is stride-cols)
scalar * data
pointer to the stored data
scalar * get_data() const
Call to get the pointer to the stored data.
int rows
The number of rows.
int cols
The number of columns.
Custom types for the SQUANDER package.
Header file of complex array storage array with automatic and thread safe reference counting...
Matrix copy() const
Call to create a copy of the matrix.
Double-precision complex matrix (float64).
int size() const
Call to get the number of the allocated elements.
double real
the real part of a complex number
double imag
the imaginary part of a complex number