Displaying 7 results from an estimated 7 matches for "numericmatrix".
1998 Sep 25
1
format(numericmatrix, ...) : proposal for a change
Since format, i.e., format.default(.), is a pretty basic function I
thought I'd ask before just changing it...
aa <- cbind(1:7, rnorm(7))
format(aa)
or
format(aa, digits=7)
looks like
[,1] [,2]
[1,] " 1.0000000" " 0.2406669"
[2,] " 2.0000000" "-0.4973221"
[3,] " 3.0000000" " 0.4672260"
[4,] "
2012 Dec 05
1
RInside, rcpp compilation problem
...le as the RInside.h header file references the rcpp.h header file, which is not included with RInclude download. This is the sample code provided in one of the RInside manuals:
#include <iostream>
#include <RInside.h> // for the embedded R via RInside
rcpp::NumericMatrix createMatrix(const int n) {
Rcpp::NumericMatrix M(n,n);
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
M(i,j) = i*10 + j;
}
}
return(M);
}
[[alternative HTML version deleted]]
2014 Sep 30
1
Package Rcpp: Question conerning source code of cpp files and related question
...to work with Rcpp my question might sound silly, but
any help and comments are highly welcome.
Thank you very much for your help in advance!
Best,
Martin
crossp.cpp:
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
//[[Rcpp::export]]
NumericMatrix crossp3(NumericMatrix Xr) {
int n = Xr.nrow(), k = Xr.ncol();
arma::mat X(Xr.begin(), n, k, false);
arma::mat XXt = X.t()*X;
return Rcpp::wrap(XXt);
}
[[alternative HTML version deleted]]
2011 Feb 20
2
Problem using F77_CALL(dgemm) in a package
Dear R-devel,
I've written a numerical solver for SOCPs (second order cone programs)
in R, and now I want to move most of the solver code into C for speed.
I've written combined R/C packages before, but in this case I need to
do matrix operations in my C code. As I have never done that before,
I'm trying to write some simple examples to make sure I understand the
basics. I am stuck
2011 Dec 16
0
crash in using Rcpp and inline packages.
...="integer"),
paste(readLines("mkc.cpp"),collapse = "\n"),
plugin = "Rcpp")
The codes in mkc.cpp file are:
NumericVector fx(fx0);
NumericVector fy(fy0);
NumericVector fsp(fsp0);
NumericVector x(x0);
NumericVector y(y0);
NumericVector sp(sp0);
NumericMatrix phyd(phyd0);
double rmax = as<double>(rmax0);
double step = as<double>(step0);
double totalcout = 0.0;
double totalsum = 0.0;
int binlength = as<int> (binlength0);
NumericVector bincout(binlength);
NumericVector binsum(binlength);
int nfocal=fx.size();
int ntotal=x.size();
do...
2011 Dec 16
0
Fw: crash in using Rcpp and inline packages.
...="integer"),
paste(readLines("mkc.cpp"),collapse = "\n"),
plugin = "Rcpp")
The codes in mkc.cpp file are:
NumericVector fx(fx0);
NumericVector fy(fy0);
NumericVector fsp(fsp0);
NumericVector x(x0);
NumericVector y(y0);
NumericVector sp(sp0);
NumericMatrix phyd(phyd0);
double rmax = as<double>(rmax0);
double step = as<double>(step0);
double totalcout = 0.0;
double totalsum = 0.0;
int binlength = as<int> (binlength0);
NumericVector bincout(binlength);
NumericVector binsum(binlength);
int nfocal=fx.size();
int ntotal=x.size();
do...
2018 Sep 20
4
Bias in R's random integers?
Hello,
On Thursday, September 20, 2018 11:15:04 AM EDT Duncan Murdoch wrote:
> On 20/09/2018 6:59 AM, Ralf Stubner wrote:
> > On 9/20/18 1:43 AM, Carl Boettiger wrote:
> >> For a well-tested C algorithm, based on my reading of Lemire, the
> >> unbiased "algorithm 3" in https://arxiv.org/abs/1805.10941 is part
> >> already of the C standard library in