R/rowcolSumSq.r

Defines functions colSumsSq rowSumsSq

Documented in colSumsSq rowSumsSq

# Same as rowSums(x^2), but faster with C/C++
rowSumsSq = function(x){
    stopifnot( is.numeric(x) );
    output = double(NROW(x));
    .Call("CrowSumsSq", x, output);
    return(output);
}

# Same as colSums(x^2), but faster with C/C++
colSumsSq = function(x){
    stopifnot( is.numeric(x) );
    output = double(NCOL(x));
    .Call("CcolSumsSq", x, output);
    return(output);
}

Try the ramwas package in your browser

Any scripts or data that you put into this service are public.

ramwas documentation built on Nov. 8, 2020, 8:24 p.m.