libqasm
library for handling cQASM files
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
cqasm::v1::types::ComplexMatrix Class Reference

Type of a complex matrix. More...

Public Member Functions

 ComplexMatrix (const cqasm::v1::primitives::Int &num_rows=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Int >(), const cqasm::v1::primitives::Int &num_cols=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Int >(), const cqasm::v1::primitives::Bool &assignable=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Bool >())
 Constructor. More...
 
void find_reachable (::tree::base::PointerMap &map) const override
 Registers all reachable nodes with the given PointerMap. More...
 
void check_complete (const ::tree::base::PointerMap &map) const override
 Returns whether this ComplexMatrix is complete/fully defined. More...
 
NodeType type () const override
 Returns the NodeType of this node. More...
 
ComplexMatrixas_complex_matrix () override
 Interprets this node to a node of type ComplexMatrix. More...
 
const ComplexMatrixas_complex_matrix () const override
 Interprets this node to a node of type ComplexMatrix. More...
 
One< Nodecopy () const override
 Returns a shallow copy of this node. More...
 
One< Nodeclone () const override
 Returns a deep copy of this node. More...
 
bool equals (const Node &rhs) const override
 Value-based equality operator. More...
 
bool operator== (const Node &rhs) const override
 Pointer-based equality operator. More...
 
void serialize (::tree::cbor::MapWriter &map, const ::tree::base::PointerMap &ids) const override
 Serializes this node to the given map. More...
 
- Public Member Functions inherited from cqasm::v1::types::TypeBase
 TypeBase (const cqasm::v1::primitives::Bool &assignable=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Bool >())
 Constructor. More...
 
TypeBaseas_type_base () override
 Interprets this node to a node of type TypeBase. More...
 
const TypeBaseas_type_base () const override
 Interprets this node to a node of type TypeBase. More...
 
- Public Member Functions inherited from cqasm::v1::types::Node
bool operator!= (const Node &rhs) const
 Pointer-based inequality operator. More...
 
template<typename T >
visit (Visitor< T > &visitor)
 Visit this object. More...
 
void dump (std::ostream &out=std::cout, int indent=0)
 Writes a debug dump of this node to the given stream. More...
 
void dump_seq (std::ostream &out=std::cout, int indent=0)
 Alternate debug dump that represents links and node uniqueness via sequence number tags. More...
 
virtual Axisas_axis ()
 Interprets this node to a node of type Axis. More...
 
virtual const Axisas_axis () const
 Interprets this node to a node of type Axis. More...
 
virtual Boolas_bool ()
 Interprets this node to a node of type Bool. More...
 
virtual const Boolas_bool () const
 Interprets this node to a node of type Bool. More...
 
virtual Complexas_complex ()
 Interprets this node to a node of type Complex. More...
 
virtual const Complexas_complex () const
 Interprets this node to a node of type Complex. More...
 
virtual Intas_int ()
 Interprets this node to a node of type Int. More...
 
virtual const Intas_int () const
 Interprets this node to a node of type Int. More...
 
virtual Jsonas_json ()
 Interprets this node to a node of type Json. More...
 
virtual const Jsonas_json () const
 Interprets this node to a node of type Json. More...
 
virtual Qubitas_qubit ()
 Interprets this node to a node of type Qubit. More...
 
virtual const Qubitas_qubit () const
 Interprets this node to a node of type Qubit. More...
 
virtual Realas_real ()
 Interprets this node to a node of type Real. More...
 
virtual const Realas_real () const
 Interprets this node to a node of type Real. More...
 
virtual RealMatrixas_real_matrix ()
 Interprets this node to a node of type RealMatrix. More...
 
virtual const RealMatrixas_real_matrix () const
 Interprets this node to a node of type RealMatrix. More...
 
virtual Stringas_string ()
 Interprets this node to a node of type String. More...
 
virtual const Stringas_string () const
 Interprets this node to a node of type String. More...
 

Static Public Member Functions

static std::shared_ptr< ComplexMatrixdeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 
- Static Public Member Functions inherited from cqasm::v1::types::TypeBase
static std::shared_ptr< TypeBasedeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 
- Static Public Member Functions inherited from cqasm::v1::types::Node
static std::shared_ptr< Nodedeserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids)
 Deserializes the given node. More...
 

Public Attributes

cqasm::v1::primitives::Int num_rows
 Number of rows. More...
 
cqasm::v1::primitives::Int num_cols
 Number of columns. More...
 
- Public Attributes inherited from cqasm::v1::types::TypeBase
cqasm::v1::primitives::Bool assignable
 Whether a value of this type can be assigned (true), or can only be read (false). More...
 

Protected Member Functions

void visit_internal (VisitorBase &visitor, void *retval) override
 Helper method for visiting nodes. More...
 

Detailed Description

Type of a complex matrix.

Also used for one-dimensional arrays and vectors.

Definition at line 606 of file cqasm-v1-types-gen.hpp.

#include <cqasm-v1-types-gen.hpp>

Inheritance diagram for cqasm::v1::types::ComplexMatrix:
Inheritance graph
[legend]
Collaboration diagram for cqasm::v1::types::ComplexMatrix:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ ComplexMatrix()

Constructor.

Definition at line 626 of file cqasm-v1-types-gen.cpp.

Member Function Documentation

◆ find_reachable()

void cqasm::v1::types::ComplexMatrix::find_reachable ( ::tree::base::PointerMap &  map) const
override

Registers all reachable nodes with the given PointerMap.

Definition at line 633 of file cqasm-v1-types-gen.cpp.

◆ check_complete()

void cqasm::v1::types::ComplexMatrix::check_complete ( const ::tree::base::PointerMap &  map) const
override

Returns whether this ComplexMatrix is complete/fully defined.

Definition at line 640 of file cqasm-v1-types-gen.cpp.

◆ type()

NodeType cqasm::v1::types::ComplexMatrix::type ( ) const
overridevirtual

Returns the NodeType of this node.

Implements cqasm::v1::types::Node.

Definition at line 647 of file cqasm-v1-types-gen.cpp.

◆ visit_internal()

void cqasm::v1::types::ComplexMatrix::visit_internal ( VisitorBase visitor,
void *  retval 
)
overrideprotectedvirtual

Helper method for visiting nodes.

Implements cqasm::v1::types::Node.

Definition at line 654 of file cqasm-v1-types-gen.cpp.

◆ as_complex_matrix() [1/2]

ComplexMatrix * cqasm::v1::types::ComplexMatrix::as_complex_matrix ( )
overridevirtual

Interprets this node to a node of type ComplexMatrix.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::types::Node.

Definition at line 662 of file cqasm-v1-types-gen.cpp.

◆ as_complex_matrix() [2/2]

const ComplexMatrix * cqasm::v1::types::ComplexMatrix::as_complex_matrix ( ) const
overridevirtual

Interprets this node to a node of type ComplexMatrix.

Returns null if it has the wrong type.

Reimplemented from cqasm::v1::types::Node.

Definition at line 670 of file cqasm-v1-types-gen.cpp.

◆ copy()

One< Node > cqasm::v1::types::ComplexMatrix::copy ( ) const
overridevirtual

Returns a shallow copy of this node.

Implements cqasm::v1::types::Node.

Definition at line 677 of file cqasm-v1-types-gen.cpp.

◆ clone()

One< Node > cqasm::v1::types::ComplexMatrix::clone ( ) const
overridevirtual

Returns a deep copy of this node.

Implements cqasm::v1::types::Node.

Definition at line 684 of file cqasm-v1-types-gen.cpp.

◆ equals()

bool cqasm::v1::types::ComplexMatrix::equals ( const Node rhs) const
overridevirtual

Value-based equality operator.

Ignores annotations!

Implements cqasm::v1::types::Node.

Definition at line 692 of file cqasm-v1-types-gen.cpp.

◆ operator==()

bool cqasm::v1::types::ComplexMatrix::operator== ( const Node rhs) const
overridevirtual

Pointer-based equality operator.

Implements cqasm::v1::types::Node.

Definition at line 704 of file cqasm-v1-types-gen.cpp.

◆ serialize()

void cqasm::v1::types::ComplexMatrix::serialize ( ::tree::cbor::MapWriter &  map,
const ::tree::base::PointerMap &  ids 
) const
overridevirtual

Serializes this node to the given map.

Implements cqasm::v1::types::Node.

Definition at line 716 of file cqasm-v1-types-gen.cpp.

◆ deserialize()

std::shared_ptr< ComplexMatrix > cqasm::v1::types::ComplexMatrix::deserialize ( const ::tree::cbor::MapReader &  map,
::tree::base::IdentifierMap &  ids 
)
static

Deserializes the given node.

Writes a debug dump of this node to the given stream.

Definition at line 737 of file cqasm-v1-types-gen.cpp.

Member Data Documentation

◆ num_rows

cqasm::v1::primitives::Int cqasm::v1::types::ComplexMatrix::num_rows

Number of rows.

Negative indicates that the value is unconstrained. Must be one or more otherwise.

Definition at line 613 of file cqasm-v1-types-gen.hpp.

◆ num_cols

cqasm::v1::primitives::Int cqasm::v1::types::ComplexMatrix::num_cols

Number of columns.

Negative indicates that the value is unconstrained. Can be zero, unlike num_rows.

Definition at line 619 of file cqasm-v1-types-gen.hpp.


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