SHOGUN  6.1.3
LinalgBackendEigen.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Shogun-Toolbox e.V. <shogun-team@shogun-toolbox.org>
3  * All rights reserved.
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * Authors: 2016 Pan Deng, Soumyajit De, Heiko Strathmann, Viktor Gal
31  */
32 
33 #ifndef LINALG_BACKEND_EIGEN_H__
34 #define LINALG_BACKEND_EIGEN_H__
35 
36 #include <numeric>
42 
43 namespace shogun
44 {
45 
48  {
49  public:
51 #define BACKEND_GENERIC_IN_PLACE_ADD(Type, Container) \
52  virtual void add( \
53  Container<Type>& a, Container<Type>& b, Type alpha, Type beta, \
54  Container<Type>& result) const;
57 #undef BACKEND_GENERIC_IN_PLACE_ADD
58 
60 #define BACKEND_GENERIC_ADD_COL_VEC(Type, Container) \
61  virtual void add_col_vec( \
62  const SGMatrix<Type>& A, index_t i, const SGVector<Type>& b, \
63  Container<Type>& result, Type alpha, Type beta) const;
66 #undef BACKEND_GENERIC_ADD_COL_VEC
67 
69 #define BACKEND_GENERIC_ADD(Type, Container) \
70  virtual void add_vector( \
71  const SGMatrix<Type>& A, const SGVector<Type>& b, \
72  SGMatrix<Type>& result, Type alpha, Type beta) const;
74 #undef BACKEND_GENERIC_ADD
75 
77 #define BACKEND_GENERIC_ADD_SCALAR(Type, Container) \
78  virtual void add_scalar(Container<Type>& a, Type b) const;
81 #undef BACKEND_GENERIC_ADD_SCALAR
82 
84 #define BACKEND_GENERIC_CENTER_MATRIX(Type, Container) \
85  virtual void center_matrix(Container<Type>& A) const;
87 #undef BACKEND_GENERIC_CENTER_MATRIX
88 
90 #define BACKEND_GENERIC_CHOLESKY_FACTOR(Type, Container) \
91  virtual Container<Type> cholesky_factor( \
92  const Container<Type>& A, const bool lower) const;
94 #undef BACKEND_GENERIC_CHOLESKY_FACTOR
95 
97 #define BACKEND_GENERIC_CHOLESKY_SOLVER(Type, Container) \
98  virtual SGVector<Type> cholesky_solver( \
99  const Container<Type>& L, const SGVector<Type>& b, const bool lower) \
100  const;
102 #undef BACKEND_GENERIC_CHOLESKY_SOLVER
103 
105 #define BACKEND_GENERIC_CROSS_ENTROPY(Type, Container) \
106  virtual Type cross_entropy( \
107  const Container<Type>& P, const Container<Type>& Q) const;
110 #undef BACKEND_GENERIC_CROSS_ENTROPY
111 
113 #define BACKEND_GENERIC_DOT(Type, Container) \
114  virtual Type dot(const Container<Type>& a, const Container<Type>& b) const;
116 #undef BACKEND_GENERIC_DOT
117 
119 #define BACKEND_GENERIC_EIGEN_SOLVER(Type, Container) \
120  virtual void eigen_solver( \
121  const Container<Type>& A, SGVector<Type>& eigenvalues, \
122  SGMatrix<Type>& eigenvectors) const;
124 #undef BACKEND_GENERIC_EIGEN_SOLVER
125 
127 #define BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC(Type, Container) \
128  virtual void eigen_solver_symmetric( \
129  const Container<Type>& A, SGVector<Type>& eigenvalues, \
130  SGMatrix<Type>& eigenvectors, index_t k) const;
133 #undef BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC
134 
136 #define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD(Type, Container) \
137  virtual void element_prod( \
138  Container<Type>& a, Container<Type>& b, Container<Type>& result) \
139  const;
141 #undef BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD
142 
144 #define BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD(Type, Container) \
145  virtual void element_prod( \
146  linalg::Block<Container<Type>>& a, linalg::Block<Container<Type>>& b, \
147  Container<Type>& result) const;
150 #undef BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD
151 
153 #define BACKEND_GENERIC_EXPONENT(Type, Container) \
154  virtual void exponent(const Container<Type>& a, Container<Type>& result) \
155  const
158 #undef BACKEND_GENERIC_EXPONENT
159 
161 #define BACKEND_GENERIC_IDENTITY(Type, Container) \
162  virtual void identity(Container<Type>& identity_matrix) const;
164 #undef BACKEND_GENERIC_IDENTITY
165 
167 #define BACKEND_GENERIC_LOGISTIC(Type, Container) \
168  virtual void logistic(Container<Type>& a, Container<Type>& result) const;
170 #undef BACKEND_GENERIC_LOGISTIC
171 
173 #define BACKEND_GENERIC_IN_PLACE_MATRIX_PROD(Type, Container) \
174  virtual void matrix_prod( \
175  SGMatrix<Type>& a, Container<Type>& b, Container<Type>& result, \
176  bool transpose_A, bool transpose_B) const;
179 #undef BACKEND_GENERIC_IN_PLACE_MATRIX_PROD
180 
182 #define BACKEND_GENERIC_MAX(Type, Container) \
183  virtual Type max(const Container<Type>& a) const;
186 #undef BACKEND_GENERIC_MAX
187 
189 #define BACKEND_GENERIC_REAL_MEAN(Type, Container) \
190  virtual float64_t mean(const Container<Type>& a) const;
193 #undef BACKEND_GENERIC_REAL_MEAN
194 
196 #define BACKEND_GENERIC_COMPLEX_MEAN(Container) \
197  virtual complex128_t mean(const Container<complex128_t>& a) const;
200 #undef BACKEND_GENERIC_COMPLEX_MEAN
201 
203 #define BACKEND_GENERIC_MULTIPLY_BY_LOGISTIC_DERIV(Type, Container) \
204  virtual void multiply_by_logistic_derivative( \
205  Container<Type>& a, Container<Type>& result) const;
208 #undef BACKEND_GENERIC_MULTIPLY_BY_LOGISTIC_DERIV
209 
211 #define BACKEND_GENERIC_MULTIPLY_BY_RECTIFIED_LINEAR_DERIV(Type, Container) \
212  virtual void multiply_by_rectified_linear_derivative( \
213  Container<Type>& a, Container<Type>& result) const;
216 #undef BACKEND_GENERIC_MULTIPLY_BY_RECTIFIED_LINEAR_DERIV
217 
219 #define BACKEND_GENERIC_QR_SOLVER(Type, Container) \
220  virtual Container<Type> qr_solver( \
221  const SGMatrix<Type>& A, const Container<Type>& b) const;
224 #undef BACKEND_GENERIC_QR_SOLVER
225 
227 #define BACKEND_GENERIC_RANGE_FILL(Type, Container) \
228  virtual void range_fill(Container<Type>& a, const Type start) const;
231 #undef BACKEND_GENERIC_RANGE_FILL
232 
234 #define BACKEND_GENERIC_RECTIFIED_LINEAR(Type, Container) \
235  virtual void rectified_linear(Container<Type>& a, Container<Type>& result) \
236  const;
238 #undef BACKEND_GENERIC_RECTIFIED_LINEAR
239 
241 #define BACKEND_GENERIC_IN_PLACE_SCALE(Type, Container) \
242  virtual void scale( \
243  Container<Type>& a, Type alpha, Container<Type>& result) const;
246 #undef BACKEND_GENERIC_IN_PLACE_SCALE
247 
249 #define BACKEND_GENERIC_SET_CONST(Type, Container) \
250  virtual void set_const(Container<Type>& a, const Type value) const;
253 #undef BACKEND_GENERIC_SET_CONST
254 
256 #define BACKEND_GENERIC_SOFTMAX(Type, Container) \
257  virtual void softmax(Container<Type>& a) const;
259 #undef BACKEND_GENERIC_SOFTMAX
260 
262 #define BACKEND_GENERIC_SQUARED_ERROR(Type, Container) \
263  virtual Type squared_error( \
264  const Container<Type>& P, const Container<Type>& Q) const;
267 #undef BACKEND_GENERIC_SQUARED_ERROR
268 
270 #define BACKEND_GENERIC_SUM(Type, Container) \
271  virtual Type sum(const Container<Type>& a, bool no_diag) const;
274 #undef BACKEND_GENERIC_SUM
275 
277 #define BACKEND_GENERIC_BLOCK_SUM(Type, Container) \
278  virtual Type sum(const linalg::Block<Container<Type>>& a, bool no_diag) \
279  const;
281 #undef BACKEND_GENERIC_BLOCK_SUM
282 
284 #define BACKEND_GENERIC_SYMMETRIC_SUM(Type, Container) \
285  virtual Type sum_symmetric(const Container<Type>& a, bool no_diag) const;
287 #undef BACKEND_GENERIC_SYMMETRIC_SUM
288 
290 #define BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM(Type, Container) \
291  virtual Type sum_symmetric( \
292  const linalg::Block<Container<Type>>& a, bool no_diag) const;
294 #undef BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM
295 
297 #define BACKEND_GENERIC_COLWISE_SUM(Type, Container) \
298  virtual SGVector<Type> colwise_sum(const Container<Type>& a, bool no_diag) \
299  const;
301 #undef BACKEND_GENERIC_COLWISE_SUM
302 
304 #define BACKEND_GENERIC_BLOCK_COLWISE_SUM(Type, Container) \
305  virtual SGVector<Type> colwise_sum( \
306  const linalg::Block<Container<Type>>& a, bool no_diag) const;
308 #undef BACKEND_GENERIC_BLOCK_COLWISE_SUM
309 
311 #define BACKEND_GENERIC_ROWWISE_SUM(Type, Container) \
312  virtual SGVector<Type> rowwise_sum(const Container<Type>& a, bool no_diag) \
313  const;
315 #undef BACKEND_GENERIC_ROWWISE_SUM
316 
318 #define BACKEND_GENERIC_BLOCK_ROWWISE_SUM(Type, Container) \
319  virtual SGVector<Type> rowwise_sum( \
320  const linalg::Block<Container<Type>>& a, bool no_diag) const;
322 #undef BACKEND_GENERIC_BLOCK_ROWWISE_SUM
323 
325 #define BACKEND_GENERIC_SVD(Type, Container) \
326  virtual void svd( \
327  const Container<Type>& A, SGVector<Type> s, Container<Type> U, \
328  bool thin_U, linalg::SVDAlgorithm alg) const;
330 #undef BACKEND_GENERIC_SVD
331 
333 #define BACKEND_GENERIC_TRACE(Type, Container) \
334  virtual Type trace(const Container<Type>& A) const;
336 #undef BACKEND_GENERIC_TRACE
337 
339 #define BACKEND_GENERIC_TRANSPOSE_MATRIX(Type, Container) \
340  virtual Container<Type> transpose_matrix(const Container<Type>& A) const;
342 #undef BACKEND_GENERIC_TRANSPOSE_MATRIX
343 
345 #define BACKEND_GENERIC_TRIANGULAR_SOLVER(Type, Container) \
346  virtual Container<Type> triangular_solver( \
347  const SGMatrix<Type>& L, const Container<Type>& b, const bool lower) \
348  const;
353 #undef BACKEND_GENERIC_TRIANGULAR_SOLVER
354 
356 #define BACKEND_GENERIC_ZERO(Type, Container) \
357  virtual void zero(Container<Type>& a) const;
360 #undef BACKEND_GENERIC_ZERO
361 
362 #undef DEFINE_FOR_ALL_PTYPE
363 #undef DEFINE_FOR_REAL_PTYPE
364 #undef DEFINE_FOR_NON_INTEGER_PTYPE
365 #undef DEFINE_FOR_NUMERIC_PTYPE
366 
367  private:
369  template <typename T>
370  void add_impl(
371  SGVector<T>& a, SGVector<T>& b, T alpha, T beta,
372  SGVector<T>& result) const;
373 
375  template <typename T>
376  void add_impl(
377  SGMatrix<T>& a, SGMatrix<T>& b, T alpha, T beta,
378  SGMatrix<T>& result) const;
379 
381  template <typename T>
382  void add_col_vec_impl(
383  const SGMatrix<T>& A, index_t i, const SGVector<T>& b,
384  SGMatrix<T>& result, T alpha, T beta) const;
385 
387  template <typename T>
388  void add_col_vec_impl(
389  const SGMatrix<T>& A, index_t i, const SGVector<T>& b,
390  SGVector<T>& result, T alpha, T beta) const;
391 
393  template <typename T>
394  void add_vector_impl(
395  const SGMatrix<T>& A, const SGVector<T>& b, SGMatrix<T>& result,
396  T alpha, T beta) const;
397 
399  template <typename T>
400  void add_scalar_impl(SGVector<T>& a, T b) const;
401 
403  template <typename T>
404  void add_scalar_impl(SGMatrix<T>& a, T b) const;
405 
407  template <typename T>
408  void center_matrix_impl(SGMatrix<T>& A) const;
409 
411  template <typename T>
412  SGMatrix<T>
413  cholesky_factor_impl(const SGMatrix<T>& A, const bool lower) const;
414 
416  template <typename T>
417  SGVector<T> cholesky_solver_impl(
418  const SGMatrix<T>& L, const SGVector<T>& b, const bool lower) const;
419 
424  template <typename T>
425  T cross_entropy_impl(const SGMatrix<T>& p, const SGMatrix<T>& q) const;
426 
428  template <typename T>
429  T dot_impl(const SGVector<T>& a, const SGVector<T>& b) const;
430 
433  template <typename T>
434  void eigen_solver_impl(
435  const SGMatrix<T>& A, SGVector<T>& eigenvalues,
436  SGMatrix<T>& eigenvectors) const;
437 
440  void eigen_solver_impl(
441  const SGMatrix<complex128_t>& A,
442  SGVector<complex128_t>& eigenvalues,
443  SGMatrix<complex128_t>& eigenvectors) const;
444 
447  template <typename T>
448  void eigen_solver_symmetric_impl(
449  const SGMatrix<T>& A, SGVector<T>& eigenvalues,
450  SGMatrix<T>& eigenvectors, index_t k) const;
451 
453  template <typename T>
454  void element_prod_impl(
455  SGMatrix<T>& a, SGMatrix<T>& b, SGMatrix<T>& result) const;
456 
458  template <typename T>
459  void element_prod_impl(
460  linalg::Block<SGMatrix<T>>& a, linalg::Block<SGMatrix<T>>& b,
461  SGMatrix<T>& result) const;
462 
464  template <typename T>
465  void exponent_impl(const SGVector<T>& a, SGVector<T>& result) const;
466 
468  template <typename T>
469  void exponent_impl(const SGMatrix<T>& a, SGMatrix<T>& result) const;
470 
472  template <typename T>
473  void identity_impl(SGMatrix<T>& identity_matrix) const;
474 
476  template <typename T>
477  void logistic_impl(SGMatrix<T>& a, SGMatrix<T>& result) const;
478 
480  template <typename T>
481  void matrix_prod_impl(
482  SGMatrix<T>& a, SGVector<T>& b, SGVector<T>& result, bool transpose,
483  bool transpose_B = false) const;
484 
486  template <typename T>
487  void matrix_prod_impl(
488  SGMatrix<T>& a, SGMatrix<T>& b, SGMatrix<T>& result,
489  bool transpose_A, bool transpose_B) const;
490 
492  template <typename T>
493  T max_impl(const SGVector<T>& vec) const;
494 
496  template <typename T>
497  T max_impl(const SGMatrix<T>& mat) const;
498 
500  template <typename T, template <typename> class Container>
501  typename std::enable_if<!std::is_same<T, complex128_t>::value,
502  float64_t>::type
503  mean_impl(const Container<T>& a) const;
504 
506  template <template <typename> class Container>
507  complex128_t mean_impl(const Container<complex128_t>& a) const;
508 
514  template <typename T>
515  void multiply_by_logistic_derivative_impl(
516  SGMatrix<T>& a, SGMatrix<T>& result) const;
517 
521  template <typename T>
522  void multiply_by_rectified_linear_derivative_impl(
523  SGMatrix<T>& a, SGMatrix<T>& result) const;
524 
526  template <typename T>
527  SGVector<T>
528  qr_solver_impl(const SGMatrix<T>& A, const SGVector<T>& b) const;
529 
531  template <typename T>
532  SGMatrix<T>
533  qr_solver_impl(const SGMatrix<T>& A, const SGMatrix<T> b) const;
534 
536  template <typename T, template <typename> class Container>
537  void range_fill_impl(Container<T>& a, const T start) const;
538 
540  template <typename T>
541  void rectified_linear_impl(SGMatrix<T>& a, SGMatrix<T>& result) const;
542 
544  template <typename T>
545  void scale_impl(SGVector<T>& a, T alpha, SGVector<T>& result) const;
546 
548  template <typename T>
549  void scale_impl(SGMatrix<T>& a, T alpha, SGMatrix<T>& result) const;
550 
552  template <typename T, template <typename> class Container>
553  void set_const_impl(Container<T>& a, T value) const;
554 
556  template <typename T, template <typename> class Container>
557  void softmax_impl(Container<T>& a) const;
558 
563  template <typename T>
564  T squared_error_impl(const SGMatrix<T>& p, const SGMatrix<T>& q) const;
565 
567  template <typename T>
568  T sum_impl(const SGVector<T>& vec, bool no_diag = false) const;
569 
571  template <typename T>
572  T sum_impl(const SGMatrix<T>& mat, bool no_diag = false) const;
573 
575  template <typename T>
576  T sum_impl(
577  const linalg::Block<SGMatrix<T>>& mat, bool no_diag = false) const;
578 
580  template <typename T>
581  T
582  sum_symmetric_impl(const SGMatrix<T>& mat, bool no_diag = false) const;
583 
585  template <typename T>
586  T sum_symmetric_impl(
587  const linalg::Block<SGMatrix<T>>& mat, bool no_diag = false) const;
588 
590  template <typename T>
591  SGVector<T>
592  colwise_sum_impl(const SGMatrix<T>& mat, bool no_diag) const;
593 
595  template <typename T>
596  SGVector<T> colwise_sum_impl(
597  const linalg::Block<SGMatrix<T>>& mat, bool no_diag) const;
598 
600  template <typename T>
601  SGVector<T>
602  rowwise_sum_impl(const SGMatrix<T>& mat, bool no_diag) const;
603 
605  template <typename T>
606  SGVector<T> rowwise_sum_impl(
607  const linalg::Block<SGMatrix<T>>& mat, bool no_diag) const;
608 
610  template <typename T>
611  void svd_impl(
612  const SGMatrix<T>& A, SGVector<T>& s, SGMatrix<T>& U, bool thin_U,
613  linalg::SVDAlgorithm alg) const;
614 
616  template <typename T>
617  T trace_impl(const SGMatrix<T>& A) const;
618 
620  template <typename T>
621  SGMatrix<T> transpose_matrix_impl(const SGMatrix<T>& A) const;
622 
624  template <typename T>
625  SGMatrix<T> triangular_solver_impl(
626  const SGMatrix<T>& L, const SGMatrix<T>& b, const bool lower) const;
627 
629  template <typename T>
630  SGVector<T> triangular_solver_impl(
631  const SGMatrix<T>& L, const SGVector<T>& b, const bool lower) const;
632 
634  template <typename T>
635  void zero_impl(SGVector<T>& a) const;
636 
638  template <typename T>
639  void zero_impl(SGMatrix<T>& a) const;
640  };
641 
642 /*
643  * Eigen's symmetric eigensolver uses a slower algorithm in comparison
644  * to LAPACK's dsyevr, so if LAPACK is available we use it for float64 type.
645  * This should be removed if eventually Eigen will provide a faster
646  * symmetric eigensolver (@see
647  * http://eigen.tuxfamily.org/bz/show_bug.cgi?id=522).
648  */
649 #ifdef HAVE_LAPACK
650  template <>
651  void LinalgBackendEigen::eigen_solver_symmetric_impl<float64_t>(
652  const SGMatrix<float64_t>& A, SGVector<float64_t>& eigenvalues,
653  SGMatrix<float64_t>& eigenvectors, index_t k) const;
654 #endif
655 }
656 
657 #endif // LINALG_BACKEND_EIGEN_H__
#define BACKEND_GENERIC_MULTIPLY_BY_LOGISTIC_DERIV(Type, Container)
#define BACKEND_GENERIC_EIGEN_SOLVER(Type, Container)
#define BACKEND_GENERIC_BLOCK_COLWISE_SUM(Type, Container)
#define BACKEND_GENERIC_IDENTITY(Type, Container)
#define BACKEND_GENERIC_CHOLESKY_FACTOR(Type, Container)
std::complex< float64_t > complex128_t
Definition: common.h:77
#define BACKEND_GENERIC_COMPLEX_MEAN(Container)
#define BACKEND_GENERIC_CENTER_MATRIX(Type, Container)
#define BACKEND_GENERIC_ROWWISE_SUM(Type, Container)
int32_t index_t
Definition: common.h:72
#define BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD(Type, Container)
#define DEFINE_FOR_NUMERIC_PTYPE(METHODNAME, Container)
Definition: LinalgMacros.h:75
#define BACKEND_GENERIC_DOT(Type, Container)
#define BACKEND_GENERIC_BLOCK_SUM(Type, Container)
#define BACKEND_GENERIC_REAL_MEAN(Type, Container)
DEFINE_FOR_NON_INTEGER_PTYPE(BACKEND_GENERIC_TRIANGULAR_SOLVER, SGVector) DEFINE_FOR_NON_INTEGER_PTYPE(BACKEND_GENERIC_TRIANGULAR_SOLVER
#define BACKEND_GENERIC_COLWISE_SUM(Type, Container)
#define BACKEND_GENERIC_ZERO(Type, Container)
DEFINE_FOR_ALL_PTYPE(BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD, SGMatrix) DEFINE_FOR_NUMERIC_PTYPE(BACKEND_GENERIC_MULTIPLY_BY_LOGISTIC_DERIV
#define BACKEND_GENERIC_BLOCK_ROWWISE_SUM(Type, Container)
#define BACKEND_GENERIC_SVD(Type, Container)
#define BACKEND_GENERIC_MAX(Type, Container)
#define BACKEND_GENERIC_IN_PLACE_MATRIX_PROD(Type, Container)
#define BACKEND_GENERIC_SUM(Type, Container)
#define BACKEND_GENERIC_ADD(Type, Container)
#define BACKEND_GENERIC_SOFTMAX(Type, Container)
#define DEFINE_FOR_REAL_PTYPE(METHODNAME, Container)
#define BACKEND_GENERIC_CHOLESKY_SOLVER(Type, Container)
#define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD(Type, Container)
double float64_t
Definition: common.h:60
#define BACKEND_GENERIC_TRIANGULAR_SOLVER(Type, Container)
#define BACKEND_GENERIC_CROSS_ENTROPY(Type, Container)
DEFINE_FOR_NON_INTEGER_REAL_PTYPE(BACKEND_GENERIC_CROSS_ENTROPY, SGMatrix) DEFINE_FOR_NON_INTEGER_PTYPE(BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC
#define BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC(Type, Container)
#define BACKEND_GENERIC_LOGISTIC(Type, Container)
#define BACKEND_GENERIC_ADD_SCALAR(Type, Container)
#define BACKEND_GENERIC_ADD_COL_VEC(Type, Container)
#define BACKEND_GENERIC_IN_PLACE_SCALE(Type, Container)
#define BACKEND_GENERIC_TRACE(Type, Container)
#define BACKEND_GENERIC_SYMMETRIC_SUM(Type, Container)
#define BACKEND_GENERIC_QR_SOLVER(Type, Container)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define BACKEND_GENERIC_SQUARED_ERROR(Type, Container)
Base interface of generic linalg methods and generic memory transfer methods.
#define BACKEND_GENERIC_IN_PLACE_ADD(Type, Container)
Linalg methods with Eigen3 backend.
#define BACKEND_GENERIC_MULTIPLY_BY_RECTIFIED_LINEAR_DERIV(Type, Container)
#define BACKEND_GENERIC_TRANSPOSE_MATRIX(Type, Container)
#define BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM(Type, Container)
#define BACKEND_GENERIC_RECTIFIED_LINEAR(Type, Container)
#define BACKEND_GENERIC_SET_CONST(Type, Container)
#define BACKEND_GENERIC_RANGE_FILL(Type, Container)
#define BACKEND_GENERIC_EXPONENT(Type, Container)

SHOGUN Machine Learning Toolbox - Documentation