Code Monkey home page Code Monkey logo

Comments (4)

zkamvar avatar zkamvar commented on June 25, 2024

I'm working on the function to estimate round robin frequencies in place, but I'm having trouble passing ASAN at my comparison function for qsort.

The error it gives me:

mlg_counter.c:61:10: runtime error: member access within null pointer of type 'struct mask'

All I want to do is cast it into a char *. @JonahBrooks, do you have any pointers (pun VERY intended)?

from poppr.

zkamvar avatar zkamvar commented on June 25, 2024

The issue above has been fixed and the results are fantastic as compared to doing the same thing in base R:

Setup:

# Function for counting the number of round robin mlgs per locus
rr <- function(x){
        mask <- seq(ncol(x))
        res  <- vector(mode = "integer", length = ncol(x))
        for (i in mask){
                res[i] <- nrow(unique(x[, -i, drop = FALSE]))
        }
        return(res)
}

x <- matrix(sample(0:2, 6660, rep = TRUE), nrow = 666, ncol = 10)
library('microbenchmark')
library('poppr')
res <- microbenchmark(rr(x), .Call("mlg_round_robin", x, PACKAGE = "poppr"))
res
Unit: milliseconds
                                           expr        min         lq        mean     median         uq       max neval  
                                          rr(x) 199.243444 220.686884  241.518477 229.980039 245.227290 569.22988   100  
 .Call("mlg_round_robin", x, PACKAGE = "poppr")   4.213625   4.396508    6.976769   4.925717   5.974037  50.60142   100  

from poppr.

zkamvar avatar zkamvar commented on June 25, 2024

I've added a function to estimate round robin allele frequencies in the mlg-counter branch called rraf()

from poppr.

zkamvar avatar zkamvar commented on June 25, 2024

I've added both pgen() and psex() and I've documented Stacy's name on the functions, now I just need to add her name to the Authors@R field in the Description.

from poppr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.