Kernel Quantum Probability Library
The KQP library aims at providing tools for working with quantums probabilities
Public Member Functions | Data Fields
kqp::Decomposition< Scalar > Class Template Reference

#include <decomposition.hpp>

Public Member Functions

 KQP_SCALAR_TYPEDEFS (Scalar)
 
 Decomposition ()
 Default constructor with an undefined feature space.
 
 Decomposition (const FSpaceCPtr &fs)
 Default constructor with a feature space.
 
 Decomposition (const FSpaceCPtr &fs, const FMatrixCPtr &mX, const ScalarAltMatrix &mY, const RealAltVector &mD, bool orthonormal, bool squareRoot)
 Full constructor.
 
 Decomposition (FSpaceCPtr &&fs, FMatrixPtr &&mX, const ScalarAltMatrix &&mY, const RealAltVector &&mD, bool orthonormal, bool squareRoot)
 Move constructor.
 
 Decomposition (Decomposition &&other)
 Move constructor.
 
Decompositionoperator= (Decomposition &&other)
 Move assignement.
 
void take (Decomposition &other)
 
 Decomposition (const Decomposition &other)
 Copy constructor.
 
Decompositionoperator= (const Decomposition &other)
 Copy assignement.
 
ScalarMatrix k (const Decomposition &other) const
 
bool check () const
 
Index rank () const
 
Index preimagesCount () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
bool isOrthonormal () const
 
bool isSquareRoot () const
 
void squareRoot (bool mode)
 Change the type of representation.
 
void orthonormalize ()
 Orthonormalize the decomposition (non const version)
 
void multiplyBy (Real alpha)
 Multiply the operator by a real value.
 
Real trace () const
 Computes the trace of the operator.
 
void traceNormalize ()
 Normalize by dividing by the trace.
 

Data Fields

FSpaceCPtr fs
 Feature space.
 
FMatrixPtr mX
 The feature matrix.
 
ScalarAltMatrix mY
 The linear combination matrix.
 
RealAltVector mD
 The diagonal matrix.
 
bool orthonormal
 If this is a real decomposition.
 
bool m_squareRoot
 Square root representation ?
 
Index updateCount
 Number of rank updates.
 

Detailed Description

template<typename Scalar>
class kqp::Decomposition< Scalar >

A decomposition: holds three matrices X, Y and D

The operator is \( XYDY^TX^T\) or \( XYD^2Y^TX^T \) (square root mode)

Member Function Documentation

template<typename Scalar>
bool kqp::Decomposition< Scalar >::check ( ) const
inline

Check that the decomposition is valid

template<typename Scalar>
ScalarMatrix kqp::Decomposition< Scalar >::k ( const Decomposition< Scalar > &  other) const
inline

Computes \( D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2 \)

template<typename Scalar>
template<class Archive >
void kqp::Decomposition< Scalar >::serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the matrices


The documentation for this class was generated from the following file: