Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions | Public Attributes | Protected Attributes | Private Attributes
Matrix_real_float Class Reference

Class to store single-precision real arrays and properties. More...

#include <matrix_real_float.h>

Inheritance diagram for Matrix_real_float:
Inheritance graph
[legend]

Public Member Functions

void conjugate ()
 Call to conjugate (or un-conjugate) the matrix for CBLAS functions. More...
 
Matrix_real_float copy () const
 
void copy_to (matrix_base< float > &target) const
 Copy the current matrix storage into a reusable target matrix. More...
 
void ensure_aligned ()
 
float * get_data () const
 Call to get the pointer to the stored data. More...
 
bool is_conjugated () const
 Call to get whether the matrix should be conjugated in CBLAS functions or not. More...
 
bool is_transposed () const
 Call to get whether the matrix should be conjugated in CBLAS functions or not. More...
 
bool isnan ()
 
 Matrix_real_float ()
 
 Matrix_real_float (float *data_in, int rows_in, int cols_in)
 
 Matrix_real_float (float *data_in, int rows_in, int cols_in, int stride_in)
 
 Matrix_real_float (int rows_in, int cols_in)
 
 Matrix_real_float (int rows_in, int cols_in, int stride_in)
 
 Matrix_real_float (const Matrix_real_float &in)
 
bool operator< (const matrix_base< float > &other) const
 
Matrix_real_floatoperator= (const Matrix_real_float &mtx)
 
float & operator[] (int idx) const
 Operator [] to access elements in array style (does not check the boundaries of the stored array) More...
 
void print_matrix () const
 Call to prints the stored matrix on the standard output. More...
 
void release_data ()
 Call to release the data stored by the matrix. More...
 
void replace_data (float *data_in, bool owner_in)
 Call to replace the stored data by an another data array. More...
 
void set_owner (bool owner_in)
 Call to set the current class instance to be (or not to be) the owner of the stored data array. More...
 
int size () const
 Call to get the number of the allocated elements. More...
 
void transpose ()
 Call to transpose (or un-transpose) the matrix for CBLAS functions. More...
 

Public Attributes

int cols
 The number of columns. More...
 
float * data
 pointer to the stored data More...
 
int rows
 The number of rows. More...
 
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) More...
 

Protected Attributes

bool conjugated
 logical variable indicating whether the matrix needs to be conjugated in CBLAS operations More...
 
bool owner
 logical value indicating whether the class instance is the owner of the stored data or not. (If true, the data array is released in the destructor) More...
 
std::atomic< int64_t > * references
 the number of the current references of the present object More...
 
bool transposed
 logical variable indicating whether the matrix needs to be transposed in CBLAS operations More...
 

Private Attributes

char padding [CACHELINE-48]
 padding class object to cache line borders More...
 

Detailed Description

Class to store single-precision real arrays and properties.

Definition at line 31 of file matrix_real_float.h.

Constructor & Destructor Documentation

◆ Matrix_real_float() [1/6]

Matrix_real_float::Matrix_real_float ( )

Definition at line 26 of file matrix_real_float.cpp.

Here is the caller graph for this function:

◆ Matrix_real_float() [2/6]

Matrix_real_float::Matrix_real_float ( float *  data_in,
int  rows_in,
int  cols_in 
)

Definition at line 29 of file matrix_real_float.cpp.

◆ Matrix_real_float() [3/6]

Matrix_real_float::Matrix_real_float ( float *  data_in,
int  rows_in,
int  cols_in,
int  stride_in 
)

Definition at line 33 of file matrix_real_float.cpp.

◆ Matrix_real_float() [4/6]

Matrix_real_float::Matrix_real_float ( int  rows_in,
int  cols_in 
)

Definition at line 37 of file matrix_real_float.cpp.

◆ Matrix_real_float() [5/6]

Matrix_real_float::Matrix_real_float ( int  rows_in,
int  cols_in,
int  stride_in 
)

Definition at line 41 of file matrix_real_float.cpp.

◆ Matrix_real_float() [6/6]

Matrix_real_float::Matrix_real_float ( const Matrix_real_float in)

Definition at line 45 of file matrix_real_float.cpp.

Member Function Documentation

◆ conjugate()

void matrix_base< float >::conjugate ( )
inlineinherited

Call to conjugate (or un-conjugate) the matrix for CBLAS functions.

Definition at line 252 of file matrix_base.hpp.

◆ copy()

Matrix_real_float Matrix_real_float::copy ( ) const

Definition at line 56 of file matrix_real_float.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_to()

void matrix_base< float >::copy_to ( matrix_base< float > &  target) const
inlineinherited

Copy the current matrix storage into a reusable target matrix.

The target is reallocated when dimensions or stride differ; otherwise its existing allocation is reused.

Parameters
targetThe matrix receiving a deep copy of the current storage.

Definition at line 433 of file matrix_base.hpp.

◆ ensure_aligned()

void matrix_base< float >::ensure_aligned ( )
inlineinherited

Definition at line 448 of file matrix_base.hpp.

◆ get_data()

float * matrix_base< float >::get_data ( ) const
inlineinherited

Call to get the pointer to the stored data.

Definition at line 285 of file matrix_base.hpp.

◆ is_conjugated()

bool matrix_base< float >::is_conjugated ( ) const
inlineinherited

Call to get whether the matrix should be conjugated in CBLAS functions or not.

Returns
Returns with true if the matrix should be conjugated in CBLAS functions or false otherwise.

Definition at line 245 of file matrix_base.hpp.

◆ is_transposed()

bool matrix_base< float >::is_transposed ( ) const
inlineinherited

Call to get whether the matrix should be conjugated in CBLAS functions or not.

Returns
Returns with true if the matrix should be conjugated in CBLAS functions or false otherwise.

Definition at line 263 of file matrix_base.hpp.

◆ isnan()

bool Matrix_real_float::isnan ( )

Definition at line 71 of file matrix_real_float.cpp.

◆ operator<()

bool matrix_base< float >::operator< ( const matrix_base< float > &  other) const
inlineinherited

Definition at line 394 of file matrix_base.hpp.

◆ operator=()

Matrix_real_float & Matrix_real_float::operator= ( const Matrix_real_float mtx)

Definition at line 50 of file matrix_real_float.cpp.

Here is the call graph for this function:

◆ operator[]()

float & matrix_base< float >::operator[] ( int  idx) const
inlineinherited

Operator [] to access elements in array style (does not check the boundaries of the stored array)

Parameters
idxthe index of the element
Returns
Returns with a reference to the idx-th element.

Definition at line 382 of file matrix_base.hpp.

◆ print_matrix()

void matrix_base< float >::print_matrix ( ) const
inlineinherited

Call to prints the stored matrix on the standard output.

Definition at line 471 of file matrix_base.hpp.

◆ release_data()

void matrix_base< float >::release_data ( )
inlineinherited

Call to release the data stored by the matrix.

(If the class instance was not the owner of the data, then the data pointer is simply set to NULL pointer.)

Definition at line 311 of file matrix_base.hpp.

◆ replace_data()

void matrix_base< float >::replace_data ( float *  data_in,
bool  owner_in 
)
inlineinherited

Call to replace the stored data by an another data array.

If the class was the owner of the original data array, then it is released.

Parameters
data_inThe data array to be set as a new storage.
owner_inSet true to set the current class instance to be the owner of the data array, or false otherwise.

Definition at line 297 of file matrix_base.hpp.

◆ set_owner()

void matrix_base< float >::set_owner ( bool  owner_in)
inlineinherited

Call to set the current class instance to be (or not to be) the owner of the stored data array.

Parameters
owner_inSet true to set the current class instance to be the owner of the data array, or false otherwise.

Definition at line 337 of file matrix_base.hpp.

◆ size()

int matrix_base< float >::size ( ) const
inlineinherited

Call to get the number of the allocated elements.

Returns
Returns with the number of the allocated elements (rows*cols)

Definition at line 461 of file matrix_base.hpp.

◆ transpose()

void matrix_base< float >::transpose ( )
inlineinherited

Call to transpose (or un-transpose) the matrix for CBLAS functions.

Definition at line 273 of file matrix_base.hpp.

Member Data Documentation

◆ cols

int matrix_base< float >::cols
inherited

The number of columns.

Definition at line 44 of file matrix_base.hpp.

◆ conjugated

bool matrix_base< float >::conjugated
protectedinherited

logical variable indicating whether the matrix needs to be conjugated in CBLAS operations

Definition at line 53 of file matrix_base.hpp.

◆ data

float * matrix_base< float >::data
inherited

pointer to the stored data

Definition at line 48 of file matrix_base.hpp.

◆ owner

bool matrix_base< float >::owner
protectedinherited

logical value indicating whether the class instance is the owner of the stored data or not. (If true, the data array is released in the destructor)

Definition at line 57 of file matrix_base.hpp.

◆ padding

char Matrix_real_float::padding[CACHELINE-48]
private

padding class object to cache line borders

Definition at line 34 of file matrix_real_float.h.

◆ references

std::atomic<int64_t>* matrix_base< float >::references
protectedinherited

the number of the current references of the present object

Definition at line 59 of file matrix_base.hpp.

◆ rows

int matrix_base< float >::rows
inherited

The number of rows.

Definition at line 42 of file matrix_base.hpp.

◆ stride

int matrix_base< float >::stride
inherited

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)

Definition at line 46 of file matrix_base.hpp.

◆ transposed

bool matrix_base< float >::transposed
protectedinherited

logical variable indicating whether the matrix needs to be transposed in CBLAS operations

Definition at line 55 of file matrix_base.hpp.


The documentation for this class was generated from the following files: