class aux::Gradient¶
Overview¶
Methods to calculate gradients (derivatives) with respect to different directions. More…
#include <Gradient.h>
class Gradient {
public:
// construction
Gradient();
virtual ~Gradient();
// methods
void calculateDerivativesSameDim(const gpr::Coord& x1, const gpr::Coord& x2, const gpr::AtomsConfiguration& conf_info, const gpr::FieldMatrixd& lengthScale, const gpr::FieldMatrixIdx& dims, uint8_t calc_options, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives_pt);
void calculateDerivativesDiffDim(const gpr::Coord& x1, const gpr::Coord& x2, const gpr::AtomsConfiguration& conf_info, const gpr::FieldMatrixd& lengthScale, const gpr::FieldMatrixIdx& dims1, const gpr::FieldMatrixIdx& dims2, const uint8_t calc_options, const uint8_t direction_x2, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives_pt);
};
Detailed Documentation¶
Methods to calculate gradients (derivatives) with respect to different directions.
Methods¶
void calculateDerivativesSameDim(const gpr::Coord& x1, const gpr::Coord& x2, const gpr::AtomsConfiguration& conf_info, const gpr::FieldMatrixd& lengthScale, const gpr::FieldMatrixIdx& dims, uint8_t calc_options, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& 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.
Parameters:
derivatives |
Pair with the result. |
x1 |
Matrix of gpr::Coordinates |
x2 |
Matrix of gpr::Coordinates |
conf_info |
Configuration data for the GP model |
lengthScale |
Length-scale |
dims |
Dimensions for x1 and x2 (???) |
calc_options |
Determines which derivative to calculate (D1, D2, D12) |
derivatives |
Field of derivatives calculated at each dims |
derivatives_pt |
Field of pairtype derivatives |
void calculateDerivativesDiffDim(const gpr::Coord& x1, const gpr::Coord& x2, const gpr::AtomsConfiguration& conf_info, const gpr::FieldMatrixd& lengthScale, const gpr::FieldMatrixIdx& dims1, const gpr::FieldMatrixIdx& dims2, const uint8_t calc_options, const uint8_t direction_x2, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& derivatives, gpr::Derivatives<std::vector<gpr::FieldMatrixd>>& 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).
Parameters:
x1 |
Matrix of gpr::Coordinates |
x2 |
Matrix of gpr::Coordinates |
conf_info |
Configuration data for the GP model |
lengthScale |
Length-scale |
dims1 |
Dimensions for x1 (???) |
dims2 |
Dimensions for 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 |
derivatives_pt |
Field of pairtype derivatives |