DesignMatrix

template<typename Mode>
class DesignMatrix

Design Matrix \( \Phi \) and the corresponding target vector \( \mathrm{T} \)

An aggregation matrix composed of \phi_i matrices

Phi = | \phi_1 |
      | \phi_2 |
      | ...    |
      | \phi_N |
where N corresponds to the number of structures in a provided StructureDB.

The ordering in \( \phi_i \)

| energy of the 1st structure
| force on the 1st atom in the x-dir
| force on the 1st atom in the y-dir
| force on the 1st atom in the z-dir
| force on the 2st atom in the x-dir
| ...
| force on the n-th atom in the z-dir
| stress xx
| stress xy
| stress xz
| stress yy
| stress yz
| stress zz
We need to know: STRESS, FORCE

Scalling factors FWEIGHT, SWEIGHT

Default scalling:

  • Forces are scaled by 1/N_i/3 where N_i is a number of atoms in the i-th structure.

  • Stresses are scaled by 1/6.

  • Energies are scaled by 1/N_i

Template Parameters:

ModeFunc_Base child -> BF_Base or Kern_Base

Public Functions

inline DesignMatrix(Mode &bf, Config &c)

This constructor fully initialise this object.

This class is used to build a Design Matrix.

Usage example:

Config config("Config");
BF_Linear bf(config);
DesignMatrix<LinearKernel> desmat(bf, config);

inline void build(StDescriptorsDB &st_desc_db, const StructureDB &stdb)

Build design matrix from already calculated StDescriptorsDB.

Here we simply build matrix from already calculated descriptors. The vector of targets T is build from StructureDB. D2, D3 and DM calculators are not used.

template<typename DC>
inline void build(const StructureDB &stdb, Normaliser &norm, DC &dc)

Calculate descriptors and build design matrix.