Skip to content

New matrix ctor to allow for fill on dimension creation #562

@coatless

Description

@coatless

Going through the matrix options right now, there seems to be only two options to fill a matrix:

// by vector
NumericVector x = NumericVector(100, 2.0); 
y = NumericMatrix(10, 10, v.begin());


// using stl
NumericMatrix z(10,10);
std::fill(z.begin, z.end(), 2.0);

However, as indicated by option using a vector, it would be nice to be able to immediately specify the fill value within the constructor:

// proposed addition
NumericMatrix z2(10, 10, 2.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