GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Array does not work · Issue #230 · Rcpp11/Rcpp11

Array does not work #230

New issue
Copy link
New issue
Copy link
Open
Open
Array does not work#230
Copy link

Description

@gdkrmr
gdkrmr
opened on Jul 28, 2016
Issue body actions

The following does not compile (attributes::sourceCpp(test.cpp), see also comment on #156):

#include <Rcpp.h>
using namespace Rcpp ;

typedef Array<3,REALSXP> Numeric3D ;

// [[Rcpp::export]]
Numeric3D test(){
  Numeric3D res(1,1,1);
  return res;
}

/*** R
test()
*/

Activity

  1. gdkrmr commented on Jul 29, 2016

    @gdkrmr
    gdkrmr
    on Jul 29, 2016
    Author
    More actions

    A quick fix is converting index.prod() to R_xlen_t in line 24 of Array.h.

            template <
                typename... Args, 
                typename = typename std::enable_if< ValidIndexArgs<N,Args...>() >::type 
            >
            Array( Args... args ) : 
                index({ static_cast<size_t>(args)... }), 
                data( (R_xlen_t)index.prod())
            {
                attr(data, "dim") = index ;    
            }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.