Tapkee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
projection.hpp
Go to the documentation of this file.
1 /* This software is distributed under BSD 3-clause license (see LICENSE file).
2  *
3  * Copyright (c) 2012-2013 Sergey Lisitsyn, Fernando Iglesias
4  */
5 
6 #ifndef TAPKEE_PROJECTION_H_
7 #define TAPKEE_PROJECTION_H_
8 
9 namespace tapkee
10 {
11 
14 {
16  {
17  }
21  virtual DenseVector project(const DenseVector& vec) = 0;
22 };
23 
26 {
30  void clear()
31  {
32  delete implementation;
33  }
37  inline DenseVector operator()(const DenseVector& vec)
38  {
39  return implementation->project(vec);
40  }
42 };
43 
47 {
49  {
50  }
51 
53  {
54  }
55 
56  virtual DenseVector project(const DenseVector& vec)
57  {
58  return proj_mat*(vec-mean_vec);
59  }
60 
63 };
64 
65 }
66 #endif
Eigen::Matrix< tapkee::ScalarType, Eigen::Dynamic, Eigen::Dynamic > DenseMatrix
dense matrix type (non-overridable)
Definition: types.hpp:23
ProjectionImplementation * implementation
Definition: projection.hpp:41
virtual DenseVector project(const DenseVector &vec)
Projects provided vector to new space.
Definition: projection.hpp:56
ProjectingFunction(ProjectionImplementation *impl)
Definition: projection.hpp:28
A base class for implementation of projecting.
Definition: projection.hpp:13
DenseVector operator()(const DenseVector &vec)
Projects provided vector to new space.
Definition: projection.hpp:37
Eigen::Matrix< tapkee::ScalarType, Eigen::Dynamic, 1 > DenseVector
dense vector type (non-overridable)
Definition: types.hpp:21
A pimpl wrapper for projecting function.
Definition: projection.hpp:25
MatrixProjectionImplementation(DenseMatrix matrix, DenseVector mean)
Definition: projection.hpp:48
virtual DenseVector project(const DenseVector &vec)=0
Projects provided vector to new space.
Basic ProjectionImplementation that subtracts mean from the vector and multiplies projecting matrix w...
Definition: projection.hpp:46
void clear()
Destroys current implementation.
Definition: projection.hpp:30