Skip to content

use Matrix methods in as.matrix #31

@goldingn

Description

@goldingn

It may be possible to get a speed up from deterministic projections in big landscapes by using sparse matrix classes

For a 3-stage, 2000 patch dispersal model, switching from matrix to Matrix (and adding import & dealing with classes) here doesn't slow down pop:::as.matrix.dynamic() much (7.3s vs 3.9s) and results in much faster multiplications (1.2s vs 5.3s).

This only skips true 0s, so is as accurate as the dense matrix version. If the matrix construction end can be sped up, this may be worthwhile in all dispersal cases.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions