R/RcppExports.R

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

baseHaz_cpp <- function(starttimes, stoptimes, status, eXb, strata, predtimes, emaxtimes, nPatients, nStrata, cause, Efron) {
    .Call(`_riskRegressionLight_baseHaz_cpp`, starttimes, stoptimes, status, eXb, strata, predtimes, emaxtimes, nPatients, nStrata, cause, Efron)
}

calcSeHazard_cpp <- function(seqTau, indexTau, indexJump, IFbeta, cumEhazard0, iS0, cumhazard_iS0, newEXb, sampleEXb, X, sameStrata, sampleTime, cumhazard0, newSurvival, firstJumpTime, lastSampleTime, nTau, nNewObs, nSample, p, exportSE, exportIF, exportIFsum_cumhazard, exportIFsum_survival) {
    .Call(`_riskRegressionLight_calcSeHazard_cpp`, seqTau, indexTau, indexJump, IFbeta, cumEhazard0, iS0, cumhazard_iS0, newEXb, sampleEXb, X, sameStrata, sampleTime, cumhazard0, newSurvival, firstJumpTime, lastSampleTime, nTau, nNewObs, nSample, p, exportSE, exportIF, exportIFsum_cumhazard, exportIFsum_survival)
}

calcAIFsurv_cpp <- function(ls_IFcumhazard, IFbeta, cumhazard0, survival, eXb, X, prevStrata, ls_indexStrata, factor, nTimes, nObs, nStrata, nVar, exportCumHazard, exportSurvival) {
    .Call(`_riskRegressionLight_calcAIFsurv_cpp`, ls_IFcumhazard, IFbeta, cumhazard0, survival, eXb, X, prevStrata, ls_indexStrata, factor, nTimes, nObs, nStrata, nVar, exportCumHazard, exportSurvival)
}

calcSeCif_cpp <- function(seqTau, jumpTime, jumpTheCause, indexJump, indexSample, IFbeta, cif, Ehazard0, cumEhazard0, iS0, cumhazard_iS0, hazard_iS0, newEXb, sampleEXb, X, sameStrata, sampleTime, hazard0, cumhazard0, theCause, firstJumpTime, lastSampleTime, nTau, nJump, nNewObs, nSample, nCause, p, survtype, exportSE, exportIF, exportIFsum) {
    .Call(`_riskRegressionLight_calcSeCif_cpp`, seqTau, jumpTime, jumpTheCause, indexJump, indexSample, IFbeta, cif, Ehazard0, cumEhazard0, iS0, cumhazard_iS0, hazard_iS0, newEXb, sampleEXb, X, sameStrata, sampleTime, hazard0, cumhazard0, theCause, firstJumpTime, lastSampleTime, nTau, nJump, nNewObs, nSample, nCause, p, survtype, exportSE, exportIF, exportIFsum)
}

calcSeCif2_cpp <- function(ls_IFbeta, ls_X, ls_cumhazard, ls_hazard, ls_IFcumhazard, ls_IFhazard, eXb, nJumpTime, JumpMax, tau, tauIndex, nTau, nObs, theCause, nCause, hazardType, nVar, nNewObs, strata, exportSE, exportIF, exportIFsum) {
    .Call(`_riskRegressionLight_calcSeCif2_cpp`, ls_IFbeta, ls_X, ls_cumhazard, ls_hazard, ls_IFcumhazard, ls_IFhazard, eXb, nJumpTime, JumpMax, tau, tauIndex, nTau, nObs, theCause, nCause, hazardType, nVar, nNewObs, strata, exportSE, exportIF, exportIFsum)
}

calcAIFcif_cpp <- function(hazard1, ls_cumhazard, ls_tX, eXb, ls_IFbeta, ls_IFhazard, ls_IFcumhazard, nCause, theCause, hazardType, tau, nTau, tauIndex, nJumpTime, JumpMax, nObs, nNewObs, levelStrata, nStrata, ls_indexStrata, nVar, factor) {
    .Call(`_riskRegressionLight_calcAIFcif_cpp`, hazard1, ls_cumhazard, ls_tX, eXb, ls_IFbeta, ls_IFhazard, ls_IFcumhazard, nCause, theCause, hazardType, tau, nTau, tauIndex, nJumpTime, JumpMax, nObs, nNewObs, levelStrata, nStrata, ls_indexStrata, nVar, factor)
}

#' Apply cumsum in each column 
#'
#' @description Fast computation of apply(x,2,cumsum)
#' @param x A matrix.
#' @return A matrix of same size as x.
#' @author Thomas Alexander Gerds <tag@@biostat.ku.dk>
#' @examples
#' x <- matrix(1:8,ncol=2)
#' colCumSum(x)
#' @export
colCumSum <- function(x) {
    .Call(`_riskRegressionLight_colCumSum`, x)
}

#' Apply crossprod and colSums 
#'
#' @description Fast computation of crossprod(colSums(X),Y) 
#' @param X A matrix with dimensions k*n. Hence the result of \code{colSums(X)} has length n.
#' @param Y A matrix with dimenions n*m. Can be a matrix with dimension m*n but then \code{transposeY} should be \code{TRUE}.
#' @param transposeY Logical. If \code{TRUE} transpose Y before matrix multiplication.
#' @return A vector of length m.
#' @author Thomas Alexander Gerds <tag@@biostat.ku.dk>
#' @examples
#' x <- matrix(1:8,ncol=2)
#' y <- matrix(1:16,ncol=8)
#' colSumsCrossprod(x,y,0)
#' 
#' x <- matrix(1:8,ncol=2)
#' y <- matrix(1:16,ncol=2)
#' colSumsCrossprod(x,y,1)
#' @export
colSumsCrossprod <- function(X, Y, transposeY) {
    .Call(`_riskRegressionLight_colSumsCrossprod`, X, Y, transposeY)
}

quantileProcess_cpp <- function(nObject, nNew, nSim, iid, se, confLevel) {
    .Call(`_riskRegressionLight_quantileProcess_cpp`, nObject, nNew, nSim, iid, se, confLevel)
}

sampleMaxProcess_cpp <- function(nObject, nNew, nSim, iid, se) {
    .Call(`_riskRegressionLight_sampleMaxProcess_cpp`, nObject, nNew, nSim, iid, se)
}

calcE_cpp <- function(eventtime, status, eXb, X, p, add0) {
    .Call(`_riskRegressionLight_calcE_cpp`, eventtime, status, eXb, X, p, add0)
}

IFbeta_cpp <- function(newT, neweXb, newX, newStatus, newIndexJump, S01, E1, time1, iInfo, p) {
    .Call(`_riskRegressionLight_IFbeta_cpp`, newT, neweXb, newX, newStatus, newIndexJump, S01, E1, time1, iInfo, p)
}

IFbetaApprox_cpp <- function(newX, newStatus, newIndexJump, E1, iInfo, p) {
    .Call(`_riskRegressionLight_IFbetaApprox_cpp`, newX, newStatus, newIndexJump, E1, iInfo, p)
}

IFlambda0_cpp <- function(tau, IFbeta, newT, neweXb, newStatus, newStrata, newIndexJump, S01, E1, time1, lastTime1, lambda0, p, strata, exact, minimalExport) {
    .Call(`_riskRegressionLight_IFlambda0_cpp`, tau, IFbeta, newT, neweXb, newStatus, newStrata, newIndexJump, S01, E1, time1, lastTime1, lambda0, p, strata, exact, minimalExport)
}

predictCIF_cpp <- function(hazard, cumhazard, eXb, strata, newtimes, etimes, etimeMax, t0, nEventTimes, nNewTimes, nData, cause, nCause, survtype, productLimit) {
    .Call(`_riskRegressionLight_predictCIF_cpp`, hazard, cumhazard, eXb, strata, newtimes, etimes, etimeMax, t0, nEventTimes, nNewTimes, nData, cause, nCause, survtype, productLimit)
}

#' Apply cumsum in each row 
#'
#' @description Fast computation of t(apply(x,1,cumsum))
#' @param x A matrix.
#' @return A matrix of same size as x.
#' @author Thomas Alexander Gerds <tag@@biostat.ku.dk>
#' @examples
#' x <- matrix(1:8,ncol=2)
#' rowCumSum(x)
#' @export
rowCumSum <- function(x) {
    .Call(`_riskRegressionLight_rowCumSum`, x)
}

#' Apply crossprod and rowSums
#'
#' @description Fast computation of crossprod(rowSums(X),Y)
#' @param X A matrix with dimensions n*k. Hence the result of \code{rowSums(X)} has length n.
#' @param Y A matrix with dimenions n*m. Can be a matrix with dimension m*n but then \code{transposeY} should be \code{TRUE}.
#' @param transposeY Logical. If \code{TRUE} transpose Y before matrix multiplication.
#' @return A vector of length m.
#' @author Thomas Alexander Gerds <tag@@biostat.ku.dk>
#' @examples
#' x <- matrix(1:10,nrow=5)
#' y <- matrix(1:20,ncol=4)
#' rowSumsCrossprod(x,y,0)
#'
#' x <- matrix(1:10,nrow=5)
#' y <- matrix(1:20,ncol=5)
#' rowSumsCrossprod(x,y,1)
#' @export
rowSumsCrossprod <- function(X, Y, transposeY) {
    .Call(`_riskRegressionLight_rowSumsCrossprod`, X, Y, transposeY)
}

#' @title Apply - by column
#' @description Fast computation of sweep(X, MARGIN = 1, FUN = "-", STATS = center)
#' @name colCenter_cpp
#' 
#' 
#' @param X A matrix.
#' @param center a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' 
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 1, FUN = "-", STATS = 1:6)
#' colCenter_cpp(x, 1:6 )
NULL

#' @title Apply - by row
#' @description Fast computation of sweep(X, MARGIN = 2, FUN = "-", STATS = center)
#' @name rowCenter_cpp
#' 
#' @param X A matrix.
#' @param center a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 2, FUN = "-", STATS = 1:5)
#' rowCenter_cpp(x, 1:5 )
#' 
#' rowCenter_cpp(x, colMeans(x) )
NULL

#' @title Apply / by column
#' @description Fast computation of sweep(X, MARGIN = 1, FUN = "/", STATS = scale)
#' @name colScale_cpp
#'
#' @param X A matrix.
#' @param scale a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 1, FUN = "/", STATS = 1:6)
#' colScale_cpp(x, 1:6 )
NULL

#' @title Apply / by row
#' @description Fast computation of sweep(X, MARGIN = 2, FUN = "/", STATS = scale)
#' @name rowScale_cpp
#' 
#' @param X A matrix.
#' @param scale a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 2, FUN = "/", STATS = 1:5)
#' rowScale_cpp(x, 1:5 )
#' 
#' rowScale_cpp(x, colMeans(x) )
NULL

#' @title Apply * by column
#' @description Fast computation of sweep(X, MARGIN = 1, FUN = "*", STATS = scale)
#' @name colMultiply_cpp
#' 
#' @param X A matrix.
#' @param scale a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 1, FUN = "*", STATS = 1:6)
#' colMultiply_cpp(x, 1:6 )
NULL

#' @title Apply * by row
#' @description Fast computation of sweep(X, MARGIN = 2, FUN = "*", STATS = scale)
#' @name rowMultiply_cpp
#' 
#' @param X A matrix.
#' @param scale a numeric vector of length equal to the number of rows of \code{x}
#' 
#' @return A matrix of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- matrix(1,6,5)
#' sweep(x, MARGIN = 2, FUN = "*", STATS = 1:5)
#' rowMultiply_cpp(x, 1:5 )
#' 
#' rowMultiply_cpp(x, 1/colMeans(x) )
#' 
NULL

#' @title Apply * by slice
#' @description Fast computation of sweep(X, MARGIN = 1:2, FUN = "*", STATS = scale)
#' @name sliceMultiply_cpp
#' 
#' @param X An array.
#' @param M A matrix with the same number of row and columns as X.
#' 
#' @return An array of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- array(1, dim = c(2,6,5))
#' M <- matrix(1:12,2,6)
#' sweep(x, MARGIN = 1:2, FUN = "*", STATS = M)
#' sliceMultiply_cpp(x, M) 
#' 
NULL

#' @title Apply / by slice
#' @description Fast computation of sweep(X, MARGIN = 1:2, FUN = "/", STATS = scale)
#' @name sliceScale_cpp
#' 
#' @param X An array.
#' @param M A matrix with the same number of row and columns as X.
#' 
#' @return An array of same size as X.
#' @author Brice Ozenne <broz@@sund.ku.dk>
#' @examples
#' x <- array(1, dim = c(2,6,5))
#' M <- matrix(1:12,2,6)
#' sweep(x, MARGIN = 1:2, FUN = "/", STATS = M)
#' sliceScale_cpp(x, M) 
#' 
NULL

#' @rdname colCenter_cpp
#' @export
colCenter_cpp <- function(X, center) {
    .Call(`_riskRegressionLight_colCenter_cpp`, X, center)
}

#' @rdname rowCenter_cpp
#' @export
rowCenter_cpp <- function(X, center) {
    .Call(`_riskRegressionLight_rowCenter_cpp`, X, center)
}

#' @rdname colScale_cpp
#' @export
colScale_cpp <- function(X, scale) {
    .Call(`_riskRegressionLight_colScale_cpp`, X, scale)
}

#' @rdname rowScale_cpp
#' @export
rowScale_cpp <- function(X, scale) {
    .Call(`_riskRegressionLight_rowScale_cpp`, X, scale)
}

#' @name colMultiply_cpp
#' @export
colMultiply_cpp <- function(X, scale) {
    .Call(`_riskRegressionLight_colMultiply_cpp`, X, scale)
}

#' @name rowMultiply_cpp
#' @export
rowMultiply_cpp <- function(X, scale) {
    .Call(`_riskRegressionLight_rowMultiply_cpp`, X, scale)
}

#' @rdname sliceMultiply_cpp
#' @export
sliceMultiply_cpp <- function(X, M) {
    .Call(`_riskRegressionLight_sliceMultiply_cpp`, X, M)
}

#' @rdname sliceMultiply_cpp
#' @export
sliceMultiplyPointer_cpp <- function(X, M) {
    invisible(.Call(`_riskRegressionLight_sliceMultiplyPointer_cpp`, X, M))
}

#' @rdname sliceScale_cpp
#' @export
sliceScale_cpp <- function(X, M) {
    .Call(`_riskRegressionLight_sliceScale_cpp`, X, M)
}

#' @rdname sliceScale_cpp
#' @export
sliceScalePointer_cpp <- function(X, M) {
    invisible(.Call(`_riskRegressionLight_sliceScalePointer_cpp`, X, M))
}
bozenne/riskRegressionLight documentation built on May 7, 2019, 12:52 a.m.