{% set version = '0.3.3.4' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-rsparse
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/rsparse_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rsparse/rsparse_{{ version }}.tar.gz
  sha256: 6844ba5510a1eb19fe91958cb147b155d9fdf088923202ea4d2abe95f71890d8

build:
  merge_build_host: True  # [win]
  number: 1
  # some dependencies are >=3.6 only
  skip: True  # [r_base == "3.5.1"]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - libopenblas
    - _openmp_mutex              # [linux]
    - r-base
    - r-matrix >=1.2
    - r-rcpp >=0.11
    - r-rcpparmadillo >=0.9.100.5.0
    - r-rhpcblasctl
    - r-data.table >=1.10.0
    - r-float >=0.2_2
    - r-lgr >=0.2
    - r-mlapi >=0.1.0
  run:
    - libopenblas
    - _openmp_mutex              # [linux]
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-matrix >=1.2
    - r-rcpp >=0.11
    - r-rcpparmadillo >=0.9.100.5.0
    - r-rhpcblasctl
    - r-data.table >=1.10.0
    - r-float >=0.2_2
    - r-lgr >=0.2
    - r-mlapi >=0.1.0

test:
  commands:
    - $R -e "library('rsparse')"           # [not win]
    - "\"%R%\" -e \"library('rsparse')\""  # [win]

about:
  home: https://github.com/dselivanov/rsparse
  license: GPL-2
  summary: 'Implements many algorithms for statistical learning on sparse matrices - matrix factorizations,
    matrix completion, elastic net regressions, factorization machines. Also ''rsparse''
    enhances ''Matrix'' package by providing methods for multithreaded <sparse, dense>
    matrix products and native slicing of the sparse matrices in Compressed Sparse Row
    (CSR) format. List of the algorithms for regression problems: 1) Elastic Net regression
    via Follow The Proximally-Regularized Leader (FTRL) Stochastic Gradient Descent
    (SGD), as per McMahan et al(, <doi:10.1145/2487575.2488200>) 2) Factorization Machines
    via SGD, as per Rendle (2010, <doi:10.1109/ICDM.2010.127>) List of algorithms for
    matrix factorization and matrix completion: 1) Weighted Regularized Matrix Factorization
    (WRMF) via Alternating Least Squares (ALS) - paper by Hu, Koren, Volinsky (2008,
    <doi:10.1109/ICDM.2008.22>) 2) Maximum-Margin Matrix Factorization via ALS, paper
    by Rennie, Srebro (2005, <doi:10.1145/1102351.1102441>) 3) Fast Truncated Singular
    Value Decomposition (SVD), Soft-Thresholded SVD, Soft-Impute matrix completion via
    ALS - paper by Hastie, Mazumder et al. (2014, <arXiv:1410.2596>) 4) Linear-Flow
    matrix factorization, from ''Practical linear models for large-scale one-class collaborative
    filtering'' by Sedhain, Bui, Kawale et al (2016, ISBN:978-1-57735-770-4) 5) GlobalVectors
    (GloVe) matrix factorization via SGD, paper by Pennington, Socher, Manning (2014,
    <https://www.aclweb.org/anthology/D14-1162>) Package is reasonably fast and memory
    efficient - it allows to work with large datasets - millions of rows and millions
    of columns. This is particularly useful for practitioners working on recommender
    systems.'
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - conda-forge/r

# Package: rsparse
# Type: Package
# Title: Statistical Learning on Sparse Matrices
# Version: 0.3.3.4
# Authors@R: c( person("Dmitriy", "Selivanov", role=c("aut", "cre", "cph"), email="selivanov.dmitriy@gmail.com", comment = c(ORCID = "0000-0001-5413-1506")), person("Drew", "Schmidt", role="ctb", comment="configure script for BLAS, LAPACK detection"), person("Wei-Chen", "Chen", role="ctb", comment="configure script and work on linking to float package") )
# Maintainer: Dmitriy Selivanov <selivanov.dmitriy@gmail.com>
# Description: Implements many algorithms for statistical learning on sparse matrices - matrix factorizations, matrix completion, elastic net regressions, factorization machines. Also 'rsparse' enhances 'Matrix' package by providing methods for multithreaded <sparse, dense> matrix products and native slicing of the sparse matrices in Compressed Sparse Row (CSR) format. List of the algorithms for regression problems: 1) Elastic Net regression via Follow The Proximally-Regularized Leader (FTRL) Stochastic Gradient Descent (SGD), as per McMahan et al(, <doi:10.1145/2487575.2488200>) 2) Factorization Machines via SGD, as per Rendle (2010, <doi:10.1109/ICDM.2010.127>) List of algorithms for matrix factorization and matrix completion: 1) Weighted Regularized Matrix Factorization (WRMF) via Alternating Least Squares (ALS) - paper by Hu, Koren, Volinsky (2008, <doi:10.1109/ICDM.2008.22>) 2) Maximum-Margin Matrix Factorization via ALS, paper by Rennie, Srebro (2005, <doi:10.1145/1102351.1102441>) 3) Fast Truncated Singular Value Decomposition (SVD), Soft-Thresholded SVD, Soft-Impute matrix completion via ALS - paper by Hastie, Mazumder et al. (2014, <arXiv:1410.2596>) 4) Linear-Flow matrix factorization, from 'Practical linear models for large-scale one-class collaborative filtering' by Sedhain, Bui, Kawale et al (2016, ISBN:978-1-57735-770-4) 5) GlobalVectors (GloVe) matrix factorization via SGD, paper by Pennington, Socher, Manning (2014, <https://www.aclweb.org/anthology/D14-1162>) Package is reasonably fast and memory efficient - it allows to work with large datasets - millions of rows and millions of columns. This is particularly useful for practitioners working on recommender systems.
# License: GPL (>= 2)
# Encoding: UTF-8
# LazyData: true
# ByteCompile: true
# Depends: R (>= 3.6.0), methods
# Imports: Matrix (>= 1.2), Rcpp (>= 0.11), mlapi (>= 0.1.0), data.table (>= 1.10.0), float (>= 0.2-2), RhpcBLASctl, lgr (>= 0.2)
# LinkingTo: Rcpp, RcppArmadillo (>= 0.9.100.5.0)
# Suggests: testthat, covr
# StagedInstall: TRUE
# URL: https://github.com/dselivanov/rsparse
# BugReports: https://github.com/dselivanov/rsparse/issues
# RoxygenNote: 6.1.1
# NeedsCompilation: yes
# Packaged: 2019-10-14 08:29:30 UTC; dselivanov
# Author: Dmitriy Selivanov [aut, cre, cph] (<https://orcid.org/0000-0001-5413-1506>), Drew Schmidt [ctb] (configure script for BLAS, LAPACK detection), Wei-Chen Chen [ctb] (configure script and work on linking to float package)
# Repository: CRAN
# Date/Publication: 2019-11-14 12:30:02 UTC
