.. index:: pair: class; aux::Gradient .. _doxid-classaux_1_1_gradient: class aux::Gradient =================== .. toctree:: :hidden: Overview ~~~~~~~~ Methods to calculate gradients (derivatives) with respect to different directions. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Gradient { public: // construction :target:`Gradient`(); virtual :target:`~Gradient`(); // methods void :ref:`calculateDerivativesSameDim`(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const :ref:`gpr::AtomsConfiguration`& conf_info, const :ref:`gpr::FieldMatrixd`& lengthScale, const :ref:`gpr::FieldMatrixIdx`& dims, uint8_t calc_options, :ref:`gpr::Derivatives``>>& derivatives, :ref:`gpr::Derivatives``>>& derivatives_pt); void :ref:`setFarFieldRadius`(double radius); double :target:`farFieldRadius`() const; void :ref:`calculateDerivativesDiffDim`(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const :ref:`gpr::AtomsConfiguration`& conf_info, const :ref:`gpr::FieldMatrixd`& lengthScale, const :ref:`gpr::FieldMatrixIdx`& dims1, const :ref:`gpr::FieldMatrixIdx`& dims2, const uint8_t calc_options, const uint8_t direction_x2, :ref:`gpr::Derivatives``>>& derivatives, :ref:`gpr::Derivatives``>>& derivatives_pt); }; .. _details-classaux_1_1_gradient: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods to calculate gradients (derivatives) with respect to different directions. Methods ------- .. index:: pair: function; calculateDerivativesSameDim .. _doxid-classaux_1_1_gradient_1af224c54c1a5914db3f64560568760e8c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateDerivativesSameDim(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const :ref:`gpr::AtomsConfiguration`& conf_info, const :ref:`gpr::FieldMatrixd`& lengthScale, const :ref:`gpr::FieldMatrixIdx`& dims, uint8_t calc_options, :ref:`gpr::Derivatives``>>& derivatives, :ref:`gpr::Derivatives``>>& derivatives_pt) Evaluate gradient of covariance function with respect to both input variables x and x2 (in same dimension). The *first* member of *derivatives* will contain a vector of fields for every derivative calculated for *x* (analog of D1). The *second* member of *derivatives* will contain derivatives calculated for active pairtypes. .. warning:: derivatives_pt sums every coordinate named in ``dims``. derivatives.D1/D2/D12 hold one block per coordinate. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x1 - Matrix of gpr::Coordinates * - x2 - Matrix of gpr::Coordinates * - conf_info - Configuration data for the GP model * - lengthScale - Length-scale * - dims - Derivative dimensions evaluated for both inputs * - calc_options - Determines which derivative to calculate (D1, D2, D12) * - derivatives - Output derivative fields (one block per coordinate) * - derivatives_pt - Output derivatives for active pair types .. index:: pair: function; setFarFieldRadius .. _doxid-classaux_1_1_gradient_1a05c043312cffc26d0b0566a1c85bd5de: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFarFieldRadius(double radius) Same radius convention as :ref:`Distance::setFarFieldRadius `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - radius - Far-field radius. .. index:: pair: function; calculateDerivativesDiffDim .. _doxid-classaux_1_1_gradient_1af1c7bb2ec5583795bc166fef634cf63f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void calculateDerivativesDiffDim(const :ref:`gpr::Coord`& x1, const :ref:`gpr::Coord`& x2, const :ref:`gpr::AtomsConfiguration`& conf_info, const :ref:`gpr::FieldMatrixd`& lengthScale, const :ref:`gpr::FieldMatrixIdx`& dims1, const :ref:`gpr::FieldMatrixIdx`& dims2, const uint8_t calc_options, const uint8_t direction_x2, :ref:`gpr::Derivatives``>>& derivatives, :ref:`gpr::Derivatives``>>& derivatives_pt) Evaluate gradient of covariance function, of which has been taken partial derivatives with respect to both input variables x and x2 with respect to parameters (if specified). .. warning:: derivatives_pt sums every coordinate pair named by ``dims1`` and ``dims2``. derivatives.D1/D2/D12 hold one block per pair. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - x1 - Matrix of gpr::Coordinates * - x2 - Matrix of gpr::Coordinates * - conf_info - Configuration data for the GP model * - lengthScale - Length-scale * - dims1 - Coordinate-dimension indices differentiated in ``x1``. * - dims2 - Coordinate-dimension indices differentiated in ``x2``. * - calc_options - General type of the options to be calculated * - direction_x2 - Direction for the derivative calculation for *x2* field. * - derivatives - Field of derivatives calculated at each *dims* (one block per coordinate) * - derivatives_pt - Field of pairtype derivatives