Skip to content

DataGen.Range() #259

@swharden

Description

@swharden

Create a function to make it easy to generate a range of numbers with defined spacing.

We can copy the arguments for numpy.arange() in Python

double[] values;
values = DataGen.Range(10); // returns 10 numbers (0 through 9)
values = DataGen.Range(5, 10); // returns 5 numbers (5 through 9)
values = DataGen.Range(0, 1, 0.1); // returns 10 numbers (0.0 through 0.9)

It may be useful to mark DataGen.Consecutive() as obsolete...
EDIT: let's keep Consecutive() because it's more useful than Range() when the goal is to quickly create an array of a given size. Mental math is required to predict many values Range() will return.

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