Skip to content

nrow and ncol doesn't work for matrix class #12

@EmilHvitfeldt

Description

@EmilHvitfeldt
library(cpp11)

x <- matrix(runif(4), nrow = 2)

cpp_function("int get_nrow(cpp11::doubles_matrix x) {
  int res = x.nrow();
  
  return(res);
}")

get_nrow(x)
#> [1] 2076180480

cpp_function("int get_ncol(cpp11::doubles_matrix x) {
  int res = x.ncol();
  
  return(res);
}")

get_ncol(x)
#> [1] 0

Created on 2020-06-16 by the reprex package (v0.3.0)

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