This is similar to blas/ext/base/glinspace, except for generating logarithmically spaced values.
API signatures:
glogspace( N, base, start, stop, endpoint, x, strideX )
glogspace( N, base, start, stop, endpoint, x, strideX, offsetX )
where
N: number of indexed elements.
base: base of the logspace.
start: exponent of the starting value of the sequence, where the starting value is given by base^start.
stop: exponent of the final value of the sequence, where the final value is given by base^stop.
endpoint: boolean indicating whether to include the final value when writing values to the input array. If true, the input array is filled with logarithmically spaced values over the closed interval [base^start, base^stop]. If false, the input array is filled with logarithmically spaced values over the half-open interval [base^start, base^stop).
x: input strided array.
strideX: stride length of x.
offsetX: starting index for x.
To calculate the increment, one computes exactly as done in linspace, taking into account whether endpoint is true or false. To compute the values, one then does
where d is the increment.
The notes in https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dlinspace#notes are largely applicable to logspace.
Follow-on Work
Once completed, the following packages can be created:
Note that for complex support, base should be restricted to a positive real base, start and stop are complex, and be conceptually implemented in a manner equivalent to (but NOT directly as)
logspace(base, start, stop) == exp( linspace(start, stop) * ln(base) )
For complex support, we should document that
- Generated values follow a logarithmic spiral in the complex plane.
- Imaginary components control phase rotation.
This is similar to
blas/ext/base/glinspace, except for generating logarithmically spaced values.API signatures:
where
N: number of indexed elements.base: base of the logspace.start: exponent of the starting value of the sequence, where the starting value is given bybase^start.stop: exponent of the final value of the sequence, where the final value is given bybase^stop.endpoint: boolean indicating whether to include the final value when writing values to the input array. Iftrue, the input array is filled with logarithmically spaced values over the closed interval[base^start, base^stop]. Iffalse, the input array is filled with logarithmically spaced values over the half-open interval[base^start, base^stop).x: input strided array.strideX: stride length ofx.offsetX: starting index forx.To calculate the increment, one computes exactly as done in
linspace, taking into account whetherendpointistrueorfalse. To compute the values, one then doeswhere
dis the increment.The notes in https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/ext/base/dlinspace#notes are largely applicable to logspace.
Follow-on Work
Once completed, the following packages can be created:
blas/ext/base/dlogspaceblas/ext/base/slogspaceblas/ext/base/clogspaceblas/ext/base/zlogspaceblas/ext/base/ndarray/dlogspaceblas/ext/base/ndarray/slogspaceblas/ext/base/ndarray/glogspaceblas/ext/base/ndarray/clogspaceblas/ext/base/ndarray/zlogspaceblas/ext/logspaceNote that for complex support,
baseshould be restricted to a positive real base,startandstopare complex, and be conceptually implemented in a manner equivalent to (but NOT directly as)For complex support, we should document that