{% set version = '0.12-0' %}

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

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

source:
  fn: RSpectra_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RSpectra_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RSpectra/RSpectra_{{ version }}.tar.gz
  sha256: c0a9e7467200e08c945ea2f497a1abb1104d92c48516f5affd6f00f9611d4329

build:
  merge_build_host: True  # [win]
  number: 2
  rpaths:
    - lib/R/lib/
    - lib/
  skip: True  # [win32]

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-matrix >=1.1_0
    - r-rcpp >=0.11.5
    - r-rcppeigen >=0.3.2.2.0
    - spectra

  run:
    - r-base
    - r-matrix >=1.1_0
    - r-rcpp >=0.11.5
    - r-rcppeigen >=0.3.2.2.0
    - spectra

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

about:
  home: https://github.com/yixuan/RSpectra
  license: MPL (>= 2)
  summary: R interface to the 'Spectra' library <http://yixuan.cos.name/spectra/> for large scale
    eigenvalue and SVD problems. It is typically used to compute a few eigenvalues/vectors
    of an n by n matrix, e.g., the k largest eigenvalues, which is usually more efficient
    than eigen() if k << n. This package provides the 'eigs()' function which does the
    similar job as in 'Matlab', 'Octave', 'Python SciPy' and 'Julia'. It also provides
    the 'svds()' function to calculate the largest k singular values and corresponding
    singular vectors of a real matrix. Matrices can be given in either dense or sparse
    form.
  license_family: OTHER

extra:
  recipe-maintainers:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
