.. index:: pair: class; QPanda::Variational::var .. _doxid-class_q_panda_1_1_variational_1_1var: class QPanda::Variational::var ============================== .. toctree:: :hidden: Overview ~~~~~~~~ The class denotes the variable. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class var { public: // fields std::shared_ptr<:ref:`impl`> :target:`pimpl`; // construction :ref:`var`(std::shared_ptr<:ref:`impl`>); :ref:`var`(double); :ref:`var`(const MatrixXd&); :target:`var`( double, bool ); :target:`var`( const MatrixXd&, bool ); :ref:`var`(:ref:`op_type` op, const std::vector& children); :ref:`var`(var&&); :target:`var`(const var&); // methods var& :ref:`operator =` (var&&); var& :target:`operator =` (const var&); var :target:`clone`(); virtual size_t :target:`getNumOpArgs`(); MatrixXd :target:`getValue`() const; void :target:`setValue`(const MatrixXd&); :ref:`op_type` :target:`getOp`() const; void :target:`setOp`(:ref:`op_type`); std::vector& :target:`getChildren`() const; std::vector :target:`getParents`() const; long :target:`getUseCount`() const; bool :target:`getValueType`() const; MatrixXd :target:`_eval`(); MatrixXd :target:`_back_single`( const MatrixXd& dx, size_t op_idx ); std::vector :target:`_back`( const MatrixXd& dx, const std::unordered_set& nonconsts ); std::vector :target:`_back`(const MatrixXd& dx); bool :target:`operator ==` (const var& rhs) const; const var :target:`operator []` (int subscript); }; .. _details-class_q_panda_1_1_variational_1_1var: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The class denotes the variable. Construction ------------ .. index:: pair: function; var .. _doxid-class_q_panda_1_1_variational_1_1var_1a2be836e1cd4206b85b1afaf7be47b00e: .. ref-code-block:: cpp :class: doxyrest-title-code-block var(std::shared_ptr<:ref:`impl`>) Construct a new var object by the impl object. .. index:: pair: function; var .. _doxid-class_q_panda_1_1_variational_1_1var_1a85b2b8873157bd60d8074fea72634e8d: .. ref-code-block:: cpp :class: doxyrest-title-code-block var(double) Construct a new var object by a double. .. index:: pair: function; var .. _doxid-class_q_panda_1_1_variational_1_1var_1abfaa969c16de32bbc5c61898a9bfecf1: .. ref-code-block:: cpp :class: doxyrest-title-code-block var(const MatrixXd&) Construct a new var object by a Eigen matrix. .. index:: pair: function; var .. _doxid-class_q_panda_1_1_variational_1_1var_1a47c3186c59ecefc5d8ae7d884b6eee95: .. ref-code-block:: cpp :class: doxyrest-title-code-block var(:ref:`op_type` op, const std::vector& children) Construct a new var object by the operator type and children. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - op - operator type * - children - children of the operator. For example, c = a + b. c is a and b's parent, a and b are c's children .. index:: pair: function; var .. _doxid-class_q_panda_1_1_variational_1_1var_1a796ed20b2ee9d5ec2217199ebb0d8eb8: .. ref-code-block:: cpp :class: doxyrest-title-code-block var(var&&) move constructor of var Methods ------- .. index:: pair: function; operator= .. _doxid-class_q_panda_1_1_variational_1_1var_1af7babc0a6551403b34e617a2f70fa6be: .. ref-code-block:: cpp :class: doxyrest-title-code-block var& operator = (var&&) .. rubric:: Returns: var&