libqasm
library for handling cQASM files
|
Represents a value of type complex. More...
Public Member Functions | |
ConstComplex (const cqasm::v1::primitives::Complex &value=cqasm::v1::primitives::initialize< cqasm::v1::primitives::Complex >()) | |
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 ConstComplex is complete/fully defined. More... | |
NodeType | type () const override |
Returns the NodeType of this node. More... | |
ConstComplex * | as_const_complex () override |
Interprets this node to a node of type ConstComplex. More... | |
const ConstComplex * | as_const_complex () const override |
Interprets this node to a node of type ConstComplex. More... | |
One< Node > | copy () const override |
Returns a shallow copy of this node. More... | |
One< Node > | clone () 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... | |
![]() | |
Constant * | as_constant () override |
Interprets this node to a node of type Constant. More... | |
const Constant * | as_constant () const override |
Interprets this node to a node of type Constant. More... | |
![]() | |
bool | operator!= (const Node &rhs) const |
Pointer-based inequality operator. More... | |
template<typename T > | |
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 BitRefs * | as_bit_refs () |
Interprets this node to a node of type BitRefs. More... | |
virtual const BitRefs * | as_bit_refs () const |
Interprets this node to a node of type BitRefs. More... | |
virtual ConstAxis * | as_const_axis () |
Interprets this node to a node of type ConstAxis. More... | |
virtual const ConstAxis * | as_const_axis () const |
Interprets this node to a node of type ConstAxis. More... | |
virtual ConstBool * | as_const_bool () |
Interprets this node to a node of type ConstBool. More... | |
virtual const ConstBool * | as_const_bool () const |
Interprets this node to a node of type ConstBool. More... | |
virtual ConstComplexMatrix * | as_const_complex_matrix () |
Interprets this node to a node of type ConstComplexMatrix. More... | |
virtual const ConstComplexMatrix * | as_const_complex_matrix () const |
Interprets this node to a node of type ConstComplexMatrix. More... | |
virtual ConstInt * | as_const_int () |
Interprets this node to a node of type ConstInt. More... | |
virtual const ConstInt * | as_const_int () const |
Interprets this node to a node of type ConstInt. More... | |
virtual ConstJson * | as_const_json () |
Interprets this node to a node of type ConstJson. More... | |
virtual const ConstJson * | as_const_json () const |
Interprets this node to a node of type ConstJson. More... | |
virtual ConstReal * | as_const_real () |
Interprets this node to a node of type ConstReal. More... | |
virtual const ConstReal * | as_const_real () const |
Interprets this node to a node of type ConstReal. More... | |
virtual ConstRealMatrix * | as_const_real_matrix () |
Interprets this node to a node of type ConstRealMatrix. More... | |
virtual const ConstRealMatrix * | as_const_real_matrix () const |
Interprets this node to a node of type ConstRealMatrix. More... | |
virtual ConstString * | as_const_string () |
Interprets this node to a node of type ConstString. More... | |
virtual const ConstString * | as_const_string () const |
Interprets this node to a node of type ConstString. More... | |
virtual Function * | as_function () |
Interprets this node to a node of type Function. More... | |
virtual const Function * | as_function () const |
Interprets this node to a node of type Function. More... | |
virtual QubitRefs * | as_qubit_refs () |
Interprets this node to a node of type QubitRefs. More... | |
virtual const QubitRefs * | as_qubit_refs () const |
Interprets this node to a node of type QubitRefs. More... | |
virtual Reference * | as_reference () |
Interprets this node to a node of type Reference. More... | |
virtual const Reference * | as_reference () const |
Interprets this node to a node of type Reference. More... | |
virtual VariableRef * | as_variable_ref () |
Interprets this node to a node of type VariableRef. More... | |
virtual const VariableRef * | as_variable_ref () const |
Interprets this node to a node of type VariableRef. More... | |
Static Public Member Functions | |
static std::shared_ptr< ConstComplex > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< Constant > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< Node > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
Public Attributes | |
cqasm::v1::primitives::Complex | value |
The contained value. More... | |
Protected Member Functions | |
void | visit_internal (VisitorBase &visitor, void *retval) override |
Helper method for visiting nodes. More... | |
Represents a value of type complex.
Definition at line 713 of file cqasm-v1-values-gen.hpp.
#include <cqasm-v1-values-gen.hpp>
cqasm::v1::values::ConstComplex::ConstComplex | ( | const cqasm::v1::primitives::Complex & | value = cqasm::v1::primitives::initialize<cqasm::v1::primitives::Complex>() | ) |
Constructor.
Definition at line 716 of file cqasm-v1-values-gen.cpp.
|
override |
Registers all reachable nodes with the given PointerMap.
Definition at line 723 of file cqasm-v1-values-gen.cpp.
|
override |
Returns whether this ConstComplex
is complete/fully defined.
Definition at line 730 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Returns the NodeType
of this node.
Implements cqasm::v1::values::Node.
Definition at line 737 of file cqasm-v1-values-gen.cpp.
|
overrideprotectedvirtual |
Helper method for visiting nodes.
Implements cqasm::v1::values::Node.
Definition at line 744 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Interprets this node to a node of type ConstComplex.
Returns null if it has the wrong type.
Reimplemented from cqasm::v1::values::Node.
Definition at line 752 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Interprets this node to a node of type ConstComplex.
Returns null if it has the wrong type.
Reimplemented from cqasm::v1::values::Node.
Definition at line 760 of file cqasm-v1-values-gen.cpp.
Returns a shallow copy of this node.
Implements cqasm::v1::values::Node.
Definition at line 767 of file cqasm-v1-values-gen.cpp.
Returns a deep copy of this node.
Implements cqasm::v1::values::Node.
Definition at line 774 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Value-based equality operator.
Ignores annotations!
Implements cqasm::v1::values::Node.
Definition at line 782 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Pointer-based equality operator.
Implements cqasm::v1::values::Node.
Definition at line 792 of file cqasm-v1-values-gen.cpp.
|
overridevirtual |
Serializes this node to the given map.
Implements cqasm::v1::values::Node.
Definition at line 802 of file cqasm-v1-values-gen.cpp.
|
static |
Deserializes the given node.
Writes a debug dump of this node to the given stream.
Definition at line 817 of file cqasm-v1-values-gen.cpp.
cqasm::v1::primitives::Complex cqasm::v1::values::ConstComplex::value |
The contained value.
Definition at line 719 of file cqasm-v1-values-gen.hpp.