Kernel Quantum Probability Library
The KQP library aims at providing tools for working with quantums probabilities
Public Types | Public Member Functions | Static Public Member Functions
kqp::SparseDenseSpace< Scalar > Class Template Reference
Inheritance diagram for kqp::SparseDenseSpace< Scalar >:
kqp::SpaceBase< Scalar > kqp::AbstractSpace

Public Types

typedef SparseDenseSpace< Scalar > Self
 

Public Member Functions

 KQP_SPACE_TYPEDEFS ("sparse-dense", Scalar)
 
 SparseDenseSpace (Index dimension)
 
Index dimension () const override
 Dimension of the underlying space (-1 for infinity)
 
void dimension (Index dimension)
 
virtual FSpacePtr copy () const override
 Copy.
 
virtual FMatrixBasePtr newMatrix () const override
 Creates a new feature matrix.
 
virtual FMatrixBasePtr newMatrix (const FMatrixBase &mX) const override
 
virtual bool _canLinearlyCombine () const override
 Returns whether the pre-images can be linearly combined (false by default)
 
const ScalarMatrix & k (const FeatureMatrixBase< Scalar > &mX) const override
 
virtual ScalarMatrix k (const FeatureMatrixBase< Scalar > &mX1, const ScalarAltMatrix &mY1, const RealAltVector &mD1, const FeatureMatrixBase< Scalar > &mX2, const ScalarAltMatrix &mY2, const RealAltVector &mD2) const override
 
virtual FMatrixBasePtr linearCombination (const FeatureMatrixBase< Scalar > &mX, const ScalarAltMatrix &mA, Scalar alpha, const FeatureMatrixBase< Scalar > *mY, const ScalarAltMatrix *mB, Scalar beta) const override
 
virtual void load (const picojson::object &json) override
 
virtual picojson::object save () const override
 Save in JSON.
 
- Public Member Functions inherited from kqp::SpaceBase< Scalar >
 KQP_SCALAR_TYPEDEFS (Scalar)
 
virtual const ScalarMatrix & k (const FMatrixBase &mX) const =0
 Gram matrix.
 
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 int numberOfKernelValues () 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.
 

Static Public Member Functions

static FSpacePtr create (Index dimension)
 
static const SparseDense
< Scalar > & 
cast (const FeatureMatrixBase< Scalar > &mX)
 
- Static Public Member Functions inherited from kqp::SpaceBase< Scalar >
static int & counter ()
 

Member Function Documentation

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

Load from JSON

Parameters
nodeThe node to load

Implements kqp::AbstractSpace.


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