Kernel Quantum Probability Library
The KQP library aims at providing tools for working with quantums probabilities
Public Member Functions | Protected Member Functions | Protected Attributes
kqp::UnaryKernelSpace< Scalar > Class Template Referenceabstract
Inheritance diagram for kqp::UnaryKernelSpace< Scalar >:
kqp::SpaceBase< Scalar > kqp::AbstractSpace kqp::GaussianSpace< Scalar > kqp::PolynomialSpace< Scalar >

Public Member Functions

 KQP_SCALAR_TYPEDEFS (Scalar)
 
 UnaryKernelSpace (const FSpacePtr &base)
 
virtual FMatrixBasePtr newMatrix () const override
 Creates a new feature matrix.
 
virtual const ScalarMatrix & k (const FMatrixBase &mX) const override
 Gram matrix.
 
virtual void load (const picojson::object &json)
 
virtual picojson::object save () const override
 Save in JSON.
 
FSpaceCPtr base () const
 
virtual int numberOfKernelValues () const override
 
- Public Member Functions inherited from kqp::SpaceBase< Scalar >
 KQP_SCALAR_TYPEDEFS (Scalar)
 
virtual Index dimension () const =0
 Dimension of the underlying space (-1 for infinity)
 
virtual boost::shared_ptr
< SpaceBase< Scalar > > 
copy () const =0
 Copy.
 
virtual ScalarMatrix k (const FMatrixBase &mX, const ScalarAltMatrix &mY, const RealAltVector &mD) const
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
virtual ScalarMatrix k (const FMatrixBase &mX1, const ScalarAltMatrix &mY1, const RealAltVector &mD1, const FMatrixBase &mX2, const ScalarAltMatrix &mY2, const RealAltVector &mD2) const =0
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
ScalarMatrix k (const FMatrixBase &mX1, const ScalarAltMatrix &mY1, const FMatrixBase &mX2, const ScalarAltMatrix &mY2) const
 Inner products \(Y_1^\dagger X_1^\dagger X_2 Y_2\).
 
ScalarMatrix k (const FMatrixBase &mX1, const FMatrixBase &mX2) const
 Inner products \(X_1^\dagger X_2\).
 
virtual void updatePartials (Real, std::vector< Real > &, int, const std::vector< KernelValues< Scalar > > &, int, int) const
 Update the partials.
 
void updatePartials (Real alpha, std::vector< Real > &partials, const std::vector< KernelValues< Scalar > > &kernelValues, int mode) const
 
virtual void update (std::vector< KernelValues< Scalar > > &, int=0) const
 
virtual int numberOfParameters (bool) const
 
virtual void getBounds (bool, std::vector< Real > &, std::vector< Real > &, int=0) const
 
virtual void getParameters (bool, std::vector< Real > &, int=0) const
 
virtual void setParameters (bool, const std::vector< Real > &, int=0)
 
virtual int getNumberOfConstraints (bool) const
 
virtual void getConstraints (bool, std::vector< Real > &, int=0) const
 
virtual FMatrixBasePtr linearCombination (const FMatrixBase &, const ScalarAltMatrix &, Scalar, const FMatrixBase *, const ScalarAltMatrix *, Scalar) const
 Linear combination of pre-images \( \alpha X A + \beta Y B \).
 
template<typename T >
const T & as () const
 
template<typename T >
T & as ()
 
template<typename T >
bool castable_as () const
 
const ScalarMatrix & k (const FMatrixCPtr &mX) const
 Gram matrix.
 
ScalarMatrix k (const FMatrixCPtr &mX, const ScalarAltMatrix &mY, const RealAltVector &mD) const
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
ScalarMatrix k (const FMatrixCPtr &mX, const ScalarAltMatrix &mY) const
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
ScalarMatrix k (const FMatrixBase &mX, const ScalarAltMatrix &mY) const
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
ScalarMatrix k (const FMatrixCPtr &mX1, const ScalarAltMatrix &mY1, const RealAltVector &mD1, const FMatrixCPtr &mX2, const ScalarAltMatrix &mY2, const RealAltVector &mD2) const
 Inner products \(D_1^\dagger Y_1^\dagger X_1^\dagger X_2 Y_2 D_2\).
 
ScalarMatrix k (const FMatrixCPtr &mX1, const ScalarAltMatrix &mY1, const FMatrixCPtr &mX2, const ScalarAltMatrix &mY2) const
 Inner product \(X_1^\dagger X_2\).
 
ScalarMatrix k (const FMatrixCPtr &mX1, const FMatrixCPtr &mX2) const
 Inner product \(X_1^\dagger X_2\).
 
bool canLinearlyCombine () const
 Returns whether the pre-images can be linearly combined.
 
FMatrixPtr linearCombination (const FMatrixBase &mX, const ScalarAltMatrix &mA, Scalar alpha, const FMatrixBase &mY, const ScalarAltMatrix &mB, Scalar beta) const
 Linear combination of the feature vectors.
 
FMatrixPtr linearCombination (const FMatrixBase &mX, const ScalarAltMatrix &mA, Scalar alpha=(Scalar) 1) const
 Linear combination of the feature vectors.
 
FMatrixPtr linearCombination (const FMatrixCPtr &mX, const ScalarAltMatrix &mA, Scalar alpha=(Scalar) 1) const
 
void setUseLinearCombination (bool flag)
 Sets the flag for linear combination use (debug)
 
std::string demangle () const
 
- Public Member Functions inherited from kqp::AbstractSpace
virtual const std::string & name () const =0
 Name of the space.
 

Protected Member Functions

virtual void fillGram (ScalarMatrix &gram, Index tofill, const FMatrixBase &mX) const =0
 Fill a part of the Gram matrix.
 
- Protected Member Functions inherited from kqp::SpaceBase< Scalar >
virtual bool _canLinearlyCombine () const
 Returns whether the pre-images can be linearly combined (false by default)
 

Protected Attributes

FSpacePtr m_base
 The base feature space.
 

Additional Inherited Members

- Static Public Member Functions inherited from kqp::SpaceBase< Scalar >
static int & counter ()
 

Member Function Documentation

template<typename Scalar >
virtual void kqp::UnaryKernelSpace< Scalar >::fillGram ( ScalarMatrix &  gram,
Index  tofill,
const FMatrixBase &  mX 
) const
protectedpure virtual

Fill a part of the Gram matrix.

Fill the right columns (tofill) of a Gram matrix

Implemented in kqp::PolynomialSpace< Scalar >, and kqp::GaussianSpace< Scalar >.

template<typename Scalar >
virtual void kqp::UnaryKernelSpace< Scalar >::load ( const picojson::object &  json)
inlinevirtual

Load from JSON

Parameters
nodeThe node to load

Implements kqp::AbstractSpace.

Reimplemented in kqp::PolynomialSpace< Scalar >, and kqp::GaussianSpace< Scalar >.

template<typename Scalar >
virtual int kqp::UnaryKernelSpace< Scalar >::numberOfKernelValues ( ) const
inlineoverridevirtual

Returns the number of stored kernel values for this kernel

Reimplemented from kqp::SpaceBase< Scalar >.


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