/* * @license Apache-2.0 * * Copyright (c) 2019 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // TypeScript Version: 4.1 /// import * as random from '@stdlib/types/random'; import { TypedIterator } from '@stdlib/types/iter'; /** * Interface defining function options. */ interface Options { /** * Pseudorandom number generator which generates uniformly distributed pseudorandom numbers. */ prng?: random.PRNG; /** * Pseudorandom number generator seed. */ seed?: random.PRNGSeedMT19937; /** * Pseudorandom number generator state. */ state?: random.PRNGStateMT19937; /** * Specifies whether to copy a provided pseudorandom number generator state (default: `true`). */ copy?: boolean; /** * Number of iterations. */ iter?: number; } /** * Interface for iterators of pseudorandom numbers drawn from a cosine distribution. */ interface Iterator extends TypedIterator { /** * Underlying PRNG. */ readonly PRNG: random.PRNG; /** * PRNG seed. */ readonly seed: random.PRNGSeedMT19937; /** * PRNG seed length. */ readonly seedLength: number; /** * PRNG state. */ state: random.PRNGStateMT19937; /** * PRNG state length. */ readonly stateLength: number; /** * PRNG state size (in bytes). */ readonly byteLength: number; } /** * Returns an iterator for generating pseudorandom numbers drawn from a cosine distribution. * * @param mu - location parameter * @param s - scale parameter * @param options - function options * @throws `s` must be a positive number * @throws must provide valid options * @throws must provide a valid state * @returns iterator * * @example * var iter = iterator( -1.0, 3.0 ); * * var r = iter.next().value; * // returns * * r = iter.next().value; * // returns * * r = iter.next().value; * // returns * * // ... */ declare function iterator( mu: number, s: number, options?: Options ): Iterator; // EXPORTS // export = iterator;