File: RcppMLCommon.hpp

package info (click to toggle)
r-cran-rcppml 0.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 368 kB
  • sloc: cpp: 1,134; sh: 13; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// This file is part of RcppML, a Rcpp Machine Learning library
//
// Copyright (C) 2021 Zach DeBruine <zacharydebruine@gmail.com>
//
// This source code is subject to the terms of the GNU
// Public License v. 2.0.

#ifndef RcppML_common
#define RcppML_common

//[[Rcpp::plugins(openmp)]]
#ifdef _OPENMP
#include <omp.h>
#endif

#ifndef EIGEN_NO_DEBUG
#define EIGEN_NO_DEBUG
#endif

#ifndef TINY_NUM
#define TINY_NUM 1e-15 // epsilon for numerical stability
#endif

// parameters for coordinate descent
#ifndef CD_PARAMS
#define CD_TOL 1e-8
#define CD_MAXIT 100
#endif

#ifndef EIGEN_INITIALIZE_MATRICES_BY_ZERO
#define EIGEN_INITIALIZE_MATRICES_BY_ZERO
#endif

//[[Rcpp::depends(RcppEigen)]]
#ifndef RcppEigen__RcppEigen__h
#include <RcppEigen.h>
#endif

#ifndef RcppML_sparsematrix
#include <RcppML/SparseMatrix.hpp>
#endif

#ifndef RcppML_bits
#include <RcppML/bits.hpp>
#endif

#endif