# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Compute Fourier Series
#'
#' Computes Fourier series required by Andrews curves.
#' @param mat Data matrix of size nxp
#' @param t Vector of size m where the series is being evaluated.
#' @param type Type of curve.
#' @return A nxm matrix where each row represents a curve.
#' @export
compute_fourier_series <- function(mat, t, type) {
.Call(`_drewcurves_compute_fourier_series`, mat, t, type)
}
#' Minmax Normalization
#'
#' For each column of a matrix, it substracts its minimum and divide
#' by the length of its range
#'
#' An error is returned if there is at least one column whose values
#' are all the same.
#' @param mat A numeric matrix.
#' @return The normalized matrix, with a vector with ' column
#' minimums and a vector with the column range lengths as attributes.
#' @author Guillermo Basulto-Elias
#' @examples
#' mat <- matrix(c(0, 1, 2,
#' 3, 4, 5,
#' 3, 2, 1),
#' nrow = 3, byrow = TRUE)
#' drewcurves:::minmax(mat)
#'
#' \dontrun{
#' mat <- matrix(c(0, pi, 1, 2,
#' 3, pi, 4, 5,
#' 3, pi, 2, 1),
#' nrow = 3, byrow = TRUE)
#' drewcurves:::minmax(mat)
#' }
minmax <- function(mat) {
.Call(`_drewcurves_minmax`, mat)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.