7 template<
typename ComplexType>
10 template<
typename ComplexType>
12 :
matrix_base<ComplexType>(data_in, rows_in, cols_in) {}
14 template<
typename ComplexType>
16 :
matrix_base<ComplexType>(data_in, rows_in, cols_in, stride_in) {}
18 template<
typename ComplexType>
22 template<
typename ComplexType>
24 :
matrix_base<ComplexType>(rows_in, cols_in, stride_in) {}
26 template<
typename ComplexType>
30 template<
typename ComplexType>
34 template<
typename ComplexType>
42 template<
typename ComplexType>
50 template<
typename ComplexType>
55 std::memcpy(result.
data, this->data, this->rows * this->stride *
sizeof(ComplexType));
59 template<
typename ComplexType>
61 for (
int idx = 0; idx < this->
rows * this->
cols; idx++) {
62 if (std::isnan(this->
data[idx].
real) || std::isnan(this->
data[idx].imag)) {
69 template<
typename ComplexType>
71 std::cout <<
"\nThe stored matrix:\n";
72 for (
int row_idx = 0; row_idx < this->
rows; row_idx++) {
73 for (
int col_idx = 0; col_idx < this->
cols; col_idx++) {
74 int element_idx = row_idx * this->
stride + col_idx;
75 std::cout <<
" (" << this->
data[element_idx].real
76 <<
", " << this->
data[element_idx].imag <<
"*i)";
89 "Matrix_T<QGD_Complex16> size must equal exactly one CACHELINE");
91 "Matrix_T<QGD_Complex8> size must equal exactly one CACHELINE");
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)
void print_matrix() const
ComplexType * data
pointer to the stored data
bool transposed
logical variable indicating whether the matrix needs to be transposed in CBLAS operations ...
bool conjugated
logical variable indicating whether the matrix needs to be conjugated in CBLAS operations ...
Base Class to store data of arrays and its properties.
void operator=(const matrix_base &mtx)
Assignment operator.
int rows
The number of rows.
int cols
The number of columns.
Custom types for the SQUANDER package.
Matrix_T & operator=(const Matrix_T &other)