Skip to content

Loss of dim 2 when using field as input #351

@BerriJ

Description

@BerriJ

HI,

consider these 2 functions:

#include <RcppArmadillo.h>
using namespace arma;

// [[Rcpp::export]]
field<mat> fieldtest1()
{
    field<mat> out(5, 6);

    return out;
}

// [[Rcpp::export]]
field<mat> fieldtest2(field<mat> x)
{
    return x;
}

Now consider this R code:

[R] field <- fieldtest1() 
    dim(field) 
[1] 5 6
[R] field2 <- fieldtest2(field) 
    dim(field2)                                                       
[1] 30  1

fieldtest1 returns a nested list with dimensions 5,6 as expected. But fieldtest2 just imports and exports the field drop dimension 2 and returns a 30,1 list.

This Issue may be related to #263.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions