lang
stringclasses 2
values | license
stringclasses 13
values | stderr
stringlengths 0
343
| commit
stringlengths 40
40
| returncode
int64 0
128
| repos
stringlengths 6
87.7k
| new_contents
stringlengths 0
6.23M
| new_file
stringlengths 3
311
| old_contents
stringlengths 0
6.23M
| message
stringlengths 6
9.1k
| old_file
stringlengths 3
311
| subject
stringlengths 0
4k
| git_diff
stringlengths 0
6.31M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
Java | mit | f4be0d8d052d2aeb3b558f09d9ebf7e540e94bd1 | 0 | apollostack/apollo-android,apollostack/apollo-android,apollographql/apollo-android,apollostack/apollo-android,apollographql/apollo-android,apollographql/apollo-android | package com.apollographql.apollo.gradle;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.apollographql.apollo.compiler.GraphQLCompiler;
import com.moowork.gradle.node.task.NodeTask;
import org.gradle.api.GradleException;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.OutputDirectory;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import javax.annotation.Nullable;
public class ApolloIRGenTask extends NodeTask {
static final String APOLLO_CODEGEN_EXEC_FILE = "lib/cli.js";
private static final String APOLLO_CODEGEN = "apollo-codegen/node_modules/apollo-codegen/" + APOLLO_CODEGEN_EXEC_FILE;
static final String NAME = "generate%sApolloIR";
@Internal private String variant;
@Internal private ImmutableList<String> sourceSets;
@OutputDirectory private File outputDir;
public void init(String variantName, ImmutableList<String> variantSourceSets) {
variant = variantName;
sourceSets = variantSourceSets;
outputDir = new File(getProject().getBuildDir() + File.separator +
Joiner.on(File.separator).join(GraphQLCompiler.Companion.getOUTPUT_DIRECTORY()) + "/generatedIR/" + variant);
}
@Override
public void exec() {
File apolloScript = new File(getProject().getBuildDir(), APOLLO_CODEGEN);
if (!apolloScript.isFile()) {
throw new GradleException("Apollo-codegen was not found in node_modules. Please run the installApolloCodegen task.");
}
setScript(apolloScript);
ImmutableMap<String, ApolloCodegenArgs> schemaQueryMap = buildSchemaQueryMap(getInputs().getSourceFiles().getFiles());
for (Map.Entry<String, ApolloCodegenArgs> entry : schemaQueryMap.entrySet()) {
String irOutput = outputDir.getAbsolutePath() + File.separator + getProject().relativePath(entry.getValue()
.getSchemaFile().getParent());
new File(irOutput).mkdirs();
List<String> apolloArgs = Lists.newArrayList("generate");
apolloArgs.addAll(entry.getValue().getQueryFiles());
apolloArgs.addAll(Lists.newArrayList("--add-typename",
"--schema", entry.getValue().getSchemaFile().getAbsolutePath(),
"--output", irOutput + File.separator + Utils.capitalize(variant) + "API.json",
"--operation-ids-path", irOutput + File.separator + Utils.capitalize(variant) + "OperationIdMap.json",
"--merge-in-fields-from-fragment-spreads", "false",
"--target", "json"));
setArgs(apolloArgs);
super.exec();
}
}
/**
* Extracts schema files from the task inputs and sorts them in a way similar to the Gradle lookup priority.
* That is, build variant source set, build type source set, product flavor source set and finally main
* source set.
*
* The schema file under the source set with the highest priority is used and all the graphql query files under the
* schema file's subdirectories from all source sets are used to generate the IR.
*
* If any of the schema file's ancestor directories contain a schema file, a GradleException is
* thrown. This is considered to be an ambiguous case.
*
* @param files - task input files which consist of .graphql query files and schema.json files
* @return - a map with schema files as a key and associated query files as a value
*/
private ImmutableMap<String, ApolloCodegenArgs> buildSchemaQueryMap(Set<File> files) {
final List<File> schemaFiles = getSchemaFilesFrom(files);
if (schemaFiles.isEmpty()) {
throw new GradleException("Couldn't find schema files for the variant " + Utils.capitalize(variant) + ". Please" +
" ensure a valid schema.json exists under the varian't source sets");
}
if (illegalSchemasFound(schemaFiles)) {
throw new GradleException("Found an ancestor directory to a schema file that contains another schema file." +
" Please ensure no schema files exist on the path to another one");
}
ImmutableMap.Builder<String, ApolloCodegenArgs> schemaQueryMap = ImmutableMap.builder();
for (final File f : schemaFiles) {
final String normalizedSchemaFileName = getPathRelativeToSourceSet(f);
// ensures that only the highest priority schema file is used
if (schemaQueryMap.build().containsKey(normalizedSchemaFileName)) {
continue;
}
schemaQueryMap.put(normalizedSchemaFileName, new ApolloCodegenArgs(f, FluentIterable.from(files).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && !schemaFiles.contains(file) && file.getParent().contains(getPathRelativeToSourceSet(f.getParentFile()));
}
}).transform(new Function<File, String>() {
@Nullable @Override public String apply(@Nullable File file) {
return file.getAbsolutePath();
}
}).toSet()));
}
return schemaQueryMap.build();
}
/**
* Returns "schema.json" files and sorts them based on their source set priorities.
*
* @return - schema files sorted by priority based on source set priority
*/
private List<File> getSchemaFilesFrom(Set<File> files) {
return FluentIterable.from(files).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && file.getName().equals(GraphQLSourceDirectorySet.SCHEMA_FILE_NAME);
}
}).toSortedList(new Comparator<File>() {
@Override public int compare(File o1, File o2) {
String sourceSet1 = getSourceSetNameFromFile(o1);
String sourceSet2 = getSourceSetNameFromFile(o2);
// negative because the sourceSets list is in reverse order
return -(sourceSets.indexOf(sourceSet1) - sourceSets.indexOf(sourceSet2));
}
});
}
/**
* Checks whether a schema file share an ancestor directory that also contains a schema file
*
* @param schemaFiles - task's input that have been identified as schema file
* @return - whether illegal schema files were found
*/
private boolean illegalSchemasFound(Collection<File> schemaFiles) {
for (final File f : schemaFiles) {
final Path parent = Paths.get(f.getParent()).toAbsolutePath();
List<File> matches = FluentIterable.from(schemaFiles).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && file != f && Paths.get(file.getParent()).startsWith(parent);
}
}).toList();
if (!matches.isEmpty()) {
return true;
}
}
return false;
}
/**
* Returns the source set folder name given a file path. Assumes the source set name
* follows the "src" folder based on the inputs received from GraphQLSourceDirectorySet.
*
* @return - sourceSet name
*/
private String getSourceSetNameFromFile(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(getProject().file("src").getAbsolutePath());
return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
}
/**
* Returns the file path relative to the sourceSet directory
*
* @return path relative to sourceSet directory
*/
private String getPathRelativeToSourceSet(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(getProject().file("src").getAbsolutePath() + File.separator + getSourceSetNameFromFile(file));
return basePath.relativize(absolutePath).toString();
}
public File getOutputDir() {
return outputDir;
}
}
| apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloIRGenTask.java | package com.apollographql.apollo.gradle;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.apollographql.apollo.compiler.GraphQLCompiler;
import com.moowork.gradle.node.task.NodeTask;
import org.gradle.api.GradleException;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.OutputDirectory;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
public class ApolloIRGenTask extends NodeTask {
static final String APOLLO_CODEGEN_EXEC_FILE = "lib/cli.js";
private static final String APOLLO_CODEGEN = "apollo-codegen/node_modules/apollo-codegen/" + APOLLO_CODEGEN_EXEC_FILE;
static final String NAME = "generate%sApolloIR";
@Internal private String variant;
@Internal private ImmutableList<String> sourceSets;
@OutputDirectory private File outputDir;
public void init(String variantName, ImmutableList<String> variantSourceSets) {
variant = variantName;
sourceSets = variantSourceSets;
outputDir = new File(getProject().getBuildDir() + File.separator +
Joiner.on(File.separator).join(GraphQLCompiler.Companion.getOUTPUT_DIRECTORY()) + "/generatedIR/" + variant);
}
@Override
public void exec() {
File apolloScript = new File(getProject().getBuildDir(), APOLLO_CODEGEN);
if (!apolloScript.isFile()) {
throw new GradleException("Apollo-codegen was not found in node_modules. Please run the installApolloCodegen task.");
}
setScript(apolloScript);
ImmutableMap<String, ApolloCodegenArgs> schemaQueryMap = buildSchemaQueryMap(getInputs().getSourceFiles().getFiles());
for (Map.Entry<String, ApolloCodegenArgs> entry : schemaQueryMap.entrySet()) {
String irOutput = outputDir.getAbsolutePath() + File.separator + getProject().relativePath(entry.getValue()
.getSchemaFile().getParent());
new File(irOutput).mkdirs();
List<String> apolloArgs = Lists.newArrayList("generate");
apolloArgs.addAll(entry.getValue().getQueryFiles());
apolloArgs.addAll(Lists.newArrayList("--add-typename",
"--schema", entry.getValue().getSchemaFile().getAbsolutePath(),
"--output", irOutput + File.separator + Utils.capitalize(variant) + "API.json",
"--operation-ids-path", irOutput + File.separator + Utils.capitalize(variant) + "OperationIdMap.json",
"--merge-in-fields-from-fragment-spreads", "false",
"--target", "json"));
setArgs(apolloArgs);
super.exec();
}
}
/**
* Extracts schema files from the task inputs and sorts them in a way similar to the Gradle lookup priority.
* That is, build variant source set, build type source set, product flavor source set and finally main
* source set.
*
* The schema file under the source set with the highest priority is used and all the graphql query files under the
* schema file's subdirectories from all source sets are used to generate the IR.
*
* If any of the schema file's ancestor directories contain a schema file, a GradleException is
* thrown. This is considered to be an ambiguous case.
*
* @param files - task input files which consist of .graphql query files and schema.json files
* @return - a map with schema files as a key and associated query files as a value
*/
private ImmutableMap<String, ApolloCodegenArgs> buildSchemaQueryMap(Set<File> files) {
final List<File> schemaFiles = getSchemaFilesFrom(files);
if (schemaFiles.isEmpty()) {
throw new GradleException("Couldn't find schema files for the variant " + Utils.capitalize(variant) + ". Please" +
" ensure a valid schema.json exists under the varian't source sets");
}
if (illegalSchemasFound(schemaFiles)) {
throw new GradleException("Found an ancestor directory to a schema file that contains another schema file." +
" Please ensure no schema files exist on the path to another one");
}
ImmutableMap.Builder<String, ApolloCodegenArgs> schemaQueryMap = ImmutableMap.builder();
for (final File f : schemaFiles) {
final String normalizedSchemaFileName = getPathRelativeToSourceSet(f);
// ensures that only the highest priority schema file is used
if (schemaQueryMap.build().containsKey(normalizedSchemaFileName)) {
continue;
}
schemaQueryMap.put(normalizedSchemaFileName, new ApolloCodegenArgs(f, FluentIterable.from(files).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && !schemaFiles.contains(file) && file.getParent().contains(getPathRelativeToSourceSet(f.getParentFile()));
}
}).transform(new Function<File, String>() {
@Nullable @Override public String apply(@Nullable File file) {
return file.getAbsolutePath();
}
}).toSet()));
}
return schemaQueryMap.build();
}
/**
* Returns "schema.json" files and sorts them based on their source set priorities.
*
* @return - schema files sorted by priority based on source set priority
*/
private List<File> getSchemaFilesFrom(Set<File> files) {
return FluentIterable.from(files).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && file.getName().equals(GraphQLSourceDirectorySet.SCHEMA_FILE_NAME);
}
}).toSortedList(new Comparator<File>() {
@Override public int compare(File o1, File o2) {
String sourceSet1 = getSourceSetNameFromFile(o1);
String sourceSet2 = getSourceSetNameFromFile(o2);
// negative because the sourceSets list is in reverse order
return -(sourceSets.indexOf(sourceSet1) - sourceSets.indexOf(sourceSet2));
}
});
}
/**
* Checks whether a schema file share an ancestor directory that also contains a schema file
*
* @param schemaFiles - task's input that have been identified as schema file
* @return - whether illegal schema files were found
*/
private boolean illegalSchemasFound(Collection<File> schemaFiles) {
for (final File f : schemaFiles) {
final Path parent = Paths.get(f.getParent()).toAbsolutePath();
List<File> matches = FluentIterable.from(schemaFiles).filter(new Predicate<File>() {
@Override public boolean apply(@Nullable File file) {
return file != null && file != f && Paths.get(file.getParent()).startsWith(parent);
}
}).toList();
if (!matches.isEmpty()) {
return true;
}
}
return false;
}
/**
* Returns the source set folder name given a file path. Assumes the source set name
* follows the "src" folder based on the inputs received from GraphQLSourceDirectorySet.
*
* @return - sourceSet name
*/
private String getSourceSetNameFromFile(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(getProject().file("src").getAbsolutePath());
return basePath.relativize(absolutePath).toString().split(File.separator)[0];
}
/**
* Returns the file path relative to the sourceSet directory
*
* @return path relative to sourceSet directory
*/
private String getPathRelativeToSourceSet(File file) {
Path absolutePath = Paths.get(file.getAbsolutePath());
Path basePath = Paths.get(getProject().file("src").getAbsolutePath() + File.separator + getSourceSetNameFromFile(file));
return basePath.relativize(absolutePath).toString();
}
public File getOutputDir() {
return outputDir;
}
}
| fix windows file separator handling (#634)
| apollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloIRGenTask.java | fix windows file separator handling (#634) | <ide><path>pollo-gradle-plugin/src/main/java/com/apollographql/apollo/gradle/ApolloIRGenTask.java
<ide> import java.util.List;
<ide> import java.util.Map;
<ide> import java.util.Set;
<add>import java.util.regex.Matcher;
<ide>
<ide> import javax.annotation.Nullable;
<ide>
<ide> Path absolutePath = Paths.get(file.getAbsolutePath());
<ide> Path basePath = Paths.get(getProject().file("src").getAbsolutePath());
<ide>
<del> return basePath.relativize(absolutePath).toString().split(File.separator)[0];
<add> return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
<ide> }
<ide>
<ide> /** |
|
JavaScript | mit | 1f95aba862adf1e8dc84b6359a14a7e74d4a21a9 | 0 | zeit/styled-jsx | import * as t from 'babel-types'
import { STYLE_COMPONENT } from './_constants'
import {
getJSXStyleInfo,
processCss,
cssToBabelType,
validateExternalExpressions,
getScope,
computeClassNames,
makeStyledJsxTag,
createReactComponentImportDeclaration,
setStateOptions
} from './_utils'
const isModuleExports = t.buildMatchMemberExpression('module.exports')
export function processTaggedTemplateExpression({
type,
path,
fileInfo,
splitRules,
plugins,
vendorPrefixes
}) {
const templateLiteral = path.get('quasi')
let scope
// Check whether there are undefined references or
// references to this.something (e.g. props or state).
// We allow dynamic styles only when resolving styles.
if (type !== 'resolve') {
validateExternalExpressions(templateLiteral)
} else if (!path.scope.path.isProgram()) {
scope = getScope(path)
}
const stylesInfo = getJSXStyleInfo(templateLiteral, scope)
const { staticClassName, className } = computeClassNames([stylesInfo])
const styles = processCss(
{
...stylesInfo,
staticClassName,
fileInfo,
isGlobal: type === 'global',
plugins,
vendorPrefixes
},
{ splitRules }
)
if (type === 'resolve') {
const { hash, css, expressions } = styles
path.replaceWith(
// {
// styles: <_JSXStyle ... />,
// className: 'jsx-123'
// }
t.objectExpression([
t.objectProperty(
t.identifier('styles'),
makeStyledJsxTag(hash, css, expressions)
),
t.objectProperty(t.identifier('className'), className)
])
)
return
}
const id = path.parentPath.node.id
const baseExportName = id ? id.name : 'default'
let parentPath =
baseExportName === 'default'
? path.parentPath
: path.findParent(
path =>
path.isVariableDeclaration() ||
(path.isAssignmentExpression() &&
isModuleExports(path.get('left').node))
)
if (baseExportName !== 'default' && !parentPath.parentPath.isProgram()) {
parentPath = parentPath.parentPath
}
const css = cssToBabelType(styles.css)
const newPath = t.isArrayExpression(css)
? css
: t.newExpression(t.identifier('String'), [css])
// default exports
if (baseExportName === 'default') {
const defaultExportIdentifier = path.scope.generateUidIdentifier(
'defaultExport'
)
parentPath.insertBefore(
t.variableDeclaration('const', [
t.variableDeclarator(defaultExportIdentifier, newPath)
])
)
parentPath.insertBefore(addHash(defaultExportIdentifier, styles.hash))
path.replaceWith(defaultExportIdentifier)
return
}
// local and named exports
parentPath.insertAfter(addHash(t.identifier(baseExportName), styles.hash))
path.replaceWith(newPath)
}
function addHash(exportIdentifier, hash) {
const value = typeof hash === 'string' ? t.stringLiteral(hash) : hash
return t.expressionStatement(
t.assignmentExpression(
'=',
t.memberExpression(exportIdentifier, t.identifier('__hash')),
value
)
)
}
export const visitor = {
ImportDeclaration(path, state) {
// import css from 'styled-jsx/css'
if (path.node.source.value !== 'styled-jsx/css') {
return
}
// Find all the imported specifiers.
// e.g import css, { global, resolve } from 'styled-jsx/css'
// -> ['css', 'global', 'resolve']
const specifiersNames = path.node.specifiers.map(
specifier => specifier.local.name
)
specifiersNames.forEach(tagName => {
// Get all the reference paths i.e. the places that use the tagName above
// eg.
// css`div { color: red }`
// css.global`div { color: red }`
// global`div { color: red `
const binding = path.scope.getBinding(tagName)
if (!binding || !Array.isArray(binding.referencePaths)) {
return
}
// Produces an object containing all the TaggedTemplateExpression paths detected.
// The object contains { scoped, global, resolve }
const taggedTemplateExpressions = binding.referencePaths
.map(ref => ref.parentPath)
.reduce(
(result, path) => {
let taggedTemplateExpression
if (path.isTaggedTemplateExpression()) {
// css`` global`` resolve``
taggedTemplateExpression = path
} else if (
path.parentPath &&
path.isMemberExpression() &&
path.parentPath.isTaggedTemplateExpression()
) {
// This part is for css.global`` or css.resolve``
// using the default import css
taggedTemplateExpression = path.parentPath
} else {
return result
}
const tag = taggedTemplateExpression.get('tag')
const id = tag.isIdentifier()
? tag.node.name
: tag.get('property').node.name
if (result[id]) {
result[id].push(taggedTemplateExpression)
} else {
result.scoped.push(taggedTemplateExpression)
}
return result
},
{
scoped: [],
global: [],
resolve: []
}
)
let hasJSXStyle = false
const { vendorPrefixes, sourceMaps } = state.opts
Object.keys(taggedTemplateExpressions).forEach(type =>
taggedTemplateExpressions[type].forEach(path => {
hasJSXStyle = true
// Process each css block
processTaggedTemplateExpression({
type,
path,
fileInfo: {
file: state.file,
sourceFileName:
state.file.opts.sourceFileName || state.file.sourceFileName,
sourceMaps,
filename: state.file.opts.filename || state.file.filename
},
splitRules:
typeof state.opts.optimizeForSpeed === 'boolean'
? state.opts.optimizeForSpeed
: process.env.NODE_ENV === 'production',
plugins: state.plugins,
vendorPrefixes
})
})
)
// When using the `resolve` helper we need to add an import
// for the _JSXStyle component `styled-jsx/style`
if (
hasJSXStyle &&
taggedTemplateExpressions.resolve.length > 0 &&
!state.hasInjectedJSXStyle &&
!path.scope.hasBinding(STYLE_COMPONENT)
) {
state.hasInjectedJSXStyle = true
const importDeclaration = createReactComponentImportDeclaration()
path.scope.path.node.body.unshift(importDeclaration)
}
})
// Finally remove the import
path.remove()
}
}
export default function() {
return {
Program(path, state) {
setStateOptions(state)
},
...visitor
}
}
| src/babel-external.js | import * as t from 'babel-types'
import { STYLE_COMPONENT } from './_constants'
import {
getJSXStyleInfo,
processCss,
cssToBabelType,
validateExternalExpressions,
getScope,
computeClassNames,
makeStyledJsxTag,
createReactComponentImportDeclaration,
setStateOptions
} from './_utils'
const isModuleExports = t.buildMatchMemberExpression('module.exports')
export function processTaggedTemplateExpression({
type,
path,
fileInfo,
splitRules,
plugins,
vendorPrefixes
}) {
const templateLiteral = path.get('quasi')
let scope
// Check whether there are undefined references or
// references to this.something (e.g. props or state).
// We allow dynamic styles only when resolving styles.
if (type !== 'resolve') {
validateExternalExpressions(templateLiteral)
} else if (!path.scope.path.isProgram()) {
scope = getScope(path)
}
const stylesInfo = getJSXStyleInfo(templateLiteral, scope)
const { staticClassName, className } = computeClassNames([stylesInfo])
const styles = processCss(
{
...stylesInfo,
staticClassName,
fileInfo,
isGlobal: type === 'global',
plugins,
vendorPrefixes
},
{ splitRules }
)
if (type === 'resolve') {
const { hash, css, expressions } = styles
path.replaceWith(
// {
// styles: <_JSXStyle ... />,
// className: 'jsx-123'
// }
t.objectExpression([
t.objectProperty(
t.identifier('styles'),
makeStyledJsxTag(hash, css, expressions)
),
t.objectProperty(t.identifier('className'), className)
])
)
return
}
const id = path.parentPath.node.id
const baseExportName = id ? id.name : 'default'
let parentPath =
baseExportName === 'default'
? path.parentPath
: path.findParent(
path =>
path.isVariableDeclaration() ||
(path.isAssignmentExpression() &&
isModuleExports(path.get('left').node))
)
if (baseExportName !== 'default' && !parentPath.parentPath.isProgram()) {
parentPath = parentPath.parentPath
}
const css = cssToBabelType(styles.css)
const newPath = t.isArrayExpression(css)
? css
: t.newExpression(t.identifier('String'), [css])
// default exports
if (baseExportName === 'default') {
const defaultExportIdentifier = path.scope.generateUidIdentifier(
'defaultExport'
)
parentPath.insertBefore(
t.variableDeclaration('const', [
t.variableDeclarator(defaultExportIdentifier, newPath)
])
)
parentPath.insertBefore(addHash(defaultExportIdentifier, styles.hash))
path.replaceWith(defaultExportIdentifier)
return
}
// local and named exports
parentPath.insertAfter(addHash(t.identifier(baseExportName), styles.hash))
path.replaceWith(newPath)
}
function addHash(exportIdentifier, hash) {
const value = typeof hash === 'string' ? t.stringLiteral(hash) : hash
return t.expressionStatement(
t.assignmentExpression(
'=',
t.memberExpression(exportIdentifier, t.identifier('__hash')),
value
)
)
}
export const visitor = {
ImportDeclaration(path, state) {
// import css from 'styled-jsx/css'
if (path.node.source.value !== 'styled-jsx/css') {
return
}
// Find all the imported specifiers.
// e.g import css, { global, resolve } from 'styled-jsx/css'
// -> ['css', 'global', 'resolve']
const specifiersNames = path.node.specifiers.map(
specifier => specifier.local.name
)
specifiersNames.forEach(tagName => {
// Get all the reference paths i.e. the places that use the tagName above
// eg.
// css`div { color: red }`
// css.global`div { color: red }`
// global`div { color: red `
const binding = path.scope.getBinding(tagName)
if (!binding || !Array.isArray(binding.referencePaths)) {
return
}
// Produces an object containing all the TaggedTemplateExpression paths detected.
// The object contains { scoped, global, resolve }
const taggedTemplateExpressions = binding.referencePaths
.map(ref => ref.parentPath)
.reduce(
(result, path) => {
let taggedTemplateExpression
if (path.isTaggedTemplateExpression()) {
// css`` global`` resolve``
taggedTemplateExpression = path
} else if (
path.parentPath &&
path.isMemberExpression() &&
path.parentPath.isTaggedTemplateExpression()
) {
// This part is for css.global`` or css.resolve``
// using the default import css
taggedTemplateExpression = path.parentPath
} else {
return result
}
const tag = taggedTemplateExpression.get('tag')
const id = tag.isIdentifier()
? tag.node.name
: tag.get('property').node.name
if (result[id]) {
result[id].push(taggedTemplateExpression)
} else {
result.scoped.push(taggedTemplateExpression)
}
return result
},
{
scoped: [],
global: [],
resolve: []
}
)
let hasJSXStyle = false
const { vendorPrefixes, sourceMaps } = state.opts
Object.keys(taggedTemplateExpressions).forEach(type =>
taggedTemplateExpressions[type].forEach(path => {
hasJSXStyle = true
// Process each css block
processTaggedTemplateExpression({
type,
path,
fileInfo: {
file: state.file,
sourceFileName: state.file.opts.sourceFileName,
sourceMaps
},
splitRules:
typeof state.opts.optimizeForSpeed === 'boolean'
? state.opts.optimizeForSpeed
: process.env.NODE_ENV === 'production',
plugins: state.plugins,
vendorPrefixes
})
})
)
// When using the `resolve` helper we need to add an import
// for the _JSXStyle component `styled-jsx/style`
if (
hasJSXStyle &&
taggedTemplateExpressions.resolve.length > 0 &&
!state.hasInjectedJSXStyle &&
!path.scope.hasBinding(STYLE_COMPONENT)
) {
state.hasInjectedJSXStyle = true
const importDeclaration = createReactComponentImportDeclaration()
path.scope.path.node.body.unshift(importDeclaration)
}
})
// Finally remove the import
path.remove()
}
}
export default function() {
return {
Program(path, state) {
setStateOptions(state)
},
...visitor
}
}
| Add missing filename opt for external files (#526)
| src/babel-external.js | Add missing filename opt for external files (#526) | <ide><path>rc/babel-external.js
<ide> path,
<ide> fileInfo: {
<ide> file: state.file,
<del> sourceFileName: state.file.opts.sourceFileName,
<del> sourceMaps
<add> sourceFileName:
<add> state.file.opts.sourceFileName || state.file.sourceFileName,
<add> sourceMaps,
<add> filename: state.file.opts.filename || state.file.filename
<ide> },
<ide> splitRules:
<ide> typeof state.opts.optimizeForSpeed === 'boolean' |
|
Java | epl-1.0 | c18fba3d3753a7d96c6709e4f470cfdd48393579 | 0 | gnodet/wikitext | /*******************************************************************************
* Copyright (c) 2004, 2007 Mylyn project committers and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.core.sync;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.Policy;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryModel;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tasks.core.data.TaskRelation;
import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession;
import org.eclipse.mylyn.tasks.core.sync.SynchronizationJob;
/**
* @author Mik Kersten
* @author Rob Elves
* @author Steffen Pingel
*/
public class SynchronizeQueriesJob extends SynchronizationJob {
private static class MutexRule implements ISchedulingRule {
private final Object object;
public MutexRule(Object object) {
this.object = object;
}
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof MutexRule) {
return object.equals(((MutexRule) rule).object);
}
return false;
}
}
@SuppressWarnings("deprecation")
private class TaskCollector extends LegacyTaskDataCollector {
private final Set<ITask> removedQueryResults;
private final RepositoryQuery repositoryQuery;
private int resultCount;
private final SynchronizationSession session;
public TaskCollector(RepositoryQuery repositoryQuery, SynchronizationSession session) {
this.repositoryQuery = repositoryQuery;
this.session = session;
this.removedQueryResults = new HashSet<ITask>(repositoryQuery.getChildren());
}
@Override
public void accept(TaskData taskData) {
ITask task = taskList.getTask(taskData.getRepositoryUrl(), taskData.getTaskId());
if (task == null) {
task = tasksModel.createTask(repository, taskData.getTaskId());
if (taskData.isPartial()) {
session.markStale(task);
}
} else {
removedQueryResults.remove(task);
}
try {
session.putTaskData(task, taskData);
} catch (CoreException e) {
StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed to save task", e));
}
taskList.addTask(task, repositoryQuery);
resultCount++;
}
@Override
@Deprecated
public void accept(RepositoryTaskData taskData) {
boolean changed;
AbstractTask task = (AbstractTask) taskList.getTask(taskData.getRepositoryUrl(), taskData.getTaskId());
if (task == null) {
task = ((AbstractLegacyRepositoryConnector) connector).createTask(taskData.getRepositoryUrl(),
taskData.getTaskId(), "");
task.setStale(true);
changed = ((AbstractLegacyRepositoryConnector) connector).updateTaskFromTaskData(repository, task,
taskData);
} else {
changed = ((AbstractLegacyRepositoryConnector) connector).updateTaskFromTaskData(repository, task,
taskData);
removedQueryResults.remove(task);
}
taskList.addTask(task, repositoryQuery);
if (!taskData.isPartial()) {
(taskDataManager).saveIncoming(task, taskData, isUser());
} else if (changed && !task.isStale()
&& task.getSynchronizationState() == SynchronizationState.SYNCHRONIZED) {
// TODO move to synchronizationManager
// set incoming marker for web tasks
task.setSynchronizationState(SynchronizationState.INCOMING);
}
if (task.isStale()) {
session.markStale(task);
task.setSynchronizing(true);
}
resultCount++;
}
public Set<ITask> getRemovedChildren() {
return removedQueryResults;
}
public int getResultCount() {
return resultCount;
}
}
public static final String MAX_HITS_REACHED = "Max allowed number of hits returned exceeded. Some hits may not be displayed. Please narrow query scope.";
private final AbstractRepositoryConnector connector;
private final Set<RepositoryQuery> queries;
private final TaskRepository repository;
private final TaskDataManager taskDataManager;
private final TaskList taskList;
private final IRepositoryModel tasksModel;
public SynchronizeQueriesJob(TaskList taskList, TaskDataManager taskDataManager, IRepositoryModel tasksModel,
AbstractRepositoryConnector connector, TaskRepository repository, Set<RepositoryQuery> queries) {
super("Synchronizing Queries (" + repository.getRepositoryLabel() + ")");
this.taskList = taskList;
this.taskDataManager = taskDataManager;
this.tasksModel = tasksModel;
this.connector = connector;
this.repository = repository;
this.queries = queries;
}
@Override
public IStatus run(IProgressMonitor monitor) {
try {
monitor.beginTask("Processing", 20 + queries.size() * 20 + 40 + 10);
Set<ITask> allTasks;
if (!isFullSynchronization()) {
allTasks = new HashSet<ITask>();
for (RepositoryQuery query : queries) {
allTasks.addAll(query.getChildren());
}
} else {
allTasks = taskList.getTasks(repository.getRepositoryUrl());
}
MutexRule rule = new MutexRule(repository);
try {
Job.getJobManager().beginRule(rule, monitor);
final Map<String, TaskRelation[]> relationsByTaskId = new HashMap<String, TaskRelation[]>();
SynchronizationSession session = new SynchronizationSession(taskDataManager) {
@Override
public void putTaskData(ITask task, TaskData taskData) throws CoreException {
taskDataManager.putUpdatedTaskData(task, taskData, isUser(), this);
if (!taskData.isPartial()) {
Collection<TaskRelation> relations = connector.getTaskRelations(taskData);
if (relations != null) {
relationsByTaskId.put(task.getTaskId(), relations.toArray(new TaskRelation[0]));
}
}
}
};
session.setTaskRepository(repository);
session.setFullSynchronization(isFullSynchronization());
session.setTasks(Collections.unmodifiableSet(allTasks));
session.setNeedsPerformQueries(true);
session.setUser(isUser());
preSynchronization(session, new SubProgressMonitor(monitor, 20));
if (session.needsPerformQueries()) {
// synchronize queries, tasks changed within query are added to set of tasks to be synchronized
synchronizeQueries(monitor, session);
} else {
monitor.worked(queries.size() * 20);
}
Set<ITask> tasksToBeSynchronized = new HashSet<ITask>();
if (session.getStaleTasks() != null) {
for (ITask task : session.getStaleTasks()) {
tasksToBeSynchronized.add(task);
((AbstractTask) task).setSynchronizing(true);
}
}
// synchronize tasks that were marked by the connector
SynchronizeTasksJob job = new SynchronizeTasksJob(taskList, taskDataManager, tasksModel, connector,
repository, tasksToBeSynchronized);
job.setUser(isUser());
job.setSession(session);
if (!tasksToBeSynchronized.isEmpty()) {
Policy.checkCanceled(monitor);
job.run(new SubProgressMonitor(monitor, 30));
}
monitor.subTask("Receiving related tasks");
job.synchronizedTaskRelations(monitor, relationsByTaskId);
monitor.worked(10);
session.setChangedTasks(tasksToBeSynchronized);
// hook into the connector for synchronization time stamp management
postSynchronization(session, new SubProgressMonitor(monitor, 10));
} finally {
Job.getJobManager().endRule(rule);
}
} catch (OperationCanceledException e) {
return Status.CANCEL_STATUS;
} catch (Exception e) {
StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e));
} finally {
monitor.done();
}
return Status.OK_STATUS;
}
private void synchronizeQueries(IProgressMonitor monitor, SynchronizationSession session) {
for (RepositoryQuery repositoryQuery : queries) {
Policy.checkCanceled(monitor);
repositoryQuery.setStatus(null);
monitor.subTask("Synchronizing query " + repositoryQuery.getSummary());
synchronizeQuery(repositoryQuery, session, new SubProgressMonitor(monitor, 20));
repositoryQuery.setSynchronizing(false);
taskList.notifySynchronizationStateChanged(Collections.singleton(repositoryQuery));
}
}
private boolean postSynchronization(SynchronizationSession event, IProgressMonitor monitor) {
try {
Policy.checkCanceled(monitor);
monitor.subTask("Updating repository state");
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
connector.postSynchronization(event, monitor);
return true;
} catch (CoreException e) {
updateQueryStatus(e.getStatus());
return false;
}
}
private boolean preSynchronization(ISynchronizationSession event, IProgressMonitor monitor) {
try {
Policy.checkCanceled(monitor);
monitor.subTask("Querying repository");
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
connector.preSynchronization(event, monitor);
if (!event.needsPerformQueries() && !isUser()) {
updateQueryStatus(null);
return false;
}
return true;
} catch (CoreException e) {
// synchronization is unlikely to succeed, inform user and exit
updateQueryStatus(e.getStatus());
return false;
}
}
private void synchronizeQuery(RepositoryQuery repositoryQuery, SynchronizationSession event,
IProgressMonitor monitor) {
TaskCollector collector = new TaskCollector(repositoryQuery, event);
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
IStatus result = connector.performQuery(repository, repositoryQuery, collector, event, monitor);
if (result.getSeverity() == IStatus.CANCEL) {
// do nothing
} else if (result.isOK()) {
if (collector.getResultCount() >= TaskDataCollector.MAX_HITS) {
StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, MAX_HITS_REACHED + "\n"
+ repositoryQuery.getSummary()));
}
Set<ITask> removedChildren = collector.getRemovedChildren();
if (!removedChildren.isEmpty()) {
taskList.removeFromContainer(repositoryQuery, removedChildren);
}
repositoryQuery.setLastSynchronizedStamp(new SimpleDateFormat("MMM d, H:mm:ss").format(new Date()));
} else {
repositoryQuery.setStatus(result);
}
}
private void updateQueryStatus(final IStatus status) {
for (RepositoryQuery repositoryQuery : queries) {
repositoryQuery.setStatus(status);
repositoryQuery.setSynchronizing(false);
taskList.notifyElementChanged(repositoryQuery);
}
}
}
| org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java | /*******************************************************************************
* Copyright (c) 2004, 2007 Mylyn project committers and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.core.sync;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.Policy;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyRepositoryConnector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.LegacyTaskDataCollector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryModel;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
import org.eclipse.mylyn.tasks.core.data.TaskRelation;
import org.eclipse.mylyn.tasks.core.sync.ISynchronizationSession;
import org.eclipse.mylyn.tasks.core.sync.SynchronizationJob;
/**
* @author Mik Kersten
* @author Rob Elves
* @author Steffen Pingel
*/
public class SynchronizeQueriesJob extends SynchronizationJob {
private static class MutexRule implements ISchedulingRule {
private final Object object;
public MutexRule(Object object) {
this.object = object;
}
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof MutexRule) {
return object.equals(((MutexRule) rule).object);
}
return false;
}
}
@SuppressWarnings("deprecation")
private class TaskCollector extends LegacyTaskDataCollector {
private final Set<ITask> removedQueryResults;
private final RepositoryQuery repositoryQuery;
private int resultCount;
private final SynchronizationSession session;
public TaskCollector(RepositoryQuery repositoryQuery, SynchronizationSession session) {
this.repositoryQuery = repositoryQuery;
this.session = session;
this.removedQueryResults = new HashSet<ITask>(repositoryQuery.getChildren());
}
@Override
public void accept(TaskData taskData) {
ITask task = taskList.getTask(taskData.getRepositoryUrl(), taskData.getTaskId());
if (task == null) {
task = tasksModel.createTask(repository, taskData.getTaskId());
if (taskData.isPartial()) {
session.markStale(task);
}
} else {
removedQueryResults.remove(task);
}
try {
session.putTaskData(task, taskData);
} catch (CoreException e) {
StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Failed to save task", e));
}
taskList.addTask(task, repositoryQuery);
resultCount++;
}
@Override
@Deprecated
public void accept(RepositoryTaskData taskData) {
boolean changed;
AbstractTask task = (AbstractTask) taskList.getTask(taskData.getRepositoryUrl(), taskData.getTaskId());
if (task == null) {
task = ((AbstractLegacyRepositoryConnector) connector).createTask(taskData.getRepositoryUrl(),
taskData.getTaskId(), "");
task.setStale(true);
changed = ((AbstractLegacyRepositoryConnector) connector).updateTaskFromTaskData(repository, task,
taskData);
} else {
changed = ((AbstractLegacyRepositoryConnector) connector).updateTaskFromTaskData(repository, task,
taskData);
removedQueryResults.remove(task);
}
taskList.addTask(task, repositoryQuery);
if (!taskData.isPartial()) {
(taskDataManager).saveIncoming(task, taskData, isUser());
} else if (changed && !task.isStale()
&& task.getSynchronizationState() == SynchronizationState.SYNCHRONIZED) {
// TODO move to synchronizationManager
// set incoming marker for web tasks
task.setSynchronizationState(SynchronizationState.INCOMING);
}
if (task.isStale()) {
session.markStale(task);
task.setSynchronizing(true);
}
resultCount++;
}
public Set<ITask> getRemovedChildren() {
return removedQueryResults;
}
public int getResultCount() {
return resultCount;
}
}
public static final String MAX_HITS_REACHED = "Max allowed number of hits returned exceeded. Some hits may not be displayed. Please narrow query scope.";
private final AbstractRepositoryConnector connector;
private final Set<RepositoryQuery> queries;
private final TaskRepository repository;
private final TaskDataManager taskDataManager;
private final TaskList taskList;
private final IRepositoryModel tasksModel;
public SynchronizeQueriesJob(TaskList taskList, TaskDataManager taskDataManager, IRepositoryModel tasksModel,
AbstractRepositoryConnector connector, TaskRepository repository, Set<RepositoryQuery> queries) {
super("Synchronizing Queries (" + repository.getRepositoryLabel() + ")");
this.taskList = taskList;
this.taskDataManager = taskDataManager;
this.tasksModel = tasksModel;
this.connector = connector;
this.repository = repository;
this.queries = queries;
}
@Override
public IStatus run(IProgressMonitor monitor) {
try {
monitor.beginTask("Processing", 20 + queries.size() * 20 + 40 + 10);
Set<ITask> allTasks;
if (!isFullSynchronization()) {
allTasks = new HashSet<ITask>();
for (RepositoryQuery query : queries) {
allTasks.addAll(query.getChildren());
}
} else {
allTasks = taskList.getTasks(repository.getRepositoryUrl());
}
MutexRule rule = new MutexRule(repository);
try {
Job.getJobManager().beginRule(rule, monitor);
final Map<String, TaskRelation[]> relationsByTaskId = new HashMap<String, TaskRelation[]>();
SynchronizationSession session = new SynchronizationSession(taskDataManager) {
@Override
public void putTaskData(ITask task, TaskData taskData) throws CoreException {
taskDataManager.putUpdatedTaskData(task, taskData, isUser(), this);
if (!taskData.isPartial()) {
Collection<TaskRelation> relations = connector.getTaskRelations(taskData);
if (relations != null) {
relationsByTaskId.put(task.getTaskId(), relations.toArray(new TaskRelation[0]));
}
}
}
};
session.setTaskRepository(repository);
session.setFullSynchronization(isFullSynchronization());
session.setTasks(Collections.unmodifiableSet(allTasks));
session.setNeedsPerformQueries(true);
session.setUser(isUser());
preSynchronization(session, new SubProgressMonitor(monitor, 20));
if (session.needsPerformQueries()) {
// synchronize queries, tasks changed within query are added to set of tasks to be synchronized
synchronizeQueries(monitor, session);
} else {
monitor.worked(queries.size() * 20);
}
Set<ITask> tasksToBeSynchronized = new HashSet<ITask>();
if (session.getStaleTasks() != null) {
for (ITask task : session.getStaleTasks()) {
tasksToBeSynchronized.add(task);
((AbstractTask) task).setSynchronizing(true);
}
}
// synchronize tasks that were marked by the connector
SynchronizeTasksJob job = new SynchronizeTasksJob(taskList, taskDataManager, tasksModel, connector,
repository, tasksToBeSynchronized);
job.setUser(isUser());
job.setSession(session);
if (!tasksToBeSynchronized.isEmpty()) {
Policy.checkCanceled(monitor);
job.run(new SubProgressMonitor(monitor, 30));
}
monitor.subTask("Receiving related tasks");
job.synchronizedTaskRelations(monitor, relationsByTaskId);
monitor.worked(10);
session.setChangedTasks(tasksToBeSynchronized);
// hook into the connector for synchronization time stamp management
postSynchronization(session, new SubProgressMonitor(monitor, 10));
} finally {
Job.getJobManager().endRule(rule);
}
return Status.OK_STATUS;
} catch (OperationCanceledException e) {
return Status.CANCEL_STATUS;
} finally {
monitor.done();
}
}
private void synchronizeQueries(IProgressMonitor monitor, SynchronizationSession session) {
for (RepositoryQuery repositoryQuery : queries) {
Policy.checkCanceled(monitor);
repositoryQuery.setStatus(null);
monitor.subTask("Synchronizing query " + repositoryQuery.getSummary());
synchronizeQuery(repositoryQuery, session, new SubProgressMonitor(monitor, 20));
repositoryQuery.setSynchronizing(false);
taskList.notifySynchronizationStateChanged(Collections.singleton(repositoryQuery));
}
}
private boolean postSynchronization(SynchronizationSession event, IProgressMonitor monitor) {
try {
Policy.checkCanceled(monitor);
monitor.subTask("Updating repository state");
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
connector.postSynchronization(event, monitor);
return true;
} catch (CoreException e) {
updateQueryStatus(e.getStatus());
return false;
}
}
private boolean preSynchronization(ISynchronizationSession event, IProgressMonitor monitor) {
try {
Policy.checkCanceled(monitor);
monitor.subTask("Querying repository");
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
connector.preSynchronization(event, monitor);
if (!event.needsPerformQueries() && !isUser()) {
updateQueryStatus(null);
return false;
}
return true;
} catch (CoreException e) {
// synchronization is unlikely to succeed, inform user and exit
updateQueryStatus(e.getStatus());
return false;
}
}
private void synchronizeQuery(RepositoryQuery repositoryQuery, SynchronizationSession event,
IProgressMonitor monitor) {
TaskCollector collector = new TaskCollector(repositoryQuery, event);
if (!isUser()) {
monitor = Policy.backgroundMonitorFor(monitor);
}
IStatus result = connector.performQuery(repository, repositoryQuery, collector, event, monitor);
if (result.getSeverity() == IStatus.CANCEL) {
// do nothing
} else if (result.isOK()) {
if (collector.getResultCount() >= TaskDataCollector.MAX_HITS) {
StatusHandler.log(new Status(IStatus.WARNING, ITasksCoreConstants.ID_PLUGIN, MAX_HITS_REACHED + "\n"
+ repositoryQuery.getSummary()));
}
Set<ITask> removedChildren = collector.getRemovedChildren();
if (!removedChildren.isEmpty()) {
taskList.removeFromContainer(repositoryQuery, removedChildren);
}
repositoryQuery.setLastSynchronizedStamp(new SimpleDateFormat("MMM d, H:mm:ss").format(new Date()));
} else {
repositoryQuery.setStatus(result);
}
}
private void updateQueryStatus(final IStatus status) {
for (RepositoryQuery repositoryQuery : queries) {
repositoryQuery.setStatus(status);
repositoryQuery.setSynchronizing(false);
taskList.notifyElementChanged(repositoryQuery);
}
}
}
| NEW - bug 225033: [api] ensure consistent naming of API classes and methods
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225033
| org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java | NEW - bug 225033: [api] ensure consistent naming of API classes and methods https://bugs.eclipse.org/bugs/show_bug.cgi?id=225033 | <ide><path>rg.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeQueriesJob.java
<ide> } finally {
<ide> Job.getJobManager().endRule(rule);
<ide> }
<del> return Status.OK_STATUS;
<ide> } catch (OperationCanceledException e) {
<ide> return Status.CANCEL_STATUS;
<add> } catch (Exception e) {
<add> StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Synchronization failed", e));
<ide> } finally {
<ide> monitor.done();
<ide> }
<add> return Status.OK_STATUS;
<ide> }
<ide>
<ide> private void synchronizeQueries(IProgressMonitor monitor, SynchronizationSession session) { |
|
JavaScript | lgpl-2.1 | beb35e198dd92a33fe4496d90e2381aa12072d34 | 0 | FernCreek/tinymce,tinymce/tinymce,FernCreek/tinymce,FernCreek/tinymce,tinymce/tinymce,TeamupCom/tinymce,TeamupCom/tinymce,tinymce/tinymce | define(
'ephox.phoenix.wrap.SpanWrap',
[
'ephox.bud.Unicode',
'ephox.compass.Arr',
'ephox.peanut.Fun',
'ephox.perhaps.Option',
'ephox.phoenix.api.data.Spot',
'ephox.phoenix.api.general.Injection',
'ephox.phoenix.wrap.Wrapper',
'ephox.phoenix.wrap.Wraps',
'ephox.scullion.Struct'
],
function (Unicode, Arr, Fun, Option, Spot, Injection, Wrapper, Wraps, Struct) {
var point = function (universe, start, soffset, finish, foffset, exclusions) {
var scanned = scan(universe, start, soffset, finish, foffset, exclusions);
var cursor = scanned.cursor();
var range = Spot.points(
Spot.point(cursor.element(), cursor.offset()),
Spot.point(cursor.element(), cursor.offset())
);
return Option.some({
range: Fun.constant(range),
temporary: scanned.temporary,
wrappers: scanned.wrappers
});
};
var spanCursor = Struct.immutable('span', 'cursor');
/// TODO this was copied from boss DomUniverse, use that instead
var isEmptyTag = function (universe, item) {
return Arr.contains([ 'br', 'img', 'hr', 'input' ], universe.property().name(item));
};
var temporary = function (universe, start, soffset, finish, foffset) {
var doc = start.dom().ownerDocument;
var span = universe.create().nu('span', doc);
var cursor = universe.create().text(Unicode.zeroWidth(), doc);
universe.insert().append(span, cursor);
/// TODO don't append to empty tags (might be better in Injection.atStartOf)
/// also need to twiddle the offset
var injectAt = isEmptyTag(universe, start) ? universe.property().parent(start) : Option.some(start);
injectAt.each(function (z) {
Injection.atStartOf(universe, z, soffset, span);
});
// Injection.atStartOf(universe, injectAt, soffset, span);
return {
cursor: Fun.constant(Spot.point(cursor, 1)),
wrappers: Fun.constant([ span ]),
temporary: Fun.constant(true)
};
};
/*
* The point approach needs to reuse a temporary span (if we already have one) or create one if we don't.
*/
var scan = function (universe, start, soffset, finish, foffset, exclusions) {
return universe.property().parent(start).bind(function (parent) {
var cursor = Spot.point(start, soffset);
var canReuse = isSpan(universe, exclusions, parent) && universe.property().children(parent).length === 1 && isUnicode(universe, start);
return canReuse ? Option.some({
cursor: Fun.constant(cursor),
temporary: Fun.constant(false),
wrappers: Fun.constant([ parent ])
}) : Option.none();
}).getOrThunk(function () {
return temporary(universe, start, soffset, finish, foffset);
});
};
var isUnicode = function (universe, element) {
return universe.property().isText(element) && universe.property().getText(element) === Unicode.zeroWidth();
};
var isSpan = function (universe, exclusions, elem) {
return universe.property().name(elem) === 'span' && exclusions(elem) === false;
};
var wrap = function (universe, start, soffset, finish, foffset, exclusions) {
var doc = start.dom().ownerDocument;
var nuSpan = function () {
return Wraps(universe, universe.create().nu('span', doc));
};
var wrappers = Wrapper.reuse(universe, start, soffset, finish, foffset, Fun.curry(isSpan, universe, exclusions), nuSpan);
return Option.from(wrappers[wrappers.length - 1]).map(function (lastSpan) {
var lastOffset = universe.property().children(lastSpan).length;
var range = Spot.points(
Spot.point(wrappers[0], 0),
Spot.point(lastSpan, lastOffset)
);
return {
wrappers: Fun.constant(wrappers),
temporary: Fun.constant(false),
range: Fun.constant(range)
};
});
};
var isCollapsed = function (universe, start, soffset, finish, foffset) {
return universe.eq(start, finish) && soffset === foffset;
};
var spans = function (universe, start, soffset, finish, foffset, _exclusions) {
var exclusions = _exclusions !== undefined ? _exclusions : Fun.constant(false);
var wrapper = isCollapsed(universe, start, soffset, finish, foffset) ? point : wrap;
return wrapper(universe, start, soffset, finish, foffset, exclusions);
};
return {
spans: spans
};
}
); | src/main/js/ephox/phoenix/wrap/SpanWrap.js | define(
'ephox.phoenix.wrap.SpanWrap',
[
'ephox.bud.Unicode',
'ephox.peanut.Fun',
'ephox.perhaps.Option',
'ephox.phoenix.api.data.Spot',
'ephox.phoenix.api.general.Injection',
'ephox.phoenix.wrap.Wrapper',
'ephox.phoenix.wrap.Wraps',
'ephox.scullion.Struct'
],
function (Unicode, Fun, Option, Spot, Injection, Wrapper, Wraps, Struct) {
var point = function (universe, start, soffset, finish, foffset, exclusions) {
var scanned = scan(universe, start, soffset, finish, foffset, exclusions);
var cursor = scanned.cursor();
var range = Spot.points(
Spot.point(cursor.element(), cursor.offset()),
Spot.point(cursor.element(), cursor.offset())
);
return Option.some({
range: Fun.constant(range),
temporary: scanned.temporary,
wrappers: scanned.wrappers
});
};
var spanCursor = Struct.immutable('span', 'cursor');
var temporary = function (universe, start, soffset, finish, foffset) {
var doc = start.dom().ownerDocument;
var span = universe.create().nu('span', doc);
var cursor = universe.create().text(Unicode.zeroWidth(), doc);
universe.insert().append(span, cursor);
Injection.atStartOf(universe, start, soffset, span);
return {
cursor: Fun.constant(Spot.point(cursor, 1)),
wrappers: Fun.constant([ span ]),
temporary: Fun.constant(true)
};
};
/*
* The point approach needs to reuse a temporary span (if we already have one) or create one if we don't.
*/
var scan = function (universe, start, soffset, finish, foffset, exclusions) {
return universe.property().parent(start).bind(function (parent) {
var cursor = Spot.point(start, soffset);
var canReuse = isSpan(universe, exclusions, parent) && universe.property().children(parent).length === 1 && isUnicode(universe, start);
return canReuse ? Option.some({
cursor: Fun.constant(cursor),
temporary: Fun.constant(false),
wrappers: Fun.constant([ parent ])
}) : Option.none();
}).getOrThunk(function () {
return temporary(universe, start, soffset, finish, foffset);
});
};
var isUnicode = function (universe, element) {
return universe.property().isText(element) && universe.property().getText(element) === Unicode.zeroWidth();
};
var isSpan = function (universe, exclusions, elem) {
return universe.property().name(elem) === 'span' && exclusions(elem) === false;
};
var wrap = function (universe, start, soffset, finish, foffset, exclusions) {
var doc = start.dom().ownerDocument;
var nuSpan = function () {
return Wraps(universe, universe.create().nu('span', doc));
};
var wrappers = Wrapper.reuse(universe, start, soffset, finish, foffset, Fun.curry(isSpan, universe, exclusions), nuSpan);
return Option.from(wrappers[wrappers.length - 1]).map(function (lastSpan) {
var lastOffset = universe.property().children(lastSpan).length;
var range = Spot.points(
Spot.point(wrappers[0], 0),
Spot.point(lastSpan, lastOffset)
);
return {
wrappers: Fun.constant(wrappers),
temporary: Fun.constant(false),
range: Fun.constant(range)
};
});
};
var isCollapsed = function (universe, start, soffset, finish, foffset) {
return universe.eq(start, finish) && soffset === foffset;
};
var spans = function (universe, start, soffset, finish, foffset, _exclusions) {
var exclusions = _exclusions !== undefined ? _exclusions : Fun.constant(false);
var wrapper = isCollapsed(universe, start, soffset, finish, foffset) ? point : wrap;
return wrapper(universe, start, soffset, finish, foffset, exclusions);
};
return {
spans: spans
};
}
); | TBIO-4085: table cell selection formatting wip
| src/main/js/ephox/phoenix/wrap/SpanWrap.js | TBIO-4085: table cell selection formatting wip | <ide><path>rc/main/js/ephox/phoenix/wrap/SpanWrap.js
<ide>
<ide> [
<ide> 'ephox.bud.Unicode',
<add> 'ephox.compass.Arr',
<ide> 'ephox.peanut.Fun',
<ide> 'ephox.perhaps.Option',
<ide> 'ephox.phoenix.api.data.Spot',
<ide> 'ephox.scullion.Struct'
<ide> ],
<ide>
<del> function (Unicode, Fun, Option, Spot, Injection, Wrapper, Wraps, Struct) {
<add> function (Unicode, Arr, Fun, Option, Spot, Injection, Wrapper, Wraps, Struct) {
<ide> var point = function (universe, start, soffset, finish, foffset, exclusions) {
<ide> var scanned = scan(universe, start, soffset, finish, foffset, exclusions);
<ide> var cursor = scanned.cursor();
<ide>
<ide> var spanCursor = Struct.immutable('span', 'cursor');
<ide>
<add> /// TODO this was copied from boss DomUniverse, use that instead
<add> var isEmptyTag = function (universe, item) {
<add> return Arr.contains([ 'br', 'img', 'hr', 'input' ], universe.property().name(item));
<add> };
<add>
<ide> var temporary = function (universe, start, soffset, finish, foffset) {
<ide> var doc = start.dom().ownerDocument;
<ide> var span = universe.create().nu('span', doc);
<ide> var cursor = universe.create().text(Unicode.zeroWidth(), doc);
<ide> universe.insert().append(span, cursor);
<ide>
<del> Injection.atStartOf(universe, start, soffset, span);
<add> /// TODO don't append to empty tags (might be better in Injection.atStartOf)
<add>
<add> /// also need to twiddle the offset
<add> var injectAt = isEmptyTag(universe, start) ? universe.property().parent(start) : Option.some(start);
<add> injectAt.each(function (z) {
<add> Injection.atStartOf(universe, z, soffset, span);
<add> });
<add>
<add> // Injection.atStartOf(universe, injectAt, soffset, span);
<ide> return {
<ide> cursor: Fun.constant(Spot.point(cursor, 1)),
<ide> wrappers: Fun.constant([ span ]), |
|
JavaScript | apache-2.0 | e8f182c22f621d1ff9161dcf4e2c1e735deff017 | 0 | OpenCompare/OpenCompare,OpenCompare/OpenCompare,gbecan/OpenCompare,OpenCompare/OpenCompare | /**
* Created by gbecan on 17/12/14.
*/
/**
* Sort two elements by their names (accessed with x.name)
* @param a
* @param b
* @returns {number}
*/
function sortByName(a, b) {
if (a.name < b.name) {
return -1;
} else if (a.name > b.name) {
return 1;
} else {
return 0;
}
}
pcmApp.controller("PCMEditorController", function($rootScope, $scope, $http) {
// Load PCM
var pcmMM = Kotlin.modules['pcm'].pcm;
var factory = new pcmMM.factory.DefaultPcmFactory();
var loader = factory.createJSONLoader();
var serializer = factory.createJSONSerializer();
// Init
var features = [];
var featureHeaders = [];
var productHeaders = [];
var products = [];
var exp;
var number = function(value,callback){
if(/[0-9]+/.test(value)){
callback(true);
}else{
callback(false);
}
};
var bool=function(value,callback){
if(/(Yes|No)/.test(value)){
callback(true);
}else{
callback(false);
}
};
var text = function(value,callback){
if(/[a-z]+/.test(value)){
callback(true);
}else{
callback(false);
}
};
if (typeof id === 'undefined') {
// Create example PCM
$scope.pcm = factory.createPCM();
var exampleFeature = factory.createFeature();
exampleFeature.name = "Feature";
$scope.pcm.addFeatures(exampleFeature);
var exampleFeature1 = factory.createFeature();
exampleFeature1.name = "Feature1";
$scope.pcm.addFeatures(exampleFeature1);
var exampleProduct = factory.createProduct();
exampleProduct.name = "Product";
$scope.pcm.addProducts(exampleProduct);
var exampleCell = factory.createCell();
exampleCell.feature = exampleFeature;
exampleCell.content = "Yes";
exampleProduct.addValues(exampleCell);
var exampleCell1 = factory.createCell();
exampleCell1.feature = exampleFeature1;
exampleCell1.content = "No";
exampleProduct.addValues(exampleCell1);
initializeHOT();
} else {
$http.get("/api/get/" + id).success(function (data) {
$scope.pcm = loader.loadModelFromString(JSON.stringify(data)).get(0);
initializeHOT();
});
}
//Function to get a random number between [min-max]
function getRandomNumber(min, max) {
return Math.random() * (max - min) + min;
}
/**
* Get a random type :
* 1: Number
* 2: Bool (Yes/No)
* 3: Text
*/
var getType= function(value){
switch (value){
case 0:
return number;
case 1:
return bool;
case 2:
return text;
defaul:
return text;
}
}
function initializeHOT() {
// Transform features to handonstable data structures
var kFeatures = getConcreteFeatures($scope.pcm).sort(sortByName); // $scope.pcm.features.array
for (var i = 0; i < kFeatures.length; i++) {
var type = getType(Math.round(getRandomNumber(0, 2)));
features.push({
// Associate a type to a columns
data: property(kFeatures[i].generated_KMF_ID),
validator: type,
allowInvalid: true,
Type: type + "",
ID: kFeatures[i].generated_KMF_ID
});
featureHeaders.push(kFeatures[i].name);
}
// Transform products to handonstable data structures
var kProducts = $scope.pcm.products.array.sort(sortByName);
for (var i = 0; i < kProducts.length; i++) {
var product = kProducts[i];
productHeaders.push(product.name);
products.push(model(product));
//console.log(products);
}
var container = document.getElementById('hot');
var settings = {
data: products,
dataSchema: schema,
rowHeaders: productHeaders,
colHeaders: featureHeaders,
columns: features,
currentRowClassName: 'currentRow',
currentColClassName: 'currentCol',
contextMenu: contextMenu(),
//contextMenu : true,
//stretchH: 'all', // Scroll bars ?!
manualColumnMove: true,
manualRowMove: true,
minSpareRows: 0,
minSpareCols: 0,
minRows:0,
fixedRowsTop: 0,
fixedColumnsLeft: 0,
afterChange: function() {
$rootScope.$broadcast('modified');
}
};
var hot = new Handsontable(container, settings);
resize();
$scope.hot = hot;
function insertColumn(index) {
var header = prompt("Please enter your column name", "");
if (header != null) {
var feature = createFeature(header);
featureHeaders.splice(index, 0, header);
var type = getType(Math.round(getRandomNumber(0, 2)));
var featureProperty = {
data: property(feature.generated_KMF_ID),
validator: type,
allowInvalid: true,
Type: type + "",
ID: feature.generated_KMF_ID
}
features.splice(index, 0, featureProperty);
hot.updateSettings(settings);
}
}
function contextMenu() {
return {
add_col_before: {
name: 'Insert column on the left',
callback: function (key, selection) {
insertColumn(selection.start.col);
},
disabled: false
},
add_col_after: {
name: 'Insert column on the right',
callback: function (key, selection) {
insertColumn(selection.start.col + 1);
},
disabled: function () {
return false;
}
},
remove_column : {
name : 'Remove column(s)',
callback: function (key, selection) {
var start = selection.start.col;
var end = selection.end.col;
// Remove cells
$scope.pcm.products.array.forEach(function(product) {
var cellsToRemove = [];
product.values.array.forEach(function(cell) {
for (var i = start ; i <= end ; i++) {
if (cell.feature.generated_KMF_ID == features[i].ID) {
cellsToRemove.push(cell);
}
}
});
cellsToRemove.forEach(function(cell) {
product.removeValues(cell);
});
});
// Remove features
for (var i = start ; i <= end ; i++) {
var feature = $scope.pcm.findFeaturesByID(features[i].ID);
if (feature != null) {
$scope.pcm.removeFeatures(feature);
}
}
featureHeaders.splice(start, end - start + 1);
features.splice(start, end - start + 1);
hot.render();
},
disabled: false
},
set_column_name: {
name: 'Rename column',
callback: function (key, selection) {
var header = prompt("Please enter your column name", "");
if (header != null) {
featureHeaders.splice(selection.start.col, 1, header);
features[selection.start.col].data.name = header;
//$scope.pcm.findFeaturesById(features[selection.start.col.ID]).name = header;
var feature;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
feature = $scope.pcm.features.array[i];
if (feature.generated_KMF_ID == features[selection.start.col].ID) break;
}
feature.name = header;
hot.render();
}
},
disabled: function () {
// if multiple columns selected : disable
return hot.getSelected()[1] != hot.getSelected()[3];
}
},
"hsep": "---------",
add_row_before: {
name: 'Insert row above',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.start.row, 0, header);
var product = factory.createProduct();
product.name = header;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "";
product.addValues(cell);
}
$scope.pcm.addProducts(product);
products.splice(selection.start.row, 0, model(product));
hot.render();
}
},
disabled: function () {
return false;
}
},
add_row_after: {
name: 'Insert row below',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.end.row + 1, 0, header);
var product = factory.createProduct();
product.name = header;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "";
product.addValues(cell);
}
$scope.pcm.addProducts(product);
products.splice(selection.end.row + 1, 0, model(product));
hot.render();
}
},
disabled: function () {
return false;
}
},
remove_row: {
name: 'Remove row(s)',
callback: function (key, selection) {
var start = selection.start.row;
var end = selection.end.row;
$scope.pcm.products.array.forEach(function(product) {
for (var i = start; i <= end; i++) {
if (product.generated_KMF_ID == products[i]) {
$scope.pcm.removeProducts(product);
}
}
});
products.splice(start, end - start + 1);
productHeaders.splice(start, end - start + 1);
hot.render();
},
disabled: function () {
return false;
}
},
set_row_name: {
name: 'Rename row',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.start.row, 1, header);
$scope.pcm.findProductsByID(products[selection.start.row]).name = header;
hot.render();
}
},
disabled: function () {
// if multiple columns selected : disable
return hot.getSelected()[0] != hot.getSelected()[2];
}
},
"hsep1": "---------",
validator_numeric: {
name: "numeric",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
features[selection.end.col].Type = number;
features[selection.end.col].validator = number;
hot.updateSettings(settings);
hot.validateCells();
}
},
validator_text: {
name: "text",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
features[selection.end.col].Type = text;
features[selection.end.col].validator = text;
hot.updateSettings(settings);
hot.validateCells();
}
},
validator_boolean: {
name: "boolean",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
features[selection.end.col].Type = bool;
features[selection.end.col].validator = bool;
hot.updateSettings(settings);
hot.validateCells();
}
}
}
}
}
function createFeature(name) {
// Create feature
var feature = factory.createFeature();
feature.name = name;
$scope.pcm.addFeatures(feature);
// Create corresponding cells for all products
for (var i = 0; i < $scope.pcm.products.array.length; i++) {
var cell = factory.createCell();
cell.content = "";
cell.feature = feature;
$scope.pcm.products.array[i].addValues(cell);
}
return feature;
}
function getConcreteFeatures(pcm) {
var aFeatures = pcm.features.array;
var features = [];
for (var i = 0; i < aFeatures.length; i++) {
var aFeature = aFeatures[i];
features = features.concat(getConcreteFeaturesRec(aFeature))
}
return features;
}
function getConcreteFeaturesRec(aFeature) {
var features = [];
if (typeof aFeature.subFeatures !== 'undefined') {
var subFeatures = aFeature.subFeatures.array;
for (var i = 0; i < subFeatures.length; i++) {
var subFeature = subFeatures[i];
features = features.concat(getConcreteFeaturesRec(subFeature));
}
} else {
features.push(aFeature);
}
return features;
}
/**
* Synchronization function between handsontable and a PCM model of a product
* @param product : KMF model of a product
* @returns synchronization object
*/
function model(product) {
var idKMF = product.generated_KMF_ID;
return idKMF;
}
function schema(index) {
var newProduct = factory.createProduct();
if(typeof index !== 'undefined') {
$scope.pcm.addProducts(newProduct);
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "N/A";
newProduct.addValues(cell);
}
}
return model(newProduct);
}
/**
* Bind handsontable cells to PCM cells
* @param attr
* @returns synchronization function
*/
function property(attr) {
return function (row, value) {
var product = $scope.pcm.findProductsByID(row);
//var cell = product.select("values[feature/id == " + attr + "]").get(0); // FIXME : does not work ! We need to find the cell that correponds to the feature id
var cells = product.values.array;
var cell = null;
for (var i = 0; i < cells.length; i++) {
cell = cells[i];
if (cell.feature.generated_KMF_ID === attr) {
break;
}
}
if (typeof value === 'undefined') {
//console.log(product.name + ", " + cell.feature.name + " : " + cell.content);
return cell.content;
} else {
cell.content = value;
return row;
}
}
}
function resize()
{
var g=document.querySelectorAll("colgroup");
var i,j,tmp,MaxWidth=0;
var w=document.getElementById("hot");
var tab=w.getElementsByClassName("rowHeader");
for(i=0;i<tab.length;i++)
{
span=tab[i];
width=span.offsetWidth;
if (width >= MaxWidth)
MaxWidth=width;
}
MaxWidth=MaxWidth+10;//le 10 pour calucler les espaces de debut et la fin de texte
for(i=0;i<g.length;i++)
{
tab=g[i].querySelectorAll("col.rowHeader");
for(j=0;j<tab.length;j++)
{
tab[j].setAttribute("style", "width:"+MaxWidth+"px;");
}
}
return;
}
/**
* Save PCM on the server
*/
$scope.save = function() {
var jsonModel = serializer.serialize($scope.pcm);
if (typeof id === 'undefined') {
$http.post("/api/create", JSON.parse(jsonModel)).success(function(data) {
id = data;
console.log("model created with id=" + id);
$rootScope.$broadcast('saved');
});
} else {
$http.post("/api/save/" + id, JSON.parse(jsonModel)).success(function(data) {
console.log("model saved");
$rootScope.$broadcast('saved');
});
}
};
/**
*Remove PCM from server
*/
$scope.remove = function() {
if (typeof id !== 'undefined') {
$http.get("/api/remove/" + id).success(function(data) {
window.location.href = "/";
console.log("model removed");
});
}
};
/**
* Validate the type of each columns
*/
$scope.validate=function(){
// TO DO
//alert(productHeaders.length);
/* for(var i=0;i<features.length;i++){
for(var j=0;j<productHeaders.length;j++){
// temp1.setDataAtCell(j, i, temp1.getDataAtCell(j,i));
}}*/
//alert("done");
$scope.hot.validateCells(function(){
$scope.hot.render()
});
};
// Bind events from toolbar to functions of the editor
$scope.$on('save', function(event, args) {
$scope.save();
});
$scope.$on('remove', function(event, args) {
$scope.remove();
});
$scope.$on('validate', function(event, args) {
$scope.validate();
});
});
| org.opencompare/play-app/public/javascripts/controllers/pcm-editor-controller.js | /**
* Created by gbecan on 17/12/14.
*/
/**
* Sort two elements by their names (accessed with x.name)
* @param a
* @param b
* @returns {number}
*/
function sortByName(a, b) {
if (a.name < b.name) {
return -1;
} else if (a.name > b.name) {
return 1;
} else {
return 0;
}
}
pcmApp.controller("PCMEditorController", function($rootScope, $scope, $http) {
// Load PCM
var pcmMM = Kotlin.modules['pcm'].pcm;
var factory = new pcmMM.factory.DefaultPcmFactory();
var loader = factory.createJSONLoader();
var serializer = factory.createJSONSerializer();
// Init
var features = [];
var featureHeaders = [];
var productHeaders = [];
var products = [];
var exp;
var ipValidatorRegexp = /^(?:\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b|null)$/,
number = function(value,callback){
if(/[0-9]+/.test(value)){
callback(true);
}else{
callback(false);
}
},
bool=function(value,callback){
if(/(Yes|No)/.test(value)){
callback(true);
}else{
callback(false);
}
},
text = function(value,callback){
if(/[a-z]+/.test(value)){
callback(true);
}else{
callback(false);
}
};
if (typeof id === 'undefined') {
// Create example PCM
$scope.pcm = factory.createPCM();
var exampleFeature = factory.createFeature();
exampleFeature.name = "Feature";
$scope.pcm.addFeatures(exampleFeature);
var exampleFeature1 = factory.createFeature();
exampleFeature1.name = "Feature1";
$scope.pcm.addFeatures(exampleFeature1);
var exampleProduct = factory.createProduct();
exampleProduct.name = "Product";
$scope.pcm.addProducts(exampleProduct);
var exampleCell = factory.createCell();
exampleCell.feature = exampleFeature;
exampleCell.content = "Yes";
exampleProduct.addValues(exampleCell);
var exampleCell1 = factory.createCell();
exampleCell1.feature = exampleFeature1;
exampleCell1.content = "No";
exampleProduct.addValues(exampleCell1);
initializeHOT();
} else {
$http.get("/api/get/" + id).success(function (data) {
$scope.pcm = loader.loadModelFromString(JSON.stringify(data)).get(0);
initializeHOT();
});
}
//Function to get a random number between [min-max]
function getRandomNumber(min, max) {
return Math.random() * (max - min) + min;
}
/**
* Get a random type :
* 1: Number
* 2: Bool (Yes/No)
* 3: Text
*/
var getType= function(value){
switch (value){
case 0:
return number;
case 1:
return bool;
case 2:
return text;
defaul:
return text;
}
}
function initializeHOT() {
// Transform features to handonstable data structures
var kFeatures = getConcreteFeatures($scope.pcm).sort(sortByName); // $scope.pcm.features.array
for (var i = 0; i < kFeatures.length; i++) {
var type = getType(Math.round(getRandomNumber(0, 2)));
features.push({
// Associate a type to a columns
data: property(kFeatures[i].generated_KMF_ID),
validator: type,
allowInvalid: true,
Type: type + "",
ID: kFeatures[i].generated_KMF_ID
});
featureHeaders.push(kFeatures[i].name);
}
// Transform products to handonstable data structures
var kProducts = $scope.pcm.products.array.sort(sortByName);
for (var i = 0; i < kProducts.length; i++) {
var product = kProducts[i];
productHeaders.push(product.name);
products.push(model(product));
//console.log(products);
}
var container = document.getElementById('hot');
var settings = {
data: products,
dataSchema: schema,
rowHeaders: productHeaders,
colHeaders: featureHeaders,
columns: features,
currentRowClassName: 'currentRow',
currentColClassName: 'currentCol',
contextMenu: contextMenu(),
//contextMenu : true,
//stretchH: 'all', // Scroll bars ?!
manualColumnMove: true,
manualRowMove: true,
minSpareRows: 0,
minSpareCols: 0,
minRows:0,
fixedRowsTop: 0,
fixedColumnsLeft: 0,
afterChange: function() {
$rootScope.$broadcast('modified');
}
};
var hot = new Handsontable(container, settings);
resize();
$scope.hot = hot;
function insertColumn(index) {
var header = prompt("Please enter your column name", "");
if (header != null) {
var feature = createFeature(header);
featureHeaders.splice(index, 0, header);
var featureProperty = {
data: property(feature.generated_KMF_ID),
//validator: type,
//allowInvalid: true,
//Type: type + "",
ID: feature.generated_KMF_ID
}
features.splice(index, 0, featureProperty);
hot.updateSettings(settings);
}
}
function contextMenu() {
return {
add_col_before: {
name: 'Insert column on the left',
callback: function (key, selection) {
insertColumn(selection.start.col);
},
disabled: false
},
add_col_after: {
name: 'Insert column on the right',
callback: function (key, selection) {
insertColumn(selection.start.col + 1);
},
disabled: function () {
return false;
}
},
remove_column : {
name : 'Remove column(s)',
callback: function (key, selection) {
var start = selection.start.col;
var end = selection.end.col;
// Remove cells
$scope.pcm.products.array.forEach(function(product) {
var cellsToRemove = [];
product.values.array.forEach(function(cell) {
for (var i = start ; i <= end ; i++) {
if (cell.feature.generated_KMF_ID == features[i].ID) {
cellsToRemove.push(cell);
}
}
});
cellsToRemove.forEach(function(cell) {
product.removeValues(cell);
});
});
// Remove features
for (var i = start ; i <= end ; i++) {
var feature = $scope.pcm.findFeaturesByID(features[i].ID);
if (feature != null) {
$scope.pcm.removeFeatures(feature);
}
}
featureHeaders.splice(start, end - start + 1);
features.splice(start, end - start + 1);
hot.render();
},
disabled: false
},
set_column_name: {
name: 'Rename column',
callback: function (key, selection) {
var header = prompt("Please enter your column name", "");
if (header != null) {
featureHeaders.splice(selection.start.col, 1, header);
features[selection.start.col].data.name = header;
//$scope.pcm.findFeaturesById(features[selection.start.col.ID]).name = header;
var feature;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
feature = $scope.pcm.features.array[i];
if (feature.generated_KMF_ID == features[selection.start.col].ID) break;
}
feature.name = header;
hot.render();
}
},
disabled: function () {
// if multiple columns selected : disable
return hot.getSelected()[1] != hot.getSelected()[3];
}
},
"hsep": "---------",
add_row_before: {
name: 'Insert row above',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.start.row, 0, header);
var product = factory.createProduct();
product.name = header;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "";
product.addValues(cell);
}
$scope.pcm.addProducts(product);
products.splice(selection.start.row, 0, model(product));
hot.render();
}
},
disabled: function () {
return false;
}
},
add_row_after: {
name: 'Insert row below',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.end.row + 1, 0, header);
var product = factory.createProduct();
product.name = header;
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "";
product.addValues(cell);
}
$scope.pcm.addProducts(product);
products.splice(selection.end.row + 1, 0, model(product));
hot.render();
}
},
disabled: function () {
return false;
}
},
remove_row: {
name: 'Remove row(s)',
callback: function (key, selection) {
var start = selection.start.row;
var end = selection.end.row;
$scope.pcm.products.array.forEach(function(product) {
for (var i = start; i <= end; i++) {
if (product.generated_KMF_ID == products[i]) {
$scope.pcm.removeProducts(product);
}
}
});
products.splice(start, end - start + 1);
productHeaders.splice(start, end - start + 1);
hot.render();
},
disabled: function () {
return false;
}
},
set_row_name: {
name: 'Rename row',
callback: function (key, selection) {
var header = prompt("Please enter your row name", "");
if (header != null) {
productHeaders.splice(selection.start.row, 1, header);
$scope.pcm.findProductsByID(products[selection.start.row]).name = header;
hot.render();
}
},
disabled: function () {
// if multiple columns selected : disable
return hot.getSelected()[0] != hot.getSelected()[2];
}
},
"hsep1": "---------",
validator_numeric: {
name: "numeric",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
console.log(features[selection.end.col].validator);
features[selection.end.col].Type = number;
features[selection.end.col].validator = function (value, callback) {
if (number.test(value)) {
callback(true);
} else {
callback(false);
}
};
}
},
validator_text: {
name: "text",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
console.log(features[selection.end.col].validator);
features[selection.end.col].Type = text;
features[selection.end.col].validator = text;
}
},
validator_boolean: {
name: "boolean",
callback: function (key, selection) {
$scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
console.log(features[selection.end.col].validator);
features[selection.end.col].Type = bool;
features[selection.end.col].validator = bool;
}
},
validator_getype: {
name: "get type",
callback: function (key, selection) {
if (features[selection.end.col].Type == number) {
alert("Type : Number");
} else if (features[selection.end.col].Type == bool) {
alert("Type : Boolean");
} else {
alert("Type : String");
}
}
}
};
}
}
function createFeature(name) {
// Create feature
var feature = factory.createFeature();
feature.name = name;
$scope.pcm.addFeatures(feature);
// Create corresponding cells for all products
for (var i = 0; i < $scope.pcm.products.array.length; i++) {
var cell = factory.createCell();
cell.content = "";
cell.feature = feature;
$scope.pcm.products.array[i].addValues(cell);
}
return feature;
}
function getConcreteFeatures(pcm) {
var aFeatures = pcm.features.array;
var features = [];
for (var i = 0; i < aFeatures.length; i++) {
var aFeature = aFeatures[i];
features = features.concat(getConcreteFeaturesRec(aFeature))
}
return features;
}
function getConcreteFeaturesRec(aFeature) {
var features = [];
if (typeof aFeature.subFeatures !== 'undefined') {
var subFeatures = aFeature.subFeatures.array;
for (var i = 0; i < subFeatures.length; i++) {
var subFeature = subFeatures[i];
features = features.concat(getConcreteFeaturesRec(subFeature));
}
} else {
features.push(aFeature);
}
return features;
}
/**
* Synchronization function between handsontable and a PCM model of a product
* @param product : KMF model of a product
* @returns synchronization object
*/
function model(product) {
var idKMF = product.generated_KMF_ID;
return idKMF;
}
function schema(index) {
var newProduct = factory.createProduct();
if(typeof index !== 'undefined') {
$scope.pcm.addProducts(newProduct);
for (var i = 0; i < $scope.pcm.features.array.length; i++) {
var cell = factory.createCell();
cell.feature = $scope.pcm.features.array[i];
cell.content = "N/A";
newProduct.addValues(cell);
}
}
return model(newProduct);
}
/**
* Bind handsontable cells to PCM cells
* @param attr
* @returns synchronization function
*/
function property(attr) {
return function (row, value) {
var product = $scope.pcm.findProductsByID(row);
//var cell = product.select("values[feature/id == " + attr + "]").get(0); // FIXME : does not work ! We need to find the cell that correponds to the feature id
var cells = product.values.array;
var cell = null;
for (var i = 0; i < cells.length; i++) {
cell = cells[i];
if (cell.feature.generated_KMF_ID === attr) {
break;
}
}
if (typeof value === 'undefined') {
//console.log(product.name + ", " + cell.feature.name + " : " + cell.content);
return cell.content;
} else {
cell.content = value;
return row;
}
}
}
function resize()
{
var g=document.querySelectorAll("colgroup");
var i,j,tmp,MaxWidth=0;
var w=document.getElementById("hot");
var tab=w.getElementsByClassName("rowHeader");
for(i=0;i<tab.length;i++)
{
span=tab[i];
width=span.offsetWidth;
if (width >= MaxWidth)
MaxWidth=width;
}
MaxWidth=MaxWidth+10;//le 10 pour calucler les espaces de debut et la fin de texte
for(i=0;i<g.length;i++)
{
tab=g[i].querySelectorAll("col.rowHeader");
for(j=0;j<tab.length;j++)
{
tab[j].setAttribute("style", "width:"+MaxWidth+"px;");
}
}
return;
}
/**
* Save PCM on the server
*/
$scope.save = function() {
var jsonModel = serializer.serialize($scope.pcm);
if (typeof id === 'undefined') {
$http.post("/api/create", JSON.parse(jsonModel)).success(function(data) {
id = data;
console.log("model created with id=" + id);
$rootScope.$broadcast('saved');
});
} else {
$http.post("/api/save/" + id, JSON.parse(jsonModel)).success(function(data) {
console.log("model saved");
$rootScope.$broadcast('saved');
});
}
};
/**
*Remove PCM from server
*/
$scope.remove = function() {
if (typeof id !== 'undefined') {
$http.get("/api/remove/" + id).success(function(data) {
window.location.href = "/";
console.log("model removed");
});
}
};
/**
* Validate the type of each columns
*/
$scope.validate=function(){
// TO DO
//alert(productHeaders.length);
/* for(var i=0;i<features.length;i++){
for(var j=0;j<productHeaders.length;j++){
// temp1.setDataAtCell(j, i, temp1.getDataAtCell(j,i));
}}*/
//alert("done");
$scope.hot.validateCells(function(){
$scope.hot.render()
});
};
// Bind events from toolbar to functions of the editor
$scope.$on('save', function(event, args) {
$scope.save();
});
$scope.$on('remove', function(event, args) {
$scope.remove();
});
$scope.$on('validate', function(event, args) {
$scope.validate();
});
});
| towards context menu for setting type (issue #24)
| org.opencompare/play-app/public/javascripts/controllers/pcm-editor-controller.js | towards context menu for setting type (issue #24) | <ide><path>rg.opencompare/play-app/public/javascripts/controllers/pcm-editor-controller.js
<ide> */
<ide>
<ide> /**
<del>
<ide> * Sort two elements by their names (accessed with x.name)
<del>
<ide> * @param a
<del>
<ide> * @param b
<del>
<ide> * @returns {number}
<del>
<ide> */
<ide> function sortByName(a, b) {
<ide> if (a.name < b.name) {
<ide> var productHeaders = [];
<ide> var products = [];
<ide> var exp;
<del> var ipValidatorRegexp = /^(?:\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b|null)$/,
<del> number = function(value,callback){
<del> if(/[0-9]+/.test(value)){
<del> callback(true);
<del> }else{
<del> callback(false);
<del> }
<del> },
<del> bool=function(value,callback){
<del> if(/(Yes|No)/.test(value)){
<del> callback(true);
<del> }else{
<del> callback(false);
<del> }
<del> },
<del> text = function(value,callback){
<del> if(/[a-z]+/.test(value)){
<del> callback(true);
<del> }else{
<del> callback(false);
<del> }
<del> };
<add>
<add> var number = function(value,callback){
<add> if(/[0-9]+/.test(value)){
<add> callback(true);
<add> }else{
<add> callback(false);
<add> }
<add> };
<add>
<add> var bool=function(value,callback){
<add> if(/(Yes|No)/.test(value)){
<add> callback(true);
<add> }else{
<add> callback(false);
<add> }
<add> };
<add>
<add> var text = function(value,callback){
<add> if(/[a-z]+/.test(value)){
<add> callback(true);
<add> }else{
<add> callback(false);
<add> }
<add> };
<add>
<ide> if (typeof id === 'undefined') {
<ide> // Create example PCM
<ide> $scope.pcm = factory.createPCM();
<ide> return Math.random() * (max - min) + min;
<ide> }
<ide>
<del> /**
<del> * Get a random type :
<del> * 1: Number
<del> * 2: Bool (Yes/No)
<del> * 3: Text
<del> */
<add> /**
<add> * Get a random type :
<add> * 1: Number
<add> * 2: Bool (Yes/No)
<add> * 3: Text
<add> */
<ide> var getType= function(value){
<ide> switch (value){
<ide> case 0:
<ide> return bool;
<ide> case 2:
<ide> return text;
<del> defaul:
<del> return text;
<add> defaul:
<add> return text;
<ide> }
<ide> }
<ide>
<ide> //console.log(products);
<ide> }
<ide>
<del>
<add>
<ide> var container = document.getElementById('hot');
<ide> var settings = {
<ide> data: products,
<ide>
<ide> featureHeaders.splice(index, 0, header);
<ide>
<add> var type = getType(Math.round(getRandomNumber(0, 2)));
<ide> var featureProperty = {
<ide> data: property(feature.generated_KMF_ID),
<del> //validator: type,
<del> //allowInvalid: true,
<del> //Type: type + "",
<add> validator: type,
<add> allowInvalid: true,
<add> Type: type + "",
<ide> ID: feature.generated_KMF_ID
<ide> }
<ide> features.splice(index, 0, featureProperty);
<ide> name: "numeric",
<ide> callback: function (key, selection) {
<ide> $scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
<del> console.log(features[selection.end.col].validator);
<ide> features[selection.end.col].Type = number;
<del>
<del> features[selection.end.col].validator = function (value, callback) {
<del> if (number.test(value)) {
<del> callback(true);
<del> } else {
<del> callback(false);
<del> }
<del> };
<add> features[selection.end.col].validator = number;
<add>
<add> hot.updateSettings(settings);
<add> hot.validateCells();
<ide> }
<ide> },
<ide>
<ide> name: "text",
<ide> callback: function (key, selection) {
<ide> $scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
<del> console.log(features[selection.end.col].validator);
<ide> features[selection.end.col].Type = text;
<ide> features[selection.end.col].validator = text;
<add>
<add> hot.updateSettings(settings);
<add> hot.validateCells();
<ide> }
<ide> },
<ide> validator_boolean: {
<ide> name: "boolean",
<ide> callback: function (key, selection) {
<ide> $scope.pcm.findFeaturesByID(features[selection.end.col].ID).type = type;
<del> console.log(features[selection.end.col].validator);
<ide> features[selection.end.col].Type = bool;
<ide> features[selection.end.col].validator = bool;
<del> }
<del> },
<del> validator_getype: {
<del> name: "get type",
<del> callback: function (key, selection) {
<del> if (features[selection.end.col].Type == number) {
<del> alert("Type : Number");
<del> } else if (features[selection.end.col].Type == bool) {
<del> alert("Type : Boolean");
<del> } else {
<del> alert("Type : String");
<del> }
<add>
<add> hot.updateSettings(settings);
<add> hot.validateCells();
<ide> }
<ide> }
<del> };
<del>
<del> }
<add> }
<add>
<add> }
<add>
<ide> }
<ide>
<ide>
<ide> }
<ide>
<ide> return;
<del> }
<add> }
<ide> /**
<ide>
<ide> * Save PCM on the server
<ide> };
<ide>
<ide> /**
<del> *Remove PCM from server
<del> */
<add> *Remove PCM from server
<add> */
<ide> $scope.remove = function() {
<ide> if (typeof id !== 'undefined') {
<ide> $http.get("/api/remove/" + id).success(function(data) {
<ide>
<ide>
<ide> /**
<del> * Validate the type of each columns
<del> */
<add> * Validate the type of each columns
<add> */
<ide> $scope.validate=function(){
<ide> // TO DO
<del> //alert(productHeaders.length);
<del>
<del> /* for(var i=0;i<features.length;i++){
<del> for(var j=0;j<productHeaders.length;j++){
<del> // temp1.setDataAtCell(j, i, temp1.getDataAtCell(j,i));
<del> }}*/
<del>
<del> //alert("done");
<add> //alert(productHeaders.length);
<add>
<add> /* for(var i=0;i<features.length;i++){
<add> for(var j=0;j<productHeaders.length;j++){
<add> // temp1.setDataAtCell(j, i, temp1.getDataAtCell(j,i));
<add> }}*/
<add>
<add> //alert("done");
<ide> $scope.hot.validateCells(function(){
<ide> $scope.hot.render()
<ide> }); |
|
Java | agpl-3.0 | 7a40dc38cf3d7ceae73c0f3062de8447cff27ff7 | 0 | datamatica-pl/traccar-api,datamatica-pl/traccar-api | /*
* Copyright (C) 2016 Datamatica ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package pl.datamatica.traccar.api.providers;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Stream;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.slf4j.Logger;
import pl.datamatica.traccar.api.dtos.in.EditDeviceDto;
import pl.datamatica.traccar.api.providers.ProviderException.Type;
import pl.datamatica.traccar.model.Device;
import pl.datamatica.traccar.model.GeoFence;
import pl.datamatica.traccar.model.Report;
import pl.datamatica.traccar.model.User;
public class DeviceProvider extends ProviderBase {
private User requestUser;
private ImeiProvider imeis;
private Logger logger;
public DeviceProvider(EntityManager em, User requestUser, ImeiProvider imeis) {
super(em);
this.requestUser = requestUser;
this.imeis = imeis;
logger = DbLog.getLogger();
}
public Device getDevice(long id) throws ProviderException {
return get(Device.class, id, this::isVisible);
}
public Device getDeviceByImei(String imei) {
TypedQuery<Device> tq = em.createQuery("Select x from Device x where x.uniqueId = :imei", Device.class);
tq.setParameter("imei", imei);
List<Device> devices = tq.getResultList();
if(devices.isEmpty())
return null;
return devices.get(0);
}
public Stream<Device> getAllAvailableDevices() {
if(requestUser.getAdmin())
return getAllDevices();
else
return requestUser.getAllAvailableDevices().stream();
}
public Device createDevice(String imei) throws ProviderException {
if(!isImeiValid(imei))
throw new ProviderException(Type.INVALID_IMEI);
Device existing = getDeviceByImei(imei);
if(existing != null) {
if(!existing.isDeleted())
throw new ProviderException(Type.DEVICE_ALREADY_EXISTS);
hardDelete(existing);
}
Device device = new Device();
device.setName(createGpsName());
device.setUniqueId(imei);
device.setUsers(Collections.singleton(requestUser));
device.setIconId(4L);
device.setOwner(requestUser);
em.persist(device);
logger.info("{} created device {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
return device;
}
private static String createGpsName() {
Random random = new Random();
return GPS_NAME_PREFIX+(random.nextInt(99)+1);
}
private static final String GPS_NAME_PREFIX = "gps-";
public void delete(long id) throws ProviderException {
boolean shouldManageTransaction = !em.getTransaction().isActive();
if(shouldManageTransaction)
em.getTransaction().begin();
Device device = getDevice(id);
if(!isVisible(device))
throw new ProviderException(Type.ACCESS_DENIED);
if(device.isDeleted())
throw new ProviderException(Type.ALREADY_DELETED);
if(representsOwner(device)) {
logger.info("{} deleted device {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
device.setDeleted(true);
} else {
logger.info("{} stopped seeing {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
device.getUsers().remove(requestUser);
}
em.persist(device);
if(shouldManageTransaction)
em.getTransaction().commit();
}
private boolean representsOwner(Device device) {
return requestUser.getAdmin()
|| requestUser.equals(device.getOwner())
|| requestUser.getAllManagedUsers().contains(device.getOwner());
}
private boolean isVisible(Device device) {
if(requestUser.getAdmin())
return true;
return getAllAvailableDevices().anyMatch(d -> d.equals(device));
}
private Stream<Device> getAllDevices() {
TypedQuery<Device> tq = em.createQuery("Select x from Device x", Device.class);
return tq.getResultList().stream();
}
private boolean isImeiValid(String imei) {
return imeis.isImeiRegistered(imei);
}
private void hardDelete(Device device) {
device.getUsers().clear();
device.setLatestPosition(null);
em.flush();
Query query = em.createQuery("DELETE FROM DeviceEvent x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
em.createQuery("DELETE FROM UserDeviceStatus x WHERE x.id.device = :device")
.setParameter("device", device).executeUpdate();
query = em.createQuery("DELETE FROM Position x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("SELECT g FROM GeoFence g WHERE :device MEMBER OF g.devices");
query.setParameter("device", device);
for (GeoFence geoFence : (List<GeoFence>) query.getResultList()) {
geoFence.getDevices().remove(device);
}
em.flush();
query = em.createQuery("DELETE FROM Maintenance x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("DELETE FROM Sensor x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("SELECT x FROM Report x WHERE :device MEMBER OF x.devices");
query.setParameter("device", device);
List<Report> reports = query.getResultList();
for (Report report : reports) {
report.getDevices().remove(device);
}
query = em.createNativeQuery("Delete from devices where id = ?");
query.setParameter(1, device.getId());
query.executeUpdate();
}
private static final Double NauticMilesToKilometersMultiplier = 0.54;
public void updateDevice(long id, EditDeviceDto deviceDto) throws ProviderException {
Device device = getDevice(id);
device.setName(deviceDto.getDeviceName());
device.setDeviceModelId(deviceDto.getDeviceModelId());
device.setIconId(deviceDto.getIconId());
device.setCustomIconId(deviceDto.getCustomIconId());
device.setColor(deviceDto.getColor());
device.setPhoneNumber(deviceDto.getPhoneNumber());
device.setPlateNumber(deviceDto.getPlateNumber());
device.setDescription(deviceDto.getDescription());
if(deviceDto.getSpeedLimit() != null)
device.setSpeedLimit(deviceDto.getSpeedLimit() * NauticMilesToKilometersMultiplier);
else
device.setSpeedLimit(null);
device.setFuelCapacity(deviceDto.getFuelCapacity());
em.persist(device);
logger.info("{} updated device {} (id={})",
requestUser.getEmail(), device.getName(), device.getId());
}
}
| src/main/java/pl/datamatica/traccar/api/providers/DeviceProvider.java | /*
* Copyright (C) 2016 Datamatica ([email protected])
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package pl.datamatica.traccar.api.providers;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Stream;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.slf4j.Logger;
import pl.datamatica.traccar.api.dtos.in.EditDeviceDto;
import pl.datamatica.traccar.api.providers.ProviderException.Type;
import pl.datamatica.traccar.model.Device;
import pl.datamatica.traccar.model.GeoFence;
import pl.datamatica.traccar.model.Report;
import pl.datamatica.traccar.model.User;
public class DeviceProvider extends ProviderBase {
private User requestUser;
private ImeiProvider imeis;
private Logger logger;
public DeviceProvider(EntityManager em, User requestUser, ImeiProvider imeis) {
super(em);
this.requestUser = requestUser;
this.imeis = imeis;
logger = DbLog.getLogger();
}
public Device getDevice(long id) throws ProviderException {
return get(Device.class, id, this::isVisible);
}
public Device getDeviceByImei(String imei) {
TypedQuery<Device> tq = em.createQuery("Select x from Device x where x.uniqueId = :imei", Device.class);
tq.setParameter("imei", imei);
List<Device> devices = tq.getResultList();
if(devices.isEmpty())
return null;
return devices.get(0);
}
public Stream<Device> getAllAvailableDevices() {
if(requestUser.getAdmin())
return getAllDevices();
else
return requestUser.getAllAvailableDevices().stream();
}
public Device createDevice(String imei) throws ProviderException {
if(!isImeiValid(imei))
throw new ProviderException(Type.INVALID_IMEI);
Device existing = getDeviceByImei(imei);
if(existing != null) {
if(!existing.isDeleted())
throw new ProviderException(Type.DEVICE_ALREADY_EXISTS);
hardDelete(existing);
}
Device device = new Device();
device.setName(createGpsName());
device.setUniqueId(imei);
device.setUsers(Collections.singleton(requestUser));
device.setIconId(4L);
device.setOwner(requestUser);
em.persist(device);
logger.info("{} created device {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
return device;
}
private static String createGpsName() {
Random random = new Random();
return GPS_NAME_PREFIX+(random.nextInt(99)+1);
}
private static final String GPS_NAME_PREFIX = "gps-";
public void delete(long id) throws ProviderException {
boolean shouldManageTransaction = !em.getTransaction().isActive();
if(shouldManageTransaction)
em.getTransaction().begin();
Device device = getDevice(id);
if(!isVisible(device))
throw new ProviderException(Type.ACCESS_DENIED);
if(device.isDeleted())
throw new ProviderException(Type.ALREADY_DELETED);
if(representsOwner(device)) {
logger.info("{} deleted device {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
device.setDeleted(true);
} else {
logger.info("{} stopped seeing {} (id={})",
requestUser.getLogin(), device.getName(), device.getId());
device.getUsers().remove(requestUser);
}
em.persist(device);
if(shouldManageTransaction)
em.getTransaction().commit();
}
private boolean representsOwner(Device device) {
return requestUser.getAdmin()
|| requestUser.equals(device.getOwner())
|| requestUser.getAllManagedUsers().contains(device.getOwner());
}
private boolean isVisible(Device device) {
if(requestUser.getAdmin())
return true;
return getAllAvailableDevices().anyMatch(d -> d.equals(device));
}
private Stream<Device> getAllDevices() {
TypedQuery<Device> tq = em.createQuery("Select x from Device x", Device.class);
return tq.getResultList().stream();
}
private boolean isImeiValid(String imei) {
return imeis.isImeiRegistered(imei);
}
private void hardDelete(Device device) {
device.getUsers().clear();
device.setLatestPosition(null);
em.flush();
Query query = em.createQuery("DELETE FROM DeviceEvent x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("DELETE FROM Position x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("SELECT g FROM GeoFence g WHERE :device MEMBER OF g.devices");
query.setParameter("device", device);
for (GeoFence geoFence : (List<GeoFence>) query.getResultList()) {
geoFence.getDevices().remove(device);
}
em.flush();
query = em.createQuery("DELETE FROM Maintenance x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("DELETE FROM Sensor x WHERE x.device = :device");
query.setParameter("device", device);
query.executeUpdate();
query = em.createQuery("SELECT x FROM Report x WHERE :device MEMBER OF x.devices");
query.setParameter("device", device);
List<Report> reports = query.getResultList();
for (Report report : reports) {
report.getDevices().remove(device);
}
query = em.createNativeQuery("Delete from devices where id = ?");
query.setParameter(1, device.getId());
query.executeUpdate();
}
private static final Double NauticMilesToKilometersMultiplier = 0.54;
public void updateDevice(long id, EditDeviceDto deviceDto) throws ProviderException {
Device device = getDevice(id);
device.setName(deviceDto.getDeviceName());
device.setDeviceModelId(deviceDto.getDeviceModelId());
device.setIconId(deviceDto.getIconId());
device.setCustomIconId(deviceDto.getCustomIconId());
device.setColor(deviceDto.getColor());
device.setPhoneNumber(deviceDto.getPhoneNumber());
device.setPlateNumber(deviceDto.getPlateNumber());
device.setDescription(deviceDto.getDescription());
if(deviceDto.getSpeedLimit() != null)
device.setSpeedLimit(deviceDto.getSpeedLimit() * NauticMilesToKilometersMultiplier);
else
device.setSpeedLimit(null);
device.setFuelCapacity(deviceDto.getFuelCapacity());
em.persist(device);
logger.info("{} updated device {} (id={})",
requestUser.getEmail(), device.getName(), device.getId());
}
}
| AUTO-920 FIX: Exception during device's hard delete
| src/main/java/pl/datamatica/traccar/api/providers/DeviceProvider.java | AUTO-920 FIX: Exception during device's hard delete | <ide><path>rc/main/java/pl/datamatica/traccar/api/providers/DeviceProvider.java
<ide> Query query = em.createQuery("DELETE FROM DeviceEvent x WHERE x.device = :device");
<ide> query.setParameter("device", device);
<ide> query.executeUpdate();
<add>
<add> em.createQuery("DELETE FROM UserDeviceStatus x WHERE x.id.device = :device")
<add> .setParameter("device", device).executeUpdate();
<ide>
<ide> query = em.createQuery("DELETE FROM Position x WHERE x.device = :device");
<ide> query.setParameter("device", device); |
|
Java | mit | 7a5e1f0e4b9e99c9f969bbb9f7ddfacdb04c0e8e | 0 | maul-esel/rapanui | package rapanui.dsl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import rapanui.dsl.moai.Formula;
import rapanui.dsl.moai.Term;
public class DslHelper {
public static boolean equal(Term left, Term right) {
return EcoreUtil.equals(left, right);
}
public static boolean equal(Formula left, Formula right) {
return EcoreUtil.equals(left, right);
}
}
| src/rapanui.dsl/src/rapanui/dsl/DslHelper.java | package rapanui.dsl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import rapanui.dsl.moai.Term;
public class DslHelper {
public static boolean equal(Term left, Term right) {
return EcoreUtil.equals(left, right);
}
}
| add helper for formula equality
| src/rapanui.dsl/src/rapanui/dsl/DslHelper.java | add helper for formula equality | <ide><path>rc/rapanui.dsl/src/rapanui/dsl/DslHelper.java
<ide>
<ide> import org.eclipse.emf.ecore.util.EcoreUtil;
<ide>
<add>import rapanui.dsl.moai.Formula;
<ide> import rapanui.dsl.moai.Term;
<ide>
<ide> public class DslHelper {
<ide> public static boolean equal(Term left, Term right) {
<ide> return EcoreUtil.equals(left, right);
<ide> }
<add> public static boolean equal(Formula left, Formula right) {
<add> return EcoreUtil.equals(left, right);
<add> }
<ide> } |
|
Java | epl-1.0 | 2ae23e7778e6c3ec98f25a99ee5a4794e3b445c4 | 0 | miklossy/xtext-core,miklossy/xtext-core | /*******************************************************************************
* Copyright (c) 2017 itemis AG (http://www.itemis.de) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.xtext.ide.editor.contentassist;
import java.util.LinkedList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.BidiTreeIterator;
import org.eclipse.xtext.nodemodel.ILeafNode;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.util.ITextRegion;
import org.eclipse.xtext.util.LineAndColumn;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.PeekingIterator;
/**
* A CompletionPrefixProvider specialization that is capable of handling synthetic
* BEGIN and END tokens. Their unique property of being a leafnode with a length
* zero can be exploited to match the indentation stack when invoking content assist. *
*
* @author Sebastian Zarnekow - Initial contribution and API
* @since 2.13
*/
public class IndentationAwareCompletionPrefixProvider extends CompletionPrefixProvider {
/**
* Returns the input to parse including the whitespace left to the cursor position since
* it may be relevant to the list of proposals for whitespace sensitive languages.
*/
@Override
public String getInputToParse(String completeInput, int offset, int completionOffset) {
int fixedOffset = includeRightSideWhitespace(completeInput, offset, Math.min(completeInput.length(), completionOffset));
return super.getInputToParse(completeInput, fixedOffset, completionOffset);
}
protected int includeRightSideWhitespace(String input, int startOffset, int max) {
int result = startOffset;
while(result < max && Character.isWhitespace(input.charAt(result))) {
result++;
}
return result;
}
@Override
public INode getLastCompleteNodeByOffset(INode node, int offset, int completionOffset) {
INode result = getLastCompleteNodeByOffset(node, offset);
if (result.getTotalLength() == 0) {
// likely a dedent / end token - find the EObject with the respective open token
// and return the best guessed dedent token
int completionColumn = NodeModelUtils.getLineAndColumn(node, completionOffset).getColumn();
INode bestResult = findBestEndToken(node, result, completionColumn, true);
return bestResult;
} else if (result.getTotalEndOffset() < completionOffset) {
int completionColumn = NodeModelUtils.getLineAndColumn(node, completionOffset).getColumn();
INode bestResult = findBestEndToken(node, result, completionColumn, false);
return bestResult;
}
return result;
}
protected INode findBestEndToken(INode root, INode candidate, int completionColumn, boolean candidateIsEndToken) {
LinkedList<ILeafNode> sameGrammarElement = Lists.newLinkedList();
PeekingIterator<ILeafNode> iterator = createReversedLeafIterator(root, candidate, sameGrammarElement);
if (!iterator.hasNext()) {
return candidate;
}
// collect all candidates that belong to the same offset
LinkedList<ILeafNode> sameOffset = candidateIsEndToken ? collectLeafsWithSameOffset((ILeafNode)candidate, iterator) : Lists.newLinkedList();
// continue until we find a paired leaf with length 0 that is at the correct offset
EObject grammarElement = tryGetGrammarElementAsRule(candidateIsEndToken || sameGrammarElement.isEmpty() ? candidate : sameGrammarElement.getLast());
ILeafNode result = candidateIsEndToken ? null : (ILeafNode) candidate;
int sameOffsetSize = sameOffset.size();
while(iterator.hasNext()) {
ILeafNode next = iterator.next();
if (result == null || result.isHidden()) {
result = next;
}
if (next.getTotalLength() == 0) {
// potential indentation token
EObject rule = tryGetGrammarElementAsRule(next);
if (rule != grammarElement) {
LineAndColumn lineAndColumn = NodeModelUtils.getLineAndColumn(root, next.getTotalOffset());
if (lineAndColumn.getColumn() <= completionColumn) {
return result;
} else {
if (sameOffset.isEmpty()) {
if (sameGrammarElement.isEmpty()) {
result = null;
} else {
result = sameGrammarElement.removeLast();
}
} else {
if (sameOffsetSize >= sameOffset.size()) {
result = sameOffset.removeLast();
} else {
sameOffset.removeLast();
}
}
}
} else {
sameOffset.add(next);
}
}
}
return candidate;
}
private PeekingIterator<ILeafNode> createReversedLeafIterator(INode root, INode candidate, LinkedList<ILeafNode> sameGrammarElement) {
EObject grammarElement = null;
PeekingIterator<ILeafNode> iterator = Iterators.peekingIterator(Iterators.filter(root.getAsTreeIterable().reverse().iterator(), ILeafNode.class));
// traverse until we find the current candidate
while(iterator.hasNext()) {
ILeafNode next = iterator.next();
if (candidate.equals(next)) {
break;
} else if (next.getTotalLength() == 0) {
EObject otherGrammarElement = tryGetGrammarElementAsRule(next);
if (grammarElement == null) {
grammarElement = otherGrammarElement;
}
if (otherGrammarElement.equals(grammarElement)) {
sameGrammarElement.add(next);
} else {
sameGrammarElement.removeLast();
}
}
}
return iterator;
}
private LinkedList<ILeafNode> collectLeafsWithSameOffset(ILeafNode candidate, PeekingIterator<ILeafNode> iterator) {
LinkedList<ILeafNode> sameOffset = Lists.newLinkedList();
sameOffset.add(candidate);
int offset = candidate.getTotalOffset();
while(iterator.hasNext()) {
ILeafNode peek = iterator.peek();
if (peek.getTotalOffset() == offset) {
sameOffset.add(peek);
iterator.next();
} else {
break;
}
}
return sameOffset;
}
protected EObject tryGetGrammarElementAsRule(INode candidate) {
EObject grammarElement = candidate.getGrammarElement();
if (grammarElement instanceof RuleCall) {
grammarElement = ((RuleCall) grammarElement).getRule();
}
return grammarElement;
}
protected INode getLastCompleteNodeByOffset(INode node, int offset) {
BidiTreeIterator<INode> iterator = node.getRootNode().getAsTreeIterable().iterator();
INode result = node;
ITextRegion candidateTextRegion = node.getTextRegion();
while (iterator.hasNext()) {
INode candidate = iterator.next();
ITextRegion textRegion = candidate.getTextRegion();
if (textRegion.getOffset() >= offset && !(textRegion.getOffset() == offset && textRegion.getLength() == 0)) {
if (!candidateTextRegion.equals(textRegion) && candidate instanceof ILeafNode && textRegion.getLength() + textRegion.getOffset() >= offset) {
break;
}
}
if ((candidate instanceof ILeafNode) &&
(candidate.getGrammarElement() == null ||
candidate.getGrammarElement() instanceof AbstractElement ||
candidate.getGrammarElement() instanceof ParserRule)) {
if (textRegion.getLength() == 0) {
if (candidateTextRegion.getOffset() + candidateTextRegion.getLength() < offset || candidateTextRegion.getLength() == 0 && candidateTextRegion.getOffset() <= offset) {
result = candidate;
candidateTextRegion = candidate.getTextRegion();
}
} else {
result = candidate;
candidateTextRegion = candidate.getTextRegion();
}
}
}
return result;
}
}
| org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/IndentationAwareCompletionPrefixProvider.java | /*******************************************************************************
* Copyright (c) 2017 itemis AG (http://www.itemis.de) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.xtext.ide.editor.contentassist;
import java.util.LinkedList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.BidiTreeIterator;
import org.eclipse.xtext.nodemodel.ILeafNode;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.util.ITextRegion;
import org.eclipse.xtext.util.LineAndColumn;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.PeekingIterator;
/**
* A CompletionPrefixProvider specialization that is capable of handling synthetic
* BEGIN and END tokens. Their unique property of being a leafnode with a length
* zero can be exploited to match the indentation stack when invoking content assist. *
*
* @author Sebastian Zarnekow - Initial contribution and API
* @since 2.13
*/
public class IndentationAwareCompletionPrefixProvider extends CompletionPrefixProvider {
/**
* Returns the input to parse including the whitespace left to the cursor position since
* it may be relevant to the list of proposals for whitespace sensitive languages.
*/
@Override
public String getInputToParse(String completeInput, int offset, int completionOffset) {
for(; offset < completionOffset && offset < completeInput.length(); offset++) {
char c = completeInput.charAt(offset);
if (!(c == '\n' || c == '\r' || c == ' ' || c == '\t' || c == '\f')) {
break;
}
}
return super.getInputToParse(completeInput, offset, completionOffset);
}
@Override
public INode getLastCompleteNodeByOffset(INode node, int offset, int completionOffset) {
INode result = getLastCompleteNodeByOffset(node, offset);
if (result.getTotalLength() == 0) {
// likely a dedent / end token - find the EObject with the respective open token
// and return the best guessed dedent token
int completionColumn = NodeModelUtils.getLineAndColumn(node, completionOffset).getColumn();
INode bestResult = findBestEndToken(node, result, completionColumn, true);
return bestResult;
} else if (result.getTotalEndOffset() < completionOffset) {
int completionColumn = NodeModelUtils.getLineAndColumn(node, completionOffset).getColumn();
INode bestResult = findBestEndToken(node, result, completionColumn, false);
return bestResult;
}
return result;
}
protected INode findBestEndToken(INode root, INode candidate, int completionColumn, boolean candidateIsEndToken) {
LinkedList<ILeafNode> sameGrammarElement = Lists.newLinkedList();
PeekingIterator<ILeafNode> iterator = createReversedLeafIterator(root, candidate, sameGrammarElement);
if (!iterator.hasNext()) {
return candidate;
}
// collect all candidates that belong to the same offset
LinkedList<ILeafNode> sameOffset = candidateIsEndToken ? collectLeafsWithSameOffset((ILeafNode)candidate, iterator) : Lists.newLinkedList();
// continue until we find a paired leaf with length 0 that is at the correct offset
EObject grammarElement = tryGetGrammarElementAsRule(candidateIsEndToken || sameGrammarElement.isEmpty() ? candidate : sameGrammarElement.getLast());
ILeafNode result = candidateIsEndToken ? null : (ILeafNode) candidate;
int sameOffsetSize = sameOffset.size();
while(iterator.hasNext()) {
ILeafNode next = iterator.next();
if (result == null || result.isHidden()) {
result = next;
}
if (next.getTotalLength() == 0) {
// potential indentation token
EObject rule = tryGetGrammarElementAsRule(next);
if (rule != grammarElement) {
LineAndColumn lineAndColumn = NodeModelUtils.getLineAndColumn(root, next.getTotalOffset());
if (lineAndColumn.getColumn() <= completionColumn) {
return result;
} else {
if (sameOffset.isEmpty()) {
if (sameGrammarElement.isEmpty()) {
result = null;
} else {
result = sameGrammarElement.removeLast();
}
} else {
if (sameOffsetSize >= sameOffset.size()) {
result = sameOffset.removeLast();
} else {
sameOffset.removeLast();
}
}
}
} else {
sameOffset.add(next);
}
}
}
return candidate;
}
private PeekingIterator<ILeafNode> createReversedLeafIterator(INode root, INode candidate, LinkedList<ILeafNode> sameGrammarElement) {
EObject grammarElement = null;
PeekingIterator<ILeafNode> iterator = Iterators.peekingIterator(Iterators.filter(root.getAsTreeIterable().reverse().iterator(), ILeafNode.class));
// traverse until we find the current candidate
while(iterator.hasNext()) {
ILeafNode next = iterator.next();
if (candidate.equals(next)) {
break;
} else if (next.getTotalLength() == 0) {
EObject otherGrammarElement = tryGetGrammarElementAsRule(next);
if (grammarElement == null) {
grammarElement = otherGrammarElement;
}
if (otherGrammarElement.equals(grammarElement)) {
sameGrammarElement.add(next);
} else {
sameGrammarElement.removeLast();
}
}
}
return iterator;
}
private LinkedList<ILeafNode> collectLeafsWithSameOffset(ILeafNode candidate, PeekingIterator<ILeafNode> iterator) {
LinkedList<ILeafNode> sameOffset = Lists.newLinkedList();
sameOffset.add(candidate);
int offset = candidate.getTotalOffset();
while(iterator.hasNext()) {
ILeafNode peek = iterator.peek();
if (peek.getTotalOffset() == offset) {
sameOffset.add(peek);
iterator.next();
} else {
break;
}
}
return sameOffset;
}
protected EObject tryGetGrammarElementAsRule(INode candidate) {
EObject grammarElement = candidate.getGrammarElement();
if (grammarElement instanceof RuleCall) {
grammarElement = ((RuleCall) grammarElement).getRule();
}
return grammarElement;
}
protected INode getLastCompleteNodeByOffset(INode node, int offset) {
BidiTreeIterator<INode> iterator = node.getRootNode().getAsTreeIterable().iterator();
INode result = node;
ITextRegion candidateTextRegion = node.getTextRegion();
while (iterator.hasNext()) {
INode candidate = iterator.next();
ITextRegion textRegion = candidate.getTextRegion();
if (textRegion.getOffset() >= offset && !(textRegion.getOffset() == offset && textRegion.getLength() == 0)) {
if (!candidateTextRegion.equals(textRegion) && candidate instanceof ILeafNode && textRegion.getLength() + textRegion.getOffset() >= offset) {
break;
}
}
if ((candidate instanceof ILeafNode) &&
(candidate.getGrammarElement() == null ||
candidate.getGrammarElement() instanceof AbstractElement ||
candidate.getGrammarElement() instanceof ParserRule)) {
if (textRegion.getLength() == 0) {
if (candidateTextRegion.getOffset() + candidateTextRegion.getLength() < offset || candidateTextRegion.getLength() == 0 && candidateTextRegion.getOffset() <= offset) {
result = candidate;
candidateTextRegion = candidate.getTextRegion();
}
} else {
result = candidate;
candidateTextRegion = candidate.getTextRegion();
}
}
}
return result;
}
}
| Use Character.isWhitespace
| org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/IndentationAwareCompletionPrefixProvider.java | Use Character.isWhitespace | <ide><path>rg.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/IndentationAwareCompletionPrefixProvider.java
<ide> */
<ide> @Override
<ide> public String getInputToParse(String completeInput, int offset, int completionOffset) {
<del> for(; offset < completionOffset && offset < completeInput.length(); offset++) {
<del> char c = completeInput.charAt(offset);
<del> if (!(c == '\n' || c == '\r' || c == ' ' || c == '\t' || c == '\f')) {
<del> break;
<del> }
<add> int fixedOffset = includeRightSideWhitespace(completeInput, offset, Math.min(completeInput.length(), completionOffset));
<add> return super.getInputToParse(completeInput, fixedOffset, completionOffset);
<add> }
<add>
<add> protected int includeRightSideWhitespace(String input, int startOffset, int max) {
<add> int result = startOffset;
<add> while(result < max && Character.isWhitespace(input.charAt(result))) {
<add> result++;
<ide> }
<del> return super.getInputToParse(completeInput, offset, completionOffset);
<add> return result;
<ide> }
<ide>
<ide> @Override |
|
Java | apache-2.0 | fb444340e9813eabe75a84b55ddf2ed151e0acfd | 0 | emanuelet/Trove | package com.etapps.trovenla;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import com.etapps.trovenla.utils.ConfigUtils;
import com.etapps.trovenla.utils.TroveJobCreator;
import com.evernote.android.job.JobManager;
import com.facebook.stetho.Stetho;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import io.fabric.sdk.android.Fabric;
import io.realm.Realm;
import io.realm.RealmConfiguration;
import timber.log.Timber;
/**
* Created by emanuele on 12/04/15.
*/
public class Trove extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize Realm
Realm.init(this);
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded()
.build();
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mFirebaseAnalytics.setMinimumSessionDuration(3000);
mFirebaseAnalytics.setSessionTimeoutDuration(600000);
Realm.setDefaultConfiguration(realmConfiguration);
Fabric.with(this, new Crashlytics());
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
}
JobManager.create(this).addJobCreator(new TroveJobCreator());
}
public Realm getRealm() {
return Realm.getDefaultInstance();
}
@Override
public void onTerminate() {
super.onTerminate();
Realm.getDefaultInstance().close();
}
}
| app/src/main/java/com/etapps/trovenla/Trove.java | package com.etapps.trovenla;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import com.etapps.trovenla.utils.ConfigUtils;
import com.etapps.trovenla.utils.TroveJobCreator;
import com.evernote.android.job.JobManager;
import com.facebook.stetho.Stetho;
import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import io.fabric.sdk.android.Fabric;
import io.realm.Realm;
import io.realm.RealmConfiguration;
import timber.log.Timber;
/**
* Created by emanuele on 12/04/15.
*/
public class Trove extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize Realm
Realm.init(this);
RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded()
.build();
Realm.setDefaultConfiguration(realmConfiguration);
Fabric.with(this, new Crashlytics());
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
}
JobManager.create(this).addJobCreator(new TroveJobCreator());
}
public Realm getRealm() {
return Realm.getDefaultInstance();
}
@Override
public void onTerminate() {
super.onTerminate();
Realm.getDefaultInstance().close();
}
}
| global settings for firebase events
| app/src/main/java/com/etapps/trovenla/Trove.java | global settings for firebase events | <ide><path>pp/src/main/java/com/etapps/trovenla/Trove.java
<ide> import com.etapps.trovenla.utils.TroveJobCreator;
<ide> import com.evernote.android.job.JobManager;
<ide> import com.facebook.stetho.Stetho;
<add>import com.google.firebase.analytics.FirebaseAnalytics;
<ide> import com.twitter.sdk.android.core.TwitterAuthConfig;
<ide> import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
<ide>
<ide> RealmConfiguration realmConfiguration = new RealmConfiguration.Builder()
<ide> .deleteRealmIfMigrationNeeded()
<ide> .build();
<add>
<add> FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
<add> mFirebaseAnalytics.setMinimumSessionDuration(3000);
<add> mFirebaseAnalytics.setSessionTimeoutDuration(600000);
<ide>
<ide> Realm.setDefaultConfiguration(realmConfiguration);
<ide> |
|
Java | lgpl-2.1 | abbac135d3d5907c76062708856f279f23d9e0e3 | 0 | alkacon/opencms-core,alkacon/opencms-core,gallardo/opencms-core,gallardo/opencms-core,gallardo/opencms-core,alkacon/opencms-core,alkacon/opencms-core,gallardo/opencms-core | /*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ui.apps.sitemanager;
import org.opencms.ade.configuration.CmsADEManager;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsProperty;
import org.opencms.file.CmsPropertyDefinition;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceFilter;
import org.opencms.file.types.CmsResourceTypeJsp;
import org.opencms.file.types.I_CmsResourceType;
import org.opencms.i18n.CmsLocaleManager;
import org.opencms.main.CmsException;
import org.opencms.main.CmsIllegalArgumentException;
import org.opencms.main.CmsLog;
import org.opencms.main.OpenCms;
import org.opencms.security.CmsOrganizationalUnit;
import org.opencms.site.CmsSite;
import org.opencms.site.CmsSiteMatcher;
import org.opencms.ui.A_CmsUI;
import org.opencms.ui.CmsVaadinUtils;
import org.opencms.ui.apps.Messages;
import org.opencms.ui.components.CmsBasicDialog;
import org.opencms.ui.components.CmsRemovableFormRow;
import org.opencms.ui.components.CmsResourceInfo;
import org.opencms.ui.components.fileselect.CmsPathSelectField;
import org.opencms.ui.report.CmsReportWidget;
import org.opencms.util.CmsMacroResolver;
import org.opencms.util.CmsStringUtil;
import org.opencms.util.CmsUUID;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.server.StreamResource;
import com.vaadin.server.UserError;
import com.vaadin.shared.ui.combobox.FilteringMode;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Image;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.Receiver;
import com.vaadin.ui.Upload.SucceededEvent;
import com.vaadin.ui.Upload.SucceededListener;
import com.vaadin.ui.themes.ValoTheme;
/**
* Class for the Form to edit or add a site.<p>
*/
public class CmsEditSiteForm extends CmsBasicDialog {
/**
* Bean for the ComboBox to edit the position.<p>
*/
public class PositionComboBoxElementBean {
/**Position of site in List. */
private float m_position;
/**Title of site to show. */
private String m_title;
/**
* Constructor. <p>
*
* @param title of site
* @param position of site
*/
public PositionComboBoxElementBean(String title, float position) {
m_position = position;
m_title = title;
}
/**
* Getter for position.<p>
*
* @return float position
*/
public float getPosition() {
return m_position;
}
/**
* Getter for title.<p>
*
* @return String title
*/
public String getTitle() {
return m_title;
}
}
/**
* Receiver class for upload of favicon.<p>
*/
class FavIconReceiver implements Receiver, SucceededListener {
/**vaadin serial id. */
private static final long serialVersionUID = 688021741970679734L;
/**
* @see com.vaadin.ui.Upload.Receiver#receiveUpload(java.lang.String, java.lang.String)
*/
public OutputStream receiveUpload(String filename, String mimeType) {
m_os.reset();
if (!mimeType.startsWith("image")) {
return new ByteArrayOutputStream(0);
}
return m_os;
}
/**
* @see com.vaadin.ui.Upload.SucceededListener#uploadSucceeded(com.vaadin.ui.Upload.SucceededEvent)
*/
public void uploadSucceeded(SucceededEvent event) {
if (m_os.size() <= 1) {
m_imageCounter = 0;
m_fieldUploadFavIcon.setComponentError(
new UserError(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_MIME_0)));
setFaviconIfExist();
return;
}
if (m_os.size() > 4096) {
m_fieldUploadFavIcon.setComponentError(
new UserError(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_SIZE_0)));
m_imageCounter = 0;
setFaviconIfExist();
return;
}
m_imageCounter++;
setCurrentFavIcon(m_os.toByteArray());
}
}
/**
*Validator for Folder Name field.<p>
*/
class FolderPathValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 2269520781911597613L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String enteredName = (String)value;
if (FORBIDDEN_FOLDER_NAMES.contains(enteredName)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_FORBIDDEN_1, enteredName));
}
if (m_alreadyUsedFolderPath.contains(getParentFolder() + enteredName)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_ALREADYUSED_1, enteredName));
}
try {
CmsResource.checkResourceName(enteredName);
} catch (CmsIllegalArgumentException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_EMPTY_0));
}
}
}
/**
* Validator for the parent field.<p>
*/
class ParentFolderValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 5217828150841769662L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
try {
m_clonedCms.getRequestContext().setSiteRoot("");
m_clonedCms.readResource(getParentFolder());
} catch (CmsException e) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTFOLDER_NOT_EXIST_0));
}
if (!(getParentFolder()).startsWith(CmsSiteManager.PATH_SITES)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_WRONGPARENT_0));
}
if (!getSiteTemplatePath().isEmpty()) {
if (ensureFoldername(getParentFolder()).equals(ensureFoldername(getSiteTemplatePath()))) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_EQUAL_SITETEMPLATE_0));
}
}
}
}
/**
* Validator for parent OU.<p>
*/
class SelectOUValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -911831798529729185L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String OU = (String)value;
if (OU.equals("/")) {
return; //ok
}
if (OU.split("/").length < 2) {
return; //ou is under root
}
OU = OU.split("/")[0] + "/";
if (getParentFolder().isEmpty() | getFieldFolder().isEmpty()) {
return; //not ok, but gets catched in an other validator
}
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
boolean ok = false;
try {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(m_clonedCms, OU);
for (CmsResource resource : res) {
if (rootPath.startsWith(resource.getRootPath())) {
ok = true;
}
}
} catch (CmsException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_OU_INVALID_0));
}
if (!ok) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_OU_INVALID_0));
}
}
}
/**
* Validator for parent OU.<p>
*/
class SelectParentOUValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -911831798529729185L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String parentOU = (String)value;
if (parentOU.equals("/")) {
return; //ok
}
if (getParentFolder().isEmpty() | getFieldFolder().isEmpty()) {
return; //not ok, but gets catched in an other validator
}
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
boolean ok = false;
try {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
m_clonedCms,
parentOU);
for (CmsResource resource : res) {
if (rootPath.startsWith(resource.getRootPath())) {
ok = true;
}
}
} catch (CmsException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTOU_INVALID_0));
}
if (!ok) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTOU_INVALID_0));
}
}
}
/**
*Validator for server field.<p>
*/
class ServerValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 9014118214418269697L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String enteredServer = (String)value;
if (enteredServer.isEmpty()) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SERVER_EMPTY_0));
}
if (m_alreadyUsedURL.contains(new CmsSiteMatcher(enteredServer))) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SERVER_ALREADYUSED_1, enteredServer));
}
}
}
/**
* Validator for site root (in case of editing a site, fails for broken sites.<p>
*/
class SiteRootValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 7499390905843603642L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
CmsProject currentProject = m_clonedCms.getRequestContext().getCurrentProject();
try {
m_clonedCms.getRequestContext().setCurrentProject(
m_clonedCms.readProject(CmsProject.ONLINE_PROJECT_ID));
m_clonedCms.readResource((String)value);
} catch (CmsException e) {
m_clonedCms.getRequestContext().setCurrentProject(currentProject);
if (!m_clonedCms.existsResource((String)value)) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITEROOT_WRONG_0));
}
}
m_clonedCms.getRequestContext().setCurrentProject(currentProject);
}
}
/**
* Validator for Site Template selection field.<p>
*/
class SiteTemplateValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -8730991818750657154L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String pathToCheck = (String)value;
if (pathToCheck == null) {
return;
}
if (pathToCheck.isEmpty()) { //Empty -> no template chosen, ok
return;
}
if (!getParentFolder().isEmpty() & !getFieldFolder().isEmpty()) {
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
if (m_clonedCms.existsResource(rootPath)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITETEMPLATE_OVERWRITE_0));
}
}
try {
m_clonedCms.readResource(pathToCheck + CmsADEManager.CONTENT_FOLDER_NAME);
// m_clonedCms.readResource(pathToCheck + CmsSiteManager.MACRO_FOLDER);
} catch (CmsException e) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITETEMPLATE_INVALID_0));
}
}
}
/**
* Validator for the title field.<p>
*/
class TitleValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 7878441125879949490L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
if (((String)value).isEmpty()) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_TITLE_EMPTY_0));
}
}
}
/** The module name constant. */
public static final String MODULE_NAME = "org.opencms.ui.apps.sitemanager";
/** Module parameter constant for the web server script. */
public static final String PARAM_OU_DESCRIPTION = "oudescription";
/**List of all forbidden folder names as new site-roots.*/
static final List<String> FORBIDDEN_FOLDER_NAMES = new ArrayList<String>() {
private static final long serialVersionUID = 8074588073232610426L;
{
add("system");
add(OpenCms.getSiteManager().getSharedFolder().replaceAll("/", ""));
}
};
/** The logger for this class. */
static Log LOG = CmsLog.getLog(CmsEditSiteForm.class.getName());
/**vaadin serial id.*/
private static final long serialVersionUID = -1011525709082939562L;
/**List of all folder names already used for sites. */
List<String> m_alreadyUsedFolderPath = new ArrayList<String>();
/**List of all urls already used for sites.*/
List<CmsSiteMatcher> m_alreadyUsedURL = new ArrayList<CmsSiteMatcher>();
/**cloned cms obejct.*/
CmsObject m_clonedCms;
/**vaadin component. */
Upload m_fieldUploadFavIcon;
/**Needed to check if favicon was changed. */
int m_imageCounter;
/**OutputStream to store the uploaded favicon temporarily. */
ByteArrayOutputStream m_os = new ByteArrayOutputStream(5500);
/**current site which is supposed to be edited, null if site should be added.*/
CmsSite m_site;
/**vaadin component.*/
TabSheet m_tab;
/**button to add aliases.*/
private Button m_addAlias;
/**button to add parameter.*/
private Button m_addParameter;
/**vaadin component.*/
private FormLayout m_aliases;
/**automatic setted folder name.*/
private String m_autoSetFolderName;
/**vaadin component. */
private Panel m_infoSiteRoot;
/**Map to connect vaadin text fields with bundle keys.*/
private Map<TextField, String> m_bundleComponentKeyMap;
/**vaadin component.*/
private FormLayout m_bundleValues;
/**vaadin component.*/
private Button m_cancel;
/**vaadin component.*/
private CheckBox m_fieldCreateOU;
/**vaadin component.*/
private CmsPathSelectField m_fieldErrorPage;
/**vaadin component.*/
private CheckBox m_fieldExclusiveError;
/**vaadin component.*/
private CheckBox m_fieldExclusiveURL;
/**vaadin component. */
private Image m_fieldFavIcon;
/**vaadin component.*/
private CmsPathSelectField m_fieldLoadSiteTemplate;
/**vaadin component.*/
private ComboBox m_fieldPosition;
/**vaadin component.*/
private TextField m_fieldSecureServer;
/**vaadin component.*/
ComboBox m_fieldSelectOU;
/**vaadin coponent.*/
ComboBox m_fieldSelectParentOU;
/**vaadin component.*/
private CheckBox m_fieldWebServer;
/**boolean indicates if folder name was changed by user.*/
private boolean m_isFolderNameTouched;
/**vaadin component.*/
private CmsPathSelectField m_simpleFieldSiteRoot;
/** The site manager instance.*/
CmsSiteManager m_manager;
/**vaadin component.*/
private Button m_ok;
/**Click listener for ok button. */
private Button.ClickListener m_okClickListener;
/**vaadin component.*/
private FormLayout m_parameter;
/**Panel holding the report widget.*/
private Panel m_report;
/**vaadin component.*/
private TextField m_simpleFieldFolderName;
/**vaadin component.*/
private CmsPathSelectField m_simpleFieldParentFolderName;
/**vaadin component.*/
private TextField m_simpleFieldServer;
/**vaadin component.*/
private ComboBox m_simpleFieldTemplate;
/**vaadin component.*/
private TextField m_simpleFieldTitle;
/**Layout for the report widget. */
private FormLayout m_threadReport;
/**
* Constructor.<p>
* Use this to create a new site.<p>
*
* @param manager the site manager instance
* @param cms the CmsObject
*/
public CmsEditSiteForm(CmsObject cms, CmsSiteManager manager) {
m_isFolderNameTouched = false;
m_autoSetFolderName = "";
m_clonedCms = cms;
List<CmsSite> allSites = OpenCms.getSiteManager().getAvailableSites(m_clonedCms, true);
allSites.addAll(OpenCms.getSiteManager().getAvailableCorruptedSites(m_clonedCms, true));
for (CmsSite site : allSites) {
if (site.getSiteMatcher() != null) {
m_alreadyUsedFolderPath.add(site.getSiteRoot());
m_alreadyUsedURL.add(site.getSiteMatcher());
}
}
CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
m_infoSiteRoot.setVisible(false);
m_simpleFieldSiteRoot.setVisible(false);
if (!OpenCms.getSiteManager().isConfigurableWebServer()) {
m_fieldWebServer.setVisible(false);
m_fieldWebServer.setValue(new Boolean(true));
}
m_simpleFieldParentFolderName.setValue(CmsSiteManager.PATH_SITES);
m_simpleFieldParentFolderName.setUseRootPaths(true);
m_simpleFieldParentFolderName.setCmsObject(m_clonedCms);
m_simpleFieldParentFolderName.setResourceFilter(CmsResourceFilter.DEFAULT_FOLDERS);
m_simpleFieldParentFolderName.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 4043563040462776139L;
public void valueChange(ValueChangeEvent event) {
setUpOUComboBox(m_fieldSelectParentOU);
setUpOUComboBox(m_fieldSelectOU);
}
});
m_manager = manager;
m_addParameter.addClickListener(new ClickListener() {
private static final long serialVersionUID = 6814134727761004218L;
public void buttonClick(ClickEvent event) {
addParameter(null);
}
});
m_addAlias.addClickListener(new ClickListener() {
private static final long serialVersionUID = -276802394623141951L;
public void buttonClick(ClickEvent event) {
addAlias(null);
}
});
m_okClickListener = new ClickListener() {
private static final long serialVersionUID = 6814134727761004218L;
public void buttonClick(ClickEvent event) {
setupValidators();
if (isValidInputSimple() & isValidInputSiteTemplate()) {
submit();
return;
}
if (isValidInputSimple()) {
m_tab.setSelectedTab(4);
return;
}
m_tab.setSelectedTab(0);
}
};
m_ok.addClickListener(m_okClickListener);
m_cancel.addClickListener(new ClickListener() {
private static final long serialVersionUID = -276802394623141951L;
public void buttonClick(ClickEvent event) {
closeDailog(false);
}
});
m_fieldCreateOU.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -2837270577662919541L;
public void valueChange(ValueChangeEvent event) {
toggleSelectOU();
}
});
m_tab.addStyleName(ValoTheme.TABSHEET_FRAMED);
m_tab.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
setUpComboBoxPosition();
setUpComboBoxTemplate();
setUpOUComboBox(m_fieldSelectOU);
setUpOUComboBox(m_fieldSelectParentOU);
m_fieldSecureServer.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -2837270577662919541L;
public void valueChange(ValueChangeEvent event) {
toggleSecureServer();
}
});
m_fieldExclusiveURL.setEnabled(false);
m_fieldExclusiveError.setEnabled(false);
Receiver uploadReceiver = new FavIconReceiver();
m_fieldWebServer.setValue(new Boolean(true));
m_fieldUploadFavIcon.setReceiver(uploadReceiver);
m_fieldUploadFavIcon.setButtonCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SELECT_FILE_0));
m_fieldUploadFavIcon.setImmediate(true);
m_fieldUploadFavIcon.addSucceededListener((SucceededListener)uploadReceiver);
m_fieldUploadFavIcon.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_NEW_0));
m_fieldFavIcon.setVisible(false);
m_simpleFieldTitle.addBlurListener(new BlurListener() {
private static final long serialVersionUID = -4147179568264310325L;
public void blur(BlurEvent event) {
if (!getFieldTitle().isEmpty() & !isFolderNameTouched()) {
String niceName = OpenCms.getResourceManager().getNameGenerator().getUniqueFileName(
m_clonedCms,
"/sites",
getFieldTitle().toLowerCase());
setFolderNameState(niceName);
setFieldFolder(niceName);
}
}
});
m_simpleFieldFolderName.addBlurListener(new BlurListener() {
private static final long serialVersionUID = 2080245499551324408L;
public void blur(BlurEvent event) {
setFolderNameState(null);
}
});
m_fieldLoadSiteTemplate.addValidator(new SiteTemplateValidator());
m_fieldLoadSiteTemplate.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -5859547073423161234L;
public void valueChange(ValueChangeEvent event) {
clearMessageBundle();
loadMessageBundle();
m_manager.centerWindow();
}
});
m_fieldLoadSiteTemplate.setUseRootPaths(true);
m_fieldLoadSiteTemplate.setCmsObject(m_clonedCms);
m_fieldLoadSiteTemplate.setResourceFilter(CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireFolder());
m_fieldSelectParentOU.setEnabled(false);
m_report.setVisible(false);
}
/**
* Constructor.<p>
* Used to edit existing site.<p>
*
* @param manager the manager instance
* @param siteRoot of site to edit
* @param cms the CmsObject
*/
public CmsEditSiteForm(CmsObject cms, CmsSiteManager manager, String siteRoot) {
this(cms, manager);
m_simpleFieldSiteRoot.setVisible(true);
m_simpleFieldSiteRoot.setValue(siteRoot);
m_simpleFieldSiteRoot.setCmsObject(m_clonedCms);
m_simpleFieldSiteRoot.addValidator(new SiteRootValidator());
m_simpleFieldSiteRoot.addValueChangeListener(new ValueChangeListener() {
/**vaadin serial id. */
private static final long serialVersionUID = 4680456758446195524L;
public void valueChange(ValueChangeEvent event) {
setTemplateField();
checkOnOfflineSiteRoot();
}
});
m_simpleFieldParentFolderName.setVisible(false);
m_simpleFieldFolderName.setVisible(false);
m_site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
displayResourceInfoDirectly(
Collections.singletonList(
new CmsResourceInfo(m_site.getTitle(), m_site.getSiteRoot(), m_manager.getFavIcon(siteRoot))));
m_tab.removeTab(m_tab.getTab(4));
m_simpleFieldTitle.removeTextChangeListener(null);
m_simpleFieldParentFolderName.setEnabled(false);
m_simpleFieldParentFolderName.setValue(
siteRoot.substring(0, siteRoot.length() - siteRoot.split("/")[siteRoot.split("/").length - 1].length()));
m_simpleFieldFolderName.removeAllValidators(); //can not be changed
m_fieldCreateOU.setVisible(false);
disableOUComboBox();
m_alreadyUsedURL.remove(m_alreadyUsedURL.indexOf(m_site.getSiteMatcher())); //Remove current url to avoid validation problem
setFieldTitle(m_site.getTitle());
setFieldFolder(getFolderNameFromSiteRoot(siteRoot));
m_simpleFieldFolderName.setEnabled(false);
setFieldServer(m_site.getUrl());
if (m_site.hasSecureServer()) {
m_fieldSecureServer.setValue(m_site.getSecureUrl());
}
if (m_site.getErrorPage() != null) {
m_fieldErrorPage.setValue(m_site.getErrorPage());
}
m_fieldWebServer.setValue(new Boolean(m_site.isWebserver()));
m_fieldExclusiveURL.setValue(new Boolean(m_site.isExclusiveUrl()));
m_fieldExclusiveError.setValue(new Boolean(m_site.isExclusiveError()));
Map<String, String> siteParameters = m_site.getParameters();
for (Entry<String, String> parameter : siteParameters.entrySet()) {
addParameter(getParameterString(parameter));
}
List<CmsSiteMatcher> siteAliases = m_site.getAliases();
for (CmsSiteMatcher siteMatcher : siteAliases) {
addAlias(siteMatcher.getUrl());
}
setTemplateField();
setUpComboBoxPosition();
if (!m_fieldSecureServer.isEmpty()) {
m_fieldExclusiveURL.setEnabled(true);
m_fieldExclusiveError.setEnabled(true);
}
setFaviconIfExist();
checkOnOfflineSiteRoot();
}
/**
* Returns a Folder Name for a given site-root.<p>
*
* @param siteRoot site root of a site
* @return Folder Name
*/
static String getFolderNameFromSiteRoot(String siteRoot) {
return siteRoot.split("/")[siteRoot.split("/").length - 1];
}
/**
* Checks if site root exists in on and offline repository.<p>
*/
protected void checkOnOfflineSiteRoot() {
try {
CmsObject cmsOnline = OpenCms.initCmsObject(m_clonedCms);
cmsOnline.getRequestContext().setCurrentProject(m_clonedCms.readProject(CmsProject.ONLINE_PROJECT_ID));
String rootPath = m_simpleFieldSiteRoot.getValue();
if (cmsOnline.existsResource(rootPath) & !m_clonedCms.existsResource(rootPath)) {
m_ok.setEnabled(false);
m_infoSiteRoot.setVisible(true);
return;
}
} catch (CmsException e) {
LOG.error("Can not initialize CmsObject", e);
}
m_ok.setEnabled(true);
m_infoSiteRoot.setVisible(false);
}
/**
* Sets the template field depending on current set site root field(s).<p>
*/
protected void setTemplateField() {
try {
CmsProperty template = m_clonedCms.readPropertyObject(
getSiteRoot(),
CmsPropertyDefinition.PROPERTY_TEMPLATE,
false);
if (template.isNullProperty()) {
m_simpleFieldTemplate.setValue(null);
} else {
m_simpleFieldTemplate.setValue(template.getStructureValue());
}
} catch (CmsException e) {
m_simpleFieldTemplate.setValue(null);
}
}
/**
* Adds a given alias String to the aliase-Vaadin form.<p>
*
* @param aliasString alias string which should be added.
*/
void addAlias(String aliasString) {
TextField textField = new TextField();
if (aliasString != null) {
textField.setValue(aliasString);
}
CmsRemovableFormRow<TextField> row = new CmsRemovableFormRow<TextField>(
textField,
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_REMOVE_ALIAS_0));
row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_0));
row.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_HELP_0));
m_aliases.addComponent(row);
}
/**
* Add a given parameter to the form layout.<p>
*
* @param parameter parameter to add to form
*/
void addParameter(String parameter) {
TextField textField = new TextField();
if (parameter != null) {
textField.setValue(parameter);
}
CmsRemovableFormRow<TextField> row = new CmsRemovableFormRow<TextField>(
textField,
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_REMOVE_PARAMETER_0));
row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_0));
row.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_HELP_0));
m_parameter.addComponent(row);
}
/**
* Clears the message bundle and removes related text fields from UI.<p>
*/
void clearMessageBundle() {
if (m_bundleComponentKeyMap != null) {
Set<TextField> setBundles = m_bundleComponentKeyMap.keySet();
for (TextField field : setBundles) {
m_bundleValues.removeComponent(field);
}
m_bundleComponentKeyMap.clear();
}
}
/**
* Closes the dialog.<p>
*
* @param updateTable <code>true</code> to update the site table
*/
void closeDailog(boolean updateTable) {
m_manager.closeDialogWindow(updateTable);
}
/**
* Checks if there are at least one character in the folder name,
* also ensures that it ends with a '/' and doesn't start with '/'.<p>
*
* @param resourcename folder name to check (complete path)
* @return the validated folder name
* @throws CmsIllegalArgumentException if the folder name is empty or <code>null</code>
*/
String ensureFoldername(String resourcename) {
if (CmsStringUtil.isEmpty(resourcename)) {
return "";
}
if (!CmsResource.isFolder(resourcename)) {
resourcename = resourcename.concat("/");
}
if (resourcename.charAt(0) == '/') {
resourcename = resourcename.substring(1);
}
return resourcename;
}
/**
* Returns the value of the site-folder.<p>
*
* @return String of folder path.
*/
String getFieldFolder() {
return m_simpleFieldFolderName.getValue();
}
/**
* Reads title field.<p>
*
* @return title as string.
*/
String getFieldTitle() {
return m_simpleFieldTitle.getValue();
}
/**
* Returns parent folder.<p>
*
* @return parent folder as string
*/
String getParentFolder() {
return m_simpleFieldParentFolderName.getValue();
}
/**
* Returns the value of the site template field.<p>
*
* @return string root path
*/
String getSiteTemplatePath() {
return m_fieldLoadSiteTemplate.getValue();
}
/**
* Checks if folder name was touched.<p>
*
* Considered as touched if side is edited or value of foldername was changed by user.<p>
*
* @return boolean true means Folder value was set by user or existing site and should not be changed by title-listener
*/
boolean isFolderNameTouched() {
if (m_site != null) {
return true;
}
if (m_autoSetFolderName.equals(getFieldFolder())) {
return false;
}
return m_isFolderNameTouched;
}
/**
* Checks if all required fields are set correctly at first Tab.<p>
*
* @return true if all inputs are valid.
*/
boolean isValidInputSimple() {
return (m_simpleFieldFolderName.isValid()
& m_simpleFieldServer.isValid()
& m_simpleFieldTitle.isValid()
& m_simpleFieldParentFolderName.isValid()
& m_fieldSelectOU.isValid()
& m_simpleFieldSiteRoot.isValid());
}
/**
* Checks if all required fields are set correctly at site template tab.<p>
*
* @return true if all inputs are valid.
*/
boolean isValidInputSiteTemplate() {
return (m_fieldLoadSiteTemplate.isValid() & m_fieldSelectParentOU.isValid());
}
/**
* Loads message bundle from bundle defined inside the site-template which is used to create new site.<p>
*/
void loadMessageBundle() {
//Check if chosen site template is valid and not empty
if (!m_fieldLoadSiteTemplate.isValid()
| m_fieldLoadSiteTemplate.isEmpty()
| !CmsSiteManager.isFolderWithMacros(m_clonedCms, m_fieldLoadSiteTemplate.getValue())) {
return;
}
try {
m_bundleComponentKeyMap = new HashMap<TextField, String>();
//Get resource of the descriptor.
CmsResource descriptor = m_clonedCms.readResource(
m_fieldLoadSiteTemplate.getValue()
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ CmsSiteManager.BUNDLE_NAME
+ "_desc");
//Read related bundle
Properties resourceBundle = getLocalizedBundle();
Map<String, String[]> bundleKeyDescriptorMap = CmsMacroResolver.getBundleMapFromResources(
resourceBundle,
descriptor,
m_clonedCms);
for (String key : bundleKeyDescriptorMap.keySet()) {
//Create TextField
TextField field = new TextField();
field.setCaption(bundleKeyDescriptorMap.get(key)[0]);
field.setValue(bundleKeyDescriptorMap.get(key)[1]);
field.setWidth("100%");
//Add vaadin component to UI and keep related key in HashMap
m_bundleValues.addComponent(field);
m_bundleComponentKeyMap.put(field, key);
}
} catch (CmsException | IOException e) {
LOG.error("Error reading bundle", e);
}
}
/**
* Sets a new uploaded favicon and changes the caption of the upload button.<p>
*
* @param imageData holdings byte array of favicon
*/
void setCurrentFavIcon(final byte[] imageData) {
m_fieldFavIcon.setVisible(true);
m_fieldUploadFavIcon.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_CHANGE_0));
m_fieldFavIcon.setSource(new StreamResource(new StreamResource.StreamSource() {
private static final long serialVersionUID = -8868657402793427460L;
public InputStream getStream() {
return new ByteArrayInputStream(imageData);
}
}, ""));
m_fieldFavIcon.setImmediate(true);
}
/**
* Tries to read and show the favicon of the site.<p>
*/
void setFaviconIfExist() {
try {
CmsResource favicon = m_clonedCms.readResource(m_site.getSiteRoot() + "/" + CmsSiteManager.FAVICON);
setCurrentFavIcon(m_clonedCms.readFile(favicon).getContents()); //FavIcon was found -> give it to the UI
} catch (CmsException e) {
//no favicon, do nothing
}
}
/**
* Sets the folder field.<p>
*
* @param newValue value of the field
*/
void setFieldFolder(String newValue) {
m_simpleFieldFolderName.setValue(newValue);
}
/**
* Sets the folder Name state to recognize if folder field was touched.<p>
*
* @param setFolderName name of folder set by listener from title.
*/
void setFolderNameState(String setFolderName) {
if (setFolderName == null) {
if (m_simpleFieldFolderName.getValue().isEmpty()) {
m_isFolderNameTouched = false;
return;
}
m_isFolderNameTouched = true;
} else {
m_autoSetFolderName = setFolderName;
}
}
/**
* Enables the ok button after finishing report thread.<p>
*/
void setOkButtonEnabled() {
m_ok.setEnabled(true);
m_ok.removeClickListener(m_okClickListener);
m_ok.addClickListener(new ClickListener() {
private static final long serialVersionUID = 5637556711524961424L;
public void buttonClick(ClickEvent event) {
closeDailog(true);
}
});
}
/**
* Fill ComboBox for OU selection.<p>
* @param combo combo box
*/
void setUpOUComboBox(ComboBox combo) {
combo.removeAllItems();
combo.addItem("/");
try {
m_clonedCms.getRequestContext().setSiteRoot("");
List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
m_clonedCms,
"/",
true);
for (CmsOrganizationalUnit ou : ous) {
if (ouIsOK(ou)) {
combo.addItem(ou.getName());
}
}
combo.setNewItemsAllowed(false);
} catch (CmsException e) {
LOG.error("Error on reading OUs", e);
}
combo.setNullSelectionAllowed(false);
combo.setTextInputAllowed(true);
combo.setFilteringMode(FilteringMode.CONTAINS);
combo.setNewItemsAllowed(false);
combo.select("/");
}
/**
* Setup validators which get called on click.<p>
* Site-template gets validated separately.<p>
*/
void setupValidators() {
if (m_simpleFieldServer.getValidators().size() == 0) {
if (m_site == null) {
m_simpleFieldFolderName.addValidator(new FolderPathValidator());
m_simpleFieldParentFolderName.addValidator(new ParentFolderValidator());
}
m_simpleFieldServer.addValidator(new ServerValidator());
m_simpleFieldTitle.addValidator(new TitleValidator());
m_fieldSelectOU.addValidator(new SelectOUValidator());
if (m_fieldCreateOU.getValue().booleanValue()) {
m_fieldSelectParentOU.addValidator(new SelectParentOUValidator());
}
}
}
/**
* Saves the entered site-data as a CmsSite object.<p>
*/
void submit() {
//Show report field and hide form fields
m_report.setVisible(true);
m_tab.setVisible(false);
m_ok.setEnabled(false);
m_cancel.setEnabled(false);
// switch to root site
m_clonedCms.getRequestContext().setSiteRoot("");
CmsSite site = getSiteFromForm();
Map<String, String> bundle = getBundleMap();
boolean createOU = m_fieldCreateOU.isEnabled() & m_fieldCreateOU.getValue().booleanValue();
CmsCreateSiteThread createThread = new CmsCreateSiteThread(
m_clonedCms,
site,
m_site,
m_fieldLoadSiteTemplate.getValue(),
getFieldTemplate(),
createOU,
(String)m_fieldSelectParentOU.getValue(),
(String)m_fieldSelectOU.getValue(),
m_os,
bundle,
new Runnable() {
public void run() {
setOkButtonEnabled();
}
});
createThread.start();
CmsReportWidget report = new CmsReportWidget(createThread);
report.setWidth("100%");
report.setHeight("350px");
m_threadReport.addComponent(report);
}
/**
* Toogles secure server options.<p>
*/
void toggleSecureServer() {
if (m_fieldSecureServer.isEmpty()) {
m_fieldExclusiveURL.setEnabled(false);
m_fieldExclusiveError.setEnabled(false);
return;
}
m_fieldExclusiveURL.setEnabled(true);
m_fieldExclusiveError.setEnabled(true);
}
/**
* Toogles the select OU combo box depending on create ou check box.<p>
*/
void toggleSelectOU() {
boolean create = m_fieldCreateOU.getValue().booleanValue();
m_fieldSelectOU.setEnabled(!create);
m_fieldSelectParentOU.setEnabled(create);
m_fieldSelectOU.select("/");
}
/**
* Selects the OU of the site (if site has an OU), and disables the ComboBox.<p>
*/
private void disableOUComboBox() {
try {
m_clonedCms.getRequestContext().setSiteRoot("");
List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
m_clonedCms,
"/",
true);
for (CmsOrganizationalUnit ou : ous) {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
m_clonedCms,
ou.getName());
for (CmsResource resource : res) {
if (resource.getRootPath().equals(m_site.getSiteRoot() + "/")) {
m_fieldSelectOU.select(ou.getName());
}
}
}
} catch (CmsException e) {
LOG.error("Error on reading OUs", e);
}
m_fieldSelectOU.setEnabled(false);
}
/**
* Reads out all aliases from the form.<p>
*
* @return a List of CmsSiteMatcher
*/
private List<CmsSiteMatcher> getAliases() {
List<CmsSiteMatcher> ret = new ArrayList<CmsSiteMatcher>();
for (Component c : m_aliases) {
if (c instanceof CmsRemovableFormRow<?>) {
ret.add(
new CmsSiteMatcher(
((String)((CmsRemovableFormRow<? extends AbstractField<?>>)c).getInput().getValue())));
}
}
return ret;
}
/**
* Returns the correct varaint of a resource name accoreding to locale.<p>
*
* @param path where the considered resource is.
* @param baseName of the resource
* @return localized name of resource
*/
private String getAvailableLocalVariant(String path, String baseName) {
//First look for a bundle with the locale of the folder..
try {
CmsProperty propLoc = m_clonedCms.readPropertyObject(path, CmsPropertyDefinition.PROPERTY_LOCALE, true);
if (!propLoc.isNullProperty()) {
if (m_clonedCms.existsResource(path + baseName + "_" + propLoc.getValue())) {
return baseName + "_" + propLoc.getValue();
}
}
} catch (CmsException e) {
LOG.error("Can not read locale property", e);
}
//If no bundle was found with the locale of the folder, or the property was not set, search for other locales
A_CmsUI.get();
List<String> localVariations = CmsLocaleManager.getLocaleVariants(
baseName,
UI.getCurrent().getLocale(),
false,
true);
for (String name : localVariations) {
if (m_clonedCms.existsResource(path + name)) {
return name;
}
}
return null;
}
/**
* Reads out bundle values from UI and stores keys with values in HashMap.<p>
*
* @return hash map
*/
private Map<String, String> getBundleMap() {
Map<String, String> bundles = new HashMap<String, String>();
if (m_bundleComponentKeyMap != null) {
Set<TextField> fields = m_bundleComponentKeyMap.keySet();
for (TextField field : fields) {
bundles.put(m_bundleComponentKeyMap.get(field), field.getValue());
}
}
return bundles;
}
/**
* Reads server field.<p>
*
* @return server as string
*/
private String getFieldServer() {
return m_simpleFieldServer.getValue();
}
/**
* Reads ComboBox with Template information.<p>
*
* @return string of chosen template path.
*/
private String getFieldTemplate() {
Object value = m_simpleFieldTemplate.getValue();
if (value != null) {
return (String)value;
}
return "";
}
/**
* Gets localized property object.<p>
*
* @return Properties object
* @throws CmsException exception
* @throws IOException exception
*/
private Properties getLocalizedBundle() throws CmsException, IOException {
CmsResource bundleResource = m_clonedCms.readResource(
m_fieldLoadSiteTemplate.getValue()
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ getAvailableLocalVariant(
m_fieldLoadSiteTemplate.getValue() + CmsSiteManager.MACRO_FOLDER + "/",
CmsSiteManager.BUNDLE_NAME));
Properties ret = new Properties();
InputStreamReader reader = new InputStreamReader(
new ByteArrayInputStream(m_clonedCms.readFile(bundleResource).getContents()),
StandardCharsets.UTF_8);
ret.load(reader);
return ret;
}
/**
* Reads parameter from form.<p>
*
* @return a Map with Parameter information.
*/
private Map<String, String> getParameter() {
Map<String, String> ret = new TreeMap<String, String>();
for (Component c : m_parameter) {
if (c instanceof CmsRemovableFormRow<?>) {
String[] parameterStringArray = ((String)((CmsRemovableFormRow<? extends AbstractField<?>>)c).getInput().getValue()).split(
"=");
ret.put(parameterStringArray[0], parameterStringArray[1]);
}
}
return ret;
}
/**
* Map entry of parameter to String representation.<p>
*
* @param parameter Entry holding parameter info.
* @return the parameter formatted as string
*/
private String getParameterString(Entry<String, String> parameter) {
return parameter.getKey() + "=" + parameter.getValue();
}
/**
* Reads out all forms and creates a site object.<p>
*
* @return the site object.
*/
private CmsSite getSiteFromForm() {
String siteRoot = getSiteRoot();
CmsSiteMatcher matcher = CmsStringUtil.isNotEmpty(m_fieldSecureServer.getValue())
? new CmsSiteMatcher(m_fieldSecureServer.getValue())
: null;
CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
CmsUUID uuid = new CmsUUID();
if ((site != null) && (site.getSiteMatcher() != null)) {
uuid = (CmsUUID)site.getSiteRootUUID().clone();
}
String errorPage = CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldErrorPage.getValue())
? m_fieldErrorPage.getValue()
: null;
List<CmsSiteMatcher> aliases = getAliases();
CmsSite ret = new CmsSite(
siteRoot,
uuid,
getFieldTitle(),
new CmsSiteMatcher(getFieldServer()),
((PositionComboBoxElementBean)m_fieldPosition.getValue()).getPosition() == -1
? String.valueOf(m_site.getPosition())
: String.valueOf(((PositionComboBoxElementBean)m_fieldPosition.getValue()).getPosition()),
errorPage,
matcher,
m_fieldExclusiveURL.getValue().booleanValue(),
m_fieldExclusiveError.getValue().booleanValue(),
m_fieldWebServer.getValue().booleanValue(),
aliases);
ret.setParameters((SortedMap<String, String>)getParameter());
return ret;
}
/**
* Gets the site root.<p>
*
* @return site root string
*/
private String getSiteRoot() {
String res;
if (m_simpleFieldSiteRoot.isVisible()) {
res = m_simpleFieldSiteRoot.getValue();
} else {
res = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
res = res.endsWith("/") ? res.substring(0, res.length() - 1) : res;
}
return res;
}
/**
* Checks if given Ou has resources matching to currently set parent folder.<p>
*
* @param ou to check
* @return true if ou is ok for parent folder
*/
private boolean ouIsOK(CmsOrganizationalUnit ou) {
try {
for (CmsResource res : OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
m_clonedCms,
ou.getName())) {
if (m_simpleFieldParentFolderName.getValue().startsWith(res.getRootPath())) {
return true;
}
}
} catch (CmsException e) {
LOG.error("Unable to read Resources for Org Unit", e);
}
return false;
}
/**
* Sets the server field.<p>
*
* @param newValue value of the field.
*/
private void setFieldServer(String newValue) {
m_simpleFieldServer.setValue(newValue);
}
/**
* Sets the title field.<p>
*
* @param newValue value of the field.
*/
private void setFieldTitle(String newValue) {
m_simpleFieldTitle.setValue(newValue);
}
/**
* Set the combo box for the position.<p>
* Copied from workplace tool.<p>
*/
private void setUpComboBoxPosition() {
m_fieldPosition.removeAllItems();
List<CmsSite> sites = new ArrayList<CmsSite>();
List<PositionComboBoxElementBean> beanList = new ArrayList<PositionComboBoxElementBean>();
for (CmsSite site : OpenCms.getSiteManager().getAvailableSites(m_clonedCms, true)) {
if (site.getSiteMatcher() != null) {
sites.add(site);
}
}
float maxValue = 0;
float nextPos = 0;
// calculate value for the first navigation position
float firstValue = 1;
if (sites.size() > 0) {
try {
maxValue = sites.get(0).getPosition();
} catch (Exception e) {
// should usually never happen
}
}
if (maxValue != 0) {
firstValue = maxValue / 2;
}
// add the first entry: before first element
beanList.add(
new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_FIRST_0),
firstValue));
// show all present navigation elements in box
for (int i = 0; i < sites.size(); i++) {
float navPos = sites.get(i).getPosition();
String siteRoot = sites.get(i).getSiteRoot();
// get position of next nav element
nextPos = navPos + 2;
if ((i + 1) < sites.size()) {
nextPos = sites.get(i + 1).getPosition();
}
// calculate new position of current nav element
float newPos;
if ((nextPos - navPos) > 1) {
newPos = navPos + 1;
} else {
newPos = (navPos + nextPos) / 2;
}
// check new maxValue of positions and increase it
if (navPos > maxValue) {
maxValue = navPos;
}
// if the element is the current file, mark it in select box
if ((m_site != null) && (m_site.getSiteRoot() != null) && m_site.getSiteRoot().equals(siteRoot)) {
beanList.add(
new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_CURRENT_1, m_site.getTitle()),
-1));
} else {
beanList.add(new PositionComboBoxElementBean(sites.get(i).getTitle(), newPos));
}
}
// add the entry: at the last position
PositionComboBoxElementBean lastEntry = new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_LAST_0),
maxValue + 1);
beanList.add(lastEntry);
// add the entry: no change
beanList.add(
new PositionComboBoxElementBean(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_NOCHANGE_0), -1));
BeanItemContainer<PositionComboBoxElementBean> objects = new BeanItemContainer<PositionComboBoxElementBean>(
PositionComboBoxElementBean.class,
beanList);
m_fieldPosition.setContainerDataSource(objects);
m_fieldPosition.setItemCaptionPropertyId("title");
m_fieldPosition.setValue(beanList.get(beanList.size() - 1));
if (m_site == null) {
m_fieldPosition.setValue(lastEntry);
}
}
/**
* Sets the combobox for the template.<p>
*/
private void setUpComboBoxTemplate() {
try {
I_CmsResourceType templateType = OpenCms.getResourceManager().getResourceType(
CmsResourceTypeJsp.getContainerPageTemplateTypeName());
List<CmsResource> templates = m_clonedCms.readResources(
"/system/",
CmsResourceFilter.DEFAULT.addRequireType(templateType));
for (CmsResource res : templates) {
m_simpleFieldTemplate.addItem(res.getRootPath());
}
if (!templates.isEmpty()) {
m_simpleFieldTemplate.setValue(templates.get(0).getRootPath());
}
m_simpleFieldTemplate.setNullSelectionAllowed(true);
} catch (CmsException e) {
// should not happen
}
}
}
| src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java | /*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ui.apps.sitemanager;
import org.opencms.ade.configuration.CmsADEManager;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsProject;
import org.opencms.file.CmsProperty;
import org.opencms.file.CmsPropertyDefinition;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceFilter;
import org.opencms.file.types.CmsResourceTypeJsp;
import org.opencms.file.types.I_CmsResourceType;
import org.opencms.i18n.CmsLocaleManager;
import org.opencms.main.CmsException;
import org.opencms.main.CmsIllegalArgumentException;
import org.opencms.main.CmsLog;
import org.opencms.main.OpenCms;
import org.opencms.security.CmsOrganizationalUnit;
import org.opencms.site.CmsSite;
import org.opencms.site.CmsSiteMatcher;
import org.opencms.ui.A_CmsUI;
import org.opencms.ui.CmsVaadinUtils;
import org.opencms.ui.apps.Messages;
import org.opencms.ui.components.CmsBasicDialog;
import org.opencms.ui.components.CmsRemovableFormRow;
import org.opencms.ui.components.CmsResourceInfo;
import org.opencms.ui.components.fileselect.CmsPathSelectField;
import org.opencms.ui.report.CmsReportWidget;
import org.opencms.util.CmsMacroResolver;
import org.opencms.util.CmsStringUtil;
import org.opencms.util.CmsUUID;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.server.StreamResource;
import com.vaadin.server.UserError;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Image;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.Receiver;
import com.vaadin.ui.Upload.SucceededEvent;
import com.vaadin.ui.Upload.SucceededListener;
import com.vaadin.ui.themes.ValoTheme;
/**
* Class for the Form to edit or add a site.<p>
*/
public class CmsEditSiteForm extends CmsBasicDialog {
/**
* Bean for the ComboBox to edit the position.<p>
*/
public class PositionComboBoxElementBean {
/**Position of site in List. */
private float m_position;
/**Title of site to show. */
private String m_title;
/**
* Constructor. <p>
*
* @param title of site
* @param position of site
*/
public PositionComboBoxElementBean(String title, float position) {
m_position = position;
m_title = title;
}
/**
* Getter for position.<p>
*
* @return float position
*/
public float getPosition() {
return m_position;
}
/**
* Getter for title.<p>
*
* @return String title
*/
public String getTitle() {
return m_title;
}
}
/**
* Receiver class for upload of favicon.<p>
*/
class FavIconReceiver implements Receiver, SucceededListener {
/**vaadin serial id. */
private static final long serialVersionUID = 688021741970679734L;
/**
* @see com.vaadin.ui.Upload.Receiver#receiveUpload(java.lang.String, java.lang.String)
*/
public OutputStream receiveUpload(String filename, String mimeType) {
m_os.reset();
if (!mimeType.startsWith("image")) {
return new ByteArrayOutputStream(0);
}
return m_os;
}
/**
* @see com.vaadin.ui.Upload.SucceededListener#uploadSucceeded(com.vaadin.ui.Upload.SucceededEvent)
*/
public void uploadSucceeded(SucceededEvent event) {
if (m_os.size() <= 1) {
m_imageCounter = 0;
m_fieldUploadFavIcon.setComponentError(
new UserError(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_MIME_0)));
setFaviconIfExist();
return;
}
if (m_os.size() > 4096) {
m_fieldUploadFavIcon.setComponentError(
new UserError(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_SIZE_0)));
m_imageCounter = 0;
setFaviconIfExist();
return;
}
m_imageCounter++;
setCurrentFavIcon(m_os.toByteArray());
}
}
/**
*Validator for Folder Name field.<p>
*/
class FolderPathValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 2269520781911597613L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String enteredName = (String)value;
if (FORBIDDEN_FOLDER_NAMES.contains(enteredName)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_FORBIDDEN_1, enteredName));
}
if (m_alreadyUsedFolderPath.contains(getParentFolder() + enteredName)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_ALREADYUSED_1, enteredName));
}
try {
CmsResource.checkResourceName(enteredName);
} catch (CmsIllegalArgumentException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_EMPTY_0));
}
}
}
/**
* Validator for the parent field.<p>
*/
class ParentFolderValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 5217828150841769662L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
try {
m_clonedCms.getRequestContext().setSiteRoot("");
m_clonedCms.readResource(getParentFolder());
} catch (CmsException e) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTFOLDER_NOT_EXIST_0));
}
if (!(getParentFolder()).startsWith(CmsSiteManager.PATH_SITES)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_WRONGPARENT_0));
}
if (!getSiteTemplatePath().isEmpty()) {
if (ensureFoldername(getParentFolder()).equals(ensureFoldername(getSiteTemplatePath()))) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FOLDERNAME_EQUAL_SITETEMPLATE_0));
}
}
}
}
/**
* Validator for parent OU.<p>
*/
class SelectOUValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -911831798529729185L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String OU = (String)value;
if (OU.equals("/")) {
return; //ok
}
if (OU.split("/").length < 2) {
return; //ou is under root
}
OU = OU.split("/")[0] + "/";
if (getParentFolder().isEmpty() | getFieldFolder().isEmpty()) {
return; //not ok, but gets catched in an other validator
}
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
boolean ok = false;
try {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(m_clonedCms, OU);
for (CmsResource resource : res) {
if (rootPath.startsWith(resource.getRootPath())) {
ok = true;
}
}
} catch (CmsException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_OU_INVALID_0));
}
if (!ok) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_OU_INVALID_0));
}
}
}
/**
* Validator for parent OU.<p>
*/
class SelectParentOUValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -911831798529729185L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String parentOU = (String)value;
if (parentOU.equals("/")) {
return; //ok
}
if (getParentFolder().isEmpty() | getFieldFolder().isEmpty()) {
return; //not ok, but gets catched in an other validator
}
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
boolean ok = false;
try {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
m_clonedCms,
parentOU);
for (CmsResource resource : res) {
if (rootPath.startsWith(resource.getRootPath())) {
ok = true;
}
}
} catch (CmsException e) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTOU_INVALID_0));
}
if (!ok) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARENTOU_INVALID_0));
}
}
}
/**
*Validator for server field.<p>
*/
class ServerValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 9014118214418269697L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String enteredServer = (String)value;
if (enteredServer.isEmpty()) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SERVER_EMPTY_0));
}
if (m_alreadyUsedURL.contains(new CmsSiteMatcher(enteredServer))) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SERVER_ALREADYUSED_1, enteredServer));
}
}
}
/**
* Validator for site root (in case of editing a site, fails for broken sites.<p>
*/
class SiteRootValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 7499390905843603642L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
CmsProject currentProject = m_clonedCms.getRequestContext().getCurrentProject();
try {
m_clonedCms.getRequestContext().setCurrentProject(
m_clonedCms.readProject(CmsProject.ONLINE_PROJECT_ID));
m_clonedCms.readResource((String)value);
} catch (CmsException e) {
m_clonedCms.getRequestContext().setCurrentProject(currentProject);
if (!m_clonedCms.existsResource((String)value)) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITEROOT_WRONG_0));
}
}
m_clonedCms.getRequestContext().setCurrentProject(currentProject);
}
}
/**
* Validator for Site Template selection field.<p>
*/
class SiteTemplateValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = -8730991818750657154L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
String pathToCheck = (String)value;
if (pathToCheck == null) {
return;
}
if (pathToCheck.isEmpty()) { //Empty -> no template chosen, ok
return;
}
if (!getParentFolder().isEmpty() & !getFieldFolder().isEmpty()) {
String rootPath = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
if (m_clonedCms.existsResource(rootPath)) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITETEMPLATE_OVERWRITE_0));
}
}
try {
m_clonedCms.readResource(pathToCheck + CmsADEManager.CONTENT_FOLDER_NAME);
// m_clonedCms.readResource(pathToCheck + CmsSiteManager.MACRO_FOLDER);
} catch (CmsException e) {
throw new InvalidValueException(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SITETEMPLATE_INVALID_0));
}
}
}
/**
* Validator for the title field.<p>
*/
class TitleValidator implements Validator {
/**vaadin serial id.*/
private static final long serialVersionUID = 7878441125879949490L;
/**
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
public void validate(Object value) throws InvalidValueException {
if (((String)value).isEmpty()) {
throw new InvalidValueException(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_TITLE_EMPTY_0));
}
}
}
/** The module name constant. */
public static final String MODULE_NAME = "org.opencms.ui.apps.sitemanager";
/** Module parameter constant for the web server script. */
public static final String PARAM_OU_DESCRIPTION = "oudescription";
/**List of all forbidden folder names as new site-roots.*/
static final List<String> FORBIDDEN_FOLDER_NAMES = new ArrayList<String>() {
private static final long serialVersionUID = 8074588073232610426L;
{
add("system");
add(OpenCms.getSiteManager().getSharedFolder().replaceAll("/", ""));
}
};
/** The logger for this class. */
static Log LOG = CmsLog.getLog(CmsEditSiteForm.class.getName());
/**vaadin serial id.*/
private static final long serialVersionUID = -1011525709082939562L;
/**List of all folder names already used for sites. */
List<String> m_alreadyUsedFolderPath = new ArrayList<String>();
/**List of all urls already used for sites.*/
List<CmsSiteMatcher> m_alreadyUsedURL = new ArrayList<CmsSiteMatcher>();
/**cloned cms obejct.*/
CmsObject m_clonedCms;
/**vaadin component. */
Upload m_fieldUploadFavIcon;
/**Needed to check if favicon was changed. */
int m_imageCounter;
/**OutputStream to store the uploaded favicon temporarily. */
ByteArrayOutputStream m_os = new ByteArrayOutputStream(5500);
/**current site which is supposed to be edited, null if site should be added.*/
CmsSite m_site;
/**vaadin component.*/
TabSheet m_tab;
/**button to add aliases.*/
private Button m_addAlias;
/**button to add parameter.*/
private Button m_addParameter;
/**vaadin component.*/
private FormLayout m_aliases;
/**automatic setted folder name.*/
private String m_autoSetFolderName;
/**vaadin component. */
private Panel m_infoSiteRoot;
/**Map to connect vaadin text fields with bundle keys.*/
private Map<TextField, String> m_bundleComponentKeyMap;
/**vaadin component.*/
private FormLayout m_bundleValues;
/**vaadin component.*/
private Button m_cancel;
/**vaadin component.*/
private CheckBox m_fieldCreateOU;
/**vaadin component.*/
private CmsPathSelectField m_fieldErrorPage;
/**vaadin component.*/
private CheckBox m_fieldExclusiveError;
/**vaadin component.*/
private CheckBox m_fieldExclusiveURL;
/**vaadin component. */
private Image m_fieldFavIcon;
/**vaadin component.*/
private CmsPathSelectField m_fieldLoadSiteTemplate;
/**vaadin component.*/
private ComboBox m_fieldPosition;
/**vaadin component.*/
private TextField m_fieldSecureServer;
/**vaadin component.*/
private ComboBox m_fieldSelectOU;
/**vaadin coponent.*/
private ComboBox m_fieldSelectParentOU;
/**vaadin component.*/
private CheckBox m_fieldWebServer;
/**boolean indicates if folder name was changed by user.*/
private boolean m_isFolderNameTouched;
/**vaadin component.*/
private CmsPathSelectField m_simpleFieldSiteRoot;
/** The site manager instance.*/
CmsSiteManager m_manager;
/**vaadin component.*/
private Button m_ok;
/**Click listener for ok button. */
private Button.ClickListener m_okClickListener;
/**vaadin component.*/
private FormLayout m_parameter;
/**Panel holding the report widget.*/
private Panel m_report;
/**vaadin component.*/
private TextField m_simpleFieldFolderName;
/**vaadin component.*/
private CmsPathSelectField m_simpleFieldParentFolderName;
/**vaadin component.*/
private TextField m_simpleFieldServer;
/**vaadin component.*/
private ComboBox m_simpleFieldTemplate;
/**vaadin component.*/
private TextField m_simpleFieldTitle;
/**Layout for the report widget. */
private FormLayout m_threadReport;
/**
* Constructor.<p>
* Use this to create a new site.<p>
*
* @param manager the site manager instance
* @param cms the CmsObject
*/
public CmsEditSiteForm(CmsObject cms, CmsSiteManager manager) {
m_isFolderNameTouched = false;
m_autoSetFolderName = "";
m_clonedCms = cms;
List<CmsSite> allSites = OpenCms.getSiteManager().getAvailableSites(m_clonedCms, true);
allSites.addAll(OpenCms.getSiteManager().getAvailableCorruptedSites(m_clonedCms, true));
for (CmsSite site : allSites) {
if (site.getSiteMatcher() != null) {
m_alreadyUsedFolderPath.add(site.getSiteRoot());
m_alreadyUsedURL.add(site.getSiteMatcher());
}
}
CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
m_infoSiteRoot.setVisible(false);
m_simpleFieldSiteRoot.setVisible(false);
if (!OpenCms.getSiteManager().isConfigurableWebServer()) {
m_fieldWebServer.setVisible(false);
m_fieldWebServer.setValue(new Boolean(true));
}
m_simpleFieldParentFolderName.setValue(CmsSiteManager.PATH_SITES);
m_simpleFieldParentFolderName.setUseRootPaths(true);
m_simpleFieldParentFolderName.setCmsObject(m_clonedCms);
m_simpleFieldParentFolderName.setResourceFilter(CmsResourceFilter.DEFAULT_FOLDERS);
m_manager = manager;
m_addParameter.addClickListener(new ClickListener() {
private static final long serialVersionUID = 6814134727761004218L;
public void buttonClick(ClickEvent event) {
addParameter(null);
}
});
m_addAlias.addClickListener(new ClickListener() {
private static final long serialVersionUID = -276802394623141951L;
public void buttonClick(ClickEvent event) {
addAlias(null);
}
});
m_okClickListener = new ClickListener() {
private static final long serialVersionUID = 6814134727761004218L;
public void buttonClick(ClickEvent event) {
setupValidators();
if (isValidInputSimple() & isValidInputSiteTemplate()) {
submit();
return;
}
if (isValidInputSimple()) {
m_tab.setSelectedTab(4);
return;
}
m_tab.setSelectedTab(0);
}
};
m_ok.addClickListener(m_okClickListener);
m_cancel.addClickListener(new ClickListener() {
private static final long serialVersionUID = -276802394623141951L;
public void buttonClick(ClickEvent event) {
closeDailog(false);
}
});
m_fieldCreateOU.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -2837270577662919541L;
public void valueChange(ValueChangeEvent event) {
toggleSelectOU();
}
});
m_tab.addStyleName(ValoTheme.TABSHEET_FRAMED);
m_tab.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
setUpComboBoxPosition();
setUpComboBoxTemplate();
setUpOUComboBox(m_fieldSelectOU);
setUpOUComboBox(m_fieldSelectParentOU);
m_fieldSecureServer.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -2837270577662919541L;
public void valueChange(ValueChangeEvent event) {
toggleSecureServer();
}
});
m_fieldExclusiveURL.setEnabled(false);
m_fieldExclusiveError.setEnabled(false);
Receiver uploadReceiver = new FavIconReceiver();
m_fieldWebServer.setValue(new Boolean(true));
m_fieldUploadFavIcon.setReceiver(uploadReceiver);
m_fieldUploadFavIcon.setButtonCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_SELECT_FILE_0));
m_fieldUploadFavIcon.setImmediate(true);
m_fieldUploadFavIcon.addSucceededListener((SucceededListener)uploadReceiver);
m_fieldUploadFavIcon.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_NEW_0));
m_fieldFavIcon.setVisible(false);
m_simpleFieldTitle.addBlurListener(new BlurListener() {
private static final long serialVersionUID = -4147179568264310325L;
public void blur(BlurEvent event) {
if (!getFieldTitle().isEmpty() & !isFolderNameTouched()) {
String niceName = OpenCms.getResourceManager().getNameGenerator().getUniqueFileName(
m_clonedCms,
"/sites",
getFieldTitle().toLowerCase());
setFolderNameState(niceName);
setFieldFolder(niceName);
}
}
});
m_simpleFieldFolderName.addBlurListener(new BlurListener() {
private static final long serialVersionUID = 2080245499551324408L;
public void blur(BlurEvent event) {
setFolderNameState(null);
}
});
m_fieldLoadSiteTemplate.addValidator(new SiteTemplateValidator());
m_fieldLoadSiteTemplate.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -5859547073423161234L;
public void valueChange(ValueChangeEvent event) {
clearMessageBundle();
loadMessageBundle();
m_manager.centerWindow();
}
});
m_fieldLoadSiteTemplate.setUseRootPaths(true);
m_fieldLoadSiteTemplate.setCmsObject(m_clonedCms);
m_fieldLoadSiteTemplate.setResourceFilter(CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireFolder());
m_fieldSelectParentOU.setEnabled(false);
m_report.setVisible(false);
}
/**
* Constructor.<p>
* Used to edit existing site.<p>
*
* @param manager the manager instance
* @param siteRoot of site to edit
* @param cms the CmsObject
*/
public CmsEditSiteForm(CmsObject cms, CmsSiteManager manager, String siteRoot) {
this(cms, manager);
m_simpleFieldSiteRoot.setVisible(true);
m_simpleFieldSiteRoot.setValue(siteRoot);
m_simpleFieldSiteRoot.setCmsObject(m_clonedCms);
m_simpleFieldSiteRoot.addValidator(new SiteRootValidator());
m_simpleFieldSiteRoot.addValueChangeListener(new ValueChangeListener() {
/**vaadin serial id. */
private static final long serialVersionUID = 4680456758446195524L;
public void valueChange(ValueChangeEvent event) {
setTemplateField();
checkOnOfflineSiteRoot();
}
});
m_simpleFieldParentFolderName.setVisible(false);
m_simpleFieldFolderName.setVisible(false);
m_site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
displayResourceInfoDirectly(
Collections.singletonList(
new CmsResourceInfo(m_site.getTitle(), m_site.getSiteRoot(), m_manager.getFavIcon(siteRoot))));
m_tab.removeTab(m_tab.getTab(4));
m_simpleFieldTitle.removeTextChangeListener(null);
m_simpleFieldParentFolderName.setEnabled(false);
m_simpleFieldParentFolderName.setValue(
siteRoot.substring(0, siteRoot.length() - siteRoot.split("/")[siteRoot.split("/").length - 1].length()));
m_simpleFieldFolderName.removeAllValidators(); //can not be changed
m_fieldCreateOU.setVisible(false);
disableOUComboBox();
m_alreadyUsedURL.remove(m_alreadyUsedURL.indexOf(m_site.getSiteMatcher())); //Remove current url to avoid validation problem
setFieldTitle(m_site.getTitle());
setFieldFolder(getFolderNameFromSiteRoot(siteRoot));
m_simpleFieldFolderName.setEnabled(false);
setFieldServer(m_site.getUrl());
if (m_site.hasSecureServer()) {
m_fieldSecureServer.setValue(m_site.getSecureUrl());
}
if (m_site.getErrorPage() != null) {
m_fieldErrorPage.setValue(m_site.getErrorPage());
}
m_fieldWebServer.setValue(new Boolean(m_site.isWebserver()));
m_fieldExclusiveURL.setValue(new Boolean(m_site.isExclusiveUrl()));
m_fieldExclusiveError.setValue(new Boolean(m_site.isExclusiveError()));
Map<String, String> siteParameters = m_site.getParameters();
for (Entry<String, String> parameter : siteParameters.entrySet()) {
addParameter(getParameterString(parameter));
}
List<CmsSiteMatcher> siteAliases = m_site.getAliases();
for (CmsSiteMatcher siteMatcher : siteAliases) {
addAlias(siteMatcher.getUrl());
}
setTemplateField();
setUpComboBoxPosition();
if (!m_fieldSecureServer.isEmpty()) {
m_fieldExclusiveURL.setEnabled(true);
m_fieldExclusiveError.setEnabled(true);
}
setFaviconIfExist();
checkOnOfflineSiteRoot();
}
/**
* Returns a Folder Name for a given site-root.<p>
*
* @param siteRoot site root of a site
* @return Folder Name
*/
static String getFolderNameFromSiteRoot(String siteRoot) {
return siteRoot.split("/")[siteRoot.split("/").length - 1];
}
/**
* Checks if site root exists in on and offline repository.<p>
*/
protected void checkOnOfflineSiteRoot() {
try {
CmsObject cmsOnline = OpenCms.initCmsObject(m_clonedCms);
cmsOnline.getRequestContext().setCurrentProject(m_clonedCms.readProject(CmsProject.ONLINE_PROJECT_ID));
String rootPath = m_simpleFieldSiteRoot.getValue();
if (cmsOnline.existsResource(rootPath) & !m_clonedCms.existsResource(rootPath)) {
m_ok.setEnabled(false);
m_infoSiteRoot.setVisible(true);
return;
}
} catch (CmsException e) {
LOG.error("Can not initialize CmsObject", e);
}
m_ok.setEnabled(true);
m_infoSiteRoot.setVisible(false);
}
/**
* Sets the template field depending on current set site root field(s).<p>
*/
protected void setTemplateField() {
try {
CmsProperty template = m_clonedCms.readPropertyObject(
getSiteRoot(),
CmsPropertyDefinition.PROPERTY_TEMPLATE,
false);
if (template.isNullProperty()) {
m_simpleFieldTemplate.setValue(null);
} else {
m_simpleFieldTemplate.setValue(template.getStructureValue());
}
} catch (CmsException e) {
m_simpleFieldTemplate.setValue(null);
}
}
/**
* Adds a given alias String to the aliase-Vaadin form.<p>
*
* @param aliasString alias string which should be added.
*/
void addAlias(String aliasString) {
TextField textField = new TextField();
if (aliasString != null) {
textField.setValue(aliasString);
}
CmsRemovableFormRow<TextField> row = new CmsRemovableFormRow<TextField>(
textField,
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_REMOVE_ALIAS_0));
row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_0));
row.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_HELP_0));
m_aliases.addComponent(row);
}
/**
* Add a given parameter to the form layout.<p>
*
* @param parameter parameter to add to form
*/
void addParameter(String parameter) {
TextField textField = new TextField();
if (parameter != null) {
textField.setValue(parameter);
}
CmsRemovableFormRow<TextField> row = new CmsRemovableFormRow<TextField>(
textField,
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_REMOVE_PARAMETER_0));
row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_0));
row.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_HELP_0));
m_parameter.addComponent(row);
}
/**
* Clears the message bundle and removes related text fields from UI.<p>
*/
void clearMessageBundle() {
if (m_bundleComponentKeyMap != null) {
Set<TextField> setBundles = m_bundleComponentKeyMap.keySet();
for (TextField field : setBundles) {
m_bundleValues.removeComponent(field);
}
m_bundleComponentKeyMap.clear();
}
}
/**
* Closes the dialog.<p>
*
* @param updateTable <code>true</code> to update the site table
*/
void closeDailog(boolean updateTable) {
m_manager.closeDialogWindow(updateTable);
}
/**
* Checks if there are at least one character in the folder name,
* also ensures that it ends with a '/' and doesn't start with '/'.<p>
*
* @param resourcename folder name to check (complete path)
* @return the validated folder name
* @throws CmsIllegalArgumentException if the folder name is empty or <code>null</code>
*/
String ensureFoldername(String resourcename) {
if (CmsStringUtil.isEmpty(resourcename)) {
return "";
}
if (!CmsResource.isFolder(resourcename)) {
resourcename = resourcename.concat("/");
}
if (resourcename.charAt(0) == '/') {
resourcename = resourcename.substring(1);
}
return resourcename;
}
/**
* Returns the value of the site-folder.<p>
*
* @return String of folder path.
*/
String getFieldFolder() {
return m_simpleFieldFolderName.getValue();
}
/**
* Reads title field.<p>
*
* @return title as string.
*/
String getFieldTitle() {
return m_simpleFieldTitle.getValue();
}
/**
* Returns parent folder.<p>
*
* @return parent folder as string
*/
String getParentFolder() {
return m_simpleFieldParentFolderName.getValue();
}
/**
* Returns the value of the site template field.<p>
*
* @return string root path
*/
String getSiteTemplatePath() {
return m_fieldLoadSiteTemplate.getValue();
}
/**
* Checks if folder name was touched.<p>
*
* Considered as touched if side is edited or value of foldername was changed by user.<p>
*
* @return boolean true means Folder value was set by user or existing site and should not be changed by title-listener
*/
boolean isFolderNameTouched() {
if (m_site != null) {
return true;
}
if (m_autoSetFolderName.equals(getFieldFolder())) {
return false;
}
return m_isFolderNameTouched;
}
/**
* Checks if all required fields are set correctly at first Tab.<p>
*
* @return true if all inputs are valid.
*/
boolean isValidInputSimple() {
return (m_simpleFieldFolderName.isValid()
& m_simpleFieldServer.isValid()
& m_simpleFieldTitle.isValid()
& m_simpleFieldParentFolderName.isValid()
& m_fieldSelectOU.isValid()
& m_simpleFieldSiteRoot.isValid());
}
/**
* Checks if all required fields are set correctly at site template tab.<p>
*
* @return true if all inputs are valid.
*/
boolean isValidInputSiteTemplate() {
return (m_fieldLoadSiteTemplate.isValid() & m_fieldSelectParentOU.isValid());
}
/**
* Loads message bundle from bundle defined inside the site-template which is used to create new site.<p>
*/
void loadMessageBundle() {
//Check if chosen site template is valid and not empty
if (!m_fieldLoadSiteTemplate.isValid()
| m_fieldLoadSiteTemplate.isEmpty()
| !CmsSiteManager.isFolderWithMacros(m_clonedCms, m_fieldLoadSiteTemplate.getValue())) {
return;
}
try {
m_bundleComponentKeyMap = new HashMap<TextField, String>();
//Get resource of the descriptor.
CmsResource descriptor = m_clonedCms.readResource(
m_fieldLoadSiteTemplate.getValue()
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ CmsSiteManager.BUNDLE_NAME
+ "_desc");
//Read related bundle
Properties resourceBundle = getLocalizedBundle();
Map<String, String[]> bundleKeyDescriptorMap = CmsMacroResolver.getBundleMapFromResources(
resourceBundle,
descriptor,
m_clonedCms);
for (String key : bundleKeyDescriptorMap.keySet()) {
//Create TextField
TextField field = new TextField();
field.setCaption(bundleKeyDescriptorMap.get(key)[0]);
field.setValue(bundleKeyDescriptorMap.get(key)[1]);
field.setWidth("100%");
//Add vaadin component to UI and keep related key in HashMap
m_bundleValues.addComponent(field);
m_bundleComponentKeyMap.put(field, key);
}
} catch (CmsException | IOException e) {
LOG.error("Error reading bundle", e);
}
}
/**
* Sets a new uploaded favicon and changes the caption of the upload button.<p>
*
* @param imageData holdings byte array of favicon
*/
void setCurrentFavIcon(final byte[] imageData) {
m_fieldFavIcon.setVisible(true);
m_fieldUploadFavIcon.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_FAVICON_CHANGE_0));
m_fieldFavIcon.setSource(new StreamResource(new StreamResource.StreamSource() {
private static final long serialVersionUID = -8868657402793427460L;
public InputStream getStream() {
return new ByteArrayInputStream(imageData);
}
}, ""));
m_fieldFavIcon.setImmediate(true);
}
/**
* Tries to read and show the favicon of the site.<p>
*/
void setFaviconIfExist() {
try {
CmsResource favicon = m_clonedCms.readResource(m_site.getSiteRoot() + "/" + CmsSiteManager.FAVICON);
setCurrentFavIcon(m_clonedCms.readFile(favicon).getContents()); //FavIcon was found -> give it to the UI
} catch (CmsException e) {
//no favicon, do nothing
}
}
/**
* Sets the folder field.<p>
*
* @param newValue value of the field
*/
void setFieldFolder(String newValue) {
m_simpleFieldFolderName.setValue(newValue);
}
/**
* Sets the folder Name state to recognize if folder field was touched.<p>
*
* @param setFolderName name of folder set by listener from title.
*/
void setFolderNameState(String setFolderName) {
if (setFolderName == null) {
if (m_simpleFieldFolderName.getValue().isEmpty()) {
m_isFolderNameTouched = false;
return;
}
m_isFolderNameTouched = true;
} else {
m_autoSetFolderName = setFolderName;
}
}
/**
* Enables the ok button after finishing report thread.<p>
*/
void setOkButtonEnabled() {
m_ok.setEnabled(true);
m_ok.removeClickListener(m_okClickListener);
m_ok.addClickListener(new ClickListener() {
private static final long serialVersionUID = 5637556711524961424L;
public void buttonClick(ClickEvent event) {
closeDailog(true);
}
});
}
/**
* Setup validators which get called on click.<p>
* Site-template gets validated separately.<p>
*/
void setupValidators() {
if (m_simpleFieldServer.getValidators().size() == 0) {
if (m_site == null) {
m_simpleFieldFolderName.addValidator(new FolderPathValidator());
m_simpleFieldParentFolderName.addValidator(new ParentFolderValidator());
}
m_simpleFieldServer.addValidator(new ServerValidator());
m_simpleFieldTitle.addValidator(new TitleValidator());
m_fieldSelectOU.addValidator(new SelectOUValidator());
if (m_fieldCreateOU.getValue().booleanValue()) {
m_fieldSelectParentOU.addValidator(new SelectParentOUValidator());
}
}
}
/**
* Saves the entered site-data as a CmsSite object.<p>
*/
void submit() {
//Show report field and hide form fields
m_report.setVisible(true);
m_tab.setVisible(false);
m_ok.setEnabled(false);
m_cancel.setEnabled(false);
// switch to root site
m_clonedCms.getRequestContext().setSiteRoot("");
CmsSite site = getSiteFromForm();
Map<String, String> bundle = getBundleMap();
boolean createOU = m_fieldCreateOU.isEnabled() & m_fieldCreateOU.getValue().booleanValue();
CmsCreateSiteThread createThread = new CmsCreateSiteThread(
m_clonedCms,
site,
m_site,
m_fieldLoadSiteTemplate.getValue(),
getFieldTemplate(),
createOU,
(String)m_fieldSelectParentOU.getValue(),
(String)m_fieldSelectOU.getValue(),
m_os,
bundle,
new Runnable() {
public void run() {
setOkButtonEnabled();
}
});
createThread.start();
CmsReportWidget report = new CmsReportWidget(createThread);
report.setWidth("100%");
report.setHeight("350px");
m_threadReport.addComponent(report);
}
/**
* Toogles secure server options.<p>
*/
void toggleSecureServer() {
if (m_fieldSecureServer.isEmpty()) {
m_fieldExclusiveURL.setEnabled(false);
m_fieldExclusiveError.setEnabled(false);
return;
}
m_fieldExclusiveURL.setEnabled(true);
m_fieldExclusiveError.setEnabled(true);
}
/**
* Toogles the select OU combo box depending on create ou check box.<p>
*/
void toggleSelectOU() {
boolean create = m_fieldCreateOU.getValue().booleanValue();
m_fieldSelectOU.setEnabled(!create);
m_fieldSelectParentOU.setEnabled(create);
m_fieldSelectOU.select("/");
}
/**
* Selects the OU of the site (if site has an OU), and disables the ComboBox.<p>
*/
private void disableOUComboBox() {
try {
m_clonedCms.getRequestContext().setSiteRoot("");
List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
m_clonedCms,
"/",
true);
for (CmsOrganizationalUnit ou : ous) {
List<CmsResource> res = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
m_clonedCms,
ou.getName());
for (CmsResource resource : res) {
if (resource.getRootPath().equals(m_site.getSiteRoot() + "/")) {
m_fieldSelectOU.select(ou.getName());
}
}
}
} catch (CmsException e) {
LOG.error("Error on reading OUs", e);
}
m_fieldSelectOU.setEnabled(false);
}
/**
* Reads out all aliases from the form.<p>
*
* @return a List of CmsSiteMatcher
*/
private List<CmsSiteMatcher> getAliases() {
List<CmsSiteMatcher> ret = new ArrayList<CmsSiteMatcher>();
for (Component c : m_aliases) {
if (c instanceof CmsRemovableFormRow<?>) {
ret.add(
new CmsSiteMatcher(
((String)((CmsRemovableFormRow<? extends AbstractField<?>>)c).getInput().getValue())));
}
}
return ret;
}
/**
* Returns the correct varaint of a resource name accoreding to locale.<p>
*
* @param path where the considered resource is.
* @param baseName of the resource
* @return localized name of resource
*/
private String getAvailableLocalVariant(String path, String baseName) {
//First look for a bundle with the locale of the folder..
try {
CmsProperty propLoc = m_clonedCms.readPropertyObject(path, CmsPropertyDefinition.PROPERTY_LOCALE, true);
if (!propLoc.isNullProperty()) {
if (m_clonedCms.existsResource(path + baseName + "_" + propLoc.getValue())) {
return baseName + "_" + propLoc.getValue();
}
}
} catch (CmsException e) {
LOG.error("Can not read locale property", e);
}
//If no bundle was found with the locale of the folder, or the property was not set, search for other locales
A_CmsUI.get();
List<String> localVariations = CmsLocaleManager.getLocaleVariants(
baseName,
UI.getCurrent().getLocale(),
false,
true);
for (String name : localVariations) {
if (m_clonedCms.existsResource(path + name)) {
return name;
}
}
return null;
}
/**
* Reads out bundle values from UI and stores keys with values in HashMap.<p>
*
* @return hash map
*/
private Map<String, String> getBundleMap() {
Map<String, String> bundles = new HashMap<String, String>();
if (m_bundleComponentKeyMap != null) {
Set<TextField> fields = m_bundleComponentKeyMap.keySet();
for (TextField field : fields) {
bundles.put(m_bundleComponentKeyMap.get(field), field.getValue());
}
}
return bundles;
}
/**
* Reads server field.<p>
*
* @return server as string
*/
private String getFieldServer() {
return m_simpleFieldServer.getValue();
}
/**
* Reads ComboBox with Template information.<p>
*
* @return string of chosen template path.
*/
private String getFieldTemplate() {
Object value = m_simpleFieldTemplate.getValue();
if (value != null) {
return (String)value;
}
return "";
}
/**
* Gets localized property object.<p>
*
* @return Properties object
* @throws CmsException exception
* @throws IOException exception
*/
private Properties getLocalizedBundle() throws CmsException, IOException {
CmsResource bundleResource = m_clonedCms.readResource(
m_fieldLoadSiteTemplate.getValue()
+ CmsSiteManager.MACRO_FOLDER
+ "/"
+ getAvailableLocalVariant(
m_fieldLoadSiteTemplate.getValue() + CmsSiteManager.MACRO_FOLDER + "/",
CmsSiteManager.BUNDLE_NAME));
Properties ret = new Properties();
InputStreamReader reader = new InputStreamReader(
new ByteArrayInputStream(m_clonedCms.readFile(bundleResource).getContents()),
StandardCharsets.UTF_8);
ret.load(reader);
return ret;
}
/**
* Reads parameter from form.<p>
*
* @return a Map with Parameter information.
*/
private Map<String, String> getParameter() {
Map<String, String> ret = new TreeMap<String, String>();
for (Component c : m_parameter) {
if (c instanceof CmsRemovableFormRow<?>) {
String[] parameterStringArray = ((String)((CmsRemovableFormRow<? extends AbstractField<?>>)c).getInput().getValue()).split(
"=");
ret.put(parameterStringArray[0], parameterStringArray[1]);
}
}
return ret;
}
/**
* Map entry of parameter to String representation.<p>
*
* @param parameter Entry holding parameter info.
* @return the parameter formatted as string
*/
private String getParameterString(Entry<String, String> parameter) {
return parameter.getKey() + "=" + parameter.getValue();
}
/**
* Reads out all forms and creates a site object.<p>
*
* @return the site object.
*/
private CmsSite getSiteFromForm() {
String siteRoot = getSiteRoot();
CmsSiteMatcher matcher = CmsStringUtil.isNotEmpty(m_fieldSecureServer.getValue())
? new CmsSiteMatcher(m_fieldSecureServer.getValue())
: null;
CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
CmsUUID uuid = new CmsUUID();
if ((site != null) && (site.getSiteMatcher() != null)) {
uuid = (CmsUUID)site.getSiteRootUUID().clone();
}
String errorPage = CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldErrorPage.getValue())
? m_fieldErrorPage.getValue()
: null;
List<CmsSiteMatcher> aliases = getAliases();
CmsSite ret = new CmsSite(
siteRoot,
uuid,
getFieldTitle(),
new CmsSiteMatcher(getFieldServer()),
((PositionComboBoxElementBean)m_fieldPosition.getValue()).getPosition() == -1
? String.valueOf(m_site.getPosition())
: String.valueOf(((PositionComboBoxElementBean)m_fieldPosition.getValue()).getPosition()),
errorPage,
matcher,
m_fieldExclusiveURL.getValue().booleanValue(),
m_fieldExclusiveError.getValue().booleanValue(),
m_fieldWebServer.getValue().booleanValue(),
aliases);
ret.setParameters((SortedMap<String, String>)getParameter());
return ret;
}
/**
* Gets the site root.<p>
*
* @return site root string
*/
private String getSiteRoot() {
String res;
if (m_simpleFieldSiteRoot.isVisible()) {
res = m_simpleFieldSiteRoot.getValue();
} else {
res = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
res = res.endsWith("/") ? res.substring(0, res.length() - 1) : res;
}
return res;
}
/**
* Sets the server field.<p>
*
* @param newValue value of the field.
*/
private void setFieldServer(String newValue) {
m_simpleFieldServer.setValue(newValue);
}
/**
* Sets the title field.<p>
*
* @param newValue value of the field.
*/
private void setFieldTitle(String newValue) {
m_simpleFieldTitle.setValue(newValue);
}
/**
* Set the combo box for the position.<p>
* Copied from workplace tool.<p>
*/
private void setUpComboBoxPosition() {
m_fieldPosition.removeAllItems();
List<CmsSite> sites = new ArrayList<CmsSite>();
List<PositionComboBoxElementBean> beanList = new ArrayList<PositionComboBoxElementBean>();
for (CmsSite site : OpenCms.getSiteManager().getAvailableSites(m_clonedCms, true)) {
if (site.getSiteMatcher() != null) {
sites.add(site);
}
}
float maxValue = 0;
float nextPos = 0;
// calculate value for the first navigation position
float firstValue = 1;
if (sites.size() > 0) {
try {
maxValue = sites.get(0).getPosition();
} catch (Exception e) {
// should usually never happen
}
}
if (maxValue != 0) {
firstValue = maxValue / 2;
}
// add the first entry: before first element
beanList.add(
new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_FIRST_0),
firstValue));
// show all present navigation elements in box
for (int i = 0; i < sites.size(); i++) {
float navPos = sites.get(i).getPosition();
String siteRoot = sites.get(i).getSiteRoot();
// get position of next nav element
nextPos = navPos + 2;
if ((i + 1) < sites.size()) {
nextPos = sites.get(i + 1).getPosition();
}
// calculate new position of current nav element
float newPos;
if ((nextPos - navPos) > 1) {
newPos = navPos + 1;
} else {
newPos = (navPos + nextPos) / 2;
}
// check new maxValue of positions and increase it
if (navPos > maxValue) {
maxValue = navPos;
}
// if the element is the current file, mark it in select box
if ((m_site != null) && (m_site.getSiteRoot() != null) && m_site.getSiteRoot().equals(siteRoot)) {
beanList.add(
new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_CURRENT_1, m_site.getTitle()),
-1));
} else {
beanList.add(new PositionComboBoxElementBean(sites.get(i).getTitle(), newPos));
}
}
// add the entry: at the last position
PositionComboBoxElementBean lastEntry = new PositionComboBoxElementBean(
CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_LAST_0),
maxValue + 1);
beanList.add(lastEntry);
// add the entry: no change
beanList.add(
new PositionComboBoxElementBean(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_CHNAV_POS_NOCHANGE_0), -1));
BeanItemContainer<PositionComboBoxElementBean> objects = new BeanItemContainer<PositionComboBoxElementBean>(
PositionComboBoxElementBean.class,
beanList);
m_fieldPosition.setContainerDataSource(objects);
m_fieldPosition.setItemCaptionPropertyId("title");
m_fieldPosition.setValue(beanList.get(beanList.size() - 1));
if (m_site == null) {
m_fieldPosition.setValue(lastEntry);
}
}
/**
* Sets the combobox for the template.<p>
*/
private void setUpComboBoxTemplate() {
try {
I_CmsResourceType templateType = OpenCms.getResourceManager().getResourceType(
CmsResourceTypeJsp.getContainerPageTemplateTypeName());
List<CmsResource> templates = m_clonedCms.readResources(
"/system/",
CmsResourceFilter.DEFAULT.addRequireType(templateType));
for (CmsResource res : templates) {
m_simpleFieldTemplate.addItem(res.getRootPath());
}
if (!templates.isEmpty()) {
m_simpleFieldTemplate.setValue(templates.get(0).getRootPath());
}
m_simpleFieldTemplate.setNullSelectionAllowed(true);
} catch (CmsException e) {
// should not happen
}
}
/**
* Fill ComboBox for OU selection.<p>
* @param combo combo box
*/
private void setUpOUComboBox(ComboBox combo) {
combo.addItem("/");
try {
m_clonedCms.getRequestContext().setSiteRoot("");
List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
m_clonedCms,
"/",
true);
for (CmsOrganizationalUnit ou : ous) {
combo.addItem(ou.getName());
}
combo.setNewItemsAllowed(false);
} catch (CmsException e) {
LOG.error("Error on reading OUs", e);
}
combo.setNullSelectionAllowed(false);
combo.setNewItemsAllowed(false);
combo.select("/");
}
}
| SiteManager: Filter OUs to OUs witch suitable resources in ComboBoxes | src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java | SiteManager: Filter OUs to OUs witch suitable resources in ComboBoxes | <ide><path>rc/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java
<ide> import com.vaadin.event.FieldEvents.BlurListener;
<ide> import com.vaadin.server.StreamResource;
<ide> import com.vaadin.server.UserError;
<add>import com.vaadin.shared.ui.combobox.FilteringMode;
<ide> import com.vaadin.ui.AbstractField;
<ide> import com.vaadin.ui.Button;
<ide> import com.vaadin.ui.Button.ClickEvent;
<ide> private TextField m_fieldSecureServer;
<ide>
<ide> /**vaadin component.*/
<del> private ComboBox m_fieldSelectOU;
<add> ComboBox m_fieldSelectOU;
<ide>
<ide> /**vaadin coponent.*/
<del> private ComboBox m_fieldSelectParentOU;
<add> ComboBox m_fieldSelectParentOU;
<ide>
<ide> /**vaadin component.*/
<ide> private CheckBox m_fieldWebServer;
<ide> m_simpleFieldParentFolderName.setUseRootPaths(true);
<ide> m_simpleFieldParentFolderName.setCmsObject(m_clonedCms);
<ide> m_simpleFieldParentFolderName.setResourceFilter(CmsResourceFilter.DEFAULT_FOLDERS);
<add> m_simpleFieldParentFolderName.addValueChangeListener(new ValueChangeListener() {
<add>
<add> private static final long serialVersionUID = 4043563040462776139L;
<add>
<add> public void valueChange(ValueChangeEvent event) {
<add>
<add> setUpOUComboBox(m_fieldSelectParentOU);
<add> setUpOUComboBox(m_fieldSelectOU);
<add>
<add> }
<add>
<add> });
<ide>
<ide> m_manager = manager;
<ide>
<ide> closeDailog(true);
<ide> }
<ide> });
<add> }
<add>
<add> /**
<add> * Fill ComboBox for OU selection.<p>
<add> * @param combo combo box
<add> */
<add> void setUpOUComboBox(ComboBox combo) {
<add>
<add> combo.removeAllItems();
<add> combo.addItem("/");
<add> try {
<add> m_clonedCms.getRequestContext().setSiteRoot("");
<add> List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
<add> m_clonedCms,
<add> "/",
<add> true);
<add>
<add> for (CmsOrganizationalUnit ou : ous) {
<add>
<add> if (ouIsOK(ou)) {
<add> combo.addItem(ou.getName());
<add> }
<add>
<add> }
<add> combo.setNewItemsAllowed(false);
<add> } catch (CmsException e) {
<add> LOG.error("Error on reading OUs", e);
<add> }
<add> combo.setNullSelectionAllowed(false);
<add> combo.setTextInputAllowed(true);
<add> combo.setFilteringMode(FilteringMode.CONTAINS);
<add> combo.setNewItemsAllowed(false);
<add> combo.select("/");
<ide> }
<ide>
<ide> /**
<ide> }
<ide>
<ide> /**
<add> * Checks if given Ou has resources matching to currently set parent folder.<p>
<add> *
<add> * @param ou to check
<add> * @return true if ou is ok for parent folder
<add> */
<add> private boolean ouIsOK(CmsOrganizationalUnit ou) {
<add>
<add> try {
<add> for (CmsResource res : OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
<add> m_clonedCms,
<add> ou.getName())) {
<add>
<add> if (m_simpleFieldParentFolderName.getValue().startsWith(res.getRootPath())) {
<add> return true;
<add> }
<add>
<add> }
<add> } catch (CmsException e) {
<add> LOG.error("Unable to read Resources for Org Unit", e);
<add> }
<add> return false;
<add> }
<add>
<add> /**
<ide> * Sets the server field.<p>
<ide> *
<ide> * @param newValue value of the field.
<ide> // should not happen
<ide> }
<ide> }
<del>
<del> /**
<del> * Fill ComboBox for OU selection.<p>
<del> * @param combo combo box
<del> */
<del> private void setUpOUComboBox(ComboBox combo) {
<del>
<del> combo.addItem("/");
<del> try {
<del> m_clonedCms.getRequestContext().setSiteRoot("");
<del> List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
<del> m_clonedCms,
<del> "/",
<del> true);
<del>
<del> for (CmsOrganizationalUnit ou : ous) {
<del> combo.addItem(ou.getName());
<del> }
<del> combo.setNewItemsAllowed(false);
<del> } catch (CmsException e) {
<del> LOG.error("Error on reading OUs", e);
<del> }
<del> combo.setNullSelectionAllowed(false);
<del> combo.setNewItemsAllowed(false);
<del> combo.select("/");
<del> }
<ide> } |
|
Java | apache-2.0 | 3247085c9e0cc568e2278cf09332215c6ad07533 | 0 | DarwinSPL/DarwinSPL,HyVar/DarwinSPL,DarwinSPL/DarwinSPL,HyVar/DarwinSPL,HyVar/DarwinSPL,DarwinSPL/DarwinSPL | package de.darwinspl.importer.evolution;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import de.darwinspl.importer.FeatureModelConstraintsTuple;
import eu.hyvar.dataValues.HyEnum;
import eu.hyvar.dataValues.HyEnumLiteral;
import eu.hyvar.evolution.HyName;
import eu.hyvar.evolution.HyNamedElement;
import eu.hyvar.evolution.util.HyEvolutionUtil;
import eu.hyvar.feature.HyBooleanAttribute;
import eu.hyvar.feature.HyEnumAttribute;
import eu.hyvar.feature.HyFeature;
import eu.hyvar.feature.HyFeatureAttribute;
import eu.hyvar.feature.HyFeatureChild;
import eu.hyvar.feature.HyFeatureFactory;
import eu.hyvar.feature.HyFeatureModel;
import eu.hyvar.feature.HyFeatureType;
import eu.hyvar.feature.HyGroup;
import eu.hyvar.feature.HyGroupComposition;
import eu.hyvar.feature.HyGroupType;
import eu.hyvar.feature.HyGroupTypeEnum;
import eu.hyvar.feature.HyNumberAttribute;
import eu.hyvar.feature.HyRootFeature;
import eu.hyvar.feature.HyStringAttribute;
import eu.hyvar.feature.constraint.HyConstraint;
import eu.hyvar.feature.constraint.HyConstraintFactory;
import eu.hyvar.feature.constraint.HyConstraintModel;
import eu.hyvar.feature.expression.HyAbstractFeatureReferenceExpression;
import eu.hyvar.feature.expression.HyBinaryExpression;
import eu.hyvar.feature.expression.HyExpression;
import eu.hyvar.feature.expression.HyFeatureReferenceExpression;
import eu.hyvar.feature.expression.HyUnaryExpression;
import eu.hyvar.feature.util.HyFeatureEvolutionUtil;
public class DwFeatureModelEvolutionImporter {
/**
* Creates a new group if necessary.
*
* @param featureToBeAdded
* @param groupCompositionOfFeatureToBeAdded
* @param parentInMergedModel
* @param groupTypeEnum
* @param featureMap
* @param mergedFeatureModel
* @param date
*/
protected void addFeatureToBestMatchingGroup(HyFeature featureToBeAdded,
HyGroupComposition groupCompositionOfFeatureToBeAdded, HyFeature parentInMergedModel,
HyGroupTypeEnum groupTypeEnum, Map<HyFeature, HyFeature> featureMap, HyFeatureModel mergedFeatureModel,
Date date) {
HyGroup matchingGroup = null;
int maximumAmountOfMatchingSiblings = 0;
for (HyFeatureChild featureChild : HyEvolutionUtil.getValidTemporalElements(parentInMergedModel.getParentOf(),
date)) {
HyGroup childGroup = featureChild.getChildGroup();
if (HyEvolutionUtil.getValidTemporalElement(childGroup.getTypes(), date).getType().equals(groupTypeEnum)) {
int amountOfMatchingSiblings = 0;
for (HyFeature featureInGroup : groupCompositionOfFeatureToBeAdded.getFeatures()) {
if (featureInGroup == featureToBeAdded) {
continue;
}
if (featureMap.get(featureInGroup) != null) {
amountOfMatchingSiblings++;
}
}
if (amountOfMatchingSiblings > maximumAmountOfMatchingSiblings) {
amountOfMatchingSiblings = maximumAmountOfMatchingSiblings;
matchingGroup = childGroup;
}
}
}
if (matchingGroup != null) {
// Add feature to best matching alternative group
HyGroupComposition oldGroupComposition = HyEvolutionUtil
.getValidTemporalElement(matchingGroup.getParentOf(), date);
oldGroupComposition.setValidUntil(date);
HyGroupComposition newGroupComposition = HyFeatureFactory.eINSTANCE.createHyGroupComposition();
newGroupComposition.setValidSince(date);
matchingGroup.getParentOf().add(newGroupComposition);
newGroupComposition.getFeatures().addAll(oldGroupComposition.getFeatures());
newGroupComposition.getFeatures().add(featureToBeAdded);
} else {
// create a new group
HyGroup newGroup = HyFeatureFactory.eINSTANCE.createHyGroup();
newGroup.setValidSince(date);
mergedFeatureModel.getGroups().add(newGroup);
HyFeatureChild newFeatureChild = HyFeatureFactory.eINSTANCE.createHyFeatureChild();
newFeatureChild.setValidSince(date);
newFeatureChild.setChildGroup(newGroup);
newFeatureChild.setParent(parentInMergedModel);
HyGroupType newGroupType = HyFeatureFactory.eINSTANCE.createHyGroupType();
newGroupType.setValidSince(date);
newGroupType.setType(groupTypeEnum);
newGroup.getTypes().add(newGroupType);
HyGroupComposition newGroupComposition = HyFeatureFactory.eINSTANCE.createHyGroupComposition();
newGroupComposition.setValidSince(date);
newGroupComposition.getFeatures().add(featureToBeAdded);
newGroupComposition.setCompositionOf(newGroup);
}
groupCompositionOfFeatureToBeAdded.getFeatures().remove(featureToBeAdded);
}
protected boolean checkForEquality(EObject o1, EObject o2, Date date) {
if (o1 instanceof HyNamedElement && o2 instanceof HyNamedElement) {
HyNamedElement namedElement1 = (HyNamedElement) o1;
HyNamedElement namedElement2 = (HyNamedElement) o2;
HyName name1 = HyEvolutionUtil.getValidTemporalElement(namedElement1.getNames(), date);
HyName name2 = HyEvolutionUtil.getValidTemporalElement(namedElement2.getNames(), date);
if (name1.getName().equals(name2.getName())) {
return true;
} else {
return false;
}
} else if (o1 instanceof HyEnumLiteral && o2 instanceof HyEnumLiteral) {
HyEnumLiteral enumLiteral1 = (HyEnumLiteral) o1;
HyEnumLiteral enumLiteral2 = (HyEnumLiteral) o2;
if (enumLiteral1.getName().equals(enumLiteral2.getName())) {
return true;
} else {
return false;
}
}
return false;
}
/**
*
* @param elementToBeChecked
* @param elementsOfMergedModel
* @return null if no equivalent element exists. Otherwise the equivalentElement
*/
protected <S extends EObject> S checkIfElementAlreadyExists(S elementToBeChecked, List<S> elementsOfMergedModel,
Date date) {
for (S featureOfMergedModel : elementsOfMergedModel) {
if (checkForEquality(elementToBeChecked, featureOfMergedModel, date)) {
return featureOfMergedModel;
}
}
return null;
}
/**
* Merges multiple feature model evolution snapshots to one Temporal Feature
* Model
*
* @param models
* Each feature model has to be associated to a date at which the
* changes have occured.
* @return The whole feature model history merged into one TFM.
* @throws Exception
*/
public FeatureModelConstraintsTuple importFeatureModelEvolutionSnapshots(Map<FeatureModelConstraintsTuple, Date> models)
throws Exception {
Map<Date, FeatureModelConstraintsTuple> darwinSPLModels = new HashMap<Date, FeatureModelConstraintsTuple>();
for (Entry<FeatureModelConstraintsTuple, Date> entry : models.entrySet()) {
darwinSPLModels.put(entry.getValue(), entry.getKey());
HyConstraintModel constraintModel = entry.getKey().getConstraintModel();
if(constraintModel!=null) {
EcoreUtil.resolveAll(entry.getKey().getConstraintModel());
}
}
FeatureModelConstraintsTuple mergedModels = mergeFeatureModels(darwinSPLModels);
return mergedModels;
}
protected void mergeEnumAttributes(HyEnumAttribute equivalentEnumAttribute,
HyEnumAttribute enumAttributeOfFeatureToBeMerged, Date date) throws Exception {
if (equivalentEnumAttribute.getEnumType() == null || enumAttributeOfFeatureToBeMerged.getEnumType() == null) {
throw new Exception("Enum type of attribute "
+ HyEvolutionUtil.getValidTemporalElement(equivalentEnumAttribute.getNames(), date).getName()
+ " of either the merged or the input model is null. Aborting Merge!");
}
if (equivalentEnumAttribute.getEnumType().getName()
.equals(enumAttributeOfFeatureToBeMerged.getEnumType().getName())) {
List<HyEnumLiteral> literalsToBeAdded = new ArrayList<HyEnumLiteral>();
for (HyEnumLiteral enumLiteralOfFeatureAttributeToBeMerged : enumAttributeOfFeatureToBeMerged.getEnumType()
.getLiterals()) {
HyEnumLiteral equivalentEnumLiteral = checkIfElementAlreadyExists(
enumLiteralOfFeatureAttributeToBeMerged, HyEvolutionUtil.getValidTemporalElements(
equivalentEnumAttribute.getEnumType().getLiterals(), date),
date);
boolean equivalentLiteralExists = (equivalentEnumLiteral != null);
if (!equivalentLiteralExists) {
literalsToBeAdded.add(enumLiteralOfFeatureAttributeToBeMerged);
}
}
List<Integer> alreadyUsedLiteralValues = new ArrayList<Integer>();
if (!literalsToBeAdded.isEmpty()) {
for (HyEnumLiteral literalOfEquivalentAttribute : equivalentEnumAttribute.getEnumType().getLiterals()) {
alreadyUsedLiteralValues.add(literalOfEquivalentAttribute.getValue());
}
}
for (HyEnumLiteral literalToBeAdded : literalsToBeAdded) {
int value = 0;
while (alreadyUsedLiteralValues.contains(value)) {
value++;
}
alreadyUsedLiteralValues.add(value);
literalToBeAdded.setValue(value);
equivalentEnumAttribute.getEnumType().getLiterals().add(literalToBeAdded);
}
} else {
throw new Exception("Attribute names of "
+ HyEvolutionUtil.getValidTemporalElement(equivalentEnumAttribute.getNames(), date).getName()
+ " are the same but enum types do not match. Aborting merge!");
}
}
protected List<HyFeatureAttribute> mergeFeatureAttributes(HyFeature featureToBeMerged,
HyFeature equivalentFeatureOfMergedModel, Date date) throws Exception {
// Step 2: check whether attributes are matching.
List<HyFeatureAttribute> attributesToBeAddedToEquivalentFeature = new ArrayList<HyFeatureAttribute>();
for (HyFeatureAttribute attributeOfFeatureToBeMerged : featureToBeMerged.getAttributes()) {
HyFeatureAttribute equivalentAttribute = checkIfElementAlreadyExists(attributeOfFeatureToBeMerged,
HyEvolutionUtil.getValidTemporalElements(equivalentFeatureOfMergedModel.getAttributes(), date),
date);
boolean attributeAlreadyExists = (equivalentAttribute != null);
if (!attributeAlreadyExists) {
attributesToBeAddedToEquivalentFeature.add(attributeOfFeatureToBeMerged);
} else {
// Step 1.a: Check whether attribute domains are the same. If not, extend them
// to have the union of their domains
if (equivalentAttribute instanceof HyNumberAttribute
&& attributeOfFeatureToBeMerged instanceof HyNumberAttribute) {
HyNumberAttribute equivalentNumberAttribute = (HyNumberAttribute) equivalentAttribute;
HyNumberAttribute numberAttributeOfFeatureToBeMerged = (HyNumberAttribute) attributeOfFeatureToBeMerged;
int minimum = Math.min(equivalentNumberAttribute.getMin(),
numberAttributeOfFeatureToBeMerged.getMin());
int maximum = Math.max(equivalentNumberAttribute.getMax(),
numberAttributeOfFeatureToBeMerged.getMax());
equivalentNumberAttribute.setMin(minimum);
equivalentNumberAttribute.setMax(maximum);
} else if (equivalentAttribute instanceof HyBooleanAttribute
&& attributeOfFeatureToBeMerged instanceof HyBooleanAttribute) {
// nothing to do.
} else if (equivalentAttribute instanceof HyEnumAttribute
&& attributeOfFeatureToBeMerged instanceof HyEnumAttribute) {
HyEnumAttribute equivalentEnumAttribute = (HyEnumAttribute) equivalentAttribute;
HyEnumAttribute enumAttributeOfFeatureToBeMerged = (HyEnumAttribute) attributeOfFeatureToBeMerged;
mergeEnumAttributes(equivalentEnumAttribute, enumAttributeOfFeatureToBeMerged, date);
} else if (equivalentAttribute instanceof HyStringAttribute
&& attributeOfFeatureToBeMerged instanceof HyStringAttribute) {
// nothing to do.
} else {
throw new Exception("Attributes "
+ HyEvolutionUtil.getValidTemporalElement(equivalentAttribute.getNames(), date).getName()
+ " have the same name but have different types. Cannot merge.");
}
}
}
for (HyFeatureAttribute attributeToBeAdded : attributesToBeAddedToEquivalentFeature) {
attributeToBeAdded.setValidSince(date);
equivalentFeatureOfMergedModel.getAttributes().add(attributeToBeAdded);
}
return attributesToBeAddedToEquivalentFeature;
}
/**
* No evolution shall exist in the input models.
*
* @param models
* @return
* @throws Exception
*/
protected FeatureModelConstraintsTuple mergeFeatureModels(Map<Date, FeatureModelConstraintsTuple> models)
throws Exception {
HyFeatureModel mergedFeatureModel = HyFeatureFactory.eINSTANCE.createHyFeatureModel();
HyConstraintModel mergedConstraintModel = HyConstraintFactory.eINSTANCE.createHyConstraintModel();
List<Date> sortedDateList = new ArrayList<Date>(models.keySet());
sortedDateList.remove(null);
Collections.sort(sortedDateList);
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Importing base model");
long start = System.currentTimeMillis();
if (models.get(null) != null) {
mergeModels(models.get(null), mergedFeatureModel, mergedConstraintModel, null);
}
long end = System.currentTimeMillis();
System.out.println("Importing base model took "+(end-start)+" milliseconds.");
for (Date date : sortedDateList) {
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Importing model at date "+date);
start = System.currentTimeMillis();
mergeModels(models.get(date), mergedFeatureModel, mergedConstraintModel, date);
end = System.currentTimeMillis();
System.out.println("Importing model at date "+date+ " took "+(end-start)+" milliseconds");
}
FeatureModelConstraintsTuple mergedModels = new FeatureModelConstraintsTuple(mergedFeatureModel,
mergedConstraintModel);
return mergedModels;
}
protected void mergeModels(FeatureModelConstraintsTuple modelsToBeMerged, HyFeatureModel mergedFeatureModel,
HyConstraintModel mergedConstraintModel, Date date) throws Exception {
// Key is the feature of the input model and value is the feature of the merged
// model.
Map<HyFeature, HyFeature> featureMap = new HashMap<HyFeature, HyFeature>();
Map<HyGroup, HyGroup> groupMap = new HashMap<HyGroup, HyGroup>();
List<HyFeature> featuresToInvalidate = new ArrayList<HyFeature>(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getFeatures(), date));
// Step 1: Check that each feature / attribute exists. If not create it and set
// valid since. If a feature / attribute existed before, but not anymore, set
// valid until.
HyFeatureModel featureModelToBeMerged = modelsToBeMerged.getFeatureModel();
List<HyFeature> featuresToBeAddedToMergedModel = new ArrayList<HyFeature>();
List<HyFeatureAttribute> addedFeatureAttributes = new ArrayList<HyFeatureAttribute>();
// List<HyGroup> potentialGroupMatchingPartners = new ArrayList<HyGroup>();
// potentialGroupMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getGroups(), date));
//
// for (HyGroup groupToBeMerged : featureModelToBeMerged.getGroups()) {
// HyGroup equivalentGroup = checkIfElementAlreadyExists(groupToBeMerged,
// potentialGroupMatchingPartners, date);
//
// if (equivalentGroup != null) {
// potentialGroupMatchingPartners.remove(equivalentGroup);
// groupMap.put(groupToBeMerged, equivalentGroup);
// }
// }
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Searching for matching features");
List<HyFeature> potentialFeatureMatchingPartners = new ArrayList<HyFeature>();
potentialFeatureMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getFeatures(), date));
for (HyFeature featureToBeMerged : featureModelToBeMerged.getFeatures()) {
HyFeature equivalentFeature = checkIfElementAlreadyExists(featureToBeMerged,
potentialFeatureMatchingPartners, date);
boolean featureAlreadyExists = (equivalentFeature != null);
if (!featureAlreadyExists) {
featuresToBeAddedToMergedModel.add(featureToBeMerged);
} else {
potentialFeatureMatchingPartners.remove(equivalentFeature);
featuresToInvalidate.remove(equivalentFeature);
featureMap.put(featureToBeMerged, equivalentFeature);
addedFeatureAttributes.addAll(mergeFeatureAttributes(featureToBeMerged, equivalentFeature, date));
}
}
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Searching for matching groups");
List<HyGroup> potentialGroupMatchingPartners = new ArrayList<HyGroup>();
potentialGroupMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getGroups(), date));
List<HyGroup> matchedGroupMatchingPartners = new ArrayList<HyGroup>();
groupsToBeMergedLoop:
for (HyGroup groupToBeMerged : featureModelToBeMerged.getGroups()) {
// Only compare the group to be merged to groups which are valid at that point in time.
potentialGroupMatchingPartners.removeAll(matchedGroupMatchingPartners);
matchedGroupMatchingPartners = new ArrayList<HyGroup>();
for(HyGroup groupFromMergedModel: potentialGroupMatchingPartners) {
int amountOfSimilarFeatures = 0;
List<HyFeature> featuresOfMergedGroup = HyFeatureEvolutionUtil.getFeaturesOfGroup(groupFromMergedModel,
date);
for (HyFeature featureOfGroupToBeMerged : HyFeatureEvolutionUtil.getFeaturesOfGroup(groupToBeMerged,
date)) {
if (featuresOfMergedGroup.contains(featureMap.get(featureOfGroupToBeMerged))) {
amountOfSimilarFeatures++;
}
}
double sameFeatureRatio = (double) amountOfSimilarFeatures / (double) featuresOfMergedGroup.size();
if (sameFeatureRatio >= 0.75) {
groupMap.put(groupToBeMerged, groupFromMergedModel);
matchedGroupMatchingPartners.add(groupFromMergedModel);
continue groupsToBeMergedLoop;
}
}
}
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether features have to be moved");
moveFeaturesIfTheyHaveBeenMovedInInputModel(mergedFeatureModel, featureMap, date);
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether feature types need to be updated");
updateFeatureTypes(mergedFeatureModel, featureMap, date);
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether group types need to be updated");
updateGroupTypes(groupMap, date);
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding new features to merged model");
addNewFeatures(featuresToBeAddedToMergedModel, mergedFeatureModel, featureMap, date);
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding enums of feature attributes");
// handle enums. Only considered enums which are used by feature attributes.
Set<HyEnum> enums = new HashSet<HyEnum>();
for (HyFeatureAttribute addedFeatureAttribute : addedFeatureAttributes) {
if (addedFeatureAttribute instanceof HyEnumAttribute) {
HyEnumAttribute enumAttribute = (HyEnumAttribute) addedFeatureAttribute;
enums.add(enumAttribute.getEnumType());
}
}
mergedFeatureModel.getEnums().addAll(enums);
consistencyCheck(mergedFeatureModel);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Invalidating features");
// Invalidate features which do not exist anymore. Update group composition.
for (HyFeature featureToInvalidate : featuresToInvalidate) {
HyFeatureEvolutionUtil.removeFeatureFromGroup(featureToInvalidate, date);
HyFeatureEvolutionUtil.getName(featureToInvalidate, date).setValidUntil(date);
HyFeatureEvolutionUtil.getType(featureToInvalidate, date).setValidUntil(date);
for(HyFeatureAttribute attribute: HyEvolutionUtil.getValidTemporalElements(featureToInvalidate.getAttributes(), date)) {
attribute.setValidUntil(date);
}
featureToInvalidate.setValidUntil(date);
}
consistencyCheck(mergedFeatureModel);
// Merge constraint models
HyConstraintModel constraintModelToBeMerged = modelsToBeMerged.getConstraintModel();
if (constraintModelToBeMerged != null) {
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Merging constraint model");
mergeConstraintModel(constraintModelToBeMerged, mergedConstraintModel, featureMap, date);
}
consistencyCheck(mergedFeatureModel);
}
protected void updateGroupTypes(Map<HyGroup, HyGroup> groupMap, Date date) {
for (Entry<HyGroup, HyGroup> entry : groupMap.entrySet()) {
HyGroupType groupTypeOfGroupToBeMerged = HyFeatureEvolutionUtil.getType(entry.getKey(), date);
HyGroupType groupTypeOfMergedGroup = HyFeatureEvolutionUtil.getType(entry.getValue(), date);
if (!groupTypeOfGroupToBeMerged.getType().equals(groupTypeOfMergedGroup.getType())) {
groupTypeOfMergedGroup.setValidUntil(date);
HyGroupType newGroupType = HyFeatureFactory.eINSTANCE.createHyGroupType();
newGroupType.setValidSince(date);
newGroupType.setType(groupTypeOfGroupToBeMerged.getType());
entry.getValue().getTypes().add(newGroupType);
}
}
}
protected void updateFeatureTypes(HyFeatureModel mergedFeatureModel, Map<HyFeature, HyFeature> featureMap,
Date date) {
for (Entry<HyFeature, HyFeature> entry : featureMap.entrySet()) {
// key feature from input mode, value feature from merged model
HyFeatureType inputType = HyFeatureEvolutionUtil.getType(entry.getKey(), date);
HyFeatureType mergedType = HyFeatureEvolutionUtil.getType(entry.getValue(), date);
if (!inputType.getType().equals(mergedType.getType())) {
mergedType.setValidUntil(date);
HyFeatureType newFeatureType = HyFeatureFactory.eINSTANCE.createHyFeatureType();
newFeatureType.setValidSince(date);
newFeatureType.setType(inputType.getType());
entry.getValue().getTypes().add(newFeatureType);
}
}
}
protected void addNewFeatures(List<HyFeature> featuresToBeAddedToMergedModel, HyFeatureModel mergedFeatureModel,
Map<HyFeature, HyFeature> featureMap, Date date) throws Exception {
for (HyFeature featureToBeAdded : featuresToBeAddedToMergedModel) {
// set validity of feature, its name and type to date
HyFeatureModel oldFeatureModel = featureToBeAdded.getFeatureModel();
mergedFeatureModel.getFeatures().add(featureToBeAdded);
featureToBeAdded.setValidSince(date);
featureToBeAdded.setValidUntil(null);
// clear everything from evolution.
HyName validName = HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date);
validName.setValidSince(date);
validName.setValidUntil(null);
featureToBeAdded.getNames().clear();
featureToBeAdded.getNames().add(validName);
HyFeatureType validType = HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getTypes(), date);
validType.setValidSince(date);
validType.setValidUntil(null);
featureToBeAdded.getTypes().clear();
featureToBeAdded.getTypes().add(validType);
List<HyFeatureChild> validFeatureChildren = HyEvolutionUtil
.getValidTemporalElements(featureToBeAdded.getParentOf(), date);
featureToBeAdded.getParentOf().clear();
for (HyFeatureChild featureChild : validFeatureChildren) {
featureToBeAdded.getParentOf().add(featureChild);
featureChild.setValidSince(date);
featureChild.setValidUntil(null);
HyGroup group = featureChild.getChildGroup();
mergedFeatureModel.getGroups().add(group);
group.setValidSince(date);
group.setValidUntil(null);
HyGroupType validGroupType = HyEvolutionUtil.getValidTemporalElement(group.getTypes(), date);
group.getTypes().clear();
validGroupType.setValidSince(date);
validGroupType.setValidUntil(null);
group.getTypes().add(validGroupType);
HyGroupComposition validGroupComposition = HyEvolutionUtil.getValidTemporalElement(group.getParentOf(),
date);
validGroupComposition.setValidSince(date);
validGroupComposition.setValidUntil(null);
group.getParentOf().clear();
group.getParentOf().add(validGroupComposition);
List<HyFeature> featuresOfGroupComposition = new ArrayList<HyFeature>();
featuresOfGroupComposition.addAll(validGroupComposition.getFeatures());
for(HyFeature featureOfGroupComposition: featuresOfGroupComposition) {
HyFeature equivalentFeature = featureMap.get(featureOfGroupComposition);
if(equivalentFeature != null) {
validGroupComposition.getFeatures().remove(featureOfGroupComposition);
validGroupComposition.getFeatures().add(equivalentFeature);
}
}
}
// Put feature in correct group
HyGroupComposition groupComposition = HyEvolutionUtil
.getValidTemporalElement(featureToBeAdded.getGroupMembership(), date);
if (groupComposition != null) {
HyGroup group = groupComposition.getCompositionOf();
HyFeatureChild featureChildOfGroup = HyEvolutionUtil.getValidTemporalElement(group.getChildOf(), date);
HyFeature parentFeatureInInputModel = featureChildOfGroup.getParent();
if (featuresToBeAddedToMergedModel.contains(parentFeatureInInputModel)) {
// parent feature is also added to the new model. We are done.
continue;
}
HyFeature parentInMergedModel = featureMap.get(parentFeatureInInputModel);
if (parentInMergedModel != null) {
HyGroupType groupType = HyEvolutionUtil.getValidTemporalElement(group.getTypes(), date);
HyGroupTypeEnum groupTypeEnum = groupType.getType();
addFeatureToBestMatchingGroup(featureToBeAdded, groupComposition, parentInMergedModel,
groupTypeEnum, featureMap, mergedFeatureModel, date);
} else {
throw new Exception("We have a problem. The parent of the feature "
+ HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date).getName()
+ " is neither newly added to the merged model nor is it already existent in it. Aborting whole merging process");
}
}
else {
HyRootFeature oldFeatureModelRootFeature = HyEvolutionUtil
.getValidTemporalElement(oldFeatureModel.getRootFeature(), date);
if (oldFeatureModelRootFeature == null || oldFeatureModelRootFeature.getFeature() != featureToBeAdded) {
throw new Exception("Feature "
+ HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date).getName()
+ " did not have a group but is no root feature. Aborted merge.");
}
HyRootFeature oldRootFeature = HyEvolutionUtil
.getValidTemporalElement(mergedFeatureModel.getRootFeature(), date);
if (oldRootFeature != null) {
oldRootFeature.setValidUntil(date);
}
HyRootFeature newRootFeature = HyFeatureFactory.eINSTANCE.createHyRootFeature();
newRootFeature.setValidSince(date);
newRootFeature.setFeature(featureToBeAdded);
mergedFeatureModel.getRootFeature().add(newRootFeature);
}
}
}
protected void moveFeaturesIfTheyHaveBeenMovedInInputModel(HyFeatureModel mergedFeatureModel,
Map<HyFeature, HyFeature> featureMap, Date date) {
for (Entry<HyFeature, HyFeature> featureEntrySet : featureMap.entrySet()) {
HyFeature parentOfMergedFeature = HyFeatureEvolutionUtil
.getParentFeatureOfFeature(featureEntrySet.getValue(), date);
HyFeature parentFeatureFromInputModel = HyFeatureEvolutionUtil
.getParentFeatureOfFeature(featureEntrySet.getKey(), date);
if (parentFeatureFromInputModel == null) {
// seems to be new root.
continue;
}
HyFeature equivalentToParentFromInputModel = featureMap.get(parentFeatureFromInputModel);
if (equivalentToParentFromInputModel == null) {
// Parent will be added to the merged model.
// Has to be removed from its current group.
// When the new parent will be added to the model, this feature will be added to its group.
HyFeatureEvolutionUtil.removeFeatureFromGroup(featureEntrySet.getValue(), date);
} else if (equivalentToParentFromInputModel == parentOfMergedFeature) {
// parent stayed the same. Nothing to do.
} else {
// parents are different.
HyGroupComposition groupCompositionOfFeatureFromInputModel = HyEvolutionUtil
.getValidTemporalElement(featureEntrySet.getKey().getGroupMembership(), date);
HyGroupTypeEnum groupTypeOfGroupOfFeatureFromInputModel = HyEvolutionUtil.getValidTemporalElement(
groupCompositionOfFeatureFromInputModel.getCompositionOf().getTypes(), date).getType();
addFeatureToBestMatchingGroup(featureEntrySet.getValue(), groupCompositionOfFeatureFromInputModel,
equivalentToParentFromInputModel, groupTypeOfGroupOfFeatureFromInputModel, featureMap,
mergedFeatureModel, date);
HyFeatureEvolutionUtil.removeFeatureFromGroup(featureEntrySet.getValue(), date);
}
}
}
protected void mergeConstraintModel(HyConstraintModel constraintModelToBeMerged,
HyConstraintModel mergedConstraintModel, Map<HyFeature, HyFeature> featureMap, Date date) {
// For each constraint in model to be merged:
// Create a map, in which constraints from the model to be merged are mapped to
// equal constraints from the merged model
// Key is the constraint from model to be merged and value is constraint from
// merged model
List<HyConstraint> constraintsToBeMergedWithoutMatchingPartner = new ArrayList<HyConstraint>(
constraintModelToBeMerged.getConstraints());
List<HyConstraint> remainingMatchingPartners = new ArrayList<HyConstraint>(
mergedConstraintModel.getConstraints());
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Finding matching constraints");
for (HyConstraint constraintToBeMerged : constraintModelToBeMerged.getConstraints()) {
HyConstraint equalConstraint = findEqualConstraint(constraintToBeMerged, remainingMatchingPartners,
featureMap, date);
if (equalConstraint != null) {
remainingMatchingPartners.remove(equalConstraint);
constraintsToBeMergedWithoutMatchingPartner.remove(constraintToBeMerged);
zdt = ZonedDateTime.now();
// System.err.println(zdt.toString()+": Matched a constraint.");
continue;
}
}
// For each constraint of the model to be merged that does not have a mapping
// partner: add the constraint with valid since
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding new constraints");
for (HyConstraint constraintToBeMergedWithoutMatchingPartner : constraintsToBeMergedWithoutMatchingPartner) {
mergedConstraintModel.getConstraints()
.add(createConstraintInMergedModel(constraintToBeMergedWithoutMatchingPartner, featureMap, date));
}
// For each constraint of the merged model that does not have a mapping partner:
// set the valid until of the constraint
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Invalidate constraints");
for (HyConstraint unmatchedConstraint : remainingMatchingPartners) {
unmatchedConstraint.setValidUntil(date);
}
}
protected HyConstraint findEqualConstraint(HyConstraint constraint, List<HyConstraint> potentialMatchingPartners,
Map<HyFeature, HyFeature> featureMap, Date date) {
for (HyConstraint potentialMatchingPartner : potentialMatchingPartners) {
if (areExpressionsEqual(constraint.getRootExpression(), potentialMatchingPartner.getRootExpression(),
featureMap, date)) {
return potentialMatchingPartner;
}
}
return null;
}
protected boolean areExpressionsEqual(HyExpression expressionOfConstraintToBeMerged,
HyExpression expressionOfMergedConstraint, Map<HyFeature, HyFeature> featureMap, Date date) {
if (expressionOfConstraintToBeMerged.getClass().toString()
.equals(expressionOfMergedConstraint.getClass().toString())) {
if (expressionOfConstraintToBeMerged instanceof HyBinaryExpression) {
HyBinaryExpression bin1 = (HyBinaryExpression) expressionOfConstraintToBeMerged;
HyBinaryExpression bin2 = (HyBinaryExpression) expressionOfMergedConstraint;
boolean operandsMatch = false;
operandsMatch = areExpressionsEqual(bin1.getOperand1(), bin2.getOperand1(), featureMap, date)
&& areExpressionsEqual(bin1.getOperand2(), bin2.getOperand2(), featureMap, date);
return operandsMatch;
} else if (expressionOfConstraintToBeMerged instanceof HyUnaryExpression) {
HyUnaryExpression unary1 = (HyUnaryExpression) expressionOfConstraintToBeMerged;
HyUnaryExpression unary2 = (HyUnaryExpression) expressionOfMergedConstraint;
return areExpressionsEqual(unary1.getOperand(), unary2.getOperand(), featureMap, date);
} else if (expressionOfConstraintToBeMerged instanceof HyAbstractFeatureReferenceExpression) {
HyAbstractFeatureReferenceExpression featureRef1 = (HyAbstractFeatureReferenceExpression) expressionOfConstraintToBeMerged;
HyAbstractFeatureReferenceExpression featureRef2 = (HyAbstractFeatureReferenceExpression) expressionOfMergedConstraint;
HyFeature equivalentFeatureFromMergedFeatureModel = featureMap.get(featureRef1.getFeature());
boolean featuresMatch = equivalentFeatureFromMergedFeatureModel==featureRef2.getFeature();
return featuresMatch;
} else {
System.err.println(
"Currently unsupported expressions have been compared in de.darwinspl.importer.evolution.DwFeatureModelEvolutionImporter.areExpressionsEqual(HyExpression, HyExpression, Map<HyFeature, HyFeature>, Date)");
return false;
}
} else {
return false;
}
}
protected HyConstraint createConstraintInMergedModel(HyConstraint constraintToBeMerged,
Map<HyFeature, HyFeature> featureMap, Date date) {
HyConstraint constraint = EcoreUtil.copy(constraintToBeMerged);
constraint.setValidSince(date);
TreeIterator<EObject> iterator = constraint.eAllContents();
while (iterator.hasNext()) {
EObject eObject = iterator.next();
if (eObject instanceof HyFeatureReferenceExpression) {
HyFeatureReferenceExpression featureReference = (HyFeatureReferenceExpression) eObject;
// no versions are supported
featureReference.setVersionRestriction(null);
HyFeature equivalentFeatureInMergedModel = featureMap.get(featureReference.getFeature());
if(equivalentFeatureInMergedModel != null) {
featureReference.setFeature(equivalentFeatureInMergedModel);
}
}
}
return constraint;
}
/**
* Only use this method if you have the feeling that something isn't imported correctly.
* @param mergedFeatureModel
*/
private void consistencyCheck(HyFeatureModel mergedFeatureModel) {
// for(HyGroup group: mergedFeatureModel.getGroups()) {
// for(HyGroupComposition groupComposition: group.getParentOf()) {
// if(!mergedFeatureModel.getFeatures().containsAll(groupComposition.getFeatures())) {
// System.err.println("Non consistent!");
// return;
// }
// }
// }
}
}
| plugins/de.darwinspl.importer.evolution/src/de/darwinspl/importer/evolution/DwFeatureModelEvolutionImporter.java | package de.darwinspl.importer.evolution;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import de.darwinspl.importer.FeatureModelConstraintsTuple;
import eu.hyvar.dataValues.HyEnum;
import eu.hyvar.dataValues.HyEnumLiteral;
import eu.hyvar.evolution.HyName;
import eu.hyvar.evolution.HyNamedElement;
import eu.hyvar.evolution.util.HyEvolutionUtil;
import eu.hyvar.feature.HyBooleanAttribute;
import eu.hyvar.feature.HyEnumAttribute;
import eu.hyvar.feature.HyFeature;
import eu.hyvar.feature.HyFeatureAttribute;
import eu.hyvar.feature.HyFeatureChild;
import eu.hyvar.feature.HyFeatureFactory;
import eu.hyvar.feature.HyFeatureModel;
import eu.hyvar.feature.HyFeatureType;
import eu.hyvar.feature.HyGroup;
import eu.hyvar.feature.HyGroupComposition;
import eu.hyvar.feature.HyGroupType;
import eu.hyvar.feature.HyGroupTypeEnum;
import eu.hyvar.feature.HyNumberAttribute;
import eu.hyvar.feature.HyRootFeature;
import eu.hyvar.feature.HyStringAttribute;
import eu.hyvar.feature.constraint.HyConstraint;
import eu.hyvar.feature.constraint.HyConstraintFactory;
import eu.hyvar.feature.constraint.HyConstraintModel;
import eu.hyvar.feature.expression.HyAbstractFeatureReferenceExpression;
import eu.hyvar.feature.expression.HyBinaryExpression;
import eu.hyvar.feature.expression.HyExpression;
import eu.hyvar.feature.expression.HyFeatureReferenceExpression;
import eu.hyvar.feature.expression.HyUnaryExpression;
import eu.hyvar.feature.util.HyFeatureEvolutionUtil;
public class DwFeatureModelEvolutionImporter {
/**
* Creates a new group if necessary.
*
* @param featureToBeAdded
* @param groupCompositionOfFeatureToBeAdded
* @param parentInMergedModel
* @param groupTypeEnum
* @param featureMap
* @param mergedFeatureModel
* @param date
*/
protected void addFeatureToBestMatchingGroup(HyFeature featureToBeAdded,
HyGroupComposition groupCompositionOfFeatureToBeAdded, HyFeature parentInMergedModel,
HyGroupTypeEnum groupTypeEnum, Map<HyFeature, HyFeature> featureMap, HyFeatureModel mergedFeatureModel,
Date date) {
HyGroup matchingGroup = null;
int maximumAmountOfMatchingSiblings = 0;
for (HyFeatureChild featureChild : HyEvolutionUtil.getValidTemporalElements(parentInMergedModel.getParentOf(),
date)) {
HyGroup childGroup = featureChild.getChildGroup();
if (HyEvolutionUtil.getValidTemporalElement(childGroup.getTypes(), date).getType().equals(groupTypeEnum)) {
int amountOfMatchingSiblings = 0;
for (HyFeature featureInGroup : groupCompositionOfFeatureToBeAdded.getFeatures()) {
if (featureInGroup == featureToBeAdded) {
continue;
}
if (featureMap.get(featureInGroup) != null) {
amountOfMatchingSiblings++;
}
}
if (amountOfMatchingSiblings > maximumAmountOfMatchingSiblings) {
amountOfMatchingSiblings = maximumAmountOfMatchingSiblings;
matchingGroup = childGroup;
}
}
}
if (matchingGroup != null) {
// Add feature to best matching alternative group
HyGroupComposition oldGroupComposition = HyEvolutionUtil
.getValidTemporalElement(matchingGroup.getParentOf(), date);
oldGroupComposition.setValidUntil(date);
HyGroupComposition newGroupComposition = HyFeatureFactory.eINSTANCE.createHyGroupComposition();
newGroupComposition.setValidSince(date);
matchingGroup.getParentOf().add(newGroupComposition);
for (HyFeature groupFeature : oldGroupComposition.getFeatures()) {
newGroupComposition.getFeatures().add(groupFeature);
}
newGroupComposition.getFeatures().add(featureToBeAdded);
} else {
// create a new alternative group
HyGroup newAlternativeGroup = HyFeatureFactory.eINSTANCE.createHyGroup();
newAlternativeGroup.setValidSince(date);
mergedFeatureModel.getGroups().add(newAlternativeGroup);
HyFeatureChild newFeatureChild = HyFeatureFactory.eINSTANCE.createHyFeatureChild();
newFeatureChild.setValidSince(date);
newFeatureChild.setChildGroup(newAlternativeGroup);
newFeatureChild.setParent(parentInMergedModel);
HyGroupType newGroupType = HyFeatureFactory.eINSTANCE.createHyGroupType();
newGroupType.setValidSince(date);
newGroupType.setType(groupTypeEnum);
newAlternativeGroup.getTypes().add(newGroupType);
HyGroupComposition newGroupComposition = HyFeatureFactory.eINSTANCE.createHyGroupComposition();
newGroupComposition.setValidSince(date);
newGroupComposition.getFeatures().add(featureToBeAdded);
newGroupComposition.setCompositionOf(newAlternativeGroup);
}
groupCompositionOfFeatureToBeAdded.getFeatures().remove(featureToBeAdded);
}
protected boolean checkForEquality(EObject o1, EObject o2, Date date) {
if (o1 instanceof HyNamedElement && o2 instanceof HyNamedElement) {
HyNamedElement namedElement1 = (HyNamedElement) o1;
HyNamedElement namedElement2 = (HyNamedElement) o2;
HyName name1 = HyEvolutionUtil.getValidTemporalElement(namedElement1.getNames(), date);
HyName name2 = HyEvolutionUtil.getValidTemporalElement(namedElement2.getNames(), date);
if (name1.getName().equals(name2.getName())) {
return true;
} else {
return false;
}
} else if (o1 instanceof HyEnumLiteral && o2 instanceof HyEnumLiteral) {
HyEnumLiteral enumLiteral1 = (HyEnumLiteral) o1;
HyEnumLiteral enumLiteral2 = (HyEnumLiteral) o2;
if (enumLiteral1.getName().equals(enumLiteral2.getName())) {
return true;
} else {
return false;
}
}
return false;
}
/**
*
* @param elementToBeChecked
* @param elementsOfMergedModel
* @return null if no equivalent element exists. Otherwise the equivalentElement
*/
protected <S extends EObject> S checkIfElementAlreadyExists(S elementToBeChecked, List<S> elementsOfMergedModel,
Date date) {
for (S featureOfMergedModel : elementsOfMergedModel) {
if (checkForEquality(elementToBeChecked, featureOfMergedModel, date)) {
return featureOfMergedModel;
}
}
return null;
}
/**
* Merges multiple feature model evolution snapshots to one Temporal Feature
* Model
*
* @param models
* Each feature model has to be associated to a date at which the
* changes have occured.
* @return The whole feature model history merged into one TFM.
* @throws Exception
*/
public FeatureModelConstraintsTuple importFeatureModelEvolutionSnapshots(Map<FeatureModelConstraintsTuple, Date> models)
throws Exception {
Map<Date, FeatureModelConstraintsTuple> darwinSPLModels = new HashMap<Date, FeatureModelConstraintsTuple>();
for (Entry<FeatureModelConstraintsTuple, Date> entry : models.entrySet()) {
darwinSPLModels.put(entry.getValue(), entry.getKey());
EcoreUtil.resolveAll(entry.getKey().getConstraintModel());
}
FeatureModelConstraintsTuple mergedModels = mergeFeatureModels(darwinSPLModels);
return mergedModels;
}
protected void mergeEnumAttributes(HyEnumAttribute equivalentEnumAttribute,
HyEnumAttribute enumAttributeOfFeatureToBeMerged, Date date) throws Exception {
if (equivalentEnumAttribute.getEnumType() == null || enumAttributeOfFeatureToBeMerged.getEnumType() == null) {
throw new Exception("Enum type of attribute "
+ HyEvolutionUtil.getValidTemporalElement(equivalentEnumAttribute.getNames(), date).getName()
+ " of either the merged or the input model is null. Aborting Merge!");
}
if (equivalentEnumAttribute.getEnumType().getName()
.equals(enumAttributeOfFeatureToBeMerged.getEnumType().getName())) {
List<HyEnumLiteral> literalsToBeAdded = new ArrayList<HyEnumLiteral>();
for (HyEnumLiteral enumLiteralOfFeatureAttributeToBeMerged : enumAttributeOfFeatureToBeMerged.getEnumType()
.getLiterals()) {
HyEnumLiteral equivalentEnumLiteral = checkIfElementAlreadyExists(
enumLiteralOfFeatureAttributeToBeMerged, HyEvolutionUtil.getValidTemporalElements(
equivalentEnumAttribute.getEnumType().getLiterals(), date),
date);
boolean equivalentLiteralExists = (equivalentEnumLiteral != null);
if (!equivalentLiteralExists) {
literalsToBeAdded.add(enumLiteralOfFeatureAttributeToBeMerged);
}
}
List<Integer> alreadyUsedLiteralValues = new ArrayList<Integer>();
if (!literalsToBeAdded.isEmpty()) {
for (HyEnumLiteral literalOfEquivalentAttribute : equivalentEnumAttribute.getEnumType().getLiterals()) {
alreadyUsedLiteralValues.add(literalOfEquivalentAttribute.getValue());
}
}
for (HyEnumLiteral literalToBeAdded : literalsToBeAdded) {
int value = 0;
while (alreadyUsedLiteralValues.contains(value)) {
value++;
}
alreadyUsedLiteralValues.add(value);
literalToBeAdded.setValue(value);
equivalentEnumAttribute.getEnumType().getLiterals().add(literalToBeAdded);
}
} else {
throw new Exception("Attribute names of "
+ HyEvolutionUtil.getValidTemporalElement(equivalentEnumAttribute.getNames(), date).getName()
+ " are the same but enum types do not match. Aborting merge!");
}
}
protected List<HyFeatureAttribute> mergeFeatureAttributes(HyFeature featureToBeMerged,
HyFeature equivalentFeatureOfMergedModel, Date date) throws Exception {
// Step 2: check whether attributes are matching.
List<HyFeatureAttribute> attributesToBeAddedToEquivalentFeature = new ArrayList<HyFeatureAttribute>();
for (HyFeatureAttribute attributeOfFeatureToBeMerged : featureToBeMerged.getAttributes()) {
HyFeatureAttribute equivalentAttribute = checkIfElementAlreadyExists(attributeOfFeatureToBeMerged,
HyEvolutionUtil.getValidTemporalElements(equivalentFeatureOfMergedModel.getAttributes(), date),
date);
boolean attributeAlreadyExists = (equivalentAttribute != null);
if (!attributeAlreadyExists) {
attributesToBeAddedToEquivalentFeature.add(attributeOfFeatureToBeMerged);
} else {
// Step 1.a: Check whether attribute domains are the same. If not, extend them
// to have the union of their domains
if (equivalentAttribute instanceof HyNumberAttribute
&& attributeOfFeatureToBeMerged instanceof HyNumberAttribute) {
HyNumberAttribute equivalentNumberAttribute = (HyNumberAttribute) equivalentAttribute;
HyNumberAttribute numberAttributeOfFeatureToBeMerged = (HyNumberAttribute) attributeOfFeatureToBeMerged;
int minimum = Math.min(equivalentNumberAttribute.getMin(),
numberAttributeOfFeatureToBeMerged.getMin());
int maximum = Math.max(equivalentNumberAttribute.getMax(),
numberAttributeOfFeatureToBeMerged.getMax());
equivalentNumberAttribute.setMin(minimum);
equivalentNumberAttribute.setMax(maximum);
} else if (equivalentAttribute instanceof HyBooleanAttribute
&& attributeOfFeatureToBeMerged instanceof HyBooleanAttribute) {
// nothing to do.
} else if (equivalentAttribute instanceof HyEnumAttribute
&& attributeOfFeatureToBeMerged instanceof HyEnumAttribute) {
HyEnumAttribute equivalentEnumAttribute = (HyEnumAttribute) equivalentAttribute;
HyEnumAttribute enumAttributeOfFeatureToBeMerged = (HyEnumAttribute) attributeOfFeatureToBeMerged;
mergeEnumAttributes(equivalentEnumAttribute, enumAttributeOfFeatureToBeMerged, date);
} else if (equivalentAttribute instanceof HyStringAttribute
&& attributeOfFeatureToBeMerged instanceof HyStringAttribute) {
// nothing to do.
} else {
throw new Exception("Attributes "
+ HyEvolutionUtil.getValidTemporalElement(equivalentAttribute.getNames(), date).getName()
+ " have the same name but have different types. Cannot merge.");
}
}
}
for (HyFeatureAttribute attributeToBeAdded : attributesToBeAddedToEquivalentFeature) {
attributeToBeAdded.setValidSince(date);
equivalentFeatureOfMergedModel.getAttributes().add(attributeToBeAdded);
}
return attributesToBeAddedToEquivalentFeature;
}
/**
* No evolution shall exist in the input models.
*
* @param models
* @return
* @throws Exception
*/
protected FeatureModelConstraintsTuple mergeFeatureModels(Map<Date, FeatureModelConstraintsTuple> models)
throws Exception {
HyFeatureModel mergedFeatureModel = HyFeatureFactory.eINSTANCE.createHyFeatureModel();
HyConstraintModel mergedConstraintModel = HyConstraintFactory.eINSTANCE.createHyConstraintModel();
List<Date> sortedDateList = new ArrayList<Date>(models.keySet());
sortedDateList.remove(null);
Collections.sort(sortedDateList);
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Importing base model");
long start = System.currentTimeMillis();
if (models.get(null) != null) {
mergeModels(models.get(null), mergedFeatureModel, mergedConstraintModel, null);
}
long end = System.currentTimeMillis();
System.out.println("Importing base model took "+(end-start)+" milliseconds.");
for (Date date : sortedDateList) {
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Importing model at date "+date);
start = System.currentTimeMillis();
mergeModels(models.get(date), mergedFeatureModel, mergedConstraintModel, date);
end = System.currentTimeMillis();
System.out.println("Importing model at date "+date+ " took "+(end-start)+" milliseconds");
}
FeatureModelConstraintsTuple mergedModels = new FeatureModelConstraintsTuple(mergedFeatureModel,
mergedConstraintModel);
return mergedModels;
}
protected void mergeModels(FeatureModelConstraintsTuple modelsToBeMerged, HyFeatureModel mergedFeatureModel,
HyConstraintModel mergedConstraintModel, Date date) throws Exception {
// Key is the feature of the input model and value is the feature of the merged
// model.
Map<HyFeature, HyFeature> featureMap = new HashMap<HyFeature, HyFeature>();
Map<HyGroup, HyGroup> groupMap = new HashMap<HyGroup, HyGroup>();
List<HyFeature> featuresToInvalidate = new ArrayList<HyFeature>(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getFeatures(), date));
// Step 1: Check that each feature / attribute exists. If not create it and set
// valid since. If a feature / attribute existed before, but not anymore, set
// valid until.
HyFeatureModel featureModelToBeMerged = modelsToBeMerged.getFeatureModel();
List<HyFeature> featuresToBeAddedToMergedModel = new ArrayList<HyFeature>();
List<HyFeatureAttribute> addedFeatureAttributes = new ArrayList<HyFeatureAttribute>();
// List<HyGroup> potentialGroupMatchingPartners = new ArrayList<HyGroup>();
// potentialGroupMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getGroups(), date));
//
// for (HyGroup groupToBeMerged : featureModelToBeMerged.getGroups()) {
// HyGroup equivalentGroup = checkIfElementAlreadyExists(groupToBeMerged,
// potentialGroupMatchingPartners, date);
//
// if (equivalentGroup != null) {
// potentialGroupMatchingPartners.remove(equivalentGroup);
// groupMap.put(groupToBeMerged, equivalentGroup);
// }
// }
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Searching for matching features");
List<HyFeature> potentialFeatureMatchingPartners = new ArrayList<HyFeature>();
potentialFeatureMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getFeatures(), date));
for (HyFeature featureToBeMerged : featureModelToBeMerged.getFeatures()) {
HyFeature equivalentFeature = checkIfElementAlreadyExists(featureToBeMerged,
potentialFeatureMatchingPartners, date);
boolean featureAlreadyExists = (equivalentFeature != null);
if (!featureAlreadyExists) {
featuresToBeAddedToMergedModel.add(featureToBeMerged);
} else {
potentialFeatureMatchingPartners.remove(equivalentFeature);
featuresToInvalidate.remove(equivalentFeature);
featureMap.put(featureToBeMerged, equivalentFeature);
addedFeatureAttributes.addAll(mergeFeatureAttributes(featureToBeMerged, equivalentFeature, date));
}
}
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Searching for matching groups");
List<HyGroup> potentialGroupMatchingPartners = new ArrayList<HyGroup>();
potentialGroupMatchingPartners.addAll(HyEvolutionUtil.getValidTemporalElements(mergedFeatureModel.getGroups(), date));
List<HyGroup> matchedGroupMatchingPartners = new ArrayList<HyGroup>();
groupsToBeMergedLoop:
for (HyGroup groupToBeMerged : featureModelToBeMerged.getGroups()) {
// Only compare the group to be merged to groups which are valid at that point in time.
potentialGroupMatchingPartners.removeAll(matchedGroupMatchingPartners);
matchedGroupMatchingPartners = new ArrayList<HyGroup>();
for(HyGroup groupFromMergedModel: potentialGroupMatchingPartners) {
int amountOfSimilarFeatures = 0;
List<HyFeature> featuresOfMergedGroup = HyFeatureEvolutionUtil.getFeaturesOfGroup(groupFromMergedModel,
date);
for (HyFeature featureOfGroupToBeMerged : HyFeatureEvolutionUtil.getFeaturesOfGroup(groupToBeMerged,
date)) {
if (featuresOfMergedGroup.contains(featureMap.get(featureOfGroupToBeMerged))) {
amountOfSimilarFeatures++;
}
}
double sameFeatureRatio = (double) amountOfSimilarFeatures / (double) featuresOfMergedGroup.size();
if (sameFeatureRatio >= 0.75) {
groupMap.put(groupToBeMerged, groupFromMergedModel);
matchedGroupMatchingPartners.add(groupFromMergedModel);
continue groupsToBeMergedLoop;
}
}
}
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether features have to be moved");
moveFeaturesIfTheyHaveBeenMovedInInputModel(mergedFeatureModel, featureMap, date);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether feature types need to be updated");
updateFeatureTypes(mergedFeatureModel, featureMap, date);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Checking whether group types need to be updated");
updateGroupTypes(groupMap, date);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding new features to merged model");
mergeFeatures(featuresToBeAddedToMergedModel, mergedFeatureModel, featureMap, date);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding enums of feature attributes");
// handle enums. Only considered enums which are used by feature attributes.
Set<HyEnum> enums = new HashSet<HyEnum>();
for (HyFeatureAttribute addedFeatureAttribute : addedFeatureAttributes) {
if (addedFeatureAttribute instanceof HyEnumAttribute) {
HyEnumAttribute enumAttribute = (HyEnumAttribute) addedFeatureAttribute;
enums.add(enumAttribute.getEnumType());
}
}
mergedFeatureModel.getEnums().addAll(enums);
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Invalidating features");
// Invalidate features which do not exist anymore. Update group composition.
for (HyFeature featureToInvalidate : featuresToInvalidate) {
HyFeatureEvolutionUtil.removeFeatureFromGroup(featureToInvalidate, date);
HyFeatureEvolutionUtil.getName(featureToInvalidate, date).setValidUntil(date);
HyFeatureEvolutionUtil.getType(featureToInvalidate, date).setValidUntil(date);
for(HyFeatureAttribute attribute: HyEvolutionUtil.getValidTemporalElements(featureToInvalidate.getAttributes(), date)) {
attribute.setValidUntil(date);
}
featureToInvalidate.setValidUntil(date);
}
// Merge constraint models
HyConstraintModel constraintModelToBeMerged = modelsToBeMerged.getConstraintModel();
if (constraintModelToBeMerged != null) {
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Merging constraint model");
mergeConstraintModel(constraintModelToBeMerged, mergedConstraintModel, featureMap, date);
}
}
protected void updateGroupTypes(Map<HyGroup, HyGroup> groupMap, Date date) {
for (Entry<HyGroup, HyGroup> entry : groupMap.entrySet()) {
HyGroupType groupTypeOfGroupToBeMerged = HyFeatureEvolutionUtil.getType(entry.getKey(), date);
HyGroupType groupTypeOfMergedGroup = HyFeatureEvolutionUtil.getType(entry.getValue(), date);
if (!groupTypeOfGroupToBeMerged.getType().equals(groupTypeOfMergedGroup.getType())) {
groupTypeOfMergedGroup.setValidUntil(date);
HyGroupType newGroupType = HyFeatureFactory.eINSTANCE.createHyGroupType();
newGroupType.setValidSince(date);
newGroupType.setType(groupTypeOfGroupToBeMerged.getType());
entry.getValue().getTypes().add(newGroupType);
}
}
}
protected void updateFeatureTypes(HyFeatureModel mergedFeatureModel, Map<HyFeature, HyFeature> featureMap,
Date date) {
for (Entry<HyFeature, HyFeature> entry : featureMap.entrySet()) {
// key feature from input mode, value feature from merged model
HyFeatureType inputType = HyFeatureEvolutionUtil.getType(entry.getKey(), date);
HyFeatureType mergedType = HyFeatureEvolutionUtil.getType(entry.getValue(), date);
if (!inputType.getType().equals(mergedType.getType())) {
mergedType.setValidUntil(date);
HyFeatureType newFeatureType = HyFeatureFactory.eINSTANCE.createHyFeatureType();
newFeatureType.setValidSince(date);
newFeatureType.setType(inputType.getType());
entry.getValue().getTypes().add(newFeatureType);
}
}
}
protected void mergeFeatures(List<HyFeature> featuresToBeAddedToMergedModel, HyFeatureModel mergedFeatureModel,
Map<HyFeature, HyFeature> featureMap, Date date) throws Exception {
for (HyFeature featureToBeAdded : featuresToBeAddedToMergedModel) {
HyFeatureModel oldFeatureModel = featureToBeAdded.getFeatureModel();
mergedFeatureModel.getFeatures().add(featureToBeAdded);
featureToBeAdded.setValidSince(date);
featureToBeAdded.setValidUntil(null);
// clear everything from evolution.
HyName validName = HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date);
validName.setValidSince(date);
validName.setValidUntil(null);
featureToBeAdded.getNames().clear();
featureToBeAdded.getNames().add(validName);
HyFeatureType validType = HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getTypes(), date);
validType.setValidSince(date);
validType.setValidUntil(null);
featureToBeAdded.getTypes().clear();
featureToBeAdded.getTypes().add(validType);
List<HyFeatureChild> validFeatureChildren = HyEvolutionUtil
.getValidTemporalElements(featureToBeAdded.getParentOf(), date);
featureToBeAdded.getParentOf().clear();
for (HyFeatureChild featureChild : validFeatureChildren) {
featureChild.setValidSince(date);
featureChild.setValidUntil(null);
HyGroup group = featureChild.getChildGroup();
mergedFeatureModel.getGroups().add(group);
group.setValidSince(date);
group.setValidUntil(null);
HyGroupType validGroupType = HyEvolutionUtil.getValidTemporalElement(group.getTypes(), date);
group.getTypes().clear();
validGroupType.setValidSince(date);
validGroupType.setValidUntil(null);
group.getTypes().add(validGroupType);
HyGroupComposition validGroupComposition = HyEvolutionUtil.getValidTemporalElement(group.getParentOf(),
date);
validGroupComposition.setValidSince(date);
validGroupComposition.setValidUntil(null);
group.getParentOf().clear();
group.getParentOf().add(validGroupComposition);
featureToBeAdded.getParentOf().add(featureChild);
}
// Put feature in correct group
HyGroupComposition groupComposition = HyEvolutionUtil
.getValidTemporalElement(featureToBeAdded.getGroupMembership(), date);
if (groupComposition != null) {
HyGroup group = groupComposition.getCompositionOf();
HyFeatureChild featureChildOfGroup = HyEvolutionUtil.getValidTemporalElement(group.getChildOf(), date);
HyFeature parentFeatureInInputModel = featureChildOfGroup.getParent();
if (featuresToBeAddedToMergedModel.contains(parentFeatureInInputModel)) {
// parent feature is also added to the new model. We are done.
continue;
}
HyFeature parentInMergedModel = featureMap.get(parentFeatureInInputModel);
if (parentInMergedModel != null) {
HyGroupType groupType = HyEvolutionUtil.getValidTemporalElement(group.getTypes(), date);
HyGroupTypeEnum groupTypeEnum = groupType.getType();
addFeatureToBestMatchingGroup(featureToBeAdded, groupComposition, parentInMergedModel,
groupTypeEnum, featureMap, mergedFeatureModel, date);
} else {
throw new Exception("We have a problem. The parent of the feature "
+ HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date).getName()
+ " is neither newly added to the merged model nor is it already existent in it. Aborting whole merging process");
}
}
else {
HyRootFeature oldFeatureModelRootFeature = HyEvolutionUtil
.getValidTemporalElement(oldFeatureModel.getRootFeature(), date);
if (oldFeatureModelRootFeature == null || oldFeatureModelRootFeature.getFeature() != featureToBeAdded) {
throw new Exception("Feature "
+ HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date).getName()
+ " did not have a group but is no root feature. Aborted merge.");
}
HyRootFeature oldRootFeature = HyEvolutionUtil
.getValidTemporalElement(mergedFeatureModel.getRootFeature(), date);
if (oldRootFeature != null) {
oldRootFeature.setValidUntil(date);
}
HyRootFeature newRootFeature = HyFeatureFactory.eINSTANCE.createHyRootFeature();
newRootFeature.setValidSince(date);
newRootFeature.setFeature(featureToBeAdded);
mergedFeatureModel.getRootFeature().add(newRootFeature);
}
}
}
protected void moveFeaturesIfTheyHaveBeenMovedInInputModel(HyFeatureModel mergedFeatureModel,
Map<HyFeature, HyFeature> featureMap, Date date) {
for (Entry<HyFeature, HyFeature> featureEntrySet : featureMap.entrySet()) {
HyFeature parentOfMergedFeature = HyFeatureEvolutionUtil
.getParentFeatureOfFeature(featureEntrySet.getValue(), date);
HyFeature parentFeatureFromInputModel = HyFeatureEvolutionUtil
.getParentFeatureOfFeature(featureEntrySet.getKey(), date);
if (parentFeatureFromInputModel == null) {
// seems to be new root.
continue;
}
HyFeature equivalentToParentFromInputModel = featureMap.get(parentFeatureFromInputModel);
if (equivalentToParentFromInputModel == null) {
// parent will be added in the next step. Probably nothing to do.
} else if (equivalentToParentFromInputModel == parentOfMergedFeature) {
// parent stayed the same. Nothing to do.
} else {
// parents are different.
HyGroupComposition groupCompositionOfFeatureFromInputModel = HyEvolutionUtil
.getValidTemporalElement(featureEntrySet.getKey().getGroupMembership(), date);
HyGroupTypeEnum groupTypeOfGroupOfFeatureFromInputModel = HyEvolutionUtil.getValidTemporalElement(
groupCompositionOfFeatureFromInputModel.getCompositionOf().getTypes(), date).getType();
addFeatureToBestMatchingGroup(featureEntrySet.getValue(), groupCompositionOfFeatureFromInputModel,
equivalentToParentFromInputModel, groupTypeOfGroupOfFeatureFromInputModel, featureMap,
mergedFeatureModel, date);
HyFeatureEvolutionUtil.removeFeatureFromGroup(featureEntrySet.getValue(), date);
}
}
}
protected void mergeConstraintModel(HyConstraintModel constraintModelToBeMerged,
HyConstraintModel mergedConstraintModel, Map<HyFeature, HyFeature> featureMap, Date date) {
// For each constraint in model to be merged:
// Create a map, in which constraints from the model to be merged are mapped to
// equal constraints from the merged model
// Key is the constraint from model to be merged and value is constraint from
// merged model
List<HyConstraint> constraintsToBeMergedWithoutMatchingPartner = new ArrayList<HyConstraint>(
constraintModelToBeMerged.getConstraints());
List<HyConstraint> remainingMatchingPartners = new ArrayList<HyConstraint>(
mergedConstraintModel.getConstraints());
ZonedDateTime zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Finding matching constraints");
for (HyConstraint constraintToBeMerged : constraintModelToBeMerged.getConstraints()) {
HyConstraint equalConstraint = findEqualConstraint(constraintToBeMerged, remainingMatchingPartners,
featureMap, date);
if (equalConstraint != null) {
remainingMatchingPartners.remove(equalConstraint);
constraintsToBeMergedWithoutMatchingPartner.remove(constraintToBeMerged);
zdt = ZonedDateTime.now();
// System.err.println(zdt.toString()+": Matched a constraint.");
continue;
}
}
// For each constraint of the model to be merged that does not have a mapping
// partner: add the constraint with valid since
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Adding new constraints");
for (HyConstraint constraintToBeMergedWithoutMatchingPartner : constraintsToBeMergedWithoutMatchingPartner) {
mergedConstraintModel.getConstraints()
.add(createConstraintInMergedModel(constraintToBeMergedWithoutMatchingPartner, featureMap, date));
}
// For each constraint of the merged model that does not have a mapping partner:
// set the valid until of the constraint
zdt = ZonedDateTime.now();
System.out.println(zdt.toString()+": Invalidate constraints");
for (HyConstraint unmatchedConstraint : remainingMatchingPartners) {
unmatchedConstraint.setValidUntil(date);
}
}
protected HyConstraint findEqualConstraint(HyConstraint constraint, List<HyConstraint> potentialMatchingPartners,
Map<HyFeature, HyFeature> featureMap, Date date) {
for (HyConstraint potentialMatchingPartner : potentialMatchingPartners) {
if (areExpressionsEqual(constraint.getRootExpression(), potentialMatchingPartner.getRootExpression(),
featureMap, date)) {
return potentialMatchingPartner;
}
}
return null;
}
protected boolean areExpressionsEqual(HyExpression expressionOfConstraintToBeMerged,
HyExpression expressionOfMergedConstraint, Map<HyFeature, HyFeature> featureMap, Date date) {
if (expressionOfConstraintToBeMerged.getClass().toString()
.equals(expressionOfMergedConstraint.getClass().toString())) {
if (expressionOfConstraintToBeMerged instanceof HyBinaryExpression) {
HyBinaryExpression bin1 = (HyBinaryExpression) expressionOfConstraintToBeMerged;
HyBinaryExpression bin2 = (HyBinaryExpression) expressionOfMergedConstraint;
boolean operandsMatch = false;
operandsMatch = areExpressionsEqual(bin1.getOperand1(), bin2.getOperand1(), featureMap, date)
&& areExpressionsEqual(bin1.getOperand2(), bin2.getOperand2(), featureMap, date);
return operandsMatch;
} else if (expressionOfConstraintToBeMerged instanceof HyUnaryExpression) {
HyUnaryExpression unary1 = (HyUnaryExpression) expressionOfConstraintToBeMerged;
HyUnaryExpression unary2 = (HyUnaryExpression) expressionOfMergedConstraint;
return areExpressionsEqual(unary1.getOperand(), unary2.getOperand(), featureMap, date);
} else if (expressionOfConstraintToBeMerged instanceof HyAbstractFeatureReferenceExpression) {
HyAbstractFeatureReferenceExpression featureRef1 = (HyAbstractFeatureReferenceExpression) expressionOfConstraintToBeMerged;
HyAbstractFeatureReferenceExpression featureRef2 = (HyAbstractFeatureReferenceExpression) expressionOfMergedConstraint;
HyFeature equivalentFeatureFromMergedFeatureModel = featureMap.get(featureRef1.getFeature());
boolean featuresMatch = equivalentFeatureFromMergedFeatureModel==featureRef2.getFeature();
return featuresMatch;
} else {
System.err.println(
"Currently unsupported expressions have been compared in de.darwinspl.importer.evolution.DwFeatureModelEvolutionImporter.areExpressionsEqual(HyExpression, HyExpression, Map<HyFeature, HyFeature>, Date)");
return false;
}
} else {
return false;
}
}
protected HyConstraint createConstraintInMergedModel(HyConstraint constraintToBeMerged,
Map<HyFeature, HyFeature> featureMap, Date date) {
HyConstraint constraint = EcoreUtil.copy(constraintToBeMerged);
constraint.setValidSince(date);
TreeIterator<EObject> iterator = constraint.eAllContents();
while (iterator.hasNext()) {
EObject eObject = iterator.next();
if (eObject instanceof HyFeatureReferenceExpression) {
HyFeatureReferenceExpression featureReference = (HyFeatureReferenceExpression) eObject;
// no versions are supported
featureReference.setVersionRestriction(null);
HyFeature equivalentFeatureInMergedModel = featureMap.get(featureReference.getFeature());
if(equivalentFeatureInMergedModel != null) {
featureReference.setFeature(equivalentFeatureInMergedModel);
}
}
}
return constraint;
}
}
| fixed a bug when a feature is moved to a newly added parent | plugins/de.darwinspl.importer.evolution/src/de/darwinspl/importer/evolution/DwFeatureModelEvolutionImporter.java | fixed a bug when a feature is moved to a newly added parent | <ide><path>lugins/de.darwinspl.importer.evolution/src/de/darwinspl/importer/evolution/DwFeatureModelEvolutionImporter.java
<ide> HyGroupComposition groupCompositionOfFeatureToBeAdded, HyFeature parentInMergedModel,
<ide> HyGroupTypeEnum groupTypeEnum, Map<HyFeature, HyFeature> featureMap, HyFeatureModel mergedFeatureModel,
<ide> Date date) {
<add>
<ide> HyGroup matchingGroup = null;
<ide> int maximumAmountOfMatchingSiblings = 0;
<ide>
<ide> newGroupComposition.setValidSince(date);
<ide> matchingGroup.getParentOf().add(newGroupComposition);
<ide>
<del> for (HyFeature groupFeature : oldGroupComposition.getFeatures()) {
<del> newGroupComposition.getFeatures().add(groupFeature);
<del> }
<add> newGroupComposition.getFeatures().addAll(oldGroupComposition.getFeatures());
<add>
<ide> newGroupComposition.getFeatures().add(featureToBeAdded);
<ide> } else {
<del> // create a new alternative group
<del> HyGroup newAlternativeGroup = HyFeatureFactory.eINSTANCE.createHyGroup();
<del> newAlternativeGroup.setValidSince(date);
<del> mergedFeatureModel.getGroups().add(newAlternativeGroup);
<add> // create a new group
<add> HyGroup newGroup = HyFeatureFactory.eINSTANCE.createHyGroup();
<add> newGroup.setValidSince(date);
<add> mergedFeatureModel.getGroups().add(newGroup);
<ide>
<ide> HyFeatureChild newFeatureChild = HyFeatureFactory.eINSTANCE.createHyFeatureChild();
<ide> newFeatureChild.setValidSince(date);
<del> newFeatureChild.setChildGroup(newAlternativeGroup);
<add> newFeatureChild.setChildGroup(newGroup);
<ide> newFeatureChild.setParent(parentInMergedModel);
<ide>
<ide> HyGroupType newGroupType = HyFeatureFactory.eINSTANCE.createHyGroupType();
<ide> newGroupType.setValidSince(date);
<ide> newGroupType.setType(groupTypeEnum);
<del> newAlternativeGroup.getTypes().add(newGroupType);
<add> newGroup.getTypes().add(newGroupType);
<ide>
<ide> HyGroupComposition newGroupComposition = HyFeatureFactory.eINSTANCE.createHyGroupComposition();
<ide> newGroupComposition.setValidSince(date);
<ide> newGroupComposition.getFeatures().add(featureToBeAdded);
<del> newGroupComposition.setCompositionOf(newAlternativeGroup);
<add> newGroupComposition.setCompositionOf(newGroup);
<ide> }
<ide>
<ide> groupCompositionOfFeatureToBeAdded.getFeatures().remove(featureToBeAdded);
<ide>
<ide> for (Entry<FeatureModelConstraintsTuple, Date> entry : models.entrySet()) {
<ide> darwinSPLModels.put(entry.getValue(), entry.getKey());
<del> EcoreUtil.resolveAll(entry.getKey().getConstraintModel());
<add>
<add> HyConstraintModel constraintModel = entry.getKey().getConstraintModel();
<add> if(constraintModel!=null) {
<add> EcoreUtil.resolveAll(entry.getKey().getConstraintModel());
<add> }
<ide> }
<ide>
<ide> FeatureModelConstraintsTuple mergedModels = mergeFeatureModels(darwinSPLModels);
<ide> }
<ide> }
<ide>
<add> consistencyCheck(mergedFeatureModel);
<add>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Checking whether features have to be moved");
<ide> moveFeaturesIfTheyHaveBeenMovedInInputModel(mergedFeatureModel, featureMap, date);
<add>
<add> consistencyCheck(mergedFeatureModel);
<ide>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Checking whether feature types need to be updated");
<ide> updateFeatureTypes(mergedFeatureModel, featureMap, date);
<add>
<add> consistencyCheck(mergedFeatureModel);
<ide>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Checking whether group types need to be updated");
<ide> updateGroupTypes(groupMap, date);
<add>
<add> consistencyCheck(mergedFeatureModel);
<ide>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Adding new features to merged model");
<del> mergeFeatures(featuresToBeAddedToMergedModel, mergedFeatureModel, featureMap, date);
<add> addNewFeatures(featuresToBeAddedToMergedModel, mergedFeatureModel, featureMap, date);
<add>
<add> consistencyCheck(mergedFeatureModel);
<ide>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Adding enums of feature attributes");
<ide>
<ide> mergedFeatureModel.getEnums().addAll(enums);
<ide>
<add> consistencyCheck(mergedFeatureModel);
<add>
<ide> zdt = ZonedDateTime.now();
<ide> System.out.println(zdt.toString()+": Invalidating features");
<ide> // Invalidate features which do not exist anymore. Update group composition.
<ide>
<ide> }
<ide>
<add> consistencyCheck(mergedFeatureModel);
<add>
<ide> // Merge constraint models
<ide> HyConstraintModel constraintModelToBeMerged = modelsToBeMerged.getConstraintModel();
<ide> if (constraintModelToBeMerged != null) {
<ide> System.out.println(zdt.toString()+": Merging constraint model");
<ide> mergeConstraintModel(constraintModelToBeMerged, mergedConstraintModel, featureMap, date);
<ide> }
<add>
<add> consistencyCheck(mergedFeatureModel);
<ide>
<ide> }
<ide>
<ide> }
<ide> }
<ide>
<del> protected void mergeFeatures(List<HyFeature> featuresToBeAddedToMergedModel, HyFeatureModel mergedFeatureModel,
<add> protected void addNewFeatures(List<HyFeature> featuresToBeAddedToMergedModel, HyFeatureModel mergedFeatureModel,
<ide> Map<HyFeature, HyFeature> featureMap, Date date) throws Exception {
<add>
<ide> for (HyFeature featureToBeAdded : featuresToBeAddedToMergedModel) {
<add>
<add> // set validity of feature, its name and type to date
<ide> HyFeatureModel oldFeatureModel = featureToBeAdded.getFeatureModel();
<ide> mergedFeatureModel.getFeatures().add(featureToBeAdded);
<ide> featureToBeAdded.setValidSince(date);
<ide> featureToBeAdded.getTypes().clear();
<ide> featureToBeAdded.getTypes().add(validType);
<ide>
<add>
<add>
<ide> List<HyFeatureChild> validFeatureChildren = HyEvolutionUtil
<ide> .getValidTemporalElements(featureToBeAdded.getParentOf(), date);
<add>
<ide> featureToBeAdded.getParentOf().clear();
<add>
<ide> for (HyFeatureChild featureChild : validFeatureChildren) {
<add>
<add> featureToBeAdded.getParentOf().add(featureChild);
<add>
<ide> featureChild.setValidSince(date);
<ide> featureChild.setValidUntil(null);
<ide>
<ide> validGroupComposition.setValidUntil(null);
<ide> group.getParentOf().clear();
<ide> group.getParentOf().add(validGroupComposition);
<del>
<del> featureToBeAdded.getParentOf().add(featureChild);
<add>
<add> List<HyFeature> featuresOfGroupComposition = new ArrayList<HyFeature>();
<add> featuresOfGroupComposition.addAll(validGroupComposition.getFeatures());
<add>
<add> for(HyFeature featureOfGroupComposition: featuresOfGroupComposition) {
<add> HyFeature equivalentFeature = featureMap.get(featureOfGroupComposition);
<add> if(equivalentFeature != null) {
<add> validGroupComposition.getFeatures().remove(featureOfGroupComposition);
<add> validGroupComposition.getFeatures().add(equivalentFeature);
<add> }
<add> }
<add>
<ide> }
<ide>
<ide> // Put feature in correct group
<ide> + HyEvolutionUtil.getValidTemporalElement(featureToBeAdded.getNames(), date).getName()
<ide> + " is neither newly added to the merged model nor is it already existent in it. Aborting whole merging process");
<ide> }
<add>
<add>
<ide> }
<ide> else {
<ide> HyRootFeature oldFeatureModelRootFeature = HyEvolutionUtil
<ide> protected void moveFeaturesIfTheyHaveBeenMovedInInputModel(HyFeatureModel mergedFeatureModel,
<ide> Map<HyFeature, HyFeature> featureMap, Date date) {
<ide> for (Entry<HyFeature, HyFeature> featureEntrySet : featureMap.entrySet()) {
<add>
<ide> HyFeature parentOfMergedFeature = HyFeatureEvolutionUtil
<ide> .getParentFeatureOfFeature(featureEntrySet.getValue(), date);
<add>
<ide> HyFeature parentFeatureFromInputModel = HyFeatureEvolutionUtil
<ide> .getParentFeatureOfFeature(featureEntrySet.getKey(), date);
<ide>
<ide> HyFeature equivalentToParentFromInputModel = featureMap.get(parentFeatureFromInputModel);
<ide>
<ide> if (equivalentToParentFromInputModel == null) {
<del> // parent will be added in the next step. Probably nothing to do.
<add> // Parent will be added to the merged model.
<add> // Has to be removed from its current group.
<add> // When the new parent will be added to the model, this feature will be added to its group.
<add> HyFeatureEvolutionUtil.removeFeatureFromGroup(featureEntrySet.getValue(), date);
<ide> } else if (equivalentToParentFromInputModel == parentOfMergedFeature) {
<ide> // parent stayed the same. Nothing to do.
<ide> } else {
<ide> return constraint;
<ide> }
<ide>
<add> /**
<add> * Only use this method if you have the feeling that something isn't imported correctly.
<add> * @param mergedFeatureModel
<add> */
<add> private void consistencyCheck(HyFeatureModel mergedFeatureModel) {
<add>
<add>// for(HyGroup group: mergedFeatureModel.getGroups()) {
<add>// for(HyGroupComposition groupComposition: group.getParentOf()) {
<add>// if(!mergedFeatureModel.getFeatures().containsAll(groupComposition.getFeatures())) {
<add>// System.err.println("Non consistent!");
<add>// return;
<add>// }
<add>// }
<add>// }
<add> }
<ide>
<ide> } |
|
Java | mit | 3817c2e8350079185f163558c8fdffaf6c0b2f42 | 0 | seqcode/seqcode-core,seqcode/seqcode-core,seqcode/seqcode-core,seqcode/seqcode-core | package edu.psu.compbio.seqcode.deepseq;
import edu.psu.compbio.seqcode.genome.Genome;
import edu.psu.compbio.seqcode.genome.location.Point;
/**
* StrandedPair represents a pair of reads that are paired together.
* Coordinate is the 5' end of each hit.
* Weight is determined by implementation of hit loading.
*
* @author mahony
*
*/
public class StrandedPair implements Comparable<StrandedPair>{
private Genome gen;
private int r1Chrom, r2Chrom; // int codes for chroms - convert with Genome
private char r1Strand, r2Strand;
private int r1Coordinate, r2Coordinate;
private boolean sameChrom;
private float weight;
public StrandedPair(Genome g, int r1Chr, int r1Coord, char r1Str, int r2Chr, int r2Coord, char r2Str, boolean sameChr, float w){
gen=g;
r1Chrom = r1Chr;
r2Chrom = r2Chr;
r1Strand = r1Str;
r2Strand = r2Str;
r1Coordinate = r1Coord;
r2Coordinate = r2Coord;
sameChrom = sameChr;
weight = w;
}
/**
* Get the pair midpoint. Returns null if reads on different strands.
* @return
*/
public Point getMidpoint(){
if(!sameChrom)
return null;
else{
return new Point(gen, gen.getChromName(r1Chrom), (r1Coordinate+r2Coordinate)/2);
}
}
/**
* Returns distance between read 5' positions if this is a proper concurrent pair.
* Returns -1 otherwise.
* @return
*/
public int getFragmentSize(){
if(!sameChrom)
return -1;
else if((r1Coordinate<r2Coordinate && r1Strand=='+' && r2Strand=='-') || (r2Coordinate<r1Coordinate && r2Strand=='+' && r1Strand=='-')){
return Math.abs(r2Coordinate-r1Coordinate);
}else{
return -1;
}
}
public void setR1Strand(char strand) {
this.r1Strand = strand;
}
public void setR2Strand(char strand) {
this.r2Strand = strand;
}
public char getR1Strand() {
return r1Strand;
}
public char getR2Strand() {
return r2Strand;
}
public void setR1Coordinate(int coordinate) {
this.r1Coordinate = coordinate;
}
public void setR2Coordinate(int coordinate) {
this.r2Coordinate = coordinate;
}
public int getR1Coordinate() {
return r1Coordinate;
}
public int getR2Coordinate() {
return r2Coordinate;
}
public void setR1Chrom(int chrom){
if(r1Chrom == r2Chrom)
sameChrom=true;
this.r1Chrom=chrom;
}
public void setR2Chrom(int chrom){
if(r1Chrom == r2Chrom)
sameChrom=true;
this.r2Chrom=chrom;
}
public String getR1Chrom(){
return gen.getChromName(r1Chrom);
}
public String getR2Chrom(){
return gen.getChromName(r2Chrom);
}
public boolean pairFromSameChrom(){ return sameChrom; }
public void setWeight(float weight) {
this.weight = weight;
}
public float getWeight() {
return weight;
}
// sort according to R1 coordinate, then by R2 coordinate, then by strands
public int compareTo(StrandedPair b) {
int result;
if (r1Chrom==b.r1Chrom) { //R1 coord
result = r1Coordinate - b.r1Coordinate;
} else {
result = r1Chrom > b.r1Chrom ? +1 : r1Chrom < b.r1Chrom ? -1 : 0;
}
if (result == 0) { //R2 coord
if (r2Chrom == b.r2Chrom) {
result = r2Coordinate - b.r2Coordinate;
} else {
result = r2Chrom > b.r2Chrom ? +1 : r2Chrom < b.r2Chrom ? -1 : 0;
}
}
if (result == 0) //R1 strand
result = (r1Strand==b.r1Strand ? 0 : r1Strand=='+'?1:-1);
if (result == 0) { //R2 strand
result = (r2Strand==b.r2Strand ? 0 : r2Strand=='+'?1:-1);
}
return result;
}
public String toString(){
return new String(gen.getChromName(r1Chrom)+":"+r1Coordinate+":"+r1Strand+"\t"+gen.getChromName(r2Chrom)+":"+r2Coordinate+":"+r2Strand+"\t"+weight);
}
}
| src/edu/psu/compbio/seqcode/deepseq/StrandedPair.java | package edu.psu.compbio.seqcode.deepseq;
import edu.psu.compbio.seqcode.genome.Genome;
import edu.psu.compbio.seqcode.genome.location.Point;
/**
* StrandedPair represents a pair of reads that are paired together.
* Coordinate is the 5' end of each hit.
* Weight is determined by implementation of hit loading.
*
* @author mahony
*
*/
public class StrandedPair implements Comparable<StrandedPair>{
private Genome gen;
private int r1Chrom, r2Chrom; // int codes for chroms - convert with Genome
private char r1Strand, r2Strand;
private int r1Coordinate, r2Coordinate;
private boolean sameChrom;
private float weight;
public StrandedPair(Genome g, int r1Chr, int r1Coord, char r1Str, int r2Chr, int r2Coord, char r2Str, boolean sameChr, float w){
gen=g;
r1Chrom = r1Chr;
r2Chrom = r2Chr;
r1Strand = r1Str;
r2Strand = r2Str;
r1Coordinate = r1Coord;
r2Coordinate = r2Coord;
sameChrom = sameChr;
weight = w;
}
/**
* Get the pair midpoint. Returns null if reads on different strands.
* @return
*/
public Point getMidpoint(){
if(!sameChrom)
return null;
else{
return new Point(gen, gen.getChromName(r1Chrom), (r1Coordinate+r2Coordinate)/2);
}
}
/**
* Returns distance between read 5' positions if this is a proper concurrent pair.
* Returns -1 otherwise.
* @return
*/
public int getFragmentSize(){
if(!sameChrom)
return -1;
else if((r1Coordinate<r2Coordinate && r1Strand=='+' && r2Strand=='-') || (r2Coordinate<r1Coordinate && r2Strand=='+' && r1Strand=='-')){
return Math.abs(r2Coordinate-r1Coordinate);
}else{
return -1;
}
}
public void setR1Strand(char strand) {
this.r1Strand = strand;
}
public void setR2Strand(char strand) {
this.r2Strand = strand;
}
public char getR1Strand() {
return r1Strand;
}
public char getR2Strand() {
return r2Strand;
}
public void setR1Coordinate(int coordinate) {
this.r1Coordinate = coordinate;
}
public void setR2Coordinate(int coordinate) {
this.r2Coordinate = coordinate;
}
public int getR1Coordinate() {
return r1Coordinate;
}
public int getR2Coordinate() {
return r2Coordinate;
}
public void setR1Chrom(int chrom){
if(r1Chrom == r2Chrom)
sameChrom=true;
this.r1Chrom=chrom;
}
public void setR2Chrom(int chrom){
if(r1Chrom == r2Chrom)
sameChrom=true;
this.r2Chrom=chrom;
}
public String getR1Chrom(){
return gen.getChromName(r1Chrom);
}
public String getR2Chrom(){
return gen.getChromName(r2Chrom);
}
public boolean pairFromSameChrom(){ return sameChrom; }
public void setWeight(float weight) {
this.weight = weight;
}
public float getWeight() {
return weight;
}
// sort according to R1 coordinate, then by R2 coordinate, then by strands
public int compareTo(StrandedPair b) {
int result;
if (r1Chrom==b.r1Chrom) { //R1 coord
result = r1Coordinate - b.r1Coordinate;
} else {
result = r1Chrom > b.r1Chrom ? +1 : r1Chrom < b.r1Chrom ? -1 : 0;
}
if (result == 0) { //R2 coord
if (r2Chrom == b.r2Chrom) {
result = r2Coordinate - b.r2Coordinate;
} else {
result = r2Chrom > b.r2Chrom ? +1 : r2Chrom < b.r2Chrom ? -1 : 0;
}
}
if (result == 0) //R1 strand
result = (r1Strand==b.r1Strand ? 0 : r1Strand=='+'?1:-1);
if (result == 0) { //R2 strand
result = (r2Strand==b.r2Strand ? 0 : r2Strand=='+'?1:-1);
}
return result;
}
}
| toString for StrandedPair | src/edu/psu/compbio/seqcode/deepseq/StrandedPair.java | toString for StrandedPair | <ide><path>rc/edu/psu/compbio/seqcode/deepseq/StrandedPair.java
<ide> }
<ide> return result;
<ide> }
<add>
<add> public String toString(){
<add> return new String(gen.getChromName(r1Chrom)+":"+r1Coordinate+":"+r1Strand+"\t"+gen.getChromName(r2Chrom)+":"+r2Coordinate+":"+r2Strand+"\t"+weight);
<add> }
<ide>
<ide> } |
|
Java | apache-2.0 | fb5fb3f60735be8eedf4ae48b4c27078cd185cd8 | 0 | prometheus/client_java | package io.prometheus.client.exporter;
import javax.xml.bind.DatatypeConverter;
/**
* This class delegates to either javax.xml.bind.DatatypeConverter (for Java < 8) or java.util.Base64 (Java 8+)
* to perform Base64 encoding of a String.
*
* This code requires Java 8+ for compilation.
*/
public class Base64 {
private static final boolean HAS_JAVA_UTIL_BASE64 = hasJavaUtilBase64();
private static boolean hasJavaUtilBase64() {
try {
Class.forName("java.util.Base64");
// Java 8+
return true;
} catch (Throwable t) {
// Java < 8
return false;
}
}
private Base64() {}
/**
* Encodes a byte[] to a String using Base64.
*
* Passing a null argument will cause a NullPointerException to be thrown.
*
* @param src string to be encoded
* @return String in Base64 encoding
*/
@SuppressWarnings("all")
public static String encodeToString(byte[] src) {
if (src == null) {
throw new NullPointerException();
}
if (HAS_JAVA_UTIL_BASE64) {
return java.util.Base64.getEncoder().encodeToString(src);
} else {
return DatatypeConverter.printBase64Binary(src);
}
}
}
| simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/Base64.java | package io.prometheus.client.exporter;
import javax.xml.bind.DatatypeConverter;
/**
* This class delegates to either javax.xml.bind.DatatypeConverter (for Java < 8) or java.util.Base64 (Java 8+)
* to perform Base64 encoding of a String.
*
* This code requires Java 8+ for compilation.
*/
public class Base64 {
private static final boolean HAS_JAVA_UTIL_BASE64 = hasJavaUtilBase64();
private static boolean hasJavaUtilBase64() {
try {
Class.forName("java.util.Base64");
// Java 8+
return true;
} catch (Throwable t) {
// Java < 8
return false;
}
}
private Base64() {}
/**
* Encodes a byte[] to a String using Base64.
*
* Passing a null argument will cause a NullPointerException to be thrown.
*
* @param src
* @return String in Base64 encoding
*/
@SuppressWarnings("all")
public static String encodeToString(byte[] src) {
if (src == null) {
throw new NullPointerException();
}
if (HAS_JAVA_UTIL_BASE64) {
return java.util.Base64.getEncoder().encodeToString(src);
} else {
return DatatypeConverter.printBase64Binary(src);
}
}
}
| Fix javadoc
| simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/Base64.java | Fix javadoc | <ide><path>impleclient_pushgateway/src/main/java/io/prometheus/client/exporter/Base64.java
<ide> import javax.xml.bind.DatatypeConverter;
<ide>
<ide> /**
<del> * This class delegates to either javax.xml.bind.DatatypeConverter (for Java < 8) or java.util.Base64 (Java 8+)
<add> * This class delegates to either javax.xml.bind.DatatypeConverter (for Java < 8) or java.util.Base64 (Java 8+)
<ide> * to perform Base64 encoding of a String.
<ide> *
<ide> * This code requires Java 8+ for compilation.
<ide> *
<ide> * Passing a null argument will cause a NullPointerException to be thrown.
<ide> *
<del> * @param src
<add> * @param src string to be encoded
<ide> * @return String in Base64 encoding
<ide> */
<ide> @SuppressWarnings("all") |
|
Java | apache-2.0 | 226fd3fc14ebeb3d6f86ba9666032903d21d7d7f | 0 | dannil/HttpDownloader,dannil/HttpDownloader | package org.dannil.httpdownloader.utility;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* Class which handles operations on language bundles
*
* @author Daniel
*
*/
public final class LanguageUtility {
private static final Locale DEFAULT_LOCALE;
private static final List<Locale> availableLanguages;
static {
DEFAULT_LOCALE = new Locale("en", "US");
availableLanguages = new LinkedList<Locale>();
availableLanguages.add(new Locale("en", "US"));
availableLanguages.add(new Locale("sv", "SE"));
}
/**
* Private constructor to make the class a singleton.
*/
private LanguageUtility() {
throw new AssertionError();
}
/**
* Returns a bundle with the language which matches the users current display language.
*
* @return ResourceBundle with default language
*/
public static final ResourceBundle getLanguageBundle() {
return getLanguageBundle(Locale.getDefault());
}
/**
* Returns a bundle with the language which matches the inputed locale.
* If the language file doesn't exist, return a standard language (enUS).
*
* @param language
* - The language to load
*
* @return ResourceBundle with inputed locale
*/
public static final ResourceBundle getLanguageBundle(final Locale language) {
if (availableLanguages.contains(language)) {
return ResourceBundle.getBundle(PathUtility.LANGUAGE_PATH, language);
}
return ResourceBundle.getBundle(PathUtility.LANGUAGE_PATH, DEFAULT_LOCALE);
}
/**
* Convert a locale to its IETF BCP 47 string representation.
*
* @param language
* - The locale to be converted
*
* @return A String of the locale in IETF BCP 47 language tag representation
*/
public static final String toString(Locale language) {
return language.toLanguageTag();
}
/**
* Convert a language string in IETF BCP 47 representation to the correct corresponding locale.
*
* @param language
* - The string to be converted
*
* @return A Locale converted from the language string
*/
public static final Locale toLocale(String language) {
return Locale.forLanguageTag(language);
}
}
| src/main/java/org/dannil/httpdownloader/utility/LanguageUtility.java | package org.dannil.httpdownloader.utility;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* Class which handles operations on language bundles
*
* @author Daniel
*
*/
public final class LanguageUtility {
private static final Locale DEFAULT_LOCALE;
private static final List<Locale> availableLanguages;
static {
DEFAULT_LOCALE = new Locale("en", "US");
availableLanguages = new LinkedList<Locale>();
availableLanguages.add(new Locale("en", "US"));
availableLanguages.add(new Locale("sv", "SE"));
}
/**
* Private constructor to make the class a true singleton
*/
private LanguageUtility() {
throw new AssertionError();
}
/**
* Returns a bundle with the language which matches the users current display language.
* @return ResourceBundle with default language
*/
public static final ResourceBundle getLanguageBundle() {
return getLanguageBundle(Locale.getDefault());
}
/**
* Returns a bundle with the language which matches the inputed locale.
* If the language file doesn't exist, return a standard language (enUS).
* @param language
* - The language to load
* @return ResourceBundle with inputed locale
*/
public static final ResourceBundle getLanguageBundle(final Locale language) {
if (availableLanguages.contains(language)) {
return ResourceBundle.getBundle(PathUtility.LANGUAGE_PATH, language);
}
return ResourceBundle.getBundle(PathUtility.LANGUAGE_PATH, DEFAULT_LOCALE);
}
}
| Added conversion methods | src/main/java/org/dannil/httpdownloader/utility/LanguageUtility.java | Added conversion methods | <ide><path>rc/main/java/org/dannil/httpdownloader/utility/LanguageUtility.java
<ide> }
<ide>
<ide> /**
<del> * Private constructor to make the class a true singleton
<add> * Private constructor to make the class a singleton.
<ide> */
<ide> private LanguageUtility() {
<ide> throw new AssertionError();
<ide>
<ide> /**
<ide> * Returns a bundle with the language which matches the users current display language.
<add> *
<ide> * @return ResourceBundle with default language
<ide> */
<ide> public static final ResourceBundle getLanguageBundle() {
<ide> /**
<ide> * Returns a bundle with the language which matches the inputed locale.
<ide> * If the language file doesn't exist, return a standard language (enUS).
<add> *
<ide> * @param language
<ide> * - The language to load
<add> *
<ide> * @return ResourceBundle with inputed locale
<ide> */
<ide> public static final ResourceBundle getLanguageBundle(final Locale language) {
<ide> return ResourceBundle.getBundle(PathUtility.LANGUAGE_PATH, DEFAULT_LOCALE);
<ide> }
<ide>
<add> /**
<add> * Convert a locale to its IETF BCP 47 string representation.
<add> *
<add> * @param language
<add> * - The locale to be converted
<add> *
<add> * @return A String of the locale in IETF BCP 47 language tag representation
<add> */
<add> public static final String toString(Locale language) {
<add> return language.toLanguageTag();
<add> }
<add>
<add> /**
<add> * Convert a language string in IETF BCP 47 representation to the correct corresponding locale.
<add> *
<add> * @param language
<add> * - The string to be converted
<add> *
<add> * @return A Locale converted from the language string
<add> */
<add> public static final Locale toLocale(String language) {
<add> return Locale.forLanguageTag(language);
<add> }
<add>
<ide> } |
|
Java | lgpl-2.1 | 8065e10b76c55afdcd8d20e779db4a8dbb4890b3 | 0 | drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine,drhee/toxoMine | package org.intermine.web.logic.query;
/*
* Copyright (C) 2002-2011 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.intermine.api.bag.BagManager;
import org.intermine.api.bag.BagQueryConfig;
import org.intermine.api.config.ClassKeyHelper;
import org.intermine.api.profile.InterMineBag;
import org.intermine.api.profile.Profile;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
import org.intermine.metadata.ReferenceDescriptor;
import org.intermine.objectstore.ObjectStoreSummary;
import org.intermine.objectstore.query.BagConstraint;
import org.intermine.objectstore.query.ConstraintOp;
import org.intermine.objectstore.query.SimpleConstraint;
import org.intermine.pathquery.ConstraintValueParser;
import org.intermine.pathquery.Path;
import org.intermine.pathquery.PathConstraint;
import org.intermine.pathquery.PathConstraintAttribute;
import org.intermine.pathquery.PathConstraintBag;
import org.intermine.pathquery.PathConstraintLookup;
import org.intermine.pathquery.PathConstraintLoop;
import org.intermine.pathquery.PathConstraintMultiValue;
import org.intermine.pathquery.PathConstraintNull;
import org.intermine.pathquery.PathConstraintSubclass;
import org.intermine.pathquery.PathException;
import org.intermine.pathquery.PathQuery;
import org.intermine.template.SwitchOffAbility;
import org.intermine.util.StringUtil;
import org.intermine.web.autocompletion.AutoCompleter;
import org.intermine.web.logic.querybuilder.DisplayPath;
/**
* Representation of a PathQuery constraint for use by JSP pages. This object provides methods
* needed to populate constraint editing boxes and dropdowns, find available bag names, etc. Can
* either represent a new constraint to be added with no values set or an existing constraint that
* is being edited.
*
* Get methods return null if no values are available
*
* @author Richard Smith
*/
public class DisplayConstraint
{
private Path path;
private List<DisplayConstraintOption> validOps;
private AutoCompleter ac;
private ObjectStoreSummary oss;
private String endCls;
private String fieldName;
private BagQueryConfig bagQueryConfig;
private Map<String, List<FieldDescriptor>> classKeys;
private BagManager bagManager;
private Profile profile;
private String constraintLabel;
private List<DisplayConstraintOption> fixedOps;
private PathConstraint con;
private PathQuery query;
private String code;
private boolean editableInTemplate;
private SwitchOffAbility switchOffAbility;
private boolean isBagSelected;
private String selectedBagValue;
private ConstraintOp selectedBagOp;
private List<Object> templateSummary;
private boolean showExtraConstraint = false;
/**
* Construct for a new constraint that is being added to a query.
* @param path The path that is being constrained
* @param profile user editing the query, used to fetch available bags
* @param query the PathQuery, in order to provide information on candidate loops
* @param ac auto completer
* @param oss summary data for the ObjectStore contents
* @param bagQueryConfig addition details for needed for LOOKUP constraints
* @param classKeys identifier field config, needed for LOOKUP constraints
* @param bagManager provides access to saved bags
*/
protected DisplayConstraint(Path path, Profile profile, PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager) {
init(path, profile, query, ac, oss, bagQueryConfig, classKeys, bagManager);
}
/**
* Construct for an existing constraint that is being edited.
* @param path The path that is being constrained
* @param con the constraint being edited
* @param label text associated with this constraint, if a template query
* @param code the code of this constraint in the query
* @param editableInTemplate true if this is a template query and this constraint is editable
* @param switchOffAbility if the contraint is on, off, locked
* @param profile user editing the query, used to fetch available bags
* @param query the PathQuery, in order to provide information on candidate loops
* @param ac auto completer
* @param oss summary data for the ObjectStore contents
* @param bagQueryConfig addition details for needed for LOOKUP constraints
* @param classKeys identifier field config, needed for LOOKUP constraints
* @param bagManager provides access to saved bags
*/
protected DisplayConstraint(Path path, PathConstraint con, String label, String code,
boolean editableInTemplate, SwitchOffAbility switchOffAbility, Profile profile,
PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager,
List<Object> templateSummary) {
init(path, profile, query, ac, oss, bagQueryConfig, classKeys, bagManager);
this.con = con;
this.constraintLabel = label;
this.code = code;
this.editableInTemplate = editableInTemplate;
this.switchOffAbility = switchOffAbility;
this.templateSummary = templateSummary;
}
private void init(Path path, Profile profile, PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager) {
this.path = path;
this.ac = ac;
this.oss = oss;
this.endCls = getEndClass(path);
this.fieldName = getFieldName(path);
this.bagQueryConfig = bagQueryConfig;
this.classKeys = classKeys;
this.profile = profile;
this.query = query;
this.bagManager = bagManager;
this.isBagSelected = false;
if (isExtraConstraint()) {
this.showExtraConstraint = true;
}
}
private String getEndClass(Path path) {
if (path.isRootPath()) {
return path.getStartClassDescriptor().getType().getSimpleName();
} else {
return path.getLastClassDescriptor().getType().getSimpleName();
}
}
private String getFieldName(Path path) {
if (!path.isRootPath()) {
return path.getLastElement();
}
return null;
}
// TODO this should be in some common code
private String constraintStringValue(PathConstraint con) {
if (con instanceof PathConstraintAttribute) {
return ((PathConstraintAttribute) con).getValue();
} else if (con instanceof PathConstraintBag) {
return ((PathConstraintBag) con).getBag();
} else if (con instanceof PathConstraintLookup) {
return ((PathConstraintLookup) con).getValue();
} else if (con instanceof PathConstraintSubclass) {
return ((PathConstraintSubclass) con).getType();
} else if (con instanceof PathConstraintLoop) {
return ((PathConstraintLoop) con).getLoopPath();
} else if (con instanceof PathConstraintNull) {
return ((PathConstraintNull) con).getOp().toString();
}
return null;
}
/**
* If editing an existing constraint get the code for this constraint in the query, return null
* if creating a new constraint.
* @return the constraint code or null
*/
public String getCode() {
return code;
}
/**
* Return true if editing an existing template constraint and that constraint is editable.
* @return true if an editable template constraint, or null
*/
public boolean isEditableInTemplate() {
return editableInTemplate;
}
/**
* Get a representation of the path that is being constraint. DisplayPath provides convenience
* methods for use in JSP.
* @return the path being constrained
*/
public DisplayPath getPath() {
return new DisplayPath(path);
}
/**
* If editing an existing constraint, return the selected value. Otherwise return null. If
* an attribute constraint this will be the user entered. If a bag constraint, the selected
* bag name, etc. If an attribute constraint, but the use bag is setted, this will be the
* selectedBagValue setted
* @return the selected value or null
*/
public String getSelectedValue() {
if (isBagSelected) {
return selectedBagValue;
}
if (con != null) {
return constraintStringValue(con);
}
return null;
}
/**
*
*/
public String getOriginalValue() {
if (con != null) {
return constraintStringValue(con);
}
return null;
}
/**
* Returns the value collection if the constraint is a multivalue, otherwise return null.
*
* @return a Collection of Strings
*/
public Collection<String> getMultiValues() {
if (isMultiValueSelected()) {
return ((PathConstraintMultiValue) con).getValues();
}
return null;
}
/**
* If the constraint is a multivalue, returns the value collection
* represented as string separated by ', ', otherwise return an empty String.
*
* @return a String representing the multivalues of constraint
*/
public String getMultiValuesAsString() {
String multiValuesAsString = "";
if (getMultiValues() != null) {
for (String value : getMultiValues()) {
multiValuesAsString += value + ", ";
}
multiValuesAsString = multiValuesAsString.substring(0,
multiValuesAsString.lastIndexOf(","));
}
return multiValuesAsString;
}
/**
* Return true if editing an existing constraint and a bag has been selected.
* @return true if a bag has been selected
*/
public boolean isBagSelected() {
if (isBagSelected) {
return isBagSelected;
} else {
return (con != null && con instanceof PathConstraintBag);
}
}
/**
* Set if the bag is selected, used by the method isBagSelected that returns true,
* even if the constraint is an attribute constraint
* @param isBagSelected true if a bag has been selected
*/
public void setBagSelected(boolean isBagSelected) {
this.isBagSelected = isBagSelected;
}
/**
* Return true if editing an existing constraint and 'has a value' or 'has no value' has been
* selected.
* @return true if a null constraint was selected
*/
public boolean isNullSelected() {
return (con != null && con instanceof PathConstraintNull);
}
/**
* Return true if editing an existing having the attribute type boolean or Boolean
* @return true if the type is the primitive boolean or the object java.lang.Boolean
*/
public boolean isBoolean() {
String type = getPath().getType();
return ("boolean".equals(type) || "Boolean".equals(type));
}
/**
* Return true if editing an existing constraint and an attribute value or LOOKUP constraint
* was selected.
* @return true if an attribute/LOOKUP constraint was selected
*/
public boolean isValueSelected() {
if (con != null) {
return !(isBagSelected() || isNullSelected() || isLoopSelected());
}
return false;
}
/**
* Return true if editing an existing constraint and a loop value has been
* selected.
* @return true if a loop constraint was selected
*/
public boolean isLoopSelected() {
return (con != null && con instanceof PathConstraintLoop);
}
/**
* Return true if editing an existing constraint and a multivalue has been
* selected.
* @return true if a multivalue constraint was selected
*/
public boolean isMultiValueSelected() {
return (con != null && con instanceof PathConstraintMultiValue);
}
/**
* Return the last class in the path and fieldname as the title for the constraint.
* @return the title of this constraint
*/
public String getTitle() {
return endCls + (fieldName == null ? "" : " " + fieldName);
}
public String getEndClassName() {
return endCls;
}
/**
* Return the label associated with a constraint if editing a template query constraint.
* @return the constraint label
*/
public String getDescription() {
return constraintLabel;
}
/**
* Return a help message to display alongside the constraint, this will examine the constraint
* type and generate and appropriate message, e.g. list the key fields for LOOKUP constraints
* and explain the use of wildcards. Returns null when there is no appropriate help.
* @return the help message or null
*/
public String getHelpMessage() {
return DisplayConstraintHelpMessages.getHelpMessage(this);
}
/**
* If the bag is selected, return the value setted with the method setSelectedBagOp
* If editing an existing constraint return the operation used.
* Otherwise return null.
* @return the selected constraint op or null
*/
public DisplayConstraintOption getSelectedOp() {
if (isBagSelected) {
return new DisplayConstraintOption(selectedBagOp.toString(),
selectedBagOp.getIndex());
}
if (con != null) {
ConstraintOp selectedOp = con.getOp();
if (selectedOp != null) {
return new DisplayConstraintOption(selectedOp.toString(), selectedOp.getIndex());
}
}
return null;
}
/**
* Set the seletedBagOp
* @param selectedBagOp the constraint op returned by the method getSelectedOp()
* if the bag is selected
*/
public void setSelectedBagOp(ConstraintOp selectedBagOp) {
this.selectedBagOp = selectedBagOp;
}
/**
* Set the seletedBagValue returned bye the getSelectedValue if the bag is selected
* @param selectedBagValue string to set the selectedBagValue
*/
public void setSelectedBagValue(String selectedBagValue) {
this.selectedBagValue = selectedBagValue;
}
/**
* If editing an existing LOOKUP constraint return the value selected for the extra constraint
* field. Otherwise return null
* @return the LOOKUP constraint extra value or null
*/
public String getSelectedExtraValue() {
if (con instanceof PathConstraintLookup) {
return ((PathConstraintLookup) con).getExtraValue();
}
return null;
}
/**
* Given the path being constrained return the valid constraint operations. If constraining an
* attribute the valid ops depend on the type being constraint - String, Integer, Boolean, etc.
* @return the valid constraint operations
*/
public List<DisplayConstraintOption> getValidOps() {
if (validOps != null) {
return validOps;
}
validOps = new ArrayList<DisplayConstraintOption>();
if (con instanceof PathConstraintBag) {
for (ConstraintOp op : PathConstraintBag.VALID_OPS) {
validOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
} else if (con instanceof PathConstraintSubclass) {
return validOps;
} else if (con instanceof PathConstraintLoop) {
List<DisplayConstraintOption> loopQueryOps = getLoopQueryOps();
for (DisplayConstraintOption dco : loopQueryOps) {
validOps.add(dco);
}
} else if (path.endIsAttribute()) {
List<ConstraintOp> allOps = SimpleConstraint.validOps(path.getEndType());
// TODO This was in the constraint jsp:
// <c:if test="${!(editingNode.type == 'String' && (op.value == '<='
//|| op.value == '>='))}">
// TODO this should show different options if a dropdown is to be used
boolean existPossibleValues =
(getPossibleValues() != null && getPossibleValues().size() > 0) ? true : false;
for (ConstraintOp op : allOps) {
if (existPossibleValues
|| (!op.getIndex().equals(ConstraintOp.MATCHES.getIndex())
&& !op.getIndex().equals(ConstraintOp.DOES_NOT_MATCH.getIndex()))
) {
validOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
}
if (existPossibleValues) {
for (ConstraintOp op : PathConstraintMultiValue.VALID_OPS) {
validOps.add(new DisplayConstraintOption(op.toString(),
op.getIndex()));
}
}
} else if (isLookup()) {
// this must be a LOOKUP constraint
ConstraintOp lookup = ConstraintOp.LOOKUP;
validOps.add(new DisplayConstraintOption(lookup.toString(), lookup.getIndex()));
}
return validOps;
}
/**
* Returns the set of operators valid for loop constraints.
*
* @return a List of DisplayConstraintOption objects
*/
public List<DisplayConstraintOption> getLoopQueryOps() {
return Arrays.asList(new DisplayConstraintOption(ConstraintOp.EQUALS.toString(),
ConstraintOp.EQUALS.getIndex()),
new DisplayConstraintOption(ConstraintOp.NOT_EQUALS.toString(),
ConstraintOp.NOT_EQUALS.getIndex()));
}
/**
* Return true if this constraint should be a LOOKUP, true if constraining a class (ref/col)
* instead of an attribute and that class has class keys defined.
* @return true if this constraint should be a LOOKUP
*/
public boolean isLookup() {
return !path.endIsAttribute() && ClassKeyHelper.hasKeyFields(classKeys, endCls);
}
/**
* Return the LOOKUP constraint op.
* @return the LOOKUP constraint op
*/
// TOOO do we need this? validOps should contain correct value
public DisplayConstraintOption getLookupOp() {
ConstraintOp lookup = ConstraintOp.LOOKUP;
return new DisplayConstraintOption(lookup.toString(), lookup.getIndex());
}
/**
* Return the autocompleter for this path if one is available. Otherwise return null.
* @return an autocompleter for this path or null
*/
public AutoCompleter getAutoCompleter() {
if (ac != null && ac.hasAutocompleter(endCls, fieldName)) {
return ac;
}
return null;
}
/**
* Values to populate a dropdown for the path if possible values are available.
* @return possible values to populate a dropdown
*/
public List<Object> getPossibleValues() {
String className = "";
if (path.isRootPath()) {
className = path.getStartClassDescriptor().getType().getCanonicalName();
} else {
className = path.getLastClassDescriptor().getType().getCanonicalName();
}
// if this is a template, it may have been summarised so we have a restricted set if values
// for particular paths (the TemplateSummariser runs queries to work out exact values
// constraints could take given the other constraints in the query.
if (templateSummary != null && !templateSummary.isEmpty()) {
return templateSummary;
}
// otherwise, we may have possible values from the ObjectStoreSummary
List<Object> fieldValues = oss.getFieldValues(className, fieldName);
if (path.endIsAttribute()) {
Class<?> type = path.getEndType();
if (Date.class.equals(type)) {
List<Object> fieldValueFormatted = new ArrayList<Object>();
if (fieldValues != null) {
for (Object obj : fieldValues) {
fieldValueFormatted.add(ConstraintValueParser.format((String) obj));
}
}
return fieldValueFormatted;
}
}
return fieldValues;
}
/**
* If a dropdown is available for a constraint fewer operations are possible, return the list
* of operations.
* @return the constraint ops available when selecting values from a dropdown
*/
// TODO Do we need this, could getValildOps return the correct ops if a dropdown is available
public List<DisplayConstraintOption> getFixedOps() {
if (fixedOps != null) {
return fixedOps;
}
if (getPossibleValues() != null) {
fixedOps = new ArrayList<DisplayConstraintOption>();
for (ConstraintOp op : SimpleConstraint.fixedEnumOps(path.getEndType())) {
fixedOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
}
return fixedOps;
}
/**
* Return true if this is a LOOKUP constraint and an extra constraint should be available.
* @return true if an extra constraint option is available
*/
public boolean isExtraConstraint() {
if (isLookup() && bagQueryConfig != null) {
String extraValueFieldName = bagQueryConfig.getConnectField();
ClassDescriptor cld = (path.isRootPath()) ? path.getStartClassDescriptor()
: path.getLastClassDescriptor();
ReferenceDescriptor fd = cld.getReferenceDescriptorByName(extraValueFieldName, true);
return fd != null;
} else {
return false;
}
}
public boolean isShowExtraConstraint() {
return showExtraConstraint;
}
public void setShowExtraConstraint(boolean showExtraConstraint) {
this.showExtraConstraint = showExtraConstraint;
}
public String getExtraValueFieldClass() {
if (isExtraConstraint()) {
return bagQueryConfig.getExtraConstraintClassName();
}
return null;
}
/**
* If a LOOKUP constraint and an extra constraint is available for this path, return a list of
* the possible values for populating a dropdown. Otherwise return null.
* @return a list of possible extra constraint values
*/
public List<Object> getExtraConstraintValues() {
if (isExtraConstraint()) {
String extraValueFieldName = bagQueryConfig.getConstrainField();
return oss.getFieldValues(bagQueryConfig.getExtraConstraintClassName(),
extraValueFieldName);
}
return null;
}
/**
* If a LOOKUP constraint and an extra value constraint is available return the classname of
* the extra constraint so it can be displayed. Otherwise return null.
* @return the extra constraint class name or null
*/
public String getExtraConstraintClassName() {
if (isExtraConstraint()) {
String[] splitClassName = bagQueryConfig.getExtraConstraintClassName().split("[.]");
return splitClassName[splitClassName.length - 1];
//return bagQueryConfig.getExtraConstraintClassName();
}
return null;
}
/**
* Return the key fields for this path as a formatted string, for use in LOOKUP help message.
* @return a formatted string listing key fields for this path
*/
public String getKeyFields() {
if (ClassKeyHelper.hasKeyFields(classKeys, endCls)) {
return StringUtil.prettyList(ClassKeyHelper.getKeyFieldNames(classKeys, endCls), true);
}
return null;
}
/**
* Get a list of public and user bag names available and currentfor this path. If none available return
* null.
* @return a list of available bag names or null
*/
public List<String> getBags() {
if (ClassKeyHelper.hasKeyFields(classKeys, endCls)
&& !ClassKeyHelper.isKeyField(classKeys, endCls, fieldName)) {
Map<String, InterMineBag> bags =
bagManager.getCurrentUserOrGlobalBagsOfType(profile, endCls);
if (!bags.isEmpty()) {
List<String> bagList = new ArrayList<String>(bags.keySet());
Collections.sort(bagList);
return bagList;
}
}
return null;
}
/**
* Return the valid constraint ops when constraining on a bag.
* @return the possible bag constraint operations
*/
public List<DisplayConstraintOption> getBagOps() {
List<DisplayConstraintOption> bagOps = new ArrayList<DisplayConstraintOption>();
for (ConstraintOp op : BagConstraint.VALID_OPS) {
bagOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
return bagOps;
}
/**
* Returns the bag type that the constraint can be constrained to.
* If there aren't bags return null
*
* @return a String
*/
public String getBagType() {
if (getBags() != null) {
return endCls;
} else {
return null;
}
}
/**
* Returns the constraint type selected.
*
* @return a String representing the constraint type selected
*/
public String getSelectedConstraint() {
if (isBagSelected()) {
return "bag";
} else if (isNullSelected()) {
return "empty";
} else if (isLoopSelected()) {
return "loopQuery";
}
return "attribute";
}
/**
* Returns the set of paths that could feasibly be loop constrained onto the constraint's path,
* given the query's outer join situation. A candidate path must be a class path, of the same
* type, and in the same outer join group.
*
* @return a Set of String paths that could be loop joined
* @throws PathException if something goes wrong
*/
public Set<String> getCandidateLoops() throws PathException {
if (path.endIsAttribute()) {
return Collections.emptySet();
} else {
if (con instanceof PathConstraintLoop) {
Set<String> retval = new LinkedHashSet<String>();
retval.add(((PathConstraintLoop) con).getLoopPath());
retval.addAll(query.getCandidateLoops(path.getNoConstraintsString()));
return retval;
} else {
return query.getCandidateLoops(path.getNoConstraintsString());
}
}
}
/**
* Return true if the constraint is locked, it should'n be enabled or disabled.
* @return true if the constraint is locked
*/
public boolean isLocked() {
if (switchOffAbility == null || switchOffAbility == SwitchOffAbility.LOCKED) {
return true;
}
return false;
}
/**
* Return true if the constraint is enabled, false if it is disabled or locked.
* @return true if the constraint is enabled,false if it is disabled or locked
*/
public boolean isEnabled() {
if (switchOffAbility == SwitchOffAbility.ON) {
return true;
}
return false;
}
/**
* Return true if the constraint is disabled, false if it is enabled or locked.
* @return true if the constraint is disabled,false if it is enabled or locked
*/
public boolean isDisabled() {
if (switchOffAbility == SwitchOffAbility.OFF) {
return true;
}
return false;
}
/**
* Return the value on, off, locked depending on the constraint SwitchOffAbility .
* @return switchable property (on, off, locked)
*/
public String getSwitchable() {
if (SwitchOffAbility.ON.equals(switchOffAbility)) {
return SwitchOffAbility.ON.toString().toLowerCase();
} else if (SwitchOffAbility.OFF.equals(switchOffAbility)) {
return SwitchOffAbility.OFF.toString().toLowerCase();
} else {
return SwitchOffAbility.LOCKED.toString().toLowerCase();
}
}
/**
* Set the switchOffAbility
* @param switchOffAbility value
*/
public void setSwitchOffAbility(SwitchOffAbility switchOffAbility) {
this.switchOffAbility = switchOffAbility;
}
/**
* Return true if the input field can be displayed, method for use in JSP
* @return true if the input is displayed
*/
public boolean isInputFieldDisplayed() {
if (con != null) {
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.MATCHES.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_MATCH.getIndex()
|| selectedOperator == ConstraintOp.LOOKUP.getIndex()
|| selectedOperator == ConstraintOp.CONTAINS.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_CONTAIN.getIndex()) {
return true;
}
if (selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
if (con instanceof PathConstraintBag) {
return true;
}
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return false;
}
return true;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return false;
}
return true;
}
/**
* Return true if the drop-down containing the possibleValues can be displayed,
* method for use in JSP
* @return true if the drop-down is displayed
*/
public boolean isPossibleValuesDisplayed() {
if (con != null) {
if (getSelectedOp() == null) {
return false;
}
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.MATCHES.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_MATCH.getIndex()
|| selectedOperator == ConstraintOp.CONTAINS.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_CONTAIN.getIndex()
|| selectedOperator == ConstraintOp.LOOKUP.getIndex()
|| selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return true;
}
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return true;
}
return false;
}
/**
* Return true if the multi-select containing the possibleValue can be displayed,
* method for use in JSP
* @return true if the multi-select is displayed
*/
public boolean isMultiValuesDisplayed() {
if (con != null) {
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
return true;
}
return false;
} return false;
}
/**
* Representation of a constraint operation to populate a dropdown. Label is value to be
* displayed in the dropdown, property is the index of the constraint that will be selected.
* @author Richard Smith
*
*/
public class DisplayConstraintOption
{
private String label;
private Integer property;
/**
* Construct with the constraint lable and index
* @param label the value to be shown in dropdown
* @param property the constraint index to be added to form on selection
*/
public DisplayConstraintOption(String label, Integer property) {
this.label = label;
this.property = property;
}
/**
* Get the value to be displayed in the dropdown for this operation.
* @return the display value
*/
public String getLabel() {
return label;
}
/**
* Get the constraint index to be put in form when this op is selected.
* @return the constraint index
*/
public Integer getProperty() {
return property;
}
}
}
| intermine/web/main/src/org/intermine/web/logic/query/DisplayConstraint.java | package org.intermine.web.logic.query;
/*
* Copyright (C) 2002-2011 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.intermine.api.bag.BagManager;
import org.intermine.api.bag.BagQueryConfig;
import org.intermine.api.config.ClassKeyHelper;
import org.intermine.api.profile.InterMineBag;
import org.intermine.api.profile.Profile;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
import org.intermine.metadata.ReferenceDescriptor;
import org.intermine.objectstore.ObjectStoreSummary;
import org.intermine.objectstore.query.BagConstraint;
import org.intermine.objectstore.query.ConstraintOp;
import org.intermine.objectstore.query.SimpleConstraint;
import org.intermine.pathquery.ConstraintValueParser;
import org.intermine.pathquery.Path;
import org.intermine.pathquery.PathConstraint;
import org.intermine.pathquery.PathConstraintAttribute;
import org.intermine.pathquery.PathConstraintBag;
import org.intermine.pathquery.PathConstraintLookup;
import org.intermine.pathquery.PathConstraintLoop;
import org.intermine.pathquery.PathConstraintMultiValue;
import org.intermine.pathquery.PathConstraintNull;
import org.intermine.pathquery.PathConstraintSubclass;
import org.intermine.pathquery.PathException;
import org.intermine.pathquery.PathQuery;
import org.intermine.template.SwitchOffAbility;
import org.intermine.util.StringUtil;
import org.intermine.web.autocompletion.AutoCompleter;
import org.intermine.web.logic.querybuilder.DisplayPath;
/**
* Representation of a PathQuery constraint for use by JSP pages. This object provides methods
* needed to populate constraint editing boxes and dropdowns, find available bag names, etc. Can
* either represent a new constraint to be added with no values set or an existing constraint that
* is being edited.
*
* Get methods return null if no values are available
*
* @author Richard Smith
*/
public class DisplayConstraint
{
private Path path;
private List<DisplayConstraintOption> validOps;
private AutoCompleter ac;
private ObjectStoreSummary oss;
private String endCls;
private String fieldName;
private BagQueryConfig bagQueryConfig;
private Map<String, List<FieldDescriptor>> classKeys;
private BagManager bagManager;
private Profile profile;
private String constraintLabel;
private List<DisplayConstraintOption> fixedOps;
private PathConstraint con;
private PathQuery query;
private String code;
private boolean editableInTemplate;
private SwitchOffAbility switchOffAbility;
private boolean isBagSelected;
private String selectedBagValue;
private ConstraintOp selectedBagOp;
private List<Object> templateSummary;
private boolean showExtraConstraint = false;
/**
* Construct for a new constraint that is being added to a query.
* @param path The path that is being constrained
* @param profile user editing the query, used to fetch available bags
* @param query the PathQuery, in order to provide information on candidate loops
* @param ac auto completer
* @param oss summary data for the ObjectStore contents
* @param bagQueryConfig addition details for needed for LOOKUP constraints
* @param classKeys identifier field config, needed for LOOKUP constraints
* @param bagManager provides access to saved bags
*/
protected DisplayConstraint(Path path, Profile profile, PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager) {
init(path, profile, query, ac, oss, bagQueryConfig, classKeys, bagManager);
}
/**
* Construct for an existing constraint that is being edited.
* @param path The path that is being constrained
* @param con the constraint being edited
* @param label text associated with this constraint, if a template query
* @param code the code of this constraint in the query
* @param editableInTemplate true if this is a template query and this constraint is editable
* @param switchOffAbility if the contraint is on, off, locked
* @param profile user editing the query, used to fetch available bags
* @param query the PathQuery, in order to provide information on candidate loops
* @param ac auto completer
* @param oss summary data for the ObjectStore contents
* @param bagQueryConfig addition details for needed for LOOKUP constraints
* @param classKeys identifier field config, needed for LOOKUP constraints
* @param bagManager provides access to saved bags
*/
protected DisplayConstraint(Path path, PathConstraint con, String label, String code,
boolean editableInTemplate, SwitchOffAbility switchOffAbility, Profile profile,
PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager,
List<Object> templateSummary) {
init(path, profile, query, ac, oss, bagQueryConfig, classKeys, bagManager);
this.con = con;
this.constraintLabel = label;
this.code = code;
this.editableInTemplate = editableInTemplate;
this.switchOffAbility = switchOffAbility;
this.templateSummary = templateSummary;
}
private void init(Path path, Profile profile, PathQuery query, AutoCompleter ac,
ObjectStoreSummary oss, BagQueryConfig bagQueryConfig,
Map<String, List<FieldDescriptor>> classKeys, BagManager bagManager) {
this.path = path;
this.ac = ac;
this.oss = oss;
this.endCls = getEndClass(path);
this.fieldName = getFieldName(path);
this.bagQueryConfig = bagQueryConfig;
this.classKeys = classKeys;
this.profile = profile;
this.query = query;
this.bagManager = bagManager;
this.isBagSelected = false;
if (isExtraConstraint()) {
this.showExtraConstraint = true;
}
}
private String getEndClass(Path path) {
if (path.isRootPath()) {
return path.getStartClassDescriptor().getType().getSimpleName();
} else {
return path.getLastClassDescriptor().getType().getSimpleName();
}
}
private String getFieldName(Path path) {
if (!path.isRootPath()) {
return path.getLastElement();
}
return null;
}
// TODO this should be in some common code
private String constraintStringValue(PathConstraint con) {
if (con instanceof PathConstraintAttribute) {
return ((PathConstraintAttribute) con).getValue();
} else if (con instanceof PathConstraintBag) {
return ((PathConstraintBag) con).getBag();
} else if (con instanceof PathConstraintLookup) {
return ((PathConstraintLookup) con).getValue();
} else if (con instanceof PathConstraintSubclass) {
return ((PathConstraintSubclass) con).getType();
} else if (con instanceof PathConstraintLoop) {
return ((PathConstraintLoop) con).getLoopPath();
} else if (con instanceof PathConstraintNull) {
return ((PathConstraintNull) con).getOp().toString();
}
return null;
}
/**
* If editing an existing constraint get the code for this constraint in the query, return null
* if creating a new constraint.
* @return the constraint code or null
*/
public String getCode() {
return code;
}
/**
* Return true if editing an existing template constraint and that constraint is editable.
* @return true if an editable template constraint, or null
*/
public boolean isEditableInTemplate() {
return editableInTemplate;
}
/**
* Get a representation of the path that is being constraint. DisplayPath provides convenience
* methods for use in JSP.
* @return the path being constrained
*/
public DisplayPath getPath() {
return new DisplayPath(path);
}
/**
* If editing an existing constraint, return the selected value. Otherwise return null. If
* an attribute constraint this will be the user entered. If a bag constraint, the selected
* bag name, etc. If an attribute constraint, but the use bag is setted, this will be the
* selectedBagValue setted
* @return the selected value or null
*/
public String getSelectedValue() {
if (isBagSelected) {
return selectedBagValue;
}
if (con != null) {
return constraintStringValue(con);
}
return null;
}
/**
*
*/
public String getOriginalValue() {
if (con != null) {
return constraintStringValue(con);
}
return null;
}
/**
* Returns the value collection if the constraint is a multivalue, otherwise return null.
*
* @return a Collection of Strings
*/
public Collection<String> getMultiValues() {
if (isMultiValueSelected()) {
return ((PathConstraintMultiValue) con).getValues();
}
return null;
}
/**
* If the constraint is a multivalue, returns the value collection
* represented as string separated by ', ', otherwise return an empty String.
*
* @return a String representing the multivalues of constraint
*/
public String getMultiValuesAsString() {
String multiValuesAsString = "";
if (getMultiValues() != null) {
for (String value : getMultiValues()) {
multiValuesAsString += value + ", ";
}
multiValuesAsString = multiValuesAsString.substring(0,
multiValuesAsString.lastIndexOf(","));
}
return multiValuesAsString;
}
/**
* Return true if editing an existing constraint and a bag has been selected.
* @return true if a bag has been selected
*/
public boolean isBagSelected() {
if (isBagSelected) {
return isBagSelected;
} else {
return (con != null && con instanceof PathConstraintBag);
}
}
/**
* Set if the bag is selected, used by the method isBagSelected that returns true,
* even if the constraint is an attribute constraint
* @param isBagSelected true if a bag has been selected
*/
public void setBagSelected(boolean isBagSelected) {
this.isBagSelected = isBagSelected;
}
/**
* Return true if editing an existing constraint and 'has a value' or 'has no value' has been
* selected.
* @return true if a null constraint was selected
*/
public boolean isNullSelected() {
return (con != null && con instanceof PathConstraintNull);
}
/**
* Return true if editing an existing having the attribute type boolean or Boolean
* @return true if the type is the primitive boolean or the object java.lang.Boolean
*/
public boolean isBoolean() {
String type = getPath().getType();
return ("boolean".equals(type) || "Boolean".equals(type));
}
/**
* Return true if editing an existing constraint and an attribute value or LOOKUP constraint
* was selected.
* @return true if an attribute/LOOKUP constraint was selected
*/
public boolean isValueSelected() {
if (con != null) {
return !(isBagSelected() || isNullSelected() || isLoopSelected());
}
return false;
}
/**
* Return true if editing an existing constraint and a loop value has been
* selected.
* @return true if a loop constraint was selected
*/
public boolean isLoopSelected() {
return (con != null && con instanceof PathConstraintLoop);
}
/**
* Return true if editing an existing constraint and a multivalue has been
* selected.
* @return true if a multivalue constraint was selected
*/
public boolean isMultiValueSelected() {
return (con != null && con instanceof PathConstraintMultiValue);
}
/**
* Return the last class in the path and fieldname as the title for the constraint.
* @return the title of this constraint
*/
public String getTitle() {
return endCls + (fieldName == null ? "" : " " + fieldName);
}
public String getEndClassName() {
return endCls;
}
/**
* Return the label associated with a constraint if editing a template query constraint.
* @return the constraint label
*/
public String getDescription() {
return constraintLabel;
}
/**
* Return a help message to display alongside the constraint, this will examine the constraint
* type and generate and appropriate message, e.g. list the key fields for LOOKUP constraints
* and explain the use of wildcards. Returns null when there is no appropriate help.
* @return the help message or null
*/
public String getHelpMessage() {
return DisplayConstraintHelpMessages.getHelpMessage(this);
}
/**
* If the bag is selected, return the value setted with the method setSelectedBagOp
* If editing an existing constraint return the operation used.
* Otherwise return null.
* @return the selected constraint op or null
*/
public DisplayConstraintOption getSelectedOp() {
if (isBagSelected) {
return new DisplayConstraintOption(selectedBagOp.toString(),
selectedBagOp.getIndex());
}
if (con != null) {
ConstraintOp selectedOp = con.getOp();
if (selectedOp != null) {
return new DisplayConstraintOption(selectedOp.toString(), selectedOp.getIndex());
}
}
return null;
}
/**
* Set the seletedBagOp
* @param selectedBagOp the constraint op returned by the method getSelectedOp()
* if the bag is selected
*/
public void setSelectedBagOp(ConstraintOp selectedBagOp) {
this.selectedBagOp = selectedBagOp;
}
/**
* Set the seletedBagValue returned bye the getSelectedValue if the bag is selected
* @param selectedBagValue string to set the selectedBagValue
*/
public void setSelectedBagValue(String selectedBagValue) {
this.selectedBagValue = selectedBagValue;
}
/**
* If editing an existing LOOKUP constraint return the value selected for the extra constraint
* field. Otherwise return null
* @return the LOOKUP constraint extra value or null
*/
public String getSelectedExtraValue() {
if (con instanceof PathConstraintLookup) {
return ((PathConstraintLookup) con).getExtraValue();
}
return null;
}
/**
* Given the path being constrained return the valid constraint operations. If constraining an
* attribute the valid ops depend on the type being constraint - String, Integer, Boolean, etc.
* @return the valid constraint operations
*/
public List<DisplayConstraintOption> getValidOps() {
if (validOps != null) {
return validOps;
}
validOps = new ArrayList<DisplayConstraintOption>();
if (con instanceof PathConstraintBag) {
for (ConstraintOp op : PathConstraintBag.VALID_OPS) {
validOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
} else if (con instanceof PathConstraintSubclass) {
return validOps;
} else if (con instanceof PathConstraintLoop) {
List<DisplayConstraintOption> loopQueryOps = getLoopQueryOps();
for (DisplayConstraintOption dco : loopQueryOps) {
validOps.add(dco);
}
} else if (path.endIsAttribute()) {
List<ConstraintOp> allOps = SimpleConstraint.validOps(path.getEndType());
// TODO This was in the constraint jsp:
// <c:if test="${!(editingNode.type == 'String' && (op.value == '<='
//|| op.value == '>='))}">
// TODO this should show different options if a dropdown is to be used
boolean existPossibleValues =
(getPossibleValues() != null && getPossibleValues().size() > 0) ? true : false;
for (ConstraintOp op : allOps) {
if (existPossibleValues
|| (!op.getIndex().equals(ConstraintOp.MATCHES.getIndex())
&& !op.getIndex().equals(ConstraintOp.DOES_NOT_MATCH.getIndex()))
) {
validOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
}
if (existPossibleValues) {
for (ConstraintOp op : PathConstraintMultiValue.VALID_OPS) {
validOps.add(new DisplayConstraintOption(op.toString(),
op.getIndex()));
}
}
} else if (isLookup()) {
// this must be a LOOKUP constraint
ConstraintOp lookup = ConstraintOp.LOOKUP;
validOps.add(new DisplayConstraintOption(lookup.toString(), lookup.getIndex()));
}
return validOps;
}
/**
* Returns the set of operators valid for loop constraints.
*
* @return a List of DisplayConstraintOption objects
*/
public List<DisplayConstraintOption> getLoopQueryOps() {
return Arrays.asList(new DisplayConstraintOption(ConstraintOp.EQUALS.toString(),
ConstraintOp.EQUALS.getIndex()),
new DisplayConstraintOption(ConstraintOp.NOT_EQUALS.toString(),
ConstraintOp.NOT_EQUALS.getIndex()));
}
/**
* Return true if this constraint should be a LOOKUP, true if constraining a class (ref/col)
* instead of an attribute and that class has class keys defined.
* @return true if this constraint should be a LOOKUP
*/
public boolean isLookup() {
return !path.endIsAttribute() && ClassKeyHelper.hasKeyFields(classKeys, endCls);
}
/**
* Return the LOOKUP constraint op.
* @return the LOOKUP constraint op
*/
// TOOO do we need this? validOps should contain correct value
public DisplayConstraintOption getLookupOp() {
ConstraintOp lookup = ConstraintOp.LOOKUP;
return new DisplayConstraintOption(lookup.toString(), lookup.getIndex());
}
/**
* Return the autocompleter for this path if one is available. Otherwise return null.
* @return an autocompleter for this path or null
*/
public AutoCompleter getAutoCompleter() {
if (ac != null && ac.hasAutocompleter(endCls, fieldName)) {
return ac;
}
return null;
}
/**
* Values to populate a dropdown for the path if possible values are available.
* @return possible values to populate a dropdown
*/
public List<Object> getPossibleValues() {
String className = "";
if (path.isRootPath()) {
className = path.getStartClassDescriptor().getType().getCanonicalName();
} else {
className = path.getLastClassDescriptor().getType().getCanonicalName();
}
// if this is a template, it may have been summarised so we have a restricted set if values
// for particular paths (the TemplateSummariser runs queries to work out exact values
// constraints could take given the other constraints in the query.
if (templateSummary != null && !templateSummary.isEmpty()) {
return templateSummary;
}
// otherwise, we may have possible values from the ObjectStoreSummary
List<Object> fieldValues = oss.getFieldValues(className, fieldName);
if (path.endIsAttribute()) {
Class<?> type = path.getEndType();
if (Date.class.equals(type)) {
List<Object> fieldValueFormatted = new ArrayList<Object>();
for (Object obj : fieldValues) {
fieldValueFormatted.add(ConstraintValueParser.format((String) obj));
}
return fieldValueFormatted;
}
}
return fieldValues;
}
/**
* If a dropdown is available for a constraint fewer operations are possible, return the list
* of operations.
* @return the constraint ops available when selecting values from a dropdown
*/
// TODO Do we need this, could getValildOps return the correct ops if a dropdown is available
public List<DisplayConstraintOption> getFixedOps() {
if (fixedOps != null) {
return fixedOps;
}
if (getPossibleValues() != null) {
fixedOps = new ArrayList<DisplayConstraintOption>();
for (ConstraintOp op : SimpleConstraint.fixedEnumOps(path.getEndType())) {
fixedOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
}
return fixedOps;
}
/**
* Return true if this is a LOOKUP constraint and an extra constraint should be available.
* @return true if an extra constraint option is available
*/
public boolean isExtraConstraint() {
if (isLookup() && bagQueryConfig != null) {
String extraValueFieldName = bagQueryConfig.getConnectField();
ClassDescriptor cld = (path.isRootPath()) ? path.getStartClassDescriptor()
: path.getLastClassDescriptor();
ReferenceDescriptor fd = cld.getReferenceDescriptorByName(extraValueFieldName, true);
return fd != null;
} else {
return false;
}
}
public boolean isShowExtraConstraint() {
return showExtraConstraint;
}
public void setShowExtraConstraint(boolean showExtraConstraint) {
this.showExtraConstraint = showExtraConstraint;
}
public String getExtraValueFieldClass() {
if (isExtraConstraint()) {
return bagQueryConfig.getExtraConstraintClassName();
}
return null;
}
/**
* If a LOOKUP constraint and an extra constraint is available for this path, return a list of
* the possible values for populating a dropdown. Otherwise return null.
* @return a list of possible extra constraint values
*/
public List<Object> getExtraConstraintValues() {
if (isExtraConstraint()) {
String extraValueFieldName = bagQueryConfig.getConstrainField();
return oss.getFieldValues(bagQueryConfig.getExtraConstraintClassName(),
extraValueFieldName);
}
return null;
}
/**
* If a LOOKUP constraint and an extra value constraint is available return the classname of
* the extra constraint so it can be displayed. Otherwise return null.
* @return the extra constraint class name or null
*/
public String getExtraConstraintClassName() {
if (isExtraConstraint()) {
String[] splitClassName = bagQueryConfig.getExtraConstraintClassName().split("[.]");
return splitClassName[splitClassName.length - 1];
//return bagQueryConfig.getExtraConstraintClassName();
}
return null;
}
/**
* Return the key fields for this path as a formatted string, for use in LOOKUP help message.
* @return a formatted string listing key fields for this path
*/
public String getKeyFields() {
if (ClassKeyHelper.hasKeyFields(classKeys, endCls)) {
return StringUtil.prettyList(ClassKeyHelper.getKeyFieldNames(classKeys, endCls), true);
}
return null;
}
/**
* Get a list of public and user bag names available and currentfor this path. If none available return
* null.
* @return a list of available bag names or null
*/
public List<String> getBags() {
if (ClassKeyHelper.hasKeyFields(classKeys, endCls)
&& !ClassKeyHelper.isKeyField(classKeys, endCls, fieldName)) {
Map<String, InterMineBag> bags =
bagManager.getCurrentUserOrGlobalBagsOfType(profile, endCls);
if (!bags.isEmpty()) {
List<String> bagList = new ArrayList<String>(bags.keySet());
Collections.sort(bagList);
return bagList;
}
}
return null;
}
/**
* Return the valid constraint ops when constraining on a bag.
* @return the possible bag constraint operations
*/
public List<DisplayConstraintOption> getBagOps() {
List<DisplayConstraintOption> bagOps = new ArrayList<DisplayConstraintOption>();
for (ConstraintOp op : BagConstraint.VALID_OPS) {
bagOps.add(new DisplayConstraintOption(op.toString(), op.getIndex()));
}
return bagOps;
}
/**
* Returns the bag type that the constraint can be constrained to.
* If there aren't bags return null
*
* @return a String
*/
public String getBagType() {
if (getBags() != null) {
return endCls;
} else {
return null;
}
}
/**
* Returns the constraint type selected.
*
* @return a String representing the constraint type selected
*/
public String getSelectedConstraint() {
if (isBagSelected()) {
return "bag";
} else if (isNullSelected()) {
return "empty";
} else if (isLoopSelected()) {
return "loopQuery";
}
return "attribute";
}
/**
* Returns the set of paths that could feasibly be loop constrained onto the constraint's path,
* given the query's outer join situation. A candidate path must be a class path, of the same
* type, and in the same outer join group.
*
* @return a Set of String paths that could be loop joined
* @throws PathException if something goes wrong
*/
public Set<String> getCandidateLoops() throws PathException {
if (path.endIsAttribute()) {
return Collections.emptySet();
} else {
if (con instanceof PathConstraintLoop) {
Set<String> retval = new LinkedHashSet<String>();
retval.add(((PathConstraintLoop) con).getLoopPath());
retval.addAll(query.getCandidateLoops(path.getNoConstraintsString()));
return retval;
} else {
return query.getCandidateLoops(path.getNoConstraintsString());
}
}
}
/**
* Return true if the constraint is locked, it should'n be enabled or disabled.
* @return true if the constraint is locked
*/
public boolean isLocked() {
if (switchOffAbility == null || switchOffAbility == SwitchOffAbility.LOCKED) {
return true;
}
return false;
}
/**
* Return true if the constraint is enabled, false if it is disabled or locked.
* @return true if the constraint is enabled,false if it is disabled or locked
*/
public boolean isEnabled() {
if (switchOffAbility == SwitchOffAbility.ON) {
return true;
}
return false;
}
/**
* Return true if the constraint is disabled, false if it is enabled or locked.
* @return true if the constraint is disabled,false if it is enabled or locked
*/
public boolean isDisabled() {
if (switchOffAbility == SwitchOffAbility.OFF) {
return true;
}
return false;
}
/**
* Return the value on, off, locked depending on the constraint SwitchOffAbility .
* @return switchable property (on, off, locked)
*/
public String getSwitchable() {
if (SwitchOffAbility.ON.equals(switchOffAbility)) {
return SwitchOffAbility.ON.toString().toLowerCase();
} else if (SwitchOffAbility.OFF.equals(switchOffAbility)) {
return SwitchOffAbility.OFF.toString().toLowerCase();
} else {
return SwitchOffAbility.LOCKED.toString().toLowerCase();
}
}
/**
* Set the switchOffAbility
* @param switchOffAbility value
*/
public void setSwitchOffAbility(SwitchOffAbility switchOffAbility) {
this.switchOffAbility = switchOffAbility;
}
/**
* Return true if the input field can be displayed, method for use in JSP
* @return true if the input is displayed
*/
public boolean isInputFieldDisplayed() {
if (con != null) {
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.MATCHES.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_MATCH.getIndex()
|| selectedOperator == ConstraintOp.LOOKUP.getIndex()
|| selectedOperator == ConstraintOp.CONTAINS.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_CONTAIN.getIndex()) {
return true;
}
if (selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
if (con instanceof PathConstraintBag) {
return true;
}
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return false;
}
return true;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return false;
}
return true;
}
/**
* Return true if the drop-down containing the possibleValues can be displayed,
* method for use in JSP
* @return true if the drop-down is displayed
*/
public boolean isPossibleValuesDisplayed() {
if (con != null) {
if (getSelectedOp() == null) {
return false;
}
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.MATCHES.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_MATCH.getIndex()
|| selectedOperator == ConstraintOp.CONTAINS.getIndex()
|| selectedOperator == ConstraintOp.DOES_NOT_CONTAIN.getIndex()
|| selectedOperator == ConstraintOp.LOOKUP.getIndex()
|| selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return true;
}
return false;
}
if (getPossibleValues() != null && getPossibleValues().size() > 0) {
return true;
}
return false;
}
/**
* Return true if the multi-select containing the possibleValue can be displayed,
* method for use in JSP
* @return true if the multi-select is displayed
*/
public boolean isMultiValuesDisplayed() {
if (con != null) {
int selectedOperator = getSelectedOp().getProperty();
if (selectedOperator == ConstraintOp.ONE_OF.getIndex()
|| selectedOperator == ConstraintOp.NONE_OF.getIndex()) {
return true;
}
return false;
} return false;
}
/**
* Representation of a constraint operation to populate a dropdown. Label is value to be
* displayed in the dropdown, property is the index of the constraint that will be selected.
* @author Richard Smith
*
*/
public class DisplayConstraintOption
{
private String label;
private Integer property;
/**
* Construct with the constraint lable and index
* @param label the value to be shown in dropdown
* @param property the constraint index to be added to form on selection
*/
public DisplayConstraintOption(String label, Integer property) {
this.label = label;
this.property = property;
}
/**
* Get the value to be displayed in the dropdown for this operation.
* @return the display value
*/
public String getLabel() {
return label;
}
/**
* Get the constraint index to be put in form when this op is selected.
* @return the constraint index
*/
public Integer getProperty() {
return property;
}
}
}
| Fixed a bug that did't allow to add a new constraint, with type Date, on the queryBuilder page
Former-commit-id: 69af0ba1ca77cbde2380448508cc08abac88ef65 | intermine/web/main/src/org/intermine/web/logic/query/DisplayConstraint.java | Fixed a bug that did't allow to add a new constraint, with type Date, on the queryBuilder page | <ide><path>ntermine/web/main/src/org/intermine/web/logic/query/DisplayConstraint.java
<ide> Class<?> type = path.getEndType();
<ide> if (Date.class.equals(type)) {
<ide> List<Object> fieldValueFormatted = new ArrayList<Object>();
<del> for (Object obj : fieldValues) {
<del> fieldValueFormatted.add(ConstraintValueParser.format((String) obj));
<add> if (fieldValues != null) {
<add> for (Object obj : fieldValues) {
<add> fieldValueFormatted.add(ConstraintValueParser.format((String) obj));
<add> }
<ide> }
<ide> return fieldValueFormatted;
<ide> } |
|
Java | lgpl-2.1 | 51d77f360ade5fe8f9ca9805381b49f3f447b320 | 0 | julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine,julie-sullivan/phytomine | package org.intermine.web.logic.config;
/*
* Copyright (C) 2002-2014 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.util.ArrayList;
import java.util.List;
import org.intermine.metadata.AttributeDescriptor;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
/**
* Helper methods for the FieldConfig class.
*
* @author Kim Rutherford
*/
public final class FieldConfigHelper
{
private FieldConfigHelper() {
// Hidden constructor.
}
/**
* Find the FieldConfig objects for the the given ClassDescriptor (or generate them).
* @param webConfig the WebConfig object for this webapp
* @param cd a ClassDescriptor
* @return the FieldConfig objects for the the given ClassDescriptor
*/
public static List<FieldConfig> getClassFieldConfigs(WebConfig webConfig, ClassDescriptor cd) {
if (webConfig == null) {
throw new NullPointerException("webConfig must not be null");
}
if (cd == null) {
throw new NullPointerException("class descriptor 'cd' must not be null");
}
Type type = webConfig.getTypes().get(cd.getName());
List<FieldConfig> fieldConfigs = null;
if (type != null) {
fieldConfigs = new ArrayList<FieldConfig>(type.getFieldConfigs());
if (fieldConfigs.size() > 0) {
return fieldConfigs;
}
}
// do not return EMPTY_LIST, construct a FieldConfig much like WebConfig would do
fieldConfigs = new ArrayList<FieldConfig>();
for (AttributeDescriptor ad : cd.getAllAttributeDescriptors()) {
String attrName = ad.getName();
// skip database ID, hardcode
if (!"id".equals(attrName)) {
FieldConfig fc = new FieldConfig();
fc.setShowInInlineCollection(true);
fc.setShowInResults(true);
fc.setFieldExpr(attrName);
fc.setClassConfig(type);
fieldConfigs.add(fc);
}
}
return fieldConfigs;
}
/**
* Get a field config object for a particular descriptor.
* @param webConfig The configuration.
* @param fd The field metadata.
* @return The configuration for this field.
*/
public static FieldConfig getFieldConfig(WebConfig webConfig, FieldDescriptor fd) {
ClassDescriptor cld = fd.getClassDescriptor();
return getFieldConfig(webConfig, cld, fd);
}
/**
* Get a field config object for a particular descriptor.
* @param webConfig The configuration.
* @param fd The field metadata.
* @param cld The class this field belongs to.
* @return The configuration for this field.
*/
public static FieldConfig getFieldConfig(
WebConfig webConfig,
ClassDescriptor cld,
FieldDescriptor fd) {
List<FieldConfig> fcs = getClassFieldConfigs(webConfig, cld);
for (FieldConfig fc: fcs) {
if (fc == null) {
continue;
}
String fieldExpr = fc.getFieldExpr();
if (fieldExpr != null && fieldExpr.equals(fd.getName())) {
return fc;
}
}
// Now search the parents...
for (ClassDescriptor parent: cld.getSuperDescriptors()) {
FieldConfig fc = getFieldConfig(webConfig, parent, fd);
if (fc != null) {
return fc;
}
}
return null;
}
}
| intermine/web/main/src/org/intermine/web/logic/config/FieldConfigHelper.java | package org.intermine.web.logic.config;
/*
* Copyright (C) 2002-2014 FlyMine
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. See the LICENSE file for more
* information or http://www.gnu.org/copyleft/lesser.html.
*
*/
import java.util.ArrayList;
import java.util.List;
import org.intermine.metadata.AttributeDescriptor;
import org.intermine.metadata.ClassDescriptor;
import org.intermine.metadata.FieldDescriptor;
/**
* Helper methods for the FieldConfig class.
*
* @author Kim Rutherford
*/
public final class FieldConfigHelper
{
private FieldConfigHelper() {
// Hidden constructor.
}
/**
* Find the FieldConfig objects for the the given ClassDescriptor (or generate them).
* @param webConfig the WebConfig object for this webapp
* @param cd a ClassDescriptor
* @return the FieldConfig objects for the the given ClassDescriptor
*/
public static List<FieldConfig> getClassFieldConfigs(WebConfig webConfig, ClassDescriptor cd) {
Type type = webConfig.getTypes().get(cd.getName());
List<FieldConfig> fieldConfigs = null;
if (type != null) {
fieldConfigs = new ArrayList<FieldConfig>(type.getFieldConfigs());
if (fieldConfigs.size() > 0) {
return fieldConfigs;
}
}
// do not return EMPTY_LIST, construct a FieldConfig much like WebConfig would do
fieldConfigs = new ArrayList<FieldConfig>();
for (AttributeDescriptor ad : cd.getAllAttributeDescriptors()) {
String attrName = ad.getName();
// skip database ID, hardcode
if (!"id".equals(attrName)) {
FieldConfig fc = new FieldConfig();
fc.setShowInInlineCollection(true);
fc.setShowInResults(true);
fc.setFieldExpr(attrName);
fc.setClassConfig(type);
fieldConfigs.add(fc);
}
}
return fieldConfigs;
}
/**
* Get a field config object for a particular descriptor.
* @param webConfig The configuration.
* @param fd The field metadata.
* @return The configuration for this field.
*/
public static FieldConfig getFieldConfig(WebConfig webConfig, FieldDescriptor fd) {
ClassDescriptor cld = fd.getClassDescriptor();
return getFieldConfig(webConfig, cld, fd);
}
/**
* Get a field config object for a particular descriptor.
* @param webConfig The configuration.
* @param fd The field metadata.
* @param cld The class this field belongs to.
* @return The configuration for this field.
*/
public static FieldConfig getFieldConfig(
WebConfig webConfig,
ClassDescriptor cld,
FieldDescriptor fd) {
List<FieldConfig> fcs = getClassFieldConfigs(webConfig, cld);
for (FieldConfig fc: fcs) {
if (fc == null) {
continue;
}
String fieldExpr = fc.getFieldExpr();
if (fieldExpr != null && fieldExpr.equals(fd.getName())) {
return fc;
}
}
// Now search the parents...
for (ClassDescriptor parent: cld.getSuperDescriptors()) {
FieldConfig fc = getFieldConfig(webConfig, parent, fd);
if (fc != null) {
return fc;
}
}
return null;
}
}
| Added some safety checks
Former-commit-id: 3eaf1c9afab064ae43cd288633c6740eeb4358c5 | intermine/web/main/src/org/intermine/web/logic/config/FieldConfigHelper.java | Added some safety checks | <ide><path>ntermine/web/main/src/org/intermine/web/logic/config/FieldConfigHelper.java
<ide> * @return the FieldConfig objects for the the given ClassDescriptor
<ide> */
<ide> public static List<FieldConfig> getClassFieldConfigs(WebConfig webConfig, ClassDescriptor cd) {
<add> if (webConfig == null) {
<add> throw new NullPointerException("webConfig must not be null");
<add> }
<add> if (cd == null) {
<add> throw new NullPointerException("class descriptor 'cd' must not be null");
<add> }
<ide> Type type = webConfig.getTypes().get(cd.getName());
<ide> List<FieldConfig> fieldConfigs = null;
<ide> |
|
Java | apache-2.0 | 88e59b35cd13f3bb5f59e05f36cd7d664b083adc | 0 | pepstock-org/Charba,pepstock-org/Charba,pepstock-org/Charba | /**
Copyright 2017 Andrea "Stock" Stocchero
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.
*/
package org.pepstock.charba.client.enums;
import org.pepstock.charba.client.commons.Key;
/**
* An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.<br>
* To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.<br>
* To position the axis at the center of the chart area, set the position option to 'center'.<br>
* In this mode, either the axis option is specified or the axis ID starts with the letter 'x' or 'y'.<br>
* To position the axis with respect to a data value, set the position option to an object such as <code>-20</code>.<br>
* This will position the axis at a value of -20 on the axis with ID "x".<br>
* For cartesian axes, only 1 axis may be specified.
*
* @author Andrea "Stock" Stocchero
*/
public enum AxisPosition implements Key
{
/**
* Sets the edge of an axis to a unit center to its normal position.
*/
CENTER("center"),
/**
* Sets the edge of an axis to a unit above to its normal position.
*/
TOP("top"),
/**
* Sets the edge of an axis to a unit to the left to to its normal position.
*/
LEFT("left"),
/**
* Sets the edge of an axis to a unit below its normal position.
*/
BOTTOM("bottom"),
/**
* Sets the edge of an axis to a unit to the right to its normal position.
*/
RIGHT("right"),
/**
* Sets the edge of an axis to a unit to the chart area to its normal position.
*/
CHART_AREA("chartArea");
// name value of property
private final String value;
/**
* Creates with the property value to use in the native object.
*
* @param value value of property name
*/
private AxisPosition(String value) {
this.value = value;
}
/*
* (non-Javadoc)
*
* @see org.pepstock.charba.client.commons.Key#value()
*/
@Override
public String value() {
return value;
}
} | src/org/pepstock/charba/client/enums/AxisPosition.java | /**
Copyright 2017 Andrea "Stock" Stocchero
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.
*/
package org.pepstock.charba.client.enums;
import org.pepstock.charba.client.commons.Key;
/**
* An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.<br>
* To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.<br>
* To position the axis at the center of the chart area, set the position option to 'center'.<br>
* In this mode, either the axis option is specified or the axis ID starts with the letter 'x' or 'y'.<br>
* To position the axis with respect to a data value, set the position option to an object such as <code>-20</code>.<br>
* This will position the axis at a value of -20 on the axis with ID "x".<br>
* For cartesian axes, only 1 axis may be specified.
*
* @author Andrea "Stock" Stocchero
*/
public enum AxisPosition implements Key
{
/**
* the bottom property sets the bottom edge of an axis to a unit above/below its normal position.
*/
CENTER("center"),
/**
* The top property sets the top edge of an axis to a unit above/below its normal position.
*/
TOP("top"),
/**
* the left property sets the left edge of an axis to a unit to the left/right to its normal position.
*/
LEFT("left"),
/**
* the bottom property sets the bottom edge of an axis to a unit above/below its normal position.
*/
BOTTOM("bottom"),
/**
* the right property sets the right edge of an axis to a unit to the left/right to its normal position.
*/
RIGHT("right");
// name value of property
private final String value;
/**
* Creates with the property value to use in the native object.
*
* @param value value of property name
*/
private AxisPosition(String value) {
this.value = value;
}
/*
* (non-Javadoc)
*
* @see org.pepstock.charba.client.commons.Key#value()
*/
@Override
public String value() {
return value;
}
} | adds chartArea item to axis position enumeration | src/org/pepstock/charba/client/enums/AxisPosition.java | adds chartArea item to axis position enumeration | <ide><path>rc/org/pepstock/charba/client/enums/AxisPosition.java
<ide> public enum AxisPosition implements Key
<ide> {
<ide> /**
<del> * the bottom property sets the bottom edge of an axis to a unit above/below its normal position.
<add> * Sets the edge of an axis to a unit center to its normal position.
<ide> */
<ide> CENTER("center"),
<ide> /**
<del> * The top property sets the top edge of an axis to a unit above/below its normal position.
<add> * Sets the edge of an axis to a unit above to its normal position.
<ide> */
<ide> TOP("top"),
<ide> /**
<del> * the left property sets the left edge of an axis to a unit to the left/right to its normal position.
<add> * Sets the edge of an axis to a unit to the left to to its normal position.
<ide> */
<ide> LEFT("left"),
<ide> /**
<del> * the bottom property sets the bottom edge of an axis to a unit above/below its normal position.
<add> * Sets the edge of an axis to a unit below its normal position.
<ide> */
<ide> BOTTOM("bottom"),
<ide> /**
<del> * the right property sets the right edge of an axis to a unit to the left/right to its normal position.
<add> * Sets the edge of an axis to a unit to the right to its normal position.
<ide> */
<del> RIGHT("right");
<add> RIGHT("right"),
<add> /**
<add> * Sets the edge of an axis to a unit to the chart area to its normal position.
<add> */
<add> CHART_AREA("chartArea");
<ide>
<ide> // name value of property
<ide> private final String value; |
|
JavaScript | apache-2.0 | 2bcf00a41f7326ea501d5cbef01453e11f69df3c | 0 | MarxGo/containerops,xiechuanj/containerops,SixGodHuang/containerops,xcheng1982/containerops,viviXie/containerops,viviXie/containerops,victorwangyang/containerops,SixGodHuang/containerops,xcheng1982/containerops,MarxGo/containerops,MarxGo/containerops,haiheipijuan/containerops,xcheng1982/containerops,xiechuanj/containerops,xiechuanj/containerops,MarxGo/containerops,xcheng1982/containerops,haiheipijuan/containerops,MarxGo/containerops,xiechuanj/containerops,yongjingzheng/containerops,haiheipijuan/containerops,yongjingzheng/containerops,xcheng1982/containerops,xiechuanj/containerops,SixGodHuang/containerops,victorwangyang/containerops,viviXie/containerops,haiheipijuan/containerops,victorwangyang/containerops,SixGodHuang/containerops,victorwangyang/containerops,haiheipijuan/containerops,viviXie/containerops,SixGodHuang/containerops,haiheipijuan/containerops,xiechuanj/containerops,viviXie/containerops,xcheng1982/containerops,yongjingzheng/containerops,yongjingzheng/containerops,SixGodHuang/containerops,MarxGo/containerops,viviXie/containerops,victorwangyang/containerops,yongjingzheng/containerops,yongjingzheng/containerops | // Simple yet flexible JSON editor plugin.
// Turns any element into a stylable interactive JSON editor.
// Copyright (c) 2013 David Durman
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
// Dependencies:
// * jQuery
// * JSON (use json2 library for browsers that do not support JSON natively)
// Example:
// var myjson = { any: { json: { value: 1 } } };
// var opt = { change: function() { /* called on every change */ } };
// /* opt.propertyElement = '<textarea>'; */ // element of the property field, <input> is default
// /* opt.valueElement = '<textarea>'; */ // element of the value field, <input> is default
// $('#mydiv').jsonEditor(myjson, opt);
import {ContextMenu} from "./jquery.jsoneditor.menu";
import * as startIO from "../app/stage/startIO";
import * as actionIO from "../app/action/actionIO";
import * as componentIO from "../app/component/componentIO";
let from;
var items = [];
items.push({
text: 'Type',
title: 'Change the type of this field',
className: 'jsoneditor-type-',
submenu: [
{
text: 'Array',
className: 'jsoneditor-type-array',
title: "titles.array",
click: function (button,opt) {
changeType('array',button,opt);
}
},
{
text: 'Object',
className: 'jsoneditor-type-object',
title: "titles.object",
click: function (button,opt) {
changeType('object',button,opt);
}
},
{
text: 'String',
className: 'jsoneditor-type-string',
title: "titles.string",
click: function (button,opt) {
changeType('string',button,opt);
}
},
{
text: 'Boolean',
className: 'jsoneditor-type-boolean',
title: "titles.boolean",
click: function (button,opt) {
changeType('boolean',button,opt);
}
},
{
text: 'Number',
className: 'jsoneditor-type-number',
title: "titles.number",
click: function (button,opt) {
changeType('number',button,opt);
}
}
]
});
items.push({
text: 'ValueType',
title: 'Change the type of value',
className: 'jsoneditor-type-',
submenu: [
{
text: 'Changeable',
className: 'jsoneditor-value-change',
title: "titles.changeable",
click: function (button,opt) {
changeValueType("changeable",button,opt);
}
},
{
text: 'Unchangeable',
className: 'jsoneditor-value-unchange',
title: "titles.unchangeable",
click: function (button,opt) {
changeValueType("unchangeable",button,opt);
}
}
]
});
items.push({
text: 'Remove',
title: 'Remove this field (Ctrl+Del)',
className: 'jsoneditor-remove',
click: function (button,opt) {
removeItem(button,opt);
}
});
export function jsonEditor (container,json, options,caller) {
from = caller;
options = options || {};
// Make sure functions or other non-JSON data types are stripped down.
json = parse(stringify(json));
var K = function() {};
var onchange = options.change || K;
var onpropertyclick = options.propertyclick || K;
return container.each(function() {
JSONEditorInit(container, json, onchange, onpropertyclick, options.propertyElement, options.valueElement);
});
};
function JSONEditorInit(target, json, onchange, onpropertyclick, propertyElement, valueElement) {
var opt = {
target: target,
onchange: onchange,
onpropertyclick: onpropertyclick,
original: json,
propertyElement: propertyElement,
valueElement: valueElement
};
construct(opt, json, opt.target);
$(opt.target).on('blur focus', '.property, .value', function() {
$(this).toggleClass('editing');
});
}
function isObject(o) { return Object.prototype.toString.call(o) == '[object Object]'; }
function isArray(o) { return Object.prototype.toString.call(o) == '[object Array]'; }
function isBoolean(o) { return Object.prototype.toString.call(o) == '[object Boolean]'; }
function isNumber(o) { return Object.prototype.toString.call(o) == '[object Number]'; }
function isString(o) { return Object.prototype.toString.call(o) == '[object String]'; }
var types = 'object array boolean number string null';
// Feeds object `o` with `value` at `path`. If value argument is omitted,
// object at `path` will be deleted from `o`.
// Example:
// feed({}, 'foo.bar.baz', 10); // returns { foo: { bar: { baz: 10 } } }
function feed(o, path, value) {
var del = arguments.length == 2;
if (path.indexOf('.') > -1) {
var diver = o,
i = 0,
parts = path.split('.');
for (var len = parts.length; i < len - 1; i++) {
diver = diver[parts[i]];
}
if (del) delete diver[parts[len - 1]];
else diver[parts[len - 1]] = value;
} else {
if (del) delete o[path];
else o[path] = value;
}
return o;
}
// Get a property by path from object o if it exists. If not, return defaultValue.
// Example:
// def({ foo: { bar: 5 } }, 'foo.bar', 100); // returns 5
// def({ foo: { bar: 5 } }, 'foo.baz', 100); // returns 100
function def(o, path, defaultValue) {
path = path.split('.');
var i = 0;
while (i < path.length) {
if ((o = o[path[i++]]) == undefined) return defaultValue;
}
return o;
}
function error(reason) { if (window.console) { console.error(reason); } }
function parse(str) {
var res;
try { res = JSON.parse(str); }
catch (e) { res = null; error('JSON parse failed.'); }
return res;
}
function stringify(obj) {
var res;
try { res = JSON.stringify(obj); }
catch (e) { res = 'null'; error('JSON stringify failed.'); }
return res;
}
function addMenu(item,opt){
if (item.children('.menuer').length == 0) {
var menuer = $('<span>', { 'class': 'menuer fa fa-navicon' });
menuer.bind('click', function() {
window.event.stopPropagation();
ContextMenu($(this),items,opt);
});
item.prepend(menuer);
}
}
function removeItem (button,opt){
// var menuButton = button.parents(".item").find(".menuer");
var item = button.parents(".item:eq(0)");
item.find(">.property").val("").change();
item.remove();
if(from == "component"){
componentIO.initTreeEdit();
}else if(from == "action"){
actionIO.initTreeEdit();
}else if(from == "start"){
startIO.initTreeEdit();
}
}
function addExpander(item) {
if (item.children('.expander').length == 0) {
var expander = $('<span>', { 'class': 'expander' });
expander.bind('click', function() {
var item = $(this).parent();
item.toggleClass('expanded');
});
item.prepend(expander);
}
}
function addListAppender(item, handler) {
var appender = $('<div>', { 'class': 'item appender' }),
btn = $('<button></button>', { 'class': 'property' });
btn.text('Add New Value');
appender.append(btn);
item.append(appender);
btn.click(handler);
return appender;
}
function addNewValue(json) {
if (isArray(json)) {
json.push(null);
return true;
}
if (isObject(json)) {
var i = 1, newName = "newKey";
while (json.hasOwnProperty(newName)) {
newName = "newKey" + i;
i++;
}
json[newName] = null;
return true;
}
return false;
}
function construct(opt, json, root, path) {
path = path || '';
root.children('.item').remove();
for (var key in json) {
if (!json.hasOwnProperty(key)) continue;
var item = $('<div>', { 'class': 'item', 'data-path': path }),
property = $(opt.propertyElement || '<input>', { 'class': 'property' }),
value = $(opt.valueElement || '<input>', { 'class': 'value' });
if (isObject(json[key]) || isArray(json[key])) {
addExpander(item);
}
addMenu(item,opt);
item.append(property).append(value);
root.append(item);
property.val(key).attr('title', key);
var val = stringify(json[key]);
value.val(val).attr('title', val);
assignType(item, json[key]);
property.change(propertyChanged(opt));
value.change(valueChanged(opt));
property.click(propertyClicked(opt));
if (isObject(json[key]) || isArray(json[key])) {
construct(opt, json[key], item, (path ? path + '.' : '') + key);
}
}
if (isObject(json) || isArray(json)) {
addListAppender(root, function () {
addNewValue(json);
construct(opt, json, root, path);
opt.onchange(parse(stringify(opt.original)));
})
}
}
function updateParents(el, opt) {
$(el).parentsUntil(opt.target).each(function() {
var path = $(this).data('path');
path = (path ? path + '.' : path) + $(this).children('.property').val();
var val = stringify(def(opt.original, path, null));
$(this).children('.value').val(val).attr('title', val);
});
}
function propertyClicked(opt) {
return function() {
var path = $(this).parent().data('path');
var key = $(this).attr('title');
var safePath = path ? path.split('.').concat([key]).join('\'][\'') : key;
opt.onpropertyclick('[\'' + safePath + '\']');
};
}
function propertyChanged(opt) {
return function() {
var path = $(this).parent().data('path'),
val = parse($(this).next().val()),
newKey = $(this).val(),
oldKey = $(this).attr('title');
$(this).attr('title', newKey);
feed(opt.original, (path ? path + '.' : '') + oldKey);
if (newKey) feed(opt.original, (path ? path + '.' : '') + newKey, val);
updateParents(this, opt);
if (!newKey) $(this).parent().remove();
opt.onchange(parse(stringify(opt.original)));
};
}
function valueChanged(opt) {
return function() {
var key = $(this).prev().val(),
val = parse($(this).val() || 'null'),
item = $(this).parent(),
path = item.data('path');
feed(opt.original, (path ? path + '.' : '') + key, val);
if ((isObject(val) || isArray(val)) && !$.isEmptyObject(val)) {
construct(opt, val, item, (path ? path + '.' : '') + key);
addExpander(item);
} else {
item.find('.expander, .item').remove();
}
assignType(item, val);
updateParents(this, opt);
opt.onchange(parse(stringify(opt.original)));
};
}
function changeType(type,button,opt){
var item = button.parents(".item:eq(0)");
var value = item.find("input.value");
if(item.hasClass(type.toLowerCase())){
return false;
}
if(type == "string")value.val('""');
else if(type == "array") value.val("[]");
else if(type == "object") value.val("{}");
else if(type =="boolean") value.val(true);
else if(type == "number") value.val(1);
value.change();
}
function changeValueType(type,button,opt){
var item = button.parents(".item:eq(0)");
var input = item.find(">input.value");
if(type == "changeable"){
input.addClass("show");
}else{
input.removeClass("show");
}
}
function assignType(item, val) {
var className = 'null';
if (isObject(val)) className = 'object';
else if (isArray(val)) className = 'array';
else if (isBoolean(val)) className = 'boolean';
else if (isString(val)) className = 'string';
else if (isNumber(val)) className = 'number';
item.removeClass(types);
item.addClass(className);
}
| scaffold/src/vendor/jquery.jsoneditor.js | // Simple yet flexible JSON editor plugin.
// Turns any element into a stylable interactive JSON editor.
// Copyright (c) 2013 David Durman
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
// Dependencies:
// * jQuery
// * JSON (use json2 library for browsers that do not support JSON natively)
// Example:
// var myjson = { any: { json: { value: 1 } } };
// var opt = { change: function() { /* called on every change */ } };
// /* opt.propertyElement = '<textarea>'; */ // element of the property field, <input> is default
// /* opt.valueElement = '<textarea>'; */ // element of the value field, <input> is default
// $('#mydiv').jsonEditor(myjson, opt);
import {ContextMenu} from "./jquery.jsoneditor.menu";
import * as startIO from "../app/stage/startIO";
import * as actionIO from "../app/action/actionIO";
import * as componentIO from "../app/component/componentIO";
let from;
var items = [];
items.push({
text: 'Type',
title: 'Change the type of this field',
className: 'jsoneditor-type-',
submenu: [
{
text: 'Array',
className: 'jsoneditor-type-array',
title: "titles.array",
click: function (button,opt) {
changeType('array',button,opt);
}
},
{
text: 'Object',
className: 'jsoneditor-type-object',
title: "titles.object",
click: function (button,opt) {
changeType('object',button,opt);
}
},
{
text: 'String',
className: 'jsoneditor-type-string',
title: "titles.string",
click: function (button,opt) {
changeType('string',button,opt);
}
}
]
});
items.push({
text: 'ValueType',
title: 'Change the type of value',
className: 'jsoneditor-type-',
submenu: [
{
text: 'Changeable',
className: 'jsoneditor-value-change',
title: "titles.changeable",
click: function (button,opt) {
changeValueType("changeable",button,opt);
}
},
{
text: 'Unchangeable',
className: 'jsoneditor-value-unchange',
title: "titles.unchangeable",
click: function (button,opt) {
changeValueType("unchangeable",button,opt);
}
}
]
});
items.push({
text: 'Remove',
title: 'Remove this field (Ctrl+Del)',
className: 'jsoneditor-remove',
click: function (button,opt) {
removeItem(button,opt);
}
});
export function jsonEditor (container,json, options,caller) {
from = caller;
options = options || {};
// Make sure functions or other non-JSON data types are stripped down.
json = parse(stringify(json));
var K = function() {};
var onchange = options.change || K;
var onpropertyclick = options.propertyclick || K;
return container.each(function() {
JSONEditorInit(container, json, onchange, onpropertyclick, options.propertyElement, options.valueElement);
});
};
function JSONEditorInit(target, json, onchange, onpropertyclick, propertyElement, valueElement) {
var opt = {
target: target,
onchange: onchange,
onpropertyclick: onpropertyclick,
original: json,
propertyElement: propertyElement,
valueElement: valueElement
};
construct(opt, json, opt.target);
$(opt.target).on('blur focus', '.property, .value', function() {
$(this).toggleClass('editing');
});
}
function isObject(o) { return Object.prototype.toString.call(o) == '[object Object]'; }
function isArray(o) { return Object.prototype.toString.call(o) == '[object Array]'; }
function isBoolean(o) { return Object.prototype.toString.call(o) == '[object Boolean]'; }
function isNumber(o) { return Object.prototype.toString.call(o) == '[object Number]'; }
function isString(o) { return Object.prototype.toString.call(o) == '[object String]'; }
var types = 'object array boolean number string null';
// Feeds object `o` with `value` at `path`. If value argument is omitted,
// object at `path` will be deleted from `o`.
// Example:
// feed({}, 'foo.bar.baz', 10); // returns { foo: { bar: { baz: 10 } } }
function feed(o, path, value) {
var del = arguments.length == 2;
if (path.indexOf('.') > -1) {
var diver = o,
i = 0,
parts = path.split('.');
for (var len = parts.length; i < len - 1; i++) {
diver = diver[parts[i]];
}
if (del) delete diver[parts[len - 1]];
else diver[parts[len - 1]] = value;
} else {
if (del) delete o[path];
else o[path] = value;
}
return o;
}
// Get a property by path from object o if it exists. If not, return defaultValue.
// Example:
// def({ foo: { bar: 5 } }, 'foo.bar', 100); // returns 5
// def({ foo: { bar: 5 } }, 'foo.baz', 100); // returns 100
function def(o, path, defaultValue) {
path = path.split('.');
var i = 0;
while (i < path.length) {
if ((o = o[path[i++]]) == undefined) return defaultValue;
}
return o;
}
function error(reason) { if (window.console) { console.error(reason); } }
function parse(str) {
var res;
try { res = JSON.parse(str); }
catch (e) { res = null; error('JSON parse failed.'); }
return res;
}
function stringify(obj) {
var res;
try { res = JSON.stringify(obj); }
catch (e) { res = 'null'; error('JSON stringify failed.'); }
return res;
}
function addMenu(item,opt){
if (item.children('.menuer').length == 0) {
var menuer = $('<span>', { 'class': 'menuer fa fa-navicon' });
menuer.bind('click', function() {
window.event.stopPropagation();
ContextMenu($(this),items,opt);
});
item.prepend(menuer);
}
}
function removeItem (button,opt){
// var menuButton = button.parents(".item").find(".menuer");
var item = button.parents(".item:eq(0)");
item.find(">.property").val("").change();
item.remove();
if(from == "component"){
componentIO.initTreeEdit();
}else if(from == "action"){
actionIO.initTreeEdit();
}else if(from == "start"){
startIO.initTreeEdit();
}
}
function addExpander(item) {
if (item.children('.expander').length == 0) {
var expander = $('<span>', { 'class': 'expander' });
expander.bind('click', function() {
var item = $(this).parent();
item.toggleClass('expanded');
});
item.prepend(expander);
}
}
function addListAppender(item, handler) {
var appender = $('<div>', { 'class': 'item appender' }),
btn = $('<button></button>', { 'class': 'property' });
btn.text('Add New Value');
appender.append(btn);
item.append(appender);
btn.click(handler);
return appender;
}
function addNewValue(json) {
if (isArray(json)) {
json.push(null);
return true;
}
if (isObject(json)) {
var i = 1, newName = "newKey";
while (json.hasOwnProperty(newName)) {
newName = "newKey" + i;
i++;
}
json[newName] = null;
return true;
}
return false;
}
function construct(opt, json, root, path) {
path = path || '';
root.children('.item').remove();
for (var key in json) {
if (!json.hasOwnProperty(key)) continue;
var item = $('<div>', { 'class': 'item', 'data-path': path }),
property = $(opt.propertyElement || '<input>', { 'class': 'property' }),
value = $(opt.valueElement || '<input>', { 'class': 'value' });
if (isObject(json[key]) || isArray(json[key])) {
addExpander(item);
}
addMenu(item,opt);
item.append(property).append(value);
root.append(item);
property.val(key).attr('title', key);
var val = stringify(json[key]);
value.val(val).attr('title', val);
assignType(item, json[key]);
property.change(propertyChanged(opt));
value.change(valueChanged(opt));
property.click(propertyClicked(opt));
if (isObject(json[key]) || isArray(json[key])) {
construct(opt, json[key], item, (path ? path + '.' : '') + key);
}
}
if (isObject(json) || isArray(json)) {
addListAppender(root, function () {
addNewValue(json);
construct(opt, json, root, path);
opt.onchange(parse(stringify(opt.original)));
})
}
}
function updateParents(el, opt) {
$(el).parentsUntil(opt.target).each(function() {
var path = $(this).data('path');
path = (path ? path + '.' : path) + $(this).children('.property').val();
var val = stringify(def(opt.original, path, null));
$(this).children('.value').val(val).attr('title', val);
});
}
function propertyClicked(opt) {
return function() {
var path = $(this).parent().data('path');
var key = $(this).attr('title');
var safePath = path ? path.split('.').concat([key]).join('\'][\'') : key;
opt.onpropertyclick('[\'' + safePath + '\']');
};
}
function propertyChanged(opt) {
return function() {
var path = $(this).parent().data('path'),
val = parse($(this).next().val()),
newKey = $(this).val(),
oldKey = $(this).attr('title');
$(this).attr('title', newKey);
feed(opt.original, (path ? path + '.' : '') + oldKey);
if (newKey) feed(opt.original, (path ? path + '.' : '') + newKey, val);
updateParents(this, opt);
if (!newKey) $(this).parent().remove();
opt.onchange(parse(stringify(opt.original)));
};
}
function valueChanged(opt) {
return function() {
var key = $(this).prev().val(),
val = parse($(this).val() || 'null'),
item = $(this).parent(),
path = item.data('path');
feed(opt.original, (path ? path + '.' : '') + key, val);
if ((isObject(val) || isArray(val)) && !$.isEmptyObject(val)) {
construct(opt, val, item, (path ? path + '.' : '') + key);
addExpander(item);
} else {
item.find('.expander, .item').remove();
}
assignType(item, val);
updateParents(this, opt);
opt.onchange(parse(stringify(opt.original)));
};
}
function changeType(type,button,opt){
var item = button.parents(".item:eq(0)");
var value = item.find("input.value");
if(item.hasClass(type.toLowerCase())){
return false;
}
if(type == "string")value.val('""');
else if(type == "array") value.val("[]");
else if(type == "object") value.val("{}");
value.change();
}
function changeValueType(type,button,opt){
var item = button.parents(".item:eq(0)");
var input = item.find(">input.value");
if(type == "changeable"){
input.addClass("show");
}else{
input.removeClass("show");
}
}
function assignType(item, val) {
var className = 'null';
if (isObject(val)) className = 'object';
else if (isArray(val)) className = 'array';
else if (isBoolean(val)) className = 'boolean';
else if (isString(val)) className = 'string';
else if (isNumber(val)) className = 'number';
item.removeClass(types);
item.addClass(className);
}
| json tree type change
| scaffold/src/vendor/jquery.jsoneditor.js | json tree type change | <ide><path>caffold/src/vendor/jquery.jsoneditor.js
<ide> click: function (button,opt) {
<ide> changeType('string',button,opt);
<ide> }
<del> }
<add> },
<add> {
<add> text: 'Boolean',
<add> className: 'jsoneditor-type-boolean',
<add> title: "titles.boolean",
<add> click: function (button,opt) {
<add> changeType('boolean',button,opt);
<add> }
<add> },
<add> {
<add> text: 'Number',
<add> className: 'jsoneditor-type-number',
<add> title: "titles.number",
<add> click: function (button,opt) {
<add> changeType('number',button,opt);
<add> }
<add> }
<add>
<ide> ]
<ide> });
<ide>
<ide> if(type == "string")value.val('""');
<ide> else if(type == "array") value.val("[]");
<ide> else if(type == "object") value.val("{}");
<add> else if(type =="boolean") value.val(true);
<add> else if(type == "number") value.val(1);
<ide>
<ide> value.change();
<ide> } |
|
JavaScript | apache-2.0 | 1a0069bbf923000c0cc141965c9f5f29234e91e2 | 0 | QuickBlox/q-municate-web,QuickBlox/q-municate-web | /*
* Q-municate chat application
*
* User Module
*
*/
module.exports = User;
var tempParams;
function User(app) {
this.app = app;
this._remember = false;
this._valid = false;
}
User.prototype = {
connectFB: function(token) {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
self = this,
params;
UserView.loginQB();
UserView.createSpinner();
params = {
provider: 'facebook',
keys: {token: token}
};
QBApiCalls.createSession(params, function(session) {
QBApiCalls.getUser(session.user_id, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// self.rememberMe();
// UserView.successFormCallback(self);
// // import FB friends
// FB.api('/me/friends', function (data) {
// console.log(data);
// }
// );
// });
});
}, true);
},
signup: function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
form = $('section:visible form'),
tempParams = {},
self = this,
params;
if (validate(form, this)) {
UserView.createSpinner();
params = {
full_name: tempParams.full_name,
email: tempParams.email,
password: tempParams.password,
tag_list: 'web'
};
QBApiCalls.createSession({}, function() {
QBApiCalls.createUser(params, function() {
delete params.full_name;
delete params.tag_list;
QBApiCalls.loginUser(params, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// if (tempParams._blob) {
// self.uploadAvatar();
// } else {
// UserView.successFormCallback(self);
// }
// });
});
});
}, false);
}
},
uploadAvatar: function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
custom_data,
self = this;
QBApiCalls.createBlob({file: tempParams._blob, 'public': true}, function(blob) {
self.contact.blob_id = blob.id;
self.contact.avatar_url = blob.path;
UserView.successFormCallback(self);
custom_data = JSON.stringify({avatar_url: blob.path});
QBApiCalls.updateUser(self.contact.id, {blob_id: blob.id, custom_data: custom_data}, function(res) {
//if (QMCONFIG.debug) console.log('update of user', res);
});
});
},
login: function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
form = $('section:visible form'),
tempParams = {},
self = this,
params;
if (validate(form, this)) {
UserView.createSpinner();
params = {
email: tempParams.email,
password: tempParams.password
};
QBApiCalls.createSession(params, function(session) {
QBApiCalls.getUser(session.user_id, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// if (self._remember) {
// self.rememberMe();
// }
// UserView.successFormCallback(self);
// });
});
}, self._remember);
}
},
rememberMe: function() {
var storage = {},
self = this;
Object.keys(self.contact).forEach(function(prop) {
storage[prop] = self.contact[prop];
});
localStorage.setItem('QM.user', JSON.stringify(storage));
},
forgot: function(callback) {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
form = $('section:visible form'),
tempParams = {},
self = this;
if (validate(form, this)) {
UserView.createSpinner();
QBApiCalls.createSession({}, function() {
QBApiCalls.forgotPassword(tempParams.email, function() {
UserView.successSendEmailCallback();
callback();
});
}, false);
}
},
resetPass: function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
form = $('section:visible form'),
tempParams = {},
self = this;
if (validate(form, this)) {
// UserView.createSpinner();
}
},
autologin: function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
storage = JSON.parse(localStorage['QM.user']),
self = this;
this.contact = Contact.create(storage);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// UserView.successFormCallback(self);
// });
},
logout: function(callback) {
var QBApiCalls = this.app.service,
self = this;
// QBApiCalls.chatDisconnect();
QBApiCalls.logoutUser(function() {
localStorage.removeItem('QM.user');
self.contact = null;
self._remember = false;
self._valid = false;
callback();
});
}
};
/* Private
---------------------------------------------------------------------- */
function validate(form, user) {
var maxSize = QMCONFIG.maxLimitFile * 1024 * 1024,
remember = form.find('input:checkbox')[0],
file = form.find('input:file')[0],
fieldName, errName,
value, errMsg;
form.find('input:not(:file, :checkbox)').each(function() {
fieldName = this.id.split('-')[1];
errName = this.placeholder;
value = this.value.trim();
if (this.checkValidity()) {
user._valid = true;
tempParams[fieldName] = value;
} else {
if (this.validity.valueMissing) {
errMsg = errName + ' is required';
} else if (this.validity.typeMismatch) {
errMsg = QMCONFIG.errors.invalidEmail;
} else if (this.validity.patternMismatch && errName === 'Name') {
if (value.length < 3)
errMsg = QMCONFIG.errors.shortName;
else if (value.length > 50)
errMsg = QMCONFIG.errors.bigName;
else
errMsg = QMCONFIG.errors.invalidName;
} else if (this.validity.patternMismatch && (errName === 'Password' || errName === 'New password')) {
if (value.length < 8)
errMsg = QMCONFIG.errors.shortPass;
else if (value.length > 40)
errMsg = QMCONFIG.errors.bigPass;
else
errMsg = QMCONFIG.errors.invalidPass;
}
fail(user, errMsg);
$(this).addClass('is-error').focus();
return false;
}
});
if (user._valid && remember) {
user._remember = remember.checked;
}
if (user._valid && file && file.files[0]) {
file = file.files[0];
if (file.type.indexOf('image/') === -1) {
errMsg = QMCONFIG.errors.avatarType;
fail(user, errMsg);
} else if (file.name.length > 100) {
errMsg = QMCONFIG.errors.fileName;
fail(user, errMsg);
} else if (file.size > maxSize) {
errMsg = QMCONFIG.errors.fileSize;
fail(user, errMsg);
} else {
tempParams._blob = file;
}
}
return user._valid;
}
function fail(user, errMsg) {
user._valid = false;
$('section:visible').find('.text_error').addClass('is-error').text(errMsg);
}
| js/models/user.js | /*
* Q-municate chat application
*
* User Module
*
*/
module.exports = User;
var tempParams;
function User(app) {
this.app = app;
this._remember = false;
this._valid = false;
}
User.prototype.connectFB = function(token) {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
self = this,
params;
UserView.loginQB();
UserView.createSpinner();
params = {
provider: 'facebook',
keys: {token: token}
};
QBApiCalls.createSession(params, function(session) {
QBApiCalls.getUser(session.user_id, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// self.rememberMe();
// UserView.successFormCallback(self);
// // import FB friends
// FB.api('/me/friends', function (data) {
// console.log(data);
// }
// );
// });
});
}, true);
};
User.prototype.signup = function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
form = $('section:visible form'),
tempParams = {},
self = this,
params;
if (validate(form, this)) {
UserView.createSpinner();
params = {
full_name: tempParams.full_name,
email: tempParams.email,
password: tempParams.password,
tag_list: 'web'
};
QBApiCalls.createSession({}, function() {
QBApiCalls.createUser(params, function() {
delete params.full_name;
delete params.tag_list;
QBApiCalls.loginUser(params, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// if (tempParams._blob) {
// self.uploadAvatar();
// } else {
// UserView.successFormCallback(self);
// }
// });
});
});
}, false);
}
};
User.prototype.uploadAvatar = function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
custom_data,
self = this;
QBApiCalls.createBlob({file: tempParams._blob, 'public': true}, function(blob) {
self.contact.blob_id = blob.id;
self.contact.avatar_url = blob.path;
UserView.successFormCallback(self);
custom_data = JSON.stringify({avatar_url: blob.path});
QBApiCalls.updateUser(self.contact.id, {blob_id: blob.id, custom_data: custom_data}, function(res) {
//if (QMCONFIG.debug) console.log('update of user', res);
});
});
};
User.prototype.login = function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
form = $('section:visible form'),
tempParams = {},
self = this,
params;
if (validate(form, this)) {
UserView.createSpinner();
params = {
email: tempParams.email,
password: tempParams.password
};
QBApiCalls.createSession(params, function(session) {
QBApiCalls.getUser(session.user_id, function(user) {
self.contact = Contact.create(user);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// if (self._remember) {
// self.rememberMe();
// }
// UserView.successFormCallback(self);
// });
});
}, self._remember);
}
};
User.prototype.rememberMe = function() {
var storage = {},
self = this;
Object.keys(self.contact).forEach(function(prop) {
storage[prop] = self.contact[prop];
});
localStorage.setItem('QM.user', JSON.stringify(storage));
};
User.prototype.forgot = function(callback) {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
form = $('section:visible form'),
tempParams = {},
self = this;
if (validate(form, this)) {
UserView.createSpinner();
QBApiCalls.createSession({}, function() {
QBApiCalls.forgotPassword(tempParams.email, function() {
UserView.successSendEmailCallback();
callback();
});
}, false);
}
};
User.prototype.resetPass = function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
form = $('section:visible form'),
tempParams = {},
self = this;
if (validate(form, this)) {
// UserView.createSpinner();
}
};
User.prototype.autologin = function() {
var QBApiCalls = this.app.service,
UserView = this.app.views.User,
Contact = this.app.models.Contact,
storage = JSON.parse(localStorage['QM.user']),
self = this;
this.contact = Contact.create(storage);
if (QMCONFIG.debug) console.log('User', self);
// QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
// UserView.successFormCallback(self);
// });
};
User.prototype.logout = function(callback) {
var QBApiCalls = this.app.service,
self = this;
// QBApiCalls.chatDisconnect();
QBApiCalls.logoutUser(function() {
localStorage.removeItem('QM.user');
self.contact = null;
self._remember = false;
self._valid = false;
callback();
});
};
/* Private
---------------------------------------------------------------------- */
function validate(form, user) {
var maxSize = QMCONFIG.maxLimitFile * 1024 * 1024,
remember = form.find('input:checkbox')[0],
file = form.find('input:file')[0],
fieldName, errName,
value, errMsg;
form.find('input:not(:file, :checkbox)').each(function() {
fieldName = this.id.split('-')[1];
errName = this.placeholder;
value = this.value.trim();
if (this.checkValidity()) {
user._valid = true;
tempParams[fieldName] = value;
} else {
if (this.validity.valueMissing) {
errMsg = errName + ' is required';
} else if (this.validity.typeMismatch) {
errMsg = QMCONFIG.errors.invalidEmail;
} else if (this.validity.patternMismatch && errName === 'Name') {
if (value.length < 3)
errMsg = QMCONFIG.errors.shortName;
else if (value.length > 50)
errMsg = QMCONFIG.errors.bigName;
else
errMsg = QMCONFIG.errors.invalidName;
} else if (this.validity.patternMismatch && (errName === 'Password' || errName === 'New password')) {
if (value.length < 8)
errMsg = QMCONFIG.errors.shortPass;
else if (value.length > 40)
errMsg = QMCONFIG.errors.bigPass;
else
errMsg = QMCONFIG.errors.invalidPass;
}
fail(user, errMsg);
$(this).addClass('is-error').focus();
return false;
}
});
if (user._valid && remember) {
user._remember = remember.checked;
}
if (user._valid && file && file.files[0]) {
file = file.files[0];
if (file.type.indexOf('image/') === -1) {
errMsg = QMCONFIG.errors.avatarType;
fail(user, errMsg);
} else if (file.name.length > 100) {
errMsg = QMCONFIG.errors.fileName;
fail(user, errMsg);
} else if (file.size > maxSize) {
errMsg = QMCONFIG.errors.fileSize;
fail(user, errMsg);
} else {
tempParams._blob = file;
}
}
return user._valid;
}
function fail(user, errMsg) {
user._valid = false;
$('section:visible').find('.text_error').addClass('is-error').text(errMsg);
}
| refactor user
| js/models/user.js | refactor user | <ide><path>s/models/user.js
<ide> this._valid = false;
<ide> }
<ide>
<del>User.prototype.connectFB = function(token) {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> Contact = this.app.models.Contact,
<del> self = this,
<del> params;
<del>
<del> UserView.loginQB();
<del> UserView.createSpinner();
<del>
<del> params = {
<del> provider: 'facebook',
<del> keys: {token: token}
<del> };
<del>
<del> QBApiCalls.createSession(params, function(session) {
<del> QBApiCalls.getUser(session.user_id, function(user) {
<del> self.contact = Contact.create(user);
<del>
<del> if (QMCONFIG.debug) console.log('User', self);
<del>
<del> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<del> // self.rememberMe();
<del> // UserView.successFormCallback(self);
<del>
<del> // // import FB friends
<del> // FB.api('/me/friends', function (data) {
<del> // console.log(data);
<del> // }
<del> // );
<del> // });
<del> });
<del> }, true);
<del>};
<del>
<del>User.prototype.signup = function() {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> Contact = this.app.models.Contact,
<del> form = $('section:visible form'),
<del> tempParams = {},
<del> self = this,
<del> params;
<del>
<del> if (validate(form, this)) {
<add>User.prototype = {
<add>
<add> connectFB: function(token) {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> Contact = this.app.models.Contact,
<add> self = this,
<add> params;
<add>
<add> UserView.loginQB();
<ide> UserView.createSpinner();
<ide>
<ide> params = {
<del> full_name: tempParams.full_name,
<del> email: tempParams.email,
<del> password: tempParams.password,
<del> tag_list: 'web'
<del> };
<del>
<del> QBApiCalls.createSession({}, function() {
<del> QBApiCalls.createUser(params, function() {
<del> delete params.full_name;
<del> delete params.tag_list;
<del>
<del> QBApiCalls.loginUser(params, function(user) {
<del> self.contact = Contact.create(user);
<del>
<del> if (QMCONFIG.debug) console.log('User', self);
<del>
<del> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<del> // if (tempParams._blob) {
<del> // self.uploadAvatar();
<del> // } else {
<del> // UserView.successFormCallback(self);
<del> // }
<del> // });
<del> });
<del> });
<del> }, false);
<del> }
<del>};
<del>
<del>User.prototype.uploadAvatar = function() {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> custom_data,
<del> self = this;
<del>
<del> QBApiCalls.createBlob({file: tempParams._blob, 'public': true}, function(blob) {
<del> self.contact.blob_id = blob.id;
<del> self.contact.avatar_url = blob.path;
<del>
<del> UserView.successFormCallback(self);
<del>
<del> custom_data = JSON.stringify({avatar_url: blob.path});
<del> QBApiCalls.updateUser(self.contact.id, {blob_id: blob.id, custom_data: custom_data}, function(res) {
<del> //if (QMCONFIG.debug) console.log('update of user', res);
<del> });
<del> });
<del>};
<del>
<del>User.prototype.login = function() {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> Contact = this.app.models.Contact,
<del> form = $('section:visible form'),
<del> tempParams = {},
<del> self = this,
<del> params;
<del>
<del> if (validate(form, this)) {
<del> UserView.createSpinner();
<del>
<del> params = {
<del> email: tempParams.email,
<del> password: tempParams.password
<add> provider: 'facebook',
<add> keys: {token: token}
<ide> };
<ide>
<ide> QBApiCalls.createSession(params, function(session) {
<ide> if (QMCONFIG.debug) console.log('User', self);
<ide>
<ide> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<del> // if (self._remember) {
<del> // self.rememberMe();
<del> // }
<del>
<add> // self.rememberMe();
<ide> // UserView.successFormCallback(self);
<add>
<add> // // import FB friends
<add> // FB.api('/me/friends', function (data) {
<add> // console.log(data);
<add> // }
<add> // );
<ide> // });
<del>
<ide> });
<del> }, self._remember);
<add> }, true);
<add> },
<add>
<add> signup: function() {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> Contact = this.app.models.Contact,
<add> form = $('section:visible form'),
<add> tempParams = {},
<add> self = this,
<add> params;
<add>
<add> if (validate(form, this)) {
<add> UserView.createSpinner();
<add>
<add> params = {
<add> full_name: tempParams.full_name,
<add> email: tempParams.email,
<add> password: tempParams.password,
<add> tag_list: 'web'
<add> };
<add>
<add> QBApiCalls.createSession({}, function() {
<add> QBApiCalls.createUser(params, function() {
<add> delete params.full_name;
<add> delete params.tag_list;
<add>
<add> QBApiCalls.loginUser(params, function(user) {
<add> self.contact = Contact.create(user);
<add>
<add> if (QMCONFIG.debug) console.log('User', self);
<add>
<add> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<add> // if (tempParams._blob) {
<add> // self.uploadAvatar();
<add> // } else {
<add> // UserView.successFormCallback(self);
<add> // }
<add> // });
<add> });
<add> });
<add> }, false);
<add> }
<add> },
<add>
<add> uploadAvatar: function() {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> custom_data,
<add> self = this;
<add>
<add> QBApiCalls.createBlob({file: tempParams._blob, 'public': true}, function(blob) {
<add> self.contact.blob_id = blob.id;
<add> self.contact.avatar_url = blob.path;
<add>
<add> UserView.successFormCallback(self);
<add>
<add> custom_data = JSON.stringify({avatar_url: blob.path});
<add> QBApiCalls.updateUser(self.contact.id, {blob_id: blob.id, custom_data: custom_data}, function(res) {
<add> //if (QMCONFIG.debug) console.log('update of user', res);
<add> });
<add> });
<add> },
<add>
<add> login: function() {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> Contact = this.app.models.Contact,
<add> form = $('section:visible form'),
<add> tempParams = {},
<add> self = this,
<add> params;
<add>
<add> if (validate(form, this)) {
<add> UserView.createSpinner();
<add>
<add> params = {
<add> email: tempParams.email,
<add> password: tempParams.password
<add> };
<add>
<add> QBApiCalls.createSession(params, function(session) {
<add> QBApiCalls.getUser(session.user_id, function(user) {
<add> self.contact = Contact.create(user);
<add>
<add> if (QMCONFIG.debug) console.log('User', self);
<add>
<add> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<add> // if (self._remember) {
<add> // self.rememberMe();
<add> // }
<add>
<add> // UserView.successFormCallback(self);
<add> // });
<add>
<add> });
<add> }, self._remember);
<add> }
<add> },
<add>
<add> rememberMe: function() {
<add> var storage = {},
<add> self = this;
<add>
<add> Object.keys(self.contact).forEach(function(prop) {
<add> storage[prop] = self.contact[prop];
<add> });
<add>
<add> localStorage.setItem('QM.user', JSON.stringify(storage));
<add> },
<add>
<add> forgot: function(callback) {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> form = $('section:visible form'),
<add> tempParams = {},
<add> self = this;
<add>
<add> if (validate(form, this)) {
<add> UserView.createSpinner();
<add>
<add> QBApiCalls.createSession({}, function() {
<add> QBApiCalls.forgotPassword(tempParams.email, function() {
<add> UserView.successSendEmailCallback();
<add> callback();
<add> });
<add> }, false);
<add> }
<add> },
<add>
<add> resetPass: function() {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> form = $('section:visible form'),
<add> tempParams = {},
<add> self = this;
<add>
<add> if (validate(form, this)) {
<add> // UserView.createSpinner();
<add> }
<add> },
<add>
<add> autologin: function() {
<add> var QBApiCalls = this.app.service,
<add> UserView = this.app.views.User,
<add> Contact = this.app.models.Contact,
<add> storage = JSON.parse(localStorage['QM.user']),
<add> self = this;
<add>
<add> this.contact = Contact.create(storage);
<add>
<add> if (QMCONFIG.debug) console.log('User', self);
<add>
<add> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<add> // UserView.successFormCallback(self);
<add> // });
<add> },
<add>
<add> logout: function(callback) {
<add> var QBApiCalls = this.app.service,
<add> self = this;
<add>
<add> // QBApiCalls.chatDisconnect();
<add> QBApiCalls.logoutUser(function() {
<add> localStorage.removeItem('QM.user');
<add> self.contact = null;
<add> self._remember = false;
<add> self._valid = false;
<add> callback();
<add> });
<ide> }
<del>};
<del>
<del>User.prototype.rememberMe = function() {
<del> var storage = {},
<del> self = this;
<del>
<del> Object.keys(self.contact).forEach(function(prop) {
<del> storage[prop] = self.contact[prop];
<del> });
<ide>
<del> localStorage.setItem('QM.user', JSON.stringify(storage));
<del>};
<del>
<del>User.prototype.forgot = function(callback) {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> form = $('section:visible form'),
<del> tempParams = {},
<del> self = this;
<del>
<del> if (validate(form, this)) {
<del> UserView.createSpinner();
<del>
<del> QBApiCalls.createSession({}, function() {
<del> QBApiCalls.forgotPassword(tempParams.email, function() {
<del> UserView.successSendEmailCallback();
<del> callback();
<del> });
<del> }, false);
<del> }
<del>};
<del>
<del>User.prototype.resetPass = function() {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> form = $('section:visible form'),
<del> tempParams = {},
<del> self = this;
<del>
<del> if (validate(form, this)) {
<del> // UserView.createSpinner();
<del> }
<del>};
<del>
<del>User.prototype.autologin = function() {
<del> var QBApiCalls = this.app.service,
<del> UserView = this.app.views.User,
<del> Contact = this.app.models.Contact,
<del> storage = JSON.parse(localStorage['QM.user']),
<del> self = this;
<del>
<del> this.contact = Contact.create(storage);
<del>
<del> if (QMCONFIG.debug) console.log('User', self);
<del>
<del> // QBApiCalls.chatConnect(self.contact.xmpp_jid, function() {
<del> // UserView.successFormCallback(self);
<del> // });
<del>};
<del>
<del>User.prototype.logout = function(callback) {
<del> var QBApiCalls = this.app.service,
<del> self = this;
<del>
<del> // QBApiCalls.chatDisconnect();
<del> QBApiCalls.logoutUser(function() {
<del> localStorage.removeItem('QM.user');
<del> self.contact = null;
<del> self._remember = false;
<del> self._valid = false;
<del> callback();
<del> });
<ide> };
<ide>
<ide> /* Private |
|
Java | mit | 87666f84ce08989132db829a2d2dc266f610e615 | 0 | lemmy/tlaplus,lemmy/tlaplus,tlaplus/tlaplus,tlaplus/tlaplus,tlaplus/tlaplus,tlaplus/tlaplus,lemmy/tlaplus,lemmy/tlaplus | package org.lamport.tla.toolbox.ui.handler;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPartConstants;
import org.eclipse.ui.part.FileEditorInput;
import org.lamport.tla.toolbox.Activator;
import org.lamport.tla.toolbox.spec.Spec;
import org.lamport.tla.toolbox.ui.perspective.InitialPerspective;
import org.lamport.tla.toolbox.ui.perspective.SpecLoadedPerspective;
import org.lamport.tla.toolbox.util.ResourceHelper;
import org.lamport.tla.toolbox.util.UIHelper;
import org.lamport.tla.toolbox.util.pref.PreferenceStoreHelper;
/**
* Handles the open-spec command
* @author Simon Zambrovski
* @version $Id$
*/
public class OpenSpecHandler extends AbstractHandler implements IHandler
{
public static final String TLA_EDITOR = "org.lamport.tla.toolbox.editor.basic.TLAEditor";
public static final String COMMAND_ID = "toolbox.command.openSpec";
public static final String PARAM_SPEC = "toolbox.command.openSpec.param";
public Object execute(ExecutionEvent event) throws ExecutionException
{
String specName = event.getParameter(PARAM_SPEC);
if (specName == null)
{
return null;
}
final Spec spec = Activator.getSpecManager().getSpecByName(specName);
if (spec == null)
{
return null;
}
// spec the perspective
UIHelper.switchPerspective(SpecLoadedPerspective.ID);
// close the initial perspective
UIHelper.closeWindow(InitialPerspective.ID);
String[] editors = PreferenceStoreHelper.getOpenedEditors(spec.getProject());
IEditorPart part = null;
if (editors.length != 0)
{
for (int i = 0; i < editors.length; i++)
{
// IEditorInput input = new FileEditorInput(this.spec.getRootFile());
IFile file = ResourceHelper.getLinkedFile(spec.getProject(), editors[i]);
// open the editor
part = UIHelper.openEditor(TLA_EDITOR, new FileEditorInput(file));
}
} else
{
System.out.println("No editor information found. If the spec is reopened this is a BUG.");
// open the editor
part = UIHelper.openEditor(TLA_EDITOR, new FileEditorInput(spec.getRootFile()));
part.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId)
{
if (IWorkbenchPartConstants.PROP_DIRTY == propId)
{
// here the listeners to editor changes go into
}
}
});
}
// store information about opened spec in the spec manager
Activator.getSpecManager().setSpecLoaded(spec);
return null;
}
}
| org.lamport.tla.toolbox/src/org/lamport/tla/toolbox/ui/handler/OpenSpecHandler.java | package org.lamport.tla.toolbox.ui.handler;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPartConstants;
import org.eclipse.ui.part.FileEditorInput;
import org.lamport.tla.toolbox.Activator;
import org.lamport.tla.toolbox.spec.Spec;
import org.lamport.tla.toolbox.spec.parser.IParseConstants;
import org.lamport.tla.toolbox.ui.perspective.InitialPerspective;
import org.lamport.tla.toolbox.ui.perspective.SpecLoadedPerspective;
import org.lamport.tla.toolbox.util.PreferenceStoreHelper;
import org.lamport.tla.toolbox.util.ResourceHelper;
import org.lamport.tla.toolbox.util.UIHelper;
/**
* Handles the open-spec command
* @author Simon Zambrovski
* @version $Id$
*/
public class OpenSpecHandler extends AbstractHandler implements IHandler
{
public static final String TLA_EDITOR = "org.lamport.tla.toolbox.editor.basic.TLAEditor";
public static final String COMMAND_ID = "toolbox.command.openSpec";
public static final String PARAM_SPEC = "toolbox.command.openSpec.param";
public Object execute(ExecutionEvent event) throws ExecutionException
{
String specName = event.getParameter(PARAM_SPEC);
if (specName == null)
{
return null;
}
final Spec spec = Activator.getSpecManager().getSpecByName(specName);
if (spec == null)
{
return null;
}
// spec the perspective
UIHelper.switchPerspective(SpecLoadedPerspective.ID);
// close the initial perspective
UIHelper.closeWindow(InitialPerspective.ID);
String[] editors = PreferenceStoreHelper.getOpenedEditors(spec.getProject());
IEditorPart part = null;
if (editors.length != 0)
{
for (int i = 0; i < editors.length; i++)
{
// IEditorInput input = new FileEditorInput(this.spec.getRootFile());
IFile file = ResourceHelper.getLinkedFile(spec.getProject(), editors[i]);
// open the editor
part = UIHelper.openEditor(TLA_EDITOR, new FileEditorInput(file));
}
} else
{
// open the editor
part = UIHelper.openEditor(TLA_EDITOR, new FileEditorInput(spec.getRootFile()));
part.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId)
{
if (IWorkbenchPartConstants.PROP_DIRTY == propId)
{
spec.setStatus(IParseConstants.MODIFIED);
Activator.getParserRegistry().parseResultChanged(IParseConstants.MODIFIED);
}
}
});
}
// store information about opened spec in the spec manager
Activator.getSpecManager().setSpecLoaded(spec);
return null;
}
}
| change listener removed
git-svn-id: 7acc490bd371dbc82047a939b87dc892fdc31f59@12588 76a6fc44-f60b-0410-a9a8-e67b0e8fc65c
| org.lamport.tla.toolbox/src/org/lamport/tla/toolbox/ui/handler/OpenSpecHandler.java | change listener removed | <ide><path>rg.lamport.tla.toolbox/src/org/lamport/tla/toolbox/ui/handler/OpenSpecHandler.java
<ide> import org.eclipse.ui.part.FileEditorInput;
<ide> import org.lamport.tla.toolbox.Activator;
<ide> import org.lamport.tla.toolbox.spec.Spec;
<del>import org.lamport.tla.toolbox.spec.parser.IParseConstants;
<ide> import org.lamport.tla.toolbox.ui.perspective.InitialPerspective;
<ide> import org.lamport.tla.toolbox.ui.perspective.SpecLoadedPerspective;
<del>import org.lamport.tla.toolbox.util.PreferenceStoreHelper;
<ide> import org.lamport.tla.toolbox.util.ResourceHelper;
<ide> import org.lamport.tla.toolbox.util.UIHelper;
<add>import org.lamport.tla.toolbox.util.pref.PreferenceStoreHelper;
<ide>
<ide> /**
<ide> * Handles the open-spec command
<ide> }
<ide> } else
<ide> {
<add> System.out.println("No editor information found. If the spec is reopened this is a BUG.");
<ide> // open the editor
<ide> part = UIHelper.openEditor(TLA_EDITOR, new FileEditorInput(spec.getRootFile()));
<add>
<add>
<add>
<ide> part.addPropertyListener(new IPropertyListener() {
<ide>
<ide> public void propertyChanged(Object source, int propId)
<ide> {
<ide> if (IWorkbenchPartConstants.PROP_DIRTY == propId)
<ide> {
<del> spec.setStatus(IParseConstants.MODIFIED);
<del> Activator.getParserRegistry().parseResultChanged(IParseConstants.MODIFIED);
<add> // here the listeners to editor changes go into
<ide> }
<ide> }
<ide> }); |
|
Java | mit | 9ce14bcd3cfc8f0a554df661e79c2b99bfe1ec7c | 0 | haslam22/gomoku | package core;
import events.GameListener;
import players.Player;
import players.human.HumanPlayer;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
/**
* Responsible for facilitating interaction between the game and the GUI. An
* instance of this is sent down to all GUI controllers so that they can
* perform certain actions on a game e.g. start/pause/undo.
*/
public class GameController {
private final List<GameListener> listeners;
private final GameSettings settings;
private GameThread gameThread;
private GameState loadedState;
private GameState currentState;
/**
* Create a new GameController.
* @param settings Game settings
*/
public GameController(GameSettings settings) {
this.settings = settings;
this.listeners = new ArrayList<>();
}
/**
* Start the game. Reads the game settings and launches a new game thread.
* Has no effect if the game thread is already running.
*/
public void start() {
if(this.gameThread == null || !this.gameThread.isAlive()) {
listeners.forEach(listener -> listener.gameStarted());
this.currentState = loadedState != null ? loadedState.clone() :
new GameState(settings.getSize());
if(this.loadedState != null) {
listeners.forEach(listener -> listener.positionLoaded(
loadedState.getMovesMade()));
}
this.gameThread = new GameThread(currentState, settings,
settings.getPlayer1(), settings.getPlayer2(), listeners);
this.gameThread.start();
}
}
/**
* Stop the game. Safely interrupts the thread and cancels any pending
* moves and calls join() to wait for the thread to resolve. Has no
* effect if the game thread is not running.
*/
public void stop() {
if(this.gameThread != null && this.gameThread.isAlive()) {
this.gameThread.interrupt();
try {
this.gameThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
/**
* Undo the last two moves. This stops the game, removes the last two
* moves from the game state and emits an event to let the board update.
* The game is restarted immediately after.
*/
public void undo() {
if(this.currentState.getMovesMade().size() > 0) {
this.stop();
for (int i = 0; i < 2; i++) {
Move move = currentState.undo();
if (move != null) {
listeners.forEach(listener -> listener.moveRemoved(move));
}
}
listeners.forEach(listener -> listener.gameResumed());
// Create a new game thread, but pass in the times from the previous
// instance to stop resetting of times.
this.gameThread = new GameThread(currentState, settings,
settings.getPlayer1(), settings.getPlayer2(),
listeners, new long[] {
gameThread.getGameTime(1),
gameThread.getGameTime(2)
});
gameThread.start();
}
}
/**
* Get the game settings.
* @return GameSettings instance
*/
public GameSettings getSettings() {
return settings;
}
/**
* Register a listener with this game instance.
* @param listener GameListener to register
*/
public void addListener(GameListener listener) {
this.listeners.add(listener);
}
/**
* Called by the GUI to set a user's move for the game.
* @param move Move from the user
* @return True if the move was accepted
*/
public boolean setUserMove(Move move) {
Player currentPlayer = gameThread.getCurrentPlayer();
if(currentPlayer instanceof HumanPlayer) {
if(!currentState.getMovesMade().contains(move)) {
synchronized(currentPlayer) {
((HumanPlayer) currentPlayer).setMove(move);
currentPlayer.notify();
}
return true;
}
}
return false;
}
/**
* Load in a state to use for this game.
* @param state GameState object to use (can be null)
*/
public void setLoadedState(GameState state) {
if(this.gameThread != null && this.gameThread.isAlive()) {
this.stop();
}
this.loadedState = state;
if(state != null) {
settings.setSize(loadedState.getSize());
listeners.forEach(listener -> listener.positionLoaded(
state.getMovesMade()));
} else {
listeners.forEach(listener -> listener.positionCleared());
}
}
/**
* @return Copy of the current game state.
*/
public GameState getState() {
return this.currentState.clone();
}
/**
* Get the game time remaining for a player.
* @param playerIndex Player identifier (1/2)
* @return Game time left, in milliseconds
*/
public long getGameTime(int playerIndex) {
return this.gameThread.getGameTime(playerIndex);
}
}
| src/main/java/core/GameController.java | package core;
import events.GameListener;
import players.Player;
import players.human.HumanPlayer;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
/**
* Responsible for facilitating interaction between the game and the GUI. An
* instance of this is sent down to all GUI controllers so that they can
* perform certain actions on a game e.g. start/pause/undo.
*/
public class GameController {
private static Logger LOGGER = Logger.getGlobal();
private final List<GameListener> listeners;
private final GameSettings settings;
private GameThread gameThread;
private GameState loadedState;
private GameState currentState;
/**
* Create a new GameController.
* @param settings Game settings
*/
public GameController(GameSettings settings) {
this.settings = settings;
this.listeners = new ArrayList<>();
}
/**
* Start the game. Reads the game settings and launches a new game thread.
* Has no effect if the game thread is already running.
*/
public void start() {
if(this.gameThread == null || !this.gameThread.isAlive()) {
listeners.forEach(listener -> listener.gameStarted());
this.currentState = loadedState != null ? loadedState.clone() :
new GameState(settings.getSize());
if(this.loadedState != null) {
listeners.forEach(listener -> listener.positionLoaded(
loadedState.getMovesMade()));
}
this.gameThread = new GameThread(currentState, settings,
settings.getPlayer1(), settings.getPlayer2(), listeners);
this.gameThread.start();
}
}
/**
* Stop the game. Safely interrupts the thread and cancels any pending
* moves and calls join() to wait for the thread to resolve. Has no
* effect if the game thread is not running.
*/
public void stop() {
if(this.gameThread != null && this.gameThread.isAlive()) {
this.gameThread.interrupt();
try {
this.gameThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
/**
* Undo the last two moves. This stops the game, removes the last two
* moves from the game state and emits an event to let the board update.
* The game is restarted immediately after.
*/
public void undo() {
if(this.currentState.getMovesMade().size() > 0) {
this.stop();
for (int i = 0; i < 2; i++) {
Move move = currentState.undo();
if (move != null) {
listeners.forEach(listener -> listener.moveRemoved(move));
}
}
listeners.forEach(listener -> listener.gameResumed());
// Create a new game thread, but pass in the times from the previous
// instance to stop resetting of times.
this.gameThread = new GameThread(currentState, settings,
settings.getPlayer1(), settings.getPlayer2(),
listeners, new long[] {
gameThread.getGameTime(1),
gameThread.getGameTime(2)
});
gameThread.start();
}
}
/**
* Get the game settings.
* @return GameSettings instance
*/
public GameSettings getSettings() {
return settings;
}
/**
* Register a listener with this game instance.
* @param listener GameListener to register
*/
public void addListener(GameListener listener) {
this.listeners.add(listener);
}
/**
* Called by the GUI to set a user's move for the game.
* @param move Move from the user
* @return True if the move was accepted
*/
public boolean setUserMove(Move move) {
Player currentPlayer = gameThread.getCurrentPlayer();
if(currentPlayer instanceof HumanPlayer) {
if(!currentState.getMovesMade().contains(move)) {
synchronized(currentPlayer) {
((HumanPlayer) currentPlayer).setMove(move);
currentPlayer.notify();
}
return true;
}
}
return false;
}
/**
* Load in a state to use for this game.
* @param state GameState object to use (can be null)
*/
public void setLoadedState(GameState state) {
if(this.gameThread.isAlive()) {
this.stop();
}
this.loadedState = state;
if(state != null) {
settings.setSize(loadedState.getSize());
listeners.forEach(listener -> listener.positionLoaded(
state.getMovesMade()));
} else {
listeners.forEach(listener -> listener.positionCleared());
}
}
/**
* @return Copy of the current game state.
*/
public GameState getState() {
return this.currentState.clone();
}
/**
* Get the game time remaining for a player.
* @param playerIndex Player identifier (1/2)
* @return Game time left, in milliseconds
*/
public long getGameTime(int playerIndex) {
return this.gameThread.getGameTime(playerIndex);
}
}
| Small game controller bugfix.
| src/main/java/core/GameController.java | Small game controller bugfix. | <ide><path>rc/main/java/core/GameController.java
<ide> * perform certain actions on a game e.g. start/pause/undo.
<ide> */
<ide> public class GameController {
<del>
<del> private static Logger LOGGER = Logger.getGlobal();
<ide>
<ide> private final List<GameListener> listeners;
<ide> private final GameSettings settings;
<ide> * @param state GameState object to use (can be null)
<ide> */
<ide> public void setLoadedState(GameState state) {
<del> if(this.gameThread.isAlive()) {
<add> if(this.gameThread != null && this.gameThread.isAlive()) {
<ide> this.stop();
<ide> }
<ide> this.loadedState = state; |
|
Java | apache-2.0 | a41555b33338ef774a537fba57988160cb1afd51 | 0 | albinsuresh/terracotta-platform,Terracotta-OSS/terracotta-platform,albinsuresh/terracotta-platform,chrisdennis/terracotta-platform,Terracotta-OSS/terracotta-platform,chrisdennis/terracotta-platform | /*
* Copyright Terracotta, Inc.
*
* 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.
*/
package org.terracotta.dynamic_config.server.configuration.startup;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tc.text.PrettyPrintable;
import org.terracotta.common.struct.TimeUnit;
import org.terracotta.common.struct.Tuple2;
import org.terracotta.configuration.Configuration;
import org.terracotta.configuration.FailoverBehavior;
import org.terracotta.configuration.ServerConfiguration;
import org.terracotta.dynamic_config.api.model.Cluster;
import org.terracotta.dynamic_config.api.model.FailoverPriority;
import org.terracotta.dynamic_config.api.model.Node;
import org.terracotta.dynamic_config.api.model.NodeContext;
import org.terracotta.dynamic_config.api.service.IParameterSubstitutor;
import org.terracotta.dynamic_config.api.service.Props;
import org.terracotta.dynamic_config.server.api.DynamicConfigExtension;
import org.terracotta.dynamic_config.server.api.PathResolver;
import org.terracotta.entity.PlatformConfiguration;
import org.terracotta.entity.ServiceProviderConfiguration;
import org.terracotta.entity.StateDumpCollector;
import org.terracotta.entity.StateDumpable;
import org.terracotta.json.ObjectMapperFactory;
import org.terracotta.monitoring.PlatformService;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UncheckedIOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.ServiceLoader;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.terracotta.common.struct.Tuple2.tuple2;
public class StartupConfiguration implements Configuration, PrettyPrintable, StateDumpable, PlatformConfiguration, DynamicConfigExtension.Registrar {
private final Collection<Tuple2<Class<?>, Object>> extendedConfigurations = new CopyOnWriteArrayList<>();
private final Collection<ServiceProviderConfiguration> serviceProviderConfigurations = new CopyOnWriteArrayList<>();
private final Supplier<NodeContext> nodeContextSupplier;
private final boolean unConfigured;
private final boolean repairMode;
private final ClassLoader classLoader;
private final PathResolver pathResolver;
private final IParameterSubstitutor substitutor;
private final ObjectMapper objectMapper;
StartupConfiguration(Supplier<NodeContext> nodeContextSupplier, boolean unConfigured, boolean repairMode, ClassLoader classLoader, PathResolver pathResolver, IParameterSubstitutor substitutor, ObjectMapperFactory objectMapperFactory) {
this.nodeContextSupplier = requireNonNull(nodeContextSupplier);
this.unConfigured = unConfigured;
this.repairMode = repairMode;
this.classLoader = requireNonNull(classLoader);
this.pathResolver = requireNonNull(pathResolver);
this.substitutor = requireNonNull(substitutor);
this.objectMapper = objectMapperFactory.create();
}
@Override
public <T> List<T> getExtendedConfiguration(Class<T> type) {
requireNonNull(type);
List<T> out = new ArrayList<>(1);
for (Tuple2<Class<?>, Object> extendedConfiguration : extendedConfigurations) {
if (extendedConfiguration.t1 == type) {
out.add(type.cast(extendedConfiguration.t2));
} else if (extendedConfiguration.t1 == null && type.isInstance(extendedConfiguration.t2)) {
out.add(type.cast(extendedConfiguration.t2));
} else if (extendedConfiguration.t1 != null && extendedConfiguration.t1.getName().equals(type.getName())) {
throw new IllegalArgumentException("Requested service type " + type + " from classloader " + type.getClassLoader() + " but has service " + extendedConfiguration.t1 + " from classlaoder " + extendedConfiguration.t1.getClassLoader());
}
}
return out;
}
@Override
public List<ServiceProviderConfiguration> getServiceConfigurations() {
return new ArrayList<>(serviceProviderConfigurations);
}
@Override
public boolean isPartialConfiguration() {
return unConfigured || repairMode;
}
@Override
public ServerConfiguration getServerConfiguration() {
return toServerConfiguration(nodeContextSupplier.get().getNode());
}
@Override
public List<ServerConfiguration> getServerConfigurations() {
return nodeContextSupplier.get().getStripe().getNodes().stream().map(this::toServerConfiguration).collect(toList());
}
/**
* Consumed by {@link PlatformService#getPlatformConfiguration()} to output the configuration.
* <p>
* MnM is using that and it needs to have a better view that what we had before (props resolved and also user set added in a separated section)
* <p>
* So this mimics what the export command would do
*/
@Override
public String getRawConfiguration() {
NodeContext nodeContext = nodeContextSupplier.get();
Cluster cluster = nodeContext.getCluster();
Properties nonDefaults = cluster.toProperties(false, false);
substitute(nodeContext, nonDefaults);
try (StringWriter out = new StringWriter()) {
Props.store(out, nonDefaults, "User-defined configurations for node '" + nodeContext.getNodeName() + "' in stripe ID " + nodeContext.getStripeId());
return out.toString();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
/**
* This is shown in the logs. We need to show the whole effective config that will be in place, resolved
*/
@Override
public String toString() {
return getRawConfiguration();
}
@Override
public Properties getTcProperties() {
Properties copy = new Properties();
copy.putAll(nodeContextSupplier.get().getNode().getTcProperties());
return copy;
}
@Override
public FailoverBehavior getFailoverPriority() {
final FailoverPriority failoverPriority = nodeContextSupplier.get().getCluster().getFailoverPriority();
switch (failoverPriority.getType()) {
case CONSISTENCY:
return new FailoverBehavior(FailoverBehavior.Type.CONSISTENCY, failoverPriority.getVoters());
case AVAILABILITY:
return new FailoverBehavior(FailoverBehavior.Type.AVAILABILITY, 0);
default:
throw new AssertionError(failoverPriority.getType());
}
}
@Override
public Map<String, ?> getStateMap() {
Map<String, Object> main = new LinkedHashMap<>();
StateDumpCollector collector = createCollector("collector", main);
StateDumpCollector startupConfig = collector.subStateDumpCollector(getClass().getName());
startupConfig.addState("unConfigured", unConfigured);
startupConfig.addState("repairMode", repairMode);
startupConfig.addState("partialConfig", isPartialConfiguration());
startupConfig.addState("startupNodeContext", toMap(nodeContextSupplier.get()));
StateDumpCollector platformConfig = collector.subStateDumpCollector(PlatformConfiguration.class.getName());
addStateTo(platformConfig);
StateDumpCollector serviceProviderConfigurations = collector.subStateDumpCollector("ServiceProviderConfigurations");
this.serviceProviderConfigurations.stream()
.filter(StateDumpable.class::isInstance)
.map(StateDumpable.class::cast)
.forEach(sd -> sd.addStateTo(serviceProviderConfigurations.subStateDumpCollector(sd.getClass().getName())));
return main;
}
private Map<String, ?> toMap(Object o) {
try {
JsonNode node = objectMapper.valueToTree(o);
JsonParser jsonParser = objectMapper.treeAsTokens(node);
return jsonParser.readValueAs(new TypeReference<Map<String, ?>>() {});
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
private StateDumpCollector createCollector(String name, Map<String, Object> map) {
return new StateDumpCollector() {
@Override
public StateDumpCollector subStateDumpCollector(String name) {
Map<String, Object> sub = new LinkedHashMap<>();
map.put(name, sub);
return createCollector(name, sub);
}
@Override
public void addState(String key, Object value) {
map.put(key, value);
}
};
}
@Override
public void addStateTo(StateDumpCollector stateDumpCollector) {
stateDumpCollector.addState("serverName", getServerName());
stateDumpCollector.addState("host", getHost());
stateDumpCollector.addState("tsaPort", getTsaPort());
StateDumpCollector extendedConfigurations = stateDumpCollector.subStateDumpCollector("ExtendedConfigs");
this.extendedConfigurations.stream()
.map(Tuple2::getT2)
.filter(StateDumpable.class::isInstance)
.map(StateDumpable.class::cast)
.forEach(sd -> sd.addStateTo(extendedConfigurations.subStateDumpCollector(sd.getClass().getName())));
}
@Override
public String getServerName() {
return nodeContextSupplier.get().getNodeName();
}
@Override
public String getHost() {
return nodeContextSupplier.get().getNode().getNodeHostname();
}
@Override
public int getTsaPort() {
return nodeContextSupplier.get().getNode().getNodePort();
}
@Override
public void registerExtendedConfiguration(Object o) {
registerExtendedConfiguration(null, o);
}
@Override
public <T> void registerExtendedConfiguration(Class<T> type, T implementation) {
extendedConfigurations.add(tuple2(type, implementation));
}
@Override
public void registerServiceProviderConfiguration(ServiceProviderConfiguration serviceProviderConfiguration) {
serviceProviderConfigurations.add(serviceProviderConfiguration);
}
public void discoverExtensions() {
for (DynamicConfigExtension dynamicConfigExtension : ServiceLoader.load(DynamicConfigExtension.class, classLoader)) {
dynamicConfigExtension.configure(this, this);
}
}
private void substitute(NodeContext nodeContext, Properties properties) {
int stripeId = nodeContext.getStripeId();
int nodeId = nodeContext.getNodeId();
String prefix = "stripe." + stripeId + ".node." + nodeId + ".";
properties.stringPropertyNames().stream()
.filter(key -> !key.startsWith("stripe.") || key.startsWith(prefix)) // we only substitute cluster-wide parameters plus this node's parameters
.forEach(key -> properties.setProperty(key, substitutor.substitute(properties.getProperty(key))));
}
private ServerConfiguration toServerConfiguration(Node node) {
NodeContext nodeContext = nodeContextSupplier.get();
return new ServerConfiguration() {
@Override
public InetSocketAddress getTsaPort() {
return InetSocketAddress.createUnresolved(substitutor.substitute(node.getNodeBindAddress()), node.getNodePort());
}
@Override
public InetSocketAddress getGroupPort() {
return InetSocketAddress.createUnresolved(substitutor.substitute(node.getNodeGroupBindAddress()), node.getNodeGroupPort());
}
@Override
public String getHost() {
// substitutions not allowed on hostname since hostname-port is a key to identify a node
// any substitution is allowed but resolved eagerly when parsing the CLI
return node.getNodeHostname();
}
@Override
public String getName() {
// substitutions not allowed on name since stripe ID / name is a key to identify a node
return node.getNodeName();
}
@Override
public int getClientReconnectWindow() {
return nodeContext.getCluster().getClientReconnectWindow().getExactQuantity(TimeUnit.SECONDS).intValueExact();
}
@Override
public void setClientReconnectWindow(int value) {
nodeContext.getCluster().setClientReconnectWindow(value, TimeUnit.SECONDS);
}
@Override
public File getLogsLocation() {
String sanitizedNodeName = node.getNodeName().replace(":", "-"); // Sanitize for path
return (unConfigured) ? null : substitutor.substitute(pathResolver.resolve(node.getNodeLogDir().resolve(sanitizedNodeName))).toFile();
}
@Override
public String toString() {
return node.getNodeName() + "@" + node.getNodeAddress();
}
};
}
}
| dynamic-config/server/configuration-provider/src/main/java/org/terracotta/dynamic_config/server/configuration/startup/StartupConfiguration.java | /*
* Copyright Terracotta, Inc.
*
* 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.
*/
package org.terracotta.dynamic_config.server.configuration.startup;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tc.text.PrettyPrintable;
import org.terracotta.common.struct.TimeUnit;
import org.terracotta.common.struct.Tuple2;
import org.terracotta.configuration.Configuration;
import org.terracotta.configuration.FailoverBehavior;
import org.terracotta.configuration.ServerConfiguration;
import org.terracotta.dynamic_config.api.model.Cluster;
import org.terracotta.dynamic_config.api.model.FailoverPriority;
import org.terracotta.dynamic_config.api.model.Node;
import org.terracotta.dynamic_config.api.model.NodeContext;
import org.terracotta.dynamic_config.api.service.IParameterSubstitutor;
import org.terracotta.dynamic_config.api.service.Props;
import org.terracotta.dynamic_config.server.api.DynamicConfigExtension;
import org.terracotta.dynamic_config.server.api.PathResolver;
import org.terracotta.entity.PlatformConfiguration;
import org.terracotta.entity.ServiceProviderConfiguration;
import org.terracotta.entity.StateDumpCollector;
import org.terracotta.entity.StateDumpable;
import org.terracotta.json.ObjectMapperFactory;
import org.terracotta.monitoring.PlatformService;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UncheckedIOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.ServiceLoader;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.terracotta.common.struct.Tuple2.tuple2;
public class StartupConfiguration implements Configuration, PrettyPrintable, StateDumpable, PlatformConfiguration, DynamicConfigExtension.Registrar {
private final Collection<Tuple2<Class<?>, Object>> extendedConfigurations = new CopyOnWriteArrayList<>();
private final Collection<ServiceProviderConfiguration> serviceProviderConfigurations = new CopyOnWriteArrayList<>();
private final Supplier<NodeContext> nodeContextSupplier;
private final boolean unConfigured;
private final boolean repairMode;
private final ClassLoader classLoader;
private final PathResolver pathResolver;
private final IParameterSubstitutor substitutor;
private final ObjectMapper objectMapper;
StartupConfiguration(Supplier<NodeContext> nodeContextSupplier, boolean unConfigured, boolean repairMode, ClassLoader classLoader, PathResolver pathResolver, IParameterSubstitutor substitutor, ObjectMapperFactory objectMapperFactory) {
this.nodeContextSupplier = requireNonNull(nodeContextSupplier);
this.unConfigured = unConfigured;
this.repairMode = repairMode;
this.classLoader = requireNonNull(classLoader);
this.pathResolver = requireNonNull(pathResolver);
this.substitutor = requireNonNull(substitutor);
this.objectMapper = objectMapperFactory.create();
}
@Override
public <T> List<T> getExtendedConfiguration(Class<T> type) {
requireNonNull(type);
List<T> out = new ArrayList<>(1);
for (Tuple2<Class<?>, Object> extendedConfiguration : extendedConfigurations) {
if (extendedConfiguration.t1 == type) {
out.add(type.cast(extendedConfiguration.t2));
} else if (extendedConfiguration.t1 == null && type.isInstance(extendedConfiguration.t2)) {
out.add(type.cast(extendedConfiguration.t2));
} else if (extendedConfiguration.t1 != null && extendedConfiguration.t1.getName().equals(type.getName())) {
throw new IllegalArgumentException("Requested service type " + type + " from classloader " + type.getClassLoader() + " but has service " + extendedConfiguration.t1 + " from classlaoder " + extendedConfiguration.t1.getClassLoader());
}
}
return out;
}
@Override
public List<ServiceProviderConfiguration> getServiceConfigurations() {
return new ArrayList<>(serviceProviderConfigurations);
}
@Override
public boolean isPartialConfiguration() {
return unConfigured || repairMode;
}
@Override
public ServerConfiguration getServerConfiguration() {
return toServerConfiguration(nodeContextSupplier.get().getNode());
}
@Override
public List<ServerConfiguration> getServerConfigurations() {
return nodeContextSupplier.get().getStripe().getNodes().stream().map(this::toServerConfiguration).collect(toList());
}
/**
* Consumed by {@link PlatformService#getPlatformConfiguration()} to output the configuration.
* <p>
* MnM is using that and it needs to have a better view that what we had before (props resolved and also user set added in a separated section)
* <p>
* So this mimics what the export command would do
*/
@Override
public String getRawConfiguration() {
NodeContext nodeContext = nodeContextSupplier.get();
Cluster cluster = nodeContext.getCluster();
Properties nonDefaults = cluster.toProperties(false, false);
substitute(nodeContext, nonDefaults);
try (StringWriter out = new StringWriter()) {
Props.store(out, nonDefaults, "User-defined configurations for node '" + nodeContext.getNodeName() + "' in stripe ID " + nodeContext.getStripeId());
return out.toString();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
/**
* This is shown in the logs. We need to show the whole effective config that will be in place, resolved
*/
@Override
public String toString() {
return getRawConfiguration();
}
@Override
public Properties getTcProperties() {
Properties copy = new Properties();
copy.putAll(nodeContextSupplier.get().getNode().getTcProperties());
return copy;
}
@Override
public FailoverBehavior getFailoverPriority() {
final FailoverPriority failoverPriority = nodeContextSupplier.get().getCluster().getFailoverPriority();
switch (failoverPriority.getType()) {
case CONSISTENCY:
return new FailoverBehavior(FailoverBehavior.Type.CONSISTENCY, failoverPriority.getVoters());
case AVAILABILITY:
return new FailoverBehavior(FailoverBehavior.Type.AVAILABILITY, 0);
default:
throw new AssertionError(failoverPriority.getType());
}
}
@Override
public Map<String, ?> getStateMap() {
Map<String, Object> main = new LinkedHashMap<>();
StateDumpCollector collector = createCollector("collector", main);
StateDumpCollector startupConfig = collector.subStateDumpCollector(getClass().getName());
startupConfig.addState("unConfigured", unConfigured);
startupConfig.addState("repairMode", repairMode);
startupConfig.addState("partialConfig", isPartialConfiguration());
startupConfig.addState("startupNodeContext", toMap(nodeContextSupplier.get()));
StateDumpCollector platformConfig = collector.subStateDumpCollector(PlatformConfiguration.class.getName());
addStateTo(platformConfig);
StateDumpCollector serviceProviderConfigurations = collector.subStateDumpCollector("ServiceProviderConfigurations");
this.serviceProviderConfigurations.stream()
.filter(StateDumpable.class::isInstance)
.map(StateDumpable.class::cast)
.forEach(sd -> sd.addStateTo(serviceProviderConfigurations.subStateDumpCollector(sd.getClass().getName())));
return main;
}
private Map<String, ?> toMap(Object o) {
try {
JsonNode node = objectMapper.valueToTree(o);
JsonParser jsonParser = objectMapper.treeAsTokens(node);
return jsonParser.readValueAs(new TypeReference<Map<String, ?>>() {});
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
private StateDumpCollector createCollector(String name, Map<String, Object> map) {
return new StateDumpCollector() {
@Override
public StateDumpCollector subStateDumpCollector(String name) {
Map<String, Object> sub = new LinkedHashMap<>();
map.put(name, sub);
return createCollector(name, sub);
}
@Override
public void addState(String key, Object value) {
map.put(key, value);
}
};
}
@Override
public void addStateTo(StateDumpCollector stateDumpCollector) {
stateDumpCollector.addState("serverName", getServerName());
stateDumpCollector.addState("host", getHost());
stateDumpCollector.addState("tsaPort", getTsaPort());
StateDumpCollector extendedConfigurations = stateDumpCollector.subStateDumpCollector("ExtendedConfigs");
this.extendedConfigurations.stream()
.map(Tuple2::getT2)
.filter(StateDumpable.class::isInstance)
.map(StateDumpable.class::cast)
.forEach(sd -> sd.addStateTo(extendedConfigurations.subStateDumpCollector(sd.getClass().getName())));
}
@Override
public String getServerName() {
return nodeContextSupplier.get().getNodeName();
}
@Override
public String getHost() {
return nodeContextSupplier.get().getNode().getNodeHostname();
}
@Override
public int getTsaPort() {
return nodeContextSupplier.get().getNode().getNodePort();
}
@Override
public void registerExtendedConfiguration(Object o) {
registerExtendedConfiguration(null, o);
}
@Override
public <T> void registerExtendedConfiguration(Class<T> type, T implementation) {
extendedConfigurations.add(tuple2(type, implementation));
}
@Override
public void registerServiceProviderConfiguration(ServiceProviderConfiguration serviceProviderConfiguration) {
serviceProviderConfigurations.add(serviceProviderConfiguration);
}
public void discoverExtensions() {
for (DynamicConfigExtension dynamicConfigExtension : ServiceLoader.load(DynamicConfigExtension.class, classLoader)) {
dynamicConfigExtension.configure(this, this);
}
}
private void substitute(NodeContext nodeContext, Properties properties) {
int stripeId = nodeContext.getStripeId();
int nodeId = nodeContext.getNodeId();
String prefix = "stripe." + stripeId + ".node." + nodeId + ".";
properties.stringPropertyNames().stream()
.filter(key -> !key.startsWith("stripe.") || key.startsWith(prefix)) // we only substitute cluster-wide parameters plus this node's parameters
.forEach(key -> properties.setProperty(key, substitutor.substitute(properties.getProperty(key))));
}
private ServerConfiguration toServerConfiguration(Node node) {
NodeContext nodeContext = nodeContextSupplier.get();
return new ServerConfiguration() {
@Override
public InetSocketAddress getTsaPort() {
return InetSocketAddress.createUnresolved(substitutor.substitute(node.getNodeBindAddress()), node.getNodePort());
}
@Override
public InetSocketAddress getGroupPort() {
return InetSocketAddress.createUnresolved(substitutor.substitute(node.getNodeGroupBindAddress()), node.getNodeGroupPort());
}
@Override
public String getHost() {
// substitutions not allowed on hostname since hostname-port is a key to identify a node
// any substitution is allowed but resolved eagerly when parsing the CLI
return node.getNodeHostname();
}
@Override
public String getName() {
// substitutions not allowed on name since stripe ID / name is a key to identify a node
return node.getNodeName();
}
@Override
public int getClientReconnectWindow() {
return nodeContext.getCluster().getClientReconnectWindow().getExactQuantity(TimeUnit.SECONDS).intValueExact();
}
@Override
public void setClientReconnectWindow(int value) {
nodeContext.getCluster().setClientReconnectWindow(value, TimeUnit.SECONDS);
}
@Override
public File getLogsLocation() {
return (unConfigured) ? null : substitutor.substitute(pathResolver.resolve(node.getNodeLogDir().resolve(node.getNodeName()))).toFile();
}
@Override
public String toString() {
return node.getNodeName() + "@" + node.getNodeAddress();
}
};
}
}
| Sanitize server name for special characters so that directory creation doesn't fail
| dynamic-config/server/configuration-provider/src/main/java/org/terracotta/dynamic_config/server/configuration/startup/StartupConfiguration.java | Sanitize server name for special characters so that directory creation doesn't fail | <ide><path>ynamic-config/server/configuration-provider/src/main/java/org/terracotta/dynamic_config/server/configuration/startup/StartupConfiguration.java
<ide>
<ide> @Override
<ide> public File getLogsLocation() {
<del> return (unConfigured) ? null : substitutor.substitute(pathResolver.resolve(node.getNodeLogDir().resolve(node.getNodeName()))).toFile();
<add> String sanitizedNodeName = node.getNodeName().replace(":", "-"); // Sanitize for path
<add> return (unConfigured) ? null : substitutor.substitute(pathResolver.resolve(node.getNodeLogDir().resolve(sanitizedNodeName))).toFile();
<ide> }
<ide>
<ide> @Override |
|
Java | mit | 3e5ccaeb2effa312c66c28c0a9c079caba33d55b | 0 | KylanTraynor/MangoStructures | package com.kylantraynor.mangostructures.structures;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.kylantraynor.mangostructures.MangoStructures;
public class Bell extends Structure{
private static ArrayList<Bell> bells = new ArrayList<Bell>();
enum BlockType{
BRASS,
IRON,
CLAPPER,
UNDEFINED
}
static String[] validShapes = {
"[..x..-..x..][..c..-..c..]",
"[..x..-..x..][..x..-..x..][..c..-..c..]",
"[..x..-..x..][.xcx.-.xcx.][..c..-..c..]",
"[.xxx.-.xxx.][.xcx.-.xcx.][..c..-..c..]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]"
};
private String shape = "";
private BlockType[][][] blockShape;
private List<BlockState> blocks;
private boolean inRefractoryPeriod = false;
private String name;
public Bell(Location l) {
super(l);
loadShape();
if(isValidShape()){
bells.add(this);
}
}
private void loadShape() {
String clapper = "c";
String bell = "x";
String air = "0";
String other = ".";
int maxHeight = 0;
for(String s : validShapes){
maxHeight = Math.max(maxHeight, s.split("-").length - 1);
}
StringBuilder sb = new StringBuilder();
for(int y = 1; y <= maxHeight; y++){
StringBuilder sb1 = new StringBuilder();
sb1.append("[");
for(int x = -2; x <= 2; x++){
switch(getLocation().clone().add(x, -y, 0).getBlock().getType()){
case IRON_BLOCK: case GOLD_BLOCK:
sb1.append(bell);
break;
case FENCE: case ACACIA_FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
sb1.append(clapper);
break;
//case AIR:
// sb1.append(air);
default:
sb1.append(other);
break;
}
}
sb1.append("-");
for(int z = -2; z <= 2; z++){
switch(getLocation().clone().add(0, -y, z).getBlock().getType()){
case IRON_BLOCK: case GOLD_BLOCK:
sb1.append(bell);
break;
case FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
sb1.append(clapper);
break;
default:
sb1.append(other);
break;
}
}
sb1.append("]");
if(!sb1.toString().equalsIgnoreCase("[.....-.....]")){
sb.append(sb1.toString());
}
}
shape = sb.toString();
if(isValidShape()){
Location l = getLocation().clone().add(0, -1, 0);
blocks = new ArrayList<BlockState>();
blocks.add(l.getBlock().getState());
addBlocksAround(l);
}
}
private void addBlocksAround(Location l) {
for(int y = 0; y >= -1; y--){
for(int x = -1; x <= 1; x++){
for(int z = -1; z <= 1; z++){
Block b = l.getWorld().getBlockAt(l.getBlockX() + x, l.getBlockY() + y, l.getBlockZ() + z);
if(!blocks.contains(b) && isBellBlock(b)){
blocks.add(b.getState());
addBlocksAround(b.getLocation());
}
}
}
}
}
public static boolean isBellBlock(Block b){
if(b.getType() == Material.GOLD_BLOCK) return true;
if(b.getType() == Material.IRON_BLOCK) return true;
return isClapperMaterial(b.getType());
}
public boolean isValidShape(){
for(String s : validShapes){
if(s.equals(shape)) return true;
}
return false;
}
public int getBrassAmount(){
int count = 0;
for(BlockState b : blocks){
if(b.getType() == Material.GOLD_BLOCK) count++;
}
return count;
}
public int getIronAmount(){
int count = 0;
for(BlockState b : blocks){
if(b.getType() == Material.IRON_BLOCK) count++;
}
return count;
}
public void ring(){
if(inRefractoryPeriod){ return;}
float pitch = 2F - (((float) getIronAmount()) / 15.0F) - (((float) getBrassAmount()) / 20.0F);
float volume = (float) ((2.0f - pitch) * 3.0F + ((float) getLocation().getY()) * 0.1F);
for(Player player : Bukkit.getOnlinePlayers()){
MangoStructures.DEBUG(this.getName() + " is ringing with pitch: " + pitch + " and volume: " + volume + ".");
player.playSound(getLocation(), "bell01", volume, pitch);
}
this.getLocation().getWorld().playEffect(getLocation().clone().add(0, -3, 0), Effect.RECORD_PLAY, 1);
inRefractoryPeriod = true;
BukkitRunnable r = new BukkitRunnable(){
@Override
public void run() {
inRefractoryPeriod = false;
}
};
r.runTaskLater(MangoStructures.currentInstance, 10L);
}
public String getName() {
return this.name;
}
public void setName(String newName){
this.name = newName;
}
public static boolean isClapperMaterial(Material type) {
if(type == Material.FENCE) return true;
if(type == Material.COBBLE_WALL) return true;
if(type == Material.SPRUCE_FENCE) return true;
if(type == Material.DARK_OAK_FENCE) return true;
if(type == Material.BIRCH_FENCE) return true;
if(type == Material.JUNGLE_FENCE) return true;
if(type == Material.ACACIA_FENCE) return true;
return false;
}
public static ArrayList<Bell> getBells() {
return bells;
}
public static void setBells(ArrayList<Bell> bells) {
Bell.bells = bells;
}
public boolean has(Block clickedBlock) {
Location l1 = clickedBlock.getLocation();
int x1 = l1.getBlockX();
int y1 = l1.getBlockY();
int z1 = l1.getBlockZ();
if(x1 < this.getLocation().getBlockX() - 3 || x1 > this.getLocation().getBlockX() + 3) return false;
if(y1 < this.getLocation().getBlockY() - 6 || y1 > this.getLocation().getBlockY()) return false;
if(z1 < this.getLocation().getBlockZ() - 3 || z1 > this.getLocation().getBlockZ() + 3) return false;
for(BlockState s : blocks){
Location l = s.getLocation();
if(l.getBlockX() == x1 && l.getBlockY() == y1 && l.getBlockZ() == z1){
return true;
}
}
return false;
}
public String getShape() {
return shape;
}
}
| MangoStructures/src/main/java/com/kylantraynor/mangostructures/structures/Bell.java | package com.kylantraynor.mangostructures.structures;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.kylantraynor.mangostructures.MangoStructures;
public class Bell extends Structure{
private static ArrayList<Bell> bells = new ArrayList<Bell>();
enum BlockType{
BRASS,
IRON,
CLAPPER,
UNDEFINED
}
static String[] validShapes = {
"[..x..-..x..][..c..-..c..]",
"[..x..-..x..][..x..-..x..][..c..-..c..]",
"[..x..-..x..][.xcx.-.xcx.][..c..-..c..]",
"[.xxx.-.xxx.][.xcx.-.xcx.][..c..-..c..]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]",
"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]"
};
private String shape = "";
private BlockType[][][] blockShape;
private List<BlockState> blocks;
private boolean inRefractoryPeriod = false;
private String name;
public Bell(Location l) {
super(l);
loadShape();
if(isValidShape()){
bells.add(this);
}
}
private void loadShape() {
String clapper = "c";
String bell = "x";
String air = "0";
String other = ".";
int maxHeight = 0;
for(String s : validShapes){
maxHeight = Math.max(maxHeight, s.split("-").length - 1);
}
StringBuilder sb = new StringBuilder();
for(int y = 1; y <= maxHeight; y++){
StringBuilder sb1 = new StringBuilder();
sb1.append("[");
for(int x = -2; x <= 2; x++){
switch(getLocation().clone().add(x, -y, 0).getBlock().getType()){
case IRON_BLOCK: case GOLD_BLOCK:
sb1.append(bell);
case FENCE: case ACACIA_FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
sb1.append(clapper);
//case AIR:
// sb1.append(air);
default:
sb1.append(other);
}
}
sb1.append("-");
for(int z = -2; z <= 2; z++){
switch(getLocation().clone().add(0, -y, z).getBlock().getType()){
case IRON_BLOCK: case GOLD_BLOCK:
sb1.append(bell);
case FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
sb1.append(clapper);
default:
sb1.append(air);
}
}
sb1.append("]");
if(!sb1.toString().equalsIgnoreCase("[00000-00000]")){
sb.append(sb1.toString());
}
}
shape = sb.toString();
if(isValidShape()){
Location l = getLocation().clone().add(0, -1, 0);
blocks = new ArrayList<BlockState>();
blocks.add(l.getBlock().getState());
addBlocksAround(l);
}
}
private void addBlocksAround(Location l) {
for(int y = 0; y >= -1; y--){
for(int x = -1; x <= 1; x++){
for(int z = -1; z <= 1; z++){
Block b = l.getWorld().getBlockAt(l.getBlockX() + x, l.getBlockY() + y, l.getBlockZ() + z);
if(!blocks.contains(b) && isBellBlock(b)){
blocks.add(b.getState());
addBlocksAround(b.getLocation());
}
}
}
}
}
public static boolean isBellBlock(Block b){
if(b.getType() == Material.GOLD_BLOCK) return true;
if(b.getType() == Material.IRON_BLOCK) return true;
return isClapperMaterial(b.getType());
}
public boolean isValidShape(){
for(String s : validShapes){
if(s.equals(shape)) return true;
}
return false;
}
public int getBrassAmount(){
int count = 0;
for(BlockState b : blocks){
if(b.getType() == Material.GOLD_BLOCK) count++;
}
return count;
}
public int getIronAmount(){
int count = 0;
for(BlockState b : blocks){
if(b.getType() == Material.IRON_BLOCK) count++;
}
return count;
}
public void ring(){
if(inRefractoryPeriod){ return;}
float pitch = 2F - (((float) getIronAmount()) / 15.0F) - (((float) getBrassAmount()) / 20.0F);
float volume = (float) ((2.0f - pitch) * 3.0F + ((float) getLocation().getY()) * 0.1F);
for(Player player : Bukkit.getOnlinePlayers()){
MangoStructures.DEBUG(this.getName() + " is ringing with pitch: " + pitch + " and volume: " + volume + ".");
player.playSound(getLocation(), "bell01", volume, pitch);
}
this.getLocation().getWorld().playEffect(getLocation().clone().add(0, -3, 0), Effect.RECORD_PLAY, 1);
inRefractoryPeriod = true;
BukkitRunnable r = new BukkitRunnable(){
@Override
public void run() {
inRefractoryPeriod = false;
}
};
r.runTaskLater(MangoStructures.currentInstance, 10L);
}
public String getName() {
return this.name;
}
public void setName(String newName){
this.name = newName;
}
public static boolean isClapperMaterial(Material type) {
if(type == Material.FENCE) return true;
if(type == Material.COBBLE_WALL) return true;
if(type == Material.SPRUCE_FENCE) return true;
if(type == Material.DARK_OAK_FENCE) return true;
if(type == Material.BIRCH_FENCE) return true;
if(type == Material.JUNGLE_FENCE) return true;
if(type == Material.ACACIA_FENCE) return true;
return false;
}
public static ArrayList<Bell> getBells() {
return bells;
}
public static void setBells(ArrayList<Bell> bells) {
Bell.bells = bells;
}
public boolean has(Block clickedBlock) {
Location l1 = clickedBlock.getLocation();
int x1 = l1.getBlockX();
int y1 = l1.getBlockY();
int z1 = l1.getBlockZ();
if(x1 < this.getLocation().getBlockX() - 3 || x1 > this.getLocation().getBlockX() + 3) return false;
if(y1 < this.getLocation().getBlockY() - 6 || y1 > this.getLocation().getBlockY()) return false;
if(z1 < this.getLocation().getBlockZ() - 3 || z1 > this.getLocation().getBlockZ() + 3) return false;
for(BlockState s : blocks){
Location l = s.getLocation();
if(l.getBlockX() == x1 && l.getBlockY() == y1 && l.getBlockZ() == z1){
return true;
}
}
return false;
}
public String getShape() {
return shape;
}
}
| Fixed shapes. | MangoStructures/src/main/java/com/kylantraynor/mangostructures/structures/Bell.java | Fixed shapes. | <ide><path>angoStructures/src/main/java/com/kylantraynor/mangostructures/structures/Bell.java
<ide> switch(getLocation().clone().add(x, -y, 0).getBlock().getType()){
<ide> case IRON_BLOCK: case GOLD_BLOCK:
<ide> sb1.append(bell);
<add> break;
<ide> case FENCE: case ACACIA_FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
<ide> sb1.append(clapper);
<add> break;
<ide> //case AIR:
<ide> // sb1.append(air);
<ide> default:
<ide> sb1.append(other);
<add> break;
<ide> }
<ide> }
<ide> sb1.append("-");
<ide> switch(getLocation().clone().add(0, -y, z).getBlock().getType()){
<ide> case IRON_BLOCK: case GOLD_BLOCK:
<ide> sb1.append(bell);
<add> break;
<ide> case FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
<ide> sb1.append(clapper);
<add> break;
<ide> default:
<del> sb1.append(air);
<add> sb1.append(other);
<add> break;
<ide> }
<ide> }
<ide> sb1.append("]");
<del> if(!sb1.toString().equalsIgnoreCase("[00000-00000]")){
<add> if(!sb1.toString().equalsIgnoreCase("[.....-.....]")){
<ide> sb.append(sb1.toString());
<ide> }
<ide> } |
|
Java | apache-2.0 | 87dddf1e9f14055d690d71becada91bc5f0e59e5 | 0 | rrenomeron/cas,gabedwrds/cas,tduehr/cas,robertoschwald/cas,philliprower/cas,prigaux/cas,creamer/cas,Jasig/cas,yisiqi/cas,apereo/cas,philliprower/cas,philliprower/cas,apereo/cas,leleuj/cas,yisiqi/cas,William-Hill-Online/cas,fogbeam/cas_mirror,apereo/cas,doodelicious/cas,rkorn86/cas,fogbeam/cas_mirror,yisiqi/cas,frett/cas,Unicon/cas,doodelicious/cas,rkorn86/cas,pdrados/cas,pmarasse/cas,pdrados/cas,philliprower/cas,Unicon/cas,creamer/cas,zawn/cas,leleuj/cas,rrenomeron/cas,creamer/cas,leleuj/cas,prigaux/cas,philliprower/cas,rrenomeron/cas,pdrados/cas,philliprower/cas,Jasig/cas,zhoffice/cas,rkorn86/cas,Jasig/cas,GIP-RECIA/cas,apereo/cas,prigaux/cas,tduehr/cas,GIP-RECIA/cas,pmarasse/cas,frett/cas,petracvv/cas,gabedwrds/cas,William-Hill-Online/cas,zhoffice/cas,fogbeam/cas_mirror,apereo/cas,zawn/cas,leleuj/cas,yisiqi/cas,robertoschwald/cas,pmarasse/cas,tduehr/cas,pmarasse/cas,creamer/cas,robertoschwald/cas,gabedwrds/cas,apereo/cas,Jasig/cas,petracvv/cas,rrenomeron/cas,philliprower/cas,dodok1/cas,rkorn86/cas,gabedwrds/cas,zawn/cas,doodelicious/cas,robertoschwald/cas,dodok1/cas,leleuj/cas,frett/cas,GIP-RECIA/cas,dodok1/cas,GIP-RECIA/cas,frett/cas,GIP-RECIA/cas,Unicon/cas,fogbeam/cas_mirror,William-Hill-Online/cas,fogbeam/cas_mirror,William-Hill-Online/cas,pdrados/cas,zawn/cas,zhoffice/cas,petracvv/cas,doodelicious/cas,zhoffice/cas,Unicon/cas,prigaux/cas,petracvv/cas,pdrados/cas,rrenomeron/cas,dodok1/cas,tduehr/cas,apereo/cas,pdrados/cas,Unicon/cas,fogbeam/cas_mirror,leleuj/cas | /*
* Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license
* distributed with this file and available online at
* http://www.ja-sig.org/products/cas/overview/license/
*/
package org.jasig.cas.ticket.support;
import junit.framework.TestCase;
import org.jasig.cas.TestUtils;
import org.jasig.cas.ticket.TicketGrantingTicket;
import org.jasig.cas.ticket.TicketGrantingTicketImpl;
/**
* @author William G. Thompson, Jr.
* @version $Revision$ $Date$
* @since 3.4.10
*/
public class TicketGrantingTicketExpirationPolicyTests extends TestCase {
private static final long HARD_TIMEOUT = 10000; // 10s
private static final long SLIDING_TIMEOUT = 2000; // 2s
private TicketGrantingTicketExpirationPolicy expirationPolicy;
private TicketGrantingTicket ticketGrantingTicket;
protected void setUp() throws Exception {
expirationPolicy = new TicketGrantingTicketExpirationPolicy();
expirationPolicy.setMaxTimeToLiveInMilliSeconds(HARD_TIMEOUT);
expirationPolicy.setTimeToKillInMilliSeconds(SLIDING_TIMEOUT);
ticketGrantingTicket = new TicketGrantingTicketImpl("test", TestUtils.getAuthentication(), expirationPolicy);
super.setUp();
}
public void testTgtIsExpiredByHardTimeOut() throws InterruptedException {
try {
// keep tgt alive via sliding window until within SLIDING_TIME / 2 of the HARD_TIMEOUT
while (System.currentTimeMillis() - ticketGrantingTicket.getCreationTime() < (HARD_TIMEOUT - SLIDING_TIMEOUT / 2)) {
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(this.ticketGrantingTicket.isExpired());
}
// final sliding window extension past the HARD_TIMEOUT
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT / 2 + 100);
assertTrue(ticketGrantingTicket.isExpired());
} catch (InterruptedException e) {
throw e;
}
}
public void testTgtIsExpiredBySlidingWindow() throws InterruptedException {
try {
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(ticketGrantingTicket.isExpired());
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(ticketGrantingTicket.isExpired());
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT + 100);
assertTrue(ticketGrantingTicket.isExpired());
} catch (InterruptedException e) {
throw e;
}
}
}
| cas-server-3.4.2/cas-server-core/src/test/java/org/jasig/cas/ticket/support/TicketGrantingTicketExpirationPolicyTests.java | /*
* Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license
* distributed with this file and available online at
* http://www.ja-sig.org/products/cas/overview/license/
*/
package org.jasig.cas.ticket.support;
import junit.framework.TestCase;
import org.jasig.cas.TestUtils;
import org.jasig.cas.ticket.TicketGrantingTicket;
import org.jasig.cas.ticket.TicketGrantingTicketImpl;
/**
* @author William G. Thompson, Jr.
* @version $Revision$ $Date$
* @since 3.4.10
*/
public class TicketGrantingTicketExpirationPolicyTests extends TestCase {
private static final long HARD_TIMEOUT = 10000; // 10s
private static final long SLIDING_TIMEOUT = 2000; // 2s
private TicketGrantingTicketExpirationPolicy expirationPolicy;
private TicketGrantingTicket ticketGrantingTicket;
protected void setUp() throws Exception {
expirationPolicy = new TicketGrantingTicketExpirationPolicy();
expirationPolicy.setMaxTimeToLiveInMilliSeconds(HARD_TIMEOUT);
expirationPolicy.setTimeToKillInMilliSeconds(SLIDING_TIMEOUT);
ticketGrantingTicket = new TicketGrantingTicketImpl("test", TestUtils.getAuthentication(), expirationPolicy);
super.setUp();
}
public void testTgtIsExpiredByHardTimeOut() {
try {
// keep tgt alive via sliding window until within SLIDING_TIME / 2 of the HARD_TIMEOUT
while (System.currentTimeMillis() - ticketGrantingTicket.getCreationTime() < (HARD_TIMEOUT - SLIDING_TIMEOUT / 2)) {
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(this.ticketGrantingTicket.isExpired());
}
// final sliding window extension past the HARD_TIMEOUT
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT / 2 + 100);
assertTrue(ticketGrantingTicket.isExpired());
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
public void testTgtIsExpiredBySlidingWindow() {
try {
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(ticketGrantingTicket.isExpired());
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT - 100);
assertFalse(ticketGrantingTicket.isExpired());
ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
Thread.sleep(SLIDING_TIMEOUT + 100);
assertTrue(ticketGrantingTicket.isExpired());
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
}
| CAS-1027
exception thrown by testing code, not code under test, so let it bubble up to junit per feedback from petro on #jasig-cas
| cas-server-3.4.2/cas-server-core/src/test/java/org/jasig/cas/ticket/support/TicketGrantingTicketExpirationPolicyTests.java | CAS-1027 | <ide><path>as-server-3.4.2/cas-server-core/src/test/java/org/jasig/cas/ticket/support/TicketGrantingTicketExpirationPolicyTests.java
<ide> super.setUp();
<ide> }
<ide>
<del> public void testTgtIsExpiredByHardTimeOut() {
<add> public void testTgtIsExpiredByHardTimeOut() throws InterruptedException {
<ide> try {
<ide> // keep tgt alive via sliding window until within SLIDING_TIME / 2 of the HARD_TIMEOUT
<ide> while (System.currentTimeMillis() - ticketGrantingTicket.getCreationTime() < (HARD_TIMEOUT - SLIDING_TIMEOUT / 2)) {
<ide> assertTrue(ticketGrantingTicket.isExpired());
<ide>
<ide> } catch (InterruptedException e) {
<del> fail(e.getMessage());
<add> throw e;
<ide> }
<ide> }
<ide>
<del> public void testTgtIsExpiredBySlidingWindow() {
<add> public void testTgtIsExpiredBySlidingWindow() throws InterruptedException {
<ide> try {
<ide> ticketGrantingTicket.grantServiceTicket("test", TestUtils.getService(), expirationPolicy, false);
<ide> Thread.sleep(SLIDING_TIMEOUT - 100);
<ide> assertTrue(ticketGrantingTicket.isExpired());
<ide>
<ide> } catch (InterruptedException e) {
<del> fail(e.getMessage());
<add> throw e;
<ide> }
<ide> }
<ide> |
|
JavaScript | mit | b2e7c692a09ce1dd8236cedb6e6cf7cda75753ac | 0 | kochman/repostatus,kochman/repostatus,kochman/repostatus | // custom directive to keep a relative time up to date
Vue.directive('moment-ago', {
inserted(el, binding) {
const timestamp = binding.value;
el.innerHTML = moment(timestamp).fromNow();
this.interval = setInterval(() => {
el.innerHTML = moment(timestamp).fromNow();
}, 1000)
},
unbind() {
clearInterval(this.interval);
}
});
Vue.component('branch-card', {
data() {
return {
showDetail: false
}
},
props: ['branch'],
filters: {
truncate(text, length) {
return text.slice(0, length);
}
},
template: `
<div class="card text-center" v-bind:class="{ 'card-outline-danger': branch.state === 'failure', 'card-outline-success': branch.state === 'success' }">
<div class="card-block">
<h4 class="card-title">
<a v-bind:href="branch.commits_url" class="deco-none">{{ branch.name }}</a>
</h4>
<p class="card-text">
<span class="text-success" v-if="branch.state === 'success'">
Success
</span>
<span class="text-danger" v-if="branch.state === 'failure'">
Failure
</span>
<span class="" v-if="branch.state === 'pending'">
No status checks
</span>
<span v-if="branch.state === 'success' || branch.state === 'failure'" class="">
· <small class="text-muted"><span v-moment-ago="branch.last_updated"></span></small>
</span>
·
<small class="code text-muted">
<a v-bind:href="branch.commit_url" class="deco-none">{{ branch.sha | truncate(7) }}</a>
</small>
</p>
</div>
<div class="list-group list-group-flush text-left">
<template v-for="status in branch.status_checks">
<a v-if="status.status_url" v-bind:href="status.status_url" class="list-group-item list-group-item-action deco-none">
<small>
<span v-if="status.state === 'failure'">❌</span>
{{ status.description }}
</small>
</a>
<div v-else class="list-group-item">
<small>
<span v-if="status.state === 'failure'">❌</span>
{{ status.description }}
</small>
</div>
</template>
</div>
</div>
`
});
| static/branch-card.js | // custom directive to keep a relative time up to date
Vue.directive('moment-ago', {
inserted(el, binding) {
const timestamp = binding.value;
el.innerHTML = moment(timestamp).fromNow();
this.interval = setInterval(() => {
el.innerHTML = moment(timestamp).fromNow();
}, 1000)
},
unbind() {
clearInterval(this.interval);
}
});
Vue.component('branch-card', {
data() {
return {
showDetail: false
}
},
props: ['branch'],
filters: {
truncate(text, length) {
return text.slice(0, length);
}
},
template: `
<div class="card text-center" v-bind:class="{ 'card-outline-danger': branch.state === 'failure', 'card-outline-success': branch.state === 'success' }">
<div class="card-block">
<h4 class="card-title">
<a v-bind:href="branch.commits_url" class="deco-none">{{ branch.name }}</a>
</h4>
<p class="card-text">
<span class="text-success" v-if="branch.state === 'success'">
Success
</span>
<span class="text-danger" v-if="branch.state === 'failure'">
Failure
</span>
<span class="" v-if="branch.state === 'pending'">
No status checks
</span>
<span v-if="branch.state === 'success' || branch.state === 'failure'" class="">
· <small class="text-muted"><span v-moment-ago="branch.last_updated"></span></small>
</span>
·
<small class="code text-muted">
<a v-bind:href="branch.commit_url" class="deco-none">{{ branch.sha | truncate(7) }}</a>
</small>
</p>
</div>
<div class="list-group list-group-flush text-left">
<template v-for="status in branch.status_checks">
<a v-if="status.status_url" v-bind:href="status.status_url" class="list-group-item list-group-item-action deco-none">
<small>
<span v-if="status.state === 'failure'">❌</span>
{{ status.description }}
</small>
</a>
<div v-else class="list-group-item">
<small>
<span v-if="status.state === 'failure'">❌</span>
{{ status.description }}
</small>
</div>
</template>
</div>
</div>
`
});
| Remove trailing spaces
| static/branch-card.js | Remove trailing spaces | <ide><path>tatic/branch-card.js
<ide> <template v-for="status in branch.status_checks">
<ide> <a v-if="status.status_url" v-bind:href="status.status_url" class="list-group-item list-group-item-action deco-none">
<ide> <small>
<del> <span v-if="status.state === 'failure'">❌</span>
<add> <span v-if="status.state === 'failure'">❌</span>
<ide> {{ status.description }}
<ide> </small>
<ide> </a>
<ide> <div v-else class="list-group-item">
<ide> <small>
<del> <span v-if="status.state === 'failure'">❌</span>
<add> <span v-if="status.state === 'failure'">❌</span>
<ide> {{ status.description }}
<ide> </small>
<ide> </div> |
|
Java | mit | error: pathspec 'src/tutorialspoint/collections/LinkedHashMapDemo.java' did not match any file(s) known to git
| 610112a2c634c20bd1e6cadff8c512839d968e98 | 1 | antalpeti/Java-Tutorial,antalpeti/Java-Tutorial | package tutorialspoint.collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.Set;
public class LinkedHashMapDemo {
public static void main(String args[]) {
// Create a hash map
LinkedHashMap<String, Double> lhm = new LinkedHashMap<String, Double>();
// Put elements to the map
lhm.put("Zara", new Double(3434.34));
lhm.put("Mahnaz", new Double(123.22));
lhm.put("Ayan", new Double(1378.00));
lhm.put("Daisy", new Double(99.22));
lhm.put("Qadir", new Double(-19.08));
// Get a set of the entries
Set<Entry<String, Double>> set = lhm.entrySet();
// Get an iterator
Iterator<Entry<String, Double>> i = set.iterator();
// Display elements
while (i.hasNext()) {
Entry<String, Double> me = i.next();
System.out.print(me.getKey() + ": ");
System.out.println(me.getValue());
}
System.out.println();
// Deposit 1000 into Zara's account
double balance = lhm.get("Zara").doubleValue();
lhm.put("Zara", new Double(balance + 1000));
System.out.println("Zara's new balance: " + lhm.get("Zara"));
}
}
| src/tutorialspoint/collections/LinkedHashMapDemo.java | Added examples about usage of put, entrySet and get methods according to
the LinkedHashMap class. | src/tutorialspoint/collections/LinkedHashMapDemo.java | Added examples about usage of put, entrySet and get methods according to the LinkedHashMap class. | <ide><path>rc/tutorialspoint/collections/LinkedHashMapDemo.java
<add>package tutorialspoint.collections;
<add>
<add>import java.util.Iterator;
<add>import java.util.LinkedHashMap;
<add>import java.util.Map.Entry;
<add>import java.util.Set;
<add>
<add>public class LinkedHashMapDemo {
<add>
<add> public static void main(String args[]) {
<add> // Create a hash map
<add> LinkedHashMap<String, Double> lhm = new LinkedHashMap<String, Double>();
<add> // Put elements to the map
<add> lhm.put("Zara", new Double(3434.34));
<add> lhm.put("Mahnaz", new Double(123.22));
<add> lhm.put("Ayan", new Double(1378.00));
<add> lhm.put("Daisy", new Double(99.22));
<add> lhm.put("Qadir", new Double(-19.08));
<add>
<add> // Get a set of the entries
<add> Set<Entry<String, Double>> set = lhm.entrySet();
<add> // Get an iterator
<add> Iterator<Entry<String, Double>> i = set.iterator();
<add> // Display elements
<add> while (i.hasNext()) {
<add> Entry<String, Double> me = i.next();
<add> System.out.print(me.getKey() + ": ");
<add> System.out.println(me.getValue());
<add> }
<add> System.out.println();
<add> // Deposit 1000 into Zara's account
<add> double balance = lhm.get("Zara").doubleValue();
<add> lhm.put("Zara", new Double(balance + 1000));
<add> System.out.println("Zara's new balance: " + lhm.get("Zara"));
<add> }
<add>} |
|
Java | apache-2.0 | edc4c20124537fde039697c2e4b2292d4b6305c5 | 0 | huangcd/novel | package com.chhuang.novel;
import android.app.LoaderManager;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.*;
import android.widget.*;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;
import com.chhuang.novel.data.Article;
import com.chhuang.novel.data.GBKRequest;
import com.chhuang.novel.data.articles.BenghuaiNovel;
import com.chhuang.novel.data.articles.INovel;
import com.chhuang.novel.data.dao.ArticleDataHelper;
import com.chhuang.novel.data.dao.ArticleInfo;
import roboguice.activity.RoboActivity;
import roboguice.inject.ContentView;
import roboguice.inject.InjectView;
import java.text.MessageFormat;
import java.util.ArrayList;
@ContentView(R.layout.activity_directory)
public class DirectoryActivity extends RoboActivity
implements SwipeRefreshLayout.OnRefreshListener, LoaderManager.LoaderCallbacks<Cursor> {
public static final String TAG = DirectoryActivity.class.getName();
public static final int ARTICLE_LOADER = 0;
@InjectView(R.id.layout_titles)
SwipeRefreshLayout layoutTitles;
@InjectView(R.id.list_titles)
ListView listViewTitles;
private RequestQueue requestQueue;
private SimpleCursorAdapter articleSimpleCursorAdapter;
private INovel novel = new BenghuaiNovel();
private int lastVisitPosition;
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
getLoaderManager().initLoader(ARTICLE_LOADER, null, this);
init();
}
private void init() {
layoutTitles.setOnRefreshListener(this);
layoutTitles.setColorScheme(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);
requestQueue = Volley.newRequestQueue(this);
articleSimpleCursorAdapter = new ArticleCursorAdapter(this,
R.layout.title_item,
null,
new String[0],
new int[0],
0);
listViewTitles.setAdapter(articleSimpleCursorAdapter);
listViewTitles.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cursor cursor = ((SimpleCursorAdapter) listViewTitles.getAdapter()).getCursor();
if (cursor == null) {
return;
}
cursor.moveToPosition(position);
lastVisitPosition = position;
Article article = ArticleDataHelper.fromCursor(cursor);
Intent intent = new Intent(DirectoryActivity.this, ArticleActivity.class).putExtra("article", article);
startActivity(intent);
}
});
registerForContextMenu(listViewTitles);
}
@Override
protected void onPause() {
getSharedPreferences(TAG, MODE_PRIVATE)
.edit()
.putInt("list_selection", lastVisitPosition)
.commit();
super.onPause();
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
if (v.getId() == R.id.list_titles) {
menu.setHeaderTitle("下载");
menu.add(Menu.NONE, 0, 0, "下载本章");
menu.add(Menu.NONE, 1, 1, "下载之后所有章节");
}
}
@Override
public boolean onContextItemSelected(MenuItem item) {
ContextMenu.ContextMenuInfo contextMenuInfo = item.getMenuInfo();
if (contextMenuInfo instanceof AdapterView.AdapterContextMenuInfo) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) contextMenuInfo;
Cursor cursor = ((SimpleCursorAdapter) listViewTitles.getAdapter()).getCursor();
cursor.moveToPosition(info.position);
switch (item.getItemId()) {
case 0:
singleDownload(cursor);
break;
case 1:
do {
singleDownload(cursor);
} while (cursor.moveToNext());
}
return true;
}
return super.onContextItemSelected(item);
}
private void singleDownload(Cursor cursor) {
final Article article = ArticleDataHelper.fromCursor(cursor);
requestQueue.add(new GBKRequest(article.getUrl(), new Response.Listener<String>() {
@Override
public void onResponse(String response) {
String content = novel.parseArticle(response);
article.setContent(content);
Uri uri = ArticleDataHelper.getInstance(AppContext.getContext()).insert(article);
Log.v(TAG, "Article uri: " + uri);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
AppContext.showToast(DirectoryActivity.this,
article.getTitle() + " 下载失败,请稍后重试",
Toast.LENGTH_LONG);
}
}));
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case ARTICLE_LOADER:
return new CursorLoader(this,
ArticleDataHelper.ARTICLE_CONTENT_URI,
ArticleInfo.PROJECTIONS,
null,
null,
ArticleInfo._ID);
default:
return null;
}
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
articleSimpleCursorAdapter.changeCursor(data);
if (data == null || data.getCount() == 0) {
onRefresh();
} else {
final int lastVisitPosition = getSharedPreferences(TAG, MODE_PRIVATE).getInt("list_selection", 0);
listViewTitles.post(new Runnable() {
@Override
public void run() {
listViewTitles.setSelection(lastVisitPosition);
}
});
}
}
@Override
public void onRefresh() {
layoutTitles.setRefreshing(true);
requestQueue.add(new GBKRequest(novel.getBaseUrl(), new Response.Listener<String>() {
@Override
public void onResponse(String response) {
ArrayList<Article> articles = novel.parseHomePageToArticles(response);
ArticleDataHelper.getInstance(AppContext.getContext()).bulkInsert(articles);
layoutTitles.setRefreshing(false);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
AppContext.showToast(DirectoryActivity.this, "刷新失败,请稍后重试", Toast.LENGTH_LONG);
layoutTitles.setRefreshing(false);
}
}));
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
articleSimpleCursorAdapter.changeCursor(null);
}
private static class ViewHolder {
private TextView chapterNumber;
private TextView chapterTitle;
private ImageView star;
private ProgressBar progressBar;
}
private class ArticleCursorAdapter extends SimpleCursorAdapter {
private ArticleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
super(context, layout, c, from, to, flags);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
Log.d(TAG, "Cursor position: " + cursor.getPosition());
ViewHolder holder;
if (view == null) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.title_item, null);
Log.v(TAG, "Init view holder");
holder = new ViewHolder();
holder.chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
holder.chapterTitle = (TextView) view.findViewById(R.id.text_title);
holder.star = (ImageView) view.findViewById(R.id.image_status);
holder.progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
if (holder == null) {
Log.v(TAG, "Init view holder");
holder = new ViewHolder();
holder.chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
holder.chapterTitle = (TextView) view.findViewById(R.id.text_title);
holder.star = (ImageView) view.findViewById(R.id.image_status);
holder.progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
view.setTag(holder);
}
Article article = ArticleDataHelper.fromCursor(cursor);
if (TextUtils.isEmpty(article.getContent())) {
holder.star.setImageState(new int[]{android.R.attr.state_pressed}, false);
} else {
holder.star.setImageState(new int[]{android.R.attr.state_checked, android.R.attr.state_pressed}, false);
}
final int progress = (int) (100 * article.getPercentage());
holder.chapterNumber.setText(String.format("%04d", article.getId()));
holder.chapterTitle.setText(article.getTitle());
holder.progressBar.setVisibility(View.VISIBLE);
holder.progressBar.setProgress(progress);
}
}
}
| novel/src/main/java/com/chhuang/novel/DirectoryActivity.java | package com.chhuang.novel;
import android.app.LoaderManager;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.*;
import android.widget.*;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;
import com.chhuang.novel.data.Article;
import com.chhuang.novel.data.GBKRequest;
import com.chhuang.novel.data.articles.BenghuaiNovel;
import com.chhuang.novel.data.articles.INovel;
import com.chhuang.novel.data.dao.ArticleDataHelper;
import com.chhuang.novel.data.dao.ArticleInfo;
import roboguice.activity.RoboActivity;
import roboguice.inject.ContentView;
import roboguice.inject.InjectView;
import java.util.ArrayList;
@ContentView(R.layout.activity_directory)
public class DirectoryActivity extends RoboActivity
implements SwipeRefreshLayout.OnRefreshListener, LoaderManager.LoaderCallbacks<Cursor> {
public static final String TAG = DirectoryActivity.class.getName();
public static final int ARTICLE_LOADER = 0;
@InjectView(R.id.layout_titles)
SwipeRefreshLayout layoutTitles;
@InjectView(R.id.list_titles)
ListView listViewTitles;
private RequestQueue requestQueue;
private SimpleCursorAdapter articleSimpleCursorAdapter;
private INovel novel = new BenghuaiNovel();
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
init();
getLoaderManager().initLoader(ARTICLE_LOADER, null, this);
}
private void init() {
layoutTitles.setOnRefreshListener(this);
layoutTitles.setColorScheme(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);
requestQueue = Volley.newRequestQueue(this);
articleSimpleCursorAdapter = new ArticleCursorAdapter(this,
R.layout.title_item,
null,
new String[0],
new int[0],
0);
listViewTitles.setAdapter(articleSimpleCursorAdapter);
listViewTitles.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cursor cursor = ((SimpleCursorAdapter) listViewTitles.getAdapter()).getCursor();
if (cursor == null) {
return;
}
cursor.moveToPosition(position);
Article article = ArticleDataHelper.fromCursor(cursor);
Intent intent = new Intent(DirectoryActivity.this, ArticleActivity.class).putExtra("article", article);
startActivity(intent);
}
});
registerForContextMenu(listViewTitles);
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
if (v.getId() == R.id.list_titles) {
menu.setHeaderTitle("下载");
menu.add(Menu.NONE, 0, 0, "下载本章");
menu.add(Menu.NONE, 1, 1, "下载之后所有章节");
}
}
@Override
public boolean onContextItemSelected(MenuItem item) {
ContextMenu.ContextMenuInfo contextMenuInfo = item.getMenuInfo();
if (contextMenuInfo instanceof AdapterView.AdapterContextMenuInfo) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) contextMenuInfo;
Cursor cursor = ((SimpleCursorAdapter) listViewTitles.getAdapter()).getCursor();
cursor.moveToPosition(info.position);
switch (item.getItemId()) {
case 0:
singleDownload(cursor);
break;
case 1:
do {
singleDownload(cursor);
} while (cursor.moveToNext());
}
return true;
}
return super.onContextItemSelected(item);
}
private void singleDownload(Cursor cursor) {
final Article article = ArticleDataHelper.fromCursor(cursor);
requestQueue.add(new GBKRequest(article.getUrl(), new Response.Listener<String>() {
@Override
public void onResponse(String response) {
String content = novel.parseArticle(response);
article.setContent(content);
Uri uri = ArticleDataHelper.getInstance(AppContext.getContext()).insert(article);
Log.v(TAG, "Article uri: " + uri);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
AppContext.showToast(DirectoryActivity.this,
article.getTitle() + " 下载失败,请稍后重试",
Toast.LENGTH_LONG);
}
}));
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case ARTICLE_LOADER:
return new CursorLoader(this,
ArticleDataHelper.ARTICLE_CONTENT_URI,
ArticleInfo.PROJECTIONS,
null,
null,
ArticleInfo._ID);
default:
return null;
}
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
articleSimpleCursorAdapter.changeCursor(data);
if (data == null || data.getCount() == 0) {
onRefresh();
}
}
@Override
public void onRefresh() {
layoutTitles.setRefreshing(true);
requestQueue.add(new GBKRequest(novel.getBaseUrl(), new Response.Listener<String>() {
@Override
public void onResponse(String response) {
ArrayList<Article> articles = novel.parseHomePageToArticles(response);
ArticleDataHelper.getInstance(AppContext.getContext()).bulkInsert(articles);
layoutTitles.setRefreshing(false);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
AppContext.showToast(DirectoryActivity.this, "刷新失败,请稍后重试", Toast.LENGTH_LONG);
layoutTitles.setRefreshing(false);
}
}));
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
articleSimpleCursorAdapter.changeCursor(null);
}
private class ArticleCursorAdapter extends SimpleCursorAdapter {
private ArticleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
super(context, layout, c, from, to, flags);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
if (view == null) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.title_item, null);
}
TextView chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
TextView chapterTitle = (TextView) view.findViewById(R.id.text_title);
ImageView star = (ImageView) view.findViewById(R.id.image_status);
ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
Article article = ArticleDataHelper.fromCursor(cursor);
if (TextUtils.isEmpty(article.getContent())) {
star.setImageState(new int[]{android.R.attr.state_pressed}, false);
} else {
star.setImageState(new int[]{android.R.attr.state_checked, android.R.attr.state_pressed}, false);
}
final int progress = (int) (100 * article.getPercentage());
chapterNumber.setText(String.format("%04d", article.getId()));
chapterTitle.setText(article.getTitle());
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(progress);
}
}
}
| Add features:
1. Store last visited item position and restore it after cursor loaded
(restore list view state)
2. Use ViewHolder to avoid uneccessary findViewById
| novel/src/main/java/com/chhuang/novel/DirectoryActivity.java | Add features: | <ide><path>ovel/src/main/java/com/chhuang/novel/DirectoryActivity.java
<ide> import roboguice.inject.ContentView;
<ide> import roboguice.inject.InjectView;
<ide>
<add>import java.text.MessageFormat;
<ide> import java.util.ArrayList;
<ide>
<ide>
<ide> private RequestQueue requestQueue;
<ide> private SimpleCursorAdapter articleSimpleCursorAdapter;
<ide> private INovel novel = new BenghuaiNovel();
<add> private int lastVisitPosition;
<ide>
<ide> @Override
<ide> protected void onCreate(Bundle savedInstanceState) {
<ide> requestWindowFeature(Window.FEATURE_NO_TITLE);
<ide> super.onCreate(savedInstanceState);
<ide>
<add> getLoaderManager().initLoader(ARTICLE_LOADER, null, this);
<ide> init();
<del> getLoaderManager().initLoader(ARTICLE_LOADER, null, this);
<ide> }
<ide>
<ide> private void init() {
<ide> return;
<ide> }
<ide> cursor.moveToPosition(position);
<add> lastVisitPosition = position;
<ide> Article article = ArticleDataHelper.fromCursor(cursor);
<ide> Intent intent = new Intent(DirectoryActivity.this, ArticleActivity.class).putExtra("article", article);
<ide> startActivity(intent);
<ide> }
<ide> });
<ide> registerForContextMenu(listViewTitles);
<add> }
<add>
<add> @Override
<add> protected void onPause() {
<add> getSharedPreferences(TAG, MODE_PRIVATE)
<add> .edit()
<add> .putInt("list_selection", lastVisitPosition)
<add> .commit();
<add> super.onPause();
<ide> }
<ide>
<ide> @Override
<ide> articleSimpleCursorAdapter.changeCursor(data);
<ide> if (data == null || data.getCount() == 0) {
<ide> onRefresh();
<add> } else {
<add> final int lastVisitPosition = getSharedPreferences(TAG, MODE_PRIVATE).getInt("list_selection", 0);
<add> listViewTitles.post(new Runnable() {
<add> @Override
<add> public void run() {
<add> listViewTitles.setSelection(lastVisitPosition);
<add> }
<add> });
<ide> }
<ide> }
<ide>
<ide> articleSimpleCursorAdapter.changeCursor(null);
<ide> }
<ide>
<add>
<add> private static class ViewHolder {
<add> private TextView chapterNumber;
<add> private TextView chapterTitle;
<add> private ImageView star;
<add> private ProgressBar progressBar;
<add> }
<add>
<ide> private class ArticleCursorAdapter extends SimpleCursorAdapter {
<ide> private ArticleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) {
<ide> super(context, layout, c, from, to, flags);
<ide>
<ide> @Override
<ide> public void bindView(View view, Context context, Cursor cursor) {
<add> Log.d(TAG, "Cursor position: " + cursor.getPosition());
<add> ViewHolder holder;
<ide> if (view == null) {
<ide> LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
<ide> view = inflater.inflate(R.layout.title_item, null);
<del> }
<del> TextView chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
<del> TextView chapterTitle = (TextView) view.findViewById(R.id.text_title);
<del> ImageView star = (ImageView) view.findViewById(R.id.image_status);
<del> ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
<add> Log.v(TAG, "Init view holder");
<add> holder = new ViewHolder();
<add> holder.chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
<add> holder.chapterTitle = (TextView) view.findViewById(R.id.text_title);
<add> holder.star = (ImageView) view.findViewById(R.id.image_status);
<add> holder.progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
<add> view.setTag(holder);
<add> } else {
<add> holder = (ViewHolder) view.getTag();
<add> }
<add> if (holder == null) {
<add> Log.v(TAG, "Init view holder");
<add> holder = new ViewHolder();
<add> holder.chapterNumber = (TextView) view.findViewById(R.id.text_chapter);
<add> holder.chapterTitle = (TextView) view.findViewById(R.id.text_title);
<add> holder.star = (ImageView) view.findViewById(R.id.image_status);
<add> holder.progressBar = (ProgressBar) view.findViewById(R.id.progress_article);
<add> view.setTag(holder);
<add> }
<ide> Article article = ArticleDataHelper.fromCursor(cursor);
<ide> if (TextUtils.isEmpty(article.getContent())) {
<del> star.setImageState(new int[]{android.R.attr.state_pressed}, false);
<add> holder.star.setImageState(new int[]{android.R.attr.state_pressed}, false);
<ide> } else {
<del> star.setImageState(new int[]{android.R.attr.state_checked, android.R.attr.state_pressed}, false);
<add> holder.star.setImageState(new int[]{android.R.attr.state_checked, android.R.attr.state_pressed}, false);
<ide> }
<ide> final int progress = (int) (100 * article.getPercentage());
<del> chapterNumber.setText(String.format("%04d", article.getId()));
<del> chapterTitle.setText(article.getTitle());
<del> progressBar.setVisibility(View.VISIBLE);
<del> progressBar.setProgress(progress);
<add> holder.chapterNumber.setText(String.format("%04d", article.getId()));
<add> holder.chapterTitle.setText(article.getTitle());
<add> holder.progressBar.setVisibility(View.VISIBLE);
<add> holder.progressBar.setProgress(progress);
<ide> }
<ide> }
<ide> } |
|
JavaScript | apache-2.0 | 67fbc0bc0f8bc7ed3ac8d7379ebb1436bff4e793 | 0 | hj624608494/hj624608494.github.io,hj624608494/hj624608494.github.io | function alertMsg(msg){
alert(msg);
}
alertMsg('111111111111')
function setCookie(data){
document.cookie = data.key + "=" + data.val;
}
var data = {
'key':'cookietest',
'val' : 'test'
}
setCookie(data);
function getCookie(key){
var arr,reg=new RegExp("(^| )"+key+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
} | cookie.js | function alertMsg(msg){
alert(msg);
}
function setCookie(data){
document.cookie = data.key + "=" + data.val;
}
var data = {
'key':'cookietest',
'val' : 'test'
}
setCookie(data);
function getCookie(key){
var arr,reg=new RegExp("(^| )"+key+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
} | no message
| cookie.js | no message | <ide><path>ookie.js
<ide> function alertMsg(msg){
<ide> alert(msg);
<ide> }
<add>alertMsg('111111111111')
<ide>
<ide> function setCookie(data){
<ide> document.cookie = data.key + "=" + data.val; |
|
Java | bsd-3-clause | 87cdea3902a53f89189fe0dcb6ac2bffaf0719c4 | 0 | boundlessgeo/GeoGig,boundlessgeo/GeoGig,annacarol/GeoGig,markles/GeoGit,markles/GeoGit,annacarol/GeoGig,markles/GeoGit,annacarol/GeoGig,boundlessgeo/GeoGig,markles/GeoGit,markles/GeoGit | /* Copyright (c) 2013 OpenPlans. All rights reserved.
* This code is licensed under the BSD New License, available at the root
* application directory.
*/
package org.geogit.cli.porcelain;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import jline.console.ConsoleReader;
import org.fusesource.jansi.Ansi;
import org.geogit.api.GeoGIT;
import org.geogit.api.Ref;
import org.geogit.api.plumbing.DiffBounds;
import org.geogit.api.plumbing.DiffCount;
import org.geogit.api.plumbing.diff.DiffEntry;
import org.geogit.api.plumbing.diff.DiffObjectCount;
import org.geogit.api.porcelain.DiffOp;
import org.geogit.cli.AbstractCommand;
import org.geogit.cli.AnsiDecorator;
import org.geogit.cli.CLICommand;
import org.geogit.cli.GeogitCLI;
import org.geogit.cli.annotation.ReadOnly;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.vividsolutions.jts.geom.Envelope;
/**
* Shows changes between commits, commits and working tree, etc.
* <p>
* Usage:
* <ul>
* <li> {@code geogit diff [-- <path>...]}: compare working tree and index
* <li> {@code geogit diff <commit> [-- <path>...]}: compare the working tree with the given commit
* <li> {@code geogit diff --cached [-- <path>...]}: compare the index with the HEAD commit
* <li> {@code geogit diff --cached <commit> [-- <path>...]}: compare the index with the given commit
* <li> {@code geogit diff <commit1> <commit2> [-- <path>...]}: compare {@code commit1} with
* {@code commit2}, where {@code commit1} is the eldest or left side of the diff.
* </ul>
*
* @see DiffOp
*/
@ReadOnly
@Parameters(commandNames = "diff", commandDescription = "Show changes between commits, commit and working tree, etc")
public class Diff extends AbstractCommand implements CLICommand {
@Parameter(description = "[<commit> [<commit>]] [-- <path>...]", arity = 2)
private List<String> refSpec = Lists.newArrayList();
@Parameter(names = "--", hidden = true, variableArity = true)
private List<String> paths = Lists.newArrayList();
@Parameter(names = "--cached", description = "compares the specified tree (commit, branch, etc) and the staging area")
private boolean cached;
@Parameter(names = "--summary", description = "List only summary of changes")
private boolean summary;
@Parameter(names = "--nogeom", description = "Do not show detailed coordinate changes in geometries")
private boolean nogeom;
@Parameter(names = "--bounds", description = "Show only the bounds of the difference between the two trees")
private boolean bounds;
@Parameter(names = "--count", description = "Only count the number of changes between the two trees")
private boolean count;
/**
* Executes the diff command with the specified options.
*/
@Override
protected void runInternal(GeogitCLI cli) throws IOException {
checkParameter(refSpec.size() <= 2, "Commit list is too long :%s", refSpec);
checkParameter(!(nogeom && summary), "Only one printing mode allowed");
checkParameter(!(bounds && count), "Only one of --bounds or --count is allowed");
checkParameter(!(cached && refSpec.size() > 1),
"--cached allows zero or one ref specs to compare the index with.");
GeoGIT geogit = cli.getGeogit();
String oldVersion = resolveOldVersion();
String newVersion = resolveNewVersion();
if (bounds) {
DiffBounds diff = geogit.command(DiffBounds.class).setOldVersion(oldVersion)
.setNewVersion(newVersion).setCompareIndex(cached);
Envelope diffBounds = diff.call();
BoundsDiffPrinter.print(geogit, cli.getConsole(), diffBounds);
return;
}
if (count) {
if (oldVersion == null) {
oldVersion = Ref.HEAD;
}
if (newVersion == null) {
newVersion = cached ? Ref.STAGE_HEAD : Ref.WORK_HEAD;
}
DiffCount cdiff = geogit.command(DiffCount.class).setOldVersion(oldVersion)
.setNewVersion(newVersion);
cdiff.setFilter(paths);
DiffObjectCount count = cdiff.call();
ConsoleReader console = cli.getConsole();
console.println(String.format("Trees changed: %d, features changed: %,d",
count.getTreesCount(), count.getFeaturesCount()));
console.flush();
return;
}
DiffOp diff = geogit.command(DiffOp.class);
diff.setOldVersion(oldVersion).setNewVersion(newVersion).setCompareIndex(cached);
Iterator<DiffEntry> entries;
if (paths.isEmpty()) {
entries = diff.setProgressListener(cli.getProgressListener()).call();
} else {
entries = Iterators.emptyIterator();
for (String path : paths) {
Iterator<DiffEntry> moreEntries = diff.setFilter(path)
.setProgressListener(cli.getProgressListener()).call();
entries = Iterators.concat(entries, moreEntries);
}
}
if (!entries.hasNext()) {
cli.getConsole().println("No differences found");
return;
}
DiffPrinter printer;
if (summary) {
printer = new SummaryDiffPrinter();
} else {
printer = new FullDiffPrinter(nogeom, false);
}
DiffEntry entry;
while (entries.hasNext()) {
entry = entries.next();
printer.print(geogit, cli.getConsole(), entry);
}
}
private String resolveOldVersion() {
return refSpec.size() > 0 ? refSpec.get(0) : null;
}
private String resolveNewVersion() {
return refSpec.size() > 1 ? refSpec.get(1) : null;
}
private static final class BoundsDiffPrinter {
public static void print(GeoGIT geogit, ConsoleReader console, Envelope envelope)
throws IOException {
Ansi ansi = AnsiDecorator.newAnsi(console.getTerminal().isAnsiSupported());
if (envelope.isNull()) {
ansi.a("No differences found.");
} else {
ansi.a(envelope.getMinX() + ", " + envelope.getMaxX() + ", " + envelope.getMinY()
+ ", " + envelope.getMaxY());
}
console.println(ansi.toString());
}
}
}
| src/cli/src/main/java/org/geogit/cli/porcelain/Diff.java | /* Copyright (c) 2013 OpenPlans. All rights reserved.
* This code is licensed under the BSD New License, available at the root
* application directory.
*/
package org.geogit.cli.porcelain;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import jline.console.ConsoleReader;
import org.fusesource.jansi.Ansi;
import org.geogit.api.GeoGIT;
import org.geogit.api.plumbing.DiffBounds;
import org.geogit.api.plumbing.diff.DiffEntry;
import org.geogit.api.porcelain.DiffOp;
import org.geogit.cli.AbstractCommand;
import org.geogit.cli.AnsiDecorator;
import org.geogit.cli.CLICommand;
import org.geogit.cli.GeogitCLI;
import org.geogit.cli.annotation.ReadOnly;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.vividsolutions.jts.geom.Envelope;
/**
* Shows changes between commits, commits and working tree, etc.
* <p>
* Usage:
* <ul>
* <li> {@code geogit diff [-- <path>...]}: compare working tree and index
* <li> {@code geogit diff <commit> [-- <path>...]}: compare the working tree with the given commit
* <li> {@code geogit diff --cached [-- <path>...]}: compare the index with the HEAD commit
* <li> {@code geogit diff --cached <commit> [-- <path>...]}: compare the index with the given commit
* <li> {@code geogit diff <commit1> <commit2> [-- <path>...]}: compare {@code commit1} with
* {@code commit2}, where {@code commit1} is the eldest or left side of the diff.
* </ul>
*
* @see DiffOp
*/
@ReadOnly
@Parameters(commandNames = "diff", commandDescription = "Show changes between commits, commit and working tree, etc")
public class Diff extends AbstractCommand implements CLICommand {
@Parameter(description = "[<commit> [<commit>]] [-- <path>...]", arity = 2)
private List<String> refSpec = Lists.newArrayList();
@Parameter(names = "--", hidden = true, variableArity = true)
private List<String> paths = Lists.newArrayList();
@Parameter(names = "--cached", description = "compares the specified tree (commit, branch, etc) and the staging area")
private boolean cached;
@Parameter(names = "--summary", description = "List only summary of changes")
private boolean summary;
@Parameter(names = "--nogeom", description = "Do not show detailed coordinate changes in geometries")
private boolean nogeom;
@Parameter(names = "--bounds", description = "Show only the bounds of the difference between the two trees")
private boolean bounds;
/**
* Executes the diff command with the specified options.
*/
@Override
protected void runInternal(GeogitCLI cli) throws IOException {
checkParameter(refSpec.size() <= 2, "Commit list is too long :%s", refSpec);
checkParameter(!(nogeom && summary), "Only one printing mode allowed");
GeoGIT geogit = cli.getGeogit();
String oldVersion = resolveOldVersion();
String newVersion = resolveNewVersion();
if (bounds) {
DiffBounds diff = geogit.command(DiffBounds.class).setOldVersion(oldVersion)
.setNewVersion(newVersion).setCompareIndex(cached);
Envelope diffBounds = diff.call();
BoundsDiffPrinter.print(geogit, cli.getConsole(), diffBounds);
return;
}
DiffOp diff = geogit.command(DiffOp.class);
diff.setOldVersion(oldVersion).setNewVersion(newVersion).setCompareIndex(cached);
Iterator<DiffEntry> entries;
if (paths.isEmpty()) {
entries = diff.setProgressListener(cli.getProgressListener()).call();
} else {
entries = Iterators.emptyIterator();
for (String path : paths) {
Iterator<DiffEntry> moreEntries = diff.setFilter(path)
.setProgressListener(cli.getProgressListener()).call();
entries = Iterators.concat(entries, moreEntries);
}
}
if (!entries.hasNext()) {
cli.getConsole().println("No differences found");
return;
}
DiffPrinter printer;
if (summary) {
printer = new SummaryDiffPrinter();
} else {
printer = new FullDiffPrinter(nogeom, false);
}
DiffEntry entry;
while (entries.hasNext()) {
entry = entries.next();
printer.print(geogit, cli.getConsole(), entry);
}
}
private String resolveOldVersion() {
return refSpec.size() > 0 ? refSpec.get(0) : null;
}
private String resolveNewVersion() {
return refSpec.size() > 1 ? refSpec.get(1) : null;
}
private static final class BoundsDiffPrinter {
public static void print(GeoGIT geogit, ConsoleReader console, Envelope envelope)
throws IOException {
Ansi ansi = AnsiDecorator.newAnsi(console.getTerminal().isAnsiSupported());
if (envelope.isNull()) {
ansi.a("No differences found.");
} else {
ansi.a(envelope.getMinX() + ", " + envelope.getMaxX() + ", " + envelope.getMinY()
+ ", " + envelope.getMaxY());
}
console.println(ansi.toString());
}
}
}
| Add --count option to cli's diff command
| src/cli/src/main/java/org/geogit/cli/porcelain/Diff.java | Add --count option to cli's diff command | <ide><path>rc/cli/src/main/java/org/geogit/cli/porcelain/Diff.java
<ide>
<ide> import org.fusesource.jansi.Ansi;
<ide> import org.geogit.api.GeoGIT;
<add>import org.geogit.api.Ref;
<ide> import org.geogit.api.plumbing.DiffBounds;
<add>import org.geogit.api.plumbing.DiffCount;
<ide> import org.geogit.api.plumbing.diff.DiffEntry;
<add>import org.geogit.api.plumbing.diff.DiffObjectCount;
<ide> import org.geogit.api.porcelain.DiffOp;
<ide> import org.geogit.cli.AbstractCommand;
<ide> import org.geogit.cli.AnsiDecorator;
<ide> @Parameter(names = "--bounds", description = "Show only the bounds of the difference between the two trees")
<ide> private boolean bounds;
<ide>
<add> @Parameter(names = "--count", description = "Only count the number of changes between the two trees")
<add> private boolean count;
<add>
<ide> /**
<ide> * Executes the diff command with the specified options.
<ide> */
<ide> protected void runInternal(GeogitCLI cli) throws IOException {
<ide> checkParameter(refSpec.size() <= 2, "Commit list is too long :%s", refSpec);
<ide> checkParameter(!(nogeom && summary), "Only one printing mode allowed");
<add> checkParameter(!(bounds && count), "Only one of --bounds or --count is allowed");
<add> checkParameter(!(cached && refSpec.size() > 1),
<add> "--cached allows zero or one ref specs to compare the index with.");
<ide>
<ide> GeoGIT geogit = cli.getGeogit();
<ide>
<ide> .setNewVersion(newVersion).setCompareIndex(cached);
<ide> Envelope diffBounds = diff.call();
<ide> BoundsDiffPrinter.print(geogit, cli.getConsole(), diffBounds);
<add> return;
<add> }
<add> if (count) {
<add> if (oldVersion == null) {
<add> oldVersion = Ref.HEAD;
<add> }
<add> if (newVersion == null) {
<add> newVersion = cached ? Ref.STAGE_HEAD : Ref.WORK_HEAD;
<add> }
<add> DiffCount cdiff = geogit.command(DiffCount.class).setOldVersion(oldVersion)
<add> .setNewVersion(newVersion);
<add> cdiff.setFilter(paths);
<add> DiffObjectCount count = cdiff.call();
<add> ConsoleReader console = cli.getConsole();
<add> console.println(String.format("Trees changed: %d, features changed: %,d",
<add> count.getTreesCount(), count.getFeaturesCount()));
<add> console.flush();
<ide> return;
<ide> }
<ide> |
|
Java | apache-2.0 | ab63826cff654f45638daded77be7a1a1cd7bc83 | 0 | winspeednl/LibZ | package me.winspeednl.libz.screen;
import me.winspeednl.libz.image.Image;
public enum Font {
STANDARD("/Font/standard.png"),
STANDARDX2("/Font/standardx2.png"),
STANDARDX4("/Font/standardx4.png");
public final int NumberUnicodes = 59;
public int[] offsets = new int[NumberUnicodes];
public int[] widths = new int[NumberUnicodes];
public Image image;
Font(String path) {
image = new Image(path);
int unicode = -1;
for(int x = 0; x < image.width; x++) {
int color = image.imagePixels[x];
if(color == 0xff0000ff) {
unicode++;
offsets[unicode] = x;
}
if(color == 0xffffff00)
widths[unicode] = x - offsets[unicode];
}
}
}
| Java/src/me/winspeednl/libz/screen/Font.java | package me.winspeednl.libz.screen;
import me.winspeednl.libz.image.Image;
public enum Font {
STANDARD("/Font/standard.png");
public final int NumberUnicodes = 59;
public int[] offsets = new int[NumberUnicodes];
public int[] widths = new int[NumberUnicodes];
public Image image;
Font(String path) {
image = new Image(path);
int unicode = -1;
for(int x = 0; x < image.width; x++) {
int color = image.imagePixels[x];
if(color == 0xff0000ff) {
unicode++;
offsets[unicode] = x;
}
if(color == 0xffffff00)
widths[unicode] = x - offsets[unicode];
}
}
}
| Added two new fonts.
| Java/src/me/winspeednl/libz/screen/Font.java | Added two new fonts. | <ide><path>ava/src/me/winspeednl/libz/screen/Font.java
<ide> import me.winspeednl.libz.image.Image;
<ide>
<ide> public enum Font {
<del> STANDARD("/Font/standard.png");
<add> STANDARD("/Font/standard.png"),
<add> STANDARDX2("/Font/standardx2.png"),
<add> STANDARDX4("/Font/standardx4.png");
<ide>
<ide> public final int NumberUnicodes = 59;
<ide> public int[] offsets = new int[NumberUnicodes]; |
|
Java | apache-2.0 | 167a286031028dc2f2c1bbd1793984ffaa832755 | 0 | pnarayanan/ambry,cgtz/ambry,cgtz/ambry,xiahome/ambry,vgkholla/ambry,xiahome/ambry,pnarayanan/ambry,cgtz/ambry,linkedin/ambry,daniellitoc/ambry-Research,cgtz/ambry,linkedin/ambry,daniellitoc/ambry-Research,vgkholla/ambry,linkedin/ambry,nsivabalan/ambry,nsivabalan/ambry,linkedin/ambry | package com.github.ambry.coordinator;
import com.github.ambry.clustermap.ClusterMap;
import com.github.ambry.clustermap.ClusterMapManager;
import com.github.ambry.clustermap.HardwareLayout;
import com.github.ambry.clustermap.PartitionLayout;
import com.github.ambry.config.VerifiableProperties;
import com.github.ambry.messageformat.BlobOutput;
import com.github.ambry.messageformat.BlobProperties;
import com.github.ambry.shared.ServerErrorCode;
import com.github.ambry.store.StoreException;
import com.github.ambry.utils.ByteBufferInputStream;
import com.github.ambry.utils.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Properties;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
/**
*
*/
public class CoordinatorTest {
// Below three configs are for testing error cases assuming getClusterMapOneDCThreeNodeOneDiskOnePartition
// as cluster config
private ArrayList<Integer> exceptionHostPorts = new ArrayList(Arrays.asList(6667, 6668, 6669));
private final int TOTAL_HOST_COUNT = 3;
private final String host = "localhost";
private static HashMap<ServerErrorCode, CoordinatorError> deleteErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private static HashMap<ServerErrorCode, CoordinatorError> getErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private static HashMap<ServerErrorCode, CoordinatorError> putErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private Random random = new Random();
private void induceGetFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setGetException(errorCode);
hostPorts.remove(nextRandom);
}
}
private void induceDeleteFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setDeleteException(errorCode);
hostPorts.remove(nextRandom);
}
}
private void inducePutFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setPutException(errorCode);
hostPorts.remove(nextRandom);
}
}
static {
deleteErrorMappings.put(ServerErrorCode.Blob_Not_Found, CoordinatorError.BlobDoesNotExist);
deleteErrorMappings.put(ServerErrorCode.Blob_Expired, CoordinatorError.BlobExpired);
deleteErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
deleteErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
deleteErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.Data_Corrupt, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.Blob_Not_Found, CoordinatorError.BlobDoesNotExist);
getErrorMappings.put(ServerErrorCode.Blob_Deleted, CoordinatorError.BlobDeleted);
getErrorMappings.put(ServerErrorCode.Blob_Expired, CoordinatorError.BlobExpired);
getErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
getErrorMappings.put(ServerErrorCode.Partition_Unknown, CoordinatorError.BlobDoesNotExist);
//unknown
getErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Partition_Unknown, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
putErrorMappings.put(ServerErrorCode.Blob_Already_Exists, CoordinatorError.UnexpectedInternalError);
//unknown
putErrorMappings.put(ServerErrorCode.Data_Corrupt, CoordinatorError.UnexpectedInternalError);
}
ClusterMap getClusterMapOneDCOneNodeOneDiskOnePartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCOneNodeOneDiskOnePartition\",\n" +
" \"version\": 2,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCOneNodeOneDiskOnePartition\",\n" +
" \"version\": 3,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapOneDCThreeNodeOneDiskOnePartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCThreeNodeOneDiskOnePartition\",\n" +
" \"version\": 4,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCThreeNodeOneDiskOnePartition\",\n" +
" \"version\": 5,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapOneDCFourNodeOneDiskTwoPartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCFourNodeOneDiskTwoPartition\",\n" +
" \"version\": 6,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6670\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCFourNodeOneDiskTwoPartition\",\n" +
" \"version\": 7,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 1,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapTwoDCFourNodeOneDiskFourPartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"TwoDCFourNodeOneDiskFourPartition\",\n" +
" \"version\": 8,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6670\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" },\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ],\n" +
" \"name\": \"DatacenterTwo\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"TwoDCFourNodeOneDiskFourPartition\",\n" +
" \"version\": 9,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 1,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 3,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
VerifiableProperties getVProps() {
Properties properties = new Properties();
properties.setProperty("coordinator.hostname", "localhost");
properties.setProperty("coordinator.datacenter.name", "Datacenter");
properties
.setProperty("coordinator.connection.pool.factory", "com.github.ambry.coordinator.MockConnectionPoolFactory");
return new VerifiableProperties(properties);
}
VerifiableProperties getVPropsTwo() {
Properties properties = new Properties();
properties.setProperty("coordinator.hostname", "localhost");
properties.setProperty("coordinator.datacenter.name", "DatacenterTwo");
properties
.setProperty("coordinator.connection.pool.factory", "com.github.ambry.coordinator.MockConnectionPoolFactory");
return new VerifiableProperties(properties);
}
void PutGetDelete(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
ac.deleteBlob(blobId);
try {
getBlobOutput = ac.getBlob(blobId);
fail("GetBlob for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
getBlobProperties = ac.getBlobProperties(blobId);
fail("GetBlobProperties for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
getUserMetadata = ac.getBlobUserMetadata(blobId);
fail("GetUserMetaData for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ac.deleteBlob(blobId);
} catch (CoordinatorException coordinatorException) {
fail("Deletion of a deleted blob should not have thrown CoordinatorException " + blobId);
}
}
private String putBlobVerifyGet(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
return putBlobVerifyGet(ac, putBlobProperties, putUserMetadata, putContent);
}
private String putBlobVerifyGet(AmbryCoordinator ac, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
return blobId;
}
private String putBlob(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
return putBlob(ac, putBlobProperties, putUserMetadata, putContent);
}
private String putBlob(AmbryCoordinator ac, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
return blobId;
}
void getBlob(AmbryCoordinator ac, String blobId, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
}
void deleteBlobAndGet(AmbryCoordinator ac, String blobId)
throws InterruptedException, StoreException, IOException, CoordinatorException {
ac.deleteBlob(blobId);
try {
BlobOutput getBlobOutput = ac.getBlob(blobId);
fail("GetBlob for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
fail("GetBlobProperties for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
fail("GetUserMetaData for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ac.deleteBlob(blobId);
} catch (CoordinatorException coordinatorException) {
fail("Deletion of a deleted blob should not have thrown CoordinatorException " + blobId);
}
}
void deleteBlob(AmbryCoordinator ac, String blobId)
throws InterruptedException, StoreException, IOException, CoordinatorException {
ac.deleteBlob(blobId);
}
void GetNonExistantBlob(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
// create dummy blobid by corrupting the actual blob id. Goal is to corrupt the UUID part of id rather than break
// the id so much that an exception is thrown during blob id construction.
System.err.println("blob Id " + blobId);
String nonExistantBlobId = blobId.substring(0, blobId.length() - 5) + "AAAAA";
System.err.println("non existent blob Id " + nonExistantBlobId);
try {
BlobOutput getBlobOutput = ac.getBlob(nonExistantBlobId);
fail("GetBlob for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
BlobProperties getBlobProperties = ac.getBlobProperties(nonExistantBlobId);
fail("GetBlobProperties for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(nonExistantBlobId);
fail("GetUserMetaData for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
ac.deleteBlob(nonExistantBlobId);
fail("DeleteBlob of a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
}
void simple(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutGetDelete(ac);
}
ac.close();
}
/**
* Same as above simple method, but instead of performing all inline, this calls very spefific methods
* to perform something like the put, get and delete. Purpose of this method is to test the sanity of these
* smaller methods which are going to be used for execption cases after this test case.
* @param clusterMap
* @throws JSONException
* @throws InterruptedException
* @throws StoreException
* @throws IOException
* @throws CoordinatorException
*/
void simpleDecoupled(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
deleteBlob(ac, blobId);
}
ac.close();
}
void simpleDeleteException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode deleteErrorCode : deleteErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
induceDeleteFailure(TOTAL_HOST_COUNT, deleteErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
try {
deleteBlobAndGet(ac, blobId);
fail("Deletion should have failed for " + deleteErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), deleteErrorMappings.get(deleteErrorCode));
}
}
ac.close();
}
}
void simpleGetException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode getErrorCode : getErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
induceGetFailure(TOTAL_HOST_COUNT, getErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
try {
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
fail("Get should have failed for " + getErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), getErrorMappings.get(getErrorCode));
}
deleteBlob(ac, blobId);
}
ac.close();
}
}
void simplePutException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode putErrorCode : putErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
inducePutFailure(TOTAL_HOST_COUNT, putErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = null;
try {
blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
fail("Put should have failed for " + putErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), putErrorMappings.get(putErrorCode));
}
}
ac.close();
}
}
void simpleGetNonExistantBlob(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
GetNonExistantBlob(ac);
ac.close();
}
@Test
public void simpleOneDCOneNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCOneNodeOneDiskOnePartition());
simpleGetNonExistantBlob(getClusterMapOneDCOneNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForDeleteException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleDeleteException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForGetException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleGetException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForPutException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simplePutException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleDecoupleOneDCThreeNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleDecoupled(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCFourNodeOneDiskTwoPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCFourNodeOneDiskTwoPartition());
}
@Test
public void simpleTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
void multiAC(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator acOne = new AmbryCoordinator(getVProps(), clusterMap);
AmbryCoordinator acTwo = new AmbryCoordinator(getVPropsTwo(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutGetDelete(acOne);
PutGetDelete(acTwo);
}
acOne.close();
acTwo.close();
}
@Test
public void multiACTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
multiAC(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
void PutRemoteGetDelete(AmbryCoordinator acOne, AmbryCoordinator acTwo)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = acOne.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = acTwo.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = acTwo.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = acTwo.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
acTwo.deleteBlob(blobId);
}
void remoteAC(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator acOne = new AmbryCoordinator(getVProps(), clusterMap);
AmbryCoordinator acTwo = new AmbryCoordinator(getVPropsTwo(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutRemoteGetDelete(acOne, acTwo);
}
acOne.close();
acTwo.close();
}
@Test
public void remoteACTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
remoteAC(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
private ByteBuffer getByteBuffer(int count, boolean toFlip) {
ByteBuffer byteBuffer = ByteBuffer.allocate(count);
for (byte b = 0; b < count; b++) {
byteBuffer.put(b);
}
if (toFlip) {
byteBuffer.flip();
}
return byteBuffer;
}
}
| ambry-coordinator/src/test/java/com.github.ambry.coordinator/CoordinatorTest.java | package com.github.ambry.coordinator;
import com.github.ambry.clustermap.ClusterMap;
import com.github.ambry.clustermap.ClusterMapManager;
import com.github.ambry.clustermap.HardwareLayout;
import com.github.ambry.clustermap.PartitionLayout;
import com.github.ambry.config.VerifiableProperties;
import com.github.ambry.messageformat.BlobOutput;
import com.github.ambry.messageformat.BlobProperties;
import com.github.ambry.shared.ServerErrorCode;
import com.github.ambry.store.StoreException;
import com.github.ambry.utils.ByteBufferInputStream;
import com.github.ambry.utils.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Properties;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
/**
*
*/
public class CoordinatorTest {
// Below three configs are for testing error cases assuming getClusterMapOneDCThreeNodeOneDiskOnePartition
// as cluster config
private ArrayList<Integer> exceptionHostPorts = new ArrayList(Arrays.asList(6667, 6668, 6669));
private final int TOTAL_HOST_COUNT = 3;
private final String host = "localhost";
private static HashMap<ServerErrorCode, CoordinatorError> deleteErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private static HashMap<ServerErrorCode, CoordinatorError> getErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private static HashMap<ServerErrorCode, CoordinatorError> putErrorMappings =
new HashMap<ServerErrorCode, CoordinatorError>();
private Random random = new Random();
private void induceGetFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setGetException(errorCode);
hostPorts.remove(nextRandom);
}
}
private void induceDeleteFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setDeleteException(errorCode);
hostPorts.remove(nextRandom);
}
}
private void inducePutFailure(int count, ServerErrorCode errorCode) {
List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone();
for (int i = 0; i < count; i++) {
int nextRandom = random.nextInt(hostPorts.size());
MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom));
mockDataNode.setPutException(errorCode);
hostPorts.remove(nextRandom);
}
}
static {
deleteErrorMappings.put(ServerErrorCode.Blob_Not_Found, CoordinatorError.BlobDoesNotExist);
deleteErrorMappings.put(ServerErrorCode.Blob_Expired, CoordinatorError.BlobExpired);
deleteErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
deleteErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
deleteErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.Data_Corrupt, CoordinatorError.UnexpectedInternalError);
getErrorMappings.put(ServerErrorCode.Blob_Not_Found, CoordinatorError.BlobDoesNotExist);
getErrorMappings.put(ServerErrorCode.Blob_Deleted, CoordinatorError.BlobDeleted);
getErrorMappings.put(ServerErrorCode.Blob_Expired, CoordinatorError.BlobExpired);
getErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
getErrorMappings.put(ServerErrorCode.Partition_Unknown, CoordinatorError.BlobDoesNotExist);
//unknown
getErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.IO_Error, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Partition_ReadOnly, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Partition_Unknown, CoordinatorError.UnexpectedInternalError);
putErrorMappings.put(ServerErrorCode.Disk_Unavailable, CoordinatorError.AmbryUnavailable);
putErrorMappings.put(ServerErrorCode.Blob_Already_Exists, CoordinatorError.UnexpectedInternalError);
//unknown
putErrorMappings.put(ServerErrorCode.Data_Corrupt, CoordinatorError.UnexpectedInternalError);
}
ClusterMap getClusterMapOneDCOneNodeOneDiskOnePartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCOneNodeOneDiskOnePartition\",\n" +
" \"version\": 2,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCOneNodeOneDiskOnePartition\",\n" +
" \"version\": 3,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapOneDCThreeNodeOneDiskOnePartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCThreeNodeOneDiskOnePartition\",\n" +
" \"version\": 4,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCThreeNodeOneDiskOnePartition\",\n" +
" \"version\": 5,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapOneDCFourNodeOneDiskTwoPartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"OneDCFourNodeOneDiskTwoPartition\",\n" +
" \"version\": 6,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6670\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"OneDCFourNodeOneDiskTwoPartition\",\n" +
" \"version\": 7,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 1,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
ClusterMap getClusterMapTwoDCFourNodeOneDiskFourPartition()
throws JSONException {
String HL = " {\n" +
" \"clusterName\": \"TwoDCFourNodeOneDiskFourPartition\",\n" +
" \"version\": 8,\n" +
" \"datacenters\": [\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6670\n" +
" }\n" +
" ],\n" +
" \"name\": \"Datacenter\"\n" +
" },\n" +
" {\n" +
" \"dataNodes\": [\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"disks\": [\n" +
" {\n" +
" \"capacityInBytes\": 21474836480,\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"mountPath\": \"/mnt0\"\n" +
" }\n" +
" ],\n" +
" \"hardwareState\": \"AVAILABLE\",\n" +
" \"hostname\": \"localhost\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ],\n" +
" \"name\": \"DatacenterTwo\"\n" +
" }\n" +
" ]\n" +
" }\n";
String PL = "{\n" +
" \"clusterName\": \"TwoDCFourNodeOneDiskFourPartition\",\n" +
" \"version\": 9,\n" +
" \"partitions\": [\n" +
" {\n" +
" \"id\": 0,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 1,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6668\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6683\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 3,\n" +
" \"partitionState\": \"READ_WRITE\",\n" +
" \"replicaCapacityInBytes\": 10737418240,\n" +
" \"replicas\": [\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6667\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6669\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6670\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6680\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6681\n" +
" },\n" +
" {\n" +
" \"hostname\": \"localhost\",\n" +
" \"mountPath\": \"/mnt0\",\n" +
" \"port\": 6682\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n";
HardwareLayout hl = new HardwareLayout(new JSONObject(HL));
PartitionLayout pl = new PartitionLayout(hl, new JSONObject(PL));
return new ClusterMapManager(pl);
}
VerifiableProperties getVProps() {
Properties properties = new Properties();
properties.setProperty("coordinator.hostname", "localhost");
properties.setProperty("coordinator.datacenter.name", "Datacenter");
properties
.setProperty("coordinator.connection.pool.factory", "com.github.ambry.coordinator.MockConnectionPoolFactory");
return new VerifiableProperties(properties);
}
VerifiableProperties getVPropsTwo() {
Properties properties = new Properties();
properties.setProperty("coordinator.hostname", "localhost");
properties.setProperty("coordinator.datacenter.name", "DatacenterTwo");
properties
.setProperty("coordinator.connection.pool.factory", "com.github.ambry.coordinator.MockConnectionPoolFactory");
return new VerifiableProperties(properties);
}
void PutGetDelete(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
ac.deleteBlob(blobId);
try {
getBlobOutput = ac.getBlob(blobId);
fail("GetBlob for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
getBlobProperties = ac.getBlobProperties(blobId);
fail("GetBlobProperties for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
getUserMetadata = ac.getBlobUserMetadata(blobId);
fail("GetUserMetaData for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ac.deleteBlob(blobId);
} catch (CoordinatorException coordinatorException) {
fail("Deletion of a deleted blob should not have thrown CoordinatorException " + blobId);
}
}
private String putBlobVerifyGet(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
return putBlobVerifyGet(ac, putBlobProperties, putUserMetadata, putContent);
}
private String putBlobVerifyGet(AmbryCoordinator ac, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
return blobId;
}
private String putBlob(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
return putBlob(ac, putBlobProperties, putUserMetadata, putContent);
}
private String putBlob(AmbryCoordinator ac, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
return blobId;
}
void getBlob(AmbryCoordinator ac, String blobId, BlobProperties putBlobProperties, ByteBuffer putUserMetadata,
ByteBuffer putContent)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = ac.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
}
void deleteBlobAndGet(AmbryCoordinator ac, String blobId)
throws InterruptedException, StoreException, IOException, CoordinatorException {
ac.deleteBlob(blobId);
try {
BlobOutput getBlobOutput = ac.getBlob(blobId);
fail("GetBlob for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
BlobProperties getBlobProperties = ac.getBlobProperties(blobId);
fail("GetBlobProperties for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(blobId);
fail("GetUserMetaData for a deleted blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDeleted);
}
try {
ac.deleteBlob(blobId);
} catch (CoordinatorException coordinatorException) {
fail("Deletion of a deleted blob should not have thrown CoordinatorException " + blobId);
}
}
void deleteBlob(AmbryCoordinator ac, String blobId)
throws InterruptedException, StoreException, IOException, CoordinatorException {
ac.deleteBlob(blobId);
}
void GetNonExistantBlob(AmbryCoordinator ac)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
//create dummy blobid
System.out.println("blob Id " + blobId);
String nonExistantBlobId = blobId.substring(0, blobId.length() - 1) + 5;
System.out.println("non existent blob Id " + nonExistantBlobId);
try {
BlobOutput getBlobOutput = ac.getBlob(nonExistantBlobId);
fail("GetBlob for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
BlobProperties getBlobProperties = ac.getBlobProperties(nonExistantBlobId);
fail("GetBlobProperties for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
ByteBuffer getUserMetadata = ac.getBlobUserMetadata(nonExistantBlobId);
fail("GetUserMetaData for a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
try {
ac.deleteBlob(nonExistantBlobId);
fail("DeleteBlob of a non existing blob should have thrown CoordinatorException " + blobId);
} catch (CoordinatorException coordinatorException) {
assertEquals(coordinatorException.getErrorCode(), CoordinatorError.BlobDoesNotExist);
}
}
void simple(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutGetDelete(ac);
}
ac.close();
}
/**
* Same as above simple method, but instead of performing all inline, this calls very spefific methods
* to perform something like the put, get and delete. Purpose of this method is to test the sanity of these
* smaller methods which are going to be used for execption cases after this test case.
* @param clusterMap
* @throws JSONException
* @throws InterruptedException
* @throws StoreException
* @throws IOException
* @throws CoordinatorException
*/
void simpleDecoupled(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
deleteBlob(ac, blobId);
}
ac.close();
}
void simpleDeleteException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode deleteErrorCode : deleteErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
induceDeleteFailure(TOTAL_HOST_COUNT, deleteErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
try {
deleteBlobAndGet(ac, blobId);
fail("Deletion should have failed for " + deleteErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), deleteErrorMappings.get(deleteErrorCode));
}
}
ac.close();
}
}
void simpleGetException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode getErrorCode : getErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
induceGetFailure(TOTAL_HOST_COUNT, getErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
try {
getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent);
fail("Get should have failed for " + getErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), getErrorMappings.get(getErrorCode));
}
deleteBlob(ac, blobId);
}
ac.close();
}
}
void simplePutException(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
for (ServerErrorCode putErrorCode : putErrorMappings.keySet()) {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
inducePutFailure(TOTAL_HOST_COUNT, putErrorCode);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
for (int i = 0; i < 20; ++i) {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
String blobId = null;
try {
blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent);
fail("Put should have failed for " + putErrorCode);
} catch (CoordinatorException e) {
assertEquals(e.getErrorCode(), putErrorMappings.get(putErrorCode));
}
}
ac.close();
}
}
void simpleGetNonExistantBlob(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap);
GetNonExistantBlob(ac);
ac.close();
}
@Test
public void simpleOneDCOneNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCOneNodeOneDiskOnePartition());
simpleGetNonExistantBlob(getClusterMapOneDCOneNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForDeleteException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleDeleteException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForGetException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleGetException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCThreeNodeOneDiskOnePartitionForPutException()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simplePutException(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleDecoupleOneDCThreeNodeOneDiskOnePartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simpleDecoupled(getClusterMapOneDCThreeNodeOneDiskOnePartition());
}
@Test
public void simpleOneDCFourNodeOneDiskTwoPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapOneDCFourNodeOneDiskTwoPartition());
}
@Test
public void simpleTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
simple(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
void multiAC(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator acOne = new AmbryCoordinator(getVProps(), clusterMap);
AmbryCoordinator acTwo = new AmbryCoordinator(getVPropsTwo(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutGetDelete(acOne);
PutGetDelete(acTwo);
}
acOne.close();
acTwo.close();
}
@Test
public void multiACTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
multiAC(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
void PutRemoteGetDelete(AmbryCoordinator acOne, AmbryCoordinator acTwo)
throws InterruptedException, StoreException, IOException, CoordinatorException {
BlobProperties putBlobProperties =
new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time);
ByteBuffer putUserMetadata = getByteBuffer(10, false);
ByteBuffer putContent = getByteBuffer(100, true);
InputStream blobData = new ByteBufferInputStream(putContent);
String blobId = acOne.putBlob(putBlobProperties, putUserMetadata, blobData);
BlobProperties getBlobProperties = acTwo.getBlobProperties(blobId);
assertEquals(putBlobProperties.getBlobSize(), getBlobProperties.getBlobSize());
assertEquals(putBlobProperties.getContentType(), getBlobProperties.getContentType());
ByteBuffer getUserMetadata = acTwo.getBlobUserMetadata(blobId);
assertArrayEquals(putUserMetadata.array(), getUserMetadata.array());
BlobOutput getBlobOutput = acTwo.getBlob(blobId);
byte[] blobDataBytes = new byte[(int) getBlobOutput.getSize()];
new DataInputStream(getBlobOutput.getStream()).readFully(blobDataBytes);
assertArrayEquals(blobDataBytes, putContent.array());
acTwo.deleteBlob(blobId);
}
void remoteAC(ClusterMap clusterMap)
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
MockConnectionPool.mockCluster = new MockCluster(clusterMap);
AmbryCoordinator acOne = new AmbryCoordinator(getVProps(), clusterMap);
AmbryCoordinator acTwo = new AmbryCoordinator(getVPropsTwo(), clusterMap);
for (int i = 0; i < 20; ++i) {
PutRemoteGetDelete(acOne, acTwo);
}
acOne.close();
acTwo.close();
}
@Test
public void remoteACTwoDCFourNodeOneDiskFourPartition()
throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException {
remoteAC(getClusterMapTwoDCFourNodeOneDiskFourPartition());
}
private ByteBuffer getByteBuffer(int count, boolean toFlip) {
ByteBuffer byteBuffer = ByteBuffer.allocate(count);
for (byte b = 0; b < count; b++) {
byteBuffer.put(b);
}
if (toFlip) {
byteBuffer.flip();
}
return byteBuffer;
}
}
| Fix coordinator test to corrupt blob id string sufficiently for blobid to not exist.
| ambry-coordinator/src/test/java/com.github.ambry.coordinator/CoordinatorTest.java | Fix coordinator test to corrupt blob id string sufficiently for blobid to not exist. | <ide><path>mbry-coordinator/src/test/java/com.github.ambry.coordinator/CoordinatorTest.java
<ide>
<ide> String blobId = ac.putBlob(putBlobProperties, putUserMetadata, blobData);
<ide>
<del> //create dummy blobid
<del> System.out.println("blob Id " + blobId);
<del> String nonExistantBlobId = blobId.substring(0, blobId.length() - 1) + 5;
<del> System.out.println("non existent blob Id " + nonExistantBlobId);
<add> // create dummy blobid by corrupting the actual blob id. Goal is to corrupt the UUID part of id rather than break
<add> // the id so much that an exception is thrown during blob id construction.
<add> System.err.println("blob Id " + blobId);
<add> String nonExistantBlobId = blobId.substring(0, blobId.length() - 5) + "AAAAA";
<add> System.err.println("non existent blob Id " + nonExistantBlobId);
<ide>
<ide> try {
<ide> BlobOutput getBlobOutput = ac.getBlob(nonExistantBlobId); |
|
Java | apache-2.0 | 7d7017ccd4a84735fa9898c4c18628366b237c28 | 0 | kdwink/intellij-community,akosyakov/intellij-community,jagguli/intellij-community,Distrotech/intellij-community,ftomassetti/intellij-community,MER-GROUP/intellij-community,muntasirsyed/intellij-community,orekyuu/intellij-community,lucafavatella/intellij-community,hurricup/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,pwoodworth/intellij-community,petteyg/intellij-community,lucafavatella/intellij-community,Distrotech/intellij-community,blademainer/intellij-community,idea4bsd/idea4bsd,holmes/intellij-community,blademainer/intellij-community,allotria/intellij-community,kdwink/intellij-community,muntasirsyed/intellij-community,MER-GROUP/intellij-community,SerCeMan/intellij-community,ol-loginov/intellij-community,pwoodworth/intellij-community,vvv1559/intellij-community,adedayo/intellij-community,vvv1559/intellij-community,kdwink/intellij-community,retomerz/intellij-community,vladmm/intellij-community,signed/intellij-community,nicolargo/intellij-community,xfournet/intellij-community,ahb0327/intellij-community,robovm/robovm-studio,retomerz/intellij-community,ryano144/intellij-community,akosyakov/intellij-community,xfournet/intellij-community,fitermay/intellij-community,supersven/intellij-community,gnuhub/intellij-community,fengbaicanhe/intellij-community,akosyakov/intellij-community,fitermay/intellij-community,Distrotech/intellij-community,xfournet/intellij-community,ahb0327/intellij-community,holmes/intellij-community,ivan-fedorov/intellij-community,vvv1559/intellij-community,Lekanich/intellij-community,robovm/robovm-studio,adedayo/intellij-community,asedunov/intellij-community,slisson/intellij-community,mglukhikh/intellij-community,vladmm/intellij-community,jagguli/intellij-community,MichaelNedzelsky/intellij-community,muntasirsyed/intellij-community,muntasirsyed/intellij-community,asedunov/intellij-community,fitermay/intellij-community,ThiagoGarciaAlves/intellij-community,dslomov/intellij-community,ivan-fedorov/intellij-community,akosyakov/intellij-community,Distrotech/intellij-community,dslomov/intellij-community,ol-loginov/intellij-community,da1z/intellij-community,xfournet/intellij-community,vvv1559/intellij-community,tmpgit/intellij-community,caot/intellij-community,SerCeMan/intellij-community,suncycheng/intellij-community,nicolargo/intellij-community,kool79/intellij-community,retomerz/intellij-community,clumsy/intellij-community,alphafoobar/intellij-community,retomerz/intellij-community,muntasirsyed/intellij-community,Distrotech/intellij-community,ibinti/intellij-community,asedunov/intellij-community,suncycheng/intellij-community,signed/intellij-community,TangHao1987/intellij-community,robovm/robovm-studio,ftomassetti/intellij-community,ftomassetti/intellij-community,Lekanich/intellij-community,suncycheng/intellij-community,adedayo/intellij-community,akosyakov/intellij-community,fitermay/intellij-community,ibinti/intellij-community,vladmm/intellij-community,MER-GROUP/intellij-community,MER-GROUP/intellij-community,MER-GROUP/intellij-community,jagguli/intellij-community,alphafoobar/intellij-community,Distrotech/intellij-community,asedunov/intellij-community,SerCeMan/intellij-community,da1z/intellij-community,mglukhikh/intellij-community,MichaelNedzelsky/intellij-community,jagguli/intellij-community,vladmm/intellij-community,allotria/intellij-community,dslomov/intellij-community,wreckJ/intellij-community,caot/intellij-community,dslomov/intellij-community,ibinti/intellij-community,salguarnieri/intellij-community,supersven/intellij-community,petteyg/intellij-community,salguarnieri/intellij-community,mglukhikh/intellij-community,retomerz/intellij-community,dslomov/intellij-community,adedayo/intellij-community,nicolargo/intellij-community,lucafavatella/intellij-community,amith01994/intellij-community,mglukhikh/intellij-community,ivan-fedorov/intellij-community,alphafoobar/intellij-community,michaelgallacher/intellij-community,adedayo/intellij-community,holmes/intellij-community,salguarnieri/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,idea4bsd/idea4bsd,ahb0327/intellij-community,asedunov/intellij-community,idea4bsd/idea4bsd,kool79/intellij-community,consulo/consulo,Lekanich/intellij-community,fitermay/intellij-community,kool79/intellij-community,gnuhub/intellij-community,orekyuu/intellij-community,ernestp/consulo,apixandru/intellij-community,vvv1559/intellij-community,ivan-fedorov/intellij-community,ol-loginov/intellij-community,ThiagoGarciaAlves/intellij-community,MichaelNedzelsky/intellij-community,alphafoobar/intellij-community,izonder/intellij-community,jagguli/intellij-community,akosyakov/intellij-community,nicolargo/intellij-community,clumsy/intellij-community,retomerz/intellij-community,samthor/intellij-community,signed/intellij-community,lucafavatella/intellij-community,semonte/intellij-community,kdwink/intellij-community,kdwink/intellij-community,suncycheng/intellij-community,idea4bsd/idea4bsd,muntasirsyed/intellij-community,adedayo/intellij-community,pwoodworth/intellij-community,slisson/intellij-community,allotria/intellij-community,MER-GROUP/intellij-community,alphafoobar/intellij-community,hurricup/intellij-community,diorcety/intellij-community,tmpgit/intellij-community,ThiagoGarciaAlves/intellij-community,MER-GROUP/intellij-community,vvv1559/intellij-community,Distrotech/intellij-community,youdonghai/intellij-community,FHannes/intellij-community,petteyg/intellij-community,slisson/intellij-community,slisson/intellij-community,ryano144/intellij-community,tmpgit/intellij-community,orekyuu/intellij-community,ernestp/consulo,mglukhikh/intellij-community,samthor/intellij-community,izonder/intellij-community,samthor/intellij-community,tmpgit/intellij-community,MichaelNedzelsky/intellij-community,FHannes/intellij-community,izonder/intellij-community,Lekanich/intellij-community,robovm/robovm-studio,diorcety/intellij-community,ryano144/intellij-community,consulo/consulo,alphafoobar/intellij-community,youdonghai/intellij-community,samthor/intellij-community,izonder/intellij-community,lucafavatella/intellij-community,fnouama/intellij-community,akosyakov/intellij-community,amith01994/intellij-community,mglukhikh/intellij-community,retomerz/intellij-community,da1z/intellij-community,supersven/intellij-community,SerCeMan/intellij-community,youdonghai/intellij-community,Distrotech/intellij-community,signed/intellij-community,pwoodworth/intellij-community,robovm/robovm-studio,clumsy/intellij-community,caot/intellij-community,pwoodworth/intellij-community,Distrotech/intellij-community,ol-loginov/intellij-community,ivan-fedorov/intellij-community,Lekanich/intellij-community,holmes/intellij-community,holmes/intellij-community,diorcety/intellij-community,apixandru/intellij-community,supersven/intellij-community,holmes/intellij-community,ibinti/intellij-community,SerCeMan/intellij-community,ahb0327/intellij-community,petteyg/intellij-community,asedunov/intellij-community,dslomov/intellij-community,amith01994/intellij-community,MichaelNedzelsky/intellij-community,lucafavatella/intellij-community,retomerz/intellij-community,pwoodworth/intellij-community,TangHao1987/intellij-community,petteyg/intellij-community,jagguli/intellij-community,robovm/robovm-studio,apixandru/intellij-community,da1z/intellij-community,ibinti/intellij-community,samthor/intellij-community,michaelgallacher/intellij-community,ivan-fedorov/intellij-community,ahb0327/intellij-community,lucafavatella/intellij-community,ThiagoGarciaAlves/intellij-community,ahb0327/intellij-community,diorcety/intellij-community,ryano144/intellij-community,diorcety/intellij-community,retomerz/intellij-community,izonder/intellij-community,gnuhub/intellij-community,kdwink/intellij-community,xfournet/intellij-community,caot/intellij-community,consulo/consulo,TangHao1987/intellij-community,holmes/intellij-community,adedayo/intellij-community,MER-GROUP/intellij-community,izonder/intellij-community,fitermay/intellij-community,ryano144/intellij-community,kool79/intellij-community,tmpgit/intellij-community,youdonghai/intellij-community,apixandru/intellij-community,vladmm/intellij-community,gnuhub/intellij-community,asedunov/intellij-community,fnouama/intellij-community,tmpgit/intellij-community,supersven/intellij-community,ftomassetti/intellij-community,apixandru/intellij-community,ahb0327/intellij-community,signed/intellij-community,MichaelNedzelsky/intellij-community,slisson/intellij-community,ibinti/intellij-community,diorcety/intellij-community,jagguli/intellij-community,signed/intellij-community,suncycheng/intellij-community,nicolargo/intellij-community,semonte/intellij-community,ol-loginov/intellij-community,wreckJ/intellij-community,kdwink/intellij-community,ftomassetti/intellij-community,ThiagoGarciaAlves/intellij-community,youdonghai/intellij-community,samthor/intellij-community,blademainer/intellij-community,fengbaicanhe/intellij-community,ftomassetti/intellij-community,allotria/intellij-community,vladmm/intellij-community,caot/intellij-community,amith01994/intellij-community,samthor/intellij-community,da1z/intellij-community,ol-loginov/intellij-community,hurricup/intellij-community,petteyg/intellij-community,petteyg/intellij-community,mglukhikh/intellij-community,amith01994/intellij-community,amith01994/intellij-community,akosyakov/intellij-community,vvv1559/intellij-community,Lekanich/intellij-community,nicolargo/intellij-community,salguarnieri/intellij-community,ahb0327/intellij-community,semonte/intellij-community,amith01994/intellij-community,allotria/intellij-community,fnouama/intellij-community,diorcety/intellij-community,TangHao1987/intellij-community,FHannes/intellij-community,xfournet/intellij-community,semonte/intellij-community,apixandru/intellij-community,apixandru/intellij-community,fitermay/intellij-community,ibinti/intellij-community,tmpgit/intellij-community,salguarnieri/intellij-community,fengbaicanhe/intellij-community,slisson/intellij-community,jagguli/intellij-community,suncycheng/intellij-community,ernestp/consulo,ftomassetti/intellij-community,alphafoobar/intellij-community,fitermay/intellij-community,jagguli/intellij-community,lucafavatella/intellij-community,asedunov/intellij-community,FHannes/intellij-community,blademainer/intellij-community,akosyakov/intellij-community,alphafoobar/intellij-community,vvv1559/intellij-community,ibinti/intellij-community,petteyg/intellij-community,fnouama/intellij-community,asedunov/intellij-community,blademainer/intellij-community,muntasirsyed/intellij-community,mglukhikh/intellij-community,hurricup/intellij-community,TangHao1987/intellij-community,tmpgit/intellij-community,vladmm/intellij-community,nicolargo/intellij-community,supersven/intellij-community,gnuhub/intellij-community,salguarnieri/intellij-community,lucafavatella/intellij-community,hurricup/intellij-community,mglukhikh/intellij-community,holmes/intellij-community,kool79/intellij-community,robovm/robovm-studio,salguarnieri/intellij-community,salguarnieri/intellij-community,izonder/intellij-community,vvv1559/intellij-community,ftomassetti/intellij-community,kool79/intellij-community,fnouama/intellij-community,slisson/intellij-community,ahb0327/intellij-community,samthor/intellij-community,adedayo/intellij-community,michaelgallacher/intellij-community,xfournet/intellij-community,FHannes/intellij-community,nicolargo/intellij-community,alphafoobar/intellij-community,idea4bsd/idea4bsd,slisson/intellij-community,asedunov/intellij-community,youdonghai/intellij-community,semonte/intellij-community,hurricup/intellij-community,clumsy/intellij-community,allotria/intellij-community,allotria/intellij-community,MichaelNedzelsky/intellij-community,wreckJ/intellij-community,MER-GROUP/intellij-community,clumsy/intellij-community,suncycheng/intellij-community,semonte/intellij-community,tmpgit/intellij-community,signed/intellij-community,slisson/intellij-community,fengbaicanhe/intellij-community,xfournet/intellij-community,da1z/intellij-community,vvv1559/intellij-community,retomerz/intellij-community,caot/intellij-community,caot/intellij-community,michaelgallacher/intellij-community,SerCeMan/intellij-community,MichaelNedzelsky/intellij-community,amith01994/intellij-community,signed/intellij-community,FHannes/intellij-community,gnuhub/intellij-community,nicolargo/intellij-community,vladmm/intellij-community,youdonghai/intellij-community,lucafavatella/intellij-community,robovm/robovm-studio,asedunov/intellij-community,pwoodworth/intellij-community,holmes/intellij-community,youdonghai/intellij-community,clumsy/intellij-community,FHannes/intellij-community,gnuhub/intellij-community,retomerz/intellij-community,consulo/consulo,amith01994/intellij-community,kool79/intellij-community,MichaelNedzelsky/intellij-community,blademainer/intellij-community,kdwink/intellij-community,slisson/intellij-community,ryano144/intellij-community,ftomassetti/intellij-community,pwoodworth/intellij-community,wreckJ/intellij-community,youdonghai/intellij-community,idea4bsd/idea4bsd,ibinti/intellij-community,fnouama/intellij-community,Lekanich/intellij-community,vvv1559/intellij-community,ol-loginov/intellij-community,orekyuu/intellij-community,diorcety/intellij-community,kdwink/intellij-community,da1z/intellij-community,youdonghai/intellij-community,SerCeMan/intellij-community,gnuhub/intellij-community,tmpgit/intellij-community,clumsy/intellij-community,fengbaicanhe/intellij-community,amith01994/intellij-community,ThiagoGarciaAlves/intellij-community,idea4bsd/idea4bsd,ThiagoGarciaAlves/intellij-community,allotria/intellij-community,signed/intellij-community,ol-loginov/intellij-community,MichaelNedzelsky/intellij-community,clumsy/intellij-community,orekyuu/intellij-community,salguarnieri/intellij-community,ivan-fedorov/intellij-community,idea4bsd/idea4bsd,blademainer/intellij-community,ol-loginov/intellij-community,supersven/intellij-community,youdonghai/intellij-community,semonte/intellij-community,fitermay/intellij-community,xfournet/intellij-community,MER-GROUP/intellij-community,clumsy/intellij-community,vladmm/intellij-community,petteyg/intellij-community,ernestp/consulo,caot/intellij-community,apixandru/intellij-community,semonte/intellij-community,samthor/intellij-community,jagguli/intellij-community,ftomassetti/intellij-community,kool79/intellij-community,semonte/intellij-community,wreckJ/intellij-community,hurricup/intellij-community,fitermay/intellij-community,diorcety/intellij-community,signed/intellij-community,diorcety/intellij-community,michaelgallacher/intellij-community,supersven/intellij-community,fengbaicanhe/intellij-community,vladmm/intellij-community,orekyuu/intellij-community,adedayo/intellij-community,wreckJ/intellij-community,FHannes/intellij-community,allotria/intellij-community,da1z/intellij-community,izonder/intellij-community,asedunov/intellij-community,amith01994/intellij-community,fengbaicanhe/intellij-community,fnouama/intellij-community,izonder/intellij-community,blademainer/intellij-community,semonte/intellij-community,slisson/intellij-community,kool79/intellij-community,fnouama/intellij-community,lucafavatella/intellij-community,retomerz/intellij-community,Distrotech/intellij-community,supersven/intellij-community,suncycheng/intellij-community,ThiagoGarciaAlves/intellij-community,michaelgallacher/intellij-community,alphafoobar/intellij-community,ivan-fedorov/intellij-community,muntasirsyed/intellij-community,ibinti/intellij-community,SerCeMan/intellij-community,youdonghai/intellij-community,consulo/consulo,pwoodworth/intellij-community,mglukhikh/intellij-community,xfournet/intellij-community,ftomassetti/intellij-community,dslomov/intellij-community,ernestp/consulo,TangHao1987/intellij-community,ahb0327/intellij-community,akosyakov/intellij-community,nicolargo/intellij-community,hurricup/intellij-community,TangHao1987/intellij-community,fitermay/intellij-community,muntasirsyed/intellij-community,diorcety/intellij-community,gnuhub/intellij-community,alphafoobar/intellij-community,fengbaicanhe/intellij-community,fnouama/intellij-community,adedayo/intellij-community,apixandru/intellij-community,hurricup/intellij-community,michaelgallacher/intellij-community,TangHao1987/intellij-community,ryano144/intellij-community,TangHao1987/intellij-community,petteyg/intellij-community,suncycheng/intellij-community,izonder/intellij-community,ryano144/intellij-community,ftomassetti/intellij-community,FHannes/intellij-community,pwoodworth/intellij-community,robovm/robovm-studio,FHannes/intellij-community,nicolargo/intellij-community,samthor/intellij-community,Lekanich/intellij-community,ivan-fedorov/intellij-community,muntasirsyed/intellij-community,blademainer/intellij-community,nicolargo/intellij-community,clumsy/intellij-community,Distrotech/intellij-community,ryano144/intellij-community,akosyakov/intellij-community,dslomov/intellij-community,holmes/intellij-community,fnouama/intellij-community,blademainer/intellij-community,ol-loginov/intellij-community,suncycheng/intellij-community,supersven/intellij-community,MER-GROUP/intellij-community,dslomov/intellij-community,Lekanich/intellij-community,lucafavatella/intellij-community,fengbaicanhe/intellij-community,blademainer/intellij-community,petteyg/intellij-community,jagguli/intellij-community,xfournet/intellij-community,idea4bsd/idea4bsd,kdwink/intellij-community,tmpgit/intellij-community,MichaelNedzelsky/intellij-community,pwoodworth/intellij-community,supersven/intellij-community,wreckJ/intellij-community,asedunov/intellij-community,alphafoobar/intellij-community,fitermay/intellij-community,pwoodworth/intellij-community,allotria/intellij-community,blademainer/intellij-community,Lekanich/intellij-community,ryano144/intellij-community,wreckJ/intellij-community,da1z/intellij-community,fnouama/intellij-community,suncycheng/intellij-community,adedayo/intellij-community,kool79/intellij-community,clumsy/intellij-community,SerCeMan/intellij-community,ryano144/intellij-community,vvv1559/intellij-community,TangHao1987/intellij-community,dslomov/intellij-community,apixandru/intellij-community,idea4bsd/idea4bsd,ol-loginov/intellij-community,wreckJ/intellij-community,retomerz/intellij-community,ernestp/consulo,gnuhub/intellij-community,clumsy/intellij-community,robovm/robovm-studio,ryano144/intellij-community,kdwink/intellij-community,wreckJ/intellij-community,kdwink/intellij-community,orekyuu/intellij-community,dslomov/intellij-community,vladmm/intellij-community,lucafavatella/intellij-community,holmes/intellij-community,michaelgallacher/intellij-community,mglukhikh/intellij-community,muntasirsyed/intellij-community,hurricup/intellij-community,xfournet/intellij-community,da1z/intellij-community,idea4bsd/idea4bsd,supersven/intellij-community,mglukhikh/intellij-community,fengbaicanhe/intellij-community,FHannes/intellij-community,orekyuu/intellij-community,michaelgallacher/intellij-community,hurricup/intellij-community,FHannes/intellij-community,Lekanich/intellij-community,ThiagoGarciaAlves/intellij-community,Distrotech/intellij-community,orekyuu/intellij-community,ivan-fedorov/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,da1z/intellij-community,wreckJ/intellij-community,SerCeMan/intellij-community,caot/intellij-community,ivan-fedorov/intellij-community,dslomov/intellij-community,robovm/robovm-studio,michaelgallacher/intellij-community,allotria/intellij-community,MER-GROUP/intellij-community,hurricup/intellij-community,samthor/intellij-community,jagguli/intellij-community,SerCeMan/intellij-community,ivan-fedorov/intellij-community,muntasirsyed/intellij-community,vvv1559/intellij-community,SerCeMan/intellij-community,caot/intellij-community,FHannes/intellij-community,holmes/intellij-community,petteyg/intellij-community,allotria/intellij-community,diorcety/intellij-community,samthor/intellij-community,ThiagoGarciaAlves/intellij-community,MichaelNedzelsky/intellij-community,suncycheng/intellij-community,kool79/intellij-community,kool79/intellij-community,wreckJ/intellij-community,mglukhikh/intellij-community,apixandru/intellij-community,michaelgallacher/intellij-community,orekyuu/intellij-community,ahb0327/intellij-community,michaelgallacher/intellij-community,signed/intellij-community,slisson/intellij-community,izonder/intellij-community,caot/intellij-community,akosyakov/intellij-community,ThiagoGarciaAlves/intellij-community,fitermay/intellij-community,tmpgit/intellij-community,izonder/intellij-community,salguarnieri/intellij-community,orekyuu/intellij-community,da1z/intellij-community,apixandru/intellij-community,fnouama/intellij-community,TangHao1987/intellij-community,salguarnieri/intellij-community,robovm/robovm-studio,ol-loginov/intellij-community,salguarnieri/intellij-community,gnuhub/intellij-community,TangHao1987/intellij-community,youdonghai/intellij-community,orekyuu/intellij-community,signed/intellij-community,ahb0327/intellij-community,semonte/intellij-community,da1z/intellij-community,ibinti/intellij-community,fengbaicanhe/intellij-community,signed/intellij-community,apixandru/intellij-community,ibinti/intellij-community,allotria/intellij-community,apixandru/intellij-community,xfournet/intellij-community,caot/intellij-community,vladmm/intellij-community,fengbaicanhe/intellij-community,gnuhub/intellij-community,ibinti/intellij-community,consulo/consulo,amith01994/intellij-community,ThiagoGarciaAlves/intellij-community,adedayo/intellij-community | /*
* Copyright 2000-2010 JetBrains s.r.o.
*
* 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.
*/
package org.jetbrains.android.compiler.tools;
import com.android.jarutils.DebugKeyProvider;
import com.android.jarutils.JavaResourceFilter;
import com.android.jarutils.SignedJarBuilder;
import com.android.prefs.AndroidLocation;
import com.android.sdklib.SdkConstants;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.text.DateFormatUtil;
import org.jetbrains.android.util.AndroidBundle;
import org.jetbrains.android.util.AndroidUtils;
import org.jetbrains.android.util.ExecutionUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import static com.intellij.openapi.compiler.CompilerMessageCategory.*;
/**
* @author yole
*/
public class AndroidApkBuilder {
private static final Logger LOG = Logger.getInstance("#org.jetbrains.android.compiler.tools.AndroidApkBuilder");
private static final String UNALIGNED_SUFFIX = ".unaligned";
private AndroidApkBuilder() {
}
private static Map<CompilerMessageCategory, List<String>> filterUsingKeystoreMessages(Map<CompilerMessageCategory, List<String>> messages) {
List<String> infoMessages = messages.get(INFORMATION);
if (infoMessages == null) {
infoMessages = new ArrayList<String>();
messages.put(INFORMATION, infoMessages);
}
final List<String> errors = messages.get(ERROR);
for (Iterator<String> iterator = errors.iterator(); iterator.hasNext();) {
String s = iterator.next();
if (s.startsWith("Using keystore:")) {
// not actually an error
infoMessages.add(s);
iterator.remove();
}
}
return messages;
}
@SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"})
private static void collectDuplicateEntries(@NotNull String rootFile, @NotNull Set<String> entries, @NotNull Set<String> result)
throws IOException {
final JavaResourceFilter javaResourceFilter = new JavaResourceFilter();
FileInputStream fis = null;
ZipInputStream zis = null;
try {
fis = new FileInputStream(rootFile);
zis = new ZipInputStream(fis);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
if (!entry.isDirectory()) {
String name = entry.getName();
if (javaResourceFilter.checkEntry(name) && !entries.add(name)) {
result.add(name);
}
zis.closeEntry();
}
}
}
finally {
if (zis != null) {
zis.close();
}
if (fis != null) {
fis.close();
}
}
}
public static Map<CompilerMessageCategory, List<String>> execute(Project project,
@NotNull String resPackagePath,
@NotNull String dexPath,
@NotNull VirtualFile[] sourceRoots,
@NotNull String[] externalJars,
@NotNull VirtualFile[] nativeLibsFolders,
@NotNull String finalApk,
boolean unsigned,
@NotNull String sdkPath) throws IOException {
if (unsigned) {
return filterUsingKeystoreMessages(
finalPackage(project, dexPath, sourceRoots, externalJars, nativeLibsFolders, finalApk, resPackagePath, false));
}
final Map<CompilerMessageCategory, List<String>> map = new HashMap<CompilerMessageCategory, List<String>>();
final String zipAlignPath = sdkPath + File.separator + AndroidUtils.toolPath(SdkConstants.FN_ZIPALIGN);
boolean withAlignment = new File(zipAlignPath).exists();
String unalignedApk = finalApk + UNALIGNED_SUFFIX;
Map<CompilerMessageCategory, List<String>> map2 = filterUsingKeystoreMessages(
finalPackage(project, dexPath, sourceRoots, externalJars, nativeLibsFolders, withAlignment ? unalignedApk : finalApk, resPackagePath,
true));
map.putAll(map2);
if (withAlignment && map.get(ERROR).size() == 0) {
map2 = ExecutionUtil.execute(zipAlignPath, "-f", "4", unalignedApk, finalApk);
map.putAll(map2);
}
return map;
}
private static Map<CompilerMessageCategory, List<String>> finalPackage(Project project,
@NotNull String dexPath,
@NotNull VirtualFile[] sourceRoots,
@NotNull String[] externalJars,
@NotNull VirtualFile[] nativeLibsFolders,
@NotNull String outputApk, @NotNull String apkPath,
boolean signed) {
final Map<CompilerMessageCategory, List<String>> result = new HashMap<CompilerMessageCategory, List<String>>();
result.put(ERROR, new ArrayList<String>());
result.put(INFORMATION, new ArrayList<String>());
result.put(WARNING, new ArrayList<String>());
FileOutputStream fos = null;
try {
String keyStoreOsPath = DebugKeyProvider.getDefaultKeyStoreOsPath();
DebugKeyProvider provider = createDebugKeyProvider(result, keyStoreOsPath);
X509Certificate certificate = signed ? (X509Certificate)provider.getCertificate() : null;
if (certificate != null && certificate.getNotAfter().compareTo(new Date()) < 0) {
// generate a new one
File keyStoreFile = new File(keyStoreOsPath);
if (keyStoreFile.exists()) {
keyStoreFile.delete();
}
provider = createDebugKeyProvider(result, keyStoreOsPath);
certificate = (X509Certificate)provider.getCertificate();
}
if (certificate != null && certificate.getNotAfter().compareTo(new Date()) < 0) {
String date = DateFormatUtil.formatPrettyDateTime(certificate.getNotAfter());
result.get(ERROR).add(AndroidBundle.message("android.debug.certificate.expired.error", date, keyStoreOsPath));
return result;
}
PrivateKey key = provider.getDebugKey();
if (key == null) {
result.get(ERROR).add(AndroidBundle.message("android.cannot.create.new.key.error"));
return result;
}
if (!new File(apkPath).exists()) {
result.get(CompilerMessageCategory.ERROR).add("File " + apkPath + " not found. Try to rebuild project");
return result;
}
File dexEntryFile = new File(dexPath);
if (!dexEntryFile.exists()) {
result.get(CompilerMessageCategory.ERROR).add("File " + dexEntryFile.getPath() + " not found. Try to rebuild project");
return result;
}
for (String externalJar : externalJars) {
if (new File(externalJar).isDirectory()) {
result.get(CompilerMessageCategory.ERROR).add(externalJar + " is directory. Directory libraries are not supported");
}
}
if (result.get(CompilerMessageCategory.ERROR).size() > 0) {
return result;
}
fos = new FileOutputStream(outputApk);
SignedJarBuilder builder = new SignedJarBuilder(fos, key, certificate);
FileInputStream fis = new FileInputStream(apkPath);
try {
builder.writeZip(fis, null);
}
finally {
fis.close();
}
builder.writeFile(dexEntryFile, AndroidUtils.CLASSES_FILE_NAME);
final HashSet<String> added = new HashSet<String>();
for (VirtualFile sourceRoot : sourceRoots) {
final HashSet<VirtualFile> sourceFolderResources = new HashSet<VirtualFile>();
collectStandardSourceFolderResources(sourceRoot, new HashSet<VirtualFile>(), sourceFolderResources, project);
writeStandardSourceFolderResources(sourceFolderResources, sourceRoot, builder, added);
}
Set<String> duplicates = new HashSet<String>();
Set<String> entries = new HashSet<String>();
for (String externalJar : externalJars) {
collectDuplicateEntries(externalJar, entries, duplicates);
}
for (String duplicate : duplicates) {
result.get(CompilerMessageCategory.WARNING).add("Duplicate entry " + duplicate + ". The file won't be added");
}
MyResourceFilter filter = new MyResourceFilter(duplicates);
for (String externalJar : externalJars) {
fis = new FileInputStream(externalJar);
try {
builder.writeZip(fis, filter);
}
finally {
fis.close();
}
}
for (VirtualFile nativeLibsFolder : nativeLibsFolders) {
for (VirtualFile child : nativeLibsFolder.getChildren()) {
writeNativeLibraries(builder, nativeLibsFolder, child, signed);
}
}
builder.close();
}
catch (IOException e) {
return addExceptionMessage(e, result);
}
catch (CertificateException e) {
return addExceptionMessage(e, result);
}
catch (DebugKeyProvider.KeytoolException e) {
return addExceptionMessage(e, result);
}
catch (AndroidLocation.AndroidLocationException e) {
return addExceptionMessage(e, result);
}
catch (NoSuchAlgorithmException e) {
return addExceptionMessage(e, result);
}
catch (UnrecoverableEntryException e) {
return addExceptionMessage(e, result);
}
catch (KeyStoreException e) {
return addExceptionMessage(e, result);
}
catch (GeneralSecurityException e) {
return addExceptionMessage(e, result);
}
finally {
if (fos != null) {
try {
fos.close();
}
catch (IOException ignored) {
}
}
}
return result;
}
private static DebugKeyProvider createDebugKeyProvider(final Map<CompilerMessageCategory, List<String>> result, String path) throws
KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
UnrecoverableEntryException,
IOException,
DebugKeyProvider.KeytoolException,
AndroidLocation.AndroidLocationException {
return new DebugKeyProvider(path, null, new DebugKeyProvider.IKeyGenOutput() {
public void err(String message) {
result.get(ERROR).add("Error during key creation: " + message);
}
public void out(String message) {
result.get(INFORMATION).add("Info message during key creation: " + message);
}
});
}
private static void writeNativeLibraries(SignedJarBuilder builder, VirtualFile nativeLibsFolder, VirtualFile child, boolean debugBuild)
throws IOException {
ArrayList<VirtualFile> list = new ArrayList<VirtualFile>();
collectNativeLibraries(child, list, debugBuild);
for (VirtualFile file : list) {
String relativePath = VfsUtil.getRelativePath(file, nativeLibsFolder, File.separatorChar);
String path = FileUtil.toSystemIndependentName(SdkConstants.FD_APK_NATIVE_LIBS + File.separator + relativePath);
builder.writeFile(toIoFile(file), path);
}
}
private static Map<CompilerMessageCategory, List<String>> addExceptionMessage(Exception e,
Map<CompilerMessageCategory, List<String>> result) {
LOG.info(e);
String simpleExceptionName = e.getClass().getCanonicalName();
result.get(ERROR).add(simpleExceptionName + ": " + e.getMessage());
return result;
}
public static void collectNativeLibraries(@NotNull VirtualFile file, @NotNull List<VirtualFile> result, boolean debugBuild) {
if (!file.isDirectory()) {
String ext = file.getExtension();
if (AndroidUtils.EXT_NATIVE_LIB.equalsIgnoreCase(ext) || debugBuild) {
result.add(file);
}
}
else if (JavaResourceFilter.checkFolderForPackaging(file.getName())) {
for (VirtualFile child : file.getChildren()) {
collectNativeLibraries(child, result, debugBuild);
}
}
}
public static void collectStandardSourceFolderResources(VirtualFile sourceFolder,
Set<VirtualFile> visited,
Set<VirtualFile> result,
@Nullable Project project) {
visited.add(sourceFolder);
final CompilerManager compilerManager = project != null ? CompilerManager.getInstance(project) : null;
for (VirtualFile child : sourceFolder.getChildren()) {
if (child.exists()) {
if (child.isDirectory()) {
if (!visited.contains(child) &&
JavaResourceFilter.checkFolderForPackaging(child.getName()) &&
(compilerManager == null || !compilerManager.isExcludedFromCompilation(child))) {
collectStandardSourceFolderResources(child, visited, result, project);
}
}
else if (checkFileForPackaging(child) &&
(compilerManager == null || !compilerManager.isExcludedFromCompilation(child))) {
result.add(child);
}
}
}
}
private static void writeStandardSourceFolderResources(Collection<VirtualFile> resources,
VirtualFile sourceRoot,
SignedJarBuilder jarBuilder,
Set<String> added) throws IOException {
for (VirtualFile child : resources) {
final String relativePath = FileUtil.toSystemIndependentName(VfsUtil.getRelativePath(child, sourceRoot, File.separatorChar));
if (!added.contains(relativePath)) {
File file = toIoFile(child);
jarBuilder.writeFile(file, FileUtil.toSystemIndependentName(relativePath));
added.add(relativePath);
}
}
}
private static File toIoFile(VirtualFile child) {
return new File(FileUtil.toSystemDependentName(child.getPath())).getAbsoluteFile();
}
private static boolean checkFileForPackaging(VirtualFile file) {
String fileName = file.getNameWithoutExtension();
if (fileName.length() > 0) {
return JavaResourceFilter.checkFileForPackaging(fileName, file.getExtension());
}
return false;
}
private static class MyResourceFilter extends JavaResourceFilter {
private final Set<String> myExcludedEntries;
public MyResourceFilter(@NotNull Set<String> excludedEntries) {
myExcludedEntries = excludedEntries;
}
@Override
public boolean checkEntry(String name) {
if (myExcludedEntries.contains(name)) {
return false;
}
return super.checkEntry(name);
}
}
} | plugins/android/src/org/jetbrains/android/compiler/tools/AndroidApkBuilder.java | /*
* Copyright 2000-2010 JetBrains s.r.o.
*
* 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.
*/
package org.jetbrains.android.compiler.tools;
import com.android.jarutils.DebugKeyProvider;
import com.android.jarutils.JavaResourceFilter;
import com.android.jarutils.SignedJarBuilder;
import com.android.prefs.AndroidLocation;
import com.android.sdklib.SdkConstants;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
import com.intellij.util.text.DateFormatUtil;
import org.jetbrains.android.util.AndroidBundle;
import org.jetbrains.android.util.AndroidUtils;
import org.jetbrains.android.util.ExecutionUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import static com.intellij.openapi.compiler.CompilerMessageCategory.*;
/**
* @author yole
*/
public class AndroidApkBuilder {
private static final String UNALIGNED_SUFFIX = ".unaligned";
private AndroidApkBuilder() {
}
private static Map<CompilerMessageCategory, List<String>> filterUsingKeystoreMessages(Map<CompilerMessageCategory, List<String>> messages) {
List<String> infoMessages = messages.get(INFORMATION);
if (infoMessages == null) {
infoMessages = new ArrayList<String>();
messages.put(INFORMATION, infoMessages);
}
final List<String> errors = messages.get(ERROR);
for (Iterator<String> iterator = errors.iterator(); iterator.hasNext();) {
String s = iterator.next();
if (s.startsWith("Using keystore:")) {
// not actually an error
infoMessages.add(s);
iterator.remove();
}
}
return messages;
}
@SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"})
private static void collectDuplicateEntries(@NotNull String rootFile, @NotNull Set<String> entries, @NotNull Set<String> result)
throws IOException {
final JavaResourceFilter javaResourceFilter = new JavaResourceFilter();
FileInputStream fis = null;
ZipInputStream zis = null;
try {
fis = new FileInputStream(rootFile);
zis = new ZipInputStream(fis);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
if (!entry.isDirectory()) {
String name = entry.getName();
if (javaResourceFilter.checkEntry(name) && !entries.add(name)) {
result.add(name);
}
zis.closeEntry();
}
}
}
finally {
if (zis != null) {
zis.close();
}
if (fis != null) {
fis.close();
}
}
}
public static Map<CompilerMessageCategory, List<String>> execute(Project project,
@NotNull String resPackagePath,
@NotNull String dexPath,
@NotNull VirtualFile[] sourceRoots,
@NotNull String[] externalJars,
@NotNull VirtualFile[] nativeLibsFolders,
@NotNull String finalApk,
boolean unsigned,
@NotNull String sdkPath) throws IOException {
if (unsigned) {
return filterUsingKeystoreMessages(
finalPackage(project, dexPath, sourceRoots, externalJars, nativeLibsFolders, finalApk, resPackagePath, false));
}
final Map<CompilerMessageCategory, List<String>> map = new HashMap<CompilerMessageCategory, List<String>>();
final String zipAlignPath = sdkPath + File.separator + AndroidUtils.toolPath(SdkConstants.FN_ZIPALIGN);
boolean withAlignment = new File(zipAlignPath).exists();
String unalignedApk = finalApk + UNALIGNED_SUFFIX;
Map<CompilerMessageCategory, List<String>> map2 = filterUsingKeystoreMessages(
finalPackage(project, dexPath, sourceRoots, externalJars, nativeLibsFolders, withAlignment ? unalignedApk : finalApk, resPackagePath,
true));
map.putAll(map2);
if (withAlignment && map.get(ERROR).size() == 0) {
map2 = ExecutionUtil.execute(zipAlignPath, "-f", "4", unalignedApk, finalApk);
map.putAll(map2);
}
return map;
}
private static Map<CompilerMessageCategory, List<String>> finalPackage(Project project,
@NotNull String dexPath,
@NotNull VirtualFile[] sourceRoots,
@NotNull String[] externalJars,
@NotNull VirtualFile[] nativeLibsFolders,
@NotNull String outputApk, @NotNull String apkPath,
boolean signed) {
final Map<CompilerMessageCategory, List<String>> result = new HashMap<CompilerMessageCategory, List<String>>();
result.put(ERROR, new ArrayList<String>());
result.put(INFORMATION, new ArrayList<String>());
result.put(WARNING, new ArrayList<String>());
FileOutputStream fos = null;
try {
String keyStoreOsPath = DebugKeyProvider.getDefaultKeyStoreOsPath();
DebugKeyProvider provider = createDebugKeyProvider(result, keyStoreOsPath);
X509Certificate certificate = signed ? (X509Certificate)provider.getCertificate() : null;
if (certificate != null && certificate.getNotAfter().compareTo(new Date()) < 0) {
// generate a new one
File keyStoreFile = new File(keyStoreOsPath);
if (keyStoreFile.exists()) {
keyStoreFile.delete();
}
provider = createDebugKeyProvider(result, keyStoreOsPath);
certificate = (X509Certificate)provider.getCertificate();
}
if (certificate != null && certificate.getNotAfter().compareTo(new Date()) < 0) {
String date = DateFormatUtil.formatPrettyDateTime(certificate.getNotAfter());
result.get(ERROR).add(AndroidBundle.message("android.debug.certificate.expired.error", date, keyStoreOsPath));
return result;
}
PrivateKey key = provider.getDebugKey();
if (key == null) {
result.get(ERROR).add(AndroidBundle.message("android.cannot.create.new.key.error"));
return result;
}
if (!new File(apkPath).exists()) {
result.get(CompilerMessageCategory.ERROR).add("File " + apkPath + " not found. Try to rebuild project");
return result;
}
File dexEntryFile = new File(dexPath);
if (!dexEntryFile.exists()) {
result.get(CompilerMessageCategory.ERROR).add("File " + dexEntryFile.getPath() + " not found. Try to rebuild project");
return result;
}
for (String externalJar : externalJars) {
if (new File(externalJar).isDirectory()) {
result.get(CompilerMessageCategory.ERROR).add(externalJar + " is directory. Directory libraries are not supported");
}
}
if (result.get(CompilerMessageCategory.ERROR).size() > 0) {
return result;
}
fos = new FileOutputStream(outputApk);
SignedJarBuilder builder = new SignedJarBuilder(fos, key, certificate);
FileInputStream fis = new FileInputStream(apkPath);
try {
builder.writeZip(fis, null);
}
finally {
fis.close();
}
builder.writeFile(dexEntryFile, AndroidUtils.CLASSES_FILE_NAME);
final HashSet<String> added = new HashSet<String>();
for (VirtualFile sourceRoot : sourceRoots) {
final HashSet<VirtualFile> sourceFolderResources = new HashSet<VirtualFile>();
collectStandardSourceFolderResources(sourceRoot, new HashSet<VirtualFile>(), sourceFolderResources, project);
writeStandardSourceFolderResources(sourceFolderResources, sourceRoot, builder, added);
}
Set<String> duplicates = new HashSet<String>();
Set<String> entries = new HashSet<String>();
for (String externalJar : externalJars) {
collectDuplicateEntries(externalJar, entries, duplicates);
}
for (String duplicate : duplicates) {
result.get(CompilerMessageCategory.WARNING).add("Duplicate entry " + duplicate + ". The file won't be added");
}
MyResourceFilter filter = new MyResourceFilter(duplicates);
for (String externalJar : externalJars) {
fis = new FileInputStream(externalJar);
try {
builder.writeZip(fis, filter);
}
finally {
fis.close();
}
}
for (VirtualFile nativeLibsFolder : nativeLibsFolders) {
for (VirtualFile child : nativeLibsFolder.getChildren()) {
writeNativeLibraries(builder, nativeLibsFolder, child, signed);
}
}
builder.close();
}
catch (IOException e) {
return addExceptionMessage(e, result);
}
catch (CertificateException e) {
return addExceptionMessage(e, result);
}
catch (DebugKeyProvider.KeytoolException e) {
return addExceptionMessage(e, result);
}
catch (AndroidLocation.AndroidLocationException e) {
return addExceptionMessage(e, result);
}
catch (NoSuchAlgorithmException e) {
return addExceptionMessage(e, result);
}
catch (UnrecoverableEntryException e) {
return addExceptionMessage(e, result);
}
catch (KeyStoreException e) {
return addExceptionMessage(e, result);
}
catch (GeneralSecurityException e) {
return addExceptionMessage(e, result);
}
finally {
if (fos != null) {
try {
fos.close();
}
catch (IOException ignored) {
}
}
}
return result;
}
private static DebugKeyProvider createDebugKeyProvider(final Map<CompilerMessageCategory, List<String>> result, String path) throws
KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
UnrecoverableEntryException,
IOException,
DebugKeyProvider.KeytoolException,
AndroidLocation.AndroidLocationException {
return new DebugKeyProvider(path, null, new DebugKeyProvider.IKeyGenOutput() {
public void err(String message) {
result.get(ERROR).add("Error during key creation: " + message);
}
public void out(String message) {
result.get(INFORMATION).add("Info message during key creation: " + message);
}
});
}
private static void writeNativeLibraries(SignedJarBuilder builder, VirtualFile nativeLibsFolder, VirtualFile child, boolean debugBuild)
throws IOException {
ArrayList<VirtualFile> list = new ArrayList<VirtualFile>();
collectNativeLibraries(child, list, debugBuild);
for (VirtualFile file : list) {
String relativePath = VfsUtil.getRelativePath(file, nativeLibsFolder, File.separatorChar);
String path = FileUtil.toSystemIndependentName(SdkConstants.FD_APK_NATIVE_LIBS + File.separator + relativePath);
builder.writeFile(toIoFile(file), path);
}
}
private static Map<CompilerMessageCategory, List<String>> addExceptionMessage(Exception e,
Map<CompilerMessageCategory, List<String>> result) {
String simpleExceptionName = e.getClass().getCanonicalName();
result.get(ERROR).add(simpleExceptionName + ": " + e.getMessage());
return result;
}
public static void collectNativeLibraries(@NotNull VirtualFile file, @NotNull List<VirtualFile> result, boolean debugBuild) {
if (!file.isDirectory()) {
String ext = file.getExtension();
if (AndroidUtils.EXT_NATIVE_LIB.equalsIgnoreCase(ext) || debugBuild) {
result.add(file);
}
}
else if (JavaResourceFilter.checkFolderForPackaging(file.getName())) {
for (VirtualFile child : file.getChildren()) {
collectNativeLibraries(child, result, debugBuild);
}
}
}
public static void collectStandardSourceFolderResources(VirtualFile sourceFolder,
Set<VirtualFile> visited,
Set<VirtualFile> result,
@Nullable Project project) {
visited.add(sourceFolder);
final CompilerManager compilerManager = project != null ? CompilerManager.getInstance(project) : null;
for (VirtualFile child : sourceFolder.getChildren()) {
if (child.exists()) {
if (child.isDirectory()) {
if (!visited.contains(child) &&
JavaResourceFilter.checkFolderForPackaging(child.getName()) &&
(compilerManager == null || !compilerManager.isExcludedFromCompilation(child))) {
collectStandardSourceFolderResources(child, visited, result, project);
}
}
else if (checkFileForPackaging(child) &&
(compilerManager == null || !compilerManager.isExcludedFromCompilation(child))) {
result.add(child);
}
}
}
}
private static void writeStandardSourceFolderResources(Collection<VirtualFile> resources,
VirtualFile sourceRoot,
SignedJarBuilder jarBuilder,
Set<String> added) throws IOException {
for (VirtualFile child : resources) {
final String relativePath = FileUtil.toSystemIndependentName(VfsUtil.getRelativePath(child, sourceRoot, File.separatorChar));
if (!added.contains(relativePath)) {
File file = toIoFile(child);
jarBuilder.writeFile(file, FileUtil.toSystemIndependentName(relativePath));
added.add(relativePath);
}
}
}
private static File toIoFile(VirtualFile child) {
return new File(FileUtil.toSystemDependentName(child.getPath())).getAbsoluteFile();
}
private static boolean checkFileForPackaging(VirtualFile file) {
String fileName = file.getNameWithoutExtension();
if (fileName.length() > 0) {
return JavaResourceFilter.checkFileForPackaging(fileName, file.getExtension());
}
return false;
}
private static class MyResourceFilter extends JavaResourceFilter {
private final Set<String> myExcludedEntries;
public MyResourceFilter(@NotNull Set<String> excludedEntries) {
myExcludedEntries = excludedEntries;
}
@Override
public boolean checkEntry(String name) {
if (myExcludedEntries.contains(name)) {
return false;
}
return super.checkEntry(name);
}
}
} | log exceptions from apkbuilder
| plugins/android/src/org/jetbrains/android/compiler/tools/AndroidApkBuilder.java | log exceptions from apkbuilder | <ide><path>lugins/android/src/org/jetbrains/android/compiler/tools/AndroidApkBuilder.java
<ide> import com.android.sdklib.SdkConstants;
<ide> import com.intellij.openapi.compiler.CompilerManager;
<ide> import com.intellij.openapi.compiler.CompilerMessageCategory;
<add>import com.intellij.openapi.diagnostic.Logger;
<ide> import com.intellij.openapi.project.Project;
<ide> import com.intellij.openapi.util.io.FileUtil;
<ide> import com.intellij.openapi.vfs.VfsUtil;
<ide> * @author yole
<ide> */
<ide> public class AndroidApkBuilder {
<add> private static final Logger LOG = Logger.getInstance("#org.jetbrains.android.compiler.tools.AndroidApkBuilder");
<add>
<ide> private static final String UNALIGNED_SUFFIX = ".unaligned";
<ide>
<ide> private AndroidApkBuilder() {
<ide>
<ide> private static Map<CompilerMessageCategory, List<String>> addExceptionMessage(Exception e,
<ide> Map<CompilerMessageCategory, List<String>> result) {
<add> LOG.info(e);
<ide> String simpleExceptionName = e.getClass().getCanonicalName();
<ide> result.get(ERROR).add(simpleExceptionName + ": " + e.getMessage());
<ide> return result; |
|
Java | mit | c890b7130bbdd85a9930323c59459be5cfbc6572 | 0 | Nunnery/MythicDrops | package net.nunnerycode.bukkit.mythicdrops.items;
import net.nunnerycode.bukkit.mythicdrops.MythicDropsPlugin;
import net.nunnerycode.bukkit.mythicdrops.api.enchantments.MythicEnchantment;
import net.nunnerycode.bukkit.mythicdrops.api.items.ItemGenerationReason;
import net.nunnerycode.bukkit.mythicdrops.api.items.MythicItemStack;
import net.nunnerycode.bukkit.mythicdrops.api.items.NonrepairableItemStack;
import net.nunnerycode.bukkit.mythicdrops.api.items.builders.DropBuilder;
import net.nunnerycode.bukkit.mythicdrops.api.names.NameType;
import net.nunnerycode.bukkit.mythicdrops.api.tiers.Tier;
import net.nunnerycode.bukkit.mythicdrops.events.RandomItemGenerationEvent;
import net.nunnerycode.bukkit.mythicdrops.names.NameMap;
import net.nunnerycode.bukkit.mythicdrops.tiers.TierMap;
import net.nunnerycode.bukkit.mythicdrops.utils.ItemStackUtil;
import net.nunnerycode.bukkit.mythicdrops.utils.ItemUtil;
import net.nunnerycode.bukkit.mythicdrops.utils.RandomRangeUtil;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang3.text.WordUtils;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentWrapper;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.material.MaterialData;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class MythicDropBuilder implements DropBuilder {
private Tier tier;
private MaterialData materialData;
private ItemGenerationReason itemGenerationReason;
private World world;
private boolean useDurability;
private boolean callEvent;
public MythicDropBuilder() {
tier = null;
itemGenerationReason = ItemGenerationReason.DEFAULT;
world = Bukkit.getServer().getWorlds().get(0);
useDurability = false;
callEvent = true;
}
public DropBuilder withCallEvent(boolean b) {
this.callEvent = b;
return this;
}
@Override
public DropBuilder withTier(Tier tier) {
this.tier = tier;
return this;
}
@Override
public DropBuilder withTier(String tierName) {
this.tier = TierMap.getInstance().get(tierName);
return this;
}
@Override
public DropBuilder withMaterialData(MaterialData materialData) {
this.materialData = materialData;
return this;
}
@Override
public DropBuilder withMaterialData(String materialDataString) {
MaterialData matData = null;
if (materialDataString.contains(";")) {
String[] split = materialDataString.split(";");
matData = new MaterialData(NumberUtils.toInt(split[0], 0), (byte) NumberUtils.toInt(split[1], 0));
} else {
matData = new MaterialData(NumberUtils.toInt(materialDataString, 0));
}
this.materialData = matData;
return this;
}
@Override
public DropBuilder withItemGenerationReason(ItemGenerationReason reason) {
this.itemGenerationReason = reason;
return this;
}
@Override
public DropBuilder inWorld(World world) {
this.world = world;
return this;
}
@Override
public DropBuilder inWorld(String worldName) {
this.world = Bukkit.getWorld(worldName);
return this;
}
@Override
public DropBuilder useDurability(boolean b) {
this.useDurability = b;
return this;
}
@Override
public MythicItemStack build() {
World w = world != null ? world : Bukkit.getWorlds().get(0);
Tier t = (tier != null) ? tier : TierMap.getInstance().getRandomWithChance(w.getName());
if (t == null) {
t = TierMap.getInstance().getRandomWithChance("default");
if (t == null) {
return null;
}
}
MaterialData md = (materialData != null) ? materialData : ItemUtil.getRandomMaterialDataFromCollection
(ItemUtil.getMaterialDatasFromTier(t));
NonrepairableItemStack nis = new NonrepairableItemStack(md.getItemType(), 1, (short) 0, "");
ItemMeta im = nis.getItemMeta();
Map<Enchantment, Integer> baseEnchantmentMap = getBaseEnchantments(nis, t);
Map<Enchantment, Integer> bonusEnchantmentMap = getBonusEnchantments(nis, t);
for (Map.Entry<Enchantment, Integer> baseEnch : baseEnchantmentMap.entrySet()) {
im.addEnchant(baseEnch.getKey(), baseEnch.getValue(), true);
}
for (Map.Entry<Enchantment, Integer> bonusEnch : bonusEnchantmentMap.entrySet()) {
im.addEnchant(bonusEnch.getKey(), bonusEnch.getValue(), true);
}
if (useDurability) {
nis.setDurability(ItemStackUtil.getDurabilityForMaterial(nis.getType(), t.getMinimumDurabilityPercentage
(), t.getMaximumDurabilityPercentage()));
}
String name = generateName(nis);
List<String> lore = generateLore(nis);
im.setDisplayName(name);
im.setLore(lore);
if (nis.getItemMeta() instanceof LeatherArmorMeta) {
((LeatherArmorMeta) im).setColor(Color.fromRGB(RandomUtils.nextInt(255),
RandomUtils.nextInt(255), RandomUtils.nextInt(255)));
}
nis.setItemMeta(im);
if (callEvent) {
RandomItemGenerationEvent rige = new RandomItemGenerationEvent(t, nis, itemGenerationReason);
Bukkit.getPluginManager().callEvent(rige);
if (rige.isCancelled()) {
return null;
}
return rige.getItemStack();
}
return nis;
}
private Map<Enchantment, Integer> getBonusEnchantments(MythicItemStack is, Tier t) {
Validate.notNull(is, "MythicItemStack cannot be null");
Validate.notNull(t, "Tier cannot be null");
if (t.getBonusEnchantments().isEmpty()) {
return new HashMap<>();
}
Map<Enchantment, Integer> map = new HashMap<>();
int added = 0;
int attempts = 0;
int range = (int) RandomRangeUtil.randomRangeDoubleInclusive(t.getMinimumBonusEnchantments(),
t.getMaximumBonusEnchantments());
MythicEnchantment[] array = t.getBonusEnchantments().toArray(new MythicEnchantment[t.getBonusEnchantments()
.size()]);
while (added < range && attempts < 10) {
MythicEnchantment chosenEnch = array[RandomUtils.nextInt(array.length)];
if (chosenEnch == null || chosenEnch.getEnchantment() == null) {
attempts++;
continue;
}
Enchantment e = chosenEnch.getEnchantment();
int randLevel = (int) RandomRangeUtil.randomRangeLongInclusive(chosenEnch.getMinimumLevel(),
chosenEnch.getMaximumLevel());
if (is.containsEnchantment(e)) {
randLevel += is.getEnchantmentLevel(e);
}
if (t.isSafeBonusEnchantments() && e.canEnchantItem(is)) {
if (t.isAllowHighBonusEnchantments()) {
map.put(e, randLevel);
} else {
map.put(e, getAcceptableEnchantmentLevel(e, randLevel));
}
} else if (!t.isSafeBonusEnchantments()) {
if (t.isAllowHighBonusEnchantments()) {
map.put(e, randLevel);
} else {
map.put(e, getAcceptableEnchantmentLevel(e, randLevel));
}
} else {
continue;
}
added++;
}
return map;
}
private Map<Enchantment, Integer> getBaseEnchantments(MythicItemStack is, Tier t) {
Validate.notNull(is, "MythicItemStack cannot be null");
Validate.notNull(t, "Tier cannot be null");
if (t.getBaseEnchantments().isEmpty()) {
return new HashMap<>();
}
Map<Enchantment, Integer> map = new HashMap<>();
for (MythicEnchantment me : t.getBaseEnchantments()) {
if (me == null || me.getEnchantment() == null) {
continue;
}
Enchantment e = me.getEnchantment();
int minimumLevel = Math.max(me.getMinimumLevel(), e.getStartLevel());
int maximumLevel = Math.min(me.getMaximumLevel(), e.getMaxLevel());
if (t.isSafeBaseEnchantments() && e.canEnchantItem(is)) {
if (t.isAllowHighBaseEnchantments()) {
map.put(e, (int) RandomRangeUtil.randomRangeLongInclusive
(minimumLevel, maximumLevel));
} else {
map.put(e, getAcceptableEnchantmentLevel(e,
(int) RandomRangeUtil.randomRangeLongInclusive(minimumLevel, maximumLevel)));
}
} else if (!t.isSafeBaseEnchantments()) {
map.put(e, (int) RandomRangeUtil.randomRangeLongInclusive
(minimumLevel, maximumLevel));
}
}
return map;
}
private int getAcceptableEnchantmentLevel(Enchantment ench, int level) {
EnchantmentWrapper ew = new EnchantmentWrapper(ench.getId());
return Math.max(Math.min(level, ew.getMaxLevel()), ew.getStartLevel());
}
private List<String> generateLore(ItemStack itemStack) {
List<String> lore = new ArrayList<String>();
if (itemStack == null || tier == null) {
return lore;
}
List<String> tooltipFormat = MythicDropsPlugin.getInstance().getConfigSettings().getTooltipFormat();
String minecraftName = getMinecraftMaterialName(itemStack.getData().getItemType());
String mythicName = getMythicMaterialName(itemStack.getData());
String itemType = getItemTypeName(ItemUtil.getItemTypeFromMaterialData(itemStack.getData()));
String materialType = getItemTypeName(ItemUtil.getMaterialTypeFromMaterialData(itemStack.getData()));
String tierName = tier.getDisplayName();
String enchantment = getEnchantmentTypeName(itemStack);
if (MythicDropsPlugin.getInstance().getConfigSettings().isRandomLoreEnabled() && RandomUtils.nextDouble() <
MythicDropsPlugin.getInstance().getConfigSettings().getRandomLoreChance()) {
String generalLoreString = NameMap.getInstance().getRandom(NameType.GENERAL_LORE, "");
String materialLoreString = NameMap.getInstance().getRandom(NameType.MATERIAL_LORE,
itemStack.getType().name());
String tierLoreString = NameMap.getInstance().getRandom(NameType.TIER_LORE, tier.getName());
String enchantmentLoreString = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_LORE,
enchantment != null ? enchantment : "");
List<String> generalLore = null;
if (generalLoreString != null && !generalLoreString.isEmpty()) {
generalLore = Arrays.asList(generalLoreString.replace('&',
'\u00A7').replace("\u00A7\u00A7", "&").split("\n"));
}
List<String> materialLore = null;
if (materialLoreString != null && !materialLoreString.isEmpty()) {
materialLore = Arrays.asList(materialLoreString.replace('&', '\u00A7').replace("\u00A7\u00A7",
"&").split("\n"));
}
List<String> tierLore = null;
if (tierLoreString != null && !tierLoreString.isEmpty()) {
tierLore = Arrays.asList(tierLoreString.replace('&', '\u00A7').replace("\u00A7\u00A7",
"&").split("\n"));
}
List<String> enchantmentLore = null;
if (enchantmentLoreString != null && !enchantmentLoreString.isEmpty()) {
enchantmentLore = Arrays.asList(enchantmentLoreString.replace('&',
'\u00A7').replace("\u00A7\u00A7", "&").split("\n"));
}
if (generalLore != null && !generalLore.isEmpty()) {
lore.addAll(generalLore);
}
if (materialLore != null && !materialLore.isEmpty()) {
lore.addAll(materialLore);
}
if (tierLore != null && !tierLore.isEmpty()) {
lore.addAll(tierLore);
}
if (enchantmentLore != null && !enchantmentLore.isEmpty()) {
lore.addAll(enchantmentLore);
}
}
for (String s : tooltipFormat) {
String line = s;
line = line.replace("%basematerial%", minecraftName != null ? minecraftName : "");
line = line.replace("%mythicmaterial%", mythicName != null ? mythicName : "");
line = line.replace("%itemtype%", itemType != null ? itemType : "");
line = line.replace("%materialtype%", materialType != null ? materialType : "");
line = line.replace("%tiername%", tierName != null ? tierName : "");
line = line.replace("%enchantment%", enchantment != null ? enchantment : "");
line = line.replace('&', '\u00A7').replace("\u00A7\u00A7", "&");
lore.add(line);
}
for (String s : tier.getBaseLore()) {
String[] strings = s.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").split("\n");
lore.addAll(Arrays.asList(strings));
}
int numOfBonusLore = (int) RandomRangeUtil.randomRangeLongInclusive(tier.getMinimumBonusLore(),
tier.getMaximumBonusLore());
List<String> chosenLore = new ArrayList<>();
for (int i = 0; i < numOfBonusLore; i++) {
if (tier.getBonusLore() == null || tier.getBonusLore().isEmpty() || chosenLore.size() == tier
.getBonusLore().size()) {
continue;
}
// choose a random String out of the tier's bonus lore
String s = tier.getBonusLore().get(RandomUtils.nextInt(tier.getBonusLore().size()));
if (chosenLore.contains(s)) {
i--;
continue;
}
chosenLore.add(s);
// split on the next line \n
String[] strings = s.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").split("\n");
// add to lore by wrapping in Arrays.asList(Object...)
lore.addAll(Arrays.asList(strings));
}
if (MythicDropsPlugin.getInstance().getSockettingSettings().isEnabled() && RandomUtils.nextDouble() < tier
.getChanceToHaveSockets()) {
int numberOfSockets = (int) RandomRangeUtil.randomRangeLongInclusive(tier.getMinimumSockets(),
tier.getMaximumSockets());
for (int i = 0; i < numberOfSockets; i++) {
lore.add(MythicDropsPlugin.getInstance().getSockettingSettings().getSockettedItemString().replace
('&', '\u00A7').replace("\u00A7\u00A7", "&"));
}
if (numberOfSockets > 0) {
lore.addAll(MythicDropsPlugin.getInstance().getSockettingSettings().getSockettedItemLore());
}
}
return lore;
}
private String getEnchantmentTypeName(ItemStack itemStack) {
Enchantment enchantment = ItemStackUtil.getHighestEnchantment(itemStack);
if (enchantment == null) {
return MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString("displayNames" +
".Ordinary");
}
String ench = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString("displayNames."
+ enchantment.getName());
if (ench != null) {
return ench;
}
return "Ordinary";
}
private String getMythicMaterialName(MaterialData matData) {
String comb =
String.format("%s;%s", String.valueOf(matData.getItemTypeId()), String.valueOf(matData.getData()));
String comb2;
if (matData.getData() == (byte) 0) {
comb2 = String.valueOf(matData.getItemTypeId());
} else {
comb2 = comb;
}
String mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + comb.toLowerCase());
if (mythicMatName == null || mythicMatName.equals("displayNames." + comb.toLowerCase())) {
mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + comb2.toLowerCase());
if (mythicMatName == null || mythicMatName.equals("displayNames." + comb2.toLowerCase())) {
mythicMatName = getMinecraftMaterialName(matData.getItemType());
}
}
return WordUtils.capitalize(mythicMatName);
}
private String getMinecraftMaterialName(Material material) {
String prettyMaterialName = "";
String matName = material.name();
String[] split = matName.split("_");
for (String s : split) {
if (s.equals(split[split.length - 1])) {
prettyMaterialName = String
.format("%s%s%s", prettyMaterialName, s.substring(0, 1).toUpperCase(), s.substring(1,
s.length()).toLowerCase());
} else {
prettyMaterialName = prettyMaterialName
+ (String.format("%s%s", s.substring(0, 1).toUpperCase(), s.substring(1,
s.length()).toLowerCase())) + " ";
}
}
return WordUtils.capitalizeFully(prettyMaterialName);
}
private String getItemTypeName(String itemType) {
if (itemType == null) {
return null;
}
String mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + itemType.toLowerCase());
if (mythicMatName == null) {
mythicMatName = itemType;
}
return WordUtils.capitalizeFully(mythicMatName);
}
private String getItemTypeFromMaterialData(MaterialData matData) {
String comb =
String.format("%s;%s", String.valueOf(matData.getItemTypeId()), String.valueOf(matData.getData()));
String comb2;
if (matData.getData() == (byte) 0) {
comb2 = String.valueOf(matData.getItemTypeId());
} else {
comb2 = comb;
}
String comb3 = String.valueOf(matData.getItemTypeId());
Map<String, List<String>> ids = new HashMap<String, List<String>>();
ids.putAll(MythicDropsPlugin.getInstance().getConfigSettings().getItemTypesWithIds());
for (Map.Entry<String, List<String>> e : ids.entrySet()) {
if (e.getValue().contains(comb)
|| e.getValue().contains(comb2) || e.getValue().contains(comb3)) {
if (MythicDropsPlugin.getInstance().getConfigSettings().getMaterialTypes().contains(e.getKey())) {
continue;
}
return e.getKey();
}
}
return null;
}
private String generateName(ItemStack itemStack) {
Validate.notNull(itemStack, "ItemStack cannot be null");
Validate.notNull(tier, "Tier cannot be null");
String format = MythicDropsPlugin.getInstance().getConfigSettings().getItemDisplayNameFormat();
if (format == null) {
return "Mythic Item";
}
String minecraftName = getMinecraftMaterialName(itemStack.getData().getItemType());
String mythicName = getMythicMaterialName(itemStack.getData());
String generalPrefix = NameMap.getInstance().getRandom(NameType.GENERAL_PREFIX, "");
String generalSuffix = NameMap.getInstance().getRandom(NameType.GENERAL_SUFFIX, "");
String materialPrefix = NameMap.getInstance().getRandom(NameType.MATERIAL_PREFIX, itemStack.getType().name());
String materialSuffix = NameMap.getInstance().getRandom(NameType.MATERIAL_SUFFIX, itemStack.getType().name());
String tierPrefix = NameMap.getInstance().getRandom(NameType.TIER_PREFIX, tier.getName());
String tierSuffix = NameMap.getInstance().getRandom(NameType.TIER_SUFFIX, tier.getName());
String itemType = ItemUtil.getItemTypeFromMaterialData(itemStack.getData());
String materialType = ItemUtil.getMaterialTypeFromMaterialData(itemStack.getData());
String tierName = tier.getDisplayName();
String enchantment = getEnchantmentTypeName(itemStack);
Enchantment highestEnch = ItemStackUtil.getHighestEnchantment(itemStack.getItemMeta());
String enchantmentPrefix = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_PREFIX,
highestEnch != null ? highestEnch.getName() : "");
String enchantmentSuffix = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_SUFFIX,
highestEnch != null ? highestEnch.getName() : "");
String name = format;
if (name.contains("%basematerial%")) {
name = name.replace("%basematerial%", minecraftName);
}
if (name.contains("%mythicmaterial%")) {
name = name.replace("%mythicmaterial%", mythicName);
}
if (name.contains("%generalprefix%")) {
name = name.replace("%generalprefix%", generalPrefix);
}
if (name.contains("%generalsuffix%")) {
name = name.replace("%generalsuffix%", generalSuffix);
}
if (name.contains("%materialprefix%")) {
name = name.replace("%materialprefix%", materialPrefix);
}
if (name.contains("%materialsuffix%")) {
name = name.replace("%materialsuffix%", materialSuffix);
}
if (name.contains("%tierprefix%")) {
name = name.replace("%tierprefix%", tierPrefix);
}
if (name.contains("%tiersuffix%")) {
name = name.replace("%tiersuffix%", tierSuffix);
}
if (name.contains("%itemtype%")) {
name = name.replace("%itemtype%", itemType);
}
if (name.contains("%materialtype%")) {
name = name.replace("%materialtype%", materialType);
}
if (name.contains("%tiername%")) {
name = name.replace("%tiername%", tierName);
}
if (name.contains("%enchantment%")) {
name = name.replace("%enchantment%", enchantment);
}
if (name.contains("%enchantmentprefix%")) {
name = name.replace("%enchantmentprefix%", enchantmentPrefix);
}
if (name.contains("%enchantmentsuffix%")) {
name = name.replace("%enchantmentsuffix%", enchantmentSuffix);
}
return tier.getDisplayColor() + name.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").trim() +
tier.getIdentificationColor();
}
}
| MythicDrops/src/main/java/net/nunnerycode/bukkit/mythicdrops/items/MythicDropBuilder.java | package net.nunnerycode.bukkit.mythicdrops.items;
import net.nunnerycode.bukkit.mythicdrops.MythicDropsPlugin;
import net.nunnerycode.bukkit.mythicdrops.api.enchantments.MythicEnchantment;
import net.nunnerycode.bukkit.mythicdrops.api.items.ItemGenerationReason;
import net.nunnerycode.bukkit.mythicdrops.api.items.MythicItemStack;
import net.nunnerycode.bukkit.mythicdrops.api.items.NonrepairableItemStack;
import net.nunnerycode.bukkit.mythicdrops.api.items.builders.DropBuilder;
import net.nunnerycode.bukkit.mythicdrops.api.names.NameType;
import net.nunnerycode.bukkit.mythicdrops.api.tiers.Tier;
import net.nunnerycode.bukkit.mythicdrops.events.RandomItemGenerationEvent;
import net.nunnerycode.bukkit.mythicdrops.names.NameMap;
import net.nunnerycode.bukkit.mythicdrops.tiers.TierMap;
import net.nunnerycode.bukkit.mythicdrops.utils.ItemStackUtil;
import net.nunnerycode.bukkit.mythicdrops.utils.ItemUtil;
import net.nunnerycode.bukkit.mythicdrops.utils.RandomRangeUtil;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang3.text.WordUtils;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentWrapper;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.material.MaterialData;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class MythicDropBuilder implements DropBuilder {
private Tier tier;
private MaterialData materialData;
private ItemGenerationReason itemGenerationReason;
private World world;
private boolean useDurability;
private boolean callEvent;
public MythicDropBuilder() {
tier = null;
itemGenerationReason = ItemGenerationReason.DEFAULT;
world = Bukkit.getServer().getWorlds().get(0);
useDurability = false;
callEvent = true;
}
public DropBuilder withCallEvent(boolean b) {
this.callEvent = b;
return this;
}
@Override
public DropBuilder withTier(Tier tier) {
this.tier = tier;
return this;
}
@Override
public DropBuilder withTier(String tierName) {
this.tier = TierMap.getInstance().get(tierName);
return this;
}
@Override
public DropBuilder withMaterialData(MaterialData materialData) {
this.materialData = materialData;
return this;
}
@Override
public DropBuilder withMaterialData(String materialDataString) {
MaterialData matData = null;
if (materialDataString.contains(";")) {
String[] split = materialDataString.split(";");
matData = new MaterialData(NumberUtils.toInt(split[0], 0), (byte) NumberUtils.toInt(split[1], 0));
} else {
matData = new MaterialData(NumberUtils.toInt(materialDataString, 0));
}
this.materialData = matData;
return this;
}
@Override
public DropBuilder withItemGenerationReason(ItemGenerationReason reason) {
this.itemGenerationReason = reason;
return this;
}
@Override
public DropBuilder inWorld(World world) {
this.world = world;
return this;
}
@Override
public DropBuilder inWorld(String worldName) {
this.world = Bukkit.getWorld(worldName);
return this;
}
@Override
public DropBuilder useDurability(boolean b) {
this.useDurability = b;
return this;
}
@Override
public MythicItemStack build() {
World w = world != null ? world : Bukkit.getWorlds().get(0);
Tier t = (tier != null) ? tier : TierMap.getInstance().getRandomWithChance(w.getName());
if (t == null) {
t = TierMap.getInstance().getRandomWithChance("default");
if (t == null) {
return null;
}
}
MaterialData md = (materialData != null) ? materialData : ItemUtil.getRandomMaterialDataFromCollection
(ItemUtil.getMaterialDatasFromTier(t));
NonrepairableItemStack nis = new NonrepairableItemStack(md.getItemType(), 1, (short) 0, "");
ItemMeta im = nis.getItemMeta();
Map<Enchantment, Integer> baseEnchantmentMap = getBaseEnchantments(nis, t);
Map<Enchantment, Integer> bonusEnchantmentMap = getBonusEnchantments(nis, t);
for (Map.Entry<Enchantment, Integer> baseEnch : baseEnchantmentMap.entrySet()) {
im.addEnchant(baseEnch.getKey(), baseEnch.getValue(), true);
}
for (Map.Entry<Enchantment, Integer> bonusEnch : bonusEnchantmentMap.entrySet()) {
im.addEnchant(bonusEnch.getKey(), bonusEnch.getValue(), true);
}
if (useDurability) {
nis.setDurability(ItemStackUtil.getDurabilityForMaterial(nis.getType(), t.getMinimumDurabilityPercentage
(), t.getMaximumDurabilityPercentage()));
}
String name = generateName(nis);
List<String> lore = generateLore(nis);
im.setDisplayName(name);
im.setLore(lore);
if (nis.getItemMeta() instanceof LeatherArmorMeta) {
((LeatherArmorMeta) im).setColor(Color.fromRGB(RandomUtils.nextInt(255),
RandomUtils.nextInt(255), RandomUtils.nextInt(255)));
}
nis.setItemMeta(im);
if (callEvent) {
RandomItemGenerationEvent rige = new RandomItemGenerationEvent(t, nis, itemGenerationReason);
Bukkit.getPluginManager().callEvent(rige);
if (rige.isCancelled()) {
return null;
}
return rige.getItemStack();
}
return nis;
}
private Map<Enchantment, Integer> getBonusEnchantments(MythicItemStack is, Tier t) {
Validate.notNull(is, "MythicItemStack cannot be null");
Validate.notNull(t, "Tier cannot be null");
if (t.getBonusEnchantments().isEmpty()) {
return new HashMap<>();
}
Map<Enchantment, Integer> map = new HashMap<>();
int added = 0;
int attempts = 0;
int range = (int) RandomRangeUtil.randomRangeDoubleInclusive(t.getMinimumBonusEnchantments(),
t.getMaximumBonusEnchantments());
MythicEnchantment[] array = t.getBonusEnchantments().toArray(new MythicEnchantment[t.getBonusEnchantments()
.size()]);
while (added < range && attempts < 10) {
MythicEnchantment chosenEnch = array[RandomUtils.nextInt(array.length)];
if (chosenEnch == null || chosenEnch.getEnchantment() == null) {
attempts++;
continue;
}
Enchantment e = chosenEnch.getEnchantment();
int randLevel = (int) RandomRangeUtil.randomRangeLongInclusive(chosenEnch.getMinimumLevel(),
chosenEnch.getMaximumLevel());
if (is.containsEnchantment(e)) {
randLevel += is.getEnchantmentLevel(e);
}
if (t.isSafeBonusEnchantments() && e.canEnchantItem(is)) {
if (t.isAllowHighBonusEnchantments()) {
map.put(e, randLevel);
} else {
map.put(e, getAcceptableEnchantmentLevel(e, randLevel));
}
} else if (!t.isSafeBonusEnchantments()) {
if (t.isAllowHighBonusEnchantments()) {
map.put(e, randLevel);
} else {
map.put(e, getAcceptableEnchantmentLevel(e, randLevel));
}
} else {
continue;
}
added++;
}
return map;
}
private Map<Enchantment, Integer> getBaseEnchantments(MythicItemStack is, Tier t) {
Validate.notNull(is, "MythicItemStack cannot be null");
Validate.notNull(t, "Tier cannot be null");
if (t.getBaseEnchantments().isEmpty()) {
return new HashMap<>();
}
Map<Enchantment, Integer> map = new HashMap<>();
for (MythicEnchantment me : t.getBaseEnchantments()) {
if (me == null || me.getEnchantment() == null) {
continue;
}
Enchantment e = me.getEnchantment();
int minimumLevel = Math.max(me.getMinimumLevel(), e.getStartLevel());
int maximumLevel = Math.min(me.getMaximumLevel(), e.getMaxLevel());
if (t.isSafeBaseEnchantments() && e.canEnchantItem(is)) {
if (t.isAllowHighBaseEnchantments()) {
map.put(e, (int) RandomRangeUtil.randomRangeLongInclusive
(minimumLevel, maximumLevel));
} else {
map.put(e, getAcceptableEnchantmentLevel(e,
(int) RandomRangeUtil.randomRangeLongInclusive(minimumLevel, maximumLevel)));
}
} else if (!t.isSafeBaseEnchantments()) {
map.put(e, (int) RandomRangeUtil.randomRangeLongInclusive
(minimumLevel, maximumLevel));
}
}
return map;
}
private int getAcceptableEnchantmentLevel(Enchantment ench, int level) {
EnchantmentWrapper ew = new EnchantmentWrapper(ench.getId());
return Math.max(Math.min(level, ew.getMaxLevel()), ew.getStartLevel());
}
private List<String> generateLore(ItemStack itemStack) {
List<String> lore = new ArrayList<String>();
if (itemStack == null || tier == null) {
return lore;
}
List<String> tooltipFormat = MythicDropsPlugin.getInstance().getConfigSettings().getTooltipFormat();
String minecraftName = getMinecraftMaterialName(itemStack.getData().getItemType());
String mythicName = getMythicMaterialName(itemStack.getData());
String itemType = getItemTypeName(ItemUtil.getItemTypeFromMaterialData(itemStack.getData()));
String materialType = getItemTypeName(ItemUtil.getMaterialTypeFromMaterialData(itemStack.getData()));
String tierName = tier.getDisplayName();
String enchantment = getEnchantmentTypeName(itemStack);
if (MythicDropsPlugin.getInstance().getConfigSettings().isRandomLoreEnabled() && RandomUtils.nextDouble() <
MythicDropsPlugin.getInstance().getConfigSettings().getRandomLoreChance()) {
String generalLoreString = NameMap.getInstance().getRandom(NameType.GENERAL_LORE, "");
String materialLoreString = NameMap.getInstance().getRandom(NameType.MATERIAL_LORE,
itemStack.getType().name());
String tierLoreString = NameMap.getInstance().getRandom(NameType.TIER_LORE, tier.getName());
String enchantmentLoreString = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_LORE,
enchantment != null ? enchantment : "");
List<String> generalLore = null;
if (generalLoreString != null && !generalLoreString.isEmpty()) {
generalLore = Arrays.asList(generalLoreString.replace('&',
'\u00A7').replace("\u00A7\u00A7", "&").split("\n"));
}
List<String> materialLore = null;
if (materialLoreString != null && !materialLoreString.isEmpty()) {
materialLore = Arrays.asList(materialLoreString.replace('&', '\u00A7').replace("\u00A7\u00A7",
"&").split("\n"));
}
List<String> tierLore = null;
if (tierLoreString != null && !tierLoreString.isEmpty()) {
tierLore = Arrays.asList(tierLoreString.replace('&', '\u00A7').replace("\u00A7\u00A7",
"&").split("\n"));
}
List<String> enchantmentLore = null;
if (enchantmentLoreString != null && !enchantmentLoreString.isEmpty()) {
enchantmentLore = Arrays.asList(enchantmentLoreString.replace('&',
'\u00A7').replace("\u00A7\u00A7", "&").split("\n"));
}
if (generalLore != null && !generalLore.isEmpty()) {
lore.addAll(generalLore);
}
if (materialLore != null && !materialLore.isEmpty()) {
lore.addAll(materialLore);
}
if (tierLore != null && !tierLore.isEmpty()) {
lore.addAll(tierLore);
}
if (enchantmentLore != null && !enchantmentLore.isEmpty()) {
lore.addAll(enchantmentLore);
}
}
for (String s : tooltipFormat) {
String line = s;
line = line.replace("%basematerial%", minecraftName != null ? minecraftName : "");
line = line.replace("%mythicmaterial%", mythicName != null ? mythicName : "");
line = line.replace("%itemtype%", itemType != null ? itemType : "");
line = line.replace("%materialtype%", materialType != null ? materialType : "");
line = line.replace("%tiername%", tierName != null ? tierName : "");
line = line.replace("%enchantment%", enchantment != null ? enchantment : "");
line = line.replace('&', '\u00A7').replace("\u00A7\u00A7", "&");
lore.add(line);
}
for (String s : tier.getBaseLore()) {
String[] strings = s.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").split("\n");
lore.addAll(Arrays.asList(strings));
}
int numOfBonusLore = (int) RandomRangeUtil.randomRangeLongInclusive(tier.getMinimumBonusLore(),
tier.getMaximumBonusLore());
List<String> chosenLore = new ArrayList<>();
for (int i = 0; i < numOfBonusLore; i++) {
if (tier.getBonusLore() == null || tier.getBonusLore().isEmpty() || chosenLore.size() == tier
.getBonusLore().size()) {
continue;
}
// choose a random String out of the tier's bonus lore
String s = tier.getBonusLore().get(RandomUtils.nextInt(tier.getBonusLore().size()));
if (chosenLore.contains(s)) {
i--;
continue;
}
chosenLore.add(s);
// split on the next line \n
String[] strings = s.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").split("\n");
// add to lore by wrapping in Arrays.asList(Object...)
lore.addAll(Arrays.asList(strings));
}
if (MythicDropsPlugin.getInstance().getSockettingSettings().isEnabled() && RandomUtils.nextDouble() < tier
.getChanceToHaveSockets()) {
int numberOfSockets = (int) RandomRangeUtil.randomRangeLongInclusive(tier.getMinimumSockets(),
tier.getMaximumSockets());
for (int i = 0; i < numberOfSockets; i++) {
lore.add(MythicDropsPlugin.getInstance().getSockettingSettings().getSockettedItemString().replace
('&', '\u00A7').replace("\u00A7\u00A7", "&"));
}
}
return lore;
}
private String getEnchantmentTypeName(ItemStack itemStack) {
Enchantment enchantment = ItemStackUtil.getHighestEnchantment(itemStack);
if (enchantment == null) {
return MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString("displayNames" +
".Ordinary");
}
String ench = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString("displayNames."
+ enchantment.getName());
if (ench != null) {
return ench;
}
return "Ordinary";
}
private String getMythicMaterialName(MaterialData matData) {
String comb =
String.format("%s;%s", String.valueOf(matData.getItemTypeId()), String.valueOf(matData.getData()));
String comb2;
if (matData.getData() == (byte) 0) {
comb2 = String.valueOf(matData.getItemTypeId());
} else {
comb2 = comb;
}
String mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + comb.toLowerCase());
if (mythicMatName == null || mythicMatName.equals("displayNames." + comb.toLowerCase())) {
mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + comb2.toLowerCase());
if (mythicMatName == null || mythicMatName.equals("displayNames." + comb2.toLowerCase())) {
mythicMatName = getMinecraftMaterialName(matData.getItemType());
}
}
return WordUtils.capitalize(mythicMatName);
}
private String getMinecraftMaterialName(Material material) {
String prettyMaterialName = "";
String matName = material.name();
String[] split = matName.split("_");
for (String s : split) {
if (s.equals(split[split.length - 1])) {
prettyMaterialName = String
.format("%s%s%s", prettyMaterialName, s.substring(0, 1).toUpperCase(), s.substring(1,
s.length()).toLowerCase());
} else {
prettyMaterialName = prettyMaterialName
+ (String.format("%s%s", s.substring(0, 1).toUpperCase(), s.substring(1,
s.length()).toLowerCase())) + " ";
}
}
return WordUtils.capitalizeFully(prettyMaterialName);
}
private String getItemTypeName(String itemType) {
if (itemType == null) {
return null;
}
String mythicMatName = MythicDropsPlugin.getInstance().getConfigSettings().getFormattedLanguageString(
"displayNames." + itemType.toLowerCase());
if (mythicMatName == null) {
mythicMatName = itemType;
}
return WordUtils.capitalizeFully(mythicMatName);
}
private String getItemTypeFromMaterialData(MaterialData matData) {
String comb =
String.format("%s;%s", String.valueOf(matData.getItemTypeId()), String.valueOf(matData.getData()));
String comb2;
if (matData.getData() == (byte) 0) {
comb2 = String.valueOf(matData.getItemTypeId());
} else {
comb2 = comb;
}
String comb3 = String.valueOf(matData.getItemTypeId());
Map<String, List<String>> ids = new HashMap<String, List<String>>();
ids.putAll(MythicDropsPlugin.getInstance().getConfigSettings().getItemTypesWithIds());
for (Map.Entry<String, List<String>> e : ids.entrySet()) {
if (e.getValue().contains(comb)
|| e.getValue().contains(comb2) || e.getValue().contains(comb3)) {
if (MythicDropsPlugin.getInstance().getConfigSettings().getMaterialTypes().contains(e.getKey())) {
continue;
}
return e.getKey();
}
}
return null;
}
private String generateName(ItemStack itemStack) {
Validate.notNull(itemStack, "ItemStack cannot be null");
Validate.notNull(tier, "Tier cannot be null");
String format = MythicDropsPlugin.getInstance().getConfigSettings().getItemDisplayNameFormat();
if (format == null) {
return "Mythic Item";
}
String minecraftName = getMinecraftMaterialName(itemStack.getData().getItemType());
String mythicName = getMythicMaterialName(itemStack.getData());
String generalPrefix = NameMap.getInstance().getRandom(NameType.GENERAL_PREFIX, "");
String generalSuffix = NameMap.getInstance().getRandom(NameType.GENERAL_SUFFIX, "");
String materialPrefix = NameMap.getInstance().getRandom(NameType.MATERIAL_PREFIX, itemStack.getType().name());
String materialSuffix = NameMap.getInstance().getRandom(NameType.MATERIAL_SUFFIX, itemStack.getType().name());
String tierPrefix = NameMap.getInstance().getRandom(NameType.TIER_PREFIX, tier.getName());
String tierSuffix = NameMap.getInstance().getRandom(NameType.TIER_SUFFIX, tier.getName());
String itemType = ItemUtil.getItemTypeFromMaterialData(itemStack.getData());
String materialType = ItemUtil.getMaterialTypeFromMaterialData(itemStack.getData());
String tierName = tier.getDisplayName();
String enchantment = getEnchantmentTypeName(itemStack);
Enchantment highestEnch = ItemStackUtil.getHighestEnchantment(itemStack.getItemMeta());
String enchantmentPrefix = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_PREFIX,
highestEnch != null ? highestEnch.getName() : "");
String enchantmentSuffix = NameMap.getInstance().getRandom(NameType.ENCHANTMENT_SUFFIX,
highestEnch != null ? highestEnch.getName() : "");
String name = format;
if (name.contains("%basematerial%")) {
name = name.replace("%basematerial%", minecraftName);
}
if (name.contains("%mythicmaterial%")) {
name = name.replace("%mythicmaterial%", mythicName);
}
if (name.contains("%generalprefix%")) {
name = name.replace("%generalprefix%", generalPrefix);
}
if (name.contains("%generalsuffix%")) {
name = name.replace("%generalsuffix%", generalSuffix);
}
if (name.contains("%materialprefix%")) {
name = name.replace("%materialprefix%", materialPrefix);
}
if (name.contains("%materialsuffix%")) {
name = name.replace("%materialsuffix%", materialSuffix);
}
if (name.contains("%tierprefix%")) {
name = name.replace("%tierprefix%", tierPrefix);
}
if (name.contains("%tiersuffix%")) {
name = name.replace("%tiersuffix%", tierSuffix);
}
if (name.contains("%itemtype%")) {
name = name.replace("%itemtype%", itemType);
}
if (name.contains("%materialtype%")) {
name = name.replace("%materialtype%", materialType);
}
if (name.contains("%tiername%")) {
name = name.replace("%tiername%", tierName);
}
if (name.contains("%enchantment%")) {
name = name.replace("%enchantment%", enchantment);
}
if (name.contains("%enchantmentprefix%")) {
name = name.replace("%enchantmentprefix%", enchantmentPrefix);
}
if (name.contains("%enchantmentsuffix%")) {
name = name.replace("%enchantmentsuffix%", enchantmentSuffix);
}
return tier.getDisplayColor() + name.replace('&', '\u00A7').replace("\u00A7\u00A7", "&").trim() +
tier.getIdentificationColor();
}
}
| adding socketted item lore
| MythicDrops/src/main/java/net/nunnerycode/bukkit/mythicdrops/items/MythicDropBuilder.java | adding socketted item lore | <ide><path>ythicDrops/src/main/java/net/nunnerycode/bukkit/mythicdrops/items/MythicDropBuilder.java
<ide> lore.add(MythicDropsPlugin.getInstance().getSockettingSettings().getSockettedItemString().replace
<ide> ('&', '\u00A7').replace("\u00A7\u00A7", "&"));
<ide> }
<add> if (numberOfSockets > 0) {
<add> lore.addAll(MythicDropsPlugin.getInstance().getSockettingSettings().getSockettedItemLore());
<add> }
<ide> }
<ide>
<ide> return lore; |
|
Java | apache-2.0 | 04bb9a7295122d38dc27a1de3bd98f6bca8bd3f1 | 0 | nssales/OG-Platform,DevStreet/FinanceAnalytics,McLeodMoores/starling,nssales/OG-Platform,codeaudit/OG-Platform,jeorme/OG-Platform,ChinaQuants/OG-Platform,ChinaQuants/OG-Platform,McLeodMoores/starling,jerome79/OG-Platform,ChinaQuants/OG-Platform,ChinaQuants/OG-Platform,DevStreet/FinanceAnalytics,codeaudit/OG-Platform,McLeodMoores/starling,jerome79/OG-Platform,codeaudit/OG-Platform,McLeodMoores/starling,jeorme/OG-Platform,nssales/OG-Platform,jerome79/OG-Platform,jeorme/OG-Platform,nssales/OG-Platform,jeorme/OG-Platform,jerome79/OG-Platform,DevStreet/FinanceAnalytics,DevStreet/FinanceAnalytics,codeaudit/OG-Platform | /**
* Copyright (C) 2009 - 2010 by OpenGamma Inc.
*
* Please see distribution for license.
*/
package com.opengamma.engine.view.cache;
import java.io.File;
import org.fudgemsg.FudgeContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.EnvironmentLockedException;
/**
* An implementation of {@link ViewComputationCacheSource} which will use an injected
* {@link IdentifierMap} and construct {@link BerkeleyDBValueSpecificationBinaryDataStore}
* instances on demand to satisfy cache requests.
*/
public class BerkeleyDBViewComputationCacheSource extends DefaultViewComputationCacheSource {
private static final Logger s_logger = LoggerFactory.getLogger(BerkeleyDBViewComputationCacheSource.class);
private static Environment constructDatabaseEnvironmentImpl(final File dbDir, final boolean transactional) {
if (!dbDir.exists()) {
dbDir.mkdirs();
}
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(transactional);
return new Environment(dbDir, envConfig);
}
private static void deleteFile(final File file) {
if (file.isDirectory()) {
for (File subfile : file.listFiles()) {
deleteFile(subfile);
}
}
file.delete();
}
public static Environment constructDatabaseEnvironment(File dbDir, boolean transactional) {
try {
return constructDatabaseEnvironmentImpl(dbDir, transactional);
} catch (EnvironmentLockedException e) {
s_logger.warn("Error locking DB environment, deleting {} and trying again", dbDir);
deleteFile(dbDir);
return constructDatabaseEnvironmentImpl(dbDir, transactional);
}
}
public BerkeleyDBViewComputationCacheSource(IdentifierMap identifierMap, Environment dbEnvironment, FudgeContext fudgeContext) {
super(identifierMap, fudgeContext, new BerkeleyDBBinaryDataStoreFactory(dbEnvironment));
}
}
| src/com/opengamma/engine/view/cache/BerkeleyDBViewComputationCacheSource.java | /**
* Copyright (C) 2009 - 2010 by OpenGamma Inc.
*
* Please see distribution for license.
*/
package com.opengamma.engine.view.cache;
import java.io.File;
import org.fudgemsg.FudgeContext;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
/**
* An implementation of {@link ViewComputationCacheSource} which will use an injected
* {@link IdentifierMap} and construct {@link BerkeleyDBValueSpecificationBinaryDataStore}
* instances on demand to satisfy cache requests.
*/
public class BerkeleyDBViewComputationCacheSource extends DefaultViewComputationCacheSource {
public static Environment constructDatabaseEnvironment(File dbDir, boolean transactional) {
if (!dbDir.exists()) {
dbDir.mkdirs();
}
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(transactional);
Environment dbEnvironment = new Environment(dbDir, envConfig);
return dbEnvironment;
}
public BerkeleyDBViewComputationCacheSource(IdentifierMap identifierMap, Environment dbEnvironment, FudgeContext fudgeContext) {
super(identifierMap, fudgeContext, new BerkeleyDBBinaryDataStoreFactory(dbEnvironment));
}
}
| [ENG-203] Delete the BDB data area if there's a problem preventing the engine from starting
| src/com/opengamma/engine/view/cache/BerkeleyDBViewComputationCacheSource.java | [ENG-203] Delete the BDB data area if there's a problem preventing the engine from starting | <ide><path>rc/com/opengamma/engine/view/cache/BerkeleyDBViewComputationCacheSource.java
<ide> import java.io.File;
<ide>
<ide> import org.fudgemsg.FudgeContext;
<add>import org.slf4j.Logger;
<add>import org.slf4j.LoggerFactory;
<ide>
<ide> import com.sleepycat.je.Environment;
<ide> import com.sleepycat.je.EnvironmentConfig;
<add>import com.sleepycat.je.EnvironmentLockedException;
<ide>
<ide> /**
<ide> * An implementation of {@link ViewComputationCacheSource} which will use an injected
<ide> */
<ide> public class BerkeleyDBViewComputationCacheSource extends DefaultViewComputationCacheSource {
<ide>
<del> public static Environment constructDatabaseEnvironment(File dbDir, boolean transactional) {
<add> private static final Logger s_logger = LoggerFactory.getLogger(BerkeleyDBViewComputationCacheSource.class);
<add>
<add> private static Environment constructDatabaseEnvironmentImpl(final File dbDir, final boolean transactional) {
<ide> if (!dbDir.exists()) {
<ide> dbDir.mkdirs();
<ide> }
<ide> EnvironmentConfig envConfig = new EnvironmentConfig();
<ide> envConfig.setAllowCreate(true);
<ide> envConfig.setTransactional(transactional);
<del> Environment dbEnvironment = new Environment(dbDir, envConfig);
<del> return dbEnvironment;
<add> return new Environment(dbDir, envConfig);
<add> }
<add>
<add> private static void deleteFile(final File file) {
<add> if (file.isDirectory()) {
<add> for (File subfile : file.listFiles()) {
<add> deleteFile(subfile);
<add> }
<add> }
<add> file.delete();
<add> }
<add>
<add> public static Environment constructDatabaseEnvironment(File dbDir, boolean transactional) {
<add> try {
<add> return constructDatabaseEnvironmentImpl(dbDir, transactional);
<add> } catch (EnvironmentLockedException e) {
<add> s_logger.warn("Error locking DB environment, deleting {} and trying again", dbDir);
<add> deleteFile(dbDir);
<add> return constructDatabaseEnvironmentImpl(dbDir, transactional);
<add> }
<ide> }
<ide>
<ide> public BerkeleyDBViewComputationCacheSource(IdentifierMap identifierMap, Environment dbEnvironment, FudgeContext fudgeContext) { |
|
Java | mit | a72f238bafb0b1625311cc9213630da9944e3000 | 0 | gardncl/elements-of-programming-interviews | package linkedlists;
import datastructures.ListNode;
import org.junit.jupiter.api.Test;
import static linkedlists.LinkedListUtil.assertSameList;
import static linkedlists.LinkedListUtil.createLinkedList;
import static linkedlists.ListPivot.pivot;
class ListPivotTest {
private ListNode<Integer> expected;
private ListNode<Integer> input;
private int k;
@Test
void pivot1() {
expected = createLinkedList(1);
input = createLinkedList(1);
k = 0;
test(expected, input, k);
}
@Test
void pivot2() {
expected = createLinkedList(1, 1, 1, 3, 3, 3, 2, 2, 2);
input = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
k = 1;
test(expected, input, k);
}
@Test
void pivot3() {
expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
input = createLinkedList(1, 1, 1, 2, 2, 2, 3, 3, 3);
k = 2;
test(expected, input, k);
}
@Test
void pivot4() {
expected = createLinkedList(3, 2, 2, 5, 7, 11, 11);
input = createLinkedList(3, 2, 2, 11, 7, 5, 11);
k = 7;
test(expected, input, k);
}
private void test(ListNode<Integer> expected, ListNode<Integer> input, int k) {
assertSameList(expected, pivot(input, k));
}
} | test/linkedlists/ListPivotTest.java | package linkedlists;
import datastructures.ListNode;
import org.junit.jupiter.api.Test;
import static linkedlists.LinkedListUtil.assertSameList;
import static linkedlists.LinkedListUtil.createLinkedList;
import static linkedlists.ListPivot.pivot;
class ListPivotTest {
private ListNode<Integer> expected;
private ListNode<Integer> input;
private int k;
@Test
void pivot1() {
expected = createLinkedList(1);
input = createLinkedList(1);
k = 0;
test(expected, input, k);
}
@Test
void pivot2() {
expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
input = createLinkedList(2, 2, 3, 3, 3, 2, 1, 1, 1);
k = 4;
test(expected, input, k);
}
@Test
void pivot3() {
expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
input = createLinkedList(1, 1, 1, 2, 2, 2, 3, 3, 3);
k = 8;
test(expected, input, k);
}
@Test
void pivot4() {
expected = createLinkedList(3, 2, 2, 5, 7, 11, 11);
input = createLinkedList(3, 2, 2, 11, 7, 5, 11);
k = 7;
test(expected, input, k);
}
private void test(ListNode<Integer> expected, ListNode<Integer> input, int k) {
assertSameList(expected, pivot(input, k));
}
} | Fixed the test for pivot. Had interpreted as if was the dutch national flag problem--it is not
| test/linkedlists/ListPivotTest.java | Fixed the test for pivot. Had interpreted as if was the dutch national flag problem--it is not | <ide><path>est/linkedlists/ListPivotTest.java
<ide>
<ide> @Test
<ide> void pivot2() {
<del> expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
<del> input = createLinkedList(2, 2, 3, 3, 3, 2, 1, 1, 1);
<del> k = 4;
<add> expected = createLinkedList(1, 1, 1, 3, 3, 3, 2, 2, 2);
<add> input = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
<add> k = 1;
<ide>
<ide> test(expected, input, k);
<ide> }
<ide> void pivot3() {
<ide> expected = createLinkedList(3, 3, 3, 2, 2, 2, 1, 1, 1);
<ide> input = createLinkedList(1, 1, 1, 2, 2, 2, 3, 3, 3);
<del> k = 8;
<add> k = 2;
<ide>
<ide> test(expected, input, k);
<ide> } |
|
Java | apache-2.0 | 0c68591db4203b4d2840f6e31f7cb7407d8c29c4 | 0 | apache/felix-dev,apache/felix-dev,apache/felix-dev,apache/felix-dev | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.felix.webconsole.internal.obr;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeSet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
import org.apache.felix.webconsole.internal.Util;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.osgi.service.obr.Repository;
import org.osgi.service.obr.RepositoryAdmin;
import org.osgi.service.obr.Resource;
public class BundleRepositoryRender extends BaseWebConsolePlugin
{
public static final String LABEL = "bundlerepo";
public static final String TITLE = "OSGi Repository";
public static final String PARAM_REPO_ID = "repositoryId";
public static final String PARAM_REPO_URL = "repositoryURL";
private static final String REPOSITORY_PROPERTY = "obr.repository.url";
private static final String ALL_CATEGORIES_OPTION = "*";
private static final String NO_CATEGORIES_OPTION = "---";
private static final String PAR_CATEGORIES = "category";
private String[] repoURLs;
public void activate( BundleContext bundleContext )
{
super.activate( bundleContext );
String urlStr = bundleContext.getProperty( REPOSITORY_PROPERTY );
List urlList = new ArrayList();
if ( urlStr != null )
{
StringTokenizer st = new StringTokenizer( urlStr );
while ( st.hasMoreTokens() )
{
urlList.add( st.nextToken() );
}
}
this.repoURLs = ( String[] ) urlList.toArray( new String[urlList.size()] );
}
public String getLabel()
{
return LABEL;
}
public String getTitle()
{
return TITLE;
}
protected void renderContent( HttpServletRequest request, HttpServletResponse response ) throws IOException
{
PrintWriter pw = response.getWriter();
this.header( pw );
RepositoryAdmin repoAdmin = getRepositoryAdmin();
if ( repoAdmin == null )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' colspan='4'>RepositoryAdmin Service not available</td>" );
pw.println( "</tr>" );
footer( pw );
return;
}
Repository[] repos = repoAdmin.listRepositories();
Set activeURLs = new HashSet();
if ( repos == null || repos.length == 0 )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' colspan='4'>No Active Repositories</td>" );
pw.println( "</tr>" );
}
else
{
for ( int i = 0; i < repos.length; i++ )
{
Repository repo = repos[i];
activeURLs.add( repo.getURL().toString() );
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'>" + repo.getName() + "</td>" );
pw.print( "<td class='content'>" );
pw.print( "<a href='" + repo.getURL() + "' target='_blank' title='Show Repository " + repo.getURL()
+ "'>" + repo.getURL() + "</a>" );
pw.println( "</td>" );
pw.println( "<td class='content'>" + new Date( repo.getLastModified() ) + "</td>" );
pw.println( "<td class='content'>" );
pw.println( "<form>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME
+ "'>" );
pw.println( "<input type='hidden' name='" + RefreshRepoAction.PARAM_REPO + "' value='" + repo.getURL()
+ "'>" );
pw.println( "<input class='submit' type='submit' value='Refresh'>" );
pw.println( "<input class='submit' type='submit' name='remove' value='Remove'>" );
pw.println( "</form>" );
pw.println( "</td>" );
pw.println( "</tr>" );
}
}
// list any repositories configured but not active
for ( int i = 0; i < this.repoURLs.length; i++ )
{
if ( !activeURLs.contains( this.repoURLs[i] ) )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'>-</td>" );
pw.println( "<td class='content'>" + this.repoURLs[i] + "</td>" );
pw.println( "<td class='content'>[inactive, click Refresh to activate]</td>" );
pw.println( "<td class='content'>" );
pw.println( "<form>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME
+ "'>" );
pw.println( "<input type='hidden' name='" + RefreshRepoAction.PARAM_REPO + "' value='"
+ this.repoURLs[i] + "'>" );
pw.println( "<input class='submit' type='submit' value='Refresh'>" );
pw.println( "</form>" );
pw.println( "</td>" );
pw.println( "</tr>" );
}
}
// entry of a new repository
pw.println( "<form>" );
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'> </td>" );
pw.println( "<td class='content' colspan='2'>" );
pw.println( " <input class='input' type='text' name='" + RefreshRepoAction.PARAM_REPO
+ "' value='' size='80'>" );
pw.println( "</td>" );
pw.println( "<td class='content'>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME + "'>" );
pw.println( "<input class='submit' type='submit' value='Add'>" );
pw.println( "</td>" );
pw.println( "</tr>" );
pw.println( "</form>" );
this.footer( pw );
this.listResources( pw, repos, request.getParameter( PAR_CATEGORIES ) );
}
private void header( PrintWriter pw )
{
pw.println( "<table class='content' cellpadding='0' cellspacing='0' width='100%'>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content container' colspan='4'>Bundle Repositories</th>" );
pw.println( "</tr>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content'>Name</th>" );
pw.println( "<th class='content'>URL</th>" );
pw.println( "<th class='content'>Last Modification Time</th>" );
pw.println( "<th class='content'> </th>" );
pw.println( "</tr>" );
}
private void footer( PrintWriter pw )
{
pw.println( "</table>" );
}
private void listResources( PrintWriter pw, Repository[] repos, String category )
{
// assume no category if the all option
if ( ALL_CATEGORIES_OPTION.equals( category ) )
{
category = null;
}
Map bundles = this.getBundles();
Map resSet = new HashMap();
SortedSet categories = new TreeSet();
SortedSet labels = new TreeSet();
for ( int i = 0; i < repos.length; i++ )
{
Resource[] resources = repos[i].getResources();
for ( int j = 0; resources != null && j < resources.length; j++ )
{
Resource res = resources[j];
// get categories and check whether we should actually
// ignore this resource
boolean useResource;
final String[] cats = res.getCategories();
if ( cats == null )
{
useResource = NO_CATEGORIES_OPTION.equals( category );
}
else
{
useResource = false;
for ( int ci = 0; cats != null && ci < cats.length; ci++ )
{
String cat = cats[ci];
categories.add( cat );
useResource |= ( category == null || cat.equals( category ) );
}
}
if ( useResource )
{
String symbolicName = res.getSymbolicName();
Version version = res.getVersion();
Version installedVersion = ( Version ) bundles.get( symbolicName );
if ( installedVersion == null || installedVersion.compareTo( version ) < 0 )
{
Collection versions = ( Collection ) resSet.get( symbolicName );
if ( versions == null )
{
// order versions, hence use a TreeSet
versions = new TreeSet();
resSet.put( symbolicName, versions );
}
versions.add( version );
labels.add( res.getPresentationName() + Character.MAX_VALUE + symbolicName );
}
}
}
}
boolean doForm = !resSet.isEmpty();
this.resourcesHeader( pw, doForm, category, categories );
for ( Iterator ri = labels.iterator(); ri.hasNext(); )
{
final String label = ( String ) ri.next();
final int idx = label.indexOf( Character.MAX_VALUE );
final String presName = label.substring( 0, idx );
final String symName = label.substring( idx + 1 );
final Collection versions = ( Collection ) resSet.remove( symName );
if ( versions != null )
{
this.printResource( pw, symName, presName, versions );
}
}
this.resourcesFooter( pw, doForm );
}
private void resourcesHeader( PrintWriter pw, boolean doForm, String currentCategory, Collection categories )
{
if ( doForm )
{
pw.println( "<form method='post'>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + InstallFromRepoAction.NAME
+ "'>" );
}
pw.println( "<table class='content' cellpadding='0' cellspacing='0' width='100%'>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content container'>Available Resources</th>" );
if ( categories != null && !categories.isEmpty() )
{
pw.println( "<th class='content container' style='text-align:right'>Limit to Bundle Category:</th>" );
pw.println( "<th class='content container'>" );
Util.startScript( pw );
pw.println( "function reloadWithCat(field) {" );
pw.println( " var query = '?" + PAR_CATEGORIES + "=' + field.value;" );
pw
.println( " var dest = document.location.protocol + '//' + document.location.host + document.location.pathname + query;" );
pw.println( " document.location = dest;" );
pw.println( "}" );
Util.endScript( pw );
pw.println( "<select class='select' name='__ignoreoption__' onChange='reloadWithCat(this);'>" );
pw.print( "<option value='" + ALL_CATEGORIES_OPTION + "'>all</option>" );
pw.print( "<option value='" + NO_CATEGORIES_OPTION + "'>none</option>" );
for ( Iterator ci = categories.iterator(); ci.hasNext(); )
{
String category = ( String ) ci.next();
pw.print( "<option value='" + category + "'" );
if ( category.equals( currentCategory ) )
{
pw.print( " selected" );
}
pw.print( '>' );
pw.print( category );
pw.println( "</option>" );
}
pw.println( "</select>" );
pw.println( "</th>" );
}
else
{
pw.println( "<th class='content container'> </th>" );
}
pw.println( "</tr>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content'>Deploy Version</th>" );
pw.println( "<th class='content' colspan='2'>Name</th>" );
pw.println( "</tr>" );
}
private void printResource( PrintWriter pw, String symbolicName, String presentationName, Collection versions )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' valign='top' align='center'>" );
pw.println( "<select class='select' name='bundle'>" );
pw.print( "<option value='" + AbstractObrPlugin.DONT_INSTALL_OPTION + "'>Select Version...</option>" );
for ( Iterator vi = versions.iterator(); vi.hasNext(); )
{
Version version = ( Version ) vi.next();
pw.print( "<option value='" + symbolicName + "," + version + "'>" );
pw.print( version );
pw.println( "</option>" );
}
pw.println( "</select>" );
pw.println( "</td>" );
pw.println( "<td class='content' colspan='2'>" + presentationName + " (" + symbolicName + ")</td>" );
pw.println( "</tr>" );
}
private void resourcesButtons( PrintWriter pw )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'> </td>" );
pw.println( "<td class='content'>" );
pw.println( "<input class='submit' style='width:auto' type='submit' name='deploy' value='Deploy Selected'>" );
pw.println( " " );
pw
.println( "<input class='submit' style='width:auto' type='submit' name='deploystart' value='Deploy and Start Selected'>" );
pw.println( "</td></tr>" );
}
private void resourcesFooter( PrintWriter pw, boolean doForm )
{
if ( doForm )
{
this.resourcesButtons( pw );
}
pw.println( "</table></form>" );
}
private Map getBundles()
{
Map bundles = new HashMap();
Bundle[] installed = getBundleContext().getBundles();
for ( int i = 0; i < installed.length; i++ )
{
String ver = ( String ) installed[i].getHeaders().get( Constants.BUNDLE_VERSION );
Version bundleVersion = Version.parseVersion( ver );
// assume one bundle instance per symbolic name !!
// only add if there is a symbolic name !
if ( installed[i].getSymbolicName() != null )
{
bundles.put( installed[i].getSymbolicName(), bundleVersion );
}
}
return bundles;
}
protected RepositoryAdmin getRepositoryAdmin()
{
return ( RepositoryAdmin ) getService( "org.osgi.service.obr.RepositoryAdmin" );
}
}
| webconsole/src/main/java/org/apache/felix/webconsole/internal/obr/BundleRepositoryRender.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.felix.webconsole.internal.obr;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeSet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
import org.apache.felix.webconsole.internal.Util;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.osgi.service.obr.Repository;
import org.osgi.service.obr.RepositoryAdmin;
import org.osgi.service.obr.Resource;
public class BundleRepositoryRender extends BaseWebConsolePlugin
{
public static final String LABEL = "bundlerepo";
public static final String TITLE = "OSGi Repository";
public static final String PARAM_REPO_ID = "repositoryId";
public static final String PARAM_REPO_URL = "repositoryURL";
private static final String REPOSITORY_PROPERTY = "obr.repository.url";
private static final String ALL_CATEGORIES_OPTION = "*";
private static final String NO_CATEGORIES_OPTION = "---";
private static final String PAR_CATEGORIES = "category";
private String[] repoURLs;
public void activate( BundleContext bundleContext )
{
super.activate( bundleContext );
String urlStr = bundleContext.getProperty( REPOSITORY_PROPERTY );
List urlList = new ArrayList();
if ( urlStr != null )
{
StringTokenizer st = new StringTokenizer( urlStr );
while ( st.hasMoreTokens() )
{
urlList.add( st.nextToken() );
}
}
this.repoURLs = ( String[] ) urlList.toArray( new String[urlList.size()] );
}
public String getLabel()
{
return LABEL;
}
public String getTitle()
{
return TITLE;
}
protected void renderContent( HttpServletRequest request, HttpServletResponse response ) throws IOException
{
PrintWriter pw = response.getWriter();
this.header( pw );
RepositoryAdmin repoAdmin = getRepositoryAdmin();
if ( repoAdmin == null )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' colspan='4'>RepositoryAdmin Service not available</td>" );
pw.println( "</tr>" );
footer( pw );
return;
}
Repository[] repos = repoAdmin.listRepositories();
Set activeURLs = new HashSet();
if ( repos == null || repos.length == 0 )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' colspan='4'>No Active Repositories</td>" );
pw.println( "</tr>" );
}
else
{
for ( int i = 0; i < repos.length; i++ )
{
Repository repo = repos[i];
activeURLs.add( repo.getURL().toString() );
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'>" + repo.getName() + "</td>" );
pw.print( "<td class='content'>" );
pw.print( "<a href='" + repo.getURL() + "' target='_blank' title='Show Repository " + repo.getURL()
+ "'>" + repo.getURL() + "</a>" );
pw.println( "</td>" );
pw.println( "<td class='content'>" + new Date( repo.getLastModified() ) + "</td>" );
pw.println( "<td class='content'>" );
pw.println( "<form>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME
+ "'>" );
pw.println( "<input type='hidden' name='" + RefreshRepoAction.PARAM_REPO + "' value='" + repo.getURL()
+ "'>" );
pw.println( "<input class='submit' type='submit' value='Refresh'>" );
pw.println( "<input class='submit' type='submit' name='remove' value='Remove'>" );
pw.println( "</form>" );
pw.println( "</td>" );
pw.println( "</tr>" );
}
}
// list any repositories configured but not active
for ( int i = 0; i < this.repoURLs.length; i++ )
{
if ( !activeURLs.contains( this.repoURLs[i] ) )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'>-</td>" );
pw.println( "<td class='content'>" + this.repoURLs[i] + "</td>" );
pw.println( "<td class='content'>[inactive, click Refresh to activate]</td>" );
pw.println( "<td class='content'>" );
pw.println( "<form>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME
+ "'>" );
pw.println( "<input type='hidden' name='" + RefreshRepoAction.PARAM_REPO + "' value='"
+ this.repoURLs[i] + "'>" );
pw.println( "<input class='submit' type='submit' value='Refresh'>" );
pw.println( "</form>" );
pw.println( "</td>" );
pw.println( "</tr>" );
}
}
// entry of a new repository
pw.println( "<form>" );
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'> </td>" );
pw.println( "<td class='content' colspan='2'>" );
pw.println( " <input class='input' type='text' name='" + RefreshRepoAction.PARAM_REPO
+ "' value='' size='80'>" );
pw.println( "</td>" );
pw.println( "<td class='content'>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + RefreshRepoAction.NAME + "'>" );
pw.println( "<input class='submit' type='submit' value='Add'>" );
pw.println( "</td>" );
pw.println( "</tr>" );
pw.println( "</form>" );
this.footer( pw );
this.listResources( pw, repos, request.getParameter( PAR_CATEGORIES ) );
}
private void header( PrintWriter pw )
{
pw.println( "<table class='content' cellpadding='0' cellspacing='0' width='100%'>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content container' colspan='4'>Bundle Repositories</th>" );
pw.println( "</tr>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content'>Name</th>" );
pw.println( "<th class='content'>URL</th>" );
pw.println( "<th class='content'>Last Modification Time</th>" );
pw.println( "<th class='content'> </th>" );
pw.println( "</tr>" );
}
private void footer( PrintWriter pw )
{
pw.println( "</table>" );
}
private void listResources( PrintWriter pw, Repository[] repos, String category )
{
// assume no category if the all option
if ( ALL_CATEGORIES_OPTION.equals( category ) )
{
category = null;
}
Map bundles = this.getBundles();
Map resSet = new HashMap();
SortedSet categories = new TreeSet();
SortedSet labels = new TreeSet();
for ( int i = 0; i < repos.length; i++ )
{
Resource[] resources = repos[i].getResources();
for ( int j = 0; resources != null && j < resources.length; j++ )
{
Resource res = resources[j];
// get categories and check whether we should actually
// ignore this resource
boolean useResource;
final String[] cats = res.getCategories();
if ( cats == null )
{
useResource = NO_CATEGORIES_OPTION.equals( category );
}
else
{
useResource = false;
for ( int ci = 0; cats != null && ci < cats.length; ci++ )
{
String cat = cats[ci];
categories.add( cat );
useResource |= ( category == null || cat.equals( category ) );
}
}
if ( useResource )
{
String symbolicName = res.getSymbolicName();
Version version = res.getVersion();
Version installedVersion = ( Version ) bundles.get( symbolicName );
if ( installedVersion == null || installedVersion.compareTo( version ) < 0 )
{
Collection versions = ( Collection ) resSet.get( symbolicName );
if ( versions == null )
{
// order versions, hence use a TreeSet
versions = new TreeSet();
resSet.put( symbolicName, versions );
}
versions.add( version );
labels.add( res.getPresentationName() + "§" + symbolicName );
}
}
}
}
boolean doForm = !resSet.isEmpty();
this.resourcesHeader( pw, doForm, category, categories );
for ( Iterator ri = labels.iterator(); ri.hasNext(); )
{
final String label = ( String ) ri.next();
final int idx = label.indexOf( '§' );
final String presName = label.substring( 0, idx );
final String symName = label.substring( idx + 1 );
final Collection versions = ( Collection ) resSet.remove( symName );
if ( versions != null )
{
this.printResource( pw, symName, presName, versions );
}
}
this.resourcesFooter( pw, doForm );
}
private void resourcesHeader( PrintWriter pw, boolean doForm, String currentCategory, Collection categories )
{
if ( doForm )
{
pw.println( "<form method='post'>" );
pw.println( "<input type='hidden' name='" + Util.PARAM_ACTION + "' value='" + InstallFromRepoAction.NAME
+ "'>" );
}
pw.println( "<table class='content' cellpadding='0' cellspacing='0' width='100%'>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content container'>Available Resources</th>" );
if ( categories != null && !categories.isEmpty() )
{
pw.println( "<th class='content container' style='text-align:right'>Limit to Bundle Category:</th>" );
pw.println( "<th class='content container'>" );
Util.startScript( pw );
pw.println( "function reloadWithCat(field) {" );
pw.println( " var query = '?" + PAR_CATEGORIES + "=' + field.value;" );
pw
.println( " var dest = document.location.protocol + '//' + document.location.host + document.location.pathname + query;" );
pw.println( " document.location = dest;" );
pw.println( "}" );
Util.endScript( pw );
pw.println( "<select class='select' name='__ignoreoption__' onChange='reloadWithCat(this);'>" );
pw.print( "<option value='" + ALL_CATEGORIES_OPTION + "'>all</option>" );
pw.print( "<option value='" + NO_CATEGORIES_OPTION + "'>none</option>" );
for ( Iterator ci = categories.iterator(); ci.hasNext(); )
{
String category = ( String ) ci.next();
pw.print( "<option value='" + category + "'" );
if ( category.equals( currentCategory ) )
{
pw.print( " selected" );
}
pw.print( '>' );
pw.print( category );
pw.println( "</option>" );
}
pw.println( "</select>" );
pw.println( "</th>" );
}
else
{
pw.println( "<th class='content container'> </th>" );
}
pw.println( "</tr>" );
pw.println( "<tr class='content'>" );
pw.println( "<th class='content'>Deploy Version</th>" );
pw.println( "<th class='content' colspan='2'>Name</th>" );
pw.println( "</tr>" );
}
private void printResource( PrintWriter pw, String symbolicName, String presentationName, Collection versions )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content' valign='top' align='center'>" );
pw.println( "<select class='select' name='bundle'>" );
pw.print( "<option value='" + AbstractObrPlugin.DONT_INSTALL_OPTION + "'>Select Version...</option>" );
for ( Iterator vi = versions.iterator(); vi.hasNext(); )
{
Version version = ( Version ) vi.next();
pw.print( "<option value='" + symbolicName + "," + version + "'>" );
pw.print( version );
pw.println( "</option>" );
}
pw.println( "</select>" );
pw.println( "</td>" );
pw.println( "<td class='content' colspan='2'>" + presentationName + " (" + symbolicName + ")</td>" );
pw.println( "</tr>" );
}
private void resourcesButtons( PrintWriter pw )
{
pw.println( "<tr class='content'>" );
pw.println( "<td class='content'> </td>" );
pw.println( "<td class='content'>" );
pw.println( "<input class='submit' style='width:auto' type='submit' name='deploy' value='Deploy Selected'>" );
pw.println( " " );
pw
.println( "<input class='submit' style='width:auto' type='submit' name='deploystart' value='Deploy and Start Selected'>" );
pw.println( "</td></tr>" );
}
private void resourcesFooter( PrintWriter pw, boolean doForm )
{
if ( doForm )
{
this.resourcesButtons( pw );
}
pw.println( "</table></form>" );
}
private Map getBundles()
{
Map bundles = new HashMap();
Bundle[] installed = getBundleContext().getBundles();
for ( int i = 0; i < installed.length; i++ )
{
String ver = ( String ) installed[i].getHeaders().get( Constants.BUNDLE_VERSION );
Version bundleVersion = Version.parseVersion( ver );
// assume one bundle instance per symbolic name !!
// only add if there is a symbolic name !
if ( installed[i].getSymbolicName() != null )
{
bundles.put( installed[i].getSymbolicName(), bundleVersion );
}
}
return bundles;
}
protected RepositoryAdmin getRepositoryAdmin()
{
return ( RepositoryAdmin ) getService( "org.osgi.service.obr.RepositoryAdmin" );
}
}
| FELIX-1992 Replace special character with a Character constant
git-svn-id: e057f57e93a604d3b43d277ae69bde5ebf332112@901181 13f79535-47bb-0310-9956-ffa450edef68
| webconsole/src/main/java/org/apache/felix/webconsole/internal/obr/BundleRepositoryRender.java | FELIX-1992 Replace special character with a Character constant | <ide><path>ebconsole/src/main/java/org/apache/felix/webconsole/internal/obr/BundleRepositoryRender.java
<ide> }
<ide> versions.add( version );
<ide>
<del> labels.add( res.getPresentationName() + "§" + symbolicName );
<add> labels.add( res.getPresentationName() + Character.MAX_VALUE + symbolicName );
<ide> }
<ide> }
<ide> }
<ide> for ( Iterator ri = labels.iterator(); ri.hasNext(); )
<ide> {
<ide> final String label = ( String ) ri.next();
<del> final int idx = label.indexOf( '§' );
<add> final int idx = label.indexOf( Character.MAX_VALUE );
<ide> final String presName = label.substring( 0, idx );
<ide> final String symName = label.substring( idx + 1 );
<ide> final Collection versions = ( Collection ) resSet.remove( symName ); |
|
Java | apache-2.0 | 5941a15492a15d18428d4ea5ebc1f2f8681f3a6f | 0 | TankTian/acmeair,TankTian/acmeair,zhc920923/acmeair,TankTian/acmeair,TankTian/acmeair,WillemJiang/acmeair,seanyinx/acmeair,zhengyangyong/acmeair,zhc920923/acmeair,zhengyangyong/acmeair,WillemJiang/acmeair,zhc920923/acmeair,seanyinx/acmeair,seanyinx/acmeair,WillemJiang/acmeair,zhc920923/acmeair,WillemJiang/acmeair,zhengyangyong/acmeair,zhengyangyong/acmeair | /*******************************************************************************
* Copyright (c) 2013 IBM Corp.
*
* 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.
*******************************************************************************/
package com.acmeair.web;
import com.acmeair.entities.CustomerSession;
import com.acmeair.morphia.entities.CustomerSessionImpl;
import com.acmeair.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class RESTCookieSessionFilter implements Filter {
static final String LOGIN_USER = "acmeair.login_user";
private static final String LOGIN_PATH = "/rest/api/login";
private static final String LOGOUT_PATH = "/rest/api/login/logout";
private static final String LOADDB_PATH = "/rest/api/loaddb";
@Value("${customer.service.address}")
private String customerServiceAddress;
private RestTemplate restTemplate = new RestTemplate();
@Override
public void destroy() {
}
@Override
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest)req;
HttpServletResponse response = (HttpServletResponse)resp;
String path = request.getContextPath() + request.getServletPath();
if (request.getPathInfo() != null) {
path = path + request.getPathInfo();
}
// The following code is to ensure that OG is always set on the thread
/*try{
if (transactionService!=null)
transactionService.prepareForTransaction();
}catch( Exception e)
{
e.printStackTrace();
}*/
if (path.endsWith(LOGIN_PATH)) {
redirect(response, LOGIN_PATH);
return;
} else if (path.endsWith(LOGOUT_PATH)) {
redirect(response, LOGOUT_PATH);
return;
}
if (path.endsWith(LOGIN_PATH) || path.endsWith(LOGOUT_PATH) || path.endsWith(LOADDB_PATH)) {
// if logging in, logging out, or loading the database, let the request flow
chain.doFilter(req, resp);
return;
}
Cookie cookies[] = request.getCookies();
Cookie sessionCookie = null;
if (cookies != null) {
for (Cookie c : cookies) {
if (c.getName().equals(LoginREST.SESSIONID_COOKIE_NAME)) {
sessionCookie = c;
}
if (sessionCookie!=null)
break;
}
String sessionId = "";
if (sessionCookie!=null) // We need both cookie to work
sessionId= sessionCookie.getValue().trim();
// did this check as the logout currently sets the cookie value to "" instead of aging it out
// see comment in LogingREST.java
if (sessionId.equals("")) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
// Need the URLDecoder so that I can get @ not %40
ResponseEntity<CustomerSessionImpl> responseEntity = restTemplate.postForEntity(
customerServiceAddress + "/rest/api/login/validate",
validationRequest(sessionId),
CustomerSessionImpl.class
);
CustomerSession cs = responseEntity.getBody();
if (cs != null) {
request.setAttribute(LOGIN_USER, cs.getCustomerid());
chain.doFilter(req, resp);
return;
}
else {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
}
// if we got here, we didn't detect the session cookie, so we need to return 404
response.sendError(HttpServletResponse.SC_FORBIDDEN);
}
private HttpEntity<MultiValueMap<String, String>> validationRequest(String sessionId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
map.add("sessionId", sessionId);
return new HttpEntity<>(map, headers);
}
private void redirect(HttpServletResponse response, String path) {
response.setStatus(HttpServletResponse.SC_TEMPORARY_REDIRECT);
response.setHeader("Location", customerServiceAddress + path);
}
@Override
public void init(FilterConfig config) throws ServletException {
}
}
| acmeair-webapp/src/main/java/com/acmeair/web/RESTCookieSessionFilter.java | /*******************************************************************************
* Copyright (c) 2013 IBM Corp.
*
* 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.
*******************************************************************************/
package com.acmeair.web;
import com.acmeair.entities.CustomerSession;
import com.acmeair.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class RESTCookieSessionFilter implements Filter {
static final String LOGIN_USER = "acmeair.login_user";
private static final String LOGIN_PATH = "/rest/api/login";
private static final String LOGOUT_PATH = "/rest/api/login/logout";
private static final String LOADDB_PATH = "/rest/api/loaddb";
@Autowired
private CustomerService customerService;
@Value("${customer.service.address}")
private String customerServiceAddress;
@Override
public void destroy() {
}
@Override
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest)req;
HttpServletResponse response = (HttpServletResponse)resp;
String path = request.getContextPath() + request.getServletPath();
if (request.getPathInfo() != null) {
path = path + request.getPathInfo();
}
// The following code is to ensure that OG is always set on the thread
/*try{
if (transactionService!=null)
transactionService.prepareForTransaction();
}catch( Exception e)
{
e.printStackTrace();
}*/
if (path.endsWith(LOGIN_PATH)) {
redirect(response, LOGIN_PATH);
return;
} else if (path.endsWith(LOGOUT_PATH)) {
redirect(response, LOGOUT_PATH);
return;
}
if (path.endsWith(LOGIN_PATH) || path.endsWith(LOGOUT_PATH) || path.endsWith(LOADDB_PATH)) {
// if logging in, logging out, or loading the database, let the request flow
chain.doFilter(req, resp);
return;
}
Cookie cookies[] = request.getCookies();
Cookie sessionCookie = null;
if (cookies != null) {
for (Cookie c : cookies) {
if (c.getName().equals(LoginREST.SESSIONID_COOKIE_NAME)) {
sessionCookie = c;
}
if (sessionCookie!=null)
break;
}
String sessionId = "";
if (sessionCookie!=null) // We need both cookie to work
sessionId= sessionCookie.getValue().trim();
// did this check as the logout currently sets the cookie value to "" instead of aging it out
// see comment in LogingREST.java
if (sessionId.equals("")) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
// Need the URLDecoder so that I can get @ not %40
CustomerSession cs = customerService.validateSession(sessionId);
if (cs != null) {
request.setAttribute(LOGIN_USER, cs.getCustomerid());
chain.doFilter(req, resp);
return;
}
else {
response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
}
// if we got here, we didn't detect the session cookie, so we need to return 404
response.sendError(HttpServletResponse.SC_FORBIDDEN);
}
private void redirect(HttpServletResponse response, String path) {
response.setStatus(HttpServletResponse.SC_TEMPORARY_REDIRECT);
response.setHeader("Location", customerServiceAddress + path);
}
@Override
public void init(FilterConfig config) throws ServletException {
}
}
| replaced customer service call with rest communication
| acmeair-webapp/src/main/java/com/acmeair/web/RESTCookieSessionFilter.java | replaced customer service call with rest communication | <ide><path>cmeair-webapp/src/main/java/com/acmeair/web/RESTCookieSessionFilter.java
<ide> package com.acmeair.web;
<ide>
<ide> import com.acmeair.entities.CustomerSession;
<add>import com.acmeair.morphia.entities.CustomerSessionImpl;
<ide> import com.acmeair.service.CustomerService;
<ide> import org.springframework.beans.factory.annotation.Autowired;
<ide> import org.springframework.beans.factory.annotation.Value;
<add>import org.springframework.http.HttpEntity;
<add>import org.springframework.http.HttpHeaders;
<add>import org.springframework.http.MediaType;
<add>import org.springframework.http.ResponseEntity;
<ide> import org.springframework.stereotype.Component;
<add>import org.springframework.util.LinkedMultiValueMap;
<add>import org.springframework.util.MultiValueMap;
<add>import org.springframework.web.client.RestTemplate;
<ide>
<ide> import javax.servlet.Filter;
<ide> import javax.servlet.FilterChain;
<ide> private static final String LOGOUT_PATH = "/rest/api/login/logout";
<ide> private static final String LOADDB_PATH = "/rest/api/loaddb";
<ide>
<del> @Autowired
<del> private CustomerService customerService;
<del> @Value("${customer.service.address}")
<add> @Value("${customer.service.address}")
<ide> private String customerServiceAddress;
<ide>
<del> @Override
<add> private RestTemplate restTemplate = new RestTemplate();
<add>
<add> @Override
<ide> public void destroy() {
<ide> }
<ide>
<ide> return;
<ide> }
<ide> // Need the URLDecoder so that I can get @ not %40
<del> CustomerSession cs = customerService.validateSession(sessionId);
<del> if (cs != null) {
<add> ResponseEntity<CustomerSessionImpl> responseEntity = restTemplate.postForEntity(
<add> customerServiceAddress + "/rest/api/login/validate",
<add> validationRequest(sessionId),
<add> CustomerSessionImpl.class
<add> );
<add> CustomerSession cs = responseEntity.getBody();
<add> if (cs != null) {
<ide> request.setAttribute(LOGIN_USER, cs.getCustomerid());
<ide> chain.doFilter(req, resp);
<ide> return;
<ide> response.sendError(HttpServletResponse.SC_FORBIDDEN);
<ide> }
<ide>
<add> private HttpEntity<MultiValueMap<String, String>> validationRequest(String sessionId) {
<add> HttpHeaders headers = new HttpHeaders();
<add> headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
<add>
<add> MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
<add> map.add("sessionId", sessionId);
<add>
<add> return new HttpEntity<>(map, headers);
<add> }
<add>
<ide> private void redirect(HttpServletResponse response, String path) {
<ide> response.setStatus(HttpServletResponse.SC_TEMPORARY_REDIRECT);
<ide> response.setHeader("Location", customerServiceAddress + path); |
|
Java | apache-2.0 | 5851375eb6e4a797cc278f30e96247c44f02d142 | 0 | genericsystem/genericsystem2015,genericsystem/genericsystem2015,genericsystem/genericsystem2015,genericsystem/genericsystem2015,genericsystem/genericsystem2015 | package org.genericsystem.reactor.flex;
import org.genericsystem.reactor.Tag;
import org.genericsystem.reactor.annotation.InstanceColorize;
import org.genericsystem.reactor.html.HtmlH1;
import org.genericsystem.reactor.html.HtmlLabel;
import org.genericsystem.reactor.model.GenericModel;
import org.genericsystem.reactor.model.GenericModel.StringExtractor;
import org.genericsystem.reactor.model.ObservableListExtractor;
/**
* @author Nicolas Feybesse
*
* @param <M>
*/
public class FlexEditor extends CompositeFlexSection<GenericModel> {
public FlexEditor(Tag<?> parent) {
this(parent, FlexDirection.COLUMN);
}
public FlexEditor(Tag<?> parent, FlexDirection flexDirection) {
super(parent, flexDirection);
addStyle("flex", "1");
}
@Override
protected void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "0.3");
addStyle("background-color", "#ffa500");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
addStyle("color", "red");
addStyle("justify-content", "center");
addStyle("align-items", "center");
new HtmlH1<GenericModel>(this) {
{
bindText(GenericModel::getString);
}
};
}
};
}
@Override
protected void sections() {
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
}
@Override
protected void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "0.3");
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
}
@Override
public void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addStyle("background-color", "#dda5e2");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
select_(gs -> gs[0].getComponents().size() < 2 ? gs[0] : null);
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
@Override
public void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addPrefixBinding(modelContext -> modelContext.getObservableStyles(this).put("background-color",
((GenericModel) modelContext).getGeneric().getMeta().getAnnotation(InstanceColorize.class) != null ? ((GenericModel) modelContext).getString().getValue() : "#dda5e2"));
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, gs -> ObservableListExtractor.COMPONENTS.apply(gs).filtered(g -> !g.equals(gs[1].getMeta())));
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
};
}
};
}
@Override
protected void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
addStyle("flex", "1");
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.HOLDERS);
}
@Override
public void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addStyle("background-color", "#dda5e2");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
select_(gs -> gs[0].getComponents().size() < 2 ? gs[0] : null);
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
@Override
public void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addPrefixBinding(modelContext -> modelContext.getObservableStyles(this).put("background-color",
((GenericModel) modelContext).getGeneric().getMeta().getAnnotation(InstanceColorize.class) != null ? ((GenericModel) modelContext).getString().getValue() : "#dda5e2"));
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, gs -> ObservableListExtractor.COMPONENTS.apply(gs).filtered(g -> !g.equals(gs[2])));
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
};
}
};
}
};
};
};
}
}
| gs-reactor/src/main/java/org/genericsystem/reactor/flex/FlexEditor.java | package org.genericsystem.reactor.flex;
import org.genericsystem.reactor.Tag;
import org.genericsystem.reactor.annotation.InstanceColorize;
import org.genericsystem.reactor.html.HtmlH1;
import org.genericsystem.reactor.html.HtmlLabel;
import org.genericsystem.reactor.model.GenericModel;
import org.genericsystem.reactor.model.GenericModel.StringExtractor;
import org.genericsystem.reactor.model.ObservableListExtractor;
/**
* @author Nicolas Feybesse
*
* @param <M>
*/
public class FlexEditor extends CompositeFlexSection<GenericModel> {
public FlexEditor(Tag<?> parent) {
this(parent, FlexDirection.COLUMN);
}
public FlexEditor(Tag<?> parent, FlexDirection flexDirection) {
super(parent, flexDirection);
addStyle("flex", "1");
}
@Override
protected void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addStyle("background-color", "#ffa500");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
addStyle("color", "red");
addStyle("justify-content", "center");
new HtmlH1<GenericModel>(this) {
{
bindText(GenericModel::getString);
}
};
}
};
}
@Override
protected void sections() {
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
}
@Override
protected void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
}
@Override
public void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addStyle("background-color", "#dda5e2");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
select_(gs -> gs[0].getComponents().size() < 2 ? gs[0] : null);
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
@Override
public void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addPrefixBinding(modelContext -> modelContext.getObservableStyles(this).put("background-color",
((GenericModel) modelContext).getGeneric().getMeta().getAnnotation(InstanceColorize.class) != null ? ((GenericModel) modelContext).getString().getValue() : "#dda5e2"));
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, gs -> ObservableListExtractor.COMPONENTS.apply(gs).filtered(g -> !g.equals(gs[1].getMeta())));
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
};
}
};
}
@Override
protected void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.ATTRIBUTES_OF_INSTANCES);
addStyle("flex", "1");
new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
{
addStyle("flex", "1");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, ObservableListExtractor.HOLDERS);
}
@Override
public void header() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addStyle("background-color", "#dda5e2");
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
select_(gs -> gs[0].getComponents().size() < 2 ? gs[0] : null);
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
@Override
public void sections() {
new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
{
addStyle("flex", "1");
addPrefixBinding(modelContext -> modelContext.getObservableStyles(this).put("background-color",
((GenericModel) modelContext).getGeneric().getMeta().getAnnotation(InstanceColorize.class) != null ? ((GenericModel) modelContext).getString().getValue() : "#dda5e2"));
addStyle("margin-right", "1px");
addStyle("margin-bottom", "1px");
forEach(StringExtractor.SIMPLE_CLASS_EXTRACTOR, gs -> ObservableListExtractor.COMPONENTS.apply(gs).filtered(g -> !g.equals(gs[2])));
new HtmlLabel<GenericModel>(this).bindText(GenericModel::getString);
}
};
}
};
}
};
}
};
};
};
}
}
| Adjust style of FlexEditor
| gs-reactor/src/main/java/org/genericsystem/reactor/flex/FlexEditor.java | Adjust style of FlexEditor | <ide><path>s-reactor/src/main/java/org/genericsystem/reactor/flex/FlexEditor.java
<ide> protected void header() {
<ide> new FlexSection<GenericModel>(this, FlexEditor.this.getReverseDirection()) {
<ide> {
<del> addStyle("flex", "1");
<add> addStyle("flex", "0.3");
<ide> addStyle("background-color", "#ffa500");
<ide> addStyle("margin-right", "1px");
<ide> addStyle("margin-bottom", "1px");
<ide> addStyle("color", "red");
<ide> addStyle("justify-content", "center");
<add> addStyle("align-items", "center");
<ide> new HtmlH1<GenericModel>(this) {
<ide> {
<ide> bindText(GenericModel::getString);
<ide> protected void header() {
<ide> new FlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
<ide> {
<del> addStyle("flex", "1");
<add> addStyle("flex", "0.3");
<ide> new CompositeFlexSection<GenericModel>(this, FlexEditor.this.getDirection()) {
<ide> {
<ide> addStyle("flex", "1"); |
|
Java | lgpl-2.1 | 28019cd8fe1a5410ec68ab1dd3d7c8cab933e554 | 0 | Cazsius/Spice-of-Life-Carrot-Edition | package com.cazsius.solcarrot.capability;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.*;
import java.util.*;
public final class FoodCapability implements ICapabilitySerializable<NBTBase> {
private static final String NBT_KEY_FOOD_LIST = "foodList";
private static final String NBT_KEY_PROGRESS_INFO = "progressInfo";
public static FoodCapability get(EntityPlayer player) {
FoodCapability foodCapability = player.getCapability(FoodCapability.FOOD_CAPABILITY, null);
assert foodCapability != null;
return foodCapability;
}
@CapabilityInject(FoodCapability.class)
public static Capability<FoodCapability> FOOD_CAPABILITY;
private final Set<FoodInstance> foods = new HashSet<>();
private ProgressInfo progressInfo = new ProgressInfo(0);
public FoodCapability() {}
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
return capability == FOOD_CAPABILITY;
}
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
return capability == FOOD_CAPABILITY ? (T) this : null;
}
/** used for persistent storage */
@Override
public NBTBase serializeNBT() {
NBTTagList list = new NBTTagList();
for (FoodInstance food : foods) {
ResourceLocation location = Item.REGISTRY.getNameForObject(food.item);
if (location == null)
continue;
String toWrite = location + "@" + food.metadata;
list.appendTag(new NBTTagString(toWrite));
}
return list;
}
/** used for persistent storage */
@Override
public void deserializeNBT(NBTBase nbt) {
foods.clear();
NBTTagList list = (NBTTagList) nbt;
for (int i = 0; i < list.tagCount(); i++) {
String toDecompose = ((NBTTagString) list.get(i)).getString();
String[] parts = toDecompose.split("@");
String name = parts[0];
int meta;
if (parts.length > 1) {
meta = Integer.decode(parts[1]);
} else {
meta = 0;
}
Item item = Item.getByNameOrId(name);
if (item == null)
continue; // TODO it'd be nice to store (and maybe even count) references to missing items, in case the mod is added back in later
foods.add(new FoodInstance(item, meta));
}
updateProgressInfo();
}
/** serializes everything, including the progress info, for sending to clients */
public NBTTagCompound serializeFullNBT() {
NBTTagCompound tag = new NBTTagCompound();
tag.setTag(NBT_KEY_FOOD_LIST, serializeNBT());
tag.setTag(NBT_KEY_PROGRESS_INFO, progressInfo.getNBT());
return tag;
}
/** deserializes everything, including the progress info, after receiving it from the server */
public void deserializeFullNBT(NBTTagCompound tag) {
deserializeNBT(tag.getTag(NBT_KEY_FOOD_LIST));
progressInfo = new ProgressInfo(tag.getCompoundTag(NBT_KEY_PROGRESS_INFO));
}
public void addFood(ItemStack itemStack) {
foods.add(new FoodInstance(itemStack));
updateProgressInfo();
}
public boolean hasEaten(ItemStack itemStack) {
return foods.contains(new FoodInstance(itemStack));
}
public void clearFood() {
foods.clear();
updateProgressInfo();
}
public int getFoodCount() {
return foods.size();
}
public List<FoodInstance> getEatenFoods() {
return new ArrayList<>(foods);
}
public ProgressInfo getProgressInfo() {
return progressInfo;
}
/** don't use this client-side! it'll overwrite it with client-side config values */
public void updateProgressInfo() {
progressInfo = new ProgressInfo(foods.size());
}
}
| src/main/java/com/cazsius/solcarrot/capability/FoodCapability.java | package com.cazsius.solcarrot.capability;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.*;
import java.util.*;
public final class FoodCapability implements ICapabilitySerializable<NBTBase> {
private static final String NBT_KEY_FOOD_LIST = "foodList";
private static final String NBT_KEY_PROGRESS_INFO = "progressInfo";
public static FoodCapability get(EntityPlayer player) {
FoodCapability foodCapability = player.getCapability(FoodCapability.FOOD_CAPABILITY, null);
assert foodCapability != null;
return foodCapability;
}
@CapabilityInject(FoodCapability.class)
public static Capability<FoodCapability> FOOD_CAPABILITY;
private final Set<FoodInstance> foods = new HashSet<>();
private ProgressInfo progressInfo = new ProgressInfo(0);
public FoodCapability() {}
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
return capability == FOOD_CAPABILITY;
}
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
return capability == FOOD_CAPABILITY ? (T) this : null;
}
/** used for persistent storage */
@Override
public NBTBase serializeNBT() {
NBTTagList list = new NBTTagList();
for (FoodInstance food : foods) {
ResourceLocation location = Item.REGISTRY.getNameForObject(food.item);
if (location == null)
continue;
String toWrite = location + "@" + food.metadata;
list.appendTag(new NBTTagString(toWrite));
}
return list;
}
/** used for persistent storage */
@Override
public void deserializeNBT(NBTBase nbt) {
foods.clear();
NBTTagList list = (NBTTagList) nbt;
for (int i = 0; i < list.tagCount(); i++) {
String toDecompose = ((NBTTagString) list.get(i)).getString();
String[] parts = toDecompose.split("@");
String name = parts[0];
int meta;
if (parts.length > 1) {
meta = Integer.decode(parts[1]);
} else {
meta = 0;
}
Item item = Item.getByNameOrId(name);
if (item == null)
continue; // TODO it'd be nice to store (and maybe even count) references to missing items, in case the mod is added back in later
foods.add(new FoodInstance(item, meta));
}
updateProgressInfo();
}
/** serializes everything, including the progress info, for sending to clients */
public NBTTagCompound serializeFullNBT() {
NBTTagCompound tag = new NBTTagCompound();
tag.setTag(NBT_KEY_FOOD_LIST, serializeNBT());
tag.setTag(NBT_KEY_PROGRESS_INFO, progressInfo.getNBT());
return tag;
}
/** deserializes everything, including the progress info, after receiving it from the server */
public void deserializeFullNBT(NBTTagCompound tag) {
deserializeNBT(tag.getTag(NBT_KEY_FOOD_LIST));
progressInfo = new ProgressInfo(tag.getCompoundTag(NBT_KEY_PROGRESS_INFO));
}
public void addFood(ItemStack itemStack) {
foods.add(new FoodInstance(itemStack));
updateProgressInfo();
}
public boolean hasEaten(ItemStack itemStack) {
return foods.contains(new FoodInstance(itemStack));
}
public void clearFood() {
foods.clear();
updateProgressInfo();
}
public int getFoodCount() {
return foods.size()
}
public List<FoodInstance> getEatenFoods() {
return new ArrayList<>(foods);
}
public ProgressInfo getProgressInfo() {
return progressInfo;
}
/** don't use this client-side! it'll overwrite it with client-side config values */
public void updateProgressInfo() {
progressInfo = new ProgressInfo(foods.size());
}
}
| added missing semicolon
(whoops)
| src/main/java/com/cazsius/solcarrot/capability/FoodCapability.java | added missing semicolon | <ide><path>rc/main/java/com/cazsius/solcarrot/capability/FoodCapability.java
<ide> }
<ide>
<ide> public int getFoodCount() {
<del> return foods.size()
<add> return foods.size();
<ide> }
<ide>
<ide> public List<FoodInstance> getEatenFoods() { |
|
Java | apache-2.0 | 48ff4797a6a708740a317cce5a402df65e1e27ae | 0 | TeknoMatik/OpenWeather | package com.rustam.openweather.ui.activities;
import android.content.Intent;
import android.location.Location;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.rustam.openweather.Constants;
import com.rustam.openweather.R;
import com.rustam.openweather.server.OpenWeatherClient;
import com.rustam.openweather.server.entity.Item;
import com.rustam.openweather.server.handlers.DailyHandler;
import com.rustam.openweather.server.listeners.OnResponseListener;
import com.rustam.openweather.server.requests.DailyRequest;
import com.rustam.openweather.server.responses.DailyResponse;
import com.rustam.openweather.ui.adapters.ForecastAdapter;
import com.rustam.openweather.ui.dialogs.ChangeCityDialog;
import com.rustam.openweather.utils.DeviceUtil;
import com.rustam.openweather.utils.FormatUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONException;
public final class MainActivity extends BaseActivity
implements ChangeCityDialog.ChangeCityDialogListener, GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener {
private ListView mListView;
private List<Item> listItem;
private ForecastAdapter mAdapter;
private Button mCityButton;
private TextView mTemperatureTextView;
private TextView mMinTextView;
private TextView mMaxTextView;
private TextView mHumidityTextView;
private GoogleApiClient mGoogleApiClient;
private LocationRequest mLocationRequest;
private Location mLastLocation;
private OnResponseListener<DailyResponse> mOnResponseListener =
new OnResponseListener<DailyResponse>() {
@Override
public void onOk(DailyResponse response) {
listItem = response.getItemList();
mAdapter = new ForecastAdapter(MainActivity.this, listItem);
mListView.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
fillControls(response.getItemList().get(0), response.getCity().getName());
DeviceUtil.hideProgressDialog();
}
@Override
public void onNotFound() {
DeviceUtil.hideProgressDialog();
Toast.makeText(MainActivity.this, getString(R.string.city_not_found), Toast.LENGTH_SHORT)
.show();
}
@Override
public void onError(Throwable throwable) {
Log.d(MainActivity.class.getName(), throwable.getLocalizedMessage());
DeviceUtil.hideProgressDialog();
Toast.makeText(MainActivity.this, throwable.getLocalizedMessage(), Toast.LENGTH_SHORT)
.show();
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCityButton = (Button) findViewById(R.id.cityButton);
mTemperatureTextView = (TextView) findViewById(R.id.temperatureTextView);
mMinTextView = (TextView) findViewById(R.id.minTextView);
mMaxTextView = (TextView) findViewById(R.id.maxTextView);
mHumidityTextView = (TextView) findViewById(R.id.humidityTextView);
mListView = (ListView) findViewById(R.id.forecastListView);
listItem = new ArrayList<>();
mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override protected int getLayoutResources() {
return R.layout.activity_main;
}
@Override protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override protected void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}
@Override
public void onDialogPositiveClick(String query) {
DailyRequest request = new DailyRequest(query);
refreshWeather(request);
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
Intent intent = new Intent(this, SettingsActivity.class);
ActivityCompat.startActivity(MainActivity.this, intent, null);
return true;
}
return super.onOptionsItemSelected(item);
}
private void refreshWeather(Location location) {
DailyRequest dailyRequest = new DailyRequest(location.getLatitude(), location.getLongitude());
refreshWeather(dailyRequest);
}
private void refreshWeather(String city) {
DailyRequest dailyRequest = new DailyRequest(city);
refreshWeather(dailyRequest);
}
private void refreshWeather(DailyRequest request) {
try {
OpenWeatherClient.request(new DailyHandler(request).addResponseListener(mOnResponseListener));
} catch (JSONException e) {
e.printStackTrace();
}
}
private void fillControls(Item item, String city) {
mCityButton.setText(city);
mTemperatureTextView.setText(
FormatUtil.formatTemperature(item.getTemperature().getDay(), this));
mMinTextView.setText(String.format("Min\n%s",
FormatUtil.formatTemperature(item.getTemperature().getMax(), this)));
mMaxTextView.setText(String.format("Max\n%s",
FormatUtil.formatTemperature(item.getTemperature().getMin(), this)));
mHumidityTextView.setText(FormatUtil.percentValue(item.getHumidity()));
}
public void onCityButtonClick(View view) {
ChangeCityDialog cityDialog = new ChangeCityDialog();
cityDialog.show(getFragmentManager(), ChangeCityDialog.TAG);
}
@Override public void onConnected(Bundle bundle) {
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(Constants.GPS_UPDATE_TIME);
LocationServices.FusedLocationApi.requestLocationUpdates(
mGoogleApiClient, mLocationRequest, this);
Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if (location != null) {
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
mLastLocation = location;
refreshWeather(location);
} else {
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
refreshWeather(Constants.DEFAULT_CITY);
}
}
@Override public void onConnectionSuspended(int i) {
Log.i(MainActivity.class.getName(), "GoogleApiClient connection has been suspend");
}
@Override public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(MainActivity.class.getName(), "GoogleApiClient connection has failed");
}
@Override public void onLocationChanged(Location location) {
if (mLastLocation == null || (mLastLocation.getLatitude() != location.getLatitude()
&& mLastLocation.getLongitude() != location.getLongitude())) {
mLastLocation = location;
refreshWeather(location);
}
}
}
| app/src/main/java/com/rustam/openweather/ui/activities/MainActivity.java | package com.rustam.openweather.ui.activities;
import android.content.Intent;
import android.location.Location;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.util.Pair;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.rustam.openweather.Constants;
import com.rustam.openweather.R;
import com.rustam.openweather.server.OpenWeatherClient;
import com.rustam.openweather.server.entity.Item;
import com.rustam.openweather.server.handlers.DailyHandler;
import com.rustam.openweather.server.listeners.OnResponseListener;
import com.rustam.openweather.server.requests.DailyRequest;
import com.rustam.openweather.server.responses.DailyResponse;
import com.rustam.openweather.ui.adapters.ForecastAdapter;
import com.rustam.openweather.ui.dialogs.ChangeCityDialog;
import com.rustam.openweather.utils.DeviceUtil;
import com.rustam.openweather.utils.FormatUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONException;
public final class MainActivity extends BaseActivity
implements ChangeCityDialog.ChangeCityDialogListener, GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener {
private ListView mListView;
private List<Item> listItem;
private ForecastAdapter mAdapter;
private Button mCityButton;
private TextView mTemperatureTextView;
private TextView mMinTextView;
private TextView mMaxTextView;
private TextView mHumidityTextView;
private GoogleApiClient mGoogleApiClient;
private LocationRequest mLocationRequest;
private Location mLastLocation;
private OnResponseListener<DailyResponse> mOnResponseListener =
new OnResponseListener<DailyResponse>() {
@Override
public void onOk(DailyResponse response) {
listItem = response.getItemList();
mAdapter = new ForecastAdapter(MainActivity.this, listItem);
mListView.setAdapter(mAdapter);
mAdapter.notifyDataSetChanged();
fillControls(response.getItemList().get(0), response.getCity().getName());
DeviceUtil.hideProgressDialog();
}
@Override
public void onNotFound() {
DeviceUtil.hideProgressDialog();
Toast.makeText(MainActivity.this, getString(R.string.city_not_found), Toast.LENGTH_SHORT)
.show();
}
@Override
public void onError(Throwable throwable) {
Log.d(MainActivity.class.getName(), throwable.getLocalizedMessage());
DeviceUtil.hideProgressDialog();
Toast.makeText(MainActivity.this, throwable.getLocalizedMessage(), Toast.LENGTH_SHORT)
.show();
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mCityButton = (Button) findViewById(R.id.cityButton);
mTemperatureTextView = (TextView) findViewById(R.id.temperatureTextView);
mMinTextView = (TextView) findViewById(R.id.minTextView);
mMaxTextView = (TextView) findViewById(R.id.maxTextView);
mHumidityTextView = (TextView) findViewById(R.id.humidityTextView);
mListView = (ListView) findViewById(R.id.forecastListView);
listItem = new ArrayList<>();
mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override protected int getLayoutResources() {
return R.layout.activity_main;
}
@Override protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override protected void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}
@Override
public void onDialogPositiveClick(String query) {
DailyRequest request = new DailyRequest(query);
refreshWeather(request);
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
Intent intent = new Intent(this, SettingsActivity.class);
ActivityCompat.startActivity(MainActivity.this, intent, null);
return true;
}
return super.onOptionsItemSelected(item);
}
private void refreshWeather(Location location) {
DailyRequest dailyRequest = new DailyRequest(location.getLatitude(), location.getLongitude());
refreshWeather(dailyRequest);
}
private void refreshWeather(String city) {
DailyRequest dailyRequest = new DailyRequest(city);
refreshWeather(dailyRequest);
}
private void refreshWeather(DailyRequest request) {
try {
OpenWeatherClient.request(new DailyHandler(request).addResponseListener(mOnResponseListener));
} catch (JSONException e) {
e.printStackTrace();
}
}
private void fillControls(Item item, String city) {
mCityButton.setText(city);
mTemperatureTextView.setText(
FormatUtil.formatTemperature(item.getTemperature().getDay(), this));
mMinTextView.setText(String.format("Min\n%s",
FormatUtil.formatTemperature(item.getTemperature().getMax(), this)));
mMaxTextView.setText(String.format("Max\n%s",
FormatUtil.formatTemperature(item.getTemperature().getMin(), this)));
mHumidityTextView.setText(FormatUtil.percentValue(item.getHumidity()));
}
public void onCityButtonClick(View view) {
ChangeCityDialog cityDialog = new ChangeCityDialog();
cityDialog.show(getFragmentManager(), ChangeCityDialog.TAG);
}
@Override public void onConnected(Bundle bundle) {
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(Constants.GPS_UPDATE_TIME);
LocationServices.FusedLocationApi.requestLocationUpdates(
mGoogleApiClient, mLocationRequest, this);
Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if (location != null) {
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
mLastLocation = location;
refreshWeather(location);
} else {
DeviceUtil.showProgressDialog(this, getString(R.string.loading));
refreshWeather(Constants.DEFAULT_CITY);
}
}
@Override public void onConnectionSuspended(int i) {
Log.i(MainActivity.class.getName(), "GoogleApiClient connection has been suspend");
}
@Override public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(MainActivity.class.getName(), "GoogleApiClient connection has failed");
}
@Override public void onLocationChanged(Location location) {
if (mLastLocation == null || (mLastLocation.getLatitude() != location.getLatitude()
&& mLastLocation.getLongitude() != location.getLongitude())) {
mLastLocation = location;
refreshWeather(location);
}
}
}
| remove unused imports
| app/src/main/java/com/rustam/openweather/ui/activities/MainActivity.java | remove unused imports | <ide><path>pp/src/main/java/com/rustam/openweather/ui/activities/MainActivity.java
<ide> import android.location.Location;
<ide> import android.os.Bundle;
<ide> import android.support.v4.app.ActivityCompat;
<del>import android.support.v4.app.ActivityOptionsCompat;
<del>import android.support.v4.util.Pair;
<ide> import android.util.Log;
<ide> import android.view.Menu;
<ide> import android.view.MenuItem; |
|
Java | apache-2.0 | ddc688eee8f7d219e982509af7f09d6af79879f1 | 0 | GladsonAntony/WebAutomation_AllureWDM | package controllers;
import com.automation.remarks.video.enums.RecorderType;
import com.automation.remarks.video.enums.RecordingMode;
import com.automation.remarks.video.enums.VideoSaveMode;
import com.automation.remarks.video.recorder.VideoRecorder;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.NotFoundException;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
/**
* @Author Gladson Antony
* @Date 30-DEC-2018
*/
public class WebDriverFactory extends BrowserFactory
{
public static ThreadLocal<WebDriver> wd = new ThreadLocal<WebDriver>();
public static String browser;
public static String url;
@BeforeTest(alwaysRun=true)
public void suiteSetup() throws Exception
{
switch(Browser.toLowerCase())
{
case "chrome":
case "chrome_headless":
WebDriverManager.chromedriver().setup();
case "opera":
WebDriverManager.operadriver().setup();
break;
case "firefox":
case "firefox_headless":
WebDriverManager.firefoxdriver().arch64().setup();
break;
case "ie":
case "internet explorer":
WebDriverManager.iedriver().setup();
break;
case "edge":
WebDriverManager.edgedriver().setup();
break;
case "ghost":
case "phantom":
WebDriverManager.phantomjs().setup();
break;
default:
throw new NotFoundException("Browser Not Found. Please Provide a Valid Browser");
}
}
@BeforeMethod
public void beforeMethod() throws Exception
{
System.out.println("Browser: "+Browser);
System.out.println("WebsiteURL: "+WebsiteURL);
new WebDriverFactory();
WebDriver driver = WebDriverFactory.createDriver();
setWebDriver(driver);
if(VideoFeature.toLowerCase().contains("enabledfailed"))
{
setupVideoRecordingFailedOnly();
}
else if(VideoFeature.toLowerCase().contains("enabledall"))
{
setupVideoRecordingAll();
}
}
public void setupVideoRecordingFailedOnly() throws Exception
{
VideoRecorder.conf()
.withVideoFolder("./src/test/resources/Videos") // Default is ${user.dir}/video.
.videoEnabled(true) // Disabled video globally
.withVideoSaveMode(VideoSaveMode.FAILED_ONLY) // Save videos ONLY FAILED tests
.withRecorderType(RecorderType.MONTE) // Monte is Default recorder
.withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
}
public void setupVideoRecordingAll() throws Exception
{
VideoRecorder.conf()
.withVideoFolder("./src/test/resources/Videos") // Default is ${user.dir}/video.
.videoEnabled(true) // Disabled video globally
.withVideoSaveMode(VideoSaveMode.ALL) // Save videos All tests
.withRecorderType(RecorderType.MONTE) // Monte is Default recorder
.withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
}
public void setWebDriver(WebDriver driver)
{
wd.set(driver);
}
public static WebDriver getWebDriver()
{
return wd.get();
}
@AfterMethod(alwaysRun=true,enabled=true)
public void afterMethod() throws Exception
{
Thread.sleep(2000);
getWebDriver().quit();
}
}
| src/main/java/controllers/WebDriverFactory.java | /**
*
*/
package controllers;
import org.openqa.selenium.NotFoundException;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import com.automation.remarks.video.enums.RecorderType;
import com.automation.remarks.video.enums.RecordingMode;
import com.automation.remarks.video.enums.VideoSaveMode;
import com.automation.remarks.video.recorder.VideoRecorder;
import io.github.bonigarcia.wdm.ChromeDriverManager;
import io.github.bonigarcia.wdm.EdgeDriverManager;
import io.github.bonigarcia.wdm.FirefoxDriverManager;
import io.github.bonigarcia.wdm.InternetExplorerDriverManager;
import io.github.bonigarcia.wdm.PhantomJsDriverManager;
/**
* @Author Gladson Antony
* @Date 08-Feb-2017
*/
public class WebDriverFactory extends BrowserFactory
{
public static ThreadLocal<WebDriver> wd = new ThreadLocal<WebDriver>();
public static String browser;
public static String url;
@BeforeTest(alwaysRun=true)
public void suiteSetup() throws Exception
{
switch(Browser.toLowerCase())
{
case "chrome":
case "chrome_headless":
case "opera":
ChromeDriverManager.getInstance().setup();
break;
case "firefox":
FirefoxDriverManager.getInstance().setup();
break;
case "ie":
case "internet explorer":
InternetExplorerDriverManager.getInstance().setup();
break;
case "edge":
EdgeDriverManager.getInstance().setup();
break;
case "ghost":
case "phantom":
PhantomJsDriverManager.getInstance().setup();
break;
case "safari":
break;
default:
throw new NotFoundException("Browser Not Found. Please Provide a Valid Browser");
}
}
@BeforeMethod
public void beforeMethod() throws Exception
{
System.out.println("Browser: "+Browser);
System.out.println("WebsiteURL: "+WebsiteURL);
new WebDriverFactory();
WebDriver driver = WebDriverFactory.createDriver();
setWebDriver(driver);
if(VideoFeature.toLowerCase().contains("enabledfailed"))
{
setupVideoRecordingFailedOnly();
}
else if(VideoFeature.toLowerCase().contains("enabledall"))
{
setupVideoRecordingAll();
}
}
public void setupVideoRecordingFailedOnly() throws Exception
{
VideoRecorder.conf()
.withVideoFolder("./src/test/resources/Videos") // Default is ${user.dir}/video.
.videoEnabled(true) // Disabled video globally
.withVideoSaveMode(VideoSaveMode.FAILED_ONLY) // Save videos ONLY FAILED tests
.withRecorderType(RecorderType.MONTE) // Monte is Default recorder
.withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
}
public void setupVideoRecordingAll() throws Exception
{
VideoRecorder.conf()
.withVideoFolder("./src/test/resources/Videos") // Default is ${user.dir}/video.
.videoEnabled(true) // Disabled video globally
.withVideoSaveMode(VideoSaveMode.ALL) // Save videos All tests
.withRecorderType(RecorderType.MONTE) // Monte is Default recorder
.withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
}
public void setWebDriver(WebDriver driver)
{
wd.set(driver);
}
public static WebDriver getWebDriver()
{
return wd.get();
}
@AfterMethod(alwaysRun=true,enabled=true)
public void afterMethod() throws Exception
{
Thread.sleep(2000);
getWebDriver().quit();
}
}
| Updated WebBDriverFactory to match Webdriver Manger v3 Changes
| src/main/java/controllers/WebDriverFactory.java | Updated WebBDriverFactory to match Webdriver Manger v3 Changes | <ide><path>rc/main/java/controllers/WebDriverFactory.java
<del>/**
<del> *
<del> */
<ide> package controllers;
<ide>
<add>import com.automation.remarks.video.enums.RecorderType;
<add>import com.automation.remarks.video.enums.RecordingMode;
<add>import com.automation.remarks.video.enums.VideoSaveMode;
<add>import com.automation.remarks.video.recorder.VideoRecorder;
<add>import io.github.bonigarcia.wdm.WebDriverManager;
<ide> import org.openqa.selenium.NotFoundException;
<ide> import org.openqa.selenium.WebDriver;
<ide> import org.testng.annotations.AfterMethod;
<ide> import org.testng.annotations.BeforeMethod;
<ide> import org.testng.annotations.BeforeTest;
<ide>
<del>import com.automation.remarks.video.enums.RecorderType;
<del>import com.automation.remarks.video.enums.RecordingMode;
<del>import com.automation.remarks.video.enums.VideoSaveMode;
<del>import com.automation.remarks.video.recorder.VideoRecorder;
<del>
<del>import io.github.bonigarcia.wdm.ChromeDriverManager;
<del>import io.github.bonigarcia.wdm.EdgeDriverManager;
<del>import io.github.bonigarcia.wdm.FirefoxDriverManager;
<del>import io.github.bonigarcia.wdm.InternetExplorerDriverManager;
<del>import io.github.bonigarcia.wdm.PhantomJsDriverManager;
<del>
<ide> /**
<ide> * @Author Gladson Antony
<del> * @Date 08-Feb-2017
<add> * @Date 30-DEC-2018
<ide> */
<add>
<ide> public class WebDriverFactory extends BrowserFactory
<ide> {
<ide> public static ThreadLocal<WebDriver> wd = new ThreadLocal<WebDriver>();
<ide> {
<ide> case "chrome":
<ide> case "chrome_headless":
<add> WebDriverManager.chromedriver().setup();
<add>
<ide> case "opera":
<del> ChromeDriverManager.getInstance().setup();
<add> WebDriverManager.operadriver().setup();
<ide> break;
<ide>
<ide> case "firefox":
<del> FirefoxDriverManager.getInstance().setup();
<add> case "firefox_headless":
<add> WebDriverManager.firefoxdriver().arch64().setup();
<ide> break;
<ide>
<ide> case "ie":
<ide> case "internet explorer":
<del> InternetExplorerDriverManager.getInstance().setup();
<add> WebDriverManager.iedriver().setup();
<ide> break;
<ide>
<ide> case "edge":
<del> EdgeDriverManager.getInstance().setup();
<add> WebDriverManager.edgedriver().setup();
<ide> break;
<ide>
<ide> case "ghost":
<ide> case "phantom":
<del> PhantomJsDriverManager.getInstance().setup();
<del> break;
<del>
<del> case "safari":
<add> WebDriverManager.phantomjs().setup();
<ide> break;
<ide>
<ide> default:
<ide> VideoRecorder.conf()
<ide> .withVideoFolder("./src/test/resources/Videos") // Default is ${user.dir}/video.
<ide> .videoEnabled(true) // Disabled video globally
<del> .withVideoSaveMode(VideoSaveMode.FAILED_ONLY) // Save videos ONLY FAILED tests
<add> .withVideoSaveMode(VideoSaveMode.FAILED_ONLY) // Save videos ONLY FAILED tests
<ide> .withRecorderType(RecorderType.MONTE) // Monte is Default recorder
<del> .withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
<add> .withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
<ide> }
<ide>
<ide> public void setupVideoRecordingAll() throws Exception
<ide> .videoEnabled(true) // Disabled video globally
<ide> .withVideoSaveMode(VideoSaveMode.ALL) // Save videos All tests
<ide> .withRecorderType(RecorderType.MONTE) // Monte is Default recorder
<del> .withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
<add> .withRecordMode(RecordingMode.ALL) ; // Record video only for tests with @Video
<ide> }
<ide>
<ide> public void setWebDriver(WebDriver driver) |
|
Java | apache-2.0 | 49049e2df95b6a0bf7f5e15637b19efccf6e5f52 | 0 | apache/commons-functor,apache/commons-functor | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.commons.functor.core.comparator;
import java.io.Serializable;
import java.util.Comparator;
import org.apache.commons.functor.BinaryPredicate;
import org.apache.commons.functor.UnaryPredicate;
import org.apache.commons.functor.adapter.RightBoundPredicate;
/**
* A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
* <code>true</code> iff the left argument is greater than or equal
* to the right argument under the specified {@link Comparator}.
* When no (or a <code>null</code> <code>Comparator</code> is specified,
* a {@link Comparable Comparable} <code>Comparator</code> is used.
*
* @param <T> the binary predicate input types
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
public final class IsGreaterThanOrEqual<T> implements BinaryPredicate<T, T>, Serializable {
/**
* Basic IsGreaterThanOrEqual instance.
*/
public static final IsGreaterThanOrEqual<Comparable<?>> INSTANCE = IsGreaterThanOrEqual
.<Comparable<?>> instance();
/**
* serialVersionUID declaration.
*/
private static final long serialVersionUID = 5262405026444050167L;
/**
* The wrapped comparator.
*/
private final Comparator<? super T> comparator;
/**
* Construct a <code>IsGreaterThanOrEqual</code> {@link BinaryPredicate predicate}
* for {@link Comparable Comparable}s.
*/
@SuppressWarnings("unchecked")
public IsGreaterThanOrEqual() {
this(ComparableComparator.INSTANCE);
}
/**
* Construct a <code>IsGreaterThanOrEqual</code> {@link BinaryPredicate predicate}
* for the given {@link Comparator Comparator}.
*
* @param comparator the {@link Comparator Comparator}, when <code>null</code>,
* a <code>Comparator</code> for {@link Comparable Comparable}s will
* be used.
*/
public IsGreaterThanOrEqual(Comparator<? super T> comparator) {
if (comparator == null) {
throw new IllegalArgumentException("Comparator argument must not be null");
}
this.comparator = comparator;
}
/**
* Return <code>true</code> iff the <i>left</i> parameter is
* greater than or equal to the <i>right</i> parameter under my current
* {@link Comparator Comparator}.
* {@inheritDoc}
*/
public boolean test(T left, T right) {
return comparator.compare(left, right) >= 0;
}
/**
* {@inheritDoc}
*/
public boolean equals(Object that) {
return that == this || (that instanceof IsGreaterThanOrEqual<?> && equals((IsGreaterThanOrEqual<?>) that));
}
/**
* Learn whether another IsGreaterThanOrEqual is equal to this.
* @param that IsGreaterThanOrEqual to test
* @return boolean
*/
public boolean equals(IsGreaterThanOrEqual<?> that) {
if (null != that) {
if (null == comparator) {
return null == that.comparator;
}
return comparator.equals(that.comparator);
}
return false;
}
/**
* {@inheritDoc}
*/
public int hashCode() {
int hash = "IsGreaterThanOrEqual".hashCode();
// by construction, comparator is never null
hash ^= comparator.hashCode();
return hash;
}
/**
* {@inheritDoc}
*/
public String toString() {
return "IsGreaterThanOrEqual<" + comparator + ">";
}
/**
* Get a typed IsGreaterThanOrEqual instance.
*
* @param <T> the binary predicate input types
* @return IsGreaterThanOrEqual<T>
*/
public static <T extends Comparable<?>> IsGreaterThanOrEqual<T> instance() {
return new IsGreaterThanOrEqual<T>();
}
/**
* Get an IsGreaterThanOrEqual UnaryPredicate.
*
* @param <T> the binary predicate input types
* @param right the right side object of the IsGreaterThanOrEqual comparison
* @return UnaryPredicate
*/
public static <T extends Comparable<?>> UnaryPredicate<T> instance(T right) {
return RightBoundPredicate.bind(new IsGreaterThanOrEqual<T>(), right);
}
}
| src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.commons.functor.core.comparator;
import java.io.Serializable;
import java.util.Comparator;
import org.apache.commons.functor.BinaryPredicate;
import org.apache.commons.functor.UnaryPredicate;
import org.apache.commons.functor.adapter.RightBoundPredicate;
/**
* A {@link BinaryPredicate BinaryPredicate} that {@link #test tests}
* <code>true</code> iff the left argument is greater than or equal
* to the right argument under the specified {@link Comparator}.
* When no (or a <code>null</code> <code>Comparator</code> is specified,
* a {@link Comparable Comparable} <code>Comparator</code> is used.
*
* @version $Revision$ $Date$
* @author Rodney Waldhoff
*/
public final class IsGreaterThanOrEqual<T> implements BinaryPredicate<T, T>, Serializable {
/**
* Basic IsGreaterThanOrEqual instance.
*/
public static final IsGreaterThanOrEqual<Comparable<?>> INSTANCE = IsGreaterThanOrEqual
.<Comparable<?>> instance();
/**
* serialVersionUID declaration.
*/
private static final long serialVersionUID = 5262405026444050167L;
private final Comparator<? super T> comparator;
/**
* Construct a <code>IsGreaterThanOrEqual</code> {@link BinaryPredicate predicate}
* for {@link Comparable Comparable}s.
*/
@SuppressWarnings("unchecked")
public IsGreaterThanOrEqual() {
this(ComparableComparator.INSTANCE);
}
/**
* Construct a <code>IsGreaterThanOrEqual</code> {@link BinaryPredicate predicate}
* for the given {@link Comparator Comparator}.
*
* @param comparator the {@link Comparator Comparator}, when <code>null</code>,
* a <code>Comparator</code> for {@link Comparable Comparable}s will
* be used.
*/
public IsGreaterThanOrEqual(Comparator<? super T> comparator) {
if (comparator == null) {
throw new IllegalArgumentException("Comparator argument must not be null");
}
this.comparator = comparator;
}
/**
* Return <code>true</code> iff the <i>left</i> parameter is
* greater than or equal to the <i>right</i> parameter under my current
* {@link Comparator Comparator}.
* {@inheritDoc}
*/
public boolean test(T left, T right) {
return comparator.compare(left, right) >= 0;
}
/**
* {@inheritDoc}
*/
public boolean equals(Object that) {
return that == this || (that instanceof IsGreaterThanOrEqual<?> && equals((IsGreaterThanOrEqual<?>) that));
}
/**
* Learn whether another IsGreaterThanOrEqual is equal to this.
* @param that IsGreaterThanOrEqual to test
* @return boolean
*/
public boolean equals(IsGreaterThanOrEqual<?> that) {
if (null != that) {
if (null == comparator) {
return null == that.comparator;
}
return comparator.equals(that.comparator);
}
return false;
}
/**
* {@inheritDoc}
*/
public int hashCode() {
int hash = "IsGreaterThanOrEqual".hashCode();
// by construction, comparator is never null
hash ^= comparator.hashCode();
return hash;
}
/**
* {@inheritDoc}
*/
public String toString() {
return "IsGreaterThanOrEqual<" + comparator + ">";
}
/**
* Get a typed IsGreaterThanOrEqual instance.
* @param <T>
* @return IsGreaterThanOrEqual<T>
*/
public static <T extends Comparable<?>> IsGreaterThanOrEqual<T> instance() {
return new IsGreaterThanOrEqual<T>();
}
/**
* Get an IsGreaterThanOrEqual UnaryPredicate.
* @param right the right side object of the IsGreaterThanOrEqual comparison
* @return UnaryPredicate
*/
public static <T extends Comparable<?>> UnaryPredicate<T> instance(T right) {
return RightBoundPredicate.bind(new IsGreaterThanOrEqual<T>(), right);
}
}
| added missing javadoc comments
git-svn-id: ed2019a869eb985a28c54e1debc86f0801f55061@1175255 13f79535-47bb-0310-9956-ffa450edef68
| src/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java | added missing javadoc comments | <ide><path>rc/main/java/org/apache/commons/functor/core/comparator/IsGreaterThanOrEqual.java
<ide> * When no (or a <code>null</code> <code>Comparator</code> is specified,
<ide> * a {@link Comparable Comparable} <code>Comparator</code> is used.
<ide> *
<add> * @param <T> the binary predicate input types
<ide> * @version $Revision$ $Date$
<ide> * @author Rodney Waldhoff
<ide> */
<ide> */
<ide> private static final long serialVersionUID = 5262405026444050167L;
<ide>
<add> /**
<add> * The wrapped comparator.
<add> */
<ide> private final Comparator<? super T> comparator;
<ide>
<ide> /**
<ide>
<ide> /**
<ide> * Get a typed IsGreaterThanOrEqual instance.
<del> * @param <T>
<add> *
<add> * @param <T> the binary predicate input types
<ide> * @return IsGreaterThanOrEqual<T>
<ide> */
<ide> public static <T extends Comparable<?>> IsGreaterThanOrEqual<T> instance() {
<ide>
<ide> /**
<ide> * Get an IsGreaterThanOrEqual UnaryPredicate.
<add> *
<add> * @param <T> the binary predicate input types
<ide> * @param right the right side object of the IsGreaterThanOrEqual comparison
<ide> * @return UnaryPredicate
<ide> */ |
|
Java | epl-1.0 | 0cee3ec571305b05ce40ba3f3016e9e09bc8a91d | 0 | miklossy/xtext-core,miklossy/xtext-core | /*******************************************************************************
* Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.xtext.parser.antlr;
import java.util.ArrayList;
import java.util.List;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenSource;
/**
* A token stream that is aware of the current lookahead.
*
* @author Jan Khnlein - Initial contribution and API
*/
public class XtextTokenStream extends CommonTokenStream {
private List<Token> lookaheadTokens = new ArrayList<Token>();
// private Map<Token, String> tokenErrorMap = new HashMap<Token, String>();
public XtextTokenStream() {
super();
}
public XtextTokenStream(TokenSource tokenSource, int channel) {
super(tokenSource, channel);
}
public XtextTokenStream(TokenSource tokenSource) {
super(tokenSource);
}
/*
* (non-Javadoc)
*
* @see org.antlr.runtime.CommonTokenStream#LA(int)
*/
@Override
public int LA(int i) {
Token lookaheadToken = LT(i);
if (!lookaheadTokens.contains(lookaheadToken)) {
lookaheadTokens.add(lookaheadToken);
}
return super.LA(i);
}
/**
* @return the lookaheadTokens
*/
public List<Token> getLookaheadTokens() {
return lookaheadTokens;
}
public void removeLastLookaheadToken() {
lookaheadTokens.remove(lookaheadTokens.size() - 1);
}
public void resetLookahead() {
lookaheadTokens.clear();
}
public String getLexerErrorMessage(Token invalidToken) {
if (tokenSource instanceof org.eclipse.xtext.parser.antlr.Lexer) {
return ((org.eclipse.xtext.parser.antlr.Lexer) tokenSource).getErrorMessage(invalidToken);
}
return (invalidToken.getType() == Token.INVALID_TOKEN_TYPE) ? "Invalid token " + invalidToken.getText() : null;
}
}
| plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/XtextTokenStream.java | /*******************************************************************************
* Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.xtext.parser.antlr;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenSource;
/**
* A token stream that is aware of the current lookahead.
*
* @author Jan Khnlein - Initial contribution and API
*/
public class XtextTokenStream extends CommonTokenStream {
private List<Token> lookaheadTokens = new ArrayList<Token>();
private Map<Token, String> tokenErrorMap = new HashMap<Token, String>();
public XtextTokenStream() {
super();
}
public XtextTokenStream(TokenSource tokenSource, int channel) {
super(tokenSource, channel);
}
public XtextTokenStream(TokenSource tokenSource) {
super(tokenSource);
}
/*
* (non-Javadoc)
*
* @see org.antlr.runtime.CommonTokenStream#LA(int)
*/
@Override
public int LA(int i) {
Token lookaheadToken = LT(i);
if (!lookaheadTokens.contains(lookaheadToken)) {
lookaheadTokens.add(lookaheadToken);
}
return super.LA(i);
}
/**
* @return the lookaheadTokens
*/
public List<Token> getLookaheadTokens() {
return lookaheadTokens;
}
public void removeLastLookaheadToken() {
lookaheadTokens.remove(lookaheadTokens.size() - 1);
}
public void resetLookahead() {
lookaheadTokens.clear();
}
public String getLexerErrorMessage(Token invalidToken) {
if (tokenSource instanceof org.eclipse.xtext.parser.antlr.Lexer) {
return ((org.eclipse.xtext.parser.antlr.Lexer) tokenSource).getErrorMessage(invalidToken);
}
return (invalidToken.getType() == Token.INVALID_TOKEN_TYPE) ? "Invalid token " + invalidToken.getText() : null;
}
}
| removed unused private member
| plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/XtextTokenStream.java | removed unused private member | <ide><path>lugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/XtextTokenStream.java
<ide> package org.eclipse.xtext.parser.antlr;
<ide>
<ide> import java.util.ArrayList;
<del>import java.util.HashMap;
<ide> import java.util.List;
<del>import java.util.Map;
<ide>
<ide> import org.antlr.runtime.CommonTokenStream;
<ide> import org.antlr.runtime.Token;
<ide>
<ide> private List<Token> lookaheadTokens = new ArrayList<Token>();
<ide>
<del> private Map<Token, String> tokenErrorMap = new HashMap<Token, String>();
<add>// private Map<Token, String> tokenErrorMap = new HashMap<Token, String>();
<ide>
<ide> public XtextTokenStream() {
<ide> super(); |
|
Java | apache-2.0 | 9b58c6c59326d869d369d3d050cf217633934637 | 0 | google/ground-android,google/ground-android,google/ground-android | /*
* Copyright 2018 Google LLC
*
* 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
*
* https://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.
*/
package com.google.android.gnd.ui.home;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static androidx.navigation.fragment.NavHostFragment.findNavController;
import static com.google.android.gnd.rx.RxAutoDispose.autoDisposable;
import static com.google.android.gnd.ui.util.ViewUtil.getScreenHeight;
import static com.google.android.gnd.ui.util.ViewUtil.getScreenWidth;
import static java.util.Objects.requireNonNull;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.FrameLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.GravityCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavDestination;
import com.akaita.java.rxjava2debug.RxJava2Debug;
import com.google.android.gnd.BuildConfig;
import com.google.android.gnd.MainActivity;
import com.google.android.gnd.MainViewModel;
import com.google.android.gnd.R;
import com.google.android.gnd.databinding.HomeScreenFragBinding;
import com.google.android.gnd.databinding.NavDrawerHeaderBinding;
import com.google.android.gnd.model.Project;
import com.google.android.gnd.model.feature.Feature;
import com.google.android.gnd.model.feature.GeoJsonFeature;
import com.google.android.gnd.model.feature.Point;
import com.google.android.gnd.model.form.Form;
import com.google.android.gnd.model.layer.Layer;
import com.google.android.gnd.repository.FeatureRepository;
import com.google.android.gnd.rx.Loadable;
import com.google.android.gnd.rx.Schedulers;
import com.google.android.gnd.system.auth.AuthenticationManager;
import com.google.android.gnd.ui.common.AbstractFragment;
import com.google.android.gnd.ui.common.BackPressListener;
import com.google.android.gnd.ui.common.EphemeralPopups;
import com.google.android.gnd.ui.common.FeatureHelper;
import com.google.android.gnd.ui.common.Navigator;
import com.google.android.gnd.ui.common.ProgressDialogs;
import com.google.android.gnd.ui.home.featureselector.FeatureSelectorViewModel;
import com.google.android.gnd.ui.home.mapcontainer.FeatureDataTypeSelectorDialogFragment;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerFragment;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerViewModel;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerViewModel.Mode;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingInfoDialogFragment;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingViewModel;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingViewModel.PolygonDrawingState;
import com.google.android.gnd.ui.projectselector.ProjectSelectorViewModel;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener;
import com.google.common.collect.ImmutableList;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java8.util.Optional;
import javax.inject.Inject;
import org.json.JSONException;
import org.json.JSONObject;
import timber.log.Timber;
/**
* Fragment containing the map container and feature sheet fragments and NavigationView side drawer.
* This is the default view in the application, and gets swapped out for other fragments (e.g., view
* observation and edit observation) at runtime.
*/
@AndroidEntryPoint
public class HomeScreenFragment extends AbstractFragment
implements BackPressListener, OnNavigationItemSelectedListener, OnGlobalLayoutListener {
// TODO: It's not obvious which feature are in HomeScreen vs MapContainer; make this more
// intuitive.
private static final float COLLAPSED_MAP_ASPECT_RATIO = 3.0f / 2.0f;
@Inject AddFeatureDialogFragment addFeatureDialogFragment;
@Inject AuthenticationManager authenticationManager;
@Inject Schedulers schedulers;
@Inject Navigator navigator;
@Inject EphemeralPopups popups;
@Inject FeatureHelper featureHelper;
@Inject FeatureRepository featureRepository;
MapContainerViewModel mapContainerViewModel;
PolygonDrawingViewModel polygonDrawingViewModel;
@Nullable private ProgressDialog progressDialog;
private HomeScreenViewModel viewModel;
private MapContainerFragment mapContainerFragment;
private BottomSheetBehavior<View> bottomSheetBehavior;
@Nullable private FeatureDataTypeSelectorDialogFragment featureDataTypeSelectorDialogFragment;
@Nullable private PolygonDrawingInfoDialogFragment polygonDrawingInfoDialogFragment;
private ProjectSelectorViewModel projectSelectorViewModel;
private FeatureSelectorViewModel featureSelectorViewModel;
private List<Project> projects = Collections.emptyList();
private HomeScreenFragBinding binding;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getViewModel(MainViewModel.class).getWindowInsets().observe(this, this::onApplyWindowInsets);
mapContainerViewModel = getViewModel(MapContainerViewModel.class);
polygonDrawingViewModel = getViewModel(PolygonDrawingViewModel.class);
projectSelectorViewModel = getViewModel(ProjectSelectorViewModel.class);
featureSelectorViewModel = getViewModel(FeatureSelectorViewModel.class);
viewModel = getViewModel(HomeScreenViewModel.class);
viewModel.getProjectLoadingState().observe(this, this::onActiveProjectChange);
viewModel.getBottomSheetState().observe(this, this::onBottomSheetStateChange);
viewModel
.getShowFeatureSelectorRequests()
.as(autoDisposable(this))
.subscribe(this::showFeatureSelector);
viewModel.getOpenDrawerRequests().as(autoDisposable(this)).subscribe(__ -> openDrawer());
viewModel
.getAddFeatureResults()
.observeOn(schedulers.ui())
.as(autoDisposable(this))
.subscribe(this::onFeatureAdded);
viewModel.getUpdateFeatureResults().as(autoDisposable(this)).subscribe(this::onFeatureUpdated);
viewModel.getDeleteFeatureResults().as(autoDisposable(this)).subscribe(this::onFeatureDeleted);
viewModel.getErrors().as(autoDisposable(this)).subscribe(this::onError);
polygonDrawingViewModel
.getDrawingState()
.distinctUntilChanged()
.as(autoDisposable(this))
.subscribe(this::onPolygonDrawingStateUpdated);
featureSelectorViewModel
.getFeatureClicks()
.as(autoDisposable(this))
.subscribe(viewModel::onFeatureSelected);
mapContainerViewModel
.getAddFeatureButtonClicks()
.as(autoDisposable(this))
.subscribe(viewModel::onAddFeatureButtonClick);
viewModel
.getShowAddFeatureDialogRequests()
.as(autoDisposable(this))
.subscribe(args -> showAddFeatureLayerSelector(args.first, args.second));
}
private void onPolygonDrawingStateUpdated(PolygonDrawingState state) {
Timber.v("PolygonDrawing state : %s", state);
if (state.isInProgress()) {
mapContainerViewModel.setMode(Mode.DRAW_POLYGON);
} else {
mapContainerViewModel.setMode(Mode.DEFAULT);
if (state.isCompleted()) {
viewModel.addPolygonFeature(requireNonNull(state.getUnsavedPolygonFeature()));
}
}
}
private void showAddFeatureLayerSelector(ImmutableList<Layer> layers, Point mapCenter) {
// Skip layer selection if there's only one layer to which the user can add features.
// TODO: Refactor and move logic into view model.
if (layers.size() == 1) {
onAddFeatureLayerSelected(layers.get(0), mapCenter);
return;
}
addFeatureDialogFragment.show(
layers, getChildFragmentManager(), layer -> onAddFeatureLayerSelected(layer, mapCenter));
}
private void onAddFeatureLayerSelected(Layer layer, Point mapCenter) {
if (layer.getUserCanAdd().isEmpty()) {
Timber.e(
"User cannot add features to layer %s - layer list should not have been shown",
layer.getId());
return;
}
if (layer.getUserCanAdd().size() > 1) {
showAddFeatureTypeSelector(layer, mapCenter);
return;
}
switch (layer.getUserCanAdd().get(0)) {
case POINT:
viewModel.addFeature(layer, mapCenter);
break;
case POLYGON:
if (featureRepository.isPolygonDialogInfoShown()) {
startPolygonDrawing(layer);
} else {
showPolygonInfoDialog(layer);
}
break;
default:
Timber.w("Unsupported feature type defined in layer: %s", layer.getUserCanAdd().get(0));
break;
}
}
private void showFeatureSelector(ImmutableList<Feature> features) {
featureSelectorViewModel.setFeatures(features);
navigator.navigate(
HomeScreenFragmentDirections.actionHomeScreenFragmentToFeatureSelectorFragment());
}
private void onFeatureAdded(Feature feature) {
feature.getLayer().getForm().ifPresent(form -> addNewObservation(feature, form));
}
private void addNewObservation(Feature feature, Form form) {
String projectId = feature.getProject().getId();
String featureId = feature.getId();
String formId = form.getId();
navigator.navigate(HomeScreenFragmentDirections.addObservation(projectId, featureId, formId));
}
/** This is only possible after updating the location of the feature. So, reset the UI. */
private void onFeatureUpdated(Boolean result) {
if (result) {
mapContainerViewModel.setMode(Mode.DEFAULT);
}
}
private void onFeatureDeleted(Boolean result) {
if (result) {
// TODO: Re-position map to default location after successful deletion.
hideBottomSheet();
}
}
/** Generic handler to display error messages to the user. */
private void onError(Throwable throwable) {
Timber.e(throwable);
// Don't display the exact error message as it might not be user-readable.
Toast.makeText(getContext(), R.string.error_occurred, Toast.LENGTH_SHORT).show();
}
@Nullable
@Override
public View onCreateView(
LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
binding = HomeScreenFragBinding.inflate(inflater, container, false);
binding.featureDetailsChrome.setViewModel(viewModel);
binding.setLifecycleOwner(this);
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.versionText.setText(String.format(getString(R.string.build), BuildConfig.VERSION_NAME));
// Ensure nav drawer cannot be swiped out, which would conflict with map pan gestures.
binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
binding.navView.setNavigationItemSelectedListener(this);
getView().getViewTreeObserver().addOnGlobalLayoutListener(this);
if (savedInstanceState == null) {
mapContainerFragment = new MapContainerFragment();
replaceFragment(R.id.map_container_fragment, mapContainerFragment);
} else {
mapContainerFragment = restoreChildFragment(savedInstanceState, MapContainerFragment.class);
}
updateNavHeader();
setUpBottomSheetBehavior();
}
private void updateNavHeader() {
View navHeader = binding.navView.getHeaderView(0);
NavDrawerHeaderBinding headerBinding = NavDrawerHeaderBinding.bind(navHeader);
headerBinding.setUser(authenticationManager.getCurrentUser());
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
saveChildFragment(outState, mapContainerFragment, MapContainerFragment.class.getName());
}
/** Fetches offline saved projects and adds them to navigation drawer. */
private void updateNavDrawer() {
projectSelectorViewModel
.getOfflineProjects()
.subscribeOn(schedulers.io())
.observeOn(schedulers.ui())
.as(autoDisposable(this))
.subscribe(this::addProjectToNavDrawer);
}
private MenuItem getProjectsNavItem() {
// Below index is the order of the projects item in nav_drawer_menu.xml
return binding.navView.getMenu().getItem(1);
}
private void addProjectToNavDrawer(List<Project> projects) {
this.projects = projects;
// clear last saved projects list
getProjectsNavItem().getSubMenu().removeGroup(R.id.group_join_project);
for (int index = 0; index < projects.size(); index++) {
getProjectsNavItem()
.getSubMenu()
.add(R.id.group_join_project, Menu.NONE, index, projects.get(index).getTitle())
.setIcon(R.drawable.ic_menu_project);
}
// Highlight active project
Loadable.getValue(viewModel.getProjectLoadingState())
.ifPresent(project -> updateSelectedProjectUI(getSelectedProjectIndex(project)));
}
@Override
public void onGlobalLayout() {
FrameLayout bottomSheetHeader = binding.getRoot().findViewById(R.id.bottom_sheet_header);
if (bottomSheetBehavior == null || bottomSheetHeader == null) {
return;
}
bottomSheetBehavior.setFitToContents(false);
// When the bottom sheet is expanded, the bottom edge of the header needs to be aligned with
// the bottom edge of the toolbar (the header slides up under it).
BottomSheetMetrics metrics = new BottomSheetMetrics(binding.bottomSheetLayout);
bottomSheetBehavior.setExpandedOffset(metrics.getExpandedOffset());
getView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
private void setUpBottomSheetBehavior() {
bottomSheetBehavior = BottomSheetBehavior.from(binding.bottomSheetLayout);
bottomSheetBehavior.setHideable(true);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetCallback());
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
((MainActivity) getActivity()).setActionBar(binding.featureDetailsChrome.toolbar, false);
}
private void openDrawer() {
binding.drawerLayout.openDrawer(GravityCompat.START);
}
private void closeDrawer() {
binding.drawerLayout.closeDrawer(GravityCompat.START);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
BottomSheetState state = viewModel.getBottomSheetState().getValue();
if (state == null) {
Timber.e("BottomSheetState is null");
return false;
}
if (item.getItemId() == R.id.move_feature_menu_item) {
hideBottomSheet();
mapContainerViewModel.setMode(Mode.MOVE_POINT);
mapContainerViewModel.setReposFeature(state.getFeature());
Toast.makeText(getContext(), R.string.move_point_hint, Toast.LENGTH_SHORT).show();
} else if (item.getItemId() == R.id.delete_feature_menu_item) {
Optional<Feature> featureToDelete = state.getFeature();
if (featureToDelete.isPresent()) {
new Builder(requireActivity())
.setTitle(
getString(
R.string.feature_delete_confirmation_dialog_title,
featureHelper.getLabel(featureToDelete)))
.setMessage(R.string.feature_delete_confirmation_dialog_message)
.setPositiveButton(
R.string.delete_button_label,
(dialog, id) -> {
hideBottomSheet();
viewModel.deleteFeature(featureToDelete.get());
})
.setNegativeButton(
R.string.cancel_button_label,
(dialog, id) -> {
// Do nothing.
})
.create()
.show();
} else {
Timber.e("Attempted to delete non-existent feature");
}
} else if (item.getItemId() == R.id.feature_properties_menu_item) {
showFeatureProperties();
} else {
return false;
}
return true;
}
@Override
public void onStart() {
super.onStart();
if (viewModel.shouldShowProjectSelectorOnStart()) {
showProjectSelector();
}
viewModel.init();
}
@Override
public void onStop() {
super.onStop();
if (featureDataTypeSelectorDialogFragment != null
&& featureDataTypeSelectorDialogFragment.isVisible()) {
featureDataTypeSelectorDialogFragment.dismiss();
}
if (polygonDrawingInfoDialogFragment != null && polygonDrawingInfoDialogFragment.isVisible()) {
polygonDrawingInfoDialogFragment.dismiss();
}
}
private int getCurrentDestinationId() {
NavDestination currentDestination = findNavController(this).getCurrentDestination();
return currentDestination == null ? -1 : currentDestination.getId();
}
private void showProjectSelector() {
if (getCurrentDestinationId() != R.id.projectSelectorDialogFragment) {
navigator.navigate(
HomeScreenFragmentDirections.actionHomeScreenFragmentToProjectSelectorDialogFragment());
}
}
private void showOfflineAreas() {
viewModel.showOfflineAreas();
}
private void onApplyWindowInsets(WindowInsetsCompat insets) {
binding.featureDetailsChrome.toolbarWrapper.setPadding(
0, insets.getSystemWindowInsetTop(), 0, 0);
binding.featureDetailsChrome.bottomSheetBottomInsetScrim.setMinimumHeight(
insets.getSystemWindowInsetBottom());
updateNavViewInsets(insets);
updateBottomSheetPeekHeight(insets);
}
private void updateNavViewInsets(WindowInsetsCompat insets) {
View headerView = binding.navView.getHeaderView(0);
headerView.setPadding(0, insets.getSystemWindowInsetTop(), 0, 0);
}
private void updateBottomSheetPeekHeight(WindowInsetsCompat insets) {
double width =
getScreenWidth(getActivity())
+ insets.getSystemWindowInsetLeft()
+ insets.getSystemWindowInsetRight();
double height =
getScreenHeight(getActivity())
+ insets.getSystemWindowInsetTop()
+ insets.getSystemWindowInsetBottom();
double mapHeight = 0;
if (getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT) {
mapHeight = width / COLLAPSED_MAP_ASPECT_RATIO;
} else if (getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE) {
mapHeight = height / COLLAPSED_MAP_ASPECT_RATIO;
}
double peekHeight = height - mapHeight;
bottomSheetBehavior.setPeekHeight((int) peekHeight);
}
private void onActiveProjectChange(Loadable<Project> project) {
switch (project.getState()) {
case NOT_LOADED:
dismissLoadingDialog();
break;
case LOADED:
dismissLoadingDialog();
updateNavDrawer();
break;
case LOADING:
showProjectLoadingDialog();
break;
case NOT_FOUND:
case ERROR:
project.error().ifPresent(this::onActivateProjectFailure);
break;
default:
Timber.e("Unhandled case: %s", project.getState());
break;
}
}
private void updateSelectedProjectUI(int selectedIndex) {
SubMenu subMenu = getProjectsNavItem().getSubMenu();
for (int i = 0; i < projects.size(); i++) {
MenuItem menuItem = subMenu.getItem(i);
menuItem.setChecked(i == selectedIndex);
}
}
private int getSelectedProjectIndex(Project activeProject) {
for (Project project : projects) {
if (project.getId().equals(activeProject.getId())) {
return projects.indexOf(project);
}
}
Timber.e("Selected project not found.");
return -1;
}
private void onBottomSheetStateChange(BottomSheetState state) {
switch (state.getVisibility()) {
case VISIBLE:
showBottomSheet();
break;
case HIDDEN:
hideBottomSheet();
break;
default:
Timber.e("Unhandled visibility: %s", state.getVisibility());
break;
}
}
private void showBottomSheet() {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
private void hideBottomSheet() {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
private void showProjectLoadingDialog() {
if (progressDialog == null) {
progressDialog =
ProgressDialogs.modalSpinner(getContext(), R.string.project_loading_please_wait);
progressDialog.show();
}
}
private void showAddFeatureTypeSelector(Layer layer, Point point) {
featureDataTypeSelectorDialogFragment =
new FeatureDataTypeSelectorDialogFragment(
featureType -> {
if (featureType == 0) {
viewModel.addFeature(layer, point);
} else if (featureType == 1) {
if (featureRepository.isPolygonDialogInfoShown()) {
startPolygonDrawing(layer);
} else {
showPolygonInfoDialog(layer);
}
}
});
featureDataTypeSelectorDialogFragment.show(
getChildFragmentManager(), FeatureDataTypeSelectorDialogFragment.class.getSimpleName());
}
private void startPolygonDrawing(Layer layer) {
viewModel
.getActiveProject()
.ifPresentOrElse(
project -> polygonDrawingViewModel.startDrawingFlow(project, layer),
() -> Timber.e("No active project"));
}
private void showPolygonInfoDialog(Layer layer) {
featureRepository.setPolygonDialogInfoShown(true);
polygonDrawingInfoDialogFragment =
new PolygonDrawingInfoDialogFragment(() -> startPolygonDrawing(layer));
polygonDrawingInfoDialogFragment.show(
getChildFragmentManager(), PolygonDrawingInfoDialogFragment.class.getName());
}
public void dismissLoadingDialog() {
if (progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
}
@Override
public boolean onBack() {
if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) {
return false;
} else {
hideBottomSheet();
return true;
}
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getGroupId() == R.id.group_join_project) {
Project selectedProject = projects.get(item.getOrder());
projectSelectorViewModel.activateOfflineProject(selectedProject.getId());
} else if (item.getItemId() == R.id.nav_join_project) {
showProjectSelector();
} else if (item.getItemId() == R.id.sync_status) {
viewModel.showSyncStatus();
} else if (item.getItemId() == R.id.nav_offline_areas) {
showOfflineAreas();
} else if (item.getItemId() == R.id.nav_settings) {
viewModel.showSettings();
} else if (item.getItemId() == R.id.nav_sign_out) {
authenticationManager.signOut();
}
closeDrawer();
return true;
}
private void onActivateProjectFailure(Throwable throwable) {
Timber.e(RxJava2Debug.getEnhancedStackTrace(throwable), "Error activating project");
dismissLoadingDialog();
popups.showError(R.string.project_load_error);
showProjectSelector();
}
private void showFeatureProperties() {
// TODO(#841): Move business logic into view model.
BottomSheetState state = viewModel.getBottomSheetState().getValue();
if (state == null) {
Timber.e("BottomSheetState is null");
return;
}
if (state.getFeature().isEmpty()) {
Timber.e("No feature selected");
return;
}
Feature feature = state.getFeature().get();
List<String> items = new ArrayList<>();
// TODO(#843): Let properties apply to other feature types as well.
if (feature instanceof GeoJsonFeature) {
items = getFeatureProperties((GeoJsonFeature) feature);
}
if (items.isEmpty()) {
items.add("No properties defined for this feature");
}
new AlertDialog.Builder(requireContext())
.setCancelable(true)
.setTitle(R.string.feature_properties)
// TODO(#842): Use custom view to format feature properties as table.
.setItems(items.toArray(new String[] {}), (a, b) -> {})
.setPositiveButton(R.string.close_feature_properties, (a, b) -> {})
.create()
.show();
}
private ImmutableList<String> getFeatureProperties(GeoJsonFeature feature) {
String jsonString = feature.getGeoJsonString();
try {
JSONObject jsonObject = new JSONObject(jsonString);
JSONObject properties = jsonObject.optJSONObject("properties");
if (properties == null) {
return ImmutableList.of();
}
ImmutableList.Builder items = new ImmutableList.Builder();
Iterator<String> keyIter = properties.keys();
while (keyIter.hasNext()) {
String key = keyIter.next();
Object value = properties.opt(key);
// TODO(#842): Use custom view to format feature properties as table.
items.add(key + ": " + value);
}
return items.build();
} catch (JSONException e) {
Timber.d("Encountered invalid feature GeoJSON in feature %s", feature.getId());
return ImmutableList.of();
}
}
private class BottomSheetCallback extends BottomSheetBehavior.BottomSheetCallback {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
viewModel.onBottomSheetHidden();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
// no-op.
}
}
}
| gnd/src/main/java/com/google/android/gnd/ui/home/HomeScreenFragment.java | /*
* Copyright 2018 Google LLC
*
* 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
*
* https://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.
*/
package com.google.android.gnd.ui.home;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static com.google.android.gnd.rx.RxAutoDispose.autoDisposable;
import static com.google.android.gnd.ui.util.ViewUtil.getScreenHeight;
import static com.google.android.gnd.ui.util.ViewUtil.getScreenWidth;
import static java.util.Objects.requireNonNull;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.FrameLayout;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.GravityCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import com.akaita.java.rxjava2debug.RxJava2Debug;
import com.google.android.gnd.BuildConfig;
import com.google.android.gnd.MainActivity;
import com.google.android.gnd.MainViewModel;
import com.google.android.gnd.R;
import com.google.android.gnd.databinding.HomeScreenFragBinding;
import com.google.android.gnd.databinding.NavDrawerHeaderBinding;
import com.google.android.gnd.model.Project;
import com.google.android.gnd.model.feature.Feature;
import com.google.android.gnd.model.feature.GeoJsonFeature;
import com.google.android.gnd.model.feature.Point;
import com.google.android.gnd.model.form.Form;
import com.google.android.gnd.model.layer.Layer;
import com.google.android.gnd.repository.FeatureRepository;
import com.google.android.gnd.rx.Loadable;
import com.google.android.gnd.rx.Schedulers;
import com.google.android.gnd.system.auth.AuthenticationManager;
import com.google.android.gnd.ui.common.AbstractFragment;
import com.google.android.gnd.ui.common.BackPressListener;
import com.google.android.gnd.ui.common.EphemeralPopups;
import com.google.android.gnd.ui.common.FeatureHelper;
import com.google.android.gnd.ui.common.Navigator;
import com.google.android.gnd.ui.common.ProgressDialogs;
import com.google.android.gnd.ui.home.featureselector.FeatureSelectorViewModel;
import com.google.android.gnd.ui.home.mapcontainer.FeatureDataTypeSelectorDialogFragment;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerFragment;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerViewModel;
import com.google.android.gnd.ui.home.mapcontainer.MapContainerViewModel.Mode;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingInfoDialogFragment;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingViewModel;
import com.google.android.gnd.ui.home.mapcontainer.PolygonDrawingViewModel.PolygonDrawingState;
import com.google.android.gnd.ui.projectselector.ProjectSelectorViewModel;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener;
import com.google.common.collect.ImmutableList;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java8.util.Optional;
import javax.inject.Inject;
import org.json.JSONException;
import org.json.JSONObject;
import timber.log.Timber;
/**
* Fragment containing the map container and feature sheet fragments and NavigationView side drawer.
* This is the default view in the application, and gets swapped out for other fragments (e.g., view
* observation and edit observation) at runtime.
*/
@AndroidEntryPoint
public class HomeScreenFragment extends AbstractFragment
implements BackPressListener, OnNavigationItemSelectedListener, OnGlobalLayoutListener {
// TODO: It's not obvious which feature are in HomeScreen vs MapContainer; make this more
// intuitive.
private static final float COLLAPSED_MAP_ASPECT_RATIO = 3.0f / 2.0f;
@Inject AddFeatureDialogFragment addFeatureDialogFragment;
@Inject AuthenticationManager authenticationManager;
@Inject Schedulers schedulers;
@Inject Navigator navigator;
@Inject EphemeralPopups popups;
@Inject FeatureHelper featureHelper;
@Inject FeatureRepository featureRepository;
MapContainerViewModel mapContainerViewModel;
PolygonDrawingViewModel polygonDrawingViewModel;
@Nullable private ProgressDialog progressDialog;
private HomeScreenViewModel viewModel;
private MapContainerFragment mapContainerFragment;
private BottomSheetBehavior<View> bottomSheetBehavior;
@Nullable private FeatureDataTypeSelectorDialogFragment featureDataTypeSelectorDialogFragment;
@Nullable private PolygonDrawingInfoDialogFragment polygonDrawingInfoDialogFragment;
private ProjectSelectorViewModel projectSelectorViewModel;
private FeatureSelectorViewModel featureSelectorViewModel;
private List<Project> projects = Collections.emptyList();
private HomeScreenFragBinding binding;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getViewModel(MainViewModel.class).getWindowInsets().observe(this, this::onApplyWindowInsets);
mapContainerViewModel = getViewModel(MapContainerViewModel.class);
polygonDrawingViewModel = getViewModel(PolygonDrawingViewModel.class);
projectSelectorViewModel = getViewModel(ProjectSelectorViewModel.class);
featureSelectorViewModel = getViewModel(FeatureSelectorViewModel.class);
viewModel = getViewModel(HomeScreenViewModel.class);
viewModel.getProjectLoadingState().observe(this, this::onActiveProjectChange);
viewModel.getBottomSheetState().observe(this, this::onBottomSheetStateChange);
viewModel
.getShowFeatureSelectorRequests()
.as(autoDisposable(this))
.subscribe(this::showFeatureSelector);
viewModel.getOpenDrawerRequests().as(autoDisposable(this)).subscribe(__ -> openDrawer());
viewModel
.getAddFeatureResults()
.observeOn(schedulers.ui())
.as(autoDisposable(this))
.subscribe(this::onFeatureAdded);
viewModel.getUpdateFeatureResults().as(autoDisposable(this)).subscribe(this::onFeatureUpdated);
viewModel.getDeleteFeatureResults().as(autoDisposable(this)).subscribe(this::onFeatureDeleted);
viewModel.getErrors().as(autoDisposable(this)).subscribe(this::onError);
polygonDrawingViewModel
.getDrawingState()
.distinctUntilChanged()
.as(autoDisposable(this))
.subscribe(this::onPolygonDrawingStateUpdated);
featureSelectorViewModel
.getFeatureClicks()
.as(autoDisposable(this))
.subscribe(viewModel::onFeatureSelected);
mapContainerViewModel
.getAddFeatureButtonClicks()
.as(autoDisposable(this))
.subscribe(viewModel::onAddFeatureButtonClick);
viewModel
.getShowAddFeatureDialogRequests()
.as(autoDisposable(this))
.subscribe(args -> showAddFeatureLayerSelector(args.first, args.second));
}
private void onPolygonDrawingStateUpdated(PolygonDrawingState state) {
Timber.v("PolygonDrawing state : %s", state);
if (state.isInProgress()) {
mapContainerViewModel.setMode(Mode.DRAW_POLYGON);
} else {
mapContainerViewModel.setMode(Mode.DEFAULT);
if (state.isCompleted()) {
viewModel.addPolygonFeature(requireNonNull(state.getUnsavedPolygonFeature()));
}
}
}
private void showAddFeatureLayerSelector(ImmutableList<Layer> layers, Point mapCenter) {
// Skip layer selection if there's only one layer to which the user can add features.
// TODO: Refactor and move logic into view model.
if (layers.size() == 1) {
onAddFeatureLayerSelected(layers.get(0), mapCenter);
return;
}
addFeatureDialogFragment.show(
layers, getChildFragmentManager(), layer -> onAddFeatureLayerSelected(layer, mapCenter));
}
private void onAddFeatureLayerSelected(Layer layer, Point mapCenter) {
if (layer.getUserCanAdd().isEmpty()) {
Timber.e(
"User cannot add features to layer %s - layer list should not have been shown",
layer.getId());
return;
}
if (layer.getUserCanAdd().size() > 1) {
showAddFeatureTypeSelector(layer, mapCenter);
return;
}
switch (layer.getUserCanAdd().get(0)) {
case POINT:
viewModel.addFeature(layer, mapCenter);
break;
case POLYGON:
if (featureRepository.isPolygonDialogInfoShown()) {
startPolygonDrawing(layer);
} else {
showPolygonInfoDialog(layer);
}
break;
default:
Timber.w("Unsupported feature type defined in layer: %s", layer.getUserCanAdd().get(0));
break;
}
}
private void showFeatureSelector(ImmutableList<Feature> features) {
featureSelectorViewModel.setFeatures(features);
navigator.navigate(
HomeScreenFragmentDirections.actionHomeScreenFragmentToFeatureSelectorFragment());
}
private void onFeatureAdded(Feature feature) {
feature.getLayer().getForm().ifPresent(form -> addNewObservation(feature, form));
}
private void addNewObservation(Feature feature, Form form) {
String projectId = feature.getProject().getId();
String featureId = feature.getId();
String formId = form.getId();
navigator.navigate(HomeScreenFragmentDirections.addObservation(projectId, featureId, formId));
}
/** This is only possible after updating the location of the feature. So, reset the UI. */
private void onFeatureUpdated(Boolean result) {
if (result) {
mapContainerViewModel.setMode(Mode.DEFAULT);
}
}
private void onFeatureDeleted(Boolean result) {
if (result) {
// TODO: Re-position map to default location after successful deletion.
hideBottomSheet();
}
}
/** Generic handler to display error messages to the user. */
private void onError(Throwable throwable) {
Timber.e(throwable);
// Don't display the exact error message as it might not be user-readable.
Toast.makeText(getContext(), R.string.error_occurred, Toast.LENGTH_SHORT).show();
}
@Nullable
@Override
public View onCreateView(
LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
binding = HomeScreenFragBinding.inflate(inflater, container, false);
binding.featureDetailsChrome.setViewModel(viewModel);
binding.setLifecycleOwner(this);
return binding.getRoot();
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
binding.versionText.setText(String.format(getString(R.string.build), BuildConfig.VERSION_NAME));
// Ensure nav drawer cannot be swiped out, which would conflict with map pan gestures.
binding.drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
binding.navView.setNavigationItemSelectedListener(this);
getView().getViewTreeObserver().addOnGlobalLayoutListener(this);
if (savedInstanceState == null) {
mapContainerFragment = new MapContainerFragment();
replaceFragment(R.id.map_container_fragment, mapContainerFragment);
} else {
mapContainerFragment = restoreChildFragment(savedInstanceState, MapContainerFragment.class);
}
updateNavHeader();
setUpBottomSheetBehavior();
}
private void updateNavHeader() {
View navHeader = binding.navView.getHeaderView(0);
NavDrawerHeaderBinding headerBinding = NavDrawerHeaderBinding.bind(navHeader);
headerBinding.setUser(authenticationManager.getCurrentUser());
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
saveChildFragment(outState, mapContainerFragment, MapContainerFragment.class.getName());
}
/** Fetches offline saved projects and adds them to navigation drawer. */
private void updateNavDrawer() {
projectSelectorViewModel
.getOfflineProjects()
.subscribeOn(schedulers.io())
.observeOn(schedulers.ui())
.as(autoDisposable(this))
.subscribe(this::addProjectToNavDrawer);
}
private MenuItem getProjectsNavItem() {
// Below index is the order of the projects item in nav_drawer_menu.xml
return binding.navView.getMenu().getItem(1);
}
private void addProjectToNavDrawer(List<Project> projects) {
this.projects = projects;
// clear last saved projects list
getProjectsNavItem().getSubMenu().removeGroup(R.id.group_join_project);
for (int index = 0; index < projects.size(); index++) {
getProjectsNavItem()
.getSubMenu()
.add(R.id.group_join_project, Menu.NONE, index, projects.get(index).getTitle())
.setIcon(R.drawable.ic_menu_project);
}
// Highlight active project
Loadable.getValue(viewModel.getProjectLoadingState())
.ifPresent(project -> updateSelectedProjectUI(getSelectedProjectIndex(project)));
}
@Override
public void onGlobalLayout() {
FrameLayout bottomSheetHeader = binding.getRoot().findViewById(R.id.bottom_sheet_header);
if (bottomSheetBehavior == null || bottomSheetHeader == null) {
return;
}
bottomSheetBehavior.setFitToContents(false);
// When the bottom sheet is expanded, the bottom edge of the header needs to be aligned with
// the bottom edge of the toolbar (the header slides up under it).
BottomSheetMetrics metrics = new BottomSheetMetrics(binding.bottomSheetLayout);
bottomSheetBehavior.setExpandedOffset(metrics.getExpandedOffset());
getView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
private void setUpBottomSheetBehavior() {
bottomSheetBehavior = BottomSheetBehavior.from(binding.bottomSheetLayout);
bottomSheetBehavior.setHideable(true);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetCallback());
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
((MainActivity) getActivity()).setActionBar(binding.featureDetailsChrome.toolbar, false);
}
private void openDrawer() {
binding.drawerLayout.openDrawer(GravityCompat.START);
}
private void closeDrawer() {
binding.drawerLayout.closeDrawer(GravityCompat.START);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
BottomSheetState state = viewModel.getBottomSheetState().getValue();
if (state == null) {
Timber.e("BottomSheetState is null");
return false;
}
if (item.getItemId() == R.id.move_feature_menu_item) {
hideBottomSheet();
mapContainerViewModel.setMode(Mode.MOVE_POINT);
mapContainerViewModel.setReposFeature(state.getFeature());
Toast.makeText(getContext(), R.string.move_point_hint, Toast.LENGTH_SHORT).show();
} else if (item.getItemId() == R.id.delete_feature_menu_item) {
Optional<Feature> featureToDelete = state.getFeature();
if (featureToDelete.isPresent()) {
new Builder(requireActivity())
.setTitle(
getString(
R.string.feature_delete_confirmation_dialog_title,
featureHelper.getLabel(featureToDelete)))
.setMessage(R.string.feature_delete_confirmation_dialog_message)
.setPositiveButton(
R.string.delete_button_label,
(dialog, id) -> {
hideBottomSheet();
viewModel.deleteFeature(featureToDelete.get());
})
.setNegativeButton(
R.string.cancel_button_label,
(dialog, id) -> {
// Do nothing.
})
.create()
.show();
} else {
Timber.e("Attempted to delete non-existent feature");
}
} else if (item.getItemId() == R.id.feature_properties_menu_item) {
showFeatureProperties();
} else {
return false;
}
return true;
}
@Override
public void onStart() {
super.onStart();
if (viewModel.shouldShowProjectSelectorOnStart()) {
showProjectSelector();
}
viewModel.init();
}
@Override
public void onStop() {
super.onStop();
if (featureDataTypeSelectorDialogFragment != null
&& featureDataTypeSelectorDialogFragment.isVisible()) {
featureDataTypeSelectorDialogFragment.dismiss();
}
if (polygonDrawingInfoDialogFragment != null && polygonDrawingInfoDialogFragment.isVisible()) {
polygonDrawingInfoDialogFragment.dismiss();
}
}
private void showProjectSelector() {
// TODO: After login, if the screen is rotated without selecting any project, then the
// navigation throws an error due to invalid destination. Fix this!
navigator.navigate(
HomeScreenFragmentDirections.actionHomeScreenFragmentToProjectSelectorDialogFragment());
}
private void showOfflineAreas() {
viewModel.showOfflineAreas();
}
private void onApplyWindowInsets(WindowInsetsCompat insets) {
binding.featureDetailsChrome.toolbarWrapper.setPadding(
0, insets.getSystemWindowInsetTop(), 0, 0);
binding.featureDetailsChrome.bottomSheetBottomInsetScrim.setMinimumHeight(
insets.getSystemWindowInsetBottom());
updateNavViewInsets(insets);
updateBottomSheetPeekHeight(insets);
}
private void updateNavViewInsets(WindowInsetsCompat insets) {
View headerView = binding.navView.getHeaderView(0);
headerView.setPadding(0, insets.getSystemWindowInsetTop(), 0, 0);
}
private void updateBottomSheetPeekHeight(WindowInsetsCompat insets) {
double width =
getScreenWidth(getActivity())
+ insets.getSystemWindowInsetLeft()
+ insets.getSystemWindowInsetRight();
double height =
getScreenHeight(getActivity())
+ insets.getSystemWindowInsetTop()
+ insets.getSystemWindowInsetBottom();
double mapHeight = 0;
if (getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT) {
mapHeight = width / COLLAPSED_MAP_ASPECT_RATIO;
} else if (getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE) {
mapHeight = height / COLLAPSED_MAP_ASPECT_RATIO;
}
double peekHeight = height - mapHeight;
bottomSheetBehavior.setPeekHeight((int) peekHeight);
}
private void onActiveProjectChange(Loadable<Project> project) {
switch (project.getState()) {
case NOT_LOADED:
dismissLoadingDialog();
break;
case LOADED:
dismissLoadingDialog();
updateNavDrawer();
break;
case LOADING:
showProjectLoadingDialog();
break;
case NOT_FOUND:
case ERROR:
project.error().ifPresent(this::onActivateProjectFailure);
break;
default:
Timber.e("Unhandled case: %s", project.getState());
break;
}
}
private void updateSelectedProjectUI(int selectedIndex) {
SubMenu subMenu = getProjectsNavItem().getSubMenu();
for (int i = 0; i < projects.size(); i++) {
MenuItem menuItem = subMenu.getItem(i);
menuItem.setChecked(i == selectedIndex);
}
}
private int getSelectedProjectIndex(Project activeProject) {
for (Project project : projects) {
if (project.getId().equals(activeProject.getId())) {
return projects.indexOf(project);
}
}
Timber.e("Selected project not found.");
return -1;
}
private void onBottomSheetStateChange(BottomSheetState state) {
switch (state.getVisibility()) {
case VISIBLE:
showBottomSheet();
break;
case HIDDEN:
hideBottomSheet();
break;
default:
Timber.e("Unhandled visibility: %s", state.getVisibility());
break;
}
}
private void showBottomSheet() {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
private void hideBottomSheet() {
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
}
private void showProjectLoadingDialog() {
if (progressDialog == null) {
progressDialog =
ProgressDialogs.modalSpinner(getContext(), R.string.project_loading_please_wait);
progressDialog.show();
}
}
private void showAddFeatureTypeSelector(Layer layer, Point point) {
featureDataTypeSelectorDialogFragment =
new FeatureDataTypeSelectorDialogFragment(
featureType -> {
if (featureType == 0) {
viewModel.addFeature(layer, point);
} else if (featureType == 1) {
if (featureRepository.isPolygonDialogInfoShown()) {
startPolygonDrawing(layer);
} else {
showPolygonInfoDialog(layer);
}
}
});
featureDataTypeSelectorDialogFragment.show(
getChildFragmentManager(), FeatureDataTypeSelectorDialogFragment.class.getSimpleName());
}
private void startPolygonDrawing(Layer layer) {
viewModel
.getActiveProject()
.ifPresentOrElse(
project -> polygonDrawingViewModel.startDrawingFlow(project, layer),
() -> Timber.e("No active project"));
}
private void showPolygonInfoDialog(Layer layer) {
featureRepository.setPolygonDialogInfoShown(true);
polygonDrawingInfoDialogFragment =
new PolygonDrawingInfoDialogFragment(() -> startPolygonDrawing(layer));
polygonDrawingInfoDialogFragment.show(
getChildFragmentManager(), PolygonDrawingInfoDialogFragment.class.getName());
}
public void dismissLoadingDialog() {
if (progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
}
@Override
public boolean onBack() {
if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) {
return false;
} else {
hideBottomSheet();
return true;
}
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getGroupId() == R.id.group_join_project) {
Project selectedProject = projects.get(item.getOrder());
projectSelectorViewModel.activateOfflineProject(selectedProject.getId());
} else if (item.getItemId() == R.id.nav_join_project) {
showProjectSelector();
} else if (item.getItemId() == R.id.sync_status) {
viewModel.showSyncStatus();
} else if (item.getItemId() == R.id.nav_offline_areas) {
showOfflineAreas();
} else if (item.getItemId() == R.id.nav_settings) {
viewModel.showSettings();
} else if (item.getItemId() == R.id.nav_sign_out) {
authenticationManager.signOut();
}
closeDrawer();
return true;
}
private void onActivateProjectFailure(Throwable throwable) {
Timber.e(RxJava2Debug.getEnhancedStackTrace(throwable), "Error activating project");
dismissLoadingDialog();
popups.showError(R.string.project_load_error);
showProjectSelector();
}
private void showFeatureProperties() {
// TODO(#841): Move business logic into view model.
BottomSheetState state = viewModel.getBottomSheetState().getValue();
if (state == null) {
Timber.e("BottomSheetState is null");
return;
}
if (state.getFeature().isEmpty()) {
Timber.e("No feature selected");
return;
}
Feature feature = state.getFeature().get();
List<String> items = new ArrayList<>();
// TODO(#843): Let properties apply to other feature types as well.
if (feature instanceof GeoJsonFeature) {
items = getFeatureProperties((GeoJsonFeature) feature);
}
if (items.isEmpty()) {
items.add("No properties defined for this feature");
}
new AlertDialog.Builder(requireContext())
.setCancelable(true)
.setTitle(R.string.feature_properties)
// TODO(#842): Use custom view to format feature properties as table.
.setItems(items.toArray(new String[] {}), (a, b) -> {})
.setPositiveButton(R.string.close_feature_properties, (a, b) -> {})
.create()
.show();
}
private ImmutableList<String> getFeatureProperties(GeoJsonFeature feature) {
String jsonString = feature.getGeoJsonString();
try {
JSONObject jsonObject = new JSONObject(jsonString);
JSONObject properties = jsonObject.optJSONObject("properties");
if (properties == null) {
return ImmutableList.of();
}
ImmutableList.Builder items = new ImmutableList.Builder();
Iterator<String> keyIter = properties.keys();
while (keyIter.hasNext()) {
String key = keyIter.next();
Object value = properties.opt(key);
// TODO(#842): Use custom view to format feature properties as table.
items.add(key + ": " + value);
}
return items.build();
} catch (JSONException e) {
Timber.d("Encountered invalid feature GeoJSON in feature %s", feature.getId());
return ImmutableList.of();
}
}
private class BottomSheetCallback extends BottomSheetBehavior.BottomSheetCallback {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
viewModel.onBottomSheetHidden();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
// no-op.
}
}
}
| Check for current destination id before navigating to dialog
It would result in IllegalArgumentException we call this twice. This is because the action is only applicable from HomeScreenFragment and not ProjectSelectorDialogFragment
| gnd/src/main/java/com/google/android/gnd/ui/home/HomeScreenFragment.java | Check for current destination id before navigating to dialog | <ide><path>nd/src/main/java/com/google/android/gnd/ui/home/HomeScreenFragment.java
<ide>
<ide> import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
<ide> import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
<add>import static androidx.navigation.fragment.NavHostFragment.findNavController;
<ide> import static com.google.android.gnd.rx.RxAutoDispose.autoDisposable;
<ide> import static com.google.android.gnd.ui.util.ViewUtil.getScreenHeight;
<ide> import static com.google.android.gnd.ui.util.ViewUtil.getScreenWidth;
<ide> import androidx.core.view.GravityCompat;
<ide> import androidx.core.view.WindowInsetsCompat;
<ide> import androidx.drawerlayout.widget.DrawerLayout;
<add>import androidx.navigation.NavDestination;
<ide> import com.akaita.java.rxjava2debug.RxJava2Debug;
<ide> import com.google.android.gnd.BuildConfig;
<ide> import com.google.android.gnd.MainActivity;
<ide> }
<ide> }
<ide>
<add> private int getCurrentDestinationId() {
<add> NavDestination currentDestination = findNavController(this).getCurrentDestination();
<add> return currentDestination == null ? -1 : currentDestination.getId();
<add> }
<add>
<ide> private void showProjectSelector() {
<del> // TODO: After login, if the screen is rotated without selecting any project, then the
<del> // navigation throws an error due to invalid destination. Fix this!
<del> navigator.navigate(
<del> HomeScreenFragmentDirections.actionHomeScreenFragmentToProjectSelectorDialogFragment());
<add> if (getCurrentDestinationId() != R.id.projectSelectorDialogFragment) {
<add> navigator.navigate(
<add> HomeScreenFragmentDirections.actionHomeScreenFragmentToProjectSelectorDialogFragment());
<add> }
<ide> }
<ide>
<ide> private void showOfflineAreas() { |
|
Java | bsd-3-clause | 37cc7ae121717bda909be986a1575f455feb13ab | 0 | flutter/flutter-intellij,flutter/flutter-intellij,flutter/flutter-intellij,flutter/flutter-intellij,flutter/flutter-intellij | /*
* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.preview;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.CustomComponentAction;
import com.intellij.openapi.ui.SimpleToolWindowPanel;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.ui.JBUI;
import org.dartlang.analysis.server.protocol.Element;
import org.dartlang.analysis.server.protocol.FlutterOutline;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.border.AbstractBorder;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
// TODO: have a way to tell the panel whether it's hidden or shown
// TODO: we'll need to know whether the preview element is stateless widget or a state of a stateful
// widget; for the 2nd case, we'll need to find the corresponding stateful widget class
// TODO: we want to preview anything in a state, stateful, or stateless class (not
// just things contained in a build method)
// TODO: we should be bolding stateful and stateless (and state) classes, not build() methods
// or, show all elements of these classes with some additional emphasis (italic? background color?)
// TODO: we need to take the layer (or z-index?) of the widget into account (see Scaffold and its FAB)
public class PreviewArea {
public static int BORDER_WIDTH = 0;
private static final Color[] widgetColors = new Color[]{
new JBColor(new Color(0xB8F1FF), new Color(0x546E7A)),
new JBColor(new Color(0x80FFF2), new Color(0x008975)),
new JBColor(new Color(0xE1E1E1), new Color(0x757575)),
new JBColor(new Color(0x80DBFF), new Color(0x0288D1)),
new JBColor(new Color(0xA0FFCA), new Color(0x607D8B)),
new JBColor(new Color(0xFFD0B5), new Color(0x8D6E63)),
};
private static final Color labelColor = new JBColor(new Color(0x333333), new Color(0xcccccc));
private final Listener myListener;
private final DefaultActionGroup toolbarGroup = new DefaultActionGroup();
private final ActionToolbar windowToolbar;
private final SimpleToolWindowPanel window;
private final JLayeredPane layeredPanel = new JLayeredPane();
private final JPanel primaryLayer = new JPanel();
private final JPanel handleLayer = new JPanel(null);
private boolean isBeingRendered = false;
private final Map<Integer, FlutterOutline> idToOutline = new HashMap<>();
private int rootWidgetId;
private Rectangle rootWidgetBounds;
private final Map<Integer, Rectangle> idToGlobalBounds = new HashMap<>();
private final Map<FlutterOutline, JComponent> outlineToComponent = new HashMap<>();
private final List<SelectionEditPolicy> selectionComponents = new ArrayList<>();
private int widgetIndex = 0;
public PreviewArea(Listener listener) {
this.myListener = listener;
windowToolbar = ActionManager.getInstance().createActionToolbar("PreviewArea", toolbarGroup, true);
window = new SimpleToolWindowPanel(true, true);
window.setToolbar(windowToolbar.getComponent());
primaryLayer.setLayout(new BorderLayout());
clear();
// Layers must be transparent.
handleLayer.setOpaque(false);
window.setContent(layeredPanel);
layeredPanel.add(primaryLayer, Integer.valueOf(0));
layeredPanel.add(handleLayer, Integer.valueOf(1));
// Layers must cover the whole root panel.
layeredPanel.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
final int width = layeredPanel.getWidth();
final int height = layeredPanel.getHeight();
for (Component child : layeredPanel.getComponents()) {
child.setBounds(0, 0, width, height);
}
final int renderWidth = width - 2 * BORDER_WIDTH;
final int renderHeight = height - 2 * BORDER_WIDTH;
listener.resized(renderWidth, renderHeight);
}
});
}
/**
* Return the Swing component of the area.
*/
public JComponent getComponent() {
return window;
}
public void clear() {
clear("Preview is not available");
}
private void clear(String message) {
setToolbarTitle(null);
primaryLayer.removeAll();
primaryLayer.setLayout(new BorderLayout());
primaryLayer.add(new JLabel(message, SwingConstants.CENTER), BorderLayout.CENTER);
handleLayer.removeAll();
window.revalidate();
window.repaint();
}
/**
* A new outline was received, and we started rendering.
* Until rendering is finished, the area is inconsistent with the new outline.
* It should not ignore incoming events and should not send its events to the listener.
*/
public void renderingStarted() {
isBeingRendered = true;
}
/**
* Rendering finished, the new outline and rendering information is available.
* Show the rendered outlines.
*/
public void show(@NotNull FlutterOutline unitOutline, @NotNull FlutterOutline widgetOutline, @NotNull JsonObject renderObject) {
isBeingRendered = false;
idToOutline.clear();
fillIdToOutline(unitOutline);
fillIdToGlobalBounds(renderObject);
primaryLayer.removeAll();
primaryLayer.setLayout(null);
final FlutterOutline rootOutline = idToOutline.get(rootWidgetId);
if (rootOutline == null) {
clear();
return;
}
final Element widgetClassElement = widgetOutline.getDartElement();
if (widgetClassElement != null) {
setToolbarTitle(widgetClassElement.getName() + ".build():");
}
else {
setToolbarTitle(null);
}
outlineToComponent.clear();
widgetIndex = 0;
renderWidgetOutline(rootOutline);
window.revalidate();
window.repaint();
}
public void select(@NotNull List<FlutterOutline> outlines) {
if (isBeingRendered) {
return;
}
for (SelectionEditPolicy policy : selectionComponents) {
policy.deactivate();
}
selectionComponents.clear();
for (FlutterOutline outline : outlines) {
final JComponent widget = outlineToComponent.get(outline);
if (widget != null) {
final SelectionEditPolicy selectionPolicy = new SelectionEditPolicy(handleLayer, widget);
selectionComponents.add(selectionPolicy);
selectionPolicy.activate();
}
}
primaryLayer.repaint();
}
private void fillIdToOutline(@NotNull FlutterOutline outline) {
if (outline.getId() != null) {
idToOutline.put(outline.getId(), outline);
}
if (outline.getChildren() != null) {
for (FlutterOutline child : outline.getChildren()) {
fillIdToOutline(child);
}
}
}
private void fillIdToGlobalBounds(@NotNull JsonObject renderObject) {
rootWidgetBounds = null;
idToGlobalBounds.clear();
for (Map.Entry<String, JsonElement> entry : renderObject.entrySet()) {
try {
final int id = Integer.parseInt(entry.getKey());
final JsonObject widgetObject = (JsonObject)entry.getValue();
final JsonObject boundsObject = widgetObject.getAsJsonObject("globalBounds");
final int left = boundsObject.getAsJsonPrimitive("left").getAsInt();
final int top = boundsObject.getAsJsonPrimitive("top").getAsInt();
final int width = boundsObject.getAsJsonPrimitive("width").getAsInt();
final int height = boundsObject.getAsJsonPrimitive("height").getAsInt();
final Rectangle rect = new Rectangle(left, top, width, height);
if (rootWidgetBounds == null) {
rootWidgetId = id;
rootWidgetBounds = rect;
}
idToGlobalBounds.put(id, rect);
}
catch (Throwable ignored) {
}
}
}
private void renderWidgetOutline(@NotNull FlutterOutline outline) {
final Integer id = outline.getId();
if (id == null) {
return;
}
final Rectangle rect = idToGlobalBounds.get(id);
if (rect == null) {
return;
}
final int x = BORDER_WIDTH + rect.x - rootWidgetBounds.x;
final int y = BORDER_WIDTH + rect.y - rootWidgetBounds.y;
final JPanel widget = new JPanel(new BorderLayout());
final DropShadowBorder shadowBorder = new DropShadowBorder();
widget.setBorder(shadowBorder);
widget.setOpaque(false);
final Insets insets = shadowBorder.getBorderInsets(widget);
widget.setBounds(new Rectangle(x, y, rect.width + insets.right, rect.height + insets.bottom));
final JPanel inner = new JPanel(new BorderLayout());
inner.setBackground(widgetColors[widgetIndex % widgetColors.length]);
widgetIndex++;
inner.setBorder(BorderFactory.createLineBorder(inner.getBackground().darker()));
widget.add(inner, BorderLayout.CENTER);
final JBLabel label = new JBLabel(outline.getClassName());
label.setBorder(JBUI.Borders.empty(1, 4, 0, 0));
label.setForeground(labelColor);
inner.add(label, BorderLayout.NORTH);
outlineToComponent.put(outline, inner);
inner.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
myListener.doubleClicked(outline);
}
}
@Override
public void mousePressed(MouseEvent e) {
myListener.clicked(outline);
}
});
if (outline.getChildren() != null) {
for (FlutterOutline child : outline.getChildren()) {
renderWidgetOutline(child);
}
}
primaryLayer.add(widget);
}
private void setToolbarTitle(String text) {
toolbarGroup.removeAll();
if (text != null) {
toolbarGroup.add(new TitleAction(text));
}
windowToolbar.updateActionsImmediately();
}
interface Listener {
void clicked(FlutterOutline outline);
void doubleClicked(FlutterOutline outline);
void resized(int width, int height);
}
}
class TitleAction extends AnAction implements CustomComponentAction {
TitleAction(String text) {
super(text);
}
@Override
public void actionPerformed(AnActionEvent event) {
}
@Override
public JComponent createCustomComponent(Presentation presentation) {
final String text = getTemplatePresentation().getText();
return new JLabel(text);
}
}
class DropShadowBorder extends AbstractBorder {
@SuppressWarnings("UseJBColor") private static final Color borderColor = new Color(0x7F000000, true);
public DropShadowBorder() {
}
public Insets getBorderInsets(Component component) {
//noinspection UseDPIAwareInsets
return new Insets(0, 0, 1, 1);
}
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
g.setColor(borderColor);
final int x1 = x + 1;
final int y1 = y + 1;
final int x2 = x + width - 1;
final int y2 = y + height - 1;
g.drawLine(x1, y2, x2, y2);
g.drawLine(x2, y1, x2, y2 - 1);
}
}
| src/io/flutter/preview/PreviewArea.java | /*
* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
package io.flutter.preview;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.CustomComponentAction;
import com.intellij.openapi.ui.SimpleToolWindowPanel;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.ui.JBUI;
import org.dartlang.analysis.server.protocol.Element;
import org.dartlang.analysis.server.protocol.FlutterOutline;
import org.jdesktop.swingx.border.DropShadowBorder;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
// TODO: have a way to tell the panel whether it's hidden or shown
// TODO: we'll need to know whether the preview element is stateless widget or a state of a stateful
// widget; for the 2nd case, we'll need to find the corresponding stateful widget class
// TODO: we want to preview anything in a state, stateful, or stateless class (not
// just things contained in a build method)
// TODO: we should be bolding stateful and stateless (and state) classes, not build() methods
// or, show all elements of these classes with some additional emphasis (italic? background color?)
// TODO: we need to take the layer (or z-index?) of the widget into account (see Scaffold and its FAB)
public class PreviewArea {
public static int BORDER_WIDTH = 0;
private static final Color[] widgetColors = new Color[]{
new JBColor(new Color(0xB8F1FF), new Color(0x546E7A)),
new JBColor(new Color(0x80FFF2), new Color(0x008975)),
new JBColor(new Color(0xE1E1E1), new Color(0x757575)),
new JBColor(new Color(0x80DBFF), new Color(0x0288D1)),
new JBColor(new Color(0xA0FFCA), new Color(0x607D8B)),
new JBColor(new Color(0xFFD0B5), new Color(0x8D6E63)),
};
private static final Color labelColor = new JBColor(new Color(0x333333), new Color(0xcccccc));
private final Listener myListener;
private final DefaultActionGroup toolbarGroup = new DefaultActionGroup();
private final ActionToolbar windowToolbar;
private final SimpleToolWindowPanel window;
private final JLayeredPane layeredPanel = new JLayeredPane();
private final JPanel primaryLayer = new JPanel();
private final JPanel handleLayer = new JPanel(null);
private boolean isBeingRendered = false;
private final Map<Integer, FlutterOutline> idToOutline = new HashMap<>();
private int rootWidgetId;
private Rectangle rootWidgetBounds;
private final Map<Integer, Rectangle> idToGlobalBounds = new HashMap<>();
private final Map<FlutterOutline, JComponent> outlineToComponent = new HashMap<>();
private final List<SelectionEditPolicy> selectionComponents = new ArrayList<>();
private int widgetIndex = 0;
public PreviewArea(Listener listener) {
this.myListener = listener;
windowToolbar = ActionManager.getInstance().createActionToolbar("PreviewArea", toolbarGroup, true);
window = new SimpleToolWindowPanel(true, true);
window.setToolbar(windowToolbar.getComponent());
primaryLayer.setLayout(new BorderLayout());
clear();
// Layers must be transparent.
handleLayer.setOpaque(false);
window.setContent(layeredPanel);
layeredPanel.add(primaryLayer, Integer.valueOf(0));
layeredPanel.add(handleLayer, Integer.valueOf(1));
// Layers must cover the whole root panel.
layeredPanel.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
final int width = layeredPanel.getWidth();
final int height = layeredPanel.getHeight();
for (Component child : layeredPanel.getComponents()) {
child.setBounds(0, 0, width, height);
}
final int renderWidth = width - 2 * BORDER_WIDTH;
final int renderHeight = height - 2 * BORDER_WIDTH;
listener.resized(renderWidth, renderHeight);
}
});
}
/**
* Return the Swing component of the area.
*/
public JComponent getComponent() {
return window;
}
public void clear() {
clear("Preview is not available");
}
private void clear(String message) {
setToolbarTitle(null);
primaryLayer.removeAll();
primaryLayer.setLayout(new BorderLayout());
primaryLayer.add(new JLabel(message, SwingConstants.CENTER), BorderLayout.CENTER);
handleLayer.removeAll();
window.revalidate();
window.repaint();
}
/**
* A new outline was received, and we started rendering.
* Until rendering is finished, the area is inconsistent with the new outline.
* It should not ignore incoming events and should not send its events to the listener.
*/
public void renderingStarted() {
isBeingRendered = true;
}
/**
* Rendering finished, the new outline and rendering information is available.
* Show the rendered outlines.
*/
public void show(@NotNull FlutterOutline unitOutline, @NotNull FlutterOutline widgetOutline, @NotNull JsonObject renderObject) {
isBeingRendered = false;
idToOutline.clear();
fillIdToOutline(unitOutline);
fillIdToGlobalBounds(renderObject);
primaryLayer.removeAll();
primaryLayer.setLayout(null);
final FlutterOutline rootOutline = idToOutline.get(rootWidgetId);
if (rootOutline == null) {
clear();
return;
}
final Element widgetClassElement = widgetOutline.getDartElement();
if (widgetClassElement != null) {
setToolbarTitle(widgetClassElement.getName() + ".build():");
}
else {
setToolbarTitle(null);
}
outlineToComponent.clear();
widgetIndex = 0;
renderWidgetOutline(rootOutline);
window.revalidate();
window.repaint();
}
public void select(@NotNull List<FlutterOutline> outlines) {
if (isBeingRendered) {
return;
}
for (SelectionEditPolicy policy : selectionComponents) {
policy.deactivate();
}
selectionComponents.clear();
for (FlutterOutline outline : outlines) {
final JComponent widget = outlineToComponent.get(outline);
if (widget != null) {
final SelectionEditPolicy selectionPolicy = new SelectionEditPolicy(handleLayer, widget);
selectionComponents.add(selectionPolicy);
selectionPolicy.activate();
}
}
primaryLayer.repaint();
}
private void fillIdToOutline(@NotNull FlutterOutline outline) {
if (outline.getId() != null) {
idToOutline.put(outline.getId(), outline);
}
if (outline.getChildren() != null) {
for (FlutterOutline child : outline.getChildren()) {
fillIdToOutline(child);
}
}
}
private void fillIdToGlobalBounds(@NotNull JsonObject renderObject) {
rootWidgetBounds = null;
idToGlobalBounds.clear();
for (Map.Entry<String, JsonElement> entry : renderObject.entrySet()) {
try {
final int id = Integer.parseInt(entry.getKey());
final JsonObject widgetObject = (JsonObject)entry.getValue();
final JsonObject boundsObject = widgetObject.getAsJsonObject("globalBounds");
final int left = boundsObject.getAsJsonPrimitive("left").getAsInt();
final int top = boundsObject.getAsJsonPrimitive("top").getAsInt();
final int width = boundsObject.getAsJsonPrimitive("width").getAsInt();
final int height = boundsObject.getAsJsonPrimitive("height").getAsInt();
final Rectangle rect = new Rectangle(left, top, width, height);
if (rootWidgetBounds == null) {
rootWidgetId = id;
rootWidgetBounds = rect;
}
idToGlobalBounds.put(id, rect);
}
catch (Throwable ignored) {
}
}
}
private void renderWidgetOutline(@NotNull FlutterOutline outline) {
final Integer id = outline.getId();
if (id == null) {
return;
}
final Rectangle rect = idToGlobalBounds.get(id);
if (rect == null) {
return;
}
final int x = BORDER_WIDTH + rect.x - rootWidgetBounds.x;
final int y = BORDER_WIDTH + rect.y - rootWidgetBounds.y;
final JPanel widget = new JPanel(new BorderLayout());
final DropShadowBorder shadowBorder = new DropShadowBorder();
shadowBorder.setShadowSize(3);
shadowBorder.setShowRightShadow(true);
shadowBorder.setShowBottomShadow(true);
widget.setBorder(shadowBorder);
widget.setOpaque(false);
final Insets insets = shadowBorder.getBorderInsets(widget);
widget.setBounds(new Rectangle(x, y, rect.width + insets.right, rect.height + insets.bottom));
final JPanel inner = new JPanel(new BorderLayout());
inner.setBackground(widgetColors[widgetIndex % widgetColors.length]);
widgetIndex++;
inner.setBorder(BorderFactory.createLineBorder(inner.getBackground().darker()));
widget.add(inner, BorderLayout.CENTER);
final JBLabel label = new JBLabel(outline.getClassName());
label.setBorder(JBUI.Borders.empty(1, 4, 0, 0));
label.setForeground(labelColor);
inner.add(label, BorderLayout.NORTH);
outlineToComponent.put(outline, inner);
inner.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
myListener.doubleClicked(outline);
}
}
@Override
public void mousePressed(MouseEvent e) {
myListener.clicked(outline);
}
});
if (outline.getChildren() != null) {
for (FlutterOutline child : outline.getChildren()) {
renderWidgetOutline(child);
}
}
primaryLayer.add(widget);
}
private void setToolbarTitle(String text) {
toolbarGroup.removeAll();
if (text != null) {
toolbarGroup.add(new TitleAction(text));
}
windowToolbar.updateActionsImmediately();
}
interface Listener {
void clicked(FlutterOutline outline);
void doubleClicked(FlutterOutline outline);
void resized(int width, int height);
}
}
class TitleAction extends AnAction implements CustomComponentAction {
TitleAction(String text) {
super(text);
}
@Override
public void actionPerformed(AnActionEvent event) {
}
@Override
public JComponent createCustomComponent(Presentation presentation) {
final String text = getTemplatePresentation().getText();
return new JLabel(text);
}
} | add a new shadow border (#1996)
| src/io/flutter/preview/PreviewArea.java | add a new shadow border (#1996) | <ide><path>rc/io/flutter/preview/PreviewArea.java
<ide> import com.intellij.util.ui.JBUI;
<ide> import org.dartlang.analysis.server.protocol.Element;
<ide> import org.dartlang.analysis.server.protocol.FlutterOutline;
<del>import org.jdesktop.swingx.border.DropShadowBorder;
<ide> import org.jetbrains.annotations.NotNull;
<ide>
<ide> import javax.swing.*;
<add>import javax.swing.border.AbstractBorder;
<ide> import java.awt.*;
<ide> import java.awt.event.ComponentAdapter;
<ide> import java.awt.event.ComponentEvent;
<ide>
<ide> final JPanel widget = new JPanel(new BorderLayout());
<ide> final DropShadowBorder shadowBorder = new DropShadowBorder();
<del> shadowBorder.setShadowSize(3);
<del> shadowBorder.setShowRightShadow(true);
<del> shadowBorder.setShowBottomShadow(true);
<ide> widget.setBorder(shadowBorder);
<ide> widget.setOpaque(false);
<ide> final Insets insets = shadowBorder.getBorderInsets(widget);
<ide> return new JLabel(text);
<ide> }
<ide> }
<add>
<add>class DropShadowBorder extends AbstractBorder {
<add> @SuppressWarnings("UseJBColor") private static final Color borderColor = new Color(0x7F000000, true);
<add>
<add> public DropShadowBorder() {
<add> }
<add>
<add> public Insets getBorderInsets(Component component) {
<add> //noinspection UseDPIAwareInsets
<add> return new Insets(0, 0, 1, 1);
<add> }
<add>
<add> public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
<add> g.setColor(borderColor);
<add> final int x1 = x + 1;
<add> final int y1 = y + 1;
<add> final int x2 = x + width - 1;
<add> final int y2 = y + height - 1;
<add> g.drawLine(x1, y2, x2, y2);
<add> g.drawLine(x2, y1, x2, y2 - 1);
<add> }
<add>} |
|
Java | mit | fa676cfbef08366abac408fd316d467a96c647ad | 0 | jamestklo/CrackingTheCodingInterview4thEd | package ch05q03_FinderOfNextSmallestPrevLargest;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Stack;
import com.google.common.base.Joiner;
/*
* James TK Lo (C) 2013. All rights reserved. https://github.com/jamestklo
* Personal implementation(s) in Java, for calculating the binary representation of a decimal number.
*
Cracking The Coding Interview 4th Edition, Question 5.3
Given an integer, print the next smallest and next largest number that have the same number of 1 bits in their binary representation.
*
* a solution cleaner than the book's
*/
public class FinderOfNextSmallestPrevLargest {
public static int binaryToInteger(String bits) {
int output = 0;
for (int i=0, j=bits.length()-1; i < bits.length(); ++i, --j) {
if (bits.charAt(i) == '1') {
output += 1<<j;
}
}
return output;
}
public static final String integerToBinary(int input) {
if (input == 0) {
return "0";
}
int copy = input;
Stack<String> stack = new Stack<String>();
while (copy != 0) {
int bit = copy & 1;
if (bit == 1) {
stack.add("1");
}
else {
stack.add("0");
}
copy = copy >>> 1;
}
StringBuffer sb = new StringBuffer();
while(! stack.empty()) {
sb.append(stack.pop());
}
return sb.toString();
}
protected static final int NUM_BITS = 32;
protected static final int MOST_POSITIVE = ((1<<(NUM_BITS-2)) -1) + (1<<(NUM_BITS-2));
protected static final int MOST_NEGATIVE = -1-MOST_POSITIVE;
protected static int find(int input, boolean bit) {
switch (input) {
case -1: return -1;
case 0: return 0;
}
if (bit && input==MOST_POSITIVE) {
// next smallest of the most positive number
return MOST_POSITIVE;
}
else if (input == MOST_NEGATIVE){
// previous largest of the most negative number
return MOST_NEGATIVE;
}
int copy = input;
int count = -1;
int first = NUM_BITS;
int biti = bit?1:0;
for (int i=0; i < NUM_BITS; ++i, copy>>>=1) {
if ((copy & 1) == biti) {
++count;
}
else if (count >= 0) {
first = i;
break;
}
}
int mask = 1 << first;
if (first == NUM_BITS) {
mask -= 1;
++count;
}
if (bit) {
return ( input & (0-mask) ) | mask | ((1<<count)-1);
}
mask <<= 1;
int right = 1 << (first-count);
right = right -1;
return ( input & (0-mask) ) | (right<<count);
}
public static int findNextSmallest(int input) {
return find(input, true);
}
private static String findNextSmallest(String input) {
return integerToBinary(findNextSmallest(binaryToInteger(input)));
}
public static int findPrevLargest(int input) {
return find(input, false);
}
private static String findPrevLargest(String input) {
return integerToBinary(findPrevLargest(binaryToInteger(input)));
}
public static void main(String[] args) {
List<String> strlist = new ArrayList<String>();
strlist.add("1011100");
strlist.add(integerToBinary(0));
strlist.add(integerToBinary(-1));
strlist.add(integerToBinary(MOST_NEGATIVE));
strlist.add(integerToBinary(1));
strlist.add(integerToBinary(MOST_POSITIVE));
strlist.add(integerToBinary(-2));
strlist.add(integerToBinary(-4));
strlist.add(integerToBinary(3));
strlist.add(integerToBinary(7));
strlist.add(integerToBinary(-3));
ListIterator<String> str_itr = strlist.listIterator();
while (str_itr.hasNext()) {
String next = str_itr.next();
int nextInteger = binaryToInteger(next);
String smallest = findNextSmallest(next);
String largest = findPrevLargest(next);
String[] parts = new String[3];
parts[0] = next +"\t"+ nextInteger;
parts[1] = findPrevLargest(smallest)+"\t"+ smallest;
parts[2] = findNextSmallest(largest)+"\t"+ largest;
System.out.println(Joiner.on("\n").join(parts));
System.out.println("");
}
}
}
| src/main/java/ch05q03_FinderOfNextSmallestPrevLargest/FinderOfNextSmallestPrevLargest.java | package ch05q03_FinderOfNextSmallestPrevLargest;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Stack;
import com.google.common.base.Joiner;
/*
* James TK Lo (C) 2013. All rights reserved. https://github.com/jamestklo
* Personal implementation(s) in Java, for calculating the binary representation of a decimal number.
*
Cracking The Coding Interview 4th Edition, Question 5.3
Given an integer, print the next smallest and next largest number that have the same number of 1 bits in their binary representation.
*
* a solution cleaner than the book's
*/
public class FinderOfNextSmallestPrevLargest {
public static int binaryToInteger(String bits) {
int output = 0;
for (int i=0, j=bits.length()-1; i < bits.length(); ++i, --j) {
if (bits.charAt(i) == '1') {
output += 1<<j;
}
}
return output;
}
public static final String integerToBinary(int input) {
if (input == 0) {
return "0";
}
int copy = input;
Stack<String> stack = new Stack<String>();
while (copy != 0) {
int bit = copy & 1;
if (bit == 1) {
stack.add("1");
}
else {
stack.add("0");
}
copy = copy >>> 1;
}
StringBuffer sb = new StringBuffer();
while(! stack.empty()) {
sb.append(stack.pop());
}
return sb.toString();
}
protected static final int NUM_BITS = 32;
protected static final int POS_BITS = NUM_BITS-2;
protected static final int MOST_POSITIVE = ((1<<POS_BITS) -1) + (1<<POS_BITS);
protected static final int MOST_NEGATIVE = -1-MOST_POSITIVE;
protected static int find(int input, boolean bit) {
switch (input) {
case -1: return -1;
case 0: return 0;
}
if (bit && input==MOST_POSITIVE) {
// next smallest of the most positive number
return MOST_POSITIVE;
}
else if (input == MOST_NEGATIVE){
// previous largest of the most negative number
return MOST_NEGATIVE;
}
int copy = input;
int count = -1;
int first = NUM_BITS;
int biti = bit?1:0;
for (int i=0; i < NUM_BITS; ++i, copy>>>=1) {
if ((copy & 1) == biti) {
++count;
}
else if (count >= 0) {
first = i;
break;
}
}
int mask = 1 << first;
if (first == NUM_BITS) {
mask -= 1;
++count;
}
if (bit) {
return ( input & (0-mask) ) | mask | ((1<<count)-1);
}
mask <<= 1;
int right = 1 << (first-count);
right = right -1;
return ( input & (0-mask) ) | (right<<count);
}
public static int findNextSmallest(int input) {
return find(input, true);
}
private static String findNextSmallest(String input) {
return integerToBinary(findNextSmallest(binaryToInteger(input)));
}
public static int findPrevLargest(int input) {
return find(input, false);
}
private static String findPrevLargest(String input) {
return integerToBinary(findPrevLargest(binaryToInteger(input)));
}
public static void main(String[] args) {
List<String> strlist = new ArrayList<String>();
strlist.add("1011100");
strlist.add(integerToBinary(0));
strlist.add(integerToBinary(-1));
strlist.add(integerToBinary(MOST_NEGATIVE));
strlist.add(integerToBinary(1));
strlist.add(integerToBinary(MOST_POSITIVE));
strlist.add(integerToBinary(-2));
strlist.add(integerToBinary(-4));
strlist.add(integerToBinary(3));
strlist.add(integerToBinary(7));
strlist.add(integerToBinary(-3));
ListIterator<String> str_itr = strlist.listIterator();
while (str_itr.hasNext()) {
String next = str_itr.next();
int nextInteger = binaryToInteger(next);
String smallest = findNextSmallest(next);
String largest = findPrevLargest(next);
String[] parts = new String[3];
parts[0] = next +"\t"+ nextInteger;
parts[1] = findPrevLargest(smallest)+"\t"+ smallest;
parts[2] = findNextSmallest(largest)+"\t"+ largest;
System.out.println(Joiner.on("\n").join(parts));
System.out.println("");
}
}
}
| cleaned up code | src/main/java/ch05q03_FinderOfNextSmallestPrevLargest/FinderOfNextSmallestPrevLargest.java | cleaned up code | <ide><path>rc/main/java/ch05q03_FinderOfNextSmallestPrevLargest/FinderOfNextSmallestPrevLargest.java
<ide> }
<ide>
<ide> protected static final int NUM_BITS = 32;
<del> protected static final int POS_BITS = NUM_BITS-2;
<del> protected static final int MOST_POSITIVE = ((1<<POS_BITS) -1) + (1<<POS_BITS);
<add> protected static final int MOST_POSITIVE = ((1<<(NUM_BITS-2)) -1) + (1<<(NUM_BITS-2));
<ide> protected static final int MOST_NEGATIVE = -1-MOST_POSITIVE;
<ide> protected static int find(int input, boolean bit) {
<ide> switch (input) { |
|
Java | agpl-3.0 | 1752c1dfd2ba00b8cb405c2f43d1b24f356bec60 | 0 | quikkian-ua-devops/kfs,kuali/kfs,quikkian-ua-devops/will-financials,UniversityOfHawaii/kfs,kuali/kfs,kkronenb/kfs,smith750/kfs,bhutchinson/kfs,bhutchinson/kfs,kkronenb/kfs,smith750/kfs,kuali/kfs,quikkian-ua-devops/kfs,ua-eas/kfs,ua-eas/kfs-devops-automation-fork,smith750/kfs,smith750/kfs,quikkian-ua-devops/kfs,UniversityOfHawaii/kfs,ua-eas/kfs,quikkian-ua-devops/kfs,bhutchinson/kfs,kuali/kfs,quikkian-ua-devops/will-financials,kkronenb/kfs,quikkian-ua-devops/kfs,UniversityOfHawaii/kfs,UniversityOfHawaii/kfs,quikkian-ua-devops/kfs,ua-eas/kfs-devops-automation-fork,bhutchinson/kfs,kkronenb/kfs,ua-eas/kfs,ua-eas/kfs-devops-automation-fork,ua-eas/kfs-devops-automation-fork,quikkian-ua-devops/will-financials,ua-eas/kfs,quikkian-ua-devops/will-financials,ua-eas/kfs-devops-automation-fork,kuali/kfs,quikkian-ua-devops/will-financials,UniversityOfHawaii/kfs,quikkian-ua-devops/will-financials,ua-eas/kfs | /*
* Copyright 2008 The Kuali Foundation.
*
* Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
*
* 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.
*/
package org.kuali.kfs.module.ar.document.validation.impl;
import org.apache.commons.lang.StringUtils;
import org.kuali.kfs.module.ar.ArKeyConstants;
import org.kuali.kfs.module.ar.document.PaymentApplicationDocument;
import org.kuali.kfs.sys.document.validation.impl.GeneralLedgerPostingDocumentRuleBase;
import org.kuali.rice.kew.exception.WorkflowException;
import org.kuali.rice.kns.document.Document;
import org.kuali.rice.kns.rule.event.ApproveDocumentEvent;
import org.kuali.rice.kns.util.ErrorMap;
import org.kuali.rice.kns.util.GlobalVariables;
import org.kuali.rice.kns.util.KNSConstants;
import org.kuali.rice.kns.util.KualiDecimal;
public class PaymentApplicationDocumentRule extends GeneralLedgerPostingDocumentRuleBase {
protected boolean processCustomSaveDocumentBusinessRules(Document document) {
boolean isValid = super.processCustomSaveDocumentBusinessRules(document);
PaymentApplicationDocument aDocument = (PaymentApplicationDocument)document;
return isValid;
}
protected boolean processCustomRouteDocumentBusinessRules(Document document) {
// if the super failed, dont even bother running these rules
boolean isValid = super.processCustomRouteDocumentBusinessRules(document);
if (!isValid) return false;
ErrorMap errorMap = GlobalVariables.getErrorMap();
PaymentApplicationDocument paymentApplicationDocument = (PaymentApplicationDocument) document;
// dont let PayApp docs started from CashControl docs through if not all funds are applied
if (isSelectedInvoiceUnderApplied(paymentApplicationDocument)) {
isValid &= false;
errorMap.putError(
KNSConstants.GLOBAL_ERRORS,
ArKeyConstants.PaymentApplicationDocumentErrors.FULL_AMOUNT_NOT_APPLIED);
}
return isValid;
}
protected boolean isSelectedInvoiceUnderApplied(PaymentApplicationDocument doc) {
// Check for full amount not being applied only when there's a related cash control document
if (!containsCashControlDocument(doc)) {
return false;
}
KualiDecimal totalToBeApplied;
try {
totalToBeApplied = doc.getTotalToBeApplied();
}
catch (WorkflowException e) {
return false;
}
// KULAR-451
return totalToBeApplied.isGreaterThan(KualiDecimal.ZERO);
}
protected boolean containsCashControlDocument(PaymentApplicationDocument doc) {
return (StringUtils.isNotBlank(doc.getDocumentHeader().getOrganizationDocumentNumber()));
}
protected boolean processCustomApproveDocumentBusinessRules(ApproveDocumentEvent approveEvent) {
boolean isValid = super.processCustomApproveDocumentBusinessRules(approveEvent);
PaymentApplicationDocument aDocument = (PaymentApplicationDocument)approveEvent.getDocument();
return isValid;
}
}
| work/src/org/kuali/kfs/module/ar/document/validation/impl/PaymentApplicationDocumentRule.java | /*
* Copyright 2008 The Kuali Foundation.
*
* Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
*
* 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.
*/
package org.kuali.kfs.module.ar.document.validation.impl;
import org.apache.commons.lang.StringUtils;
import org.kuali.kfs.module.ar.ArKeyConstants;
import org.kuali.kfs.module.ar.document.PaymentApplicationDocument;
import org.kuali.kfs.sys.document.validation.impl.GeneralLedgerPostingDocumentRuleBase;
import org.kuali.rice.kew.exception.WorkflowException;
import org.kuali.rice.kns.document.Document;
import org.kuali.rice.kns.rule.event.ApproveDocumentEvent;
import org.kuali.rice.kns.util.ErrorMap;
import org.kuali.rice.kns.util.GlobalVariables;
import org.kuali.rice.kns.util.KNSConstants;
import org.kuali.rice.kns.util.KualiDecimal;
public class PaymentApplicationDocumentRule extends GeneralLedgerPostingDocumentRuleBase {
protected boolean processCustomSaveDocumentBusinessRules(Document document) {
boolean isValid = super.processCustomSaveDocumentBusinessRules(document);
PaymentApplicationDocument aDocument = (PaymentApplicationDocument)document;
return isValid;
}
protected boolean processCustomRouteDocumentBusinessRules(Document document) {
// if the super failed, dont even bother running these rules
boolean isValid = super.processCustomRouteDocumentBusinessRules(document);
if (!isValid) return false;
ErrorMap errorMap = GlobalVariables.getErrorMap();
PaymentApplicationDocument paymentApplicationDocument = (PaymentApplicationDocument) document;
// dont let PayApp docs started from CashControl docs through if not all funds are applied
if (isSelectedInvoiceUnderApplied(paymentApplicationDocument)) {
isValid &= false;
errorMap.putError(
KNSConstants.GLOBAL_ERRORS,
ArKeyConstants.PaymentApplicationDocumentErrors.FULL_AMOUNT_NOT_APPLIED);
}
return isValid;
}
protected boolean isSelectedInvoiceUnderApplied(PaymentApplicationDocument doc) {
// Check for full amount not being applied only when there's a related cash control document
if (!containsCashControlDocument(doc)) {
return true;
}
KualiDecimal totalToBeApplied;
try {
totalToBeApplied = doc.getTotalToBeApplied();
}
catch (WorkflowException e) {
return false;
}
// KULAR-451
return totalToBeApplied.isGreaterThan(KualiDecimal.ZERO);
}
protected boolean containsCashControlDocument(PaymentApplicationDocument doc) {
return (StringUtils.isNotBlank(doc.getDocumentHeader().getOrganizationDocumentNumber()));
}
protected boolean processCustomApproveDocumentBusinessRules(ApproveDocumentEvent approveEvent) {
boolean isValid = super.processCustomApproveDocumentBusinessRules(approveEvent);
PaymentApplicationDocument aDocument = (PaymentApplicationDocument)approveEvent.getDocument();
return isValid;
}
}
| Really dumb bug of mine left in there from earlier work.
| work/src/org/kuali/kfs/module/ar/document/validation/impl/PaymentApplicationDocumentRule.java | Really dumb bug of mine left in there from earlier work. | <ide><path>ork/src/org/kuali/kfs/module/ar/document/validation/impl/PaymentApplicationDocumentRule.java
<ide>
<ide> // Check for full amount not being applied only when there's a related cash control document
<ide> if (!containsCashControlDocument(doc)) {
<del> return true;
<add> return false;
<ide> }
<ide>
<ide> KualiDecimal totalToBeApplied; |
|
Java | apache-2.0 | 6134700eecc4bab4a7f13a9c125327d9e47d092c | 0 | Distrotech/intellij-community,xfournet/intellij-community,ftomassetti/intellij-community,signed/intellij-community,kdwink/intellij-community,ibinti/intellij-community,clumsy/intellij-community,ibinti/intellij-community,FHannes/intellij-community,fengbaicanhe/intellij-community,fnouama/intellij-community,michaelgallacher/intellij-community,mglukhikh/intellij-community,salguarnieri/intellij-community,amith01994/intellij-community,samthor/intellij-community,clumsy/intellij-community,MichaelNedzelsky/intellij-community,ibinti/intellij-community,holmes/intellij-community,ivan-fedorov/intellij-community,akosyakov/intellij-community,youdonghai/intellij-community,izonder/intellij-community,michaelgallacher/intellij-community,ahb0327/intellij-community,vladmm/intellij-community,vvv1559/intellij-community,vvv1559/intellij-community,caot/intellij-community,SerCeMan/intellij-community,fitermay/intellij-community,akosyakov/intellij-community,diorcety/intellij-community,akosyakov/intellij-community,apixandru/intellij-community,kool79/intellij-community,allotria/intellij-community,TangHao1987/intellij-community,mglukhikh/intellij-community,MER-GROUP/intellij-community,caot/intellij-community,adedayo/intellij-community,ivan-fedorov/intellij-community,alphafoobar/intellij-community,blademainer/intellij-community,mglukhikh/intellij-community,wreckJ/intellij-community,Lekanich/intellij-community,kool79/intellij-community,gnuhub/intellij-community,idea4bsd/idea4bsd,xfournet/intellij-community,youdonghai/intellij-community,ol-loginov/intellij-community,MER-GROUP/intellij-community,kdwink/intellij-community,allotria/intellij-community,FHannes/intellij-community,michaelgallacher/intellij-community,da1z/intellij-community,ryano144/intellij-community,youdonghai/intellij-community,nicolargo/intellij-community,Distrotech/intellij-community,ol-loginov/intellij-community,mglukhikh/intellij-community,ftomassetti/intellij-community,jexp/idea2,gnuhub/intellij-community,retomerz/intellij-community,ibinti/intellij-community,vladmm/intellij-community,lucafavatella/intellij-community,ryano144/intellij-community,TangHao1987/intellij-community,da1z/intellij-community,youdonghai/intellij-community,akosyakov/intellij-community,suncycheng/intellij-community,slisson/intellij-community,gnuhub/intellij-community,amith01994/intellij-community,wreckJ/intellij-community,suncycheng/intellij-community,allotria/intellij-community,idea4bsd/idea4bsd,michaelgallacher/intellij-community,michaelgallacher/intellij-community,jagguli/intellij-community,clumsy/intellij-community,supersven/intellij-community,vvv1559/intellij-community,semonte/intellij-community,fengbaicanhe/intellij-community,caot/intellij-community,slisson/intellij-community,suncycheng/intellij-community,blademainer/intellij-community,suncycheng/intellij-community,ivan-fedorov/intellij-community,petteyg/intellij-community,Lekanich/intellij-community,MER-GROUP/intellij-community,diorcety/intellij-community,vvv1559/intellij-community,slisson/intellij-community,allotria/intellij-community,fengbaicanhe/intellij-community,lucafavatella/intellij-community,MER-GROUP/intellij-community,jagguli/intellij-community,diorcety/intellij-community,amith01994/intellij-community,tmpgit/intellij-community,jagguli/intellij-community,salguarnieri/intellij-community,diorcety/intellij-community,salguarnieri/intellij-community,salguarnieri/intellij-community,Distrotech/intellij-community,MER-GROUP/intellij-community,vladmm/intellij-community,allotria/intellij-community,salguarnieri/intellij-community,jagguli/intellij-community,idea4bsd/idea4bsd,pwoodworth/intellij-community,fitermay/intellij-community,samthor/intellij-community,hurricup/intellij-community,clumsy/intellij-community,michaelgallacher/intellij-community,xfournet/intellij-community,Lekanich/intellij-community,wreckJ/intellij-community,blademainer/intellij-community,ryano144/intellij-community,kool79/intellij-community,ryano144/intellij-community,xfournet/intellij-community,caot/intellij-community,orekyuu/intellij-community,Distrotech/intellij-community,TangHao1987/intellij-community,semonte/intellij-community,asedunov/intellij-community,petteyg/intellij-community,xfournet/intellij-community,da1z/intellij-community,ThiagoGarciaAlves/intellij-community,supersven/intellij-community,suncycheng/intellij-community,salguarnieri/intellij-community,supersven/intellij-community,ThiagoGarciaAlves/intellij-community,semonte/intellij-community,MichaelNedzelsky/intellij-community,allotria/intellij-community,ThiagoGarciaAlves/intellij-community,wreckJ/intellij-community,Distrotech/intellij-community,jexp/idea2,wreckJ/intellij-community,mglukhikh/intellij-community,nicolargo/intellij-community,signed/intellij-community,xfournet/intellij-community,samthor/intellij-community,ernestp/consulo,fnouama/intellij-community,MichaelNedzelsky/intellij-community,suncycheng/intellij-community,supersven/intellij-community,clumsy/intellij-community,mglukhikh/intellij-community,vladmm/intellij-community,caot/intellij-community,akosyakov/intellij-community,ahb0327/intellij-community,muntasirsyed/intellij-community,caot/intellij-community,fengbaicanhe/intellij-community,fengbaicanhe/intellij-community,joewalnes/idea-community,fitermay/intellij-community,idea4bsd/idea4bsd,robovm/robovm-studio,hurricup/intellij-community,supersven/intellij-community,gnuhub/intellij-community,jagguli/intellij-community,michaelgallacher/intellij-community,ThiagoGarciaAlves/intellij-community,clumsy/intellij-community,slisson/intellij-community,TangHao1987/intellij-community,xfournet/intellij-community,salguarnieri/intellij-community,lucafavatella/intellij-community,MichaelNedzelsky/intellij-community,Lekanich/intellij-community,orekyuu/intellij-community,MER-GROUP/intellij-community,youdonghai/intellij-community,semonte/intellij-community,tmpgit/intellij-community,petteyg/intellij-community,mglukhikh/intellij-community,ThiagoGarciaAlves/intellij-community,Lekanich/intellij-community,alphafoobar/intellij-community,izonder/intellij-community,joewalnes/idea-community,ryano144/intellij-community,TangHao1987/intellij-community,izonder/intellij-community,muntasirsyed/intellij-community,ryano144/intellij-community,da1z/intellij-community,youdonghai/intellij-community,TangHao1987/intellij-community,hurricup/intellij-community,vladmm/intellij-community,FHannes/intellij-community,alphafoobar/intellij-community,ivan-fedorov/intellij-community,vladmm/intellij-community,FHannes/intellij-community,jagguli/intellij-community,suncycheng/intellij-community,semonte/intellij-community,signed/intellij-community,michaelgallacher/intellij-community,vvv1559/intellij-community,consulo/consulo,asedunov/intellij-community,ibinti/intellij-community,ftomassetti/intellij-community,ahb0327/intellij-community,jexp/idea2,signed/intellij-community,hurricup/intellij-community,fitermay/intellij-community,joewalnes/idea-community,hurricup/intellij-community,signed/intellij-community,retomerz/intellij-community,gnuhub/intellij-community,SerCeMan/intellij-community,jexp/idea2,petteyg/intellij-community,muntasirsyed/intellij-community,alphafoobar/intellij-community,fitermay/intellij-community,ivan-fedorov/intellij-community,MichaelNedzelsky/intellij-community,caot/intellij-community,allotria/intellij-community,fitermay/intellij-community,dslomov/intellij-community,pwoodworth/intellij-community,SerCeMan/intellij-community,supersven/intellij-community,caot/intellij-community,MER-GROUP/intellij-community,blademainer/intellij-community,TangHao1987/intellij-community,adedayo/intellij-community,fnouama/intellij-community,asedunov/intellij-community,amith01994/intellij-community,MichaelNedzelsky/intellij-community,nicolargo/intellij-community,Lekanich/intellij-community,tmpgit/intellij-community,holmes/intellij-community,samthor/intellij-community,ol-loginov/intellij-community,kdwink/intellij-community,suncycheng/intellij-community,jagguli/intellij-community,clumsy/intellij-community,signed/intellij-community,signed/intellij-community,tmpgit/intellij-community,fnouama/intellij-community,FHannes/intellij-community,MER-GROUP/intellij-community,gnuhub/intellij-community,xfournet/intellij-community,youdonghai/intellij-community,apixandru/intellij-community,MER-GROUP/intellij-community,kool79/intellij-community,retomerz/intellij-community,wreckJ/intellij-community,youdonghai/intellij-community,adedayo/intellij-community,ibinti/intellij-community,dslomov/intellij-community,vladmm/intellij-community,retomerz/intellij-community,fnouama/intellij-community,xfournet/intellij-community,orekyuu/intellij-community,gnuhub/intellij-community,samthor/intellij-community,idea4bsd/idea4bsd,da1z/intellij-community,vladmm/intellij-community,joewalnes/idea-community,adedayo/intellij-community,holmes/intellij-community,jexp/idea2,ibinti/intellij-community,xfournet/intellij-community,lucafavatella/intellij-community,dslomov/intellij-community,vladmm/intellij-community,robovm/robovm-studio,FHannes/intellij-community,fitermay/intellij-community,akosyakov/intellij-community,pwoodworth/intellij-community,diorcety/intellij-community,ThiagoGarciaAlves/intellij-community,MichaelNedzelsky/intellij-community,lucafavatella/intellij-community,semonte/intellij-community,SerCeMan/intellij-community,semonte/intellij-community,FHannes/intellij-community,orekyuu/intellij-community,Distrotech/intellij-community,ftomassetti/intellij-community,SerCeMan/intellij-community,adedayo/intellij-community,ibinti/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,nicolargo/intellij-community,mglukhikh/intellij-community,idea4bsd/idea4bsd,petteyg/intellij-community,ivan-fedorov/intellij-community,idea4bsd/idea4bsd,samthor/intellij-community,holmes/intellij-community,ftomassetti/intellij-community,hurricup/intellij-community,kdwink/intellij-community,consulo/consulo,dslomov/intellij-community,samthor/intellij-community,apixandru/intellij-community,izonder/intellij-community,vvv1559/intellij-community,vvv1559/intellij-community,diorcety/intellij-community,joewalnes/idea-community,semonte/intellij-community,TangHao1987/intellij-community,asedunov/intellij-community,fengbaicanhe/intellij-community,dslomov/intellij-community,slisson/intellij-community,asedunov/intellij-community,kool79/intellij-community,amith01994/intellij-community,clumsy/intellij-community,ryano144/intellij-community,holmes/intellij-community,joewalnes/idea-community,ftomassetti/intellij-community,asedunov/intellij-community,pwoodworth/intellij-community,apixandru/intellij-community,vvv1559/intellij-community,xfournet/intellij-community,signed/intellij-community,diorcety/intellij-community,kdwink/intellij-community,akosyakov/intellij-community,robovm/robovm-studio,kool79/intellij-community,supersven/intellij-community,apixandru/intellij-community,ernestp/consulo,jagguli/intellij-community,Distrotech/intellij-community,petteyg/intellij-community,FHannes/intellij-community,alphafoobar/intellij-community,asedunov/intellij-community,retomerz/intellij-community,SerCeMan/intellij-community,adedayo/intellij-community,asedunov/intellij-community,fitermay/intellij-community,retomerz/intellij-community,ftomassetti/intellij-community,jexp/idea2,signed/intellij-community,xfournet/intellij-community,MichaelNedzelsky/intellij-community,FHannes/intellij-community,da1z/intellij-community,pwoodworth/intellij-community,robovm/robovm-studio,hurricup/intellij-community,ernestp/consulo,youdonghai/intellij-community,apixandru/intellij-community,kool79/intellij-community,robovm/robovm-studio,allotria/intellij-community,diorcety/intellij-community,blademainer/intellij-community,jexp/idea2,izonder/intellij-community,fitermay/intellij-community,tmpgit/intellij-community,allotria/intellij-community,wreckJ/intellij-community,ahb0327/intellij-community,michaelgallacher/intellij-community,orekyuu/intellij-community,pwoodworth/intellij-community,fnouama/intellij-community,asedunov/intellij-community,MER-GROUP/intellij-community,consulo/consulo,ryano144/intellij-community,fengbaicanhe/intellij-community,apixandru/intellij-community,semonte/intellij-community,caot/intellij-community,salguarnieri/intellij-community,amith01994/intellij-community,clumsy/intellij-community,TangHao1987/intellij-community,nicolargo/intellij-community,xfournet/intellij-community,apixandru/intellij-community,Distrotech/intellij-community,orekyuu/intellij-community,blademainer/intellij-community,fitermay/intellij-community,slisson/intellij-community,SerCeMan/intellij-community,caot/intellij-community,supersven/intellij-community,izonder/intellij-community,suncycheng/intellij-community,wreckJ/intellij-community,ThiagoGarciaAlves/intellij-community,idea4bsd/idea4bsd,nicolargo/intellij-community,diorcety/intellij-community,blademainer/intellij-community,apixandru/intellij-community,amith01994/intellij-community,wreckJ/intellij-community,muntasirsyed/intellij-community,kdwink/intellij-community,clumsy/intellij-community,asedunov/intellij-community,samthor/intellij-community,diorcety/intellij-community,ftomassetti/intellij-community,blademainer/intellij-community,hurricup/intellij-community,TangHao1987/intellij-community,adedayo/intellij-community,ThiagoGarciaAlves/intellij-community,diorcety/intellij-community,allotria/intellij-community,Lekanich/intellij-community,pwoodworth/intellij-community,supersven/intellij-community,holmes/intellij-community,Distrotech/intellij-community,muntasirsyed/intellij-community,alphafoobar/intellij-community,da1z/intellij-community,izonder/intellij-community,SerCeMan/intellij-community,gnuhub/intellij-community,blademainer/intellij-community,asedunov/intellij-community,SerCeMan/intellij-community,ryano144/intellij-community,amith01994/intellij-community,robovm/robovm-studio,clumsy/intellij-community,nicolargo/intellij-community,ftomassetti/intellij-community,Lekanich/intellij-community,idea4bsd/idea4bsd,salguarnieri/intellij-community,samthor/intellij-community,signed/intellij-community,robovm/robovm-studio,mglukhikh/intellij-community,lucafavatella/intellij-community,alphafoobar/intellij-community,tmpgit/intellij-community,blademainer/intellij-community,samthor/intellij-community,vvv1559/intellij-community,ernestp/consulo,petteyg/intellij-community,ahb0327/intellij-community,jagguli/intellij-community,FHannes/intellij-community,petteyg/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,kool79/intellij-community,dslomov/intellij-community,kdwink/intellij-community,TangHao1987/intellij-community,da1z/intellij-community,ahb0327/intellij-community,MER-GROUP/intellij-community,robovm/robovm-studio,da1z/intellij-community,consulo/consulo,hurricup/intellij-community,adedayo/intellij-community,ivan-fedorov/intellij-community,holmes/intellij-community,allotria/intellij-community,jagguli/intellij-community,izonder/intellij-community,slisson/intellij-community,ivan-fedorov/intellij-community,muntasirsyed/intellij-community,nicolargo/intellij-community,kdwink/intellij-community,tmpgit/intellij-community,joewalnes/idea-community,supersven/intellij-community,muntasirsyed/intellij-community,ryano144/intellij-community,MichaelNedzelsky/intellij-community,MichaelNedzelsky/intellij-community,asedunov/intellij-community,blademainer/intellij-community,ryano144/intellij-community,hurricup/intellij-community,lucafavatella/intellij-community,semonte/intellij-community,kool79/intellij-community,kdwink/intellij-community,orekyuu/intellij-community,slisson/intellij-community,gnuhub/intellij-community,dslomov/intellij-community,adedayo/intellij-community,ahb0327/intellij-community,ol-loginov/intellij-community,fnouama/intellij-community,fnouama/intellij-community,dslomov/intellij-community,suncycheng/intellij-community,gnuhub/intellij-community,idea4bsd/idea4bsd,lucafavatella/intellij-community,mglukhikh/intellij-community,izonder/intellij-community,fitermay/intellij-community,robovm/robovm-studio,ThiagoGarciaAlves/intellij-community,youdonghai/intellij-community,pwoodworth/intellij-community,idea4bsd/idea4bsd,joewalnes/idea-community,SerCeMan/intellij-community,SerCeMan/intellij-community,fengbaicanhe/intellij-community,lucafavatella/intellij-community,jagguli/intellij-community,dslomov/intellij-community,michaelgallacher/intellij-community,slisson/intellij-community,joewalnes/idea-community,suncycheng/intellij-community,retomerz/intellij-community,retomerz/intellij-community,ThiagoGarciaAlves/intellij-community,jexp/idea2,apixandru/intellij-community,gnuhub/intellij-community,clumsy/intellij-community,amith01994/intellij-community,nicolargo/intellij-community,da1z/intellij-community,fengbaicanhe/intellij-community,akosyakov/intellij-community,ivan-fedorov/intellij-community,apixandru/intellij-community,mglukhikh/intellij-community,retomerz/intellij-community,holmes/intellij-community,allotria/intellij-community,pwoodworth/intellij-community,orekyuu/intellij-community,retomerz/intellij-community,orekyuu/intellij-community,ahb0327/intellij-community,caot/intellij-community,ibinti/intellij-community,muntasirsyed/intellij-community,vvv1559/intellij-community,alphafoobar/intellij-community,Lekanich/intellij-community,holmes/intellij-community,ahb0327/intellij-community,semonte/intellij-community,suncycheng/intellij-community,asedunov/intellij-community,ol-loginov/intellij-community,MER-GROUP/intellij-community,holmes/intellij-community,kdwink/intellij-community,robovm/robovm-studio,kool79/intellij-community,akosyakov/intellij-community,robovm/robovm-studio,fengbaicanhe/intellij-community,hurricup/intellij-community,ahb0327/intellij-community,ibinti/intellij-community,ftomassetti/intellij-community,alphafoobar/intellij-community,tmpgit/intellij-community,youdonghai/intellij-community,samthor/intellij-community,idea4bsd/idea4bsd,Distrotech/intellij-community,vvv1559/intellij-community,lucafavatella/intellij-community,nicolargo/intellij-community,adedayo/intellij-community,kool79/intellij-community,dslomov/intellij-community,ibinti/intellij-community,ThiagoGarciaAlves/intellij-community,apixandru/intellij-community,youdonghai/intellij-community,apixandru/intellij-community,jagguli/intellij-community,ryano144/intellij-community,adedayo/intellij-community,ol-loginov/intellij-community,kool79/intellij-community,lucafavatella/intellij-community,ol-loginov/intellij-community,signed/intellij-community,FHannes/intellij-community,alphafoobar/intellij-community,retomerz/intellij-community,fengbaicanhe/intellij-community,FHannes/intellij-community,fnouama/intellij-community,muntasirsyed/intellij-community,izonder/intellij-community,ernestp/consulo,signed/intellij-community,retomerz/intellij-community,tmpgit/intellij-community,orekyuu/intellij-community,lucafavatella/intellij-community,retomerz/intellij-community,ol-loginov/intellij-community,nicolargo/intellij-community,ol-loginov/intellij-community,Lekanich/intellij-community,adedayo/intellij-community,tmpgit/intellij-community,fnouama/intellij-community,MichaelNedzelsky/intellij-community,alphafoobar/intellij-community,robovm/robovm-studio,akosyakov/intellij-community,dslomov/intellij-community,izonder/intellij-community,gnuhub/intellij-community,wreckJ/intellij-community,muntasirsyed/intellij-community,vvv1559/intellij-community,fengbaicanhe/intellij-community,petteyg/intellij-community,da1z/intellij-community,MichaelNedzelsky/intellij-community,akosyakov/intellij-community,Lekanich/intellij-community,hurricup/intellij-community,pwoodworth/intellij-community,salguarnieri/intellij-community,ivan-fedorov/intellij-community,kdwink/intellij-community,ivan-fedorov/intellij-community,semonte/intellij-community,vladmm/intellij-community,salguarnieri/intellij-community,allotria/intellij-community,lucafavatella/intellij-community,ftomassetti/intellij-community,amith01994/intellij-community,supersven/intellij-community,fitermay/intellij-community,orekyuu/intellij-community,ol-loginov/intellij-community,pwoodworth/intellij-community,diorcety/intellij-community,michaelgallacher/intellij-community,muntasirsyed/intellij-community,Distrotech/intellij-community,nicolargo/intellij-community,akosyakov/intellij-community,ahb0327/intellij-community,amith01994/intellij-community,ivan-fedorov/intellij-community,semonte/intellij-community,vladmm/intellij-community,supersven/intellij-community,da1z/intellij-community,ol-loginov/intellij-community,petteyg/intellij-community,fnouama/intellij-community,slisson/intellij-community,apixandru/intellij-community,ibinti/intellij-community,ahb0327/intellij-community,caot/intellij-community,ibinti/intellij-community,FHannes/intellij-community,muntasirsyed/intellij-community,ol-loginov/intellij-community,wreckJ/intellij-community,slisson/intellij-community,holmes/intellij-community,petteyg/intellij-community,petteyg/intellij-community,vvv1559/intellij-community,SerCeMan/intellij-community,samthor/intellij-community,tmpgit/intellij-community,ftomassetti/intellij-community,wreckJ/intellij-community,TangHao1987/intellij-community,da1z/intellij-community,salguarnieri/intellij-community,tmpgit/intellij-community,dslomov/intellij-community,michaelgallacher/intellij-community,kdwink/intellij-community,holmes/intellij-community,amith01994/intellij-community,fnouama/intellij-community,consulo/consulo,alphafoobar/intellij-community,Distrotech/intellij-community,idea4bsd/idea4bsd,slisson/intellij-community,fitermay/intellij-community,vladmm/intellij-community,ernestp/consulo,blademainer/intellij-community,pwoodworth/intellij-community,consulo/consulo,mglukhikh/intellij-community,orekyuu/intellij-community,signed/intellij-community,izonder/intellij-community,youdonghai/intellij-community | /*
* Copyright 2000-2007 JetBrains s.r.o.
* 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.
*/
package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiSubstitutor;
import com.intellij.psi.PsiType;
import com.intellij.psi.PsiVariable;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementImpl;
import org.jetbrains.plugins.groovy.lang.resolve.processors.ResolverProcessor;
/**
* @author ilyas
*/
public class GrAssignmentExpressionImpl extends GroovyPsiElementImpl implements GrAssignmentExpression {
public GrAssignmentExpressionImpl(@NotNull ASTNode node) {
super(node);
}
public String toString() {
return "Assignment expression";
}
public GrExpression getLValue() {
GrExpression[] exprs = findChildrenByClass(GrExpression.class);
if (exprs.length > 0) {
return exprs[0];
}
return null;
}
public GrExpression getRValue() {
GrExpression[] exprs = findChildrenByClass(GrExpression.class);
if (exprs.length > 1) {
return exprs[1];
}
return null;
}
public PsiType getType() {
return getLValue().getType();
}
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull PsiSubstitutor substitutor, PsiElement lastParent, @NotNull PsiElement place) {
GrExpression lValue = getLValue();
if (lastParent == null || !PsiTreeUtil.isAncestor(this, lastParent, false)) {
if (lValue instanceof GrReferenceExpressionImpl) {
GrReferenceExpressionImpl lRefExpr = (GrReferenceExpressionImpl) lValue;
String name = lRefExpr.getName();
String refName = processor instanceof ResolverProcessor ? ((ResolverProcessor) processor).getName() : null;
if (refName == null ||
(refName.equals(name) && !(lRefExpr.resolve() instanceof PsiVariable))) { //this is NOT quadratic since the next statement will prevent from further processing declarations upstream
if (!processor.execute(lRefExpr, PsiSubstitutor.EMPTY)) return false;
}
}
}
return true;
}
}
| plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrAssignmentExpressionImpl.java | /*
* Copyright 2000-2007 JetBrains s.r.o.
* 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.
*/
package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiType;
import com.intellij.psi.PsiSubstitutor;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiVariable;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.scope.NameHint;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementImpl;
import org.jetbrains.plugins.groovy.lang.psi.GrNamedElement;
import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil;
import org.jetbrains.plugins.groovy.lang.resolve.processors.ResolverProcessor;
/**
* @author ilyas
*/
public class GrAssignmentExpressionImpl extends GroovyPsiElementImpl implements GrAssignmentExpression {
public GrAssignmentExpressionImpl(@NotNull ASTNode node) {
super(node);
}
public String toString() {
return "Assignment expression";
}
public GrExpression getLValue() {
GrExpression[] exprs = findChildrenByClass(GrExpression.class);
if (exprs.length > 0) {
return exprs[0];
}
return null;
}
public GrExpression getRValue() {
GrExpression[] exprs = findChildrenByClass(GrExpression.class);
if (exprs.length > 1) {
return exprs[1];
}
return null;
}
public PsiType getType() {
return null;
}
public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull PsiSubstitutor substitutor, PsiElement lastParent, @NotNull PsiElement place) {
GrExpression lValue = getLValue();
if (lastParent == null || !PsiTreeUtil.isAncestor(this, lastParent, false)) {
if (lValue instanceof GrReferenceExpressionImpl) {
GrReferenceExpressionImpl lRefExpr = (GrReferenceExpressionImpl) lValue;
String name = lRefExpr.getName();
String refName = processor instanceof ResolverProcessor ? ((ResolverProcessor) processor).getName() : null;
if (refName == null ||
(refName.equals(name) && !(lRefExpr.resolve() instanceof PsiVariable))) { //this is NOT quadratic since the next statement will prevent from further processing declarations upstream
if (!processor.execute(lRefExpr, PsiSubstitutor.EMPTY)) return false;
}
}
}
return true;
}
}
| getType() added | plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrAssignmentExpressionImpl.java | getType() added | <ide><path>lugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrAssignmentExpressionImpl.java
<ide> package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions;
<ide>
<ide> import com.intellij.lang.ASTNode;
<add>import com.intellij.psi.PsiElement;
<add>import com.intellij.psi.PsiSubstitutor;
<ide> import com.intellij.psi.PsiType;
<del>import com.intellij.psi.PsiSubstitutor;
<del>import com.intellij.psi.PsiElement;
<ide> import com.intellij.psi.PsiVariable;
<add>import com.intellij.psi.scope.PsiScopeProcessor;
<ide> import com.intellij.psi.util.PsiTreeUtil;
<del>import com.intellij.psi.scope.PsiScopeProcessor;
<del>import com.intellij.psi.scope.NameHint;
<ide> import org.jetbrains.annotations.NotNull;
<ide> import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrAssignmentExpression;
<ide> import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
<ide> import org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiElementImpl;
<del>import org.jetbrains.plugins.groovy.lang.psi.GrNamedElement;
<del>import org.jetbrains.plugins.groovy.lang.resolve.ResolveUtil;
<ide> import org.jetbrains.plugins.groovy.lang.resolve.processors.ResolverProcessor;
<ide>
<ide> /**
<ide> }
<ide>
<ide> public PsiType getType() {
<del> return null;
<add> return getLValue().getType();
<ide> }
<ide>
<ide> public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull PsiSubstitutor substitutor, PsiElement lastParent, @NotNull PsiElement place) { |
|
Java | apache-2.0 | b4f37cd8b7e2de993fdb03d64473598344145dd9 | 0 | eFaps/eFapsApp-ElectronicBilling | package org.efaps.esjp.electronicbilling.util;
import java.util.UUID;
import org.efaps.admin.common.SystemConfiguration;
import org.efaps.admin.program.esjp.EFapsApplication;
import org.efaps.admin.program.esjp.EFapsUUID;
import org.efaps.api.annotation.EFapsSysConfAttribute;
import org.efaps.api.annotation.EFapsSystemConfiguration;
import org.efaps.esjp.admin.common.systemconfiguration.BooleanSysConfAttribute;
import org.efaps.esjp.admin.common.systemconfiguration.IntegerSysConfAttribute;
import org.efaps.esjp.admin.common.systemconfiguration.PropertiesSysConfAttribute;
import org.efaps.esjp.admin.common.systemconfiguration.StringSysConfAttribute;
import org.efaps.esjp.ci.CIEBilling;
import org.efaps.esjp.ci.CISales;
import org.efaps.util.cache.CacheReloadException;
/**
* TODO comment!
*
* @author The eFaps Team
*/
@EFapsUUID("8ed79746-51c8-4590-b9bc-1716e1c0a2d3")
@EFapsApplication("eFapsApp-ElectronicBilling")
@EFapsSystemConfiguration("451e21b9-27ff-4378-adfa-a578a9ba0b51")
public final class ElectronicBilling
{
/** The base. */
public static final String BASE = "org.efaps.electronicbilling.";
/** Sales-Configuration. */
public static final UUID SYSCONFUUID = UUID.fromString("451e21b9-27ff-4378-adfa-a578a9ba0b51");
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute DOCMAPPING = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "DocumentMapping")
.description("Config for Document to EBilling Document relation")
.addDefaultValue(CISales.Invoice.getType().getName(), CIEBilling.Invoice.getType().getName())
.addDefaultValue(CIEBilling.Invoice.getType().getName() + ".CreateStatus",
CIEBilling.InvoiceStatus.Pending.key)
.addDefaultValue(CISales.Receipt.getType().getName(), CIEBilling.Receipt.getType().getName())
.addDefaultValue(CIEBilling.Receipt.getType().getName() + ".CreateStatus",
CIEBilling.ReceiptStatus.Pending.key)
.addDefaultValue(CISales.CreditNote.getType().getName(), CIEBilling.CreditNote.getType().getName())
.addDefaultValue(CIEBilling.CreditNote.getType().getName() + ".CreateStatus",
CIEBilling.CreditNoteStatus.Pending.key)
.addDefaultValue(CISales.Reminder.getType().getName(), CIEBilling.Reminder.getType().getName())
.addDefaultValue(CIEBilling.Reminder.getType().getName() + ".CreateStatus",
CIEBilling.ReminderStatus.Pending.key);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute QUERYBLDR4DOCSCAN = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "QueryBldr4DocumentScanner")
.description("QueryBuilder for Include Scanner")
.addDefaultValue("Type01", CISales.Invoice.getType().getName())
.addDefaultValue("StatusGroup01", CISales.InvoiceStatus.getType().getName())
.addDefaultValue("Status01", CISales.InvoiceStatus.Open.key)
.addDefaultValue("StatusGroup02", CISales.InvoiceStatus.getType().getName())
.addDefaultValue("Status02", CISales.InvoiceStatus.Paid.key)
.addDefaultValue("Type02", CISales.Receipt.getType().getName())
.addDefaultValue("StatusGroup03", CISales.ReceiptStatus.getType().getName())
.addDefaultValue("Status03", CISales.ReceiptStatus.Open.key)
.addDefaultValue("StatusGroup04", CISales.ReceiptStatus.getType().getName())
.addDefaultValue("Status04", CISales.ReceiptStatus.Paid.key)
.addDefaultValue("Type03", CISales.CreditNote.getType().getName())
.addDefaultValue("StatusGroup05", CISales.CreditNoteStatus.getType().getName())
.addDefaultValue("Status05", CISales.CreditNoteStatus.Open.key)
.addDefaultValue("StatusGroup06", CISales.CreditNoteStatus.getType().getName())
.addDefaultValue("Status06", CISales.CreditNoteStatus.Paid.key)
.addDefaultValue("Type04", CISales.Reminder.getType().getName())
.addDefaultValue("StatusGroup07", CISales.ReminderStatus.getType().getName())
.addDefaultValue("Status07", CISales.ReminderStatus.Open.key)
.addDefaultValue("StatusGroup08", CISales.ReminderStatus.getType().getName())
.addDefaultValue("Status08", CISales.ReminderStatus.Paid.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute ACTIVATEMAIL = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "ActivateMailing")
.description("Activate the evaluation for mails.")
.defaultValue(false);
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute INVOICE_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.InvoiceStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute INVOICE_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.Activate")
.description("Activate Invoice")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute INVOICE_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.CreateReport")
.description("Activate the creation of the Report for Invoice")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute INVOICE_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.Verification")
.description("Properties that permit to define when an Electronic Invoice should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute RECEIPT_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.ReceiptStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RECEIPT_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.Activate")
.description("Activate Receipt")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RECEIPT_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.CreateReport")
.description("Activate the creation of the Report for Receipt")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute RECEIPT_VERIFY = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.Verification")
.description("Properties that permit to define when an Electronic Receipt should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final IntegerSysConfAttribute RECEIPT_ANONYMOUSTHRESHOLD = new IntegerSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.AnonymousThreshold")
.defaultValue(700)
.description("Amount in BaseCurrency that requires Named receipts and not anonymous");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute REMINDER_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.ReminderStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute REMINDER_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.Activate")
.description("Activate Reminder")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute REMINDER_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.CreateReport")
.description("Activate the creation of the Report for Reminder")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute REMINDER_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.Verification")
.description("Properties that permit to define when an Electronic Reminder should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute CREDITNOTE_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.CreditNoteStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute CREDITNOTE_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.Activate")
.description("Activate CreditNote")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute CREDITNOTE_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.CreateReport")
.description("Activate the creation of the Report for CreditNote")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute CREDITNOTE_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.Verification")
.description("Properties that permit to define when an Electronic CreditNote should be aborted.");
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute PREMISESCODE_BY_SERIAL = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "PremisesCode.BySerial")
.description("Mapping of Serial to Establecimiento\n"
+ "Uses StartsWith as comparision.\n"
+ "F001=14\n"
+ "FC003=14");
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute TAXMAPPING = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "TaxMapping")
.description("Tax Mapping")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.id", "VAT")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.nombre", "IGV")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.sunat-id", "1000")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.afectacion-igv", "10");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute ISSUER_EMAIL = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Issuer.Email")
.description("defines the issuer email")
.defaultValue("[email protected]");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute PAYMENTMETHODREGEX = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "PaymentMethod.Regex")
.description("Name of ChannelSalesCondition will be matched against this to be included");
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RETENTION_ISAGENT = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "retention.IsAgent")
.defaultValue(false)
.description("Is the Current Company \"Agente de Retencion\"");
@EFapsSysConfAttribute
public static final StringSysConfAttribute RETENTION_PERCENTAGE = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "retention.Percentage")
.defaultValue("3")
.description("Is the Current Company \"Agente de Retencion\"");
/**
* @return the SystemConfigruation for Sales
* @throws CacheReloadException on error
*/
public static SystemConfiguration getSysConfig()
throws CacheReloadException
{
return SystemConfiguration.get(ElectronicBilling.SYSCONFUUID);
}
}
| src/main/efaps/ESJP/org/efaps/esjp/electronicbilling/util/ElectronicBilling.java | package org.efaps.esjp.electronicbilling.util;
import java.util.UUID;
import org.efaps.admin.common.SystemConfiguration;
import org.efaps.admin.program.esjp.EFapsApplication;
import org.efaps.admin.program.esjp.EFapsUUID;
import org.efaps.api.annotation.EFapsSysConfAttribute;
import org.efaps.api.annotation.EFapsSystemConfiguration;
import org.efaps.esjp.admin.common.systemconfiguration.BooleanSysConfAttribute;
import org.efaps.esjp.admin.common.systemconfiguration.PropertiesSysConfAttribute;
import org.efaps.esjp.admin.common.systemconfiguration.StringSysConfAttribute;
import org.efaps.esjp.ci.CIEBilling;
import org.efaps.esjp.ci.CISales;
import org.efaps.util.cache.CacheReloadException;
/**
* TODO comment!
*
* @author The eFaps Team
*/
@EFapsUUID("8ed79746-51c8-4590-b9bc-1716e1c0a2d3")
@EFapsApplication("eFapsApp-ElectronicBilling")
@EFapsSystemConfiguration("451e21b9-27ff-4378-adfa-a578a9ba0b51")
public final class ElectronicBilling
{
/** The base. */
public static final String BASE = "org.efaps.electronicbilling.";
/** Sales-Configuration. */
public static final UUID SYSCONFUUID = UUID.fromString("451e21b9-27ff-4378-adfa-a578a9ba0b51");
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute DOCMAPPING = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "DocumentMapping")
.description("Config for Document to EBilling Document relation")
.addDefaultValue(CISales.Invoice.getType().getName(), CIEBilling.Invoice.getType().getName())
.addDefaultValue(CIEBilling.Invoice.getType().getName() + ".CreateStatus",
CIEBilling.InvoiceStatus.Pending.key)
.addDefaultValue(CISales.Receipt.getType().getName(), CIEBilling.Receipt.getType().getName())
.addDefaultValue(CIEBilling.Receipt.getType().getName() + ".CreateStatus",
CIEBilling.ReceiptStatus.Pending.key)
.addDefaultValue(CISales.CreditNote.getType().getName(), CIEBilling.CreditNote.getType().getName())
.addDefaultValue(CIEBilling.CreditNote.getType().getName() + ".CreateStatus",
CIEBilling.CreditNoteStatus.Pending.key)
.addDefaultValue(CISales.Reminder.getType().getName(), CIEBilling.Reminder.getType().getName())
.addDefaultValue(CIEBilling.Reminder.getType().getName() + ".CreateStatus",
CIEBilling.ReminderStatus.Pending.key);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute QUERYBLDR4DOCSCAN = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "QueryBldr4DocumentScanner")
.description("QueryBuilder for Include Scanner")
.addDefaultValue("Type01", CISales.Invoice.getType().getName())
.addDefaultValue("StatusGroup01", CISales.InvoiceStatus.getType().getName())
.addDefaultValue("Status01", CISales.InvoiceStatus.Open.key)
.addDefaultValue("StatusGroup02", CISales.InvoiceStatus.getType().getName())
.addDefaultValue("Status02", CISales.InvoiceStatus.Paid.key)
.addDefaultValue("Type02", CISales.Receipt.getType().getName())
.addDefaultValue("StatusGroup03", CISales.ReceiptStatus.getType().getName())
.addDefaultValue("Status03", CISales.ReceiptStatus.Open.key)
.addDefaultValue("StatusGroup04", CISales.ReceiptStatus.getType().getName())
.addDefaultValue("Status04", CISales.ReceiptStatus.Paid.key)
.addDefaultValue("Type03", CISales.CreditNote.getType().getName())
.addDefaultValue("StatusGroup05", CISales.CreditNoteStatus.getType().getName())
.addDefaultValue("Status05", CISales.CreditNoteStatus.Open.key)
.addDefaultValue("StatusGroup06", CISales.CreditNoteStatus.getType().getName())
.addDefaultValue("Status06", CISales.CreditNoteStatus.Paid.key)
.addDefaultValue("Type04", CISales.Reminder.getType().getName())
.addDefaultValue("StatusGroup07", CISales.ReminderStatus.getType().getName())
.addDefaultValue("Status07", CISales.ReminderStatus.Open.key)
.addDefaultValue("StatusGroup08", CISales.ReminderStatus.getType().getName())
.addDefaultValue("Status08", CISales.ReminderStatus.Paid.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute ACTIVATEMAIL = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "ActivateMailing")
.description("Activate the evaluation for mails.")
.defaultValue(false);
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute INVOICE_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.InvoiceStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute INVOICE_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.Activate")
.description("Activate Invoice")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute INVOICE_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.CreateReport")
.description("Activate the creation of the Report for Invoice")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute INVOICE_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Invoice.Verification")
.description("Properties that permit to define when an Electronic Invoice should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute RECEIPT_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.ReceiptStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RECEIPT_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.Activate")
.description("Activate Receipt")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RECEIPT_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.CreateReport")
.description("Activate the creation of the Report for Receipt")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute RECEIPT_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Receipt.Verification")
.description("Properties that permit to define when an Electronic Receipt should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute REMINDER_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.ReminderStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute REMINDER_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.Activate")
.description("Activate Reminder")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute REMINDER_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.CreateReport")
.description("Activate the creation of the Report for Reminder")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute REMINDER_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Reminder.Verification")
.description("Properties that permit to define when an Electronic Reminder should be aborted.");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute CREDITNOTE_CREATEONSTATUS = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.CreateOnStatusChange")
.description("Activate the mechanism to create the electronic billing document on statsu change")
.defaultValue(CISales.CreditNoteStatus.Open.key);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute CREDITNOTE_ACTIVE = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.Activate")
.description("Activate CreditNote")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute CREDITNOTE_CREATEREPORT= new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.CreateReport")
.description("Activate the creation of the Report for CreditNote")
.defaultValue(true);
/** See description. */
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute CREDITNOTE_VERIFY= new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "CreditNote.Verification")
.description("Properties that permit to define when an Electronic CreditNote should be aborted.");
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute PREMISESCODE_BY_SERIAL = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "PremisesCode.BySerial")
.description("Mapping of Serial to Establecimiento\n"
+ "Uses StartsWith as comparision.\n"
+ "F001=14\n"
+ "FC003=14");
@EFapsSysConfAttribute
public static final PropertiesSysConfAttribute TAXMAPPING = new PropertiesSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "TaxMapping")
.description("Tax Mapping")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.id", "VAT")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.nombre", "IGV")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.sunat-id", "1000")
.addDefaultValue("tax.06e40be6-40d8-44f4-9d8f-585f2f97ce63.afectacion-igv", "10");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute ISSUER_EMAIL = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "Issuer.Email")
.description("defines the issuer email")
.defaultValue("[email protected]");
/** See description. */
@EFapsSysConfAttribute
public static final StringSysConfAttribute PAYMENTMETHODREGEX = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "PaymentMethod.Regex")
.description("Name of ChannelSalesCondition will be matched against this to be included");
@EFapsSysConfAttribute
public static final BooleanSysConfAttribute RETENTION_ISAGENT = new BooleanSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "retention.IsAgent")
.defaultValue(false)
.description("Is the Current Company \"Agente de Retencion\"");
@EFapsSysConfAttribute
public static final StringSysConfAttribute RETENTION_PERCENTAGE = new StringSysConfAttribute()
.sysConfUUID(ElectronicBilling.SYSCONFUUID)
.key(ElectronicBilling.BASE + "retention.Percentage")
.defaultValue("3")
.description("Is the Current Company \"Agente de Retencion\"");
/**
* @return the SystemConfigruation for Sales
* @throws CacheReloadException on error
*/
public static SystemConfiguration getSysConfig()
throws CacheReloadException
{
return SystemConfiguration.get(ElectronicBilling.SYSCONFUUID);
}
}
| Add config | src/main/efaps/ESJP/org/efaps/esjp/electronicbilling/util/ElectronicBilling.java | Add config | <ide><path>rc/main/efaps/ESJP/org/efaps/esjp/electronicbilling/util/ElectronicBilling.java
<ide> import org.efaps.api.annotation.EFapsSysConfAttribute;
<ide> import org.efaps.api.annotation.EFapsSystemConfiguration;
<ide> import org.efaps.esjp.admin.common.systemconfiguration.BooleanSysConfAttribute;
<add>import org.efaps.esjp.admin.common.systemconfiguration.IntegerSysConfAttribute;
<ide> import org.efaps.esjp.admin.common.systemconfiguration.PropertiesSysConfAttribute;
<ide> import org.efaps.esjp.admin.common.systemconfiguration.StringSysConfAttribute;
<ide> import org.efaps.esjp.ci.CIEBilling;
<ide>
<ide> /** See description. */
<ide> @EFapsSysConfAttribute
<del> public static final PropertiesSysConfAttribute RECEIPT_VERIFY= new PropertiesSysConfAttribute()
<add> public static final PropertiesSysConfAttribute RECEIPT_VERIFY = new PropertiesSysConfAttribute()
<ide> .sysConfUUID(ElectronicBilling.SYSCONFUUID)
<ide> .key(ElectronicBilling.BASE + "Receipt.Verification")
<ide> .description("Properties that permit to define when an Electronic Receipt should be aborted.");
<add>
<add>
<add> /** See description. */
<add> @EFapsSysConfAttribute
<add> public static final IntegerSysConfAttribute RECEIPT_ANONYMOUSTHRESHOLD = new IntegerSysConfAttribute()
<add> .sysConfUUID(ElectronicBilling.SYSCONFUUID)
<add> .key(ElectronicBilling.BASE + "Receipt.AnonymousThreshold")
<add> .defaultValue(700)
<add> .description("Amount in BaseCurrency that requires Named receipts and not anonymous");
<ide>
<ide> /** See description. */
<ide> @EFapsSysConfAttribute |
|
Java | mit | 95879d1c63dce476013380da38e4f0ebd4cb9245 | 0 | rocket-internet-berlin/RocketBucket,rocket-internet-berlin/RocketBucket,rocket-internet-berlin/RocketBucket,rocket-internet-berlin/RocketBucket | package de.rocketinternet.android.bucket;
import android.content.Context;
import android.text.TextUtils;
import java.io.File;
import java.util.concurrent.TimeUnit;
/**
* @author Sameh Gerges
*/
public class Config {
static private final String DIR_NAME_CACHING = "rocket_bucket_cache";
static public final int CACHE_SIZE = 1 * 1024 * 1024; // 1 MiB
private String mEndpoint;
private String mApiKey;
private long mReadTimeout;
private boolean mDebug;
private Config() {
}
public String getApiKey() {
return mApiKey;
}
public String getEndpoint() {
return mEndpoint;
}
public long getReadTimeout() {
return mReadTimeout;
}
public boolean isBlockAppTillExperimentsLoaded(){
return mReadTimeout > 0;
}
public boolean isDebug(){
return mDebug;
}
public File getCachingDir(Context context) {
return new File(context.getCacheDir(), DIR_NAME_CACHING);
}
public File getBucketsCachingFile(Context context){
return new File(getCachingDir(context), "rocket_bucket.local");
}
public static final class Builder {
private Config config;
public Builder() {
config = new Config();
}
/**
* @param apiKey provided by RocketBucket server for more info https://github.com/rocket-internet-berlin/RocketBucket
*/
public Builder apiKey(String apiKey) {
config.mApiKey = apiKey;
return this;
}
public Builder endpoint(String val) {
config.mEndpoint = val;
return this;
}
/**
* If it value greater than 0, it will block {@code RocketBucket.initialize} caller thread till loading experiments data.
* This blocking behaviour will happen only at first time loading experiments. Otherwise will use local cached experiments till loading fresh copy.
*/
public Builder blockAppTillExperimentsLoaded(int timeout, TimeUnit unit) {
if (timeout < 0) throw new IllegalArgumentException("timeout < 0");
if (unit == null) throw new NullPointerException("unit == null");
long millis = unit.toMillis(timeout);
if (millis > Integer.MAX_VALUE) throw new IllegalArgumentException("Timeout too large.");
if (millis == 0 && timeout > 0) throw new IllegalArgumentException("Timeout too small.");
config.mReadTimeout = millis;
return this;
}
/**
* @param isDebug value to indicate whither or not to show debugging view on different activities in order to mannually test different buckets while
* running the app without server code change
* @return
*/
public Builder debugMode(boolean isDebug){
config.mDebug = isDebug;
return this;
}
public Config build() {
if (TextUtils.isEmpty(config.mApiKey) || TextUtils.isEmpty(config.mEndpoint) ) {
throw new IllegalStateException("endpoint and api key cannot be null! or empty");
}
return config;
}
}
}
| android/RIBucket/src/main/java/de/rocketinternet/android/bucket/Config.java | package de.rocketinternet.android.bucket;
import android.content.Context;
import android.text.TextUtils;
import java.io.File;
import java.util.concurrent.TimeUnit;
/**
* @author Sameh Gerges
*/
public class Config {
static private final String DIR_NAME_CACHING = "rocket_bucket_cache";
static public final int CACHE_SIZE = 1 * 1024 * 1024; // 1 MiB
private String mEndpoint;
private String mApiKey;
private long mReadTimeout;
private boolean mDebug;
private Config() {
}
public String getApiKey() {
return mApiKey;
}
public String getEndpoint() {
return mEndpoint;
}
public long getReadTimeout() {
return mReadTimeout;
}
public boolean isBlockAppTillExperimentsLoaded(){
return mReadTimeout > 0;
}
public boolean isDebug(){
return mDebug;
}
public File getCachingDir(Context context) {
return new File(context.getCacheDir(), DIR_NAME_CACHING);
}
public File getBucketsCachingFile(Context context){
return new File(getCachingDir(context), "rocket_bucket.local");
}
public static final class Builder {
private Config config;
public Builder() {
config = new Config();
}
/**
* @param apiKey provided by RocketBucket server for more info https://github.com/rocket-internet-berlin/RocketBucket
*/
public Builder apiKey(String apiKey) {
config.mApiKey = apiKey;
return this;
}
public Builder endpoint(String val) {
config.mEndpoint = val;
return this;
}
/**
* If it value greater than 0, it will block {@code RocketBucket.initialize} caller thread till loading experiments data.
* This blocking behaviour will happen only at first time loading experiments. Otherwise will use local cached experiments till loading fresh copy.
*/
public Builder blockAppTillExperimentsLoaded(int timeout, TimeUnit unit) {
if (timeout < 0) throw new IllegalArgumentException("timeout < 0");
if (unit == null) throw new NullPointerException("unit == null");
long millis = unit.toMillis(timeout);
if (millis > Integer.MAX_VALUE) throw new IllegalArgumentException("Timeout too large.");
if (millis == 0 && timeout > 0) throw new IllegalArgumentException("Timeout too small.");
config.mReadTimeout = millis;
return this;
}
/**
* @param isDebug value to indicate whither or not to show debugging view on different activities in order to mannually test different buckets while
* running the app without server code change
* @return
*/
public Builder debugMode(boolean isDebug){
config.mDebug = isDebug;
return this;
}
public Config build() {
if (TextUtils.isEmpty(config.mApiKey) || TextUtils.isEmpty(config.mApiKey) ) {
throw new IllegalStateException("endpoint and api key cannot be null! or empty");
}
return config;
}
}
}
| Correcting empty string check | android/RIBucket/src/main/java/de/rocketinternet/android/bucket/Config.java | Correcting empty string check | <ide><path>ndroid/RIBucket/src/main/java/de/rocketinternet/android/bucket/Config.java
<ide> }
<ide>
<ide> public Config build() {
<del> if (TextUtils.isEmpty(config.mApiKey) || TextUtils.isEmpty(config.mApiKey) ) {
<add> if (TextUtils.isEmpty(config.mApiKey) || TextUtils.isEmpty(config.mEndpoint) ) {
<ide> throw new IllegalStateException("endpoint and api key cannot be null! or empty");
<ide> }
<ide> |
|
Java | apache-2.0 | 2f0965bdd7012103c72b5687648247d129dc4ca0 | 0 | apache/incubator-shardingsphere,leeyazhou/sharding-jdbc,leeyazhou/sharding-jdbc,leeyazhou/sharding-jdbc,apache/incubator-shardingsphere,apache/incubator-shardingsphere,apache/incubator-shardingsphere,leeyazhou/sharding-jdbc | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.shardingsphere.shardingjdbc.jdbc.core.context;
import lombok.Getter;
import org.apache.shardingsphere.core.metadata.table.ColumnMetaData;
import org.apache.shardingsphere.core.metadata.table.TableMetaData;
import org.apache.shardingsphere.core.metadata.table.TableMetas;
import org.apache.shardingsphere.core.rule.EncryptRule;
import org.apache.shardingsphere.spi.database.DatabaseType;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
/**
* Runtime context for encrypt.
*
* @author zhangliang
*/
@Getter
public final class EncryptRuntimeContext extends AbstractRuntimeContext<EncryptRule> {
private final TableMetas tableMetas;
public EncryptRuntimeContext(final DataSource dataSource, final EncryptRule rule, final Properties props, final DatabaseType databaseType) throws SQLException {
super(rule, props, databaseType);
tableMetas = createEncryptTableMetas(dataSource, rule);
}
private TableMetas createEncryptTableMetas(final DataSource dataSource, final EncryptRule encryptRule) throws SQLException {
Map<String, TableMetaData> tables = new LinkedHashMap<>();
try (Connection connection = dataSource.getConnection()) {
for (String each : encryptRule.getEncryptTableNames()) {
if (isTableExist(connection, each)) {
tables.put(each, new TableMetaData(getColumnMetaDataList(connection, each)));
}
}
}
return new TableMetas(tables);
}
private boolean isTableExist(final Connection connection, final String tableName) throws SQLException {
try (ResultSet resultSet = connection.getMetaData().getTables(connection.getCatalog(), null, tableName, null)) {
return resultSet.next();
}
}
private List<ColumnMetaData> getColumnMetaDataList(final Connection connection, final String tableName) throws SQLException {
List<ColumnMetaData> result = new LinkedList<>();
Collection<String> primaryKeys = getPrimaryKeys(connection, tableName);
try (ResultSet resultSet = connection.getMetaData().getColumns(connection.getCatalog(), null, tableName, "%")) {
while (resultSet.next()) {
String columnName = resultSet.getString("COLUMN_NAME");
String columnType = resultSet.getString("TYPE_NAME");
result.add(new ColumnMetaData(columnName, columnType, primaryKeys.contains(columnName)));
}
}
return result;
}
private Collection<String> getPrimaryKeys(final Connection connection, final String tableName) throws SQLException {
Collection<String> result = new HashSet<>();
try (ResultSet resultSet = connection.getMetaData().getPrimaryKeys(connection.getCatalog(), null, tableName)) {
while (resultSet.next()) {
result.add(resultSet.getString("COLUMN_NAME"));
}
}
return result;
}
}
| sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/context/EncryptRuntimeContext.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.shardingsphere.shardingjdbc.jdbc.core.context;
import com.google.common.base.Optional;
import lombok.Getter;
import org.apache.shardingsphere.core.metadata.table.ColumnMetaData;
import org.apache.shardingsphere.core.metadata.table.TableMetaData;
import org.apache.shardingsphere.core.metadata.table.TableMetas;
import org.apache.shardingsphere.core.metadata.table.sharding.ShardingTableMetaData;
import org.apache.shardingsphere.core.rule.EncryptRule;
import org.apache.shardingsphere.spi.database.DatabaseType;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
/**
* Runtime context for encrypt.
*
* @author zhangliang
*/
@Getter
public final class EncryptRuntimeContext extends AbstractRuntimeContext<EncryptRule> {
private final TableMetas tableMetas;
public EncryptRuntimeContext(final DataSource dataSource, final EncryptRule rule, final Properties props, final DatabaseType databaseType) throws SQLException {
super(rule, props, databaseType);
tableMetas = createEncryptTableMetas(dataSource, rule);
}
private TableMetas createEncryptTableMetas(final DataSource dataSource, final EncryptRule encryptRule) throws SQLException {
Map<String, TableMetaData> tables = new LinkedHashMap<>();
try (Connection connection = dataSource.getConnection()) {
for (String each : encryptRule.getEncryptTableNames()) {
if (isTableExist(connection, each)) {
tables.put(each, new ShardingTableMetaData(getColumnMetaDataList(connection, each), getLogicIndexes(connection, each)));
}
}
}
return new TableMetas(tables);
}
private boolean isTableExist(final Connection connection, final String tableName) throws SQLException {
try (ResultSet resultSet = connection.getMetaData().getTables(connection.getCatalog(), null, tableName, null)) {
return resultSet.next();
}
}
private List<ColumnMetaData> getColumnMetaDataList(final Connection connection, final String tableName) throws SQLException {
List<ColumnMetaData> result = new LinkedList<>();
Collection<String> primaryKeys = getPrimaryKeys(connection, tableName);
try (ResultSet resultSet = connection.getMetaData().getColumns(connection.getCatalog(), null, tableName, "%")) {
while (resultSet.next()) {
String columnName = resultSet.getString("COLUMN_NAME");
String columnType = resultSet.getString("TYPE_NAME");
result.add(new ColumnMetaData(columnName, columnType, primaryKeys.contains(columnName)));
}
}
return result;
}
private Collection<String> getPrimaryKeys(final Connection connection, final String tableName) throws SQLException {
Collection<String> result = new HashSet<>();
try (ResultSet resultSet = connection.getMetaData().getPrimaryKeys(connection.getCatalog(), null, tableName)) {
while (resultSet.next()) {
result.add(resultSet.getString("COLUMN_NAME"));
}
}
return result;
}
private Set<String> getLogicIndexes(final Connection connection, final String actualTableName) throws SQLException {
Set<String> result = new HashSet<>();
try (ResultSet resultSet = connection.getMetaData().getIndexInfo(connection.getCatalog(), connection.getCatalog(), actualTableName, false, false)) {
while (resultSet.next()) {
Optional<String> logicIndex = getLogicIndex(resultSet.getString("INDEX_NAME"), actualTableName);
if (logicIndex.isPresent()) {
result.add(logicIndex.get());
}
}
}
return result;
}
private Optional<String> getLogicIndex(final String actualIndexName, final String actualTableName) {
String indexNameSuffix = "_" + actualTableName;
if (actualIndexName.contains(indexNameSuffix)) {
return Optional.of(actualIndexName.replace(indexNameSuffix, ""));
}
return Optional.absent();
}
}
| for #2900, use TableMetaData on EncryptRuntimeContext
| sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/context/EncryptRuntimeContext.java | for #2900, use TableMetaData on EncryptRuntimeContext | <ide><path>harding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/context/EncryptRuntimeContext.java
<ide>
<ide> package org.apache.shardingsphere.shardingjdbc.jdbc.core.context;
<ide>
<del>import com.google.common.base.Optional;
<ide> import lombok.Getter;
<ide> import org.apache.shardingsphere.core.metadata.table.ColumnMetaData;
<ide> import org.apache.shardingsphere.core.metadata.table.TableMetaData;
<ide> import org.apache.shardingsphere.core.metadata.table.TableMetas;
<del>import org.apache.shardingsphere.core.metadata.table.sharding.ShardingTableMetaData;
<ide> import org.apache.shardingsphere.core.rule.EncryptRule;
<ide> import org.apache.shardingsphere.spi.database.DatabaseType;
<ide>
<ide> import java.util.List;
<ide> import java.util.Map;
<ide> import java.util.Properties;
<del>import java.util.Set;
<ide>
<ide> /**
<ide> * Runtime context for encrypt.
<ide> try (Connection connection = dataSource.getConnection()) {
<ide> for (String each : encryptRule.getEncryptTableNames()) {
<ide> if (isTableExist(connection, each)) {
<del> tables.put(each, new ShardingTableMetaData(getColumnMetaDataList(connection, each), getLogicIndexes(connection, each)));
<add> tables.put(each, new TableMetaData(getColumnMetaDataList(connection, each)));
<ide> }
<ide> }
<ide> }
<ide> }
<ide> return result;
<ide> }
<del>
<del> private Set<String> getLogicIndexes(final Connection connection, final String actualTableName) throws SQLException {
<del> Set<String> result = new HashSet<>();
<del> try (ResultSet resultSet = connection.getMetaData().getIndexInfo(connection.getCatalog(), connection.getCatalog(), actualTableName, false, false)) {
<del> while (resultSet.next()) {
<del> Optional<String> logicIndex = getLogicIndex(resultSet.getString("INDEX_NAME"), actualTableName);
<del> if (logicIndex.isPresent()) {
<del> result.add(logicIndex.get());
<del> }
<del> }
<del> }
<del> return result;
<del> }
<del>
<del> private Optional<String> getLogicIndex(final String actualIndexName, final String actualTableName) {
<del> String indexNameSuffix = "_" + actualTableName;
<del> if (actualIndexName.contains(indexNameSuffix)) {
<del> return Optional.of(actualIndexName.replace(indexNameSuffix, ""));
<del> }
<del> return Optional.absent();
<del> }
<ide> } |
|
Java | mpl-2.0 | 33e971caf21b3e384bc46416469b1d8b005282ad | 0 | Helioviewer-Project/JHelioviewer-SWHV,Helioviewer-Project/JHelioviewer-SWHV,Helioviewer-Project/JHelioviewer-SWHV,Helioviewer-Project/JHelioviewer-SWHV,Helioviewer-Project/JHelioviewer-SWHV | package org.helioviewer.gl3d.model;
import org.helioviewer.gl3d.scenegraph.GL3DGroup;
import org.helioviewer.gl3d.scenegraph.GL3DState;
/**
* Grouping Object for all artificial objects, that is visual assistance objects
* that do not represent any real data.
*
* @author Simon Spoerri ([email protected])
*
*/
public class GL3DArtificialObjects extends GL3DGroup {
public GL3DArtificialObjects() {
super("Artificial Objects");
}
@Override
public void shapeDraw(GL3DState state) {
super.shapeDraw(state);
}
} | src/jhv-3d/src/org/helioviewer/gl3d/model/GL3DArtificialObjects.java | package org.helioviewer.gl3d.model;
import org.helioviewer.gl3d.scenegraph.GL3DGroup;
import org.helioviewer.gl3d.scenegraph.GL3DState;
/**
* Grouping Object for all artificial objects, that is visual assistance objects
* that do not represent any real data.
*
* @author Simon Spoerri ([email protected])
*
*/
public class GL3DArtificialObjects extends GL3DGroup {
public GL3DArtificialObjects() {
super("Artificial Objects");
// GL3DGroup indicatorArrows = new GL3DModel("Arrows",
// "Arrows indicating the viewspace axes");
// this.addNode(indicatorArrows);
//GL3DGrid grid = new GL3DGrid("grid", 20, 20, new
//GL3DVec4f(1.0f,0.0f,0.0f,1.0f), new GL3DVec4d(0.0,1.0,0.0,1.0));
//this.addNode(grid);
// GL3DSphere blackSphere = new GL3DSphere(0.990*Constants.SunRadius,
// 20,20, new GL3DVec4f(0.0f, 0.0f, 0.0f, 1.0f) );
// this.addNode(blackSphere);
/*
* GL3DShape xAxis = new GL3DArrow("X-Axis", Constants.SunRadius / 20,
* Constants.SunRadius, 32, new GL3DVec4f(1, 0, 0.5f, 0.2f));
* xAxis.modelView().rotate(Math.PI / 2, 0, 1, 0);
* indicatorArrows.addNode(xAxis); GL3DShape yAxis = new
* GL3DArrow("Y-Axis", Constants.SunRadius / 20, Constants.SunRadius,
* 32, new GL3DVec4f(0, 1, 0, 0.2f)); yAxis.modelView().rotate(-Math.PI
* / 2, GL3DVec3d.XAxis); indicatorArrows.addNode(yAxis); GL3DShape
* zAxis = new GL3DArrow("Z-Axis", Constants.SunRadius / 20,
* Constants.SunRadius, 32, new GL3DVec4f(0, 0.5f, 1, 0.2f));
* indicatorArrows.addNode(zAxis);
*/
}
@Override
public void shapeDraw(GL3DState state) {
super.shapeDraw(state);
}
} | Remove commented code
git-svn-id: 4e353c0944fe8da334633afc35765ef362dec675@3131 b4e469a2-07ce-4b26-9273-4d7d95a670c7
| src/jhv-3d/src/org/helioviewer/gl3d/model/GL3DArtificialObjects.java | Remove commented code | <ide><path>rc/jhv-3d/src/org/helioviewer/gl3d/model/GL3DArtificialObjects.java
<ide>
<ide> public GL3DArtificialObjects() {
<ide> super("Artificial Objects");
<del> // GL3DGroup indicatorArrows = new GL3DModel("Arrows",
<del> // "Arrows indicating the viewspace axes");
<del> // this.addNode(indicatorArrows);
<del> //GL3DGrid grid = new GL3DGrid("grid", 20, 20, new
<del> //GL3DVec4f(1.0f,0.0f,0.0f,1.0f), new GL3DVec4d(0.0,1.0,0.0,1.0));
<del> //this.addNode(grid);
<del> // GL3DSphere blackSphere = new GL3DSphere(0.990*Constants.SunRadius,
<del> // 20,20, new GL3DVec4f(0.0f, 0.0f, 0.0f, 1.0f) );
<del> // this.addNode(blackSphere);
<del> /*
<del> * GL3DShape xAxis = new GL3DArrow("X-Axis", Constants.SunRadius / 20,
<del> * Constants.SunRadius, 32, new GL3DVec4f(1, 0, 0.5f, 0.2f));
<del> * xAxis.modelView().rotate(Math.PI / 2, 0, 1, 0);
<del> * indicatorArrows.addNode(xAxis); GL3DShape yAxis = new
<del> * GL3DArrow("Y-Axis", Constants.SunRadius / 20, Constants.SunRadius,
<del> * 32, new GL3DVec4f(0, 1, 0, 0.2f)); yAxis.modelView().rotate(-Math.PI
<del> * / 2, GL3DVec3d.XAxis); indicatorArrows.addNode(yAxis); GL3DShape
<del> * zAxis = new GL3DArrow("Z-Axis", Constants.SunRadius / 20,
<del> * Constants.SunRadius, 32, new GL3DVec4f(0, 0.5f, 1, 0.2f));
<del> * indicatorArrows.addNode(zAxis);
<del> */
<ide> }
<ide>
<ide> @Override |
|
Java | apache-2.0 | 5a39379cbcf6b7f4ed4f7c7aae444ca7ca4edb22 | 0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.metrics;
import ai.vespa.util.http.VespaHttpClientBuilder;
import com.yahoo.log.LogLevel;
import com.yahoo.slime.ArrayTraverser;
import com.yahoo.slime.Inspector;
import com.yahoo.slime.Slime;
import com.yahoo.vespa.config.SlimeUtils;
import com.yahoo.yolean.Exceptions;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
/**
* Client for reaching out to nodes in an application instance and get their
* metrics.
*
* @author olaa
* @author ogronnesby
*/
public class ClusterMetricsRetriever {
private static final Logger log = Logger.getLogger(ClusterMetricsRetriever.class.getName());
private static final String VESPA_CONTAINER = "vespa.container";
private static final String VESPA_QRSERVER = "vespa.qrserver";
private static final String VESPA_DISTRIBUTOR = "vespa.distributor";
private static final List<String> WANTED_METRIC_SERVICES = List.of(VESPA_CONTAINER, VESPA_QRSERVER, VESPA_DISTRIBUTOR);
private static final CloseableHttpClient httpClient = VespaHttpClientBuilder.create()
.setDefaultRequestConfig(RequestConfig.custom()
.setConnectTimeout(10 * 1000)
.setSocketTimeout(10 * 1000)
.build())
.build();
/**
* Call the metrics API on each host and aggregate the metrics
* into a single value, grouped by cluster.
*/
public Map<ClusterInfo, MetricsAggregator> requestMetricsGroupedByCluster(Collection<URI> hosts) {
Map<ClusterInfo, MetricsAggregator> clusterMetricsMap = new ConcurrentHashMap<>();
long startTime = System.currentTimeMillis();
Runnable retrieveMetricsJob = () ->
hosts.parallelStream().forEach(host ->
getHostMetrics(host, clusterMetricsMap)
);
ForkJoinPool threadPool = new ForkJoinPool(5);
threadPool.submit(retrieveMetricsJob);
threadPool.shutdown();
try {
threadPool.awaitTermination(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
log.log(LogLevel.DEBUG, () ->
String.format("Metric retrieval for %d nodes took %d milliseconds", hosts.size(), System.currentTimeMillis() - startTime)
);
return clusterMetricsMap;
}
private static void getHostMetrics(URI hostURI, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
Slime responseBody = doMetricsRequest(hostURI);
var parseError = responseBody.get().field("error_message");
if (parseError.valid()) {
log.info("Failed to retrieve metrics from " + hostURI + ": " + parseError.asString());
}
Inspector services = responseBody.get().field("services");
services.traverse((ArrayTraverser) (i, servicesInspector) ->
parseService(servicesInspector, clusterMetricsMap)
);
}
private static Slime doMetricsRequest(URI hostURI) {
HttpGet get = new HttpGet(hostURI);
try (CloseableHttpResponse response = httpClient.execute(get)) {
InputStream is = response.getEntity().getContent();
Slime slime = SlimeUtils.jsonToSlime(is.readAllBytes());
is.close();
return slime;
} catch (IOException e) {
// Usually caused by applications being deleted during metric retrieval
log.warning("Was unable to fetch metrics from " + hostURI + " : " + Exceptions.toMessageString(e));
return new Slime();
}
}
private static void parseService(Inspector service, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
String serviceName = service.field("name").asString();
service.field("metrics").traverse((ArrayTraverser) (i, metric) ->
addMetricsToAggeregator(serviceName, metric, clusterMetricsMap)
);
}
private static void addMetricsToAggeregator(String serviceName, Inspector metric, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
if (!WANTED_METRIC_SERVICES.contains(serviceName)) return;
Inspector values = metric.field("values");
ClusterInfo clusterInfo = getClusterInfoFromDimensions(metric.field("dimensions"));
MetricsAggregator metricsAggregator = clusterMetricsMap.computeIfAbsent(clusterInfo, c -> new MetricsAggregator());
switch (serviceName) {
case "vespa.container":
metricsAggregator.addContainerLatency(
values.field("query_latency.sum").asDouble(),
values.field("query_latency.count").asDouble());
metricsAggregator.addFeedLatency(
values.field("feed.latency.sum").asDouble(),
values.field("feed.latency.count").asDouble());
break;
case "vespa.qrserver":
metricsAggregator.addQrLatency(
values.field("query_latency.sum").asDouble(),
values.field("query_latency.count").asDouble());
break;
case "vespa.distributor":
metricsAggregator.addDocumentCount(values.field("vds.distributor.docsstored.average").asDouble());
break;
}
}
private static ClusterInfo getClusterInfoFromDimensions(Inspector dimensions) {
return new ClusterInfo(dimensions.field("clusterid").asString(), dimensions.field("clustertype").asString());
}
}
| configserver/src/main/java/com/yahoo/vespa/config/server/metrics/ClusterMetricsRetriever.java | // Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.metrics;
import ai.vespa.util.http.VespaHttpClientBuilder;
import com.yahoo.slime.ArrayTraverser;
import com.yahoo.slime.Inspector;
import com.yahoo.slime.Slime;
import com.yahoo.vespa.config.SlimeUtils;
import com.yahoo.yolean.Exceptions;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
/**
* Client for reaching out to nodes in an application instance and get their
* metrics.
*
* @author olaa
* @author ogronnesby
*/
public class ClusterMetricsRetriever {
private static final Logger log = Logger.getLogger(ClusterMetricsRetriever.class.getName());
private static final String VESPA_CONTAINER = "vespa.container";
private static final String VESPA_QRSERVER = "vespa.qrserver";
private static final String VESPA_DISTRIBUTOR = "vespa.distributor";
private static final List<String> WANTED_METRIC_SERVICES = List.of(VESPA_CONTAINER, VESPA_QRSERVER, VESPA_DISTRIBUTOR);
private static final CloseableHttpClient httpClient = VespaHttpClientBuilder.create()
.setDefaultRequestConfig(RequestConfig.custom()
.setConnectTimeout(10 * 1000)
.setSocketTimeout(10 * 1000)
.build())
.build();
/**
* Call the metrics API on each host and aggregate the metrics
* into a single value, grouped by cluster.
*/
public Map<ClusterInfo, MetricsAggregator> requestMetricsGroupedByCluster(Collection<URI> hosts) {
Map<ClusterInfo, MetricsAggregator> clusterMetricsMap = new ConcurrentHashMap<>();
Runnable retrieveMetricsJob = () ->
hosts.parallelStream().forEach(host ->
getHostMetrics(host, clusterMetricsMap)
);
ForkJoinPool threadPool = new ForkJoinPool(5);
threadPool.submit(retrieveMetricsJob);
threadPool.shutdown();
try {
threadPool.awaitTermination(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return clusterMetricsMap;
}
private static void getHostMetrics(URI hostURI, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
Slime responseBody = doMetricsRequest(hostURI);
var parseError = responseBody.get().field("error_message");
if (parseError.valid()) {
log.info("Failed to retrieve metrics from " + hostURI + ": " + parseError.asString());
}
Inspector services = responseBody.get().field("services");
services.traverse((ArrayTraverser) (i, servicesInspector) ->
parseService(servicesInspector, clusterMetricsMap)
);
}
private static Slime doMetricsRequest(URI hostURI) {
HttpGet get = new HttpGet(hostURI);
try (CloseableHttpResponse response = httpClient.execute(get)) {
InputStream is = response.getEntity().getContent();
Slime slime = SlimeUtils.jsonToSlime(is.readAllBytes());
is.close();
return slime;
} catch (IOException e) {
// Usually caused by applications being deleted during metric retrieval
log.warning("Was unable to fetch metrics from " + hostURI + " : " + Exceptions.toMessageString(e));
return new Slime();
}
}
private static void parseService(Inspector service, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
String serviceName = service.field("name").asString();
service.field("metrics").traverse((ArrayTraverser) (i, metric) ->
addMetricsToAggeregator(serviceName, metric, clusterMetricsMap)
);
}
private static void addMetricsToAggeregator(String serviceName, Inspector metric, Map<ClusterInfo, MetricsAggregator> clusterMetricsMap) {
if (!WANTED_METRIC_SERVICES.contains(serviceName)) return;
Inspector values = metric.field("values");
ClusterInfo clusterInfo = getClusterInfoFromDimensions(metric.field("dimensions"));
MetricsAggregator metricsAggregator = clusterMetricsMap.computeIfAbsent(clusterInfo, c -> new MetricsAggregator());
switch (serviceName) {
case "vespa.container":
metricsAggregator.addContainerLatency(
values.field("query_latency.sum").asDouble(),
values.field("query_latency.count").asDouble());
metricsAggregator.addFeedLatency(
values.field("feed.latency.sum").asDouble(),
values.field("feed.latency.count").asDouble());
break;
case "vespa.qrserver":
metricsAggregator.addQrLatency(
values.field("query_latency.sum").asDouble(),
values.field("query_latency.count").asDouble());
break;
case "vespa.distributor":
metricsAggregator.addDocumentCount(values.field("vds.distributor.docsstored.average").asDouble());
break;
}
}
private static ClusterInfo getClusterInfoFromDimensions(Inspector dimensions) {
return new ClusterInfo(dimensions.field("clusterid").asString(), dimensions.field("clustertype").asString());
}
}
| Debug metric retrieval execution time
| configserver/src/main/java/com/yahoo/vespa/config/server/metrics/ClusterMetricsRetriever.java | Debug metric retrieval execution time | <ide><path>onfigserver/src/main/java/com/yahoo/vespa/config/server/metrics/ClusterMetricsRetriever.java
<ide> package com.yahoo.vespa.config.server.metrics;
<ide>
<ide> import ai.vespa.util.http.VespaHttpClientBuilder;
<add>import com.yahoo.log.LogLevel;
<ide> import com.yahoo.slime.ArrayTraverser;
<ide> import com.yahoo.slime.Inspector;
<ide> import com.yahoo.slime.Slime;
<ide> public Map<ClusterInfo, MetricsAggregator> requestMetricsGroupedByCluster(Collection<URI> hosts) {
<ide> Map<ClusterInfo, MetricsAggregator> clusterMetricsMap = new ConcurrentHashMap<>();
<ide>
<add> long startTime = System.currentTimeMillis();
<ide> Runnable retrieveMetricsJob = () ->
<ide> hosts.parallelStream().forEach(host ->
<ide> getHostMetrics(host, clusterMetricsMap)
<ide> } catch (InterruptedException e) {
<ide> throw new RuntimeException(e);
<ide> }
<add>
<add> log.log(LogLevel.DEBUG, () ->
<add> String.format("Metric retrieval for %d nodes took %d milliseconds", hosts.size(), System.currentTimeMillis() - startTime)
<add> );
<add>
<ide> return clusterMetricsMap;
<ide> }
<ide> |
|
Java | mit | 4aebb485880a81e9f8813028c70404f2c0fcdd25 | 0 | vic/ioke-outdated,vic/ioke-outdated,vic/ioke-outdated,vic/ioke-outdated | /*
* See LICENSE file in distribution for copyright and licensing information.
*/
package ioke.lang;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.List;
import java.util.ArrayList;
import java.util.Properties;
import ioke.lang.exceptions.ControlFlow;
/**
* @author <a href="mailto:[email protected]">Ola Bini</a>
*/
public class Main {
private final static String HELP =
"Usage: ioke [switches] -- [programfile] [arguments]\n" +
" -Cdirectory execute with directory as CWD\n" +
" -d debug, set debug flag\n" +
" -e script execute the script. if provided, no program file is necessary.\n" +
" there can be many of these provided on the same command line.\n" +
" -h, --help help, this message\n" +
" -Idir add directory to 'System loadPath'. May be used more than once\n" +
" --copyright print the copyright\n" +
" --version print current version\n";
public static void main(String[] args) throws Throwable {
Runtime r = new Runtime();
r.init();
final IokeObject context = r.ground;
final Message mx = new Message(r, ".", null, Message.Type.TERMINATOR);
mx.setLine(0);
mx.setPosition(0);
final IokeObject message = r.createMessage(mx);
boolean debug = false;
String cwd = null;
List<String> scripts = new ArrayList<String>();
List<String> loadDirs = new ArrayList<String>();
try {
int start = 0;
boolean done = false;
boolean readStdin = false;
boolean printedSomething = false;
for(;!done && start<args.length;start++) {
String arg = args[start];
if(arg.length() > 0) {
if(arg.charAt(0) != '-') {
done = true;
break;
} else {
if(arg.equals("--")) {
done = true;
} else if(arg.equals("-d")) {
debug = true;
r.debug = true;
} else if(arg.startsWith("-e")) {
if(arg.length() == 2) {
scripts.add(args[++start]);
} else {
scripts.add(arg.substring(2));
}
} else if(arg.startsWith("-I")) {
if(arg.length() == 2) {
loadDirs.add(args[++start]);
} else {
loadDirs.add(arg.substring(2));
}
} else if(arg.equals("-h") || arg.equals("--help")) {
System.err.print(HELP);
return;
} else if(arg.equals("--version")) {
System.err.println(getVersion());
printedSomething = true;
} else if(arg.equals("--copyright")) {
System.err.print(COPYRIGHT);
printedSomething = true;
} else if(arg.equals("-")) {
readStdin = true;
} else if(arg.charAt(1) == 'C') {
if(arg.length() == 2) {
cwd = args[++start];
} else {
cwd = arg.substring(2);
}
} else {
final IokeObject condition = IokeObject.as(IokeObject.getCellChain(r.condition,
message,
context,
"Error",
"CommandLine",
"DontUnderstandOption")).mimic(message, context);
condition.setCell("message", message);
condition.setCell("context", context);
condition.setCell("receiver", context);
condition.setCell("option", r.newText(arg));
r.errorCondition(condition);
}
}
}
}
if(cwd != null) {
r.setCurrentWorkingDirectory(cwd);
}
((IokeSystem)r.system.data).setCurrentProgram("-e");
((IokeSystem)r.system.data).addLoadPath(System.getProperty("ioke.lib", ".") + "/ioke");
((IokeSystem)r.system.data).addLoadPath("lib/ioke");
for(String ss : loadDirs) {
((IokeSystem)r.system.data).addLoadPath(ss);
}
for(String script : scripts) {
r.evaluateStream("-e", new StringReader(script), message, context);
}
if(readStdin) {
((IokeSystem)r.system.data).setCurrentProgram("<stdin>");
r.evaluateStream("<stdin>", new InputStreamReader(System.in), message, context);
}
if(args.length > start) {
if(args.length > (start+1)) {
for(int i=start+1,j=args.length; i<j; i++) {
r.addArgument(args[i]);
}
}
String file = args[start];
if(file.startsWith("\"")) {
file = file.substring(1, file.length());
}
if(file.length() > 1 && file.charAt(file.length()-1) == '"') {
file = file.substring(0, file.length()-1);
}
((IokeSystem)r.system.data).setCurrentProgram(file);
r.evaluateFile(file, message, context);
} else {
if(scripts.size() == 0 && !printedSomething) {
r.evaluateString("use(\"builtin/iik\"). IIk mainLoop", message, context);
}
}
r.tearDown();
} catch(ControlFlow.Exit e) {
int exitVal = e.getExitValue();
try {
r.tearDown();
} catch(ControlFlow.Exit e2) {
exitVal = e2.getExitValue();
}
System.exit(exitVal);
} catch(ControlFlow e) {
String name = e.getClass().getName();
System.err.println("unexpected control flow: " + name.substring(name.indexOf("$") + 1).toLowerCase());
if(debug) {
e.printStackTrace(System.err);
}
System.exit(1);
}
}
public static String getVersion() {
try {
Properties props = new Properties();
props.load(Main.class.getResourceAsStream("/ioke/lang/version.properties"));
String version = props.getProperty("ioke.build.versionString");
String date = props.getProperty("ioke.build.date");
String commit = props.getProperty("ioke.build.commit");
return version + " [" + date + " -- " + commit + "]";
} catch(Exception e) {
}
return "";
}
private final static String COPYRIGHT =
"Copyright (c) 2008 Ola Bini, [email protected]\n"+
"\n"+
"Permission is hereby granted, free of charge, to any person obtaining a copy\n"+
"of this software and associated documentation files (the \"Software\"), to deal\n"+
"in the Software without restriction, including without limitation the rights\n"+
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n"+
"copies of the Software, and to permit persons to whom the Software is\n"+
"furnished to do so, subject to the following conditions:\n"+
"\n"+
"The above copyright notice and this permission notice shall be included in\n"+
"all copies or substantial portions of the Software.\n"+
"\n"+
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n"+
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n"+
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n"+
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n"+
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n"+
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n"+
"THE SOFTWARE.\n";
}// Main
| src/main/ioke/lang/Main.java | /*
* See LICENSE file in distribution for copyright and licensing information.
*/
package ioke.lang;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.List;
import java.util.ArrayList;
import ioke.lang.exceptions.ControlFlow;
/**
* @author <a href="mailto:[email protected]">Ola Bini</a>
*/
public class Main {
private final static String HELP =
"Usage: ioke [switches] -- [programfile] [arguments]\n" +
" -Cdirectory execute with directory as CWD\n" +
" -d debug, set debug flag\n" +
" -e script execute the script. if provided, no program file is necessary.\n" +
" there can be many of these provided on the same command line.\n" +
" -h, --help help, this message\n" +
" -Idir add directory to 'System loadPath'. May be used more than once\n" +
" --copyright print the copyright\n" +
" --version print current version\n";
public static void main(String[] args) throws Throwable {
Runtime r = new Runtime();
r.init();
final IokeObject context = r.ground;
final Message mx = new Message(r, ".", null, Message.Type.TERMINATOR);
mx.setLine(0);
mx.setPosition(0);
final IokeObject message = r.createMessage(mx);
boolean debug = false;
String cwd = null;
List<String> scripts = new ArrayList<String>();
List<String> loadDirs = new ArrayList<String>();
try {
int start = 0;
boolean done = false;
boolean readStdin = false;
for(;!done && start<args.length;start++) {
String arg = args[start];
if(arg.length() > 0) {
if(arg.charAt(0) != '-') {
done = true;
break;
} else {
if(arg.equals("--")) {
done = true;
} else if(arg.equals("-d")) {
debug = true;
r.debug = true;
} else if(arg.startsWith("-e")) {
if(arg.length() == 2) {
scripts.add(args[++start]);
} else {
scripts.add(arg.substring(2));
}
} else if(arg.startsWith("-I")) {
if(arg.length() == 2) {
loadDirs.add(args[++start]);
} else {
loadDirs.add(arg.substring(2));
}
} else if(arg.equals("-h") || arg.equals("--help")) {
System.err.print(HELP);
return;
} else if(arg.equals("-")) {
readStdin = true;
} else if(arg.charAt(1) == 'C') {
if(arg.length() == 2) {
cwd = args[++start];
} else {
cwd = arg.substring(2);
}
} else {
final IokeObject condition = IokeObject.as(IokeObject.getCellChain(r.condition,
message,
context,
"Error",
"CommandLine",
"DontUnderstandOption")).mimic(message, context);
condition.setCell("message", message);
condition.setCell("context", context);
condition.setCell("receiver", context);
condition.setCell("option", r.newText(arg));
r.errorCondition(condition);
}
}
}
}
if(cwd != null) {
r.setCurrentWorkingDirectory(cwd);
}
((IokeSystem)r.system.data).setCurrentProgram("-e");
((IokeSystem)r.system.data).addLoadPath(System.getProperty("ioke.lib", ".") + "/ioke");
((IokeSystem)r.system.data).addLoadPath("lib/ioke");
for(String ss : loadDirs) {
((IokeSystem)r.system.data).addLoadPath(ss);
}
for(String script : scripts) {
r.evaluateStream("-e", new StringReader(script), message, context);
}
if(readStdin) {
((IokeSystem)r.system.data).setCurrentProgram("<stdin>");
r.evaluateStream("<stdin>", new InputStreamReader(System.in), message, context);
}
if(args.length > start) {
if(args.length > (start+1)) {
for(int i=start+1,j=args.length; i<j; i++) {
r.addArgument(args[i]);
}
}
String file = args[start];
if(file.startsWith("\"")) {
file = file.substring(1, file.length());
}
if(file.length() > 1 && file.charAt(file.length()-1) == '"') {
file = file.substring(0, file.length()-1);
}
((IokeSystem)r.system.data).setCurrentProgram(file);
r.evaluateFile(file, message, context);
} else {
if(scripts.size() == 0) {
r.evaluateString("use(\"builtin/iik\"). IIk mainLoop", message, context);
}
}
r.tearDown();
} catch(ControlFlow.Exit e) {
int exitVal = e.getExitValue();
try {
r.tearDown();
} catch(ControlFlow.Exit e2) {
exitVal = e2.getExitValue();
}
System.exit(exitVal);
} catch(ControlFlow e) {
String name = e.getClass().getName();
System.err.println("unexpected control flow: " + name.substring(name.indexOf("$") + 1).toLowerCase());
if(debug) {
e.printStackTrace(System.err);
}
System.exit(1);
}
}
}// Main
| Fix #149, add possibility of seeing version string and copyright information
| src/main/ioke/lang/Main.java | Fix #149, add possibility of seeing version string and copyright information | <ide><path>rc/main/ioke/lang/Main.java
<ide>
<ide> import java.util.List;
<ide> import java.util.ArrayList;
<add>import java.util.Properties;
<ide>
<ide> import ioke.lang.exceptions.ControlFlow;
<ide>
<ide> int start = 0;
<ide> boolean done = false;
<ide> boolean readStdin = false;
<add> boolean printedSomething = false;
<ide>
<ide> for(;!done && start<args.length;start++) {
<ide> String arg = args[start];
<ide> } else if(arg.equals("-h") || arg.equals("--help")) {
<ide> System.err.print(HELP);
<ide> return;
<add> } else if(arg.equals("--version")) {
<add> System.err.println(getVersion());
<add> printedSomething = true;
<add> } else if(arg.equals("--copyright")) {
<add> System.err.print(COPYRIGHT);
<add> printedSomething = true;
<ide> } else if(arg.equals("-")) {
<ide> readStdin = true;
<ide> } else if(arg.charAt(1) == 'C') {
<ide> ((IokeSystem)r.system.data).setCurrentProgram(file);
<ide> r.evaluateFile(file, message, context);
<ide> } else {
<del> if(scripts.size() == 0) {
<add> if(scripts.size() == 0 && !printedSomething) {
<ide> r.evaluateString("use(\"builtin/iik\"). IIk mainLoop", message, context);
<ide> }
<ide> }
<ide> System.exit(1);
<ide> }
<ide> }
<add>
<add> public static String getVersion() {
<add> try {
<add> Properties props = new Properties();
<add> props.load(Main.class.getResourceAsStream("/ioke/lang/version.properties"));
<add>
<add> String version = props.getProperty("ioke.build.versionString");
<add> String date = props.getProperty("ioke.build.date");
<add> String commit = props.getProperty("ioke.build.commit");
<add>
<add> return version + " [" + date + " -- " + commit + "]";
<add> } catch(Exception e) {
<add> }
<add>
<add> return "";
<add> }
<add>
<add> private final static String COPYRIGHT =
<add> "Copyright (c) 2008 Ola Bini, [email protected]\n"+
<add> "\n"+
<add> "Permission is hereby granted, free of charge, to any person obtaining a copy\n"+
<add> "of this software and associated documentation files (the \"Software\"), to deal\n"+
<add> "in the Software without restriction, including without limitation the rights\n"+
<add> "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n"+
<add> "copies of the Software, and to permit persons to whom the Software is\n"+
<add> "furnished to do so, subject to the following conditions:\n"+
<add> "\n"+
<add> "The above copyright notice and this permission notice shall be included in\n"+
<add> "all copies or substantial portions of the Software.\n"+
<add> "\n"+
<add> "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n"+
<add> "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n"+
<add> "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n"+
<add> "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n"+
<add> "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n"+
<add> "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n"+
<add> "THE SOFTWARE.\n";
<ide> }// Main |
|
Java | apache-2.0 | f3855d185849d1501e630b5de7284969eb1eba1e | 0 | Teradata/kylo,Teradata/kylo,Teradata/kylo,Teradata/kylo,Teradata/kylo | package com.thinkbiganalytics.feedmgr.service.datasource;
/*-
* #%L
* kylo-feed-manager-controller
* %%
* Copyright (C) 2017 ThinkBig Analytics
* %%
* 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.
* #L%
*/
import com.thinkbiganalytics.feedmgr.service.security.SecurityService;
import com.thinkbiganalytics.metadata.api.catalog.Connector;
import com.thinkbiganalytics.metadata.api.catalog.DataSet;
import com.thinkbiganalytics.metadata.api.catalog.DataSetSparkParameters;
import com.thinkbiganalytics.metadata.api.catalog.DataSource;
import com.thinkbiganalytics.metadata.api.datasource.DatasourceDetails;
import com.thinkbiganalytics.metadata.api.datasource.DatasourceProvider;
import com.thinkbiganalytics.metadata.api.datasource.JdbcDatasourceDetails;
import com.thinkbiganalytics.metadata.api.datasource.security.DatasourceAccessControl;
import com.thinkbiganalytics.metadata.rest.model.data.Datasource;
import com.thinkbiganalytics.metadata.rest.model.data.DerivedDatasource;
import com.thinkbiganalytics.metadata.rest.model.data.JdbcDatasource;
import com.thinkbiganalytics.metadata.rest.model.data.UserDatasource;
import com.thinkbiganalytics.metadata.rest.model.feed.Feed;
import com.thinkbiganalytics.nifi.rest.client.NiFiControllerServicesRestClient;
import com.thinkbiganalytics.nifi.rest.client.NiFiRestClient;
import com.thinkbiganalytics.nifi.rest.client.NifiClientRuntimeException;
import com.thinkbiganalytics.nifi.rest.client.NifiComponentNotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.crypto.encrypt.TextEncryptor;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
/**
* Transform {@code Datasource}s between domain and REST objects.
*/
public class DatasourceModelTransform {
private static final Logger log = LoggerFactory.getLogger(DatasourceModelTransform.class);
private static final Map<String, String> DATA_SET_SRC_TYPES;
static {
Map<String, String> map = new HashMap<>();
map.put("jdbc", "DatabaseDatasource");
map.put("hive", "HiveDatasource");
map.put("file-upload", "DirectoryDatasource");
map.put("hdfs", "DirectoryDatasource");
map.put("local-file-system", "DirectoryDatasource");
map.put("amazon-s3", "S3Datasource");
map.put("azure-data-lake", "DatabaseDatasource");
map.put("azure-storage", "DirectoryDatasource");
DATA_SET_SRC_TYPES = Collections.unmodifiableMap(map);
}
/**
* Level of detail to include when transforming objects.
*/
public enum Level {
/**
* Include sensitive fields in result
*/
ADMIN,
/**
* Include everything except sensitive fields in result
*/
FULL,
/**
* Include basic field and connections in result
*/
CONNECTIONS,
/**
* Include only basic fields in result
*/
BASIC
}
/**
* Provides access to {@code Datasource} domain objects
*/
@Nonnull
private final DatasourceProvider datasourceProvider;
/**
* Encrypts strings
*/
@Nonnull
private final TextEncryptor encryptor;
/**
* NiFi REST client
*/
@Nonnull
private final NiFiRestClient nifiRestClient;
/**
* Security service
*/
@Nonnull
private final SecurityService securityService;
/**
* Constructs a {@code DatasourceModelTransform}.
*
* @param datasourceProvider the {@code Datasource} domain object provider
* @param encryptor the text encryptor
* @param nifiRestClient the NiFi REST client
* @param securityService the security service
*/
public DatasourceModelTransform(@Nonnull final DatasourceProvider datasourceProvider, @Nonnull final TextEncryptor encryptor, @Nonnull final NiFiRestClient nifiRestClient,
@Nonnull final SecurityService securityService) {
this.datasourceProvider = datasourceProvider;
this.encryptor = encryptor;
this.nifiRestClient = nifiRestClient;
this.securityService = securityService;
}
/**
* Transforms the specified domain data set to an equivalent legacy REST Datasource.
*
* @param domain the domain data set object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public Datasource toDatasource(@Nonnull final DataSet domainDataSet, @Nonnull final Level level) {
DataSetSparkParameters params = domainDataSet.getEffectiveSparkParameters();
DerivedDatasource ds = new DerivedDatasource();
ds.setId(domainDataSet.getId().toString());
ds.setName(domainDataSet.getTitle());
String datasourceType = params.getFormat();
String derivedDatasourceType = "DatabaseDatasource";
if(DATA_SET_SRC_TYPES.containsKey(datasourceType)){
derivedDatasourceType= DATA_SET_SRC_TYPES.get(datasourceType);
}
else if( domainDataSet.getDataSource().getConnector() != null){
datasourceType = domainDataSet.getDataSource().getConnector().getPluginId();
derivedDatasourceType= DATA_SET_SRC_TYPES.getOrDefault(datasourceType, derivedDatasourceType);
}
//exclude file-upload??
ds.setDatasourceType(derivedDatasourceType);
if(StringUtils.isBlank(ds.getName()) && params.getPaths() != null && !params.getPaths().isEmpty()){
ds.setName(params.getPaths().stream().collect(Collectors.joining(",")));
}
return ds;
}
/**
* Transforms the specified domain object to a REST object.
*
* @param domain the domain object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public Datasource toDatasource(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.Datasource domain, @Nonnull final Level level) {
if (domain instanceof com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource) {
final DerivedDatasource ds = new DerivedDatasource();
updateDatasource(ds, (com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource) domain, level);
return ds;
} else if (domain instanceof com.thinkbiganalytics.metadata.api.datasource.UserDatasource) {
return toDatasource((com.thinkbiganalytics.metadata.api.datasource.UserDatasource) domain, level);
} else {
throw new IllegalArgumentException("Not a supported datasource class: " + domain.getClass());
}
}
/**
* Transforms the specified domain object to a REST object.
*
* @param domain the domain object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public UserDatasource toDatasource(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
final DatasourceDetails details = domain.getDetails().orElse(null);
if (details == null) {
final UserDatasource userDatasource = new UserDatasource();
updateDatasource(userDatasource, domain, level);
return userDatasource;
} else if (details instanceof JdbcDatasourceDetails) {
final JdbcDatasource jdbcDatasource = new JdbcDatasource();
updateDatasource(jdbcDatasource, domain, level);
return jdbcDatasource;
} else {
throw new IllegalArgumentException("Not a supported datasource details class: " + details.getClass());
}
}
/**
* Transforms the specified REST object to a domain object.
*
* @param ds the REST object
* @return the domain object
* @throws IllegalArgumentException if the REST object cannot be converted
*/
public com.thinkbiganalytics.metadata.api.datasource.Datasource toDomain(@Nonnull final Datasource ds) {
if (ds instanceof UserDatasource) {
final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain;
final boolean isNew = (ds.getId() == null);
if (isNew) {
domain = datasourceProvider.ensureDatasource(ds.getName(), ds.getDescription(), com.thinkbiganalytics.metadata.api.datasource.UserDatasource.class);
ds.setId(domain.getId().toString());
} else {
final com.thinkbiganalytics.metadata.api.datasource.Datasource.ID id = datasourceProvider.resolve(ds.getId());
domain = (com.thinkbiganalytics.metadata.api.datasource.UserDatasource) datasourceProvider.getDatasource(id);
}
if (domain == null) {
throw new IllegalArgumentException("Could not find data source: " + ds.getId());
}
if (ds instanceof JdbcDatasource) {
if (isNew) {
datasourceProvider.ensureDatasourceDetails(domain.getId(), JdbcDatasourceDetails.class);
}
updateDomain(domain, (JdbcDatasource) ds);
} else {
updateDomain(domain, (UserDatasource) ds);
}
return domain;
} else {
throw new IllegalArgumentException("Not a supported user datasource class: " + ds.getClass());
}
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final Datasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.Datasource domain, @Nonnull final Level level) {
ds.setId(domain.getId().toString());
ds.setDescription(domain.getDescription());
ds.setName(domain.getName());
// Add connections if level matches
if (level.compareTo(Level.CONNECTIONS) <= 0) {
for (com.thinkbiganalytics.metadata.api.feed.FeedSource domainSrc : domain.getFeedSources()) {
Feed feed = new Feed();
feed.setDisplayName(domainSrc.getFeed().getDisplayName());
feed.setId(domainSrc.getFeed().getId().toString());
feed.setState(Feed.State.valueOf(domainSrc.getFeed().getState().name()));
feed.setSystemName(domainSrc.getFeed().getName());
feed.setModifiedTime(domainSrc.getFeed().getModifiedTime());
ds.getSourceForFeeds().add(feed);
}
for (com.thinkbiganalytics.metadata.api.feed.FeedDestination domainDest : domain.getFeedDestinations()) {
Feed feed = new Feed();
feed.setDisplayName(domainDest.getFeed().getDisplayName());
feed.setId(domainDest.getFeed().getId().toString());
feed.setState(Feed.State.valueOf(domainDest.getFeed().getState().name()));
feed.setSystemName(domainDest.getFeed().getName());
feed.setModifiedTime(domainDest.getFeed().getModifiedTime());
ds.getDestinationForFeeds().add(feed);
}
}
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
public void updateDatasource(@Nonnull final DerivedDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource domain, @Nonnull final Level level) {
updateDatasource((Datasource) ds, domain, level);
ds.setProperties(domain.getProperties());
ds.setDatasourceType(domain.getDatasourceType());
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final JdbcDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
updateDatasource((UserDatasource) ds, domain, level);
domain.getDetails()
.map(JdbcDatasourceDetails.class::cast)
.ifPresent(details -> {
details.getControllerServiceId().ifPresent(ds::setControllerServiceId);
if (level.compareTo(Level.ADMIN) <= 0) {
ds.setPassword(encryptor.decrypt(details.getPassword()));
}
if (level.compareTo(Level.FULL) <= 0) {
// Fetch database properties from NiFi
details.getControllerServiceId()
.flatMap(id -> nifiRestClient.controllerServices().findById(id))
.ifPresent(controllerService -> {
ds.setDatabaseConnectionUrl(controllerService.getProperties().get(DatasourceConstants.DATABASE_CONNECTION_URL));
ds.setDatabaseDriverClassName(controllerService.getProperties().get(DatasourceConstants.DATABASE_DRIVER_CLASS_NAME));
ds.setDatabaseDriverLocation(controllerService.getProperties().get(DatasourceConstants.DATABASE_DRIVER_LOCATION));
ds.setDatabaseUser(controllerService.getProperties().get(DatasourceConstants.DATABASE_USER));
});
}
});
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final UserDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
updateDatasource((Datasource) ds, domain, level);
ds.setType(domain.getType());
ds.setIcon(domain.getIcon());
ds.setIconColor(domain.getIconColor());
}
/**
* Updates the specified domain object with properties from the specified REST object.
*
* @param domain the domain object
* @param ds the REST object
*/
private void updateDomain(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final JdbcDatasource ds) {
updateDomain(domain, (UserDatasource) ds);
domain.getDetails()
.map(JdbcDatasourceDetails.class::cast)
.ifPresent(details -> {
// Look for changed properties
final Map<String, String> properties = new HashMap<>();
if (StringUtils.isNotBlank(ds.getDatabaseConnectionUrl())) {
properties.put(DatasourceConstants.DATABASE_CONNECTION_URL, ds.getDatabaseConnectionUrl());
}
if (StringUtils.isNotBlank(ds.getDatabaseDriverClassName())) {
properties.put(DatasourceConstants.DATABASE_DRIVER_CLASS_NAME, ds.getDatabaseDriverClassName());
}
if (ds.getDatabaseDriverLocation() != null) {
properties.put(DatasourceConstants.DATABASE_DRIVER_LOCATION, ds.getDatabaseDriverLocation());
}
if (ds.getDatabaseUser() != null) {
properties.put(DatasourceConstants.DATABASE_USER, ds.getDatabaseUser());
}
if (ds.getPassword() != null) {
details.setPassword(encryptor.encrypt(ds.getPassword()));
properties.put(DatasourceConstants.PASSWORD, StringUtils.isNotEmpty(ds.getPassword()) ? ds.getPassword() : null);
}
// Update or create the controller service
ControllerServiceDTO controllerService = null;
if (details.getControllerServiceId().isPresent()) {
controllerService = new ControllerServiceDTO();
controllerService.setId(details.getControllerServiceId().get());
controllerService.setName(ds.getName());
controllerService.setComments(ds.getDescription());
controllerService.setProperties(properties);
try {
controllerService = nifiRestClient.controllerServices().updateServiceAndReferencingComponents(controllerService);
ds.setControllerServiceId(controllerService.getId());
} catch (final NifiComponentNotFoundException e) {
log.warn("Controller service is missing for datasource: {}", domain.getId(), e);
controllerService = null;
}
}
if (controllerService == null) {
controllerService = new ControllerServiceDTO();
controllerService.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
controllerService.setName(ds.getName());
controllerService.setComments(ds.getDescription());
controllerService.setProperties(properties);
final ControllerServiceDTO newControllerService = nifiRestClient.controllerServices().create(controllerService);
try {
nifiRestClient.controllerServices().updateStateById(newControllerService.getId(), NiFiControllerServicesRestClient.State.ENABLED);
} catch (final NifiClientRuntimeException nifiException) {
log.error("Failed to enable controller service for datasource: {}", domain.getId(), nifiException);
nifiRestClient.controllerServices().disableAndDeleteAsync(newControllerService.getId());
throw nifiException;
}
details.setControllerServiceId(newControllerService.getId());
ds.setControllerServiceId(newControllerService.getId());
}
});
}
/**
* Updates the specified domain object with properties from the specified REST object.
*
* @param domain the domain object
* @param ds the REST object
*/
private void updateDomain(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final UserDatasource ds) {
// Update properties
domain.setDescription(ds.getDescription());
domain.setName(ds.getName());
domain.setType(ds.getType());
domain.setIcon(ds.getIcon());
domain.setIconColor(ds.getIconColor());
// Update access control
if (domain.getAllowedActions().hasPermission(DatasourceAccessControl.CHANGE_PERMS)) {
ds.toRoleMembershipChangeList().forEach(roleMembershipChange -> securityService.changeDatasourceRoleMemberships(ds.getId(), roleMembershipChange));
}
}
}
| services/feed-manager-service/feed-manager-controller/src/main/java/com/thinkbiganalytics/feedmgr/service/datasource/DatasourceModelTransform.java | package com.thinkbiganalytics.feedmgr.service.datasource;
/*-
* #%L
* kylo-feed-manager-controller
* %%
* Copyright (C) 2017 ThinkBig Analytics
* %%
* 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.
* #L%
*/
import com.thinkbiganalytics.feedmgr.service.security.SecurityService;
import com.thinkbiganalytics.metadata.api.catalog.Connector;
import com.thinkbiganalytics.metadata.api.catalog.DataSet;
import com.thinkbiganalytics.metadata.api.catalog.DataSetSparkParameters;
import com.thinkbiganalytics.metadata.api.catalog.DataSource;
import com.thinkbiganalytics.metadata.api.datasource.DatasourceDetails;
import com.thinkbiganalytics.metadata.api.datasource.DatasourceProvider;
import com.thinkbiganalytics.metadata.api.datasource.JdbcDatasourceDetails;
import com.thinkbiganalytics.metadata.api.datasource.security.DatasourceAccessControl;
import com.thinkbiganalytics.metadata.rest.model.data.Datasource;
import com.thinkbiganalytics.metadata.rest.model.data.DerivedDatasource;
import com.thinkbiganalytics.metadata.rest.model.data.JdbcDatasource;
import com.thinkbiganalytics.metadata.rest.model.data.UserDatasource;
import com.thinkbiganalytics.metadata.rest.model.feed.Feed;
import com.thinkbiganalytics.nifi.rest.client.NiFiControllerServicesRestClient;
import com.thinkbiganalytics.nifi.rest.client.NiFiRestClient;
import com.thinkbiganalytics.nifi.rest.client.NifiClientRuntimeException;
import com.thinkbiganalytics.nifi.rest.client.NifiComponentNotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.crypto.encrypt.TextEncryptor;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
/**
* Transform {@code Datasource}s between domain and REST objects.
*/
public class DatasourceModelTransform {
private static final Logger log = LoggerFactory.getLogger(DatasourceModelTransform.class);
private static final Map<String, String> DATA_SET_SRC_TYPES;
static {
Map<String, String> map = new HashMap<>();
map.put("jdbc", "DatabaseDatasource");
map.put("hive", "HiveDatasource");
map.put("file-upload", "DirectoryDatasource");
map.put("hdfs", "DirectoryDatasource");
map.put("local-file-system", "DirectoryDatasource");
map.put("amazon-s3", "S3Datasource");
map.put("azure-data-lake", "DatabaseDatasource");
map.put("azure-storage", "DirectoryDatasource");
DATA_SET_SRC_TYPES = Collections.unmodifiableMap(map);
}
/**
* Level of detail to include when transforming objects.
*/
public enum Level {
/**
* Include sensitive fields in result
*/
ADMIN,
/**
* Include everything except sensitive fields in result
*/
FULL,
/**
* Include basic field and connections in result
*/
CONNECTIONS,
/**
* Include only basic fields in result
*/
BASIC
}
/**
* Provides access to {@code Datasource} domain objects
*/
@Nonnull
private final DatasourceProvider datasourceProvider;
/**
* Encrypts strings
*/
@Nonnull
private final TextEncryptor encryptor;
/**
* NiFi REST client
*/
@Nonnull
private final NiFiRestClient nifiRestClient;
/**
* Security service
*/
@Nonnull
private final SecurityService securityService;
/**
* Constructs a {@code DatasourceModelTransform}.
*
* @param datasourceProvider the {@code Datasource} domain object provider
* @param encryptor the text encryptor
* @param nifiRestClient the NiFi REST client
* @param securityService the security service
*/
public DatasourceModelTransform(@Nonnull final DatasourceProvider datasourceProvider, @Nonnull final TextEncryptor encryptor, @Nonnull final NiFiRestClient nifiRestClient,
@Nonnull final SecurityService securityService) {
this.datasourceProvider = datasourceProvider;
this.encryptor = encryptor;
this.nifiRestClient = nifiRestClient;
this.securityService = securityService;
}
/**
* Transforms the specified domain data set to an equivalent legacy REST Datasource.
*
* @param domain the domain data set object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public Datasource toDatasource(@Nonnull final DataSet domainDataSet, @Nonnull final Level level) {
DataSetSparkParameters params = domainDataSet.getEffectiveSparkParameters();
DerivedDatasource ds = new DerivedDatasource();
ds.setId(domainDataSet.getId().toString());
ds.setName(domainDataSet.getTitle());
ds.setDatasourceType(DATA_SET_SRC_TYPES.getOrDefault(params.getFormat(), "DatabaseDatasource"));
return ds;
}
/**
* Transforms the specified domain object to a REST object.
*
* @param domain the domain object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public Datasource toDatasource(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.Datasource domain, @Nonnull final Level level) {
if (domain instanceof com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource) {
final DerivedDatasource ds = new DerivedDatasource();
updateDatasource(ds, (com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource) domain, level);
return ds;
} else if (domain instanceof com.thinkbiganalytics.metadata.api.datasource.UserDatasource) {
return toDatasource((com.thinkbiganalytics.metadata.api.datasource.UserDatasource) domain, level);
} else {
throw new IllegalArgumentException("Not a supported datasource class: " + domain.getClass());
}
}
/**
* Transforms the specified domain object to a REST object.
*
* @param domain the domain object
* @param level the level of detail
* @return the REST object
* @throws IllegalArgumentException if the domain object cannot be converted
*/
public UserDatasource toDatasource(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
final DatasourceDetails details = domain.getDetails().orElse(null);
if (details == null) {
final UserDatasource userDatasource = new UserDatasource();
updateDatasource(userDatasource, domain, level);
return userDatasource;
} else if (details instanceof JdbcDatasourceDetails) {
final JdbcDatasource jdbcDatasource = new JdbcDatasource();
updateDatasource(jdbcDatasource, domain, level);
return jdbcDatasource;
} else {
throw new IllegalArgumentException("Not a supported datasource details class: " + details.getClass());
}
}
/**
* Transforms the specified REST object to a domain object.
*
* @param ds the REST object
* @return the domain object
* @throws IllegalArgumentException if the REST object cannot be converted
*/
public com.thinkbiganalytics.metadata.api.datasource.Datasource toDomain(@Nonnull final Datasource ds) {
if (ds instanceof UserDatasource) {
final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain;
final boolean isNew = (ds.getId() == null);
if (isNew) {
domain = datasourceProvider.ensureDatasource(ds.getName(), ds.getDescription(), com.thinkbiganalytics.metadata.api.datasource.UserDatasource.class);
ds.setId(domain.getId().toString());
} else {
final com.thinkbiganalytics.metadata.api.datasource.Datasource.ID id = datasourceProvider.resolve(ds.getId());
domain = (com.thinkbiganalytics.metadata.api.datasource.UserDatasource) datasourceProvider.getDatasource(id);
}
if (domain == null) {
throw new IllegalArgumentException("Could not find data source: " + ds.getId());
}
if (ds instanceof JdbcDatasource) {
if (isNew) {
datasourceProvider.ensureDatasourceDetails(domain.getId(), JdbcDatasourceDetails.class);
}
updateDomain(domain, (JdbcDatasource) ds);
} else {
updateDomain(domain, (UserDatasource) ds);
}
return domain;
} else {
throw new IllegalArgumentException("Not a supported user datasource class: " + ds.getClass());
}
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final Datasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.Datasource domain, @Nonnull final Level level) {
ds.setId(domain.getId().toString());
ds.setDescription(domain.getDescription());
ds.setName(domain.getName());
// Add connections if level matches
if (level.compareTo(Level.CONNECTIONS) <= 0) {
for (com.thinkbiganalytics.metadata.api.feed.FeedSource domainSrc : domain.getFeedSources()) {
Feed feed = new Feed();
feed.setDisplayName(domainSrc.getFeed().getDisplayName());
feed.setId(domainSrc.getFeed().getId().toString());
feed.setState(Feed.State.valueOf(domainSrc.getFeed().getState().name()));
feed.setSystemName(domainSrc.getFeed().getName());
feed.setModifiedTime(domainSrc.getFeed().getModifiedTime());
ds.getSourceForFeeds().add(feed);
}
for (com.thinkbiganalytics.metadata.api.feed.FeedDestination domainDest : domain.getFeedDestinations()) {
Feed feed = new Feed();
feed.setDisplayName(domainDest.getFeed().getDisplayName());
feed.setId(domainDest.getFeed().getId().toString());
feed.setState(Feed.State.valueOf(domainDest.getFeed().getState().name()));
feed.setSystemName(domainDest.getFeed().getName());
feed.setModifiedTime(domainDest.getFeed().getModifiedTime());
ds.getDestinationForFeeds().add(feed);
}
}
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
public void updateDatasource(@Nonnull final DerivedDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.DerivedDatasource domain, @Nonnull final Level level) {
updateDatasource((Datasource) ds, domain, level);
ds.setProperties(domain.getProperties());
ds.setDatasourceType(domain.getDatasourceType());
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final JdbcDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
updateDatasource((UserDatasource) ds, domain, level);
domain.getDetails()
.map(JdbcDatasourceDetails.class::cast)
.ifPresent(details -> {
details.getControllerServiceId().ifPresent(ds::setControllerServiceId);
if (level.compareTo(Level.ADMIN) <= 0) {
ds.setPassword(encryptor.decrypt(details.getPassword()));
}
if (level.compareTo(Level.FULL) <= 0) {
// Fetch database properties from NiFi
details.getControllerServiceId()
.flatMap(id -> nifiRestClient.controllerServices().findById(id))
.ifPresent(controllerService -> {
ds.setDatabaseConnectionUrl(controllerService.getProperties().get(DatasourceConstants.DATABASE_CONNECTION_URL));
ds.setDatabaseDriverClassName(controllerService.getProperties().get(DatasourceConstants.DATABASE_DRIVER_CLASS_NAME));
ds.setDatabaseDriverLocation(controllerService.getProperties().get(DatasourceConstants.DATABASE_DRIVER_LOCATION));
ds.setDatabaseUser(controllerService.getProperties().get(DatasourceConstants.DATABASE_USER));
});
}
});
}
/**
* Updates the specified REST object with properties from the specified domain object.
*
* @param ds the REST object
* @param domain the domain object
* @param level the level of detail
*/
private void updateDatasource(@Nonnull final UserDatasource ds, @Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final Level level) {
updateDatasource((Datasource) ds, domain, level);
ds.setType(domain.getType());
ds.setIcon(domain.getIcon());
ds.setIconColor(domain.getIconColor());
}
/**
* Updates the specified domain object with properties from the specified REST object.
*
* @param domain the domain object
* @param ds the REST object
*/
private void updateDomain(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final JdbcDatasource ds) {
updateDomain(domain, (UserDatasource) ds);
domain.getDetails()
.map(JdbcDatasourceDetails.class::cast)
.ifPresent(details -> {
// Look for changed properties
final Map<String, String> properties = new HashMap<>();
if (StringUtils.isNotBlank(ds.getDatabaseConnectionUrl())) {
properties.put(DatasourceConstants.DATABASE_CONNECTION_URL, ds.getDatabaseConnectionUrl());
}
if (StringUtils.isNotBlank(ds.getDatabaseDriverClassName())) {
properties.put(DatasourceConstants.DATABASE_DRIVER_CLASS_NAME, ds.getDatabaseDriverClassName());
}
if (ds.getDatabaseDriverLocation() != null) {
properties.put(DatasourceConstants.DATABASE_DRIVER_LOCATION, ds.getDatabaseDriverLocation());
}
if (ds.getDatabaseUser() != null) {
properties.put(DatasourceConstants.DATABASE_USER, ds.getDatabaseUser());
}
if (ds.getPassword() != null) {
details.setPassword(encryptor.encrypt(ds.getPassword()));
properties.put(DatasourceConstants.PASSWORD, StringUtils.isNotEmpty(ds.getPassword()) ? ds.getPassword() : null);
}
// Update or create the controller service
ControllerServiceDTO controllerService = null;
if (details.getControllerServiceId().isPresent()) {
controllerService = new ControllerServiceDTO();
controllerService.setId(details.getControllerServiceId().get());
controllerService.setName(ds.getName());
controllerService.setComments(ds.getDescription());
controllerService.setProperties(properties);
try {
controllerService = nifiRestClient.controllerServices().updateServiceAndReferencingComponents(controllerService);
ds.setControllerServiceId(controllerService.getId());
} catch (final NifiComponentNotFoundException e) {
log.warn("Controller service is missing for datasource: {}", domain.getId(), e);
controllerService = null;
}
}
if (controllerService == null) {
controllerService = new ControllerServiceDTO();
controllerService.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
controllerService.setName(ds.getName());
controllerService.setComments(ds.getDescription());
controllerService.setProperties(properties);
final ControllerServiceDTO newControllerService = nifiRestClient.controllerServices().create(controllerService);
try {
nifiRestClient.controllerServices().updateStateById(newControllerService.getId(), NiFiControllerServicesRestClient.State.ENABLED);
} catch (final NifiClientRuntimeException nifiException) {
log.error("Failed to enable controller service for datasource: {}", domain.getId(), nifiException);
nifiRestClient.controllerServices().disableAndDeleteAsync(newControllerService.getId());
throw nifiException;
}
details.setControllerServiceId(newControllerService.getId());
ds.setControllerServiceId(newControllerService.getId());
}
});
}
/**
* Updates the specified domain object with properties from the specified REST object.
*
* @param domain the domain object
* @param ds the REST object
*/
private void updateDomain(@Nonnull final com.thinkbiganalytics.metadata.api.datasource.UserDatasource domain, @Nonnull final UserDatasource ds) {
// Update properties
domain.setDescription(ds.getDescription());
domain.setName(ds.getName());
domain.setType(ds.getType());
domain.setIcon(ds.getIcon());
domain.setIconColor(ds.getIconColor());
// Update access control
if (domain.getAllowedActions().hasPermission(DatasourceAccessControl.CHANGE_PERMS)) {
ds.toRoleMembershipChangeList().forEach(roleMembershipChange -> securityService.changeDatasourceRoleMemberships(ds.getId(), roleMembershipChange));
}
}
}
| KYLO-3090 Lineage file shows up as database
| services/feed-manager-service/feed-manager-controller/src/main/java/com/thinkbiganalytics/feedmgr/service/datasource/DatasourceModelTransform.java | KYLO-3090 Lineage file shows up as database | <ide><path>ervices/feed-manager-service/feed-manager-controller/src/main/java/com/thinkbiganalytics/feedmgr/service/datasource/DatasourceModelTransform.java
<ide> import java.util.Collections;
<ide> import java.util.HashMap;
<ide> import java.util.Map;
<add>import java.util.stream.Collectors;
<ide>
<ide> import javax.annotation.Nonnull;
<ide>
<ide>
<ide> ds.setId(domainDataSet.getId().toString());
<ide> ds.setName(domainDataSet.getTitle());
<del> ds.setDatasourceType(DATA_SET_SRC_TYPES.getOrDefault(params.getFormat(), "DatabaseDatasource"));
<add> String datasourceType = params.getFormat();
<add> String derivedDatasourceType = "DatabaseDatasource";
<add> if(DATA_SET_SRC_TYPES.containsKey(datasourceType)){
<add> derivedDatasourceType= DATA_SET_SRC_TYPES.get(datasourceType);
<add> }
<add> else if( domainDataSet.getDataSource().getConnector() != null){
<add> datasourceType = domainDataSet.getDataSource().getConnector().getPluginId();
<add> derivedDatasourceType= DATA_SET_SRC_TYPES.getOrDefault(datasourceType, derivedDatasourceType);
<add> }
<add> //exclude file-upload??
<add> ds.setDatasourceType(derivedDatasourceType);
<add> if(StringUtils.isBlank(ds.getName()) && params.getPaths() != null && !params.getPaths().isEmpty()){
<add> ds.setName(params.getPaths().stream().collect(Collectors.joining(",")));
<add> }
<add>
<ide>
<ide> return ds;
<ide> } |
|
Java | apache-2.0 | b405d5e777725dacab51e82cdecda30beda25e03 | 0 | lastaflute/lastaflute-example-harbor,lastaflute/lastaflute-example-harbor,lastaflute/lastaflute-example-harbor,lastaflute/lastaflute-example-harbor,lastaflute/lastaflute-example-harbor,lastaflute/lastaflute-example-harbor | /*
* Copyright 2014-2015 the original author or 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.
*/
package org.docksidestage.app.web.signin;
import javax.annotation.Resource;
import org.docksidestage.app.web.base.HarborBaseAction;
import org.docksidestage.app.web.base.login.HarborLoginAssist;
import org.docksidestage.app.web.mypage.MypageAction;
import org.docksidestage.mylasta.action.HarborMessages;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.HtmlResponse;
/**
* @author jflute
*/
public class SigninAction extends HarborBaseAction {
// ===================================================================================
// Attribute
// =========
@Resource
private HarborLoginAssist harborLoginAssist;
// ===================================================================================
// Execute
// =======
@Execute
public HtmlResponse index() {
if (getUserBean().isPresent()) {
return redirect(MypageAction.class);
}
return asHtml(path_Signin_SigninJsp).useForm(SigninForm.class);
}
@Execute
public HtmlResponse signin(SigninForm form) {
validate(form, messages -> moreValidate(form, messages), () -> {
form.clearSecurityInfo();
return asHtml(path_Signin_SigninJsp);
});
return harborLoginAssist.loginRedirect(form.email, form.password, op -> op.rememberMe(form.rememberMe), () -> {
return redirect(MypageAction.class);
});
}
private void moreValidate(SigninForm form, HarborMessages messages) {
if (isNotEmpty(form.email) && isNotEmpty(form.password)) {
if (!harborLoginAssist.checkUserLoginable(form.email, form.password)) {
messages.addErrorsLoginFailure("email");
}
}
}
} | src/main/java/org/docksidestage/app/web/signin/SigninAction.java | /*
* Copyright 2014-2015 the original author or 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.
*/
package org.docksidestage.app.web.signin;
import javax.annotation.Resource;
import org.docksidestage.app.web.base.HarborBaseAction;
import org.docksidestage.app.web.base.login.HarborLoginAssist;
import org.docksidestage.app.web.mypage.MypageAction;
import org.docksidestage.dbflute.exbhv.MemberBhv;
import org.lastaflute.web.Execute;
import org.lastaflute.web.response.HtmlResponse;
/**
* @author jflute
*/
public class SigninAction extends HarborBaseAction {
// ===================================================================================
// Attribute
// =========
@Resource
private HarborLoginAssist harborLoginAssist;
@Resource
private MemberBhv memberBhv;
// ===================================================================================
// Execute
// =======
@Execute
public HtmlResponse index() {
if (getUserBean().isPresent()) {
return redirect(MypageAction.class);
}
return asHtml(path_Signin_SigninJsp).useForm(SigninForm.class);
}
@Execute
public HtmlResponse signin(SigninForm form) {
validate(form, messages -> {} , () -> {
form.clearSecurityInfo();
return asHtml(path_Signin_SigninJsp);
});
return harborLoginAssist.loginRedirect(form.email, form.password, op -> op.rememberMe(form.rememberMe), () -> {
return redirect(MypageAction.class);
});
}
} | add more validation of login | src/main/java/org/docksidestage/app/web/signin/SigninAction.java | add more validation of login | <ide><path>rc/main/java/org/docksidestage/app/web/signin/SigninAction.java
<ide> import org.docksidestage.app.web.base.HarborBaseAction;
<ide> import org.docksidestage.app.web.base.login.HarborLoginAssist;
<ide> import org.docksidestage.app.web.mypage.MypageAction;
<del>import org.docksidestage.dbflute.exbhv.MemberBhv;
<add>import org.docksidestage.mylasta.action.HarborMessages;
<ide> import org.lastaflute.web.Execute;
<ide> import org.lastaflute.web.response.HtmlResponse;
<ide>
<ide> // =========
<ide> @Resource
<ide> private HarborLoginAssist harborLoginAssist;
<del> @Resource
<del> private MemberBhv memberBhv;
<ide>
<ide> // ===================================================================================
<ide> // Execute
<ide>
<ide> @Execute
<ide> public HtmlResponse signin(SigninForm form) {
<del> validate(form, messages -> {} , () -> {
<add> validate(form, messages -> moreValidate(form, messages), () -> {
<ide> form.clearSecurityInfo();
<ide> return asHtml(path_Signin_SigninJsp);
<ide> });
<ide> return redirect(MypageAction.class);
<ide> });
<ide> }
<add>
<add> private void moreValidate(SigninForm form, HarborMessages messages) {
<add> if (isNotEmpty(form.email) && isNotEmpty(form.password)) {
<add> if (!harborLoginAssist.checkUserLoginable(form.email, form.password)) {
<add> messages.addErrorsLoginFailure("email");
<add> }
<add> }
<add> }
<ide> } |
|
Java | apache-2.0 | error: pathspec 'src/test/java/org/dependencytrack/model/VulnerabilityTest.java' did not match any file(s) known to git
| 2eb208cd250d0f2e33360a68656da7a2a7d79626 | 1 | stevespringett/dependency-track,stevespringett/dependency-track,stevespringett/dependency-track | /*
* This file is part of Dependency-Track.
*
* 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.
*
* Copyright (c) Steve Springett. All Rights Reserved.
*/
package org.dependencytrack.model;
import org.junit.Assert;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class VulnerabilityTest {
@Test
public void testId() {
Vulnerability vuln = new Vulnerability();
vuln.setId(111L);
Assert.assertEquals(111L, vuln.getId());
}
@Test
public void testSeverity() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV2Vector("Vector");
vuln.setCvssV2BaseScore(new BigDecimal(5.0));
vuln.setCvssV2ImpactSubScore(new BigDecimal(5.1));
vuln.setCvssV2ExploitabilitySubScore(new BigDecimal(5.2));
vuln.setCvssV3Vector("Vector");
vuln.setCvssV3BaseScore(new BigDecimal(6.0));
vuln.setCvssV3ImpactSubScore(new BigDecimal(6.1));
vuln.setCvssV3ExploitabilitySubScore(new BigDecimal(6.2));
Assert.assertEquals(Severity.MEDIUM, vuln.getSeverity());
vuln.setSeverity(Severity.HIGH);
Assert.assertNull(vuln.getCvssV2Vector());
Assert.assertNull(vuln.getCvssV2BaseScore());
Assert.assertNull(vuln.getCvssV2ImpactSubScore());
Assert.assertNull(vuln.getCvssV2ExploitabilitySubScore());
Assert.assertNull(vuln.getCvssV3Vector());
Assert.assertNull(vuln.getCvssV3BaseScore());
Assert.assertNull(vuln.getCvssV3ImpactSubScore());
Assert.assertNull(vuln.getCvssV3ExploitabilitySubScore());
Assert.assertEquals(Severity.HIGH, vuln.getSeverity());
}
@Test
public void testVulnId() {
Vulnerability vuln = new Vulnerability();
vuln.setVulnId("CVE-2019-0000");
Assert.assertEquals("CVE-2019-0000", vuln.getVulnId());
}
@Test
public void testDescription() {
Vulnerability vuln = new Vulnerability();
vuln.setDescription("My description");
Assert.assertEquals("My description", vuln.getDescription());
}
@Test
public void testRecommendation() {
Vulnerability vuln = new Vulnerability();
vuln.setRecommendation("My recommendation");
Assert.assertEquals("My recommendation", vuln.getRecommendation());
}
@Test
public void testReferences() {
Vulnerability vuln = new Vulnerability();
vuln.setReferences("My references");
Assert.assertEquals("My references", vuln.getReferences());
}
@Test
public void testCredits() {
Vulnerability vuln = new Vulnerability();
vuln.setCredits("My credits");
Assert.assertEquals("My credits", vuln.getCredits());
}
@Test
public void testCreated() {
Date date = new Date();
Vulnerability vuln = new Vulnerability();
vuln.setCreated(date);
Assert.assertEquals(date, vuln.getCreated());
}
@Test
public void testPublished() {
Date date = new Date();
Vulnerability vuln = new Vulnerability();
vuln.setPublished(date);
Assert.assertEquals(date, vuln.getPublished());
}
@Test
public void testUpdated() {
Date date = new Date();
Vulnerability vuln = new Vulnerability();
vuln.setUpdated(date);
Assert.assertEquals(date, vuln.getUpdated());
}
@Test
public void testVulnerableVersions() {
Vulnerability vuln = new Vulnerability();
vuln.setVulnerableVersions("Vulnerable versions");
Assert.assertEquals("Vulnerable versions", vuln.getVulnerableVersions());
}
@Test
public void testPatchedVersions() {
Vulnerability vuln = new Vulnerability();
vuln.setPatchedVersions("Patched versions");
Assert.assertEquals("Patched versions", vuln.getPatchedVersions());
}
@Test
public void testSource() {
Vulnerability vuln = new Vulnerability();
vuln.setSource("My source");
Assert.assertEquals("My source", vuln.getSource());
vuln.setSource(Vulnerability.Source.NPM);
Assert.assertEquals("NPM", vuln.getSource());
}
@Test
public void testTitle() {
Vulnerability vuln = new Vulnerability();
vuln.setTitle("My title");
Assert.assertEquals("My title", vuln.getTitle());
}
@Test
public void testSubTitle() {
Vulnerability vuln = new Vulnerability();
vuln.setSubTitle("My subtitle");
Assert.assertEquals("My subtitle", vuln.getSubTitle());
}
@Test
public void testCwe() {
Cwe cwe = new Cwe();
Vulnerability vuln = new Vulnerability();
vuln.setCwe(cwe);
Assert.assertEquals(cwe, vuln.getCwe());
}
@Test
public void testCvssV2BaseScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV2BaseScore(new BigDecimal(5.0));
Assert.assertEquals(new BigDecimal(5.0), vuln.getCvssV2BaseScore());
}
@Test
public void testCvssV2ImpactSubScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV2ImpactSubScore(new BigDecimal(5.1));
Assert.assertEquals(new BigDecimal(5.1), vuln.getCvssV2ImpactSubScore());
}
@Test
public void testCvssV2ExploitabilitySubScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV2ExploitabilitySubScore(new BigDecimal(5.2));
Assert.assertEquals(new BigDecimal(5.2), vuln.getCvssV2ExploitabilitySubScore());
}
@Test
public void testCvssV2Vector() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV2Vector("CVSS vector");
Assert.assertEquals("CVSS vector", vuln.getCvssV2Vector());
}
@Test
public void testCvssV3BaseScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV3BaseScore(new BigDecimal(6.0));
Assert.assertEquals(new BigDecimal(6.0), vuln.getCvssV3BaseScore());
}
@Test
public void testCvssV3ImpactSubScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV3ImpactSubScore(new BigDecimal(6.1));
Assert.assertEquals(new BigDecimal(6.1), vuln.getCvssV3ImpactSubScore());
}
@Test
public void testCvssV3ExploitabilitySubScore() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV3ExploitabilitySubScore(new BigDecimal(6.2));
Assert.assertEquals(new BigDecimal(6.2), vuln.getCvssV3ExploitabilitySubScore());
}
@Test
public void testCvssV3Vector() {
Vulnerability vuln = new Vulnerability();
vuln.setCvssV3Vector("CVSS vector");
Assert.assertEquals("CVSS vector", vuln.getCvssV3Vector());
}
@Test
public void testMatchedCPE() {
Vulnerability vuln = new Vulnerability();
vuln.setMatchedCPE("Matched CPE");
Assert.assertEquals("Matched CPE", vuln.getMatchedCPE());
}
@Test
public void testMatchedAllPreviousCPE() {
Vulnerability vuln = new Vulnerability();
vuln.setMatchedAllPreviousCPE("Previous CPE");
Assert.assertEquals("Previous CPE", vuln.getMatchedAllPreviousCPE());
}
@Test
public void testComponents() {
List<Component> components = new ArrayList<>();
Component component = new Component();
components.add(component);
Vulnerability vuln = new Vulnerability();
vuln.setComponents(components);
Assert.assertEquals(1, vuln.getComponents().size());
Assert.assertEquals(component, vuln.getComponents().get(0));
}
@Test
public void testUuid() {
UUID uuid = UUID.randomUUID();
Vulnerability vuln = new Vulnerability();
vuln.setUuid(uuid);
Assert.assertEquals(uuid.toString(), vuln.getUuid().toString());
}
}
| src/test/java/org/dependencytrack/model/VulnerabilityTest.java | More model unit tests #68
| src/test/java/org/dependencytrack/model/VulnerabilityTest.java | More model unit tests #68 | <ide><path>rc/test/java/org/dependencytrack/model/VulnerabilityTest.java
<add>/*
<add> * This file is part of Dependency-Track.
<add> *
<add> * Licensed under the Apache License, Version 2.0 (the "License");
<add> * you may not use this file except in compliance with the License.
<add> * You may obtain a copy of the License at
<add> *
<add> * http://www.apache.org/licenses/LICENSE-2.0
<add> *
<add> * Unless required by applicable law or agreed to in writing, software
<add> * distributed under the License is distributed on an "AS IS" BASIS,
<add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<add> * See the License for the specific language governing permissions and
<add> * limitations under the License.
<add> *
<add> * Copyright (c) Steve Springett. All Rights Reserved.
<add> */
<add>package org.dependencytrack.model;
<add>
<add>import org.junit.Assert;
<add>import org.junit.Test;
<add>import java.math.BigDecimal;
<add>import java.util.ArrayList;
<add>import java.util.Date;
<add>import java.util.List;
<add>import java.util.UUID;
<add>
<add>public class VulnerabilityTest {
<add>
<add> @Test
<add> public void testId() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setId(111L);
<add> Assert.assertEquals(111L, vuln.getId());
<add> }
<add>
<add> @Test
<add> public void testSeverity() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV2Vector("Vector");
<add> vuln.setCvssV2BaseScore(new BigDecimal(5.0));
<add> vuln.setCvssV2ImpactSubScore(new BigDecimal(5.1));
<add> vuln.setCvssV2ExploitabilitySubScore(new BigDecimal(5.2));
<add> vuln.setCvssV3Vector("Vector");
<add> vuln.setCvssV3BaseScore(new BigDecimal(6.0));
<add> vuln.setCvssV3ImpactSubScore(new BigDecimal(6.1));
<add> vuln.setCvssV3ExploitabilitySubScore(new BigDecimal(6.2));
<add> Assert.assertEquals(Severity.MEDIUM, vuln.getSeverity());
<add> vuln.setSeverity(Severity.HIGH);
<add> Assert.assertNull(vuln.getCvssV2Vector());
<add> Assert.assertNull(vuln.getCvssV2BaseScore());
<add> Assert.assertNull(vuln.getCvssV2ImpactSubScore());
<add> Assert.assertNull(vuln.getCvssV2ExploitabilitySubScore());
<add> Assert.assertNull(vuln.getCvssV3Vector());
<add> Assert.assertNull(vuln.getCvssV3BaseScore());
<add> Assert.assertNull(vuln.getCvssV3ImpactSubScore());
<add> Assert.assertNull(vuln.getCvssV3ExploitabilitySubScore());
<add> Assert.assertEquals(Severity.HIGH, vuln.getSeverity());
<add> }
<add>
<add> @Test
<add> public void testVulnId() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setVulnId("CVE-2019-0000");
<add> Assert.assertEquals("CVE-2019-0000", vuln.getVulnId());
<add> }
<add>
<add> @Test
<add> public void testDescription() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setDescription("My description");
<add> Assert.assertEquals("My description", vuln.getDescription());
<add> }
<add>
<add> @Test
<add> public void testRecommendation() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setRecommendation("My recommendation");
<add> Assert.assertEquals("My recommendation", vuln.getRecommendation());
<add> }
<add>
<add> @Test
<add> public void testReferences() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setReferences("My references");
<add> Assert.assertEquals("My references", vuln.getReferences());
<add> }
<add>
<add> @Test
<add> public void testCredits() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCredits("My credits");
<add> Assert.assertEquals("My credits", vuln.getCredits());
<add> }
<add>
<add> @Test
<add> public void testCreated() {
<add> Date date = new Date();
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCreated(date);
<add> Assert.assertEquals(date, vuln.getCreated());
<add> }
<add>
<add> @Test
<add> public void testPublished() {
<add> Date date = new Date();
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setPublished(date);
<add> Assert.assertEquals(date, vuln.getPublished());
<add> }
<add>
<add> @Test
<add> public void testUpdated() {
<add> Date date = new Date();
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setUpdated(date);
<add> Assert.assertEquals(date, vuln.getUpdated());
<add> }
<add>
<add> @Test
<add> public void testVulnerableVersions() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setVulnerableVersions("Vulnerable versions");
<add> Assert.assertEquals("Vulnerable versions", vuln.getVulnerableVersions());
<add> }
<add>
<add> @Test
<add> public void testPatchedVersions() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setPatchedVersions("Patched versions");
<add> Assert.assertEquals("Patched versions", vuln.getPatchedVersions());
<add> }
<add>
<add> @Test
<add> public void testSource() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setSource("My source");
<add> Assert.assertEquals("My source", vuln.getSource());
<add> vuln.setSource(Vulnerability.Source.NPM);
<add> Assert.assertEquals("NPM", vuln.getSource());
<add> }
<add>
<add> @Test
<add> public void testTitle() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setTitle("My title");
<add> Assert.assertEquals("My title", vuln.getTitle());
<add> }
<add>
<add> @Test
<add> public void testSubTitle() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setSubTitle("My subtitle");
<add> Assert.assertEquals("My subtitle", vuln.getSubTitle());
<add> }
<add>
<add> @Test
<add> public void testCwe() {
<add> Cwe cwe = new Cwe();
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCwe(cwe);
<add> Assert.assertEquals(cwe, vuln.getCwe());
<add> }
<add>
<add> @Test
<add> public void testCvssV2BaseScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV2BaseScore(new BigDecimal(5.0));
<add> Assert.assertEquals(new BigDecimal(5.0), vuln.getCvssV2BaseScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV2ImpactSubScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV2ImpactSubScore(new BigDecimal(5.1));
<add> Assert.assertEquals(new BigDecimal(5.1), vuln.getCvssV2ImpactSubScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV2ExploitabilitySubScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV2ExploitabilitySubScore(new BigDecimal(5.2));
<add> Assert.assertEquals(new BigDecimal(5.2), vuln.getCvssV2ExploitabilitySubScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV2Vector() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV2Vector("CVSS vector");
<add> Assert.assertEquals("CVSS vector", vuln.getCvssV2Vector());
<add> }
<add>
<add> @Test
<add> public void testCvssV3BaseScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV3BaseScore(new BigDecimal(6.0));
<add> Assert.assertEquals(new BigDecimal(6.0), vuln.getCvssV3BaseScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV3ImpactSubScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV3ImpactSubScore(new BigDecimal(6.1));
<add> Assert.assertEquals(new BigDecimal(6.1), vuln.getCvssV3ImpactSubScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV3ExploitabilitySubScore() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV3ExploitabilitySubScore(new BigDecimal(6.2));
<add> Assert.assertEquals(new BigDecimal(6.2), vuln.getCvssV3ExploitabilitySubScore());
<add> }
<add>
<add> @Test
<add> public void testCvssV3Vector() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setCvssV3Vector("CVSS vector");
<add> Assert.assertEquals("CVSS vector", vuln.getCvssV3Vector());
<add> }
<add>
<add> @Test
<add> public void testMatchedCPE() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setMatchedCPE("Matched CPE");
<add> Assert.assertEquals("Matched CPE", vuln.getMatchedCPE());
<add> }
<add>
<add> @Test
<add> public void testMatchedAllPreviousCPE() {
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setMatchedAllPreviousCPE("Previous CPE");
<add> Assert.assertEquals("Previous CPE", vuln.getMatchedAllPreviousCPE());
<add> }
<add>
<add> @Test
<add> public void testComponents() {
<add> List<Component> components = new ArrayList<>();
<add> Component component = new Component();
<add> components.add(component);
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setComponents(components);
<add> Assert.assertEquals(1, vuln.getComponents().size());
<add> Assert.assertEquals(component, vuln.getComponents().get(0));
<add> }
<add>
<add> @Test
<add> public void testUuid() {
<add> UUID uuid = UUID.randomUUID();
<add> Vulnerability vuln = new Vulnerability();
<add> vuln.setUuid(uuid);
<add> Assert.assertEquals(uuid.toString(), vuln.getUuid().toString());
<add> }
<add>} |
|
JavaScript | apache-2.0 | 3cc2725e174b3a8f50288977adf0456972dacf15 | 0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | /* eslint-disable quotes, max-lines */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 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.
*/
/*
* This file is generated by scripts/build.js.
*/
'use strict';
var db = {
"AFINN_96": "\nAFINN_96()\n Returns a list of English words rated for valence.\n\n The returned list contains 1468 English words (and phrases) rated for\n valence. Negative words have a negative valence [-5,0). Positive words have\n a positive valence (0,5]. Neutral words have a valence of 0.\n\n A few notes:\n\n - The list is an earlier version of AFINN-111.\n - The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n - All words are lowercase.\n - Some \"words\" are phrases; e.g., \"cashing in\", \"cool stuff\".\n - Words may contain apostrophes; e.g., \"can't stand\".\n - Words may contain dashes; e.g., \"cover-up\", \"made-up\".\n\n Returns\n -------\n out: Array<Array>\n List of English words and their valence.\n\n Examples\n --------\n > var list = AFINN_96()\n [ [ 'abandon', -2 ], [ 'abandons', -2 ], [ 'abandoned', -2 ], ... ]\n\n References\n ----------\n - Nielsen, Finn Årup. 2011. \"A new ANEW: Evaluation of a word list for\n sentiment analysis in microblogs.\" In *Proceedings of the ESWC2011 Workshop\n on 'Making Sense of Microposts': Big Things Come in Small Packages.*,\n 718:93–98. CEUR Workshop Proceedings. <http://ceur-ws.org/Vol-718/paper_16.\n pdf>.\n\n * If you use the list for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n AFINN_111\n",
"AFINN_111": "\nAFINN_111()\n Returns a list of English words rated for valence.\n\n The returned list contains 2477 English words (and phrases) rated for\n valence. Negative words have a negative valence [-5,0). Positive words have\n a positive valence (0,5]. Neutral words have a valence of 0.\n\n A few notes:\n\n - The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n - All words are lowercase.\n - Words may contain numbers; e.g., \"n00b\".\n - Some \"words\" are phrases; e.g., \"cool stuff\", \"not good\".\n - Words may contain apostrophes; e.g., \"can't stand\".\n - Words may contain diaeresis; e.g., \"naïve\".\n - Words may contain dashes; e.g., \"self-deluded\", \"self-confident\".\n\n Returns\n -------\n out: Array<Array>\n List of English words and their valence.\n\n Examples\n --------\n > var list = AFINN_111()\n [ [ 'abandon', -2 ], [ 'abandoned', -2 ], [ 'abandons', -2 ], ... ]\n\n References\n ----------\n - Nielsen, Finn Årup. 2011. \"A new ANEW: Evaluation of a word list for\n sentiment analysis in microblogs.\" In *Proceedings of the ESWC2011 Workshop\n on 'Making Sense of Microposts': Big Things Come in Small Packages.*,\n 718:93–98. CEUR Workshop Proceedings. <http://ceur-ws.org/Vol-718/paper_16.\n pdf>.\n\n * If you use the list for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n AFINN_96\n",
"allocUnsafe": "\nallocUnsafe( size )\n Allocates a buffer having a specified number of bytes.\n\n The underlying memory of returned buffers is not initialized. Memory\n contents are unknown and may contain sensitive data.\n\n When the size is less than half a buffer pool size, memory is allocated from\n the buffer pool for faster allocation of Buffer instances.\n\n Parameters\n ----------\n size: integer\n Number of bytes to allocate.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var buf = allocUnsafe( 100 )\n <Buffer>\n\n See Also\n --------\n Buffer, array2buffer, arraybuffer2buffer, copyBuffer, string2buffer\n",
"anova1": "\nanova1( x, factor[, options] )\n Performs a one-way analysis of variance.\n\n Parameters\n ----------\n x: Array<number>\n Measured values.\n\n factor: Array\n Array of treatments.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.means: Object\n Group means alongside sample sizes and standard errors.\n\n out.treatmentDf: number\n Treatment degrees of freedom.\n\n out.treatmentSS: number\n Treatment sum of squares.\n\n out.treatmentMSS: number\n Treatment mean sum of squares.\n\n out.errorDf: number\n Error degrees of freedom.\n\n out.errorSS: number\n Error sum of squares.\n\n out.errorMSS: number\n Error mean sum of squares.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var x = [1, 3, 5, 2, 4, 6, 8, 7, 10, 11, 12, 15];\n > var f = [\n ... 'control', 'treatA', 'treatB', 'treatC', 'control',\n ... 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC'\n ... ];\n > var out = anova1( x, f )\n {...}\n\n",
"ANSCOMBES_QUARTET": "\nANSCOMBES_QUARTET()\n Returns Anscombe's quartet.\n\n Anscombe's quartet is a set of 4 datasets which all have nearly identical\n simple statistical properties but vary considerably when graphed. Anscombe\n created the datasets to demonstrate why graphical data exploration should\n precede statistical data analysis and to show the effect of outliers on\n statistical properties.\n\n Returns\n -------\n out: Array<Array>\n Anscombe's quartet.\n\n Examples\n --------\n > var d = ANSCOMBES_QUARTET()\n [[[10,8.04],...],[[10,9.14],...],[[10,7.46],...],[[8,6.58],...]]\n\n References\n ----------\n - Anscombe, Francis J. 1973. \"Graphs in Statistical Analysis.\" *The American\n Statistician* 27 (1). [American Statistical Association, Taylor & Francis,\n Ltd.]: 17–21. <http://www.jstor.org/stable/2682899>.\n\n",
"any": "\nany( collection )\n Tests whether at least one element in a collection is truthy.\n\n The function immediately returns upon encountering a truthy value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if an element is truthy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 0, 0, 1 ];\n > var bool = any( arr )\n true\n\n See Also\n --------\n anyBy, every, forEach, none, some\n",
"anyBy": "\nanyBy( collection, predicate[, thisArg ] )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns `true` for\n any element; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, 3, 4, -1 ];\n > var bool = anyBy( arr, negative )\n true\n\n See Also\n --------\n anyByAsync, anyByRight, everyBy, forEach, noneBy, someBy\n",
"anyByAsync": "\nanyByAsync( collection, [options,] predicate, done )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-falsy `result`\n value and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nanyByAsync.factory( [options,] predicate )\n Returns a function which tests whether at least one element in a collection\n passes a test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = anyByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyBy, anyByRightAsync, everyByAsync, forEachAsync, noneByAsync, someByAsync\n",
"anyByRight": "\nanyByRight( collection, predicate[, thisArg ] )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns `true` for\n any element; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ -1, 1, 2, 3, 4 ];\n > var bool = anyByRight( arr, negative )\n true\n\n See Also\n --------\n anyBy, anyByRightAsync, everyByRight, forEachRight, noneByRight, someByRight\n",
"anyByRightAsync": "\nanyByRightAsync( collection, [options,] predicate, done )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-falsy `result`\n value and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nanyByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether at least one element in a collection\n passes a test implemented by a predicate function, iterating from right to\n left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = anyByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByAsync, anyByRight, everyByRightAsync, forEachRightAsync, noneByRightAsync, someByRightAsync\n",
"APERY": "\nAPERY\n Apéry's constant.\n\n Examples\n --------\n > APERY\n 1.2020569031595942\n\n",
"append": "\nappend( collection1, collection2 )\n Adds the elements of one collection to the end of another collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection1: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n collection2: Array|TypedArray|Object\n A collection containing the elements to add. If the collection is an\n `Object`, the collection should be array-like.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = append( arr, [ 6.0, 7.0 ] )\n [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = append( arr, [ 3.0, 4.0 ] )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n // Array-like object:\n > arr = { 'length': 0 };\n > arr = append( arr, [ 1.0, 2.0 ] )\n { 'length': 2, '0': 1.0, '1': 2.0 }\n\n See Also\n --------\n prepend, push\n",
"ARCH": "\nARCH\n Operating system CPU architecture.\n\n Current possible values:\n\n - arm\n - arm64\n - ia32\n - mips\n - mipsel\n - ppc\n - ppc64\n - s390\n - s390x\n - x32\n - x64\n\n Examples\n --------\n > ARCH\n <string>\n\n See Also\n --------\n PLATFORM\n",
"argumentFunction": "\nargumentFunction( idx )\n Returns a function which always returns a specified argument.\n\n The input argument corresponds to the zero-based index of the argument to\n return.\n\n Parameters\n ----------\n idx: integer\n Argument index to return (zero-based).\n\n Returns\n -------\n out: Function\n Argument function.\n\n Examples\n --------\n > var argn = argumentFunction( 1 );\n > var v = argn( 3.14, -3.14, 0.0 )\n -3.14\n > v = argn( -1.0, -0.0, 1.0 )\n -0.0\n > v = argn( 'beep', 'boop', 'bop' )\n 'boop'\n > v = argn( 'beep' )\n undefined\n\n See Also\n --------\n constantFunction, identity\n",
"ARGV": "\nARGV\n An array containing command-line arguments passed when launching the calling\n process.\n\n The first element is the absolute pathname of the executable that started\n the calling process.\n\n The second element is the path of the executed file.\n\n Any additional elements are additional command-line arguments.\n\n In browser environments, the array is empty.\n\n Examples\n --------\n > var execPath = ARGV[ 0 ]\n e.g., /usr/local/bin/node\n\n See Also\n --------\n ENV\n",
"array": "\narray( [buffer,] [options] )\n Returns a multidimensional array.\n\n Parameters\n ----------\n buffer: Array|TypedArray|Buffer|ndarray (optional)\n Data source.\n\n options: Object (optional)\n Options.\n\n options.buffer: Array|TypedArray|Buffer|ndarray (optional)\n Data source. If provided along with a `buffer` argument, the argument\n takes precedence.\n\n options.dtype: string (optional)\n Underlying storage data type. If not specified and a data source is\n provided, the data type is inferred from the provided data source. If an\n input data source is not of the same type, this option specifies the\n data type to which to cast the input data. For non-ndarray generic array\n data sources, the function casts generic array data elements to the\n default data type. In order to prevent this cast, the `dtype` option\n must be explicitly set to `'generic'`. Any time a cast is required, the\n `copy` option is set to `true`, as memory must be copied from the data\n source to an output data buffer. Default: 'float64'.\n\n options.order: string (optional)\n Specifies the memory layout of the data source as either row-major (C-\n style) or column-major (Fortran-style). The option may be one of the\n following values:\n\n - 'row-major': the order of the returned array is row-major.\n - 'column-major': the order of the returned array is column-major.\n - 'any': if a data source is column-major and not row-major, the order\n of the returned array is column-major; otherwise, the order of the\n returned array is row-major.\n - 'same': the order of the returned array matches the order of an input\n data source.\n\n Note that specifying an order which differs from the order of a\n provided data source does *not* entail a conversion from one memory\n layout to another. In short, this option is descriptive, not\n prescriptive. Default: 'row-major'.\n\n options.shape: Array<integer> (optional)\n Array shape (dimensions). If a shape is not specified, the function\n attempts to infer a shape based on a provided data source. For example,\n if provided a nested array, the function resolves nested array\n dimensions. If provided a multidimensional array data source, the\n function uses the array's associated shape. For most use cases, such\n inference suffices. For the remaining use cases, specifying a shape is\n necessary. For example, provide a shape to create a multidimensional\n array view over a linear data buffer, ignoring any existing shape meta\n data associated with a provided data source.\n\n options.flatten: boolean (optional)\n Boolean indicating whether to automatically flatten generic array data\n sources. If an array shape is not specified, the shape is inferred from\n the dimensions of nested arrays prior to flattening. If a use case\n requires partial flattening, partially flatten prior to invoking this\n function and set the option value to `false` to prevent further\n flattening during invocation. Default: true.\n\n options.copy: boolean (optional)\n Boolean indicating whether to (shallow) copy source data to a new data\n buffer. The function does *not* perform a deep copy. To prevent\n undesired shared changes in state for generic arrays containing objects,\n perform a deep copy prior to invoking this function. Default: false.\n\n options.ndmin: integer (optional)\n Specifies the minimum number of dimensions. If an array shape has fewer\n dimensions than required by `ndmin`, the function prepends singleton\n dimensions to the array shape in order to satisfy the dimensions\n requirement. Default: 0.\n\n options.casting: string (optional)\n Specifies the casting rule used to determine acceptable casts. The\n option may be one of the following values:\n\n - 'none': only allow casting between identical types.\n - 'equiv': allow casting between identical and byte swapped types.\n - 'safe': only allow \"safe\" casts.\n - 'same-kind': allow \"safe\" casts and casts within the same kind (e.g.,\n between signed integers or between floats).\n - 'unsafe': allow casting between all types (including between integers\n and floats).\n\n Default: 'safe'.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. The\n option may be one of the following values:\n\n - 'throw': an ndarray instance throws an error when an index exceeds\n array dimensions.\n - 'wrap': an ndarray instance wraps around indices exceeding array\n dimensions using modulo arithmetic.\n - 'clamp', an ndarray instance sets an index exceeding array dimensions\n to either `0` (minimum index) or the maximum index.\n\n Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to\n\n - 'throw': an ndarray instance throws an error when a subscript exceeds\n array dimensions.\n - 'wrap': an ndarray instance wraps around subscripts exceeding array\n dimensions using modulo arithmetic.\n - 'clamp': an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index.\n\n If the number of modes is fewer than the number of dimensions, the\n function recycles modes using modulo arithmetic.\n\n Default: [ options.mode ].\n\n Returns\n -------\n out: ndarray\n Multidimensional array.\n\n Examples\n --------\n // Create a 2x2 matrix:\n > var arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n ndarray\n",
"array2buffer": "\narray2buffer( arr )\n Allocates a buffer using an octet array.\n\n Parameters\n ----------\n arr: Array<integer>\n Array (or array-like object) of octets from which to copy.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var buf = array2buffer( [ 1, 2, 3, 4 ] )\n <Buffer>[ 1, 2, 3, 4 ]\n\n See Also\n --------\n Buffer, arraybuffer2buffer, copyBuffer, string2buffer\n",
"ArrayBuffer": "\nArrayBuffer( size )\n Returns an array buffer having a specified number of bytes.\n\n Buffer contents are initialized to 0.\n\n Parameters\n ----------\n size: integer\n Number of bytes.\n\n Returns\n -------\n out: ArrayBuffer\n An array buffer.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 5 )\n <ArrayBuffer>\n\n\nArrayBuffer.length\n Number of input arguments the constructor accepts.\n\n Examples\n --------\n > ArrayBuffer.length\n 1\n\n\nArrayBuffer.isView( arr )\n Returns a boolean indicating if provided an array buffer view.\n\n Parameters\n ----------\n arr: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an input argument is a buffer view.\n\n Examples\n --------\n > var arr = new Float64Array( 10 );\n > ArrayBuffer.isView( arr )\n true\n\n\nArrayBuffer.prototype.byteLength\n Read-only property which returns the length (in bytes) of the array buffer.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 5 );\n > buf.byteLength\n 5\n\n\nArrayBuffer.prototype.slice( [start[, end]] )\n Copies the bytes of an array buffer to a new array buffer.\n\n Parameters\n ----------\n start: integer (optional)\n Index at which to start copying buffer contents (inclusive). If\n negative, the index is relative to the end of the buffer.\n\n end: integer (optional)\n Index at which to stop copying buffer contents (exclusive). If negative,\n the index is relative to the end of the buffer.\n\n Returns\n -------\n out: ArrayBuffer\n A new array buffer whose contents have been copied from the calling\n array buffer.\n\n Examples\n --------\n > var b1 = new ArrayBuffer( 10 );\n > var b2 = b1.slice( 2, 6 );\n > var bool = ( b1 === b2 )\n false\n > b2.byteLength\n 4\n\n See Also\n --------\n Buffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, SharedArrayBuffer, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"arraybuffer2buffer": "\narraybuffer2buffer( buf[, byteOffset[, length]] )\n Allocates a buffer from an ArrayBuffer.\n\n The behavior of this function varies across Node.js versions due to changes\n in the underlying Node.js APIs:\n\n - <3.0.0: the function copies ArrayBuffer bytes to a new Buffer instance.\n - >=3.0.0 and <5.10.0: if provided a byte offset, the function copies\n ArrayBuffer bytes to a new Buffer instance; otherwise, the function\n returns a view of an ArrayBuffer without copying the underlying memory.\n - <6.0.0: if provided an empty ArrayBuffer, the function returns an empty\n Buffer which is not an ArrayBuffer view.\n - >=6.0.0: the function returns a view of an ArrayBuffer without copying\n the underlying memory.\n\n Parameters\n ----------\n buf: ArrayBuffer\n Input array buffer.\n\n byteOffset: integer (optional)\n Index offset specifying the location of the first byte.\n\n length: integer (optional)\n Number of bytes to expose from the underlying ArrayBuffer.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var ab = new ArrayBuffer( 10 )\n <ArrayBuffer>\n > var buf = arraybuffer2buffer( ab )\n <Buffer>\n > var len = buf.length\n 10\n > buf = arraybuffer2buffer( ab, 2, 6 )\n <Buffer>\n > len = buf.length\n 6\n\n See Also\n --------\n Buffer, array2buffer, copyBuffer, string2buffer\n",
"arrayCtors": "\narrayCtors( dtype )\n Returns an array constructor.\n\n The function returns constructors for the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Constructor.\n\n Examples\n --------\n > var ctor = arrayCtors( 'float64' )\n <Function>\n > ctor = arrayCtors( 'float' )\n null\n\n See Also\n --------\n typedarrayCtors\n",
"arrayDataType": "\narrayDataType( array )\n Returns the data type of an array.\n\n If provided an argument having an unknown or unsupported type, the function\n returns `null`.\n\n Parameters\n ----------\n array: any\n Input value.\n\n Returns\n -------\n out: string|null\n Data type.\n\n Examples\n --------\n > var arr = new Float64Array( 10 );\n > var dt = arrayDataType( arr )\n 'float64'\n > dt = arrayDataType( 'beep' )\n null\n\n See Also\n --------\n arrayDataTypes\n",
"arrayDataTypes": "\narrayDataTypes()\n Returns a list of array data types.\n\n The output array contains the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of array data types.\n\n Examples\n --------\n > var out = arrayDataTypes()\n <Array>\n\n See Also\n --------\n typedarrayDataTypes, ndarrayDataTypes\n",
"arrayMinDataType": "\narrayMinDataType( value )\n Returns the minimum array data type of the closest \"kind\" necessary for\n storing a provided scalar value.\n\n The function does *not* provide precision guarantees for non-integer-valued\n real numbers. In other words, the function returns the smallest possible\n floating-point (i.e., inexact) data type for storing numbers having\n decimals.\n\n Parameters\n ----------\n value: any\n Scalar value.\n\n Returns\n -------\n dt: string\n Array data type.\n\n Examples\n --------\n > var dt = arrayMinDataType( 3.141592653589793 )\n 'float32'\n > dt = arrayMinDataType( 3 )\n 'uint8'\n > dt = arrayMinDataType( -3 )\n 'int8'\n > dt = arrayMinDataType( '-3' )\n 'generic'\n\n See Also\n --------\n arrayDataTypes, arrayPromotionRules, arraySafeCasts\n",
"arrayNextDataType": "\narrayNextDataType( [dtype] )\n Returns the next larger array data type of the same kind.\n\n If not provided a data type, the function returns a table.\n\n If a data type does not have a next larger data type or the next larger type\n is not supported, the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Next larger type(s).\n\n Examples\n --------\n > var out = arrayNextDataType( 'float32' )\n 'float64'\n\n See Also\n --------\n arrayDataType, arrayDataTypes\n",
"arrayPromotionRules": "\narrayPromotionRules( [dtype1, dtype2] )\n Returns the array data type with the smallest size and closest \"kind\" to\n which array data types can be safely cast.\n\n If not provided data types, the function returns a type promotion table.\n\n If a data type to which data types can be safely cast does *not* exist (or\n is not supported), the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype1: string (optional)\n Array data type.\n\n dtype2: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Promotion rule(s).\n\n Examples\n --------\n > var out = arrayPromotionRules( 'float32', 'int32' )\n 'float64'\n\n See Also\n --------\n arrayDataTypes, arraySafeCasts, ndarrayPromotionRules\n",
"arraySafeCasts": "\narraySafeCasts( [dtype] )\n Returns a list of array data types to which a provided array data type can\n be safely cast.\n\n If not provided an array data type, the function returns a casting table.\n\n If provided an unrecognized array data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n Array data types to which a data type can be safely cast.\n\n Examples\n --------\n > var out = arraySafeCasts( 'float32' )\n <Array>\n\n See Also\n --------\n convertArray, convertArraySame, arrayDataTypes, arraySameKindCasts, ndarraySafeCasts\n",
"arraySameKindCasts": "\narraySameKindCasts( [dtype] )\n Returns a list of array data types to which a provided array data type can\n be safely cast or cast within the same \"kind\".\n\n If not provided an array data type, the function returns a casting table.\n\n If provided an unrecognized array data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n Array data types to which a data type can be safely cast or cast within\n the same \"kind\".\n\n Examples\n --------\n > var out = arraySameKindCasts( 'float32' )\n <Array>\n\n See Also\n --------\n convertArray, convertArraySame, arrayDataTypes, arraySafeCasts, ndarraySameKindCasts\n",
"arrayShape": "\narrayShape( arr )\n Determines array dimensions.\n\n Parameters\n ----------\n arr: Array\n Input array.\n\n Returns\n -------\n out: Array\n Array shape.\n\n Examples\n --------\n > var out = arrayShape( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] )\n [ 2, 3 ]\n\n See Also\n --------\n ndarray\n",
"bartlettTest": "\nbartlettTest( ...x[, options] )\n Computes Bartlett’s test for equal variances.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = bartlettTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = bartlettTest( arr, { 'groups': groups })\n\n See Also\n --------\n vartest\n",
"base.abs": "\nbase.abs( x )\n Computes the absolute value of `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Absolute value.\n\n Examples\n --------\n > var y = base.abs( -1.0 )\n 1.0\n > y = base.abs( 2.0 )\n 2.0\n > y = base.abs( 0.0 )\n 0.0\n > y = base.abs( -0.0 )\n 0.0\n > y = base.abs( NaN )\n NaN\n\n See Also\n --------\n base.abs2\n",
"base.abs2": "\nbase.abs2( x )\n Computes the squared absolute value of `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Squared absolute value.\n\n Examples\n --------\n > var y = base.abs2( -1.0 )\n 1.0\n > y = base.abs2( 2.0 )\n 4.0\n > y = base.abs2( 0.0 )\n 0.0\n > y = base.abs2( -0.0 )\n 0.0\n > y = base.abs2( NaN )\n NaN\n\n See Also\n --------\n base.abs\n",
"base.absdiff": "\nbase.absdiff( x, y )\n Computes the absolute difference.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Absolute difference.\n\n Examples\n --------\n > var d = base.absdiff( 2.0, 5.0 )\n 3.0\n > d = base.absdiff( -1.0, 3.14 )\n ~4.14\n > d = base.absdiff( 10.1, -2.05 )\n ~12.15\n > d = base.absdiff( -0.0, 0.0 )\n +0.0\n > d = base.absdiff( NaN, 5.0 )\n NaN\n > d = base.absdiff( PINF, NINF )\n Infinity\n > d = base.absdiff( PINF, PINF )\n NaN\n\n See Also\n --------\n base.reldiff, base.epsdiff\n",
"base.absInt32": "\nbase.absInt32( x )\n Computes an absolute value of a signed 32-bit integer in two's complement\n format.\n\n Parameters\n ----------\n x: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Absolute value.\n\n Examples\n --------\n > var v = base.absInt32( -1|0 )\n 1\n > v = base.absInt32( 2|0 )\n 2\n > v = base.absInt32( 0|0 )\n 0\n\n See Also\n --------\n base.abs\n",
"base.acos": "\nbase.acos( x )\n Compute the arccosine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arccosine (in radians).\n\n Examples\n --------\n > var y = base.acos( 1.0 )\n 0.0\n > y = base.acos( 0.707 )\n ~0.7855\n > y = base.acos( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asin, base.atan\n",
"base.acosh": "\nbase.acosh( x )\n Computes the hyperbolic arccosine of a number.\n\n If `x < 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arccosine (in radians).\n\n Examples\n --------\n > var y = base.acosh( 1.0 )\n 0.0\n > y = base.acosh( 2.0 )\n ~1.317\n > y = base.acosh( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asinh, base.atanh\n",
"base.acoth": "\nbase.acoth( x )\n Computes the inverse hyperbolic cotangent of a number.\n\n The domain of the inverse hyperbolic cotangent is the union of the intervals\n (-inf,-1] and [1,inf).\n\n If provided a value on the open interval (-1,1), the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse hyperbolic cotangent (in radians).\n\n Examples\n --------\n > var y = base.acoth( 2.0 )\n ~0.5493\n > y = base.acoth( 0.0 )\n NaN\n > y = base.acoth( 0.5 )\n NaN\n > y = base.acoth( 1.0 )\n Infinity\n > y = base.acoth( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asinh, base.atanh\n",
"base.acovercos": "\nbase.acovercos( x )\n Computes the inverse coversed cosine.\n\n The inverse coversed cosine is defined as `asin(1+x)`.\n\n If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse coversed cosine.\n\n Examples\n --------\n > var y = base.acovercos( -1.5 )\n ~-0.5236\n > y = base.acovercos( -0.0 )\n ~1.5708\n\n See Also\n --------\n base.acoversin, base.avercos, base.covercos, base.vercos\n",
"base.acoversin": "\nbase.acoversin( x )\n Computes the inverse coversed sine.\n\n The inverse coversed sine is defined as `asin(1-x)`.\n\n If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse coversed sine.\n\n Examples\n --------\n > var y = base.acoversin( 1.5 )\n ~-0.5236\n > y = base.acoversin( 0.0 )\n ~1.5708\n\n See Also\n --------\n base.acovercos, base.aversin, base.coversin, base.versin\n",
"base.ahavercos": "\nbase.ahavercos( x )\n Computes the inverse half-value versed cosine.\n\n The inverse half-value versed cosine is defined as `2*acos(sqrt(x))`.\n\n If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse half-value versed cosine.\n\n Examples\n --------\n > var y = base.ahavercos( 0.5 )\n ~1.5708\n > y = base.ahavercos( 0.0 )\n ~3.1416\n\n See Also\n --------\n base.ahaversin, base.havercos, base.vercos\n",
"base.ahaversin": "\nbase.ahaversin( x )\n Computes the inverse half-value versed sine.\n\n The inverse half-value versed sine is defined as `2*asin(sqrt(x))`.\n\n If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse half-value versed sine.\n\n Examples\n --------\n > var y = base.ahaversin( 0.5 )\n ~1.5708\n > y = base.ahaversin( 0.0 )\n 0.0\n\n See Also\n --------\n base.ahavercos, base.haversin, base.versin\n",
"base.asin": "\nbase.asin( x )\n Computes the arcsine of a number.\n\n If `|x| > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arcsine (in radians).\n\n Examples\n --------\n > var y = base.asin( 0.0 )\n 0.0\n > y = base.asin( PI/2.0 )\n ~1.0\n > y = base.asin( -PI/6.0 )\n ~-0.551\n > y = base.asin( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asinh, base.atan\n",
"base.asinh": "\nbase.asinh( x )\n Computes the hyperbolic arcsine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arcsine (in radians).\n\n Examples\n --------\n > var y = base.asinh( 0.0 )\n 0.0\n > y = base.asinh( 2.0 )\n ~1.444\n > y = base.asinh( -2.0 )\n ~-1.444\n > y = base.asinh( NaN )\n NaN\n > y = base.asinh( NINF )\n -Infinity\n > y = base.asinh( PINF )\n Infinity\n\n See Also\n --------\n base.acosh, base.asin, base.atanh\n",
"base.atan": "\nbase.atan( x )\n Computes the arctangent of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arctangent (in radians).\n\n Examples\n --------\n > var y = base.atan( 0.0 )\n ~0.0\n > y = base.atan( -PI/2.0 )\n ~-1.004\n > y = base.atan( PI/2.0 )\n ~1.004\n > y = base.atan( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asin, base.atanh\n",
"base.atan2": "\nbase.atan2( y, x )\n Evaluates the arctangent of the quotient of two numbers.\n\n Parameters\n ----------\n y: number\n Numerator.\n\n x: number\n Denominator.\n\n Returns\n -------\n out: number\n Arctangent of `y/x` (in radians).\n\n Examples\n --------\n > var v = base.atan2( 2.0, 2.0 )\n ~0.785\n > v = base.atan2( 6.0, 2.0 )\n ~1.249\n > v = base.atan2( -1.0, -1.0 )\n ~-2.356\n > v = base.atan2( 3.0, 0.0 )\n ~1.571\n > v = base.atan2( -2.0, 0.0 )\n ~-1.571\n > v = base.atan2( 0.0, 0.0 )\n 0.0\n > v = base.atan2( 3.0, NaN )\n NaN\n > v = base.atan2( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.atan\n",
"base.atanh": "\nbase.atanh( x )\n Computes the hyperbolic arctangent of a number.\n\n If `|x| > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arctangent (in radians).\n\n Examples\n --------\n > var y = base.atanh( 0.0 )\n 0.0\n > y = base.atanh( 0.9 )\n ~1.472\n > y = base.atanh( 1.0 )\n Infinity\n > y = base.atanh( -1.0 )\n -Infinity\n > y = base.atanh( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asinh, base.atan\n",
"base.avercos": "\nbase.avercos( x )\n Computes the inverse versed cosine.\n\n The inverse versed cosine is defined as `acos(1+x)`.\n\n If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse versed cosine.\n\n Examples\n --------\n > var y = base.avercos( -1.5 )\n ~2.0944\n > y = base.avercos( -0.0 )\n 0.0\n\n See Also\n --------\n base.aversin, base.versin\n",
"base.aversin": "\nbase.aversin( x )\n Computes the inverse versed sine.\n\n The inverse versed sine is defined as `acos(1-x)`.\n\n If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse versed sine.\n\n Examples\n --------\n > var y = base.aversin( 1.5 )\n ~2.0944\n > y = base.aversin( 0.0 )\n 0.0\n\n See Also\n --------\n base.avercos, base.vercos\n",
"base.bernoulli": "\nbase.bernoulli( n )\n Computes the nth Bernoulli number.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: number\n Bernoulli number.\n\n Examples\n --------\n > var y = base.bernoulli( 0 )\n 1.0\n > y = base.bernoulli( 1 )\n 0.0\n > y = base.bernoulli( 2 )\n ~0.167\n > y = base.bernoulli( 3 )\n 0.0\n > y = base.bernoulli( 4 )\n ~-0.033\n > y = base.bernoulli( 5 )\n 0.0\n > y = base.bernoulli( 20 )\n ~-529.124\n > y = base.bernoulli( 260 )\n -Infinity\n > y = base.bernoulli( 262 )\n Infinity\n > y = base.bernoulli( NaN )\n NaN\n\n",
"base.besselj0": "\nbase.besselj0( x )\n Computes the Bessel function of the first kind of order zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.besselj0( 0.0 )\n 1.0\n > y = base.besselj0( 1.0 )\n ~0.765\n > y = base.besselj0( PINF )\n 0.0\n > y = base.besselj0( NINF )\n 0.0\n > y = base.besselj0( NaN )\n NaN\n\n See Also\n --------\n base.besselj1, base.bessely0, base.bessely1\n",
"base.besselj1": "\nbase.besselj1( x )\n Computes the Bessel function of the first kind of order one.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.besselj1( 0.0 )\n 0.0\n > y = base.besselj1( 1.0 )\n ~0.440\n > y = base.besselj1( PINF )\n 0.0\n > y = base.besselj1( NINF )\n 0.0\n > y = base.besselj1( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.bessely0, base.bessely1\n",
"base.bessely0": "\nbase.bessely0( x )\n Computes the Bessel function of the second kind of order zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.bessely0( 0.0 )\n -Infinity\n > y = base.bessely0( 1.0 )\n ~0.088\n > y = base.bessely0( -1.0 )\n NaN\n > y = base.bessely0( PINF )\n 0.0\n > y = base.bessely0( NINF )\n NaN\n > y = base.bessely0( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.besselj1, base.bessely1\n",
"base.bessely1": "\nbase.bessely1( x )\n Computes the Bessel function of the second kind of order one.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.bessely1( 0.0 )\n -Infinity\n > y = base.bessely1( 1.0 )\n ~-0.781\n > y = base.bessely1( -1.0 )\n NaN\n > y = base.bessely1( PINF )\n 0.0\n > y = base.bessely1( NINF )\n NaN\n > y = base.bessely1( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.besselj1, base.bessely0\n",
"base.beta": "\nbase.beta( x, y )\n Evaluates the beta function.\n\n Parameters\n ----------\n x: number\n First function parameter (non-negative).\n\n y: number\n Second function parameter (non-negative).\n\n Returns\n -------\n out: number\n Evaluated beta function.\n\n Examples\n --------\n > var v = base.beta( 0.0, 0.0 )\n Infinity\n > v = base.beta( 1.0, 1.0 )\n 1.0\n > v = base.beta( -1.0, 2.0 )\n NaN\n > v = base.beta( 5.0, 0.2 )\n ~3.382\n > v = base.beta( 4.0, 1.0 )\n 0.25\n > v = base.beta( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.betainc, base.betaincinv, base.betaln\n",
"base.betainc": "\nbase.betainc( x, a, b[, regularized[, upper]] )\n Computes the regularized incomplete beta function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete beta functions, respectively.\n\n If provided `x < 0` or `x > 1`, the function returns `NaN`.\n\n If provided `a < 0` or `b < 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n regularized: boolean (optional)\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete beta function. Default: `true`.\n\n upper: boolean (optional)\n Boolean indicating whether the function should return the upper tail of\n the incomplete beta function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.betainc( 0.5, 2.0, 2.0 )\n 0.5\n > y = base.betainc( 0.5, 2.0, 2.0, false )\n ~0.083\n > y = base.betainc( 0.2, 1.0, 2.0 )\n 0.36\n > y = base.betainc( 0.2, 1.0, 2.0, true, true )\n 0.64\n > y = base.betainc( NaN, 1.0, 1.0 )\n NaN\n > y = base.betainc( 0.8, NaN, 1.0 )\n NaN\n > y = base.betainc( 0.8, 1.0, NaN )\n NaN\n > y = base.betainc( 1.5, 1.0, 1.0 )\n NaN\n > y = base.betainc( -0.5, 1.0, 1.0 )\n NaN\n > y = base.betainc( 0.5, -2.0, 2.0 )\n NaN\n > y = base.betainc( 0.5, 2.0, -2.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betaincinv, base.betaln\n",
"base.betaincinv": "\nbase.betaincinv( p, a, b[, upper] )\n Computes the inverse of the lower incomplete beta function.\n\n In contrast to a more commonly used definition, the first argument is the\n probability `p` and the second and third arguments are `a` and `b`,\n respectively.\n\n By default, the function inverts the lower regularized incomplete beta\n function. To invert the upper function, set the `upper` argument to `true`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Probability.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n upper: boolean (optional)\n Boolean indicating if the function should invert the upper tail of the\n incomplete beta function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.betaincinv( 0.2, 3.0, 3.0 )\n ~0.327\n > y = base.betaincinv( 0.4, 3.0, 3.0 )\n ~0.446\n > y = base.betaincinv( 0.4, 3.0, 3.0, true )\n ~0.554\n > y = base.betaincinv( 0.4, 1.0, 6.0 )\n ~0.082\n > y = base.betaincinv( 0.8, 1.0, 6.0 )\n ~0.235\n > y = base.betaincinv( NaN, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, NaN, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, 1.0, NaN )\n NaN\n > y = base.betaincinv( 1.2, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( -0.5, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, -2.0, 2.0 )\n NaN\n > y = base.betaincinv( 0.5, 0.0, 2.0 )\n NaN\n > y = base.betaincinv( 0.5, 2.0, -2.0 )\n NaN\n > y = base.betaincinv( 0.5, 2.0, 0.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betainc, base.betaln\n",
"base.betaln": "\nbase.betaln( a, b )\n Evaluates the natural logarithm of the beta function.\n\n Parameters\n ----------\n a: number\n First function parameter (non-negative).\n\n b: number\n Second function parameter (non-negative).\n\n Returns\n -------\n out: number\n Natural logarithm of the beta function.\n\n Examples\n --------\n > var v = base.betaln( 0.0, 0.0 )\n Infinity\n > v = base.betaln( 1.0, 1.0 )\n 0.0\n > v = base.betaln( -1.0, 2.0 )\n NaN\n > v = base.betaln( 5.0, 0.2 )\n ~1.218\n > v = base.betaln( 4.0, 1.0 )\n ~-1.386\n > v = base.betaln( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betainc, base.betaincinv\n",
"base.binet": "\nbase.binet( x )\n Evaluates Binet's formula extended to real numbers.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function result.\n\n Examples\n --------\n > var y = base.binet( 0.0 )\n 0.0\n > y = base.binet( 1.0 )\n 1.0\n > y = base.binet( 2.0 )\n 1.0\n > y = base.binet( 3.0 )\n 2.0\n > y = base.binet( 4.0 )\n 3.0\n > y = base.binet( 5.0 )\n ~5.0\n > y = base.binet( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negafibonacci\n",
"base.binomcoef": "\nbase.binomcoef( n, k )\n Computes the binomial coefficient of two integers.\n\n If `k < 0`, the function returns `0`.\n\n The function returns `NaN` for non-integer `n` or `k`.\n\n Parameters\n ----------\n n: integer\n First input value.\n\n k: integer\n Second input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var v = base.binomcoef( 8, 2 )\n 28\n > v = base.binomcoef( 0, 0 )\n 1\n > v = base.binomcoef( -4, 2 )\n 10\n > v = base.binomcoef( 5, 3 )\n 10\n > v = base.binomcoef( NaN, 3 )\n NaN\n > v = base.binomcoef( 5, NaN )\n NaN\n > v = base.binomcoef( NaN, NaN )\n NaN\n\n",
"base.binomcoefln": "\nbase.binomcoefln( n, k )\n Computes the natural logarithm of the binomial coefficient of two integers.\n\n If `k < 0`, the function returns negative infinity.\n\n The function returns `NaN` for non-integer `n` or `k`.\n\n Parameters\n ----------\n n: integer\n First input value.\n\n k: integer\n Second input value.\n\n Returns\n -------\n out: number\n Natural logarithm of the binomial coefficient.\n\n Examples\n --------\n > var v = base.binomcoefln( 8, 2 )\n ~3.332\n > v = base.binomcoefln( 0, 0 )\n 0.0\n > v = base.binomcoefln( -4, 2 )\n ~2.303\n > v = base.binomcoefln( 88, 3 )\n ~11.606\n > v = base.binomcoefln( NaN, 3 )\n NaN\n > v = base.binomcoefln( 5, NaN )\n NaN\n > v = base.binomcoefln( NaN, NaN )\n NaN\n\n",
"base.boxcox": "\nbase.boxcox( x, lambda )\n Computes a one-parameter Box-Cox transformation.\n\n Parameters\n ----------\n x: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox( 1.0, 2.5 )\n 0.0\n > v = base.boxcox( 4.0, 2.5 )\n 12.4\n > v = base.boxcox( 10.0, 2.5 )\n ~126.0911\n > v = base.boxcox( 2.0, 0.0 )\n ~0.6931\n > v = base.boxcox( -1.0, 2.5 )\n NaN\n > v = base.boxcox( 0.0, -1.0 )\n -Infinity\n\n See Also\n --------\n base.boxcoxinv, base.boxcox1p, base.boxcox1pinv",
"base.boxcox1p": "\nbase.boxcox1p( x, lambda )\n Computes a one-parameter Box-Cox transformation of 1+x.\n\n Parameters\n ----------\n x: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox1p( 1.0, 2.5 )\n ~1.8627\n > v = base.boxcox1p( 4.0, 2.5 )\n ~21.9607\n > v = base.boxcox1p( 10.0, 2.5 )\n ~160.1246\n > v = base.boxcox1p( 2.0, 0.0 )\n ~1.0986\n > v = base.boxcox1p( -1.0, 2.5 )\n -0.4\n > v = base.boxcox1p( 0.0, -1.0 )\n 0.0\n > v = base.boxcox1p( -1.0, -1.0 )\n -Infinity\n\n See Also\n --------\n base.boxcox, base.boxcox1pinv, base.boxcoxinv",
"base.boxcox1pinv": "\nbase.boxcox1pinv( y, lambda )\n Computes the inverse of a one-parameter Box-Cox transformation for 1+x.\n\n Parameters\n ----------\n y: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n v: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox1pinv( 1.0, 2.5 )\n ~0.6505\n > v = base.boxcox1pinv( 4.0, 2.5 )\n ~1.6095\n > v = base.boxcox1pinv( 10.0, 2.5 )\n ~2.6812\n > v = base.boxcox1pinv( 2.0, 0.0 )\n ~6.3891\n > v = base.boxcox1pinv( -1.0, 2.5 )\n NaN\n > v = base.boxcox1pinv( 0.0, -1.0 )\n 0.0\n > v = base.boxcox1pinv( 1.0, NaN )\n NaN\n > v = base.boxcox1pinv( NaN, 3.1 )\n NaN\n\n See Also\n --------\n base.boxcox, base.boxcox1p, base.boxcoxinv",
"base.boxcoxinv": "\nbase.boxcoxinv( y, lambda )\n Computes the inverse of a one-parameter Box-Cox transformation.\n\n Parameters\n ----------\n y: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcoxinv( 1.0, 2.5 )\n ~1.6505\n > v = base.boxcoxinv( 4.0, 2.5 )\n ~2.6095\n > v = base.boxcoxinv( 10.0, 2.5 )\n ~3.6812\n > v = base.boxcoxinv( 2.0, 0.0 )\n ~7.3891\n > v = base.boxcoxinv( -1.0, 2.5 )\n NaN\n > v = base.boxcoxinv( 0.0, -1.0 )\n 1.0\n > v = base.boxcoxinv( 1.0, NaN )\n NaN\n > v = base.boxcoxinv( NaN, 3.1 )\n NaN\n\n See Also\n --------\n base.boxcox, base.boxcox1p, base.boxcox1pinv",
"base.cabs": "\nbase.cabs( re, im )\n Computes the absolute value of a complex number.\n\n The absolute value of a complex number is its distance from zero.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n y: number\n Absolute value.\n\n Examples\n --------\n > var y = base.cabs( 5.0, 3.0 )\n ~5.831\n\n See Also\n --------\n base.cabs2, base.abs\n",
"base.cabs2": "\nbase.cabs2( re, im )\n Computes the squared absolute value of a complex number.\n\n The absolute value of a complex number is its distance from zero.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n y: number\n Squared absolute value.\n\n Examples\n --------\n > var y = base.cabs2( 5.0, 3.0 )\n 34.0\n\n See Also\n --------\n base.cabs, base.abs2\n",
"base.cadd": "\nbase.cadd( [out,] re1, im1, re2, im2 )\n Adds two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cadd( 5.0, 3.0, -2.0, 1.0 )\n [ 3.0, 4.0 ]\n\n // Provide an output array:\n > var out = new Float32Array( 2 );\n > y = base.cadd( out, 5.0, 3.0, -2.0, 1.0 )\n <Float32Array>[ 3.0, 4.0 ]\n > var bool = ( y === out )\n true\n\n See Also\n --------\n base.cdiv, base.cmul, base.csub\n",
"base.cbrt": "\nbase.cbrt( x )\n Computes the cube root.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Cube root.\n\n Examples\n --------\n > var y = base.cbrt( 64.0 )\n 4.0\n > y = base.cbrt( 27.0 )\n 3.0\n > y = base.cbrt( 0.0 )\n 0.0\n > y = base.cbrt( -0.0 )\n -0.0\n > y = base.cbrt( -9.0 )\n ~-2.08\n > y = base.cbrt( NaN )\n NaN\n\n See Also\n --------\n base.pow, base.sqrt\n",
"base.cceil": "\nbase.cceil( [out,] re, im )\n Rounds a complex number toward positive infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cceil( 5.5, 3.3 )\n [ 6.0, 4.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cceil( out, 5.5, 3.3 )\n <Float64Array>[ 6.0, 4.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloor, base.cround\n",
"base.cceiln": "\nbase.cceiln( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n` toward positive\n infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cceiln( 5.555, -3.333, -2 )\n [ 5.56, -3.33 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cceiln( out, 5.555, -3.333, -2 )\n <Float64Array>[ 5.56, -3.33 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloorn, base.croundn\n",
"base.ccis": "\nbase.ccis( [out,] re, im )\n Computes the cis function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.ccis( 0.0, 0.0 )\n [ 1.0, 0.0 ]\n\n > var y = base.ccis( 1.0, 0.0 )\n [ ~0.540, ~0.841 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.ccis( out, 1.0, 0.0 )\n <Float64Array>[ ~0.540, ~0.841 ]\n > var bool = ( v === out )\n true\n\n",
"base.cdiv": "\nbase.cdiv( [out,] re1, im1, re2, im2 )\n Divides two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cdiv( -13.0, -1.0, -2.0, 1.0 )\n [ 5.0, 3.0 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cdiv( out, -13.0, -1.0, -2.0, 1.0 )\n <Float64Array>[ 5.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cmul, base.csub\n",
"base.ceil": "\nbase.ceil( x )\n Rounds a numeric value toward positive infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil( 3.14 )\n 4.0\n > y = base.ceil( -4.2 )\n -4.0\n > y = base.ceil( -4.6 )\n -4.0\n > y = base.ceil( 9.5 )\n 10.0\n > y = base.ceil( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceiln, base.floor, base.round\n",
"base.ceil2": "\nbase.ceil2( x )\n Rounds a numeric value to the nearest power of two toward positive infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil2( 3.14 )\n 4.0\n > y = base.ceil2( -4.2 )\n -4.0\n > y = base.ceil2( -4.6 )\n -4.0\n > y = base.ceil2( 9.5 )\n 16.0\n > y = base.ceil2( 13.0 )\n 16.0\n > y = base.ceil2( -13.0 )\n -8.0\n > y = base.ceil2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.ceil10, base.floor2, base.round2\n",
"base.ceil10": "\nbase.ceil10( x )\n Rounds a numeric value to the nearest power of ten toward positive infinity.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil10( 3.14 )\n 10.0\n > y = base.ceil10( -4.2 )\n -1.0\n > y = base.ceil10( -4.6 )\n -1.0\n > y = base.ceil10( 9.5 )\n 10.0\n > y = base.ceil10( 13.0 )\n 100.0\n > y = base.ceil10( -13.0 )\n -10.0\n > y = base.ceil10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.ceil2, base.floor10, base.round10\n",
"base.ceilb": "\nbase.ceilb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward positive\n infinity.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.ceilb( 3.14159, -4, 10 )\n 3.1416\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.ceilb( 3.14159, 0, 2 )\n 4.0\n\n // Round to nearest multiple of two toward positive infinity:\n > y = base.ceilb( 5.0, 1, 2 )\n 6.0\n\n See Also\n --------\n base.ceil, base.ceiln, base.floorb, base.roundb\n",
"base.ceiln": "\nbase.ceiln( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward positive\n infinity.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.ceiln( 3.14159, -2 )\n 3.15\n\n // If `n = 0`, standard round toward positive infinity behavior:\n > y = base.ceiln( 3.14159, 0 )\n 4.0\n\n // Round to nearest thousand:\n > y = base.ceiln( 12368.0, 3 )\n 13000.0\n\n\n See Also\n --------\n base.ceil, base.ceilb, base.floorn, base.roundn\n",
"base.ceilsd": "\nbase.ceilsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward positive infinity with\n `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceilsd( 3.14159, 5 )\n 3.1416\n > y = base.ceilsd( 3.14159, 1 )\n 4.0\n > y = base.ceilsd( 12368.0, 2 )\n 13000.0\n > y = base.ceilsd( 0.0313, 2, 2 )\n 0.046875\n\n See Also\n --------\n base.ceil, base.floorsd, base.roundsd, base.truncsd\n",
"base.cexp": "\nbase.cexp( [out,] re, im )\n Computes the exponential function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cexp( 0.0, 0.0 )\n [ 1.0, 0.0 ]\n\n > y = base.cexp( 0.0, 1.0 )\n [ ~0.540, ~0.841 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cexp( out, 0.0, 1.0 )\n <Float64Array>[ ~0.540, ~0.841 ]\n > var bool = ( v === out )\n true\n\n",
"base.cflipsign": "\nbase.cflipsign( [out,] re, im, y )\n Returns a complex number with the same magnitude as `z` and the sign of\n `y*z`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n y: number\n Number from which to derive the sign.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Function result.\n\n Examples\n --------\n > var out = base.cflipsign( -4.2, 5.5, -9 )\n [ 4.2, -5.5 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cflipsign( out, -4.2, 5.5, 8 )\n <Float64Array>[ -4.2, 5.5 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cneg, base.csignum\n",
"base.cfloor": "\nbase.cfloor( [out,] re, im )\n Rounds a complex number toward negative infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Rounded components.\n\n Examples\n --------\n > var out = base.cfloor( 5.5, 3.3 )\n [ 5.0, 3.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cfloor( out, 5.5, 3.3 )\n <Float64Array>[ 5.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloorn, base.cround\n",
"base.cfloorn": "\nbase.cfloorn( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n` toward negative\n infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cfloorn( 5.555, -3.333, -2 )\n [ 5.55, -3.34 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cfloorn( out, 5.555, -3.333, -2 )\n <Float64Array>[ 5.55, -3.34 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloor, base.croundn\n",
"base.cinv": "\nbase.cinv( [out,] re, im )\n Computes the inverse of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cinv( 2.0, 4.0 )\n [ 0.1, -0.2 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cinv( out, 2.0, 4.0 )\n <Float64Array>[ 0.1, -0.2 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cdiv\n",
"base.clamp": "\nbase.clamp( v, min, max )\n Restricts a value to a specified range.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Value to restrict.\n\n min: number\n Minimum value.\n\n max: number\n Maximum value.\n\n Returns\n -------\n y: number\n Restricted value.\n\n Examples\n --------\n > var y = base.clamp( 3.14, 0.0, 5.0 )\n 3.14\n > y = base.clamp( -3.14, 0.0, 5.0 )\n 0.0\n > y = base.clamp( 3.14, 0.0, 3.0 )\n 3.0\n > y = base.clamp( -0.0, 0.0, 5.0 )\n 0.0\n > y = base.clamp( 0.0, -3.14, -0.0 )\n -0.0\n > y = base.clamp( NaN, 0.0, 5.0 )\n NaN\n\n See Also\n --------\n base.wrap\n",
"base.cmul": "\nbase.cmul( [out,] re1, im1, re2, im2 )\n Multiplies two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Array containing the real and imaginary components of the result.\n\n Examples\n --------\n > var out = base.cmul( 5.0, 3.0, -2.0, 1.0 )\n [ -13.0, -1.0 ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > var v = base.cmul( out, 5.0, 3.0, -2.0, 1.0 )\n <Float64Array>[ -13.0, -1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cdiv, base.csub\n",
"base.cneg": "\nbase.cneg( [out,] re, im )\n Negates a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Negated components.\n\n Examples\n --------\n > var out = base.cneg( -4.2, 5.5 )\n [ 4.2, -5.5 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cneg( out, -4.2, 5.5 )\n <Float64Array>[ 4.2, -5.5 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cabs\n",
"base.continuedFraction": "\nbase.continuedFraction( generator[, options] )\n Evaluates the continued fraction approximation for the supplied series\n generator using the modified Lentz algorithm.\n\n `generator` can be either a function which returns an array with two\n elements, the `a` and `b` terms of the fraction, or an ES6 Generator object.\n\n By default, the function computes\n\n a1\n ---------------\n b1 + a2\n ----------\n b2 + a3\n -----\n b3 + ...\n\n To evaluate\n\n b0 +\t a1\n ---------------\n b1 +\t a2\n ----------\n b2 + a3\n -----\n b3 + ...\n\n set the `keep` option to `true`.\n\n Parameters\n ----------\n generator: Function\n Function returning terms of continued fraction expansion.\n\n options: Object (optional)\n Options.\n\n options.maxIter: integer (optional)\n Maximum number of iterations. Default: `1000000`.\n\n options.tolerance: number (optional)\n Further terms are only added as long as the next term is greater than\n current term times the tolerance. Default: `2.22e-16`.\n\n options.keep: boolean (optional)\n Boolean indicating whether to keep the `b0` term in the continued\n fraction. Default: `false`.\n\n Returns\n -------\n out: number\n Value of continued fraction.\n\n Examples\n --------\n // Continued fraction for (e-1)^(-1):\n > function closure() {\n ... var i = 0;\n ... return function() {\n ... i += 1;\n ... return [ i, i ];\n ... };\n ... };\n > var gen = closure();\n > var out = base.continuedFraction( gen )\n ~0.582\n\n // Using an ES6 generator:\n > function* generator() {\n ... var i = 0;\n ... while ( true ) {\n ... i += 1;\n ... yield [ i, i ];\n ... }\n ... };\n > gen = generator();\n > out = base.continuedFraction( gen )\n ~0.582\n\n // Set options:\n > out = base.continuedFraction( generator(), { 'keep': true } )\n ~1.718\n > out = base.continuedFraction( generator(), { 'maxIter': 10 } )\n ~0.582\n > out = base.continuedFraction( generator(), { 'tolerance': 1e-1 } )\n ~0.579\n\n",
"base.copysign": "\nbase.copysign( x, y )\n Returns a double-precision floating-point number with the magnitude of `x`\n and the sign of `y`.\n\n Parameters\n ----------\n x: number\n Number from which to derive a magnitude.\n\n y: number\n Number from which to derive a sign.\n\n Returns\n -------\n z: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var z = base.copysign( -3.14, 10.0 )\n 3.14\n > z = base.copysign( 3.14, -1.0 )\n -3.14\n > z = base.copysign( 1.0, -0.0 )\n -1.0\n > z = base.copysign( -3.14, -0.0 )\n -3.14\n > z = base.copysign( -0.0, 1.0 )\n 0.0\n\n See Also\n --------\n base.flipsign\n",
"base.cos": "\nbase.cos( x )\n Computes the cosine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Cosine.\n\n Examples\n --------\n > var y = base.cos( 0.0 )\n 1.0\n > y = base.cos( PI/4.0 )\n ~0.707\n > y = base.cos( -PI/6.0 )\n ~0.866\n > y = base.cos( NaN )\n NaN\n\n See Also\n --------\n base.cospi, base.cosm1, base.sin, base.tan\n",
"base.cosh": "\nbase.cosh( x )\n Computes the hyperbolic cosine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic cosine.\n\n Examples\n --------\n > var y = base.cosh( 0.0 )\n 1.0\n > y = base.cosh( 2.0 )\n ~3.762\n > y = base.cosh( -2.0 )\n ~3.762\n > y = base.cosh( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sinh, base.tanh\n",
"base.cosm1": "\nbase.cosm1( x )\n Computes the cosine of a number minus one.\n\n This function should be used instead of manually calculating `cos(x)-1` when\n `x` is near unity.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Cosine minus one.\n\n Examples\n --------\n > var y = base.cosm1( 0.0 )\n 0.0\n > y = base.cosm1( PI/4.0 )\n ~-0.293\n > y = base.cosm1( -PI/6.0 )\n ~-0.134\n > y = base.cosm1( NaN )\n NaN\n\n See Also\n --------\n base.cos\n",
"base.cospi": "\nbase.cospi( x )\n Computes the value of `cos(πx)`.\n\n This function computes `cos(πx)` more accurately than the obvious approach,\n especially for large `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.cospi( 0.0 )\n 1.0\n > y = base.cospi( 0.5 )\n 0.0\n > y = base.cospi( 0.1 )\n ~0.951\n > y = base.cospi( NaN )\n NaN\n\n See Also\n --------\n base.cos\n",
"base.covercos": "\nbase.covercos( x )\n Computes the coversed cosine.\n\n The coversed cosine is defined as `1 + sin(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Coversed cosine.\n\n Examples\n --------\n > var y = base.covercos( 3.14 )\n ~1.0016\n > y = base.covercos( -4.2 )\n ~1.8716\n > y = base.covercos( -4.6 )\n ~1.9937\n > y = base.covercos( 9.5 )\n ~0.9248\n > y = base.covercos( -0.0 )\n 1.0\n\n See Also\n --------\n base.coversin, base.vercos\n",
"base.coversin": "\nbase.coversin( x )\n Computes the coversed sine.\n\n The coversed sine is defined as `1 - sin(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Coversed sine.\n\n Examples\n --------\n > var y = base.coversin( 3.14 )\n ~0.9984\n > y = base.coversin( -4.2 )\n ~0.1284\n > y = base.coversin( -4.6 )\n ~0.0063\n > y = base.coversin( 9.5 )\n ~1.0752\n > y = base.coversin( -0.0 )\n 1.0\n\n See Also\n --------\n base.covercos, base.versin\n",
"base.cphase": "\nbase.cphase( re, im )\n Computes the argument of a complex number in radians.\n\n The argument of a complex number, also known as the phase, is the angle of\n the radius extending from the origin to the complex number plotted in the\n complex plane and the positive real axis.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n phi: number\n Argument.\n\n Examples\n --------\n > var phi = base.cphase( 5.0, 3.0 )\n ~0.5404\n\n See Also\n --------\n base.cabs\n",
"base.cpolar": "\nbase.cpolar( [out,] re, im )\n Returns the absolute value and phase of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Absolute value and phase, respectively.\n\n Examples\n --------\n > var out = base.cpolar( 5.0, 3.0 )\n [ ~5.83, ~0.5404 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cpolar( out, 5.0, 3.0 )\n <Float64Array>[ ~5.83, ~0.5404 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cabs, base.cphase\n",
"base.cround": "\nbase.cround( [out,] re, im )\n Rounds a complex number to the nearest integer.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Rounded components.\n\n Examples\n --------\n > var out = base.cround( 5.5, 3.3 )\n [ 6.0, 3.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cround( out, 5.5, 3.3 )\n <Float64Array>[ 6.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloor, base.croundn\n",
"base.croundn": "\nbase.croundn( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n`.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.croundn( 5.555, -3.336, -2 )\n [ 5.56, -3.34 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.croundn( out, 5.555, -3.336, -2 )\n <Float64Array>[ 5.56, -3.34 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloorn, base.cround\n",
"base.csignum": "\nbase.csignum( [out,] re, im )\n Evaluates the signum function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Function result.\n\n Examples\n --------\n > var out = base.csignum( -4.2, 5.5 )\n [ -0.6069136033622302, 0.79476781392673 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.csignum( out, -4.2, 5.5 )\n <Float64Array>[ -0.6069136033622302, 0.79476781392673 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.signum\n",
"base.csub": "\nbase.csub( [out,] re1, im1, re2, im2 )\n Subtracts two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Array containing the real and imaginary components of the result.\n\n Examples\n --------\n > var out = base.csub( 5.0, 3.0, -2.0, 1.0 )\n [ 7.0, 2.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.csub( out, 5.0, 3.0, -2.0, 1.0 )\n <Float64Array>[ 7.0, 2.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cdiv, base.cmul\n",
"base.dasum": "\nbase.dasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float64Array\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.dasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.dasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.dasum( N, x1, stride )\n 12.0\n\n\nbase.dasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float64Array\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.dasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > sum = base.dasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n\nbase.dasum.wasm( [options] )\n Returns a memory managed function to compute the sum of absolute values.\n\n For an externally defined `Float64Array`, data must be copied to the heap.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.memory: integer (optional)\n Total memory. If not provided a buffer, setting the memory option\n instructs the returned function to allocate an internal memory store of\n the specified size.\n\n options.stack: integer (optional)\n Total stack size. Must be less than the memory option and large enough\n for a program's needs. Default: `1024` bytes.\n\n options.buffer: ArrayBuffer (optional)\n `ArrayBuffer` serving as the underlying memory store. If not provided,\n each returned function will allocate and manage its own memory. If\n provided a memory option, the buffer `byteLength` must equal the\n specified total memory.\n\n Returns\n -------\n out: Function\n Memory managed function.\n\n Examples\n --------\n > var wasm = base.dasum.wasm();\n > var N = 5;\n\n // Allocate space on the heap:\n > var bytes = wasm.malloc( N * 8 );\n\n // Create a Float64Array view:\n > var view = new Float64Array( bytes.buffer, bytes.byteOffset, N );\n\n // Copy data to the heap:\n > view.set( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n\n // Compute the sum of absolute values (passing in the heap buffer):\n > var s = wasm( N, bytes, 1 )\n 15.0\n\n // Free the memory:\n > wasm.free( bytes );\n\n See Also\n --------\n base.daxpy, base.dcopy\n",
"base.daxpy": "\nbase.daxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.daxpy( x.length, alpha, x, 1, y, 1 )\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > base.daxpy( N, alpha, x, 2, y, -1 )\n <Float64Array>[ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.daxpy( N, 5.0, x1, -2, y1, 1 )\n <Float64Array>[ 40.0, 33.0, 22.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.daxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.daxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n <Float64Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.daxpy.wasm( [options] )\n Returns a memory managed function to multiply `x` by a constant `alpha` and\n add the result to `y`.\n\n For externally defined `Float64Arrays`, data must be copied to the heap.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.memory: integer (optional)\n Total memory. If not provided a buffer, setting the memory option\n instructs the returned function to allocate an internal memory store of\n the specified size.\n\n options.stack: integer (optional)\n Total stack size. Must be less than the memory option and large enough\n for a program's needs. Default: `1024` bytes.\n\n options.buffer: ArrayBuffer (optional)\n `ArrayBuffer` serving as the underlying memory store. If not provided,\n each returned function will allocate and manage its own memory. If\n provided a memory option, the buffer `byteLength` must equal the\n specified total memory.\n\n Returns\n -------\n out: Function\n Memory managed function.\n\n Examples\n --------\n > var wasm = base.daxpy.wasm();\n > var N = 5;\n\n // Allocate space on the heap:\n > var xbytes = wasm.malloc( N * 8 );\n > var ybytes = wasm.malloc( N * 8 );\n\n // Create Float64Array views:\n > var x = new Float64Array( xbytes.buffer, xbytes.byteOffset, N );\n > var y = new Float64Array( ybytes.buffer, ybytes.byteOffset, N );\n\n // Copy data to the heap:\n > x.set( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > y.set( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n\n // Multiply and add alpha:\n > var alpha = 5.0;\n > wasm( x.length, alpha, xbytes, 1, ybytes, 1 );\n > y\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Free the memory:\n > wasm.free( xbytes );\n > wasm.free( ybytes );\n\n See Also\n --------\n base.dasum, base.dcopy\n",
"base.dcopy": "\nbase.dcopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.dcopy( x.length, x, 1, y, 1 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.dcopy( N, x, -2, y, 1 )\n <Float64Array>[ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.dcopy( N, x1, -2, y1, 1 )\n <Float64Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.dcopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.dcopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dasum, base.daxpy\n",
"base.deg2rad": "\nbase.deg2rad( x )\n Converts an angle from degrees to radians.\n\n Parameters\n ----------\n x: number\n Angle in degrees.\n\n Returns\n -------\n r: number\n Angle in radians.\n\n Examples\n --------\n > var r = base.deg2rad( 90.0 )\n ~1.571\n > r = base.deg2rad( -45.0 )\n ~-0.785\n > r = base.deg2rad( NaN )\n NaN\n\n See Also\n --------\n base.rad2deg\n",
"base.digamma": "\nbase.digamma( x )\n Evaluates the digamma function.\n\n If `x` is `0` or a negative `integer`, the `function` returns `NaN`.\n\n If provided `NaN`, the `function` returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.digamma( -2.5 )\n ~1.103\n > y = base.digamma( 1.0 )\n ~-0.577\n > y = base.digamma( 10.0 )\n ~2.252\n > y = base.digamma( NaN )\n NaN\n > y = base.digamma( -1.0 )\n NaN\n\n See Also\n --------\n base.trigamma, base.gamma\n",
"base.diracDelta": "\nbase.diracDelta( x )\n Evaluates the Dirac delta function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.diracDelta( 3.14 )\n 0.0\n > y = base.diracDelta( 0.0 )\n Infinity\n\n See Also\n --------\n base.kroneckerDelta\n",
"base.dists.arcsine.Arcsine": "\nbase.dists.arcsine.Arcsine( [a, b] )\n Returns an arcsine distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be less than `b`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a`. Default: `1.0`.\n\n Returns\n -------\n arcsine: Object\n Distribution instance.\n\n arcsine.a: number\n Minimum support. If set, the value must be less than `b`.\n\n arcsine.b: number\n Maximum support. If set, the value must be greater than `a`.\n\n arcsine.entropy: number\n Read-only property which returns the differential entropy.\n\n arcsine.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n arcsine.mean: number\n Read-only property which returns the expected value.\n\n arcsine.median: number\n Read-only property which returns the median.\n\n arcsine.mode: number\n Read-only property which returns the mode.\n\n arcsine.skewness: number\n Read-only property which returns the skewness.\n\n arcsine.stdev: number\n Read-only property which returns the standard deviation.\n\n arcsine.variance: number\n Read-only property which returns the variance.\n\n arcsine.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n arcsine.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n arcsine.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n arcsine.pdf: Function\n Evaluates the probability density function (PDF).\n\n arcsine.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var arcsine = base.dists.arcsine.Arcsine( 0.0, 1.0 );\n > arcsine.a\n 0.0\n > arcsine.b\n 1.0\n > arcsine.entropy\n ~-0.242\n > arcsine.kurtosis\n -1.5\n > arcsine.mean\n 0.5\n > arcsine.median\n 0.5\n > arcsine.mode\n 0.0\n > arcsine.skewness\n 0.0\n > arcsine.stdev\n ~0.354\n > arcsine.variance\n 0.125\n > arcsine.cdf( 0.8 )\n ~0.705\n > arcsine.logcdf( 0.8 )\n ~-0.35\n > arcsine.logpdf( 0.4 )\n ~-0.431\n > arcsine.pdf( 0.8 )\n ~0.796\n > arcsine.quantile( 0.8 )\n ~0.905\n\n",
"base.dists.arcsine.cdf": "\nbase.dists.arcsine.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for an arcsine\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.cdf( 9.0, 0.0, 10.0 )\n ~0.795\n > y = base.dists.arcsine.cdf( 0.5, 0.0, 2.0 )\n ~0.333\n > y = base.dists.arcsine.cdf( PINF, 2.0, 4.0 )\n 1.0\n > y = base.dists.arcsine.cdf( NINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.cdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.arcsine.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an arcsine distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.arcsine.cdf.factory( 0.0, 10.0 );\n > var y = mycdf( 0.5 )\n ~0.144\n > y = mycdf( 8.0 )\n ~0.705\n\n",
"base.dists.arcsine.entropy": "\nbase.dists.arcsine.entropy( a, b )\n Returns the differential entropy of an arcsine distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.arcsine.entropy( 0.0, 1.0 )\n ~-0.242\n > v = base.dists.arcsine.entropy( 4.0, 12.0 )\n ~1.838\n > v = base.dists.arcsine.entropy( 2.0, 8.0 )\n ~1.55\n\n",
"base.dists.arcsine.kurtosis": "\nbase.dists.arcsine.kurtosis( a, b )\n Returns the excess kurtosis of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.arcsine.kurtosis( 0.0, 1.0 )\n -1.5\n > v = base.dists.arcsine.kurtosis( 4.0, 12.0 )\n -1.5\n > v = base.dists.arcsine.kurtosis( 2.0, 8.0 )\n -1.5\n\n",
"base.dists.arcsine.logcdf": "\nbase.dists.arcsine.logcdf( x, a, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for an\n arcsine distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.logcdf( 9.0, 0.0, 10.0 )\n ~-0.229\n > y = base.dists.arcsine.logcdf( 0.5, 0.0, 2.0 )\n ~-1.1\n > y = base.dists.arcsine.logcdf( PINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.logcdf( NINF, 2.0, 4.0 )\n -Infinity\n > y = base.dists.arcsine.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.logcdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.arcsine.logcdf.factory( a, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of an arcsine distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.arcsine.logcdf.factory( 0.0, 10.0 );\n > var y = mylogcdf( 0.5 )\n ~-1.941\n > y = mylogcdf( 8.0 )\n ~-0.35\n\n",
"base.dists.arcsine.logpdf": "\nbase.dists.arcsine.logpdf( x, a, b )\n Evaluates the logarithm of the probability density function (PDF) for an\n arcsine distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.logpdf( 2.0, 0.0, 4.0 )\n ~-1.838\n > y = base.dists.arcsine.logpdf( 5.0, 0.0, 4.0 )\n -Infinity\n > y = base.dists.arcsine.logpdf( 0.25, 0.0, 1.0 )\n ~-0.308\n > y = base.dists.arcsine.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.logpdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.logpdf.factory( a, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of an arcsine distribution with minimum support `a` and\n maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.arcsine.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 7.0 )\n Infinity\n > y = mylogPDF( 5.0 )\n -Infinity\n\n",
"base.dists.arcsine.mean": "\nbase.dists.arcsine.mean( a, b )\n Returns the expected value of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.arcsine.mean( 0.0, 1.0 )\n 0.5\n > v = base.dists.arcsine.mean( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.mean( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.arcsine.median": "\nbase.dists.arcsine.median( a, b )\n Returns the median of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.arcsine.median( 0.0, 1.0 )\n 0.5\n > v = base.dists.arcsine.median( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.median( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.arcsine.mode": "\nbase.dists.arcsine.mode( a, b )\n Returns the mode of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.arcsine.mode( 0.0, 1.0 )\n 0.0\n > v = base.dists.arcsine.mode( 4.0, 12.0 )\n 4.0\n > v = base.dists.arcsine.mode( 2.0, 8.0 )\n 2.0\n\n",
"base.dists.arcsine.pdf": "\nbase.dists.arcsine.pdf( x, a, b )\n Evaluates the probability density function (PDF) for an arcsine distribution\n with minimum support `a` and maximum support `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.pdf( 2.0, 0.0, 4.0 )\n ~0.159\n > y = base.dists.arcsine.pdf( 5.0, 0.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.pdf( 0.25, 0.0, 1.0 )\n ~0.735\n > y = base.dists.arcsine.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.pdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF) of\n an arcsine distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.arcsine.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n Infinity\n > y = myPDF( 5.0 )\n 0.0\n\n",
"base.dists.arcsine.quantile": "\nbase.dists.arcsine.quantile( p, a, b )\n Evaluates the quantile function for an arcsine distribution with minimum\n support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.arcsine.quantile( 0.8, 0.0, 1.0 )\n ~0.905\n > y = base.dists.arcsine.quantile( 0.5, 0.0, 10.0 )\n ~5.0\n\n > y = base.dists.arcsine.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.arcsine.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.arcsine.quantile( 0.5, 2.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of an arcsine\n distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.arcsine.quantile.factory( 0.0, 4.0 );\n > var y = myQuantile( 0.8 )\n ~3.618\n\n",
"base.dists.arcsine.skewness": "\nbase.dists.arcsine.skewness( a, b )\n Returns the skewness of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.arcsine.skewness( 0.0, 1.0 )\n 0.0\n > v = base.dists.arcsine.skewness( 4.0, 12.0 )\n 0.0\n > v = base.dists.arcsine.skewness( 2.0, 8.0 )\n 0.0\n\n",
"base.dists.arcsine.stdev": "\nbase.dists.arcsine.stdev( a, b )\n Returns the standard deviation of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.arcsine.stdev( 0.0, 1.0 )\n ~0.354\n > v = base.dists.arcsine.stdev( 4.0, 12.0 )\n ~2.828\n > v = base.dists.arcsine.stdev( 2.0, 8.0 )\n ~2.121\n\n",
"base.dists.arcsine.variance": "\nbase.dists.arcsine.variance( a, b )\n Returns the variance of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.arcsine.variance( 0.0, 1.0 )\n ~0.125\n > v = base.dists.arcsine.variance( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.variance( 2.0, 8.0 )\n ~4.5\n\n",
"base.dists.bernoulli.Bernoulli": "\nbase.dists.bernoulli.Bernoulli( [p] )\n Returns a Bernoulli distribution object.\n\n Parameters\n ----------\n p: number (optional)\n Success probability. Must be between `0` and `1`. Default: `0.5`.\n\n Returns\n -------\n bernoulli: Object\n Distribution instance.\n\n bernoulli.p: number\n Success probability. If set, the value must be between `0` and `1`.\n\n bernoulli.entropy: number\n Read-only property which returns the differential entropy.\n\n bernoulli.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n bernoulli.mean: number\n Read-only property which returns the expected value.\n\n bernoulli.median: number\n Read-only property which returns the median.\n\n bernoulli.skewness: number\n Read-only property which returns the skewness.\n\n bernoulli.stdev: number\n Read-only property which returns the standard deviation.\n\n bernoulli.variance: number\n Read-only property which returns the variance.\n\n bernoulli.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n bernoulli.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n bernoulli.pmf: Function\n Evaluates the probability mass function (PMF).\n\n bernoulli.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var bernoulli = base.dists.bernoulli.Bernoulli( 0.6 );\n > bernoulli.p\n 0.6\n > bernoulli.entropy\n ~0.673\n > bernoulli.kurtosis\n ~-1.833\n > bernoulli.mean\n 0.6\n > bernoulli.median\n 1.0\n > bernoulli.skewness\n ~-0.408\n > bernoulli.stdev\n ~0.49\n > bernoulli.variance\n ~0.24\n > bernoulli.cdf( 0.5 )\n 0.4\n > bernoulli.mgf( 3.0 )\n ~12.451\n > bernoulli.pmf( 0.0 )\n 0.4\n > bernoulli.quantile( 0.7 )\n 1.0\n\n",
"base.dists.bernoulli.cdf": "\nbase.dists.bernoulli.cdf( x, p )\n Evaluates the cumulative distribution function (CDF) for a Bernoulli\n distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.cdf( 0.5, 0.5 )\n 0.5\n > y = base.dists.bernoulli.cdf( 0.8, 0.1 )\n 0.9\n > y = base.dists.bernoulli.cdf( -1.0, 0.4 )\n 0.0\n > y = base.dists.bernoulli.cdf( 1.5, 0.4 )\n 1.0\n > y = base.dists.bernoulli.cdf( NaN, 0.5 )\n NaN\n > y = base.dists.bernoulli.cdf( 0.0, NaN )\n NaN\n // Invalid probability:\n > y = base.dists.bernoulli.cdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.bernoulli.cdf.factory( p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.bernoulli.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n 1.0\n > y = mycdf( 0.7 )\n 0.5\n\n",
"base.dists.bernoulli.entropy": "\nbase.dists.bernoulli.entropy( p )\n Returns the entropy of a Bernoulli distribution with success probability\n `p` (in nats).\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.bernoulli.entropy( 0.1 )\n ~0.325\n > v = base.dists.bernoulli.entropy( 0.5 )\n ~0.693\n\n",
"base.dists.bernoulli.kurtosis": "\nbase.dists.bernoulli.kurtosis( p )\n Returns the excess kurtosis of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.bernoulli.kurtosis( 0.1 )\n ~5.111\n > v = base.dists.bernoulli.kurtosis( 0.5 )\n -2.0\n\n",
"base.dists.bernoulli.mean": "\nbase.dists.bernoulli.mean( p )\n Returns the expected value of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.bernoulli.mean( 0.1 )\n 0.1\n > v = base.dists.bernoulli.mean( 0.5 )\n 0.5\n\n",
"base.dists.bernoulli.median": "\nbase.dists.bernoulli.median( p )\n Returns the median of a Bernoulli distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.bernoulli.median( 0.1 )\n 0\n > v = base.dists.bernoulli.median( 0.8 )\n 1\n\n",
"base.dists.bernoulli.mgf": "\nbase.dists.bernoulli.mgf( t, p )\n Evaluates the moment-generating function (MGF) for a Bernoulli\n distribution with success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.mgf( 0.2, 0.5 )\n ~1.111\n > y = base.dists.bernoulli.mgf( 0.4, 0.5 )\n ~1.246\n > y = base.dists.bernoulli.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.bernoulli.mgf( 0.0, NaN )\n NaN\n > y = base.dists.bernoulli.mgf( -2.0, -1.0 )\n NaN\n > y = base.dists.bernoulli.mgf( 0.2, 2.0 )\n NaN\n\n\nbase.dists.bernoulli.mgf.factory( p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.bernoulli.mgf.factory( 0.8 );\n > var y = mymgf( -0.2 )\n ~0.855\n\n",
"base.dists.bernoulli.mode": "\nbase.dists.bernoulli.mode( p )\n Returns the mode of a Bernoulli distribution with success probability `p`.\n\n For `p = 0.5`, the mode is either `0` or `1`. This implementation returns\n `0` for `p = 0.5`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.bernoulli.mode( 0.1 )\n 0\n > v = base.dists.bernoulli.mode( 0.8 )\n 1\n\n",
"base.dists.bernoulli.pmf": "\nbase.dists.bernoulli.pmf( x, p )\n Evaluates the probability mass function (PMF) for a Bernoulli distribution\n with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.pmf( 1.0, 0.3 )\n 0.3\n > y = base.dists.bernoulli.pmf( 0.0, 0.7 )\n 0.3\n > y = base.dists.bernoulli.pmf( -1.0, 0.5 )\n 0.0\n > y = base.dists.bernoulli.pmf( 0.0, NaN )\n NaN\n > y = base.dists.bernoulli.pmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.bernoulli.pmf( 0.0, 1.5 )\n NaN\n\n\nbase.dists.bernoulli.pmf.factory( p )\n Returns a function for evaluating the probability mass function (PMF) of a\n Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.bernoulli.pmf.factory( 0.5 );\n > var y = mypmf( 1.0 )\n 0.5\n > y = mypmf( 0.0 )\n 0.5\n\n",
"base.dists.bernoulli.quantile": "\nbase.dists.bernoulli.quantile( r, p )\n Evaluates the quantile function for a Bernoulli distribution with success\n probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.bernoulli.quantile( 0.8, 0.4 )\n 1\n > y = base.dists.bernoulli.quantile( 0.5, 0.4 )\n 0\n > y = base.dists.bernoulli.quantile( 0.9, 0.1 )\n 0\n\n > y = base.dists.bernoulli.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.bernoulli.quantile( NaN, 0.8 )\n NaN\n > y = base.dists.bernoulli.quantile( 0.4, NaN )\n NaN\n\n > y = base.dists.bernoulli.quantile( 0.5, -1.0 )\n NaN\n > y = base.dists.bernoulli.quantile( 0.5, 1.5 )\n NaN\n\n\nbase.dists.bernoulli.quantile.factory( p )\n Returns a function for evaluating the quantile function of a Bernoulli\n distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.bernoulli.quantile.factory( 0.4 );\n > var y = myquantile( 0.4 )\n 0\n > y = myquantile( 0.8 )\n 1\n > y = myquantile( 1.0 )\n 1\n\n",
"base.dists.bernoulli.skewness": "\nbase.dists.bernoulli.skewness( p )\n Returns the skewness of a Bernoulli distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.bernoulli.skewness( 0.1 )\n ~2.667\n > v = base.dists.bernoulli.skewness( 0.5 )\n 0.0\n\n",
"base.dists.bernoulli.stdev": "\nbase.dists.bernoulli.stdev( p )\n Returns the standard deviation of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.bernoulli.stdev( 0.1 )\n ~0.3\n > v = base.dists.bernoulli.stdev( 0.5 )\n 0.5\n\n",
"base.dists.bernoulli.variance": "\nbase.dists.bernoulli.variance( p )\n Returns the variance of a Bernoulli distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.bernoulli.variance( 0.1 )\n ~0.09\n > v = base.dists.bernoulli.variance( 0.5 )\n 0.25\n\n",
"base.dists.beta.Beta": "\nbase.dists.beta.Beta( [α, β] )\n Returns a beta distribution object.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n beta: Object\n Distribution instance.\n\n beta.alpha: number\n First shape parameter. If set, the value must be greater than `0`.\n\n beta.beta: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n beta.entropy: number\n Read-only property which returns the differential entropy.\n\n beta.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n beta.mean: number\n Read-only property which returns the expected value.\n\n beta.median: number\n Read-only property which returns the median.\n\n beta.mode: number\n Read-only property which returns the mode.\n\n beta.skewness: number\n Read-only property which returns the skewness.\n\n beta.stdev: number\n Read-only property which returns the standard deviation.\n\n beta.variance: number\n Read-only property which returns the variance.\n\n beta.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n beta.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n beta.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n beta.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n beta.pdf: Function\n Evaluates the probability density function (PDF).\n\n beta.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var beta = base.dists.beta.Beta( 1.0, 1.0 );\n > beta.alpha\n 1.0\n > beta.beta\n 1.0\n > beta.entropy\n 0.0\n > beta.kurtosis\n -1.2\n > beta.mean\n 0.5\n > beta.median\n 0.5\n > beta.mode\n NaN\n > beta.skewness\n 0.0\n > beta.stdev\n ~0.289\n > beta.variance\n ~0.0833\n > beta.cdf( 0.8 )\n 0.8\n > beta.logcdf( 0.8 )\n ~-0.223\n > beta.logpdf( 1.0 )\n 0.0\n > beta.mgf( 3.14 )\n ~7.0394\n > beta.pdf( 1.0 )\n 1.0\n > beta.quantile( 0.8 )\n 0.8\n\n",
"base.dists.beta.cdf": "\nbase.dists.beta.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a beta distribution\n with first shape parameter `α` and second shape parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.beta.cdf( 0.5, 1.0, 1.0 )\n 0.5\n > y = base.dists.beta.cdf( 0.5, 2.0, 4.0 )\n ~0.813\n > y = base.dists.beta.cdf( 0.2, 2.0, 2.0 )\n ~0.104\n > y = base.dists.beta.cdf( 0.8, 4.0, 4.0 )\n ~0.967\n > y = base.dists.beta.cdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.beta.cdf( 1.5, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.beta.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a beta distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.beta.cdf.factory( 0.5, 0.5 );\n > var y = mycdf( 0.8 )\n ~0.705\n > y = mycdf( 0.3 )\n ~0.369\n\n",
"base.dists.beta.entropy": "\nbase.dists.beta.entropy( α, β )\n Returns the differential entropy of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.beta.entropy( 1.0, 1.0 )\n 0.0\n > v = base.dists.beta.entropy( 4.0, 12.0 )\n ~-0.869\n > v = base.dists.beta.entropy( 8.0, 2.0 )\n ~-0.795\n\n > v = base.dists.beta.entropy( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.entropy( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.entropy( 2.0, NaN )\n NaN\n > v = base.dists.beta.entropy( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.kurtosis": "\nbase.dists.beta.kurtosis( α, β )\n Returns the excess kurtosis of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.beta.kurtosis( 1.0, 1.0 )\n -1.2\n > v = base.dists.beta.kurtosis( 4.0, 12.0 )\n ~0.082\n > v = base.dists.beta.kurtosis( 8.0, 2.0 )\n ~0.490\n\n > v = base.dists.beta.kurtosis( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.kurtosis( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.kurtosis( 2.0, NaN )\n NaN\n > v = base.dists.beta.kurtosis( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.logcdf": "\nbase.dists.beta.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a beta distribution with first shape parameter `α` and second\n shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.beta.logcdf( 0.5, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.beta.logcdf( 0.5, 2.0, 4.0 )\n ~-0.208\n > y = base.dists.beta.logcdf( 0.2, 2.0, 2.0 )\n ~-2.263\n > y = base.dists.beta.logcdf( 0.8, 4.0, 4.0 )\n ~-0.034\n > y = base.dists.beta.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.beta.logcdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.beta.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a beta distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.beta.logcdf.factory( 0.5, 0.5 );\n > var y = mylogcdf( 0.8 )\n ~-0.35\n > y = mylogcdf( 0.3 )\n ~-0.997\n\n",
"base.dists.beta.logpdf": "\nbase.dists.beta.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a beta distribution with first shape parameter `α` and second shape\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.beta.logpdf( 0.5, 1.0, 1.0 )\n 0.0\n > y = base.dists.beta.logpdf( 0.5, 2.0, 4.0 )\n ~0.223\n > y = base.dists.beta.logpdf( 0.2, 2.0, 2.0 )\n ~-0.041\n > y = base.dists.beta.logpdf( 0.8, 4.0, 4.0 )\n ~-0.556\n > y = base.dists.beta.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.beta.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.beta.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a beta distribution with first shape parameter `α`\n and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n fcn: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogpdf = base.dists.beta.logpdf.factory( 0.5, 0.5 );\n > var y = mylogpdf( 0.8 )\n ~-0.228\n > y = mylogpdf( 0.3 )\n ~-0.364\n\n",
"base.dists.beta.mean": "\nbase.dists.beta.mean( α, β )\n Returns the expected value of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.beta.mean( 1.0, 1.0 )\n 0.5\n > v = base.dists.beta.mean( 4.0, 12.0 )\n 0.25\n > v = base.dists.beta.mean( 8.0, 2.0 )\n 0.8\n\n",
"base.dists.beta.median": "\nbase.dists.beta.median( α, β )\n Returns the median of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.beta.median( 1.0, 1.0 )\n 0.5\n > v = base.dists.beta.median( 4.0, 12.0 )\n ~0.239\n > v = base.dists.beta.median( 8.0, 2.0 )\n ~0.820\n\n > v = base.dists.beta.median( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.median( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.median( 2.0, NaN )\n NaN\n > v = base.dists.beta.median( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.mgf": "\nbase.dists.beta.mgf( t, α, β )\n Evaluates the moment-generating function (MGF) for a beta distribution with\n first shape parameter `α` and second shape parameter `β` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.beta.mgf( 0.5, 1.0, 1.0 )\n ~1.297\n > y = base.dists.beta.mgf( 0.5, 2.0, 4.0 )\n ~1.186\n > y = base.dists.beta.mgf( 3.0, 2.0, 2.0 )\n ~5.575\n > y = base.dists.beta.mgf( -0.8, 4.0, 4.0 )\n ~0.676\n\n > y = base.dists.beta.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.beta.mgf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.mgf( 2.0, 0.0, 0.5 )\n NaN\n\n > y = base.dists.beta.mgf( 2.0, 0.5, -1.0 )\n NaN\n > y = base.dists.beta.mgf( 2.0, 0.5, 0.0 )\n NaN\n\n\nbase.dists.beta.mgf.factory( α, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n beta distribution with first shape parameter `α` and second shape parameter\n `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.beta.mgf.factory( 0.5, 0.5 );\n > var y = myMGF( 0.8 )\n ~1.552\n > y = myMGF( 0.3 )\n ~1.168\n\n",
"base.dists.beta.mode": "\nbase.dists.beta.mode( α, β )\n Returns the mode of a beta distribution.\n\n If `α <= 1` or `β <= 1`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.beta.mode( 4.0, 12.0 )\n ~0.214\n > v = base.dists.beta.mode( 8.0, 2.0 )\n ~0.875\n > v = base.dists.beta.mode( 1.0, 1.0 )\n NaN\n\n",
"base.dists.beta.pdf": "\nbase.dists.beta.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a beta distribution\n with first shape parameter `α` and second shape parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.beta.pdf( 0.5, 1.0, 1.0 )\n 1.0\n > y = base.dists.beta.pdf( 0.5, 2.0, 4.0 )\n 1.25\n > y = base.dists.beta.pdf( 0.2, 2.0, 2.0 )\n ~0.96\n > y = base.dists.beta.pdf( 0.8, 4.0, 4.0 )\n ~0.573\n > y = base.dists.beta.pdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.beta.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.beta.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a beta distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.beta.pdf.factory( 0.5, 0.5 );\n > var y = mypdf( 0.8 )\n ~0.796\n > y = mypdf( 0.3 )\n ~0.695\n\n",
"base.dists.beta.quantile": "\nbase.dists.beta.quantile( p, α, β )\n Evaluates the quantile function for a beta distribution with first shape\n parameter `α` and second shape parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value (probability).\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.beta.quantile( 0.8, 2.0, 1.0 )\n ~0.894\n > y = base.dists.beta.quantile( 0.5, 4.0, 2.0 )\n ~0.686\n > y = base.dists.beta.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.beta.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.beta.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.beta.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a beta\n distribution with first shape parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.beta.quantile.factory( 2.0, 2.0 );\n > y = myquantile( 0.8 )\n ~0.713\n > y = myquantile( 0.4 )\n ~0.433\n\n",
"base.dists.beta.skewness": "\nbase.dists.beta.skewness( α, β )\n Returns the skewness of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.beta.skewness( 1.0, 1.0 )\n 0.0\n > v = base.dists.beta.skewness( 4.0, 12.0 )\n ~0.529\n > v = base.dists.beta.skewness( 8.0, 2.0 )\n ~-0.829\n\n > v = base.dists.beta.skewness( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.skewness( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.skewness( 2.0, NaN )\n NaN\n > v = base.dists.beta.skewness( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.stdev": "\nbase.dists.beta.stdev( α, β )\n Returns the standard deviation of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.beta.stdev( 1.0, 1.0 )\n ~0.289\n > v = base.dists.beta.stdev( 4.0, 12.0 )\n ~0.105\n > v = base.dists.beta.stdev( 8.0, 2.0 )\n ~0.121\n\n > v = base.dists.beta.stdev( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.stdev( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.stdev( 2.0, NaN )\n NaN\n > v = base.dists.beta.stdev( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.variance": "\nbase.dists.beta.variance( α, β )\n Returns the variance of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.beta.variance( 1.0, 1.0 )\n ~0.083\n > v = base.dists.beta.variance( 4.0, 12.0 )\n ~0.011\n > v = base.dists.beta.variance( 8.0, 2.0 )\n ~0.015\n\n > v = base.dists.beta.variance( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.variance( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.variance( 2.0, NaN )\n NaN\n > v = base.dists.beta.variance( NaN, 2.0 )\n NaN\n\n",
"base.dists.betaprime.BetaPrime": "\nbase.dists.betaprime.BetaPrime( [α, β] )\n Returns a beta prime distribution object.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n betaprime: Object\n Distribution instance.\n\n betaprime.alpha: number\n First shape parameter. If set, the value must be greater than `0`.\n\n betaprime.beta: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n betaprime.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n betaprime.mean: number\n Read-only property which returns the expected value.\n\n betaprime.mode: number\n Read-only property which returns the mode.\n\n betaprime.skewness: number\n Read-only property which returns the skewness.\n\n betaprime.stdev: number\n Read-only property which returns the standard deviation.\n\n betaprime.variance: number\n Read-only property which returns the variance.\n\n betaprime.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n betaprime.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n betaprime.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n betaprime.pdf: Function\n Evaluates the probability density function (PDF).\n\n betaprime.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var betaprime = base.dists.betaprime.BetaPrime( 6.0, 5.0 );\n > betaprime.alpha\n 6.0\n > betaprime.beta\n 5.0\n > betaprime.kurtosis\n 44.4\n > betaprime.mean\n 1.5\n > betaprime.mode\n ~0.833\n > betaprime.skewness\n ~3.578\n > betaprime.stdev\n ~1.118\n > betaprime.variance\n 1.25\n > betaprime.cdf( 0.8 )\n ~0.25\n > betaprime.logcdf( 0.8 )\n ~-1.387\n > betaprime.logpdf( 1.0 )\n ~-0.486\n > betaprime.pdf( 1.0 )\n ~0.615\n > betaprime.quantile( 0.8 )\n ~2.06\n\n",
"base.dists.betaprime.cdf": "\nbase.dists.betaprime.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.cdf( 0.5, 1.0, 1.0 )\n ~0.333\n > y = base.dists.betaprime.cdf( 0.5, 2.0, 4.0 )\n ~0.539\n > y = base.dists.betaprime.cdf( 0.2, 2.0, 2.0 )\n ~0.074\n > y = base.dists.betaprime.cdf( 0.8, 4.0, 4.0 )\n ~0.38\n > y = base.dists.betaprime.cdf( -0.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.betaprime.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a beta prime distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.betaprime.cdf.factory( 0.5, 0.5 );\n > var y = mycdf( 0.8 )\n ~0.465\n > y = mycdf( 0.3 )\n ~0.319\n\n",
"base.dists.betaprime.kurtosis": "\nbase.dists.betaprime.kurtosis( α, β )\n Returns the excess kurtosis of a beta prime distribution.\n\n If `α <= 0` or `β <= 4`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var v = base.dists.betaprime.kurtosis( 2.0, 6.0 )\n ~26.143\n > v = base.dists.betaprime.kurtosis( 4.0, 12.0 )\n ~5.764\n > v = base.dists.betaprime.kurtosis( 8.0, 6.0 )\n ~19.962\n\n > v = base.dists.betaprime.kurtosis( 1.0, 2.8 )\n NaN\n > v = base.dists.betaprime.kurtosis( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.kurtosis( -0.1, 5.0 )\n NaN\n\n > v = base.dists.betaprime.kurtosis( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.kurtosis( NaN, 6.0 )\n NaN\n\n",
"base.dists.betaprime.logcdf": "\nbase.dists.betaprime.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a beta prime distribution with first shape parameter `α` and\n second shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.logcdf( 0.5, 1.0, 1.0 )\n ~-1.099\n > y = base.dists.betaprime.logcdf( 0.5, 2.0, 4.0 )\n ~-0.618\n > y = base.dists.betaprime.logcdf( 0.2, 2.0, 2.0 )\n ~-2.603\n > y = base.dists.betaprime.logcdf( 0.8, 4.0, 4.0 )\n ~-0.968\n > y = base.dists.betaprime.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.betaprime.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a beta prime distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.betaprime.logcdf.factory( 0.5, 0.5 );\n > var y = mylogcdf( 0.8 )\n ~-0.767\n > y = mylogcdf( 0.3 )\n ~-1.143\n\n",
"base.dists.betaprime.logpdf": "\nbase.dists.betaprime.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a beta prime distribution with first shape parameter `α` and second\n shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.logpdf( 0.5, 1.0, 1.0 )\n ~-0.811\n > y = base.dists.betaprime.logpdf( 0.5, 2.0, 4.0 )\n ~-0.13\n > y = base.dists.betaprime.logpdf( 0.2, 2.0, 2.0 )\n ~-0.547\n > y = base.dists.betaprime.logpdf( 0.8, 4.0, 4.0 )\n ~-0.43\n > y = base.dists.betaprime.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.betaprime.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a beta prime distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n fcn: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogpdf = base.dists.betaprime.logpdf.factory( 0.5, 0.5 );\n > var y = mylogpdf( 0.8 )\n ~-1.62\n > y = mylogpdf( 0.3 )\n ~-0.805\n\n",
"base.dists.betaprime.mean": "\nbase.dists.betaprime.mean( α, β )\n Returns the expected value of a beta prime distribution.\n\n If `α <= 0` or `β <= 1`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.betaprime.mean( 1.0, 2.0 )\n 1.0\n > v = base.dists.betaprime.mean( 4.0, 12.0 )\n ~0.364\n > v = base.dists.betaprime.mean( 8.0, 2.0 )\n 8.0\n\n",
"base.dists.betaprime.mode": "\nbase.dists.betaprime.mode( α, β )\n Returns the mode of a beta prime distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.betaprime.mode( 1.0, 2.0 )\n 0.0\n > v = base.dists.betaprime.mode( 4.0, 12.0 )\n ~0.231\n > v = base.dists.betaprime.mode( 8.0, 2.0 )\n ~2.333\n\n",
"base.dists.betaprime.pdf": "\nbase.dists.betaprime.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.pdf( 0.5, 1.0, 1.0 )\n ~0.444\n > y = base.dists.betaprime.pdf( 0.5, 2.0, 4.0 )\n ~0.878\n > y = base.dists.betaprime.pdf( 0.2, 2.0, 2.0 )\n ~0.579\n > y = base.dists.betaprime.pdf( 0.8, 4.0, 4.0 )\n ~0.65\n > y = base.dists.betaprime.pdf( -0.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.betaprime.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a beta prime distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.betaprime.pdf.factory( 0.5, 0.5 );\n > var y = mypdf( 0.8 )\n ~0.198\n > y = mypdf( 0.3 )\n ~0.447\n\n",
"base.dists.betaprime.quantile": "\nbase.dists.betaprime.quantile( p, α, β )\n Evaluates the quantile function for a beta prime distribution with first\n shape parameter `α` and second shape parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value (probability).\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.betaprime.quantile( 0.8, 2.0, 1.0 )\n ~8.472\n > y = base.dists.betaprime.quantile( 0.5, 4.0, 2.0 )\n ~2.187\n > y = base.dists.betaprime.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.betaprime.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.betaprime.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.betaprime.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.betaprime.quantile.factory( 2.0, 2.0 );\n > y = myQuantile( 0.8 )\n ~2.483\n > y = myQuantile( 0.4 )\n ~0.763\n\n",
"base.dists.betaprime.skewness": "\nbase.dists.betaprime.skewness( α, β )\n Returns the skewness of a beta prime distribution.\n\n If `α <= 0` or `β <= 3`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.betaprime.skewness( 2.0, 4.0 )\n ~6.261\n > v = base.dists.betaprime.skewness( 4.0, 12.0 )\n ~1.724\n > v = base.dists.betaprime.skewness( 8.0, 4.0 )\n ~5.729\n\n > v = base.dists.betaprime.skewness( 1.0, 2.8 )\n NaN\n > v = base.dists.betaprime.skewness( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.skewness( -0.1, 4.0 )\n NaN\n\n > v = base.dists.betaprime.skewness( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.skewness( NaN, 4.0 )\n NaN\n\n",
"base.dists.betaprime.stdev": "\nbase.dists.betaprime.stdev( α, β )\n Returns the standard deviation of a beta prime distribution.\n\n If `α <= 0` or `β <= 2`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.betaprime.stdev( 1.0, 2.5 )\n ~1.491\n > v = base.dists.betaprime.stdev( 4.0, 12.0 )\n ~0.223\n > v = base.dists.betaprime.stdev( 8.0, 2.5 )\n ~8.219\n\n > v = base.dists.betaprime.stdev( 8.0, 1.0 )\n NaN\n > v = base.dists.betaprime.stdev( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.stdev( -0.1, 3.0 )\n NaN\n\n > v = base.dists.betaprime.stdev( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.stdev( NaN, 3.0 )\n NaN\n\n",
"base.dists.betaprime.variance": "\nbase.dists.betaprime.variance( α, β )\n Returns the variance of a beta prime distribution.\n\n If `α <= 0` or `β <= 2`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.betaprime.variance( 1.0, 2.5 )\n ~2.222\n > v = base.dists.betaprime.variance( 4.0, 12.0 )\n ~0.05\n > v = base.dists.betaprime.variance( 8.0, 2.5 )\n ~67.556\n\n > v = base.dists.betaprime.variance( 8.0, 1.0 )\n NaN\n > v = base.dists.betaprime.variance( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.variance( -0.1, 3.0 )\n NaN\n\n > v = base.dists.betaprime.variance( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.variance( NaN, 3.0 )\n NaN\n\n",
"base.dists.binomial.Binomial": "\nbase.dists.binomial.Binomial( [n, p] )\n Returns a binomial distribution object.\n\n Parameters\n ----------\n n: integer (optional)\n Number of trials. Must be a positive integer. Default: `1`.\n\n p: number (optional)\n Success probability. Must be a number between `0` and `1`. Default:\n `0.5`.\n\n Returns\n -------\n binomial: Object\n Distribution instance.\n\n binomial.n: number\n Number of trials. If set, the value must be a positive integer.\n\n binomial.p: number\n Success probability. If set, the value must be a number between `0` and\n `1`.\n\n binomial.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n binomial.mean: number\n Read-only property which returns the expected value.\n\n binomial.median: number\n Read-only property which returns the median.\n\n binomial.mode: number\n Read-only property which returns the mode.\n\n binomial.skewness: number\n Read-only property which returns the skewness.\n\n binomial.stdev: number\n Read-only property which returns the standard deviation.\n\n binomial.variance: number\n Read-only property which returns the variance.\n\n binomial.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n binomial.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n binomial.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n binomial.pmf: Function\n Evaluates the probability mass function (PMF).\n\n binomial.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var binomial = base.dists.binomial.Binomial( 8, 0.5 );\n > binomial.n\n 8.0\n > binomial.p\n 0.5\n > binomial.kurtosis\n -0.25\n > binomial.mean\n 4.0\n > binomial.median\n 4.0\n > binomial.mode\n 4.0\n > binomial.skewness\n 0.0\n > binomial.stdev\n ~1.414\n > binomial.variance\n 2.0\n > binomial.cdf( 2.9 )\n ~0.145\n > binomial.logpmf( 3.0 )\n ~-1.52\n > binomial.mgf( 0.2 )\n ~2.316\n > binomial.pmf( 3.0 )\n ~0.219\n > binomial.quantile( 0.8 )\n 5.0\n\n",
"base.dists.binomial.cdf": "\nbase.dists.binomial.cdf( x, n, p )\n Evaluates the cumulative distribution function (CDF) for a binomial\n distribution with number of trials `n` and success probability `p` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.binomial.cdf( 3.0, 20, 0.2 )\n ~0.411\n > y = base.dists.binomial.cdf( 21.0, 20, 0.2 )\n 1.0\n > y = base.dists.binomial.cdf( 5.0, 10, 0.4 )\n ~0.834\n > y = base.dists.binomial.cdf( 0.0, 10, 0.4 )\n ~0.006\n > y = base.dists.binomial.cdf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.cdf.factory( n, p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a binomial distribution with number of trials `n` and success probability\n `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.binomial.cdf.factory( 10, 0.5 );\n > var y = mycdf( 3.0 )\n ~0.172\n > y = mycdf( 1.0 )\n ~0.011\n\n",
"base.dists.binomial.entropy": "\nbase.dists.binomial.entropy( n, p )\n Returns the entropy of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.binomial.entropy( 100, 0.1 )\n ~2.511\n > v = base.dists.binomial.entropy( 20, 0.5 )\n ~2.223\n > v = base.dists.binomial.entropy( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.entropy( 20, 1.1 )\n NaN\n > v = base.dists.binomial.entropy( 20, NaN )\n NaN\n\n",
"base.dists.binomial.kurtosis": "\nbase.dists.binomial.kurtosis( n, p )\n Returns the excess kurtosis of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.binomial.kurtosis( 100, 0.1 )\n ~0.051\n > v = base.dists.binomial.kurtosis( 20, 0.5 )\n ~-0.1\n > v = base.dists.binomial.kurtosis( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.kurtosis( 20, 1.1 )\n NaN\n > v = base.dists.binomial.kurtosis( 20, NaN )\n NaN\n\n",
"base.dists.binomial.logpmf": "\nbase.dists.binomial.logpmf( x, n, p )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n binomial distribution with number of trials `n` and success probability `p`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.binomial.logpmf( 3.0, 20, 0.2 )\n ~-1.583\n > y = base.dists.binomial.logpmf( 21.0, 20, 0.2 )\n -Infinity\n > y = base.dists.binomial.logpmf( 5.0, 10, 0.4 )\n ~-1.606\n > y = base.dists.binomial.logpmf( 0.0, 10, 0.4 )\n ~-5.108\n > y = base.dists.binomial.logpmf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.logpmf.factory( n, p )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a binomial distribution with number of trials `n` and\n success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.binomial.logpmf.factory( 10, 0.5 );\n > var y = mylogpmf( 3.0 )\n ~-2.144\n > y = mylogpmf( 5.0 )\n ~-1.402\n\n",
"base.dists.binomial.mean": "\nbase.dists.binomial.mean( n, p )\n Returns the expected value of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.binomial.mean( 100, 0.1 )\n 10.0\n > v = base.dists.binomial.mean( 20, 0.5 )\n 10.0\n > v = base.dists.binomial.mean( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.mean( 20, 1.1 )\n NaN\n > v = base.dists.binomial.mean( 20, NaN )\n NaN\n\n",
"base.dists.binomial.median": "\nbase.dists.binomial.median( n, p )\n Returns the median of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.binomial.median( 100, 0.1 )\n 10\n > v = base.dists.binomial.median( 20, 0.5 )\n 10\n > v = base.dists.binomial.median( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.median( 20, 1.1 )\n NaN\n > v = base.dists.binomial.median( 20, NaN )\n NaN\n\n",
"base.dists.binomial.mgf": "\nbase.dists.binomial.mgf( t, n, p )\n Evaluates the moment-generating function (MGF) for a binomial distribution\n with number of trials `n` and success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.binomial.mgf( 0.5, 20, 0.2 )\n ~11.471\n > y = base.dists.binomial.mgf( 5.0, 20, 0.2 )\n ~4.798e+29\n > y = base.dists.binomial.mgf( 0.9, 10, 0.4 )\n ~99.338\n > y = base.dists.binomial.mgf( 0.0, 10, 0.4 )\n 1.0\n\n > y = base.dists.binomial.mgf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 0.0, 20, NaN )\n NaN\n\n > y = base.dists.binomial.mgf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.mgf.factory( n, p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n binomial distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.binomial.mgf.factory( 10, 0.5 );\n > var y = myMGF( 0.3 )\n ~5.013\n\n",
"base.dists.binomial.mode": "\nbase.dists.binomial.mode( n, p )\n Returns the mode of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.binomial.mode( 100, 0.1 )\n 10\n > v = base.dists.binomial.mode( 20, 0.5 )\n 10\n > v = base.dists.binomial.mode( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.mode( 20, 1.1 )\n NaN\n > v = base.dists.binomial.mode( 20, NaN )\n NaN\n\n",
"base.dists.binomial.pmf": "\nbase.dists.binomial.pmf( x, n, p )\n Evaluates the probability mass function (PMF) for a binomial distribution\n with number of trials `n` and success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.binomial.pmf( 3.0, 20, 0.2 )\n ~0.205\n > y = base.dists.binomial.pmf( 21.0, 20, 0.2 )\n 0.0\n > y = base.dists.binomial.pmf( 5.0, 10, 0.4 )\n ~0.201\n > y = base.dists.binomial.pmf( 0.0, 10, 0.4 )\n ~0.006\n > y = base.dists.binomial.pmf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.pmf.factory( n, p )\n Returns a function for evaluating the probability mass function (PMF) of a\n binomial distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.binomial.pmf.factory( 10, 0.5 );\n > var y = mypmf( 3.0 )\n ~0.117\n > y = mypmf( 5.0 )\n ~0.246\n\n",
"base.dists.binomial.quantile": "\nbase.dists.binomial.quantile( r, n, p )\n Evaluates the quantile function for a binomial distribution with number of\n trials `n` and success probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.binomial.quantile( 0.4, 20, 0.2 )\n 3\n > y = base.dists.binomial.quantile( 0.8, 20, 0.2 )\n 5\n > y = base.dists.binomial.quantile( 0.5, 10, 0.4 )\n 4\n > y = base.dists.binomial.quantile( 0.0, 10, 0.4 )\n 0\n > y = base.dists.binomial.quantile( 1.0, 10, 0.4 )\n 10\n\n > y = base.dists.binomial.quantile( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.2, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.2, 20, NaN )\n NaN\n\n > y = base.dists.binomial.quantile( 0.5, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.5, -2.0, 0.5 )\n NaN\n\n > y = base.dists.binomial.quantile( 0.5, 20, -1.0 )\n NaN\n > y = base.dists.binomial.quantile( 0.5, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.quantile.factory( n, p )\n Returns a function for evaluating the quantile function of a binomial\n distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.binomial.quantile.factory( 10, 0.5 );\n > var y = myquantile( 0.1 )\n 3\n > y = myquantile( 0.9 )\n 7\n\n",
"base.dists.binomial.skewness": "\nbase.dists.binomial.skewness( n, p )\n Returns the skewness of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.binomial.skewness( 100, 0.1 )\n ~0.267\n > v = base.dists.binomial.skewness( 20, 0.5 )\n 0.0\n > v = base.dists.binomial.skewness( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.skewness( 20, 1.1 )\n NaN\n > v = base.dists.binomial.skewness( 20, NaN )\n NaN\n\n",
"base.dists.binomial.stdev": "\nbase.dists.binomial.stdev( n, p )\n Returns the standard deviation of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.binomial.stdev( 100, 0.1 )\n 3.0\n > v = base.dists.binomial.stdev( 20, 0.5 )\n ~2.236\n > v = base.dists.binomial.stdev( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.stdev( 20, 1.1 )\n NaN\n > v = base.dists.binomial.stdev( 20, NaN )\n NaN\n\n",
"base.dists.binomial.variance": "\nbase.dists.binomial.variance( n, p )\n Returns the variance of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.binomial.variance( 100, 0.1 )\n 9\n > v = base.dists.binomial.variance( 20, 0.5 )\n 5\n > v = base.dists.binomial.variance( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.variance( 20, 1.1 )\n NaN\n > v = base.dists.binomial.variance( 20, NaN )\n NaN\n\n",
"base.dists.cauchy.Cauchy": "\nbase.dists.cauchy.Cauchy( [x0, Ɣ] )\n Returns a Cauchy distribution object.\n\n Parameters\n ----------\n x0: number (optional)\n Location parameter. Default: `0.0`.\n\n Ɣ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n cauchy: Object\n Distribution instance.\n\n cauchy.x0: number\n Location parameter.\n\n cauchy.gamma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n cauchy.entropy: number\n Read-only property which returns the differential entropy.\n\n cauchy.median: number\n Read-only property which returns the median.\n\n cauchy.mode: number\n Read-only property which returns the mode.\n\n cauchy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n cauchy.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n cauchy.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n cauchy.pdf: Function\n Evaluates the probability density function (PDF).\n\n cauchy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var cauchy = base.dists.cauchy.Cauchy( 0.0, 1.0 );\n > cauchy.x0\n 0.0\n > cauchy.gamma\n 1.0\n > cauchy.entropy\n ~2.531\n > cauchy.median\n 0.0\n > cauchy.mode\n 0.0\n > cauchy.cdf( 0.8 )\n ~0.715\n > cauchy.logcdf( 1.0 )\n ~-0.288\n > cauchy.logpdf( 1.0 )\n ~-1.838\n > cauchy.pdf( 1.0 )\n ~0.159\n > cauchy.quantile( 0.8 )\n ~1.376\n\n",
"base.dists.cauchy.cdf": "\nbase.dists.cauchy.cdf( x, x0, Ɣ )\n Evaluates the cumulative distribution function (CDF) for a Cauchy\n distribution with location parameter `x0` and scale parameter `Ɣ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.cdf( 4.0, 0.0, 2.0 )\n ~0.852\n > y = base.dists.cauchy.cdf( 1.0, 0.0, 2.0 )\n ~0.648\n > y = base.dists.cauchy.cdf( 1.0, 3.0, 2.0 )\n 0.25\n > y = base.dists.cauchy.cdf( NaN, 0.0, 2.0 )\n NaN\n > y = base.dists.cauchy.cdf( 1.0, 2.0, NaN )\n NaN\n > y = base.dists.cauchy.cdf( 1.0, NaN, 3.0 )\n NaN\n\n\nbase.dists.cauchy.cdf.factory( x0, Ɣ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Cauchy distribution with location parameter `x0` and scale parameter\n `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.cauchy.cdf.factory( 1.5, 3.0 );\n > var y = myCDF( 1.0 )\n ~0.447\n\n",
"base.dists.cauchy.entropy": "\nbase.dists.cauchy.entropy( x0, Ɣ )\n Returns the differential entropy of a Cauchy distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.cauchy.entropy( 10.0, 7.0 )\n ~4.477\n > v = base.dists.cauchy.entropy( 22.0, 0.5 )\n ~1.838\n > v = base.dists.cauchy.entropy( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.logcdf": "\nbase.dists.cauchy.logcdf( x, x0, Ɣ )\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF) for a Cauchy distribution with location parameter `x0` and scale\n parameter `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the CDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.logcdf( 4.0, 0.0, 2.0 )\n ~-0.16\n > y = base.dists.cauchy.logcdf( 1.0, 0.0, 2.0 )\n ~-0.435\n > y = base.dists.cauchy.logcdf( 1.0, 3.0, 2.0 )\n ~-1.386\n > y = base.dists.cauchy.logcdf( NaN, 0.0, 2.0 )\n NaN\n > y = base.dists.cauchy.logcdf( 1.0, 2.0, NaN )\n NaN\n > y = base.dists.cauchy.logcdf( 1.0, NaN, 3.0 )\n NaN\n\n\nbase.dists.cauchy.logcdf.factory( x0, Ɣ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (logCDF) of a Cauchy distribution with location\n parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Function to evaluate the natural logarithm of CDF.\n\n Examples\n --------\n > var mylogCDF = base.dists.cauchy.logcdf.factory( 1.5, 3.0 );\n > var y = mylogCDF( 1.0 )\n ~-0.804\n\n",
"base.dists.cauchy.logpdf": "\nbase.dists.cauchy.logpdf( x, x0, Ɣ )\n Evaluates the natural logarithm of the probability density function (logPDF)\n for a Cauchy distribution with location parameter `x0` and scale parameter\n `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of PDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.logpdf( 2.0, 1.0, 1.0 )\n ~-1.838\n > y = base.dists.cauchy.logpdf( 4.0, 3.0, 0.1 )\n ~-3.457\n > y = base.dists.cauchy.logpdf( 4.0, 3.0, 3.0 )\n ~-2.349\n > y = base.dists.cauchy.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.cauchy.logpdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.logpdf( 2.0, 1.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.cauchy.logpdf( 2.0, 1.0, -2.0 )\n NaN\n\n\nbase.dists.cauchy.logpdf.factory( x0, Ɣ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (logPDF) of a Cauchy distribution with location parameter\n `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogPDF = base.dists.cauchy.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-1.838\n\n",
"base.dists.cauchy.median": "\nbase.dists.cauchy.median( x0, Ɣ )\n Returns the median of a Cauchy distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.cauchy.median( 10.0, 5.0 )\n 10.0\n > v = base.dists.cauchy.median( 7.0, 0.5 )\n 7.0\n > v = base.dists.cauchy.median( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.mode": "\nbase.dists.cauchy.mode( x0, Ɣ )\n Returns the mode of a Cauchy distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.cauchy.mode( 10.0, 5.0 )\n 10.0\n > v = base.dists.cauchy.mode( 7.0, 0.5 )\n 7.0\n > v = base.dists.cauchy.mode( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.pdf": "\nbase.dists.cauchy.pdf( x, x0, Ɣ )\n Evaluates the probability density function (PDF) for a Cauchy distribution\n with location parameter `x0` and scale parameter `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.pdf( 2.0, 1.0, 1.0 )\n ~0.159\n > y = base.dists.cauchy.pdf( 4.0, 3.0, 0.1 )\n ~0.0315\n > y = base.dists.cauchy.pdf( 4.0, 3.0, 3.0 )\n ~0.095\n > y = base.dists.cauchy.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.cauchy.pdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.pdf( 2.0, 1.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cauchy.pdf( 2.0, 1.0, -2.0 )\n NaN\n\n\nbase.dists.cauchy.pdf.factory( x0, Ɣ )\n Returns a function for evaluating the probability density function (PDF) of\n a Cauchy distribution with location parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.cauchy.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.159\n\n",
"base.dists.cauchy.quantile": "\nbase.dists.cauchy.quantile( p, x0, Ɣ )\n Evaluates the quantile function for a Cauchy distribution with location\n parameter `x0` and scale parameter `Ɣ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.cauchy.quantile( 0.3, 2.0, 2.0 )\n ~0.547\n > y = base.dists.cauchy.quantile( 0.8, 10, 2.0 )\n ~12.753\n > y = base.dists.cauchy.quantile( 0.1, 10.0, 2.0 )\n ~3.845\n\n > y = base.dists.cauchy.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.cauchy.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cauchy.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.cauchy.quantile.factory( x0, Ɣ )\n Returns a function for evaluating the quantile function of a Cauchy\n distribution with location parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.cauchy.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.chi.cdf": "\nbase.dists.chi.cdf( x, k )\n Evaluates the cumulative distribution function (CDF) for a chi distribution\n with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.chi.cdf( 2.0, 3.0 )\n ~0.739\n > y = base.dists.chi.cdf( 1.0, 0.5 )\n ~0.846\n > y = base.dists.chi.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.chi.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.chi.cdf( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.cdf( 2.0, 0.0 )\n 1.0\n > y = base.dists.chi.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.chi.cdf( 0.0, 0.0 )\n 0.0\n\nbase.dists.chi.cdf.factory( k )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.chi.cdf.factory( 1.0 );\n > var y = mycdf( 2.0 )\n ~0.954\n > y = mycdf( 1.2 )\n ~0.77\n\n",
"base.dists.chi.Chi": "\nbase.dists.chi.Chi( [k] )\n Returns a chi distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n chi: Object\n Distribution instance.\n\n chi.k: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n chi.entropy: number\n Read-only property which returns the differential entropy.\n\n chi.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n chi.mean: number\n Read-only property which returns the expected value.\n\n chi.mode: number\n Read-only property which returns the mode.\n\n chi.skewness: number\n Read-only property which returns the skewness.\n\n chi.stdev: number\n Read-only property which returns the standard deviation.\n\n chi.variance: number\n Read-only property which returns the variance.\n\n chi.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n chi.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n chi.pdf: Function\n Evaluates the probability density function (PDF).\n\n chi.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var chi = base.dists.chi.Chi( 6.0 );\n > chi.k\n 6.0\n > chi.entropy\n ~1.04\n > chi.kurtosis\n ~0.025\n > chi.mean\n ~2.35\n > chi.mode\n ~2.236\n > chi.skewness\n ~0.318\n > chi.stdev\n ~0.691\n > chi.variance\n ~0.478\n > chi.cdf( 1.0 )\n ~0.014\n > chi.logpdf( 1.5 )\n ~-1.177\n > chi.pdf( 1.5 )\n ~0.308\n > chi.quantile( 0.5 )\n ~2.313\n\n",
"base.dists.chi.entropy": "\nbase.dists.chi.entropy( k )\n Returns the differential entropy of a chi distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.chi.entropy( 11.0 )\n ~1.056\n > v = base.dists.chi.entropy( 1.5 )\n ~0.878\n\n",
"base.dists.chi.kurtosis": "\nbase.dists.chi.kurtosis( k )\n Returns the excess kurtosis of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.chi.kurtosis( 9.0 )\n ~0.011\n > v = base.dists.chi.kurtosis( 1.5 )\n ~0.424\n\n",
"base.dists.chi.logpdf": "\nbase.dists.chi.logpdf( x, k )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a chi distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.chi.logpdf( 0.3, 4.0 )\n ~-4.35\n > y = base.dists.chi.logpdf( 0.7, 0.7 )\n ~-0.622\n > y = base.dists.chi.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.chi.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.chi.logpdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.logpdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.chi.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chi.logpdf.factory( k )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.chi.logpdf.factory( 6.0 );\n > var y = mylogPDF( 3.0 )\n ~-1.086\n\n",
"base.dists.chi.mean": "\nbase.dists.chi.mean( k )\n Returns the expected value of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.chi.mean( 11.0 )\n ~3.242\n > v = base.dists.chi.mean( 4.5 )\n ~2.008\n\n",
"base.dists.chi.mode": "\nbase.dists.chi.mode( k )\n Returns the mode of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 1`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.chi.mode( 11.0 )\n ~3.162\n > v = base.dists.chi.mode( 1.5 )\n ~0.707\n\n",
"base.dists.chi.pdf": "\nbase.dists.chi.pdf( x, k )\n Evaluates the probability density function (PDF) for a chi distribution with\n degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.chi.pdf( 0.3, 4.0 )\n ~0.013\n > y = base.dists.chi.pdf( 0.7, 0.7 )\n ~0.537\n > y = base.dists.chi.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.chi.pdf( 0.0, NaN )\n NaN\n > y = base.dists.chi.pdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.chi.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chi.pdf.factory( k )\n Returns a function for evaluating the probability density function (PDF) of\n a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.chi.pdf.factory( 6.0 );\n > var y = myPDF( 3.0 )\n ~0.337\n\n",
"base.dists.chi.quantile": "\nbase.dists.chi.quantile( p, k )\n Evaluates the quantile function for a chi distribution with degrees of\n freedom `k` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.chi.quantile( 0.8, 1.0 )\n ~1.282\n > y = base.dists.chi.quantile( 0.5, 4.0 )\n ~1.832\n > y = base.dists.chi.quantile( 0.8, 0.1 )\n ~0.116\n > y = base.dists.chi.quantile( -0.2, 0.5 )\n NaN\n > y = base.dists.chi.quantile( 1.1, 0.5 )\n NaN\n > y = base.dists.chi.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.chi.quantile( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.quantile( 0.5, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.quantile( 0.3, 0.0 )\n 0.0\n > y = base.dists.chi.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.chi.quantile.factory( k )\n Returns a function for evaluating the quantile function of a chi\n distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.chi.quantile.factory( 2.0 );\n > var y = myquantile( 0.3 )\n ~0.845\n > y = myquantile( 0.7 )\n ~1.552\n\n",
"base.dists.chi.skewness": "\nbase.dists.chi.skewness( k )\n Returns the skewness of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.chi.skewness( 11.0 )\n ~0.225\n > v = base.dists.chi.skewness( 1.5 )\n ~0.763\n\n",
"base.dists.chi.stdev": "\nbase.dists.chi.stdev( k )\n Returns the standard deviation of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.chi.stdev( 11.0 )\n ~0.699\n > v = base.dists.chi.stdev( 1.5 )\n ~0.637\n\n",
"base.dists.chi.variance": "\nbase.dists.chi.variance( k )\n Returns the variance of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.chi.variance( 11.0 )\n ~0.488\n > v = base.dists.chi.variance( 1.5 )\n ~0.406\n\n",
"base.dists.chisquare.cdf": "\nbase.dists.chisquare.cdf( x, k )\n Evaluates the cumulative distribution function (CDF) for a chi-squared\n distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.cdf( 2.0, 3.0 )\n ~0.428\n > y = base.dists.chisquare.cdf( 1.0, 0.5 )\n ~0.846\n > y = base.dists.chisquare.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.chisquare.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.chisquare.cdf( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.cdf( 2.0, 0.0 )\n 1.0\n > y = base.dists.chisquare.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.chisquare.cdf( 0.0, 0.0 )\n 0.0\n\nbase.dists.chisquare.cdf.factory( k )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a chi-squared distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.chisquare.cdf.factory( 1.0 );\n > var y = mycdf( 2.0 )\n ~0.843\n > y = mycdf( 1.2 )\n ~0.727\n\n",
"base.dists.chisquare.ChiSquare": "\nbase.dists.chisquare.ChiSquare( [k] )\n Returns a chi-squared distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n chisquare: Object\n Distribution instance.\n\n chisquare.k: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n chisquare.entropy: number\n Read-only property which returns the differential entropy.\n\n chisquare.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n chisquare.mean: number\n Read-only property which returns the expected value.\n\n chisquare.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n chisquare.mode: number\n Read-only property which returns the mode.\n\n chisquare.skewness: number\n Read-only property which returns the skewness.\n\n chisquare.stdev: number\n Read-only property which returns the standard deviation.\n\n chisquare.variance: number\n Read-only property which returns the variance.\n\n chisquare.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n chisquare.pdf: Function\n Evaluates the probability density function (PDF).\n\n chisquare.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var chisquare = base.dists.chisquare.ChiSquare( 6.0 );\n > chisquare.k\n 6.0\n > chisquare.entropy\n ~2.541\n > chisquare.kurtosis\n 2.0\n > chisquare.mean\n 6.0\n > chisquare.mode\n 4.0\n > chisquare.skewness\n ~1.155\n > chisquare.stdev\n ~3.464\n > chisquare.variance\n 12.0\n > chisquare.cdf( 3.0 )\n ~0.191\n > chisquare.mgf( 0.2 )\n ~4.63\n > chisquare.pdf( 1.5 )\n ~0.066\n > chisquare.quantile( 0.5 )\n ~5.348\n\n",
"base.dists.chisquare.entropy": "\nbase.dists.chisquare.entropy( k )\n Returns the differential entropy of a chi-squared distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.chisquare.entropy( 11.0 )\n ~2.901\n > v = base.dists.chisquare.entropy( 1.5 )\n ~1.375\n\n",
"base.dists.chisquare.kurtosis": "\nbase.dists.chisquare.kurtosis( k )\n Returns the excess kurtosis of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.chisquare.kurtosis( 9.0 )\n ~1.333\n > v = base.dists.chisquare.kurtosis( 1.5 )\n 8.0\n\n",
"base.dists.chisquare.logpdf": "\nbase.dists.chisquare.logpdf( x, k )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a chi-squared distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.logpdf( 0.3, 4.0 )\n ~-2.74\n > y = base.dists.chisquare.logpdf( 0.7, 0.7 )\n ~-1.295\n > y = base.dists.chisquare.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.chisquare.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.chisquare.logpdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.logpdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.chisquare.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chisquare.logpdf.factory( k )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a chi-squared distribution with degrees of freedom\n `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.chisquare.logpdf.factory( 6.0 );\n > var y = myLogPDF( 3.0 )\n ~-2.075\n\n",
"base.dists.chisquare.mean": "\nbase.dists.chisquare.mean( k )\n Returns the expected value of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.chisquare.mean( 11.0 )\n 11.0\n > v = base.dists.chisquare.mean( 4.5 )\n 4.5\n\n",
"base.dists.chisquare.mode": "\nbase.dists.chisquare.mode( k )\n Returns the mode of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.chisquare.mode( 11.0 )\n 9.0\n > v = base.dists.chisquare.mode( 1.5 )\n 0.0\n\n",
"base.dists.chisquare.pdf": "\nbase.dists.chisquare.pdf( x, k )\n Evaluates the probability density function (PDF) for a chi-squared\n distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.pdf( 0.3, 4.0 )\n ~0.065\n > y = base.dists.chisquare.pdf( 0.7, 0.7 )\n ~0.274\n > y = base.dists.chisquare.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.chisquare.pdf( 0.0, NaN )\n NaN\n > y = base.dists.chisquare.pdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.chisquare.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chisquare.pdf.factory( k )\n Returns a function for evaluating the probability density function (PDF) of\n a chi-squared distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.chisquare.pdf.factory( 6.0 );\n > var y = myPDF( 3.0 )\n ~0.126\n\n",
"base.dists.chisquare.quantile": "\nbase.dists.chisquare.quantile( p, k )\n Evaluates the quantile function for a chi-squared distribution with degrees\n of freedom `k` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.chisquare.quantile( 0.8, 1.0 )\n ~1.642\n > y = base.dists.chisquare.quantile( 0.5, 4.0 )\n ~3.357\n > y = base.dists.chisquare.quantile( 0.8, 0.1 )\n ~0.014\n > y = base.dists.chisquare.quantile( -0.2, 0.5 )\n NaN\n > y = base.dists.chisquare.quantile( 1.1, 0.5 )\n NaN\n > y = base.dists.chisquare.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.chisquare.quantile( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.quantile( 0.5, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.quantile( 0.3, 0.0 )\n 0.0\n > y = base.dists.chisquare.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.chisquare.quantile.factory( k )\n Returns a function for evaluating the quantile function of a chi-squared\n distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.chisquare.quantile.factory( 2.0 );\n > var y = myquantile( 0.3 )\n ~0.713\n > y = myquantile( 0.7 )\n ~2.408\n\n",
"base.dists.chisquare.skewness": "\nbase.dists.chisquare.skewness( k )\n Returns the skewness of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.chisquare.skewness( 11.0 )\n ~0.853\n > v = base.dists.chisquare.skewness( 1.5 )\n ~2.309\n\n",
"base.dists.chisquare.stdev": "\nbase.dists.chisquare.stdev( k )\n Returns the standard deviation of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.chisquare.stdev( 11.0 )\n ~4.69\n > v = base.dists.chisquare.stdev( 1.5 )\n ~1.732\n\n",
"base.dists.chisquare.variance": "\nbase.dists.chisquare.variance( k )\n Returns the variance of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.chisquare.variance( 11.0 )\n 22.0\n > v = base.dists.chisquare.variance( 1.5 )\n 3.0\n\n",
"base.dists.cosine.cdf": "\nbase.dists.cosine.cdf( x, μ, s )\n Evaluates the cumulative distribution function (CDF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.cosine.cdf( 2.0, 0.0, 3.0 )\n ~0.971\n > y = base.dists.cosine.cdf( 9.0, 10.0, 3.0 )\n ~0.196\n\n > y = base.dists.cosine.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.cosine.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.cosine.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.cosine.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.cosine.cdf.factory( μ, s )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a raised cosine distribution with location parameter `μ` and scale\n parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.cosine.cdf.factory( 3.0, 1.5 );\n > var y = mycdf( 1.9 )\n ~0.015\n\n",
"base.dists.cosine.Cosine": "\nbase.dists.cosine.Cosine( [μ, s] )\n Returns a raised cosine distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n cosine: Object\n Distribution instance.\n\n cosine.mu: number\n Location parameter.\n\n cosine.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n cosine.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n cosine.mean: number\n Read-only property which returns the expected value.\n\n cosine.median: number\n Read-only property which returns the median.\n\n cosine.mode: number\n Read-only property which returns the mode.\n\n cosine.skewness: number\n Read-only property which returns the skewness.\n\n cosine.stdev: number\n Read-only property which returns the standard deviation.\n\n cosine.variance: number\n Read-only property which returns the variance.\n\n cosine.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n cosine.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n cosine.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n cosine.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n cosine.pdf: Function\n Evaluates the probability density function (PDF).\n\n cosine.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var cosine = base.dists.cosine.Cosine( -2.0, 3.0 );\n > cosine.mu\n -2.0\n > cosine.s\n 3.0\n > cosine.kurtosis\n ~-0.594\n > cosine.mean\n -2.0\n > cosine.median\n -2.0\n > cosine.mode\n -2.0\n > cosine.skewness\n 0.0\n > cosine.stdev\n ~1.085\n > cosine.variance\n ~1.176\n > cosine.cdf( 0.5 )\n ~0.996\n > cosine.logcdf( 0.5 )\n ~-0.004\n > cosine.logpdf( -1.0 )\n ~-1.386\n > cosine.mgf( 0.2 )\n ~0.686\n > cosine.pdf( -2.0 )\n ~0.333\n > cosine.quantile( 0.9 )\n ~-0.553\n\n",
"base.dists.cosine.kurtosis": "\nbase.dists.cosine.kurtosis( μ, s )\n Returns the excess kurtosis of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.cosine.kurtosis( 0.0, 1.0 )\n ~-0.594\n > y = base.dists.cosine.kurtosis( 4.0, 2.0 )\n ~-0.594\n > y = base.dists.cosine.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.cosine.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.logcdf": "\nbase.dists.cosine.logcdf( x, μ, s )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a raised cosine distribution with location parameter `μ` and scale\n parameter `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.cosine.logcdf( 2.0, 0.0, 3.0 )\n ~-0.029\n > y = base.dists.cosine.logcdf( 9.0, 10.0, 3.0 )\n ~-1.632\n\n > y = base.dists.cosine.logcdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.cosine.logcdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.logcdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.cosine.logcdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.cosine.logcdf( 8.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.logcdf( 10.0, 8.0, 0.0 )\n 0.0\n\n\nbase.dists.cosine.logcdf.factory( μ, s )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.cosine.logcdf.factory( 3.0, 1.5 );\n > var y = mylogcdf( 1.9 )\n ~-4.2\n\n",
"base.dists.cosine.logpdf": "\nbase.dists.cosine.logpdf( x, μ, s )\n Evaluates the logarithm of the probability density function (PDF) for a\n raised cosine distribution with location parameter `μ` and scale parameter\n `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.cosine.logpdf( 2.0, 0.0, 3.0 )\n ~-2.485\n > y = base.dists.cosine.logpdf( -1.0, 2.0, 4.0 )\n ~-3.307\n > y = base.dists.cosine.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cosine.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution at `s = 0.0`:\n > y = base.dists.cosine.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.cosine.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.cosine.logpdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a raised cosine distribution with location parameter `μ`\n and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.cosine.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-0.693\n\n",
"base.dists.cosine.mean": "\nbase.dists.cosine.mean( μ, s )\n Returns the expected value of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.cosine.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.mean( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mean( 0.0, NaN )\n NaN\n > y = base.dists.cosine.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.median": "\nbase.dists.cosine.median( μ, s )\n Returns the median of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.cosine.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.median( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.median( 0.0, NaN )\n NaN\n > y = base.dists.cosine.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.mgf": "\nbase.dists.cosine.mgf( t, μ, s )\n Evaluates the moment-generating function (MGF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.cosine.mgf( 2.0, 0.0, 3.0 )\n ~7.234\n > y = base.dists.cosine.mgf( 9.0, 10.0, 3.0 )\n ~1.606e+47\n\n > y = base.dists.cosine.mgf( 0.5, 0.0, NaN )\n NaN\n > y = base.dists.cosine.mgf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mgf( NaN, 0.0, 1.0 )\n NaN\n\n\nbase.dists.cosine.mgf.factory( μ, s )\n Returns a function for evaluating the moment-generating function (MGF) of a\n raised cosine distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.cosine.mgf.factory( 3.0, 1.5 );\n > var y = mymgf( 1.9 )\n ~495.57\n\n",
"base.dists.cosine.mode": "\nbase.dists.cosine.mode( μ, s )\n Returns the mode of a raised cosine distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.cosine.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.mode( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mode( 0.0, NaN )\n NaN\n > y = base.dists.cosine.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.pdf": "\nbase.dists.cosine.pdf( x, μ, s )\n Evaluates the probability density function (PDF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.cosine.pdf( 2.0, 0.0, 3.0 )\n ~0.083\n > y = base.dists.cosine.pdf( 2.4, 4.0, 2.0 )\n ~0.048\n > y = base.dists.cosine.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.cosine.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.cosine.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.pdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.cosine.pdf.factory( μ, s )\n Returns a function for evaluating the probability density function (PDF) of\n a raised cosine distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.cosine.pdf.factory( 0.0, 3.0 );\n > var y = myPDF( 2.0 )\n ~0.083\n\n",
"base.dists.cosine.quantile": "\nbase.dists.cosine.quantile( p, μ, s )\n Evaluates the quantile function for a raised cosine distribution with\n location parameter `μ` and scale parameter `s` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.cosine.quantile( 0.8, 0.0, 1.0 )\n ~0.327\n > y = base.dists.cosine.quantile( 0.5, 4.0, 2.0 )\n ~4.0\n\n > y = base.dists.cosine.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.cosine.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cosine.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.cosine.quantile.factory( μ, s )\n Returns a function for evaluating the quantile function of a raised cosine\n distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.cosine.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.3 )\n ~9.586\n\n",
"base.dists.cosine.skewness": "\nbase.dists.cosine.skewness( μ, s )\n Returns the skewness of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.cosine.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.cosine.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.skewness( 0.0, NaN )\n NaN\n > y = base.dists.cosine.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.stdev": "\nbase.dists.cosine.stdev( μ, s )\n Returns the standard deviation of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.cosine.stdev( 0.0, 1.0 )\n ~0.362\n > y = base.dists.cosine.stdev( 4.0, 2.0 )\n ~0.723\n > y = base.dists.cosine.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.stdev( 0.0, NaN )\n NaN\n > y = base.dists.cosine.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.variance": "\nbase.dists.cosine.variance( μ, s )\n Returns the variance of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.cosine.variance( 0.0, 1.0 )\n ~0.131\n > y = base.dists.cosine.variance( 4.0, 2.0 )\n ~0.523\n > y = base.dists.cosine.variance( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.variance( 0.0, NaN )\n NaN\n > y = base.dists.cosine.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.degenerate.cdf": "\nbase.dists.degenerate.cdf( x, μ )\n Evaluates the cumulative distribution function (CDF) for a degenerate\n distribution with mean value `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.cdf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.cdf( 4.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.cdf( 3.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.cdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.cdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.cdf.factory( μ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a degenerate distribution centered at a provided mean value.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.degenerate.cdf.factory( 5.0 );\n > var y = myCDF( 3.0 )\n 0.0\n > y = myCDF( 6.0 )\n 1.0\n\n",
"base.dists.degenerate.Degenerate": "\nbase.dists.degenerate.Degenerate( [μ] )\n Returns a degenerate distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Constant value of distribution.\n\n Returns\n -------\n degenerate: Object\n Distribution instance.\n\n degenerate.mu: number\n Constant value of distribution.\n\n degenerate.entropy: number\n Read-only property which returns the differential entropy.\n\n degenerate.mean: number\n Read-only property which returns the expected value.\n\n degenerate.median: number\n Read-only property which returns the median.\n\n degenerate.stdev: number\n Read-only property which returns the standard deviation.\n\n degenerate.variance: number\n Read-only property which returns the variance.\n\n degenerate.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n degenerate.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n degenerate.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n degenerate.logpmf: Function\n Evaluates the natural logarithm of the probability mass function\n (PMF).\n\n degenerate.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n degenerate.pmf: Function\n Evaluates the probability mass function (PMF).\n\n degenerate.pdf: Function\n Evaluates the probability density function (PDF).\n\n degenerate.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var degenerate = base.dists.degenerate.Degenerate( 2.0 );\n > degenerate.mu\n 2.0\n > degenerate.entropy\n 0.0\n > degenerate.mean\n 2.0\n > degenerate.mode\n 2.0\n > degenerate.median\n 2.0\n > degenerate.stdev\n 0.0\n > degenerate.variance\n 0.0\n > degenerate.cdf( 0.5 )\n 0.0\n > degenerate.logcdf( 2.5 )\n 0.0\n > degenerate.logpdf( 0.5 )\n -Infinity\n > degenerate.logpmf( 2.5 )\n -Infinity\n > degenerate.mgf( 0.2 )\n ~1.492\n > degenerate.pdf( 2.0 )\n +Infinity\n > degenerate.pmf( 2.0 )\n 1.0\n > degenerate.quantile( 0.7 )\n 2.0\n\n",
"base.dists.degenerate.entropy": "\nbase.dists.degenerate.entropy( μ )\n Returns the entropy of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.degenerate.entropy( 20.0 )\n 0.0\n > v = base.dists.degenerate.entropy( -10.0 )\n 0.0\n\n",
"base.dists.degenerate.logcdf": "\nbase.dists.degenerate.logcdf( x, μ )\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF) for a degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Natural logarithm of the CDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logcdf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logcdf( 4.0, 3.0 )\n 0\n > y = base.dists.degenerate.logcdf( 3.0, 3.0 )\n 0\n > y = base.dists.degenerate.logcdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logcdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logcdf.factory( μ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (logCDF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logcdf: Function\n Function to evaluate the natural logarithm of cumulative distribution\n function (logCDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.degenerate.logcdf.factory( 5.0 );\n > var y = mylogcdf( 3.0 )\n -Infinity\n > y = mylogcdf( 6.0 )\n 0\n\n",
"base.dists.degenerate.logpdf": "\nbase.dists.degenerate.logpdf( x, μ )\n Evaluates the natural logarithm of the probability density function (logPDF)\n for a degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logpdf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logpdf( 3.0, 3.0 )\n Infinity\n > y = base.dists.degenerate.logpdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logpdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logpdf.factory( μ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (logPDF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logpdf: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogPDF = base.dists.degenerate.logpdf.factory( 10.0 );\n > var y = mylogPDF( 10.0 )\n Infinity\n\n",
"base.dists.degenerate.logpmf": "\nbase.dists.degenerate.logpmf( x, μ )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logpmf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logpmf( 3.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.logpmf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logpmf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logpmf.factory( μ )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.degenerate.logpmf.factory( 10.0 );\n > var y = mylogPMF( 10.0 )\n 0.0\n\n",
"base.dists.degenerate.mean": "\nbase.dists.degenerate.mean( μ )\n Returns the expected value of a degenerate distribution with constant value\n `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.degenerate.mean( 20.0 )\n 20.0\n > v = base.dists.degenerate.mean( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.median": "\nbase.dists.degenerate.median( μ )\n Returns the median of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.degenerate.median( 20.0 )\n 20.0\n > v = base.dists.degenerate.median( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.mgf": "\nbase.dists.degenerate.mgf( x, μ )\n Evaluates the moment-generating function (MGF) for a degenerate distribution\n with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.degenerate.mgf( 1.0, 1.0 )\n ~2.718\n > y = base.dists.degenerate.mgf( 2.0, 3.0 )\n ~403.429\n > y = base.dists.degenerate.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.mgf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.mgf.factory( μ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.degenerate.mgf.factory( 10.0 );\n > var y = myMGF( 0.1 )\n ~2.718\n\n",
"base.dists.degenerate.mode": "\nbase.dists.degenerate.mode( μ )\n Returns the mode of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.degenerate.mode( 20.0 )\n 20.0\n > v = base.dists.degenerate.mode( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.pdf": "\nbase.dists.degenerate.pdf( x, μ )\n Evaluates the probability density function (PDF) for a degenerate\n distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.pdf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.pdf( 3.0, 3.0 )\n Infinity\n > y = base.dists.degenerate.pdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.pdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.pdf.factory( μ )\n Returns a function for evaluating the probability density function (PDF) of\n a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.degenerate.pdf.factory( 10.0 );\n > var y = myPDF( 10.0 )\n Infinity\n\n",
"base.dists.degenerate.pmf": "\nbase.dists.degenerate.pmf( x, μ )\n Evaluates the probability mass function (PMF) for a degenerate distribution\n with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.degenerate.pmf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.pmf( 3.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.pmf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.pmf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.pmf.factory( μ )\n Returns a function for evaluating the probability mass function (PMF) of a\n degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.degenerate.pmf.factory( 10.0 );\n > var y = myPMF( 10.0 )\n 1.0\n\n",
"base.dists.degenerate.quantile": "\nbase.dists.degenerate.quantile( p, μ )\n Evaluates the quantile function for a degenerate distribution with mean `μ`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.degenerate.quantile( 0.5, 2.0 )\n 2.0\n > y = base.dists.degenerate.quantile( 0.9, 4.0 )\n 4.0\n > y = base.dists.degenerate.quantile( 1.1, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( -0.2, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.quantile.factory( μ )\n Returns a function for evaluating the quantile function of a degenerate\n distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.degenerate.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.degenerate.stdev": "\nbase.dists.degenerate.stdev( μ )\n Returns the standard deviation of a degenerate distribution with constant\n value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.degenerate.stdev( 20.0 )\n 0.0\n > v = base.dists.degenerate.stdev( -10.0 )\n 0.0\n\n",
"base.dists.degenerate.variance": "\nbase.dists.degenerate.variance( μ )\n Returns the variance of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.degenerate.variance( 20.0 )\n 0.0\n > v = base.dists.degenerate.variance( -10.0 )\n 0.0\n\n",
"base.dists.discreteUniform.cdf": "\nbase.dists.discreteUniform.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.cdf( 9.0, 0, 10 )\n ~0.909\n > y = base.dists.discreteUniform.cdf( 0.5, 0, 2 )\n ~0.333\n > y = base.dists.discreteUniform.cdf( PINF, 2, 4 )\n 1.0\n > y = base.dists.discreteUniform.cdf( NINF, 2, 4 )\n 0.0\n > y = base.dists.discreteUniform.cdf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.cdf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.cdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.cdf( 2.0, 1, 0 )\n NaN\n\n\nbase.dists.discreteUniform.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a discrete uniform distribution with minimum support `a` and maximum\n support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.discreteUniform.cdf.factory( 0, 10 );\n > var y = mycdf( 0.5 )\n ~0.091\n > y = mycdf( 8.0 )\n ~0.818\n\n",
"base.dists.discreteUniform.DiscreteUniform": "\nbase.dists.discreteUniform.DiscreteUniform( [a, b] )\n Returns a discrete uniform distribution object.\n\n Parameters\n ----------\n a: integer (optional)\n Minimum support. Must be an integer smaller than `b`. Default: `0`.\n\n b: integer (optional)\n Maximum support. Must be an integer greater than `a`. Default: `1`.\n\n Returns\n -------\n discreteUniform: Object\n Distribution instance.\n\n discreteUniform.a: integer\n Minimum support. If set, the value must be an integer smaller than or\n equal to `b`.\n\n discreteUniform.b: integer\n Maximum support. If set, the value must be an integer greater than or\n equal to `a`.\n\n discreteUniform.entropy: number\n Read-only property which returns the entropy.\n\n discreteUniform.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n discreteUniform.mean: number\n Read-only property which returns the expected value.\n\n discreteUniform.median: number\n Read-only property which returns the median.\n\n discreteUniform.skewness: number\n Read-only property which returns the skewness.\n\n discreteUniform.stdev: number\n Read-only property which returns the standard deviation.\n\n discreteUniform.variance: number\n Read-only property which returns the variance.\n\n discreteUniform.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n discreteUniform.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n discreteUniform.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n discreteUniform.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n discreteUniform.pmf: Function\n Evaluates the probability mass function (PMF).\n\n discreteUniform.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var discreteUniform = base.dists.discreteUniform.DiscreteUniform( -2, 2 );\n > discreteUniform.a\n -2\n > discreteUniform.b\n 2\n > discreteUniform.entropy\n ~1.609\n > discreteUniform.kurtosis\n -1.3\n > discreteUniform.mean\n 0.0\n > discreteUniform.median\n 0.0\n > discreteUniform.skewness\n 0.0\n > discreteUniform.stdev\n ~1.414\n > discreteUniform.variance\n 2.0\n > discreteUniform.cdf( 0.8 )\n 0.6\n > discreteUniform.logcdf( 0.5 )\n ~-0.511\n > discreteUniform.logpmf( 1.0 )\n ~-1.609\n > discreteUniform.mgf( 0.8 )\n ~1.766\n > discreteUniform.pmf( 0.0 )\n 0.2\n > discreteUniform.quantile( 0.8 )\n 2.0\n\n",
"base.dists.discreteUniform.kurtosis": "\nbase.dists.discreteUniform.kurtosis( a, b )\n Returns the excess kurtosis of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.kurtosis( 0, 1 )\n -2.0\n > v = base.dists.discreteUniform.kurtosis( 4, 12 )\n ~-1.23\n > v = base.dists.discreteUniform.kurtosis( -4, 8 )\n ~-1.214\n\n",
"base.dists.discreteUniform.logcdf": "\nbase.dists.discreteUniform.logcdf( x, a, b )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a discrete uniform distribution with minimum support `a` and\n maximum support `b` at a value `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.logcdf( 9.0, 0, 10 )\n ~-0.095\n > y = base.dists.discreteUniform.logcdf( 0.5, 0, 2 )\n ~-1.099\n > y = base.dists.discreteUniform.logcdf( PINF, 2, 4 )\n 0.0\n > y = base.dists.discreteUniform.logcdf( NINF, 2, 4 )\n -Infinity\n > y = base.dists.discreteUniform.logcdf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.logcdf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.logcdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.logcdf( 2.0, 1, 0 )\n NaN\n\n\nbase.dists.discreteUniform.logcdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a discrete uniform distribution with minimum\n support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var myLogCDF = base.dists.discreteUniform.logcdf.factory( 0, 10 );\n > var y = myLogCDF( 0.5 )\n ~-2.398\n > y = myLogCDF( 8.0 )\n ~-0.201\n\n",
"base.dists.discreteUniform.logpmf": "\nbase.dists.discreteUniform.logpmf( x, a, b )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n discrete uniform distribution with minimum support `a` and maximum support\n `b` at a value `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.logpmf( 2.0, 0, 4 )\n ~-1.609\n > y = base.dists.discreteUniform.logpmf( 5.0, 0, 4 )\n -Infinity\n > y = base.dists.discreteUniform.logpmf( 3.0, -4, 4 )\n ~-2.197\n > y = base.dists.discreteUniform.logpmf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.logpmf( 2.0, 3, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 2.0, 1, 2.4 )\n NaN\n\n\nbase.dists.discreteUniform.logpmf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a discrete uniform distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var myLogPMF = base.dists.discreteUniform.logpmf.factory( 6, 7 );\n > var y = myLogPMF( 7.0 )\n ~-0.693\n > y = myLogPMF( 5.0 )\n -Infinity\n\n",
"base.dists.discreteUniform.mean": "\nbase.dists.discreteUniform.mean( a, b )\n Returns the expected value of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.mean( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.mean( 4, 12 )\n 8.0\n > v = base.dists.discreteUniform.mean( 2, 8 )\n 5.0\n\n",
"base.dists.discreteUniform.median": "\nbase.dists.discreteUniform.median( a, b )\n Returns the median of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.median( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.median( 4, 12 )\n 8.0\n > v = base.dists.discreteUniform.median( 2, 8 )\n 5.0\n\n",
"base.dists.discreteUniform.mgf": "\nbase.dists.discreteUniform.mgf( t, a, b )\n Evaluates the moment-generating function (MGF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `t`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.mgf( 2.0, 0, 4 )\n ~689.475\n > y = base.dists.discreteUniform.mgf( -0.2, 0, 4 )\n ~0.697\n > y = base.dists.discreteUniform.mgf( 2.0, 0, 1 )\n ~4.195\n > y = base.dists.discreteUniform.mgf( 0.5, 3, 2 )\n NaN\n > y = base.dists.discreteUniform.mgf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.mgf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.mgf( 0.0, 0, NaN )\n NaN\n\n\nbase.dists.discreteUniform.mgf.factory( a, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a discrete uniform distribution with minimum support `a` and maximum\n support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.discreteUniform.mgf.factory( 6, 7 );\n > var y = mymgf( 0.1 )\n ~1.918\n > y = mymgf( 1.1 )\n ~1471.722\n\n",
"base.dists.discreteUniform.pmf": "\nbase.dists.discreteUniform.pmf( x, a, b )\n Evaluates the probability mass function (PMF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.pmf( 2.0, 0, 4 )\n ~0.2\n > y = base.dists.discreteUniform.pmf( 5.0, 0, 4 )\n 0.0\n > y = base.dists.discreteUniform.pmf( 3.0, -4, 4 )\n ~0.111\n > y = base.dists.discreteUniform.pmf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.pmf( 2.0, 3, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 2.0, 1, 2.4 )\n NaN\n\n\nbase.dists.discreteUniform.pmf.factory( a, b )\n Returns a function for evaluating the probability mass function (PMF) of\n a discrete uniform distribution with minimum support `a` and maximum support\n `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.discreteUniform.pmf.factory( 6, 7 );\n > var y = myPMF( 7.0 )\n 0.5\n > y = myPMF( 5.0 )\n 0.0\n\n",
"base.dists.discreteUniform.quantile": "\nbase.dists.discreteUniform.quantile( p, a, b )\n Evaluates the quantile function for a discrete uniform distribution with\n minimum support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n If provided `a > b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.quantile( 0.8, 0, 1 )\n 1\n > y = base.dists.discreteUniform.quantile( 0.5, 0.0, 10.0 )\n 5\n\n > y = base.dists.discreteUniform.quantile( 1.1, 0, 4 )\n NaN\n > y = base.dists.discreteUniform.quantile( -0.2, 0, 4 )\n NaN\n\n > y = base.dists.discreteUniform.quantile( NaN, -2, 2 )\n NaN\n > y = base.dists.discreteUniform.quantile( 0.1, NaN, 2 )\n NaN\n > y = base.dists.discreteUniform.quantile( 0.1, -2, NaN )\n NaN\n\n > y = base.dists.discreteUniform.quantile( 0.5, 2, 1 )\n NaN\n\n\nbase.dists.discreteUniform.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a discrete\n uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.discreteUniform.quantile.factory( 0, 4 );\n > var y = myQuantile( 0.8 )\n 4\n\n",
"base.dists.discreteUniform.skewness": "\nbase.dists.discreteUniform.skewness( a, b )\n Returns the skewness of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.skewness( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.skewness( 4, 12 )\n 0.0\n > v = base.dists.discreteUniform.skewness( 2, 8 )\n 0.0\n\n",
"base.dists.discreteUniform.stdev": "\nbase.dists.discreteUniform.stdev( a, b )\n Returns the standard deviation of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.stdev( 0, 1 )\n ~0.5\n > v = base.dists.discreteUniform.stdev( 4, 12 )\n ~2.582\n > v = base.dists.discreteUniform.stdev( 2, 8 )\n 2.0\n\n",
"base.dists.discreteUniform.variance": "\nbase.dists.discreteUniform.variance( a, b )\n Returns the variance of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.variance( 0, 1 )\n ~0.25\n > v = base.dists.discreteUniform.variance( 4, 12 )\n ~6.667\n > v = base.dists.discreteUniform.variance( 2, 8 )\n 4.0\n\n",
"base.dists.erlang.cdf": "\nbase.dists.erlang.cdf( x, k, λ )\n Evaluates the cumulative distribution function (CDF) for an Erlang\n distribution with shape parameter `k` and rate parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.erlang.cdf( 2.0, 1, 1.0 )\n ~0.865\n > y = base.dists.erlang.cdf( 2.0, 3, 1.0 )\n ~0.323\n > y = base.dists.erlang.cdf( 2.0, 2.5, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( -1.0, 2, 2.0 )\n 0.0\n > y = base.dists.erlang.cdf( PINF, 4, 2.0 )\n 1.0\n > y = base.dists.erlang.cdf( NINF, 4, 2.0 )\n 0.0\n > y = base.dists.erlang.cdf( NaN, 0, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.erlang.cdf( 2.0, -1, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.cdf.factory( k, λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.erlang.cdf.factory( 2, 0.5 );\n > var y = mycdf( 6.0 )\n ~0.801\n > y = mycdf( 2.0 )\n ~0.264\n\n",
"base.dists.erlang.entropy": "\nbase.dists.erlang.entropy( k, λ )\n Returns the differential entropy of an Erlang distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.erlang.entropy( 1, 1.0 )\n ~1.0\n > v = base.dists.erlang.entropy( 4, 12.0 )\n ~-0.462\n > v = base.dists.erlang.entropy( 8, 2.0 )\n ~1.723\n\n",
"base.dists.erlang.Erlang": "\nbase.dists.erlang.Erlang( [k, λ] )\n Returns an Erlang distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Shape parameter. Must be a positive integer. Default: `1.0`.\n\n λ: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n erlang: Object\n Distribution instance.\n\n erlang.k: number\n Shape parameter. If set, the value must be a positive integer.\n\n erlang.lambda: number\n Rate parameter. If set, the value must be greater than `0`.\n\n erlang.entropy: number\n Read-only property which returns the differential entropy.\n\n erlang.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n erlang.mean: number\n Read-only property which returns the expected value.\n\n erlang.mode: number\n Read-only property which returns the mode.\n\n erlang.skewness: number\n Read-only property which returns the skewness.\n\n erlang.stdev: number\n Read-only property which returns the standard deviation.\n\n erlang.variance: number\n Read-only property which returns the variance.\n\n erlang.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n erlang.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n erlang.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n erlang.pdf: Function\n Evaluates the probability density function (PDF).\n\n erlang.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var erlang = base.dists.erlang.Erlang( 6, 5.0 );\n > erlang.k\n 6\n > erlang.lambda\n 5.0\n > erlang.entropy\n ~0.647\n > erlang.kurtosis\n 1.0\n > erlang.mean\n 1.2\n > erlang.mode\n 1.0\n > erlang.skewness\n ~0.816\n > erlang.stdev\n ~0.49\n > erlang.variance\n 0.24\n > erlang.cdf( 3.0 )\n ~0.997\n > erlang.logpdf( 3.0 )\n ~-4.638\n > erlang.mgf( -0.5 )\n ~0.564\n > erlang.pdf( 3.0 )\n ~0.01\n > erlang.quantile( 0.8 )\n ~1.581\n\n",
"base.dists.erlang.kurtosis": "\nbase.dists.erlang.kurtosis( k, λ )\n Returns the excess kurtosis of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.erlang.kurtosis( 1, 1.0 )\n 6.0\n > v = base.dists.erlang.kurtosis( 4, 12.0 )\n 1.5\n > v = base.dists.erlang.kurtosis( 8, 2.0 )\n 0.75\n\n",
"base.dists.erlang.logpdf": "\nbase.dists.erlang.logpdf( x, k, λ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an Erlang distribution with shape parameter `k` and rate parameter `λ`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.erlang.logpdf( 0.1, 1, 1.0 )\n ~-0.1\n > y = base.dists.erlang.logpdf( 0.5, 2, 2.5 )\n ~-0.111\n > y = base.dists.erlang.logpdf( -1.0, 4, 2.0 )\n -Infinity\n > y = base.dists.erlang.logpdf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.logpdf( 0.0, 1, NaN )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, -2, 0.5 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 0.5, 0.5 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.erlang.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n > y = base.dists.erlang.logpdf( 2.0, 1, 0.0 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.logpdf.factory( k, λ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of an Erlang distribution with shape parameter `k`\n and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.erlang.logpdf.factory( 6.0, 7.0 );\n > y = myLogPDF( 7.0 )\n ~-32.382\n\n\n",
"base.dists.erlang.mean": "\nbase.dists.erlang.mean( k, λ )\n Returns the expected value of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.erlang.mean( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.mean( 4, 12.0 )\n ~0.333\n > v = base.dists.erlang.mean( 8, 2.0 )\n 4.0\n\n",
"base.dists.erlang.mgf": "\nbase.dists.erlang.mgf( t, k, λ )\n Evaluates the moment-generating function (MGF) for an Erlang distribution\n with shape parameter `k` and rate parameter `λ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.erlang.mgf( 0.3, 1, 1.0 )\n ~1.429\n > y = base.dists.erlang.mgf( 2.0, 2, 3.0 )\n ~9.0\n > y = base.dists.erlang.mgf( -1.0, 2, 2.0 )\n ~0.444\n\n > y = base.dists.erlang.mgf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.0, 1, NaN )\n NaN\n\n > y = base.dists.erlang.mgf( 0.2, -2, 0.5 )\n NaN\n > y = base.dists.erlang.mgf( 0.2, 0.5, 0.5 )\n NaN\n\n > y = base.dists.erlang.mgf( 0.2, 1, 0.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.2, 1, -5.0 )\n NaN\n\n\nbase.dists.erlang.mgf.factory( k, λ )\n Returns a function for evaluating the moment-generating function (MGF) of an\n Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.erlang.mgf.factory( 2, 0.5 );\n > var y = myMGF( 0.2 )\n ~2.778\n > y = myMGF( -0.5 )\n 0.25\n\n",
"base.dists.erlang.mode": "\nbase.dists.erlang.mode( k, λ )\n Returns the mode of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.erlang.mode( 1, 1.0 )\n 0.0\n > v = base.dists.erlang.mode( 4, 12.0 )\n 0.25\n > v = base.dists.erlang.mode( 8, 2.0 )\n 3.5\n\n",
"base.dists.erlang.pdf": "\nbase.dists.erlang.pdf( x, k, λ )\n Evaluates the probability density function (PDF) for an Erlang distribution\n with shape parameter `k` and rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.erlang.pdf( 0.1, 1, 1.0 )\n ~0.905\n > y = base.dists.erlang.pdf( 0.5, 2, 2.5 )\n ~0.895\n > y = base.dists.erlang.pdf( -1.0, 4, 2.0 )\n 0.0\n > y = base.dists.erlang.pdf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.pdf( 0.0, 1, NaN )\n NaN\n > y = base.dists.erlang.pdf( 2.0, -2, 0.5 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 0.5, 0.5 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.erlang.pdf( 0.0, 0.0, 2.0 )\n Infinity\n > y = base.dists.erlang.pdf( 2.0, 1, 0.0 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.pdf.factory( k, λ )\n Returns a function for evaluating the probability density function (PDF)\n of an Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.erlang.pdf.factory( 6.0, 7.0 );\n > y = myPDF( 7.0 )\n ~8.639e-15\n\n\n",
"base.dists.erlang.quantile": "\nbase.dists.erlang.quantile( p, k, λ )\n Evaluates the quantile function for an Erlang distribution with shape\n parameter `k` and rate parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive number for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.erlang.quantile( 0.8, 2, 1.0 )\n ~2.994\n > y = base.dists.erlang.quantile( 0.5, 4, 2.0 )\n ~1.836\n\n > y = base.dists.erlang.quantile( 1.1, 1, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( -0.2, 1, 1.0 )\n NaN\n\n > y = base.dists.erlang.quantile( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( 0.0, 1, NaN )\n NaN\n\n // Non-integer shape parameter:\n > y = base.dists.erlang.quantile( 0.5, 0.5, 1.0 )\n NaN\n // Non-positive shape parameter:\n > y = base.dists.erlang.quantile( 0.5, -1, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.erlang.quantile( 0.5, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.quantile.factory( k, λ )\n Returns a function for evaluating the quantile function of an Erlang\n distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.erlang.quantile.factory( 10, 2.0 );\n > var y = myQuantile( 0.4 )\n ~4.452\n\n",
"base.dists.erlang.skewness": "\nbase.dists.erlang.skewness( k, λ )\n Returns the skewness of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.erlang.skewness( 1, 1.0 )\n 2.0\n > v = base.dists.erlang.skewness( 4, 12.0 )\n 1.0\n > v = base.dists.erlang.skewness( 8, 2.0 )\n ~0.707\n\n",
"base.dists.erlang.stdev": "\nbase.dists.erlang.stdev( k, λ )\n Returns the standard deviation of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.erlang.stdev( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.stdev( 4, 12.0 )\n ~0.167\n > v = base.dists.erlang.stdev( 8, 2.0 )\n ~1.414\n\n",
"base.dists.erlang.variance": "\nbase.dists.erlang.variance( k, λ )\n Returns the variance of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.erlang.variance( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.variance( 4, 12.0 )\n ~0.028\n > v = base.dists.erlang.variance( 8, 2.0 )\n 2.0\n\n",
"base.dists.exponential.cdf": "\nbase.dists.exponential.cdf( x, λ )\n Evaluates the cumulative distribution function (CDF) for an exponential\n distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.exponential.cdf( 2.0, 0.1 )\n ~0.181\n > y = base.dists.exponential.cdf( 1.0, 2.0 )\n ~0.865\n > y = base.dists.exponential.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.exponential.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.cdf( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.cdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.cdf.factory( λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n for an exponential distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.exponential.cdf.factory( 0.5 );\n > var y = myCDF( 3.0 )\n ~0.777\n\n",
"base.dists.exponential.entropy": "\nbase.dists.exponential.entropy( λ )\n Returns the differential entropy of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.exponential.entropy( 11.0 )\n ~-1.398\n > v = base.dists.exponential.entropy( 4.5 )\n ~-0.504\n\n",
"base.dists.exponential.Exponential": "\nbase.dists.exponential.Exponential( [λ] )\n Returns an exponential distribution object.\n\n Parameters\n ----------\n λ: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n exponential: Object\n Distribution instance.\n\n exponential.lambda: number\n Rate parameter. If set, the value must be greater than `0`.\n\n exponential.entropy: number\n Read-only property which returns the differential entropy.\n\n exponential.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n exponential.mean: number\n Read-only property which returns the expected value.\n\n exponential.median: number\n Read-only property which returns the median.\n\n exponential.mode: number\n Read-only property which returns the mode.\n\n exponential.skewness: number\n Read-only property which returns the skewness.\n\n exponential.stdev: number\n Read-only property which returns the standard deviation.\n\n exponential.variance: number\n Read-only property which returns the variance.\n\n exponential.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n exponential.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n exponential.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n exponential.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n exponential.pdf: Function\n Evaluates the probability density function (PDF).\n\n exponential.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var exponential = base.dists.exponential.Exponential( 6.0 );\n > exponential.lambda\n 6.0\n > exponential.entropy\n ~-0.792\n > exponential.kurtosis\n 6.0\n > exponential.mean\n ~0.167\n > exponential.median\n ~0.116\n > exponential.mode\n 0.0\n > exponential.skewness\n 2.0\n > exponential.stdev\n ~0.167\n > exponential.variance\n ~0.028\n > exponential.cdf( 1.0 )\n ~0.998\n > exponential.logcdf( 1.0 )\n ~-0.002\n > exponential.logpdf( 1.5 )\n ~-7.208\n > exponential.mgf( -0.5 )\n ~0.923\n > exponential.pdf( 1.5 )\n ~0.001\n > exponential.quantile( 0.5 )\n ~0.116\n\n",
"base.dists.exponential.kurtosis": "\nbase.dists.exponential.kurtosis( λ )\n Returns the excess kurtosis of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.exponential.kurtosis( 11.0 )\n 6.0\n > v = base.dists.exponential.kurtosis( 4.5 )\n 6.0\n\n",
"base.dists.exponential.logcdf": "\nbase.dists.exponential.logcdf( x, λ )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for an exponential distribution with rate parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.exponential.logcdf( 2.0, 0.1 )\n ~-1.708\n > y = base.dists.exponential.logcdf( 1.0, 2.0 )\n ~-0.145\n > y = base.dists.exponential.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.exponential.logcdf( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.logcdf( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.logcdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.logcdf.factory( λ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) for an exponential distribution with rate\n parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogCDF = base.dists.exponential.logcdf.factory( 0.5 );\n > var y = mylogCDF( 3.0 )\n ~-0.252\n\n",
"base.dists.exponential.logpdf": "\nbase.dists.exponential.logpdf( x, λ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an exponential distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.exponential.logpdf( 0.3, 4.0 )\n ~0.186\n > y = base.dists.exponential.logpdf( 2.0, 0.7 )\n ~-1.757\n > y = base.dists.exponential.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.exponential.logpdf( 0, NaN )\n NaN\n > y = base.dists.exponential.logpdf( NaN, 2.0 )\n NaN\n\n // Negative rate:\n > y = base.dists.exponential.logpdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.logpdf.factory( λ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) for an exponential distribution with rate parameter\n `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.exponential.logpdf.factory( 0.5 );\n > var y = mylogpdf( 3.0 )\n ~-2.193\n\n",
"base.dists.exponential.mean": "\nbase.dists.exponential.mean( λ )\n Returns the expected value of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.exponential.mean( 11.0 )\n ~0.091\n > v = base.dists.exponential.mean( 4.5 )\n ~0.222\n\n",
"base.dists.exponential.median": "\nbase.dists.exponential.median( λ )\n Returns the median of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.exponential.median( 11.0 )\n ~0.063\n > v = base.dists.exponential.median( 4.5 )\n ~0.154\n\n",
"base.dists.exponential.mode": "\nbase.dists.exponential.mode( λ )\n Returns the mode of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.exponential.mode( 11.0 )\n 0.0\n > v = base.dists.exponential.mode( 4.5 )\n 0.0\n\n",
"base.dists.exponential.pdf": "\nbase.dists.exponential.pdf( x, λ )\n Evaluates the probability density function (PDF) for an exponential\n distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.exponential.pdf( 0.3, 4.0 )\n ~1.205\n > y = base.dists.exponential.pdf( 2.0, 0.7 )\n ~0.173\n > y = base.dists.exponential.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.exponential.pdf( 0, NaN )\n NaN\n > y = base.dists.exponential.pdf( NaN, 2.0 )\n NaN\n\n // Negative rate:\n > y = base.dists.exponential.pdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.pdf.factory( λ )\n Returns a function for evaluating the probability density function (PDF)\n for an exponential distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.exponential.pdf.factory( 0.5 );\n > var y = myPDF( 3.0 )\n ~0.112\n\n",
"base.dists.exponential.quantile": "\nbase.dists.exponential.quantile( p, λ )\n Evaluates the quantile function for an exponential distribution with rate\n parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.exponential.quantile( 0.8, 1.0 )\n ~1.609\n > y = base.dists.exponential.quantile( 0.5, 4.0 )\n ~0.173\n > y = base.dists.exponential.quantile( 0.5, 0.1 )\n ~6.931\n\n > y = base.dists.exponential.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.exponential.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.quantile( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.exponential.quantile.factory( λ )\n Returns a function for evaluating the quantile function for an exponential\n distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.exponential.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n ~1.277\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.exponential.skewness": "\nbase.dists.exponential.skewness( λ )\n Returns the skewness of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.exponential.skewness( 11.0 )\n 2.0\n > v = base.dists.exponential.skewness( 4.5 )\n 2.0\n\n",
"base.dists.exponential.stdev": "\nbase.dists.exponential.stdev( λ )\n Returns the standard deviation of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.exponential.stdev( 9.0 )\n ~0.11\n > v = base.dists.exponential.stdev( 1.0 )\n 1.0\n\n",
"base.dists.exponential.variance": "\nbase.dists.exponential.variance( λ )\n Returns the variance of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.exponential.variance( 9.0 )\n ~0.012\n > v = base.dists.exponential.variance( 1.0 )\n 1.0\n\n",
"base.dists.f.cdf": "\nbase.dists.f.cdf( x, d1, d2 )\n Evaluates the cumulative distribution function (CDF) for a F distribution\n with numerator degrees of freedom `d1` and denominator degrees of freedom\n `d2` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.f.cdf( 2.0, 1.0, 1.0 )\n ~0.608\n > var y = base.dists.f.cdf( 2.0, 8.0, 4.0 )\n ~0.737\n > var y = base.dists.f.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > var y = base.dists.f.cdf( PINF, 4.0, 2.0 )\n 1.0\n > var y = base.dists.f.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > var y = base.dists.f.cdf( NaN, 1.0, 1.0 )\n NaN\n > var y = base.dists.f.cdf( 0.0, NaN, 1.0 )\n NaN\n > var y = base.dists.f.cdf( 0.0, 1.0, NaN )\n NaN\n\n > var y = base.dists.f.cdf( 2.0, 1.0, -1.0 )\n NaN\n > var y = base.dists.f.cdf( 2.0, -1.0, 1.0 )\n NaN\n\n\nbase.dists.f.cdf.factory( d1, d2 )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a F distribution with numerator degrees of freedom `d1` and denominator\n degrees of freedom `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.f.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 10.0 )\n ~0.906\n > y = myCDF( 8.0 )\n ~0.884\n\n",
"base.dists.f.entropy": "\nbase.dists.f.entropy( d1, d2 )\n Returns the differential entropy of a F distribution (in nats).\n\n If `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.f.entropy( 3.0, 7.0 )\n ~1.298\n > v = base.dists.f.entropy( 4.0, 12.0 )\n ~1.12\n > v = base.dists.f.entropy( 8.0, 2.0 )\n ~2.144\n\n",
"base.dists.f.F": "\nbase.dists.f.F( [d1, d2] )\n Returns a F distribution object.\n\n Parameters\n ----------\n d1: number (optional)\n Numerator degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n d2: number (optional)\n Denominator degrees of freedom. Must be greater than `0`.\n Default: `1.0`.\n\n Returns\n -------\n f: Object\n Distribution instance.\n\n f.d1: number\n Numerator degrees of freedom. If set, the value must be greater than\n `0`.\n\n f.d2: number\n Denominator degrees of freedom. If set, the value must be greater than\n `0`.\n\n f.entropy: number\n Read-only property which returns the differential entropy.\n\n f.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n f.mean: number\n Read-only property which returns the expected value.\n\n f.mode: number\n Read-only property which returns the mode.\n\n f.skewness: number\n Read-only property which returns the skewness.\n\n f.stdev: number\n Read-only property which returns the standard deviation.\n\n f.variance: number\n Read-only property which returns the variance.\n\n f.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n f.pdf: Function\n Evaluates the probability density function (PDF).\n\n f.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var f = base.dists.f.F( 6.0, 9.0 );\n > f.d1\n 6.0\n > f.d2\n 9.0\n > f.entropy\n ~1.134\n > f.kurtosis\n ~104.564\n > f.mean\n ~1.286\n > f.mode\n ~0.545\n > f.skewness\n ~4.535\n > f.stdev\n ~1.197\n > f.variance\n ~1.433\n > f.cdf( 3.0 )\n ~0.932\n > f.pdf( 2.5 )\n ~0.095\n > f.quantile( 0.8 )\n ~1.826\n\n",
"base.dists.f.kurtosis": "\nbase.dists.f.kurtosis( d1, d2 )\n Returns the excess kurtosis of a F distribution.\n\n If `d1 <= 0` or `d2 <= 8`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.f.kurtosis( 3.0, 9.0 )\n ~124.667\n > v = base.dists.f.kurtosis( 4.0, 12.0 )\n ~26.143\n > v = base.dists.f.kurtosis( 8.0, 9.0 )\n ~100.167\n\n",
"base.dists.f.mean": "\nbase.dists.f.mean( d1, d2 )\n Returns the expected value of a F distribution.\n\n If `d1 <= 0` or `d2 <= 2`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.f.mean( 3.0, 5.0 )\n ~1.667\n > v = base.dists.f.mean( 4.0, 12.0 )\n ~1.2\n > v = base.dists.f.mean( 8.0, 4.0 )\n 2.0\n\n",
"base.dists.f.mode": "\nbase.dists.f.mode( d1, d2 )\n Returns the mode of a F distribution.\n\n If `d1 <= 2` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.f.mode( 3.0, 5.0 )\n ~0.238\n > v = base.dists.f.mode( 4.0, 12.0 )\n ~0.429\n > v = base.dists.f.mode( 8.0, 4.0 )\n 0.5\n\n",
"base.dists.f.pdf": "\nbase.dists.f.pdf( x, d1, d2 )\n Evaluates the probability density function (PDF) for a F distribution with\n numerator degrees of freedom `d1` and denominator degrees of freedom `d2` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.f.pdf( 2.0, 0.5, 1.0 )\n ~0.057\n > y = base.dists.f.pdf( 0.1, 1.0, 1.0 )\n ~0.915\n > y = base.dists.f.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.f.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.f.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.f.pdf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.f.pdf( 2.0, 1.0, -1.0 )\n NaN\n > y = base.dists.f.pdf( 2.0, -1.0, 1.0 )\n NaN\n\n\nbase.dists.f.pdf.factory( d1, d2 )\n Returns a function for evaluating the probability density function (PDF) of\n a F distribution with numerator degrees of freedom `d1` and denominator\n degrees of freedom `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.f.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n ~0.004\n > y = myPDF( 2.0 )\n ~0.166\n\n",
"base.dists.f.quantile": "\nbase.dists.f.quantile( p, d1, d2 )\n Evaluates the quantile function for a F distribution with numerator degrees\n of freedom `d1` and denominator degrees of freedom `d2` at a probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.f.quantile( 0.8, 1.0, 1.0 )\n ~9.472\n > y = base.dists.f.quantile( 0.5, 4.0, 2.0 )\n ~1.207\n\n > y = base.dists.f.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.f.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.f.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.f.quantile.factory( d1, d2 )\n Returns a function for evaluating the quantile function of a F distribution\n with numerator degrees of freedom `d1` and denominator degrees of freedom\n `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.f.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.2 )\n ~0.527\n > y = myQuantile( 0.8 )\n ~4.382\n\n",
"base.dists.f.skewness": "\nbase.dists.f.skewness( d1, d2 )\n Returns the skewness of a F distribution.\n\n If `d1 <= 0` or `d2 <= 6`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.f.skewness( 3.0, 7.0 )\n 11.0\n > v = base.dists.f.skewness( 4.0, 12.0 )\n ~3.207\n > v = base.dists.f.skewness( 8.0, 7.0 )\n ~10.088\n\n",
"base.dists.f.stdev": "\nbase.dists.f.stdev( d1, d2 )\n Returns the standard deviation of a F distribution.\n\n If `d1 <= 0` or `d2 <= 4`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.f.stdev( 3.0, 5.0 )\n ~3.333\n > v = base.dists.f.stdev( 4.0, 12.0 )\n ~1.122\n > v = base.dists.f.stdev( 8.0, 5.0 )\n ~2.764\n\n",
"base.dists.f.variance": "\nbase.dists.f.variance( d1, d2 )\n Returns the variance of a F distribution.\n\n If `d1 <= 0` or `d2 <= 4`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.f.variance( 3.0, 5.0 )\n ~11.111\n > v = base.dists.f.variance( 4.0, 12.0 )\n ~1.26\n > v = base.dists.f.variance( 8.0, 5.0 )\n ~7.639\n\n",
"base.dists.frechet.cdf": "\nbase.dists.frechet.cdf( x, α, s, m )\n Evaluates the cumulative distribution function (CDF) for a Fréchet\n distribution with shape parameter `α`, scale parameter `s`, and location\n `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.frechet.cdf( 10.0, 2.0, 3.0, 0.0 )\n ~0.914\n > y = base.dists.frechet.cdf( -1.0, 2.0, 3.0, -3.0 )\n ~0.105\n > y = base.dists.frechet.cdf( 2.5, 2.0, 1.0, 2.0 )\n ~0.018\n > y = base.dists.frechet.cdf( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.cdf( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.cdf.factory( α, s, m )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.frechet.cdf.factory( 3.0, 3.0, 5.0 );\n > var y = myCDF( 10.0 )\n ~0.806\n > y = myCDF( 7.0 )\n ~0.034\n\n",
"base.dists.frechet.entropy": "\nbase.dists.frechet.entropy( α, s, m )\n Returns the differential entropy of a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.frechet.entropy( 1.0, 1.0, 1.0 )\n ~2.154\n > y = base.dists.frechet.entropy( 4.0, 2.0, 1.0 )\n ~1.028\n > y = base.dists.frechet.entropy( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.entropy( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.entropy( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.Frechet": "\nbase.dists.frechet.Frechet( [α, s, m] )\n Returns a Fréchet distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n m: number (optional)\n Location parameter. Default: `0.0`.\n\n Returns\n -------\n frechet: Object\n Distribution instance.\n\n frechet.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n frechet.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n frechet.m: number\n Location parameter.\n\n frechet.entropy: number\n Read-only property which returns the differential entropy.\n\n frechet.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n frechet.mean: number\n Read-only property which returns the expected value.\n\n frechet.median: number\n Read-only property which returns the median.\n\n frechet.mode: number\n Read-only property which returns the mode.\n\n frechet.skewness: number\n Read-only property which returns the skewness.\n\n frechet.stdev: number\n Read-only property which returns the standard deviation.\n\n frechet.variance: number\n Read-only property which returns the variance.\n\n frechet.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n frechet.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n frechet.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n frechet.pdf: Function\n Evaluates the probability density function (PDF).\n\n frechet.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var frechet = base.dists.frechet.Frechet( 1.0, 1.0, 0.0 );\n > frechet.alpha\n 1.0\n > frechet.s\n 1.0\n > frechet.m\n 0.0\n > frechet.entropy\n ~2.154\n > frechet.kurtosis\n Infinity\n > frechet.mean\n Infinity\n > frechet.median\n ~1.443\n > frechet.mode\n 0.5\n > frechet.skewness\n Infinity\n > frechet.stdev\n Infinity\n > frechet.variance\n Infinity\n > frechet.cdf( 0.8 )\n ~0.287\n > frechet.logcdf( 0.8 )\n -1.25\n > frechet.logpdf( 0.8 )\n ~-0.804\n > frechet.pdf( 0.8 )\n ~0.448\n > frechet.quantile( 0.8 )\n ~4.481\n\n",
"base.dists.frechet.kurtosis": "\nbase.dists.frechet.kurtosis( α, s, m )\n Returns the excess kurtosis of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 4` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.frechet.kurtosis( 5.0, 2.0, 1.0 )\n ~45.092\n > var y = base.dists.frechet.kurtosis( 5.0, 10.0, -3.0 )\n ~45.092\n > y = base.dists.frechet.kurtosis( 3.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.kurtosis( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.kurtosis( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.kurtosis( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.logcdf": "\nbase.dists.frechet.logcdf( x, α, s, m )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a Fréchet distribution with shape parameter `α`, scale parameter\n `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.frechet.logcdf( 10.0, 2.0, 3.0, 0.0 )\n ~-0.09\n > y = base.dists.frechet.logcdf( -1.0, 2.0, 3.0, -3.0 )\n ~-2.25\n > y = base.dists.frechet.logcdf( 2.5, 2.0, 1.0, 2.0 )\n -4.0\n > y = base.dists.frechet.logcdf( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.logcdf.factory( α, s, m )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.frechet.logcdf.factory( 3.0, 3.0, 5.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.216\n > y = mylogcdf( 7.0 )\n ~-3.375\n\n",
"base.dists.frechet.logpdf": "\nbase.dists.frechet.logpdf( x, α, s, m )\n Evaluates the logarithm of the probability density function (PDF) for a\n Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.frechet.logpdf( 10.0, 1.0, 3.0, 5.0 )\n ~-2.72\n > y = base.dists.frechet.logpdf( -2.0, 1.0, 3.0, -3.0 )\n ~-1.901\n > y = base.dists.frechet.logpdf( 0.0, 2.0, 1.0, -1.0 )\n ~-0.307\n > y = base.dists.frechet.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.frechet.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.frechet.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.frechet.logpdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.frechet.logpdf.factory( α, s, m )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Fréchet distribution with shape parameter `α`, scale\n parameter `s`, and location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.frechet.logpdf.factory( 2.0, 3.0, 1.0 );\n > var y = mylogPDF( 10.0 )\n ~-3.812\n > y = mylogPDF( 2.0 )\n ~-6.11\n\n",
"base.dists.frechet.mean": "\nbase.dists.frechet.mean( α, s, m )\n Returns the expected value of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 1` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Mean.\n\n Examples\n --------\n > var y = base.dists.frechet.mean( 4.0, 2.0, 1.0 )\n ~3.451\n > y = base.dists.frechet.mean( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.mean( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.mean( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.mean( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.median": "\nbase.dists.frechet.median( α, s, m )\n Returns the median of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.frechet.median( 4.0, 2.0, 1.0 )\n ~3.192\n > var y = base.dists.frechet.median( 4.0, 2.0, -3.0 )\n ~-0.808\n > y = base.dists.frechet.median( 0.5, 2.0, 1.0 )\n ~5.163\n > y = base.dists.frechet.median( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.median( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.median( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.mode": "\nbase.dists.frechet.mode( α, s, m )\n Returns the mode of a Fréchet distribution with shape parameter `α`, scale\n parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.frechet.mode( 4.0, 2.0, 1.0 )\n ~2.891\n > var y = base.dists.frechet.mode( 4.0, 2.0, -3.0 )\n ~-1.109\n > y = base.dists.frechet.mode( 0.5, 2.0, 1.0 )\n ~1.222\n > y = base.dists.frechet.mode( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.mode( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.mode( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.pdf": "\nbase.dists.frechet.pdf( x, α, s, m )\n Evaluates the probability density function (PDF) for a Fréchet distribution\n with shape parameter `α`, scale parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.frechet.pdf( 10.0, 0.0, 3.0 )\n ~0.965\n > y = base.dists.frechet.pdf( -2.0, 0.0, 3.0 )\n ~0.143\n > y = base.dists.frechet.pdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.frechet.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.frechet.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.frechet.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.frechet.pdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.frechet.pdf.factory( α, s, m )\n Returns a function for evaluating the probability density function (PDF) of\n a Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.frechet.pdf.factory( 2.0, 3.0 );\n > var y = myPDF( 10.0 )\n ~0.933\n > y = myPDF( 2.0 )\n ~0.368\n\n",
"base.dists.frechet.quantile": "\nbase.dists.frechet.quantile( p, α, s, m )\n Evaluates the quantile function for a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.frechet.quantile( 0.3, 10.0, 2.0, 3.0 )\n ~4.963\n > y = base.dists.frechet.quantile( 0.2, 3.0, 3.0, 3.0 )\n ~5.56\n > y = base.dists.frechet.quantile( 0.9, 1.0, 1.0, -3.0 )\n ~6.491\n > y = base.dists.frechet.quantile( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, NaN, 1.0, 0.0)\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.quantile( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.quantile.factory( α, s, m )\n Returns a function for evaluating the quantile function of a Fréchet\n distribution with shape parameter `α`, scale parameter `s`, and location\n `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.frechet.quantile.factory( 2.0, 2.0, 3.0 );\n > var y = myQuantile( 0.5 )\n ~5.402\n > y = myQuantile( 0.2 )\n ~4.576\n\n",
"base.dists.frechet.skewness": "\nbase.dists.frechet.skewness( α, s, m )\n Returns the skewness of a Fréchet distribution with shape parameter `α`,\n scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 3` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.frechet.skewness( 4.0, 2.0, 1.0 )\n ~5.605\n > var y = base.dists.frechet.skewness( 4.0, 2.0, -3.0 )\n ~5.605\n > y = base.dists.frechet.skewness( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.skewness( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.skewness( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.skewness( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.stdev": "\nbase.dists.frechet.stdev( α, s, m )\n Returns the standard deviation of a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 2` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.frechet.stdev( 4.0, 2.0, 1.0 )\n ~1.041\n > var y = base.dists.frechet.stdev( 4.0, 2.0, -3.0 )\n ~1.041\n > y = base.dists.frechet.stdev( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.stdev( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.stdev( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.stdev( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.variance": "\nbase.dists.frechet.variance( α, s, m )\n Returns the variance of a Fréchet distribution with shape parameter `α`,\n scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 2` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.frechet.variance( 4.0, 2.0, 1.0 )\n ~1.083\n > var y = base.dists.frechet.variance( 4.0, 2.0, -3.0 )\n ~1.083\n > y = base.dists.frechet.variance( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.variance( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.variance( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.variance( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.gamma.cdf": "\nbase.dists.gamma.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a gamma\n distribution with shape parameter `α` and rate parameter `β` at a value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.gamma.cdf( 2.0, 1.0, 1.0 )\n ~0.865\n > y = base.dists.gamma.cdf( 2.0, 3.0, 1.0 )\n ~0.323\n > y = base.dists.gamma.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.gamma.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.gamma.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.gamma.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.gamma.cdf( 2.0, -1.0, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0` when `α = 0.0`:\n > y = base.dists.gamma.cdf( 2.0, 0.0, 2.0 )\n 1.0\n > y = base.dists.gamma.cdf( -2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.cdf( 0.0, 0.0, 2.0 )\n 0.0\n\n\nbase.dists.gamma.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.gamma.cdf.factory( 2.0, 0.5 );\n > var y = myCDF( 6.0 )\n ~0.801\n > y = myCDF( 2.0 )\n ~0.264\n\n",
"base.dists.gamma.entropy": "\nbase.dists.gamma.entropy( α, β )\n Returns the differential entropy of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.gamma.entropy( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.entropy( 4.0, 12.0 )\n ~-0.462\n > v = base.dists.gamma.entropy( 8.0, 2.0 )\n ~1.723\n\n",
"base.dists.gamma.Gamma": "\nbase.dists.gamma.Gamma( [α, β] )\n Returns a gamma distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n gamma: Object\n Distribution instance.\n\n gamma.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n gamma.beta: number\n Rate parameter. If set, the value must be greater than `0`.\n\n gamma.entropy: number\n Read-only property which returns the differential entropy.\n\n gamma.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n gamma.mean: number\n Read-only property which returns the expected value.\n\n gamma.mode: number\n Read-only property which returns the mode.\n\n gamma.skewness: number\n Read-only property which returns the skewness.\n\n gamma.stdev: number\n Read-only property which returns the standard deviation.\n\n gamma.variance: number\n Read-only property which returns the variance.\n\n gamma.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n gamma.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n gamma.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n gamma.pdf: Function\n Evaluates the probability density function (PDF).\n\n gamma.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var gamma = base.dists.gamma.Gamma( 6.0, 5.0 );\n > gamma.alpha\n 6.0\n > gamma.beta\n 5.0\n > gamma.entropy\n ~0.647\n > gamma.kurtosis\n 1.0\n > gamma.mean\n 1.2\n > gamma.mode\n 1.0\n > gamma.skewness\n ~0.816\n > gamma.stdev\n ~0.49\n > gamma.variance\n 0.24\n > gamma.cdf( 0.8 )\n ~0.215\n > gamma.logpdf( 1.0 )\n ~-0.131\n > gamma.mgf( -0.5 )\n ~0.564\n > gamma.pdf( 1.0 )\n ~0.877\n > gamma.quantile( 0.8 )\n ~1.581\n\n",
"base.dists.gamma.kurtosis": "\nbase.dists.gamma.kurtosis( α, β )\n Returns the excess kurtosis of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.gamma.kurtosis( 1.0, 1.0 )\n 6.0\n > v = base.dists.gamma.kurtosis( 4.0, 12.0 )\n 1.5\n > v = base.dists.gamma.kurtosis( 8.0, 2.0 )\n 0.75\n\n",
"base.dists.gamma.logpdf": "\nbase.dists.gamma.logpdf( x, α, β )\n Evaluates the logarithm of the probability density function (PDF) for a\n gamma distribution with shape parameter `α` and rate parameter `β` at a\n value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.gamma.logpdf( 2.0, 0.5, 1.0 )\n ~-2.919\n > y = base.dists.gamma.logpdf( 0.1, 1.0, 1.0 )\n ~-0.1\n > y = base.dists.gamma.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.gamma.logpdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.gamma.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.logpdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.gamma.logpdf( 2.0, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.logpdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.gamma.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.gamma.logpdf.factory( α, β )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a gamma distribution with shape parameter `α` and rate\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.gamma.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 2.0 )\n ~-3.646\n\n",
"base.dists.gamma.mean": "\nbase.dists.gamma.mean( α, β )\n Returns the expected value of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.gamma.mean( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.mean( 4.0, 12.0 )\n ~0.333\n > v = base.dists.gamma.mean( 8.0, 2.0 )\n 4.0\n\n",
"base.dists.gamma.mgf": "\nbase.dists.gamma.mgf( t, α, β )\n Evaluates the moment-generating function (MGF) for a gamma distribution with\n shape parameter `α` and rate parameter `β` at a value `t`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.gamma.mgf( 0.5, 0.5, 1.0 )\n ~1.414\n > y = base.dists.gamma.mgf( 0.1, 1.0, 1.0 )\n ~1.111\n > y = base.dists.gamma.mgf( -1.0, 4.0, 2.0 )\n ~0.198\n\n > y = base.dists.gamma.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.gamma.mgf( 2.0, 4.0, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, -0.5, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, 1.0, 0.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.gamma.mgf.factory( α, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.gamma.mgf.factory( 3.0, 1.5 );\n > var y = myMGF( 1.0 )\n ~27.0\n > y = myMGF( 0.5 )\n ~3.375\n\n",
"base.dists.gamma.mode": "\nbase.dists.gamma.mode( α, β )\n Returns the mode of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.gamma.mode( 1.0, 1.0 )\n 0.0\n > v = base.dists.gamma.mode( 4.0, 12.0 )\n 0.25\n > v = base.dists.gamma.mode( 8.0, 2.0 )\n 3.5\n\n",
"base.dists.gamma.pdf": "\nbase.dists.gamma.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a gamma distribution\n with shape parameter `α` and rate parameter `β` at a value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.gamma.pdf( 2.0, 0.5, 1.0 )\n ~0.054\n > y = base.dists.gamma.pdf( 0.1, 1.0, 1.0 )\n ~0.905\n > y = base.dists.gamma.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.gamma.pdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.gamma.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.pdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.gamma.pdf( 2.0, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.pdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.gamma.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.gamma.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 2.0 )\n ~0.026\n\n",
"base.dists.gamma.quantile": "\nbase.dists.gamma.quantile( p, α, β )\n Evaluates the quantile function for a gamma distribution with shape\n parameter `α` and rate parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.gamma.quantile( 0.8, 2.0, 1.0 )\n ~2.994\n > y = base.dists.gamma.quantile( 0.5, 4.0, 2.0 )\n ~1.836\n\n > y = base.dists.gamma.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.gamma.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( 0.0, 1.0, NaN )\n NaN\n\n // Non-positive shape parameter:\n > y = base.dists.gamma.quantile( 0.5, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.quantile( 0.3, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.quantile( 0.9, 0.0, 2.0 )\n 0.0\n\n\nbase.dists.gamma.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a gamma\n distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.gamma.quantile.factory( 2.0, 2.0 );\n > var y = myQuantile( 0.8 )\n ~1.497\n > y = myQuantile( 0.4 )\n ~0.688\n\n",
"base.dists.gamma.skewness": "\nbase.dists.gamma.skewness( α, β )\n Returns the skewness of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.gamma.skewness( 1.0, 1.0 )\n 2.0\n > v = base.dists.gamma.skewness( 4.0, 12.0 )\n 1.0\n > v = base.dists.gamma.skewness( 8.0, 2.0 )\n ~0.707\n\n",
"base.dists.gamma.stdev": "\nbase.dists.gamma.stdev( α, β )\n Returns the standard deviation of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.gamma.stdev( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.stdev( 4.0, 12.0 )\n ~0.167\n > v = base.dists.gamma.stdev( 8.0, 2.0 )\n ~1.414\n\n",
"base.dists.gamma.variance": "\nbase.dists.gamma.variance( α, β )\n Returns the variance of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.gamma.variance( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.variance( 4.0, 12.0 )\n ~0.028\n > v = base.dists.gamma.variance( 8.0, 2.0 )\n 2.0\n\n",
"base.dists.geometric.cdf": "\nbase.dists.geometric.cdf( x, p )\n Evaluates the cumulative distribution function (CDF) for a geometric\n distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.geometric.cdf( 2.0, 0.5 )\n 0.875\n > y = base.dists.geometric.cdf( 2.0, 0.1 )\n ~0.271\n > y = base.dists.geometric.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.geometric.cdf( NaN, 0.5 )\n NaN\n > y = base.dists.geometric.cdf( 0.0, NaN )\n NaN\n // Invalid probability\n > y = base.dists.geometric.cdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.geometric.cdf.factory( p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.geometric.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n 0.9375\n > y = mycdf( 1.0 )\n 0.75\n\n",
"base.dists.geometric.entropy": "\nbase.dists.geometric.entropy( p )\n Returns the entropy of a geometric distribution with success probability\n `p` (in nats).\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.geometric.entropy( 0.1 )\n ~3.251\n > v = base.dists.geometric.entropy( 0.5 )\n ~1.386\n\n",
"base.dists.geometric.Geometric": "\nbase.dists.geometric.Geometric( [p] )\n Returns a geometric distribution object.\n\n Parameters\n ----------\n p: number (optional)\n Success probability. Must be between `0` and `1`. Default: `0.5`.\n\n Returns\n -------\n geometric: Object\n Distribution instance.\n\n geometric.p: number\n Success probability. If set, the value must be between `0` and `1`.\n\n geometric.entropy: number\n Read-only property which returns the differential entropy.\n\n geometric.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n geometric.mean: number\n Read-only property which returns the expected value.\n\n geometric.median: number\n Read-only property which returns the median.\n\n geometric.mode: number\n Read-only property which returns the mode.\n\n geometric.skewness: number\n Read-only property which returns the skewness.\n\n geometric.stdev: number\n Read-only property which returns the standard deviation.\n\n geometric.variance: number\n Read-only property which returns the variance.\n\n geometric.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n geometric.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n geometric.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n geometric.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n geometric.pmf: Function\n Evaluates the probability mass function (PMF).\n\n geometric.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var geometric = base.dists.geometric.Geometric( 0.6 );\n > geometric.p\n 0.6\n > geometric.entropy\n ~1.122\n > geometric.kurtosis\n ~6.9\n > geometric.mean\n ~0.667\n > geometric.median\n 0.0\n > geometric.mode\n 0.0\n > geometric.skewness\n ~2.214\n > geometric.stdev\n ~1.054\n > geometric.variance\n ~1.111\n > geometric.cdf( 3.0 )\n ~0.974\n > geometric.logcdf( 3.0 )\n ~-0.026\n > geometric.logpmf( 4.0 )\n ~-4.176\n > geometric.mgf( 0.5 )\n ~2.905\n > geometric.pmf( 2.0 )\n ~0.096\n > geometric.quantile( 0.7 )\n 1.0\n\n",
"base.dists.geometric.kurtosis": "\nbase.dists.geometric.kurtosis( p )\n Returns the excess kurtosis of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.geometric.kurtosis( 0.1 )\n ~6.011\n > v = base.dists.geometric.kurtosis( 0.5 )\n 6.5\n\n",
"base.dists.geometric.logcdf": "\nbase.dists.geometric.logcdf( x, p )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n geometric distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.geometric.logcdf( 2.0, 0.5 )\n ~-0.134\n > y = base.dists.geometric.logcdf( 2.0, 0.1 )\n ~-1.306\n > y = base.dists.geometric.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.geometric.logcdf( NaN, 0.5 )\n NaN\n > y = base.dists.geometric.logcdf( 0.0, NaN )\n NaN\n // Invalid probability\n > y = base.dists.geometric.logcdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.geometric.logcdf.factory( p )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a geometric distribution with success\n probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.geometric.logcdf.factory( 0.5 );\n > var y = mylogcdf( 3.0 )\n ~-0.065\n > y = mylogcdf( 1.0 )\n ~-0.288\n\n",
"base.dists.geometric.logpmf": "\nbase.dists.geometric.logpmf( x, p )\n Evaluates the logarithm of the probability mass function (PMF) for a\n geometric distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.geometric.logpmf( 4.0, 0.3 )\n ~-2.631\n > y = base.dists.geometric.logpmf( 2.0, 0.7 )\n ~-2.765\n > y = base.dists.geometric.logpmf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.geometric.logpmf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.logpmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.geometric.logpmf( 2.0, 1.5 )\n NaN\n\n\nbase.dists.geometric.logpmf.factory( p )\n Returns a function for evaluating the logarithm of the probability mass\n function (PMF) of a geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.geometric.logpmf.factory( 0.5 );\n > var y = mylogpmf( 3.0 )\n ~-2.773\n > y = mylogpmf( 1.0 )\n ~-1.386\n\n",
"base.dists.geometric.mean": "\nbase.dists.geometric.mean( p )\n Returns the expected value of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.geometric.mean( 0.1 )\n 9.0\n > v = base.dists.geometric.mean( 0.5 )\n 1.0\n\n",
"base.dists.geometric.median": "\nbase.dists.geometric.median( p )\n Returns the median of a geometric distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.geometric.median( 0.1 )\n 6\n > v = base.dists.geometric.median( 0.5 )\n 0\n\n",
"base.dists.geometric.mgf": "\nbase.dists.geometric.mgf( t, p )\n Evaluates the moment-generating function (MGF) for a geometric\n distribution with success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `t >= -ln(1-p)`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.geometric.mgf( 0.2, 0.5 )\n ~1.569\n > y = base.dists.geometric.mgf( 0.4, 0.5 )\n ~2.936\n // Case: t >= -ln(1-p)\n > y = base.dists.geometric.mgf( 0.8, 0.5 )\n NaN\n > y = base.dists.geometric.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.geometric.mgf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.mgf( -2.0, -1.0 )\n NaN\n > y = base.dists.geometric.mgf( 0.2, 2.0 )\n NaN\n\n\nbase.dists.geometric.mgf.factory( p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.geometric.mgf.factory( 0.8 );\n > var y = mymgf( -0.2 )\n ~0.783\n\n",
"base.dists.geometric.mode": "\nbase.dists.geometric.mode( p )\n Returns the mode of a geometric distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.geometric.mode( 0.1 )\n 0\n > v = base.dists.geometric.mode( 0.5 )\n 0\n\n",
"base.dists.geometric.pmf": "\nbase.dists.geometric.pmf( x, p )\n Evaluates the probability mass function (PMF) for a geometric distribution\n with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.geometric.pmf( 4.0, 0.3 )\n ~0.072\n > y = base.dists.geometric.pmf( 2.0, 0.7 )\n ~0.063\n > y = base.dists.geometric.pmf( -1.0, 0.5 )\n 0.0\n > y = base.dists.geometric.pmf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.pmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.geometric.pmf( 2.0, 1.5 )\n NaN\n\n\nbase.dists.geometric.pmf.factory( p )\n Returns a function for evaluating the probability mass function (PMF) of a\n geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.geometric.pmf.factory( 0.5 );\n > var y = mypmf( 3.0 )\n 0.0625\n > y = mypmf( 1.0 )\n 0.25\n\n",
"base.dists.geometric.quantile": "\nbase.dists.geometric.quantile( r, p )\n Evaluates the quantile function for a geometric distribution with success\n probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.geometric.quantile( 0.8, 0.4 )\n 3\n > y = base.dists.geometric.quantile( 0.5, 0.4 )\n 1\n > y = base.dists.geometric.quantile( 0.9, 0.1 )\n 21\n\n > y = base.dists.geometric.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.geometric.quantile( NaN, 0.8 )\n NaN\n > y = base.dists.geometric.quantile( 0.4, NaN )\n NaN\n\n > y = base.dists.geometric.quantile( 0.5, -1.0 )\n NaN\n > y = base.dists.geometric.quantile( 0.5, 1.5 )\n NaN\n\n\nbase.dists.geometric.quantile.factory( p )\n Returns a function for evaluating the quantile function of a geometric\n distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.geometric.quantile.factory( 0.4 );\n > var y = myquantile( 0.4 )\n 0\n > y = myquantile( 0.8 )\n 3\n > y = myquantile( 1.0 )\n Infinity\n\n",
"base.dists.geometric.skewness": "\nbase.dists.geometric.skewness( p )\n Returns the skewness of a geometric distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.geometric.skewness( 0.1 )\n ~2.003\n > v = base.dists.geometric.skewness( 0.5 )\n ~2.121\n\n",
"base.dists.geometric.stdev": "\nbase.dists.geometric.stdev( p )\n Returns the standard deviation of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.geometric.stdev( 0.1 )\n ~9.487\n > v = base.dists.geometric.stdev( 0.5 )\n ~1.414\n\n",
"base.dists.geometric.variance": "\nbase.dists.geometric.variance( p )\n Returns the variance of a geometric distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.geometric.variance( 0.1 )\n ~90.0\n > v = base.dists.geometric.variance( 0.5 )\n 2.0\n\n",
"base.dists.gumbel.cdf": "\nbase.dists.gumbel.cdf( x, μ, β )\n Evaluates the cumulative distribution function (CDF) for a Gumbel\n distribution with location parameter `μ` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.cdf( 10.0, 0.0, 3.0 )\n ~0.965\n > y = base.dists.gumbel.cdf( -2.0, 0.0, 3.0 )\n ~0.143\n > y = base.dists.gumbel.cdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.gumbel.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.cdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.cdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.cdf.factory( μ, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Gumbel distribution with location parameter `μ` and scale parameter\n `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.gumbel.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.933\n > y = myCDF( 2.0 )\n ~0.368\n\n",
"base.dists.gumbel.entropy": "\nbase.dists.gumbel.entropy( μ, β )\n Returns the differential entropy of a Gumbel distribution with location\n parameter `μ` and scale parameter `β` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.gumbel.entropy( 0.0, 1.0 )\n ~1.577\n > y = base.dists.gumbel.entropy( 4.0, 2.0 )\n ~2.27\n > y = base.dists.gumbel.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.entropy( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.Gumbel": "\nbase.dists.gumbel.Gumbel( [μ, β] )\n Returns a Gumbel distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n gumbel: Object\n Distribution instance.\n\n gumbel.mu: number\n Location parameter.\n\n gumbel.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n gumbel.entropy: number\n Read-only property which returns the differential entropy.\n\n gumbel.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n gumbel.mean: number\n Read-only property which returns the expected value.\n\n gumbel.median: number\n Read-only property which returns the median.\n\n gumbel.mode: number\n Read-only property which returns the mode.\n\n gumbel.skewness: number\n Read-only property which returns the skewness.\n\n gumbel.stdev: number\n Read-only property which returns the standard deviation.\n\n gumbel.variance: number\n Read-only property which returns the variance.\n\n gumbel.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n gumbel.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n gumbel.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n gumbel.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n gumbel.pdf: Function\n Evaluates the probability density function (PDF).\n\n gumbel.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var gumbel = base.dists.gumbel.Gumbel( -2.0, 3.0 );\n > gumbel.mu\n -2.0\n > gumbel.beta\n 3.0\n > gumbel.entropy\n ~2.676\n > gumbel.kurtosis\n 2.4\n > gumbel.mean\n ~-0.268\n > gumbel.median\n ~-0.9\n > gumbel.mode\n -2.0\n > gumbel.skewness\n ~1.14\n > gumbel.stdev\n ~3.848\n > gumbel.variance\n ~14.804\n > gumbel.cdf( 0.8 )\n ~0.675\n > gumbel.logcdf( 0.8 )\n ~-0.393\n > gumbel.logpdf( 1.0 )\n ~-2.466\n > gumbel.mgf( 0.2 )\n ~1.487\n > gumbel.pdf( 1.0 )\n ~0.085\n > gumbel.quantile( 0.8 )\n ~2.5\n\n",
"base.dists.gumbel.kurtosis": "\nbase.dists.gumbel.kurtosis( μ, β )\n Returns the excess kurtosis of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.gumbel.kurtosis( 0.0, 1.0 )\n 2.4\n > y = base.dists.gumbel.kurtosis( 4.0, 2.0 )\n 2.4\n > y = base.dists.gumbel.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.logcdf": "\nbase.dists.gumbel.logcdf( x, μ, β )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Gumbel distribution with location parameter `μ` and scale parameter `β` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.logcdf( 10.0, 0.0, 3.0 )\n ~-0.036\n > y = base.dists.gumbel.logcdf( -2.0, 0.0, 3.0 )\n ~-1.948\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, 1.0 )\n ~-1.0\n > y = base.dists.gumbel.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.logcdf.factory( μ, β )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var myLCDF = base.dists.gumbel.logcdf.factory( 2.0, 3.0 );\n > var y = myLCDF( 10.0 )\n ~-0.069\n > y = myLCDF( 2.0 )\n ~-1.0\n\n",
"base.dists.gumbel.logpdf": "\nbase.dists.gumbel.logpdf( x, μ, β )\n Evaluates the logarithm of the probability density function (PDF) for a\n Gumbel distribution with location parameter `μ` and scale parameter `β` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.logpdf( 0.0, 0.0, 2.0 )\n ~-1.693\n > y = base.dists.gumbel.logpdf( 0.0, 0.0, 1.0 )\n ~-1\n > y = base.dists.gumbel.logpdf( 1.0, 3.0, 2.0 )\n ~-2.411\n > y = base.dists.gumbel.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.logpdf.factory( μ, β )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.gumbel.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-1.693\n > y = mylogpdf( 12.0 )\n ~-2.061\n\n",
"base.dists.gumbel.mean": "\nbase.dists.gumbel.mean( μ, β )\n Returns the expected value of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.gumbel.mean( 0.0, 1.0 )\n ~0.577\n > y = base.dists.gumbel.mean( 4.0, 2.0 )\n ~5.154\n > y = base.dists.gumbel.mean( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mean( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.median": "\nbase.dists.gumbel.median( μ, β )\n Returns the median of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.gumbel.median( 0.0, 1.0 )\n ~0.367\n > y = base.dists.gumbel.median( 4.0, 2.0 )\n ~4.733\n > y = base.dists.gumbel.median( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.median( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.mgf": "\nbase.dists.gumbel.mgf( t, μ, β )\n Evaluates the moment-generating function (MGF) for a Gumbel distribution\n with location parameter `μ` and scale parameter `β` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.gumbel.mgf( -1.0, 0.0, 3.0 )\n 6.0\n > y = base.dists.gumbel.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.gumbel.mgf( 0.1, 0.0, 3.0 )\n ~1.298\n\n > y = base.dists.gumbel.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mgf( 0.0, 0.0, NaN )\n NaN\n\n // Case: `t >= 1/beta`\n > y = base.dists.gumbel.mgf( 0.8, 0.0, 2.0 )\n NaN\n\n // Non-positive scale parameter:\n > y = base.dists.gumbel.mgf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.mgf.factory( μ, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Gumbel distribution with location parameter `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.gumbel.mgf.factory( 0.0, 3.0 );\n > var y = myMGF( -1.5 )\n ~52.343\n > y = myMGF( -1.0 )\n 6.0\n\n",
"base.dists.gumbel.mode": "\nbase.dists.gumbel.mode( μ, β )\n Returns the mode of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.gumbel.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.gumbel.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.gumbel.mode( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mode( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.pdf": "\nbase.dists.gumbel.pdf( x, μ, β )\n Evaluates the probability density function (PDF) for a Gumbel distribution\n with location parameter `μ` and scale parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.pdf( 0.0, 0.0, 2.0 )\n ~0.184\n > y = base.dists.gumbel.pdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.gumbel.pdf( 1.0, 3.0, 2.0 )\n ~0.09\n > y = base.dists.gumbel.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.pdf.factory( μ, β )\n Returns a function for evaluating the probability density function (PDF)\n of a Gumbel distribution with location parameter `μ` and scale parameter\n `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.gumbel.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.184\n > y = myPDF( 12.0 )\n ~0.127\n\n",
"base.dists.gumbel.quantile": "\nbase.dists.gumbel.quantile( p, μ, β )\n Evaluates the quantile function for a Gumbel distribution with location\n parameter `μ` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.gumbel.quantile( 0.8, 0.0, 1.0 )\n ~1.5\n > y = base.dists.gumbel.quantile( 0.5, 4.0, 2.0 )\n ~4.733\n > y = base.dists.gumbel.quantile( 0.5, 4.0, 4.0 )\n ~5.466\n\n > y = base.dists.gumbel.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.gumbel.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.gumbel.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.quantile.factory( μ, β )\n Returns a function for evaluating the quantile function of a Gumbel\n distribution with location parameter `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.gumbel.quantile.factory( 8.0, 2.0 );\n > var y = myQuantile( 0.5 )\n ~8.733\n > y = myQuantile( 0.7 )\n ~10.062\n\n",
"base.dists.gumbel.skewness": "\nbase.dists.gumbel.skewness( μ, β )\n Returns the skewness of a Gumbel distribution with location parameter `μ`\n and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.gumbel.skewness( 0.0, 1.0 )\n ~1.14\n > y = base.dists.gumbel.skewness( 4.0, 2.0 )\n ~1.14\n > y = base.dists.gumbel.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.skewness( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.stdev": "\nbase.dists.gumbel.stdev( μ, β )\n Returns the standard deviation of a Gumbel distribution with location\n parameter `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.gumbel.stdev( 0.0, 1.0 )\n ~1.283\n > y = base.dists.gumbel.stdev( 4.0, 2.0 )\n ~2.565\n > y = base.dists.gumbel.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.stdev( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.variance": "\nbase.dists.gumbel.variance( μ, β )\n Returns the variance of a Gumbel distribution with location parameter `μ`\n and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.gumbel.variance( 0.0, 1.0 )\n ~1.645\n > y = base.dists.gumbel.variance( 4.0, 2.0 )\n ~6.58\n > y = base.dists.gumbel.variance( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.variance( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.hypergeometric.cdf": "\nbase.dists.hypergeometric.cdf( x, N, K, n )\n Evaluates the cumulative distribution function (CDF) for a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or subpopulation size `K` exceeds population size\n `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.cdf( 1.0, 8, 4, 2 )\n ~0.786\n > y = base.dists.hypergeometric.cdf( 1.5, 8, 4, 2 )\n ~0.786\n > y = base.dists.hypergeometric.cdf( 2.0, 8, 4, 2 )\n 1.0\n > y = base.dists.hypergeometric.cdf( 0, 8, 4, 2)\n ~0.214\n\n > y = base.dists.hypergeometric.cdf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.cdf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.cdf.factory( N, K, n )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a hypergeometric distribution with population size `N`, subpopulation\n size `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.hypergeometric.cdf.factory( 30, 20, 5 );\n > var y = myCDF( 4.0 )\n ~0.891\n > y = myCDF( 1.0 )\n ~0.031\n\n",
"base.dists.hypergeometric.Hypergeometric": "\nbase.dists.hypergeometric.Hypergeometric( [N, K, n] )\n Returns a hypergeometric distribution object.\n\n Parameters\n ----------\n N: integer (optional)\n Population size. Must be a non-negative integer larger than or equal to\n `K` and `n`.\n\n K: integer (optional)\n Subpopulation size. Must be a non-negative integer smaller than or equal\n to `N`.\n\n n: integer (optional)\n Number of draws. Must be a non-negative integer smaller than or equal to\n `N`.\n\n Returns\n -------\n hypergeometric: Object\n Distribution instance.\n\n hypergeometric.N: number\n Population size. If set, the value must be a non-negative integer larger\n than or equal to `K` and `n`.\n\n hypergeometric.K: number\n Subpopulation size. If set, the value must be a non-negative integer\n smaller than or equal to `N`.\n\n hypergeometric.n: number\n Number of draws. If set, the value must be a non-negative integer\n smaller than or equal to `N`.\n\n hypergeometric.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n hypergeometric.mean: number\n Read-only property which returns the expected value.\n\n hypergeometric.mode: number\n Read-only property which returns the mode.\n\n hypergeometric.skewness: number\n Read-only property which returns the skewness.\n\n hypergeometric.stdev: number\n Read-only property which returns the standard deviation.\n\n hypergeometric.variance: number\n Read-only property which returns the variance.\n\n hypergeometric.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n hypergeometric.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n hypergeometric.pmf: Function\n Evaluates the probability mass function (PMF).\n\n hypergeometric.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var hypergeometric = base.dists.hypergeometric.Hypergeometric( 100, 70, 20 );\n > hypergeometric.N\n 100.0\n > hypergeometric.K\n 70.0\n > hypergeometric.n\n 20.0\n > hypergeometric.kurtosis\n ~-0.063\n > hypergeometric.mean\n 14.0\n > hypergeometric.mode\n 14.0\n > hypergeometric.skewness\n ~-0.133\n > hypergeometric.stdev\n ~1.842\n > hypergeometric.variance\n ~3.394\n > hypergeometric.cdf( 2.9 )\n ~0.0\n > hypergeometric.logpmf( 10 )\n ~-3.806\n > hypergeometric.pmf( 10 )\n ~0.022\n > hypergeometric.quantile( 0.8 )\n 16.0\n\n",
"base.dists.hypergeometric.kurtosis": "\nbase.dists.hypergeometric.kurtosis( N, K, n )\n Returns the excess kurtosis of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or subpopulation size `K` exceed population size\n `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.kurtosis( 16, 11, 4 )\n ~-0.326\n > v = base.dists.hypergeometric.kurtosis( 4, 2, 2 )\n 0.0\n\n > v = base.dists.hypergeometric.kurtosis( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.kurtosis( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.logpmf": "\nbase.dists.hypergeometric.logpmf( x, N, K, n )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n hypergeometric distribution with population size `N`, subpopulation size\n `K`, and number of draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K`, or draws `n`\n which is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.logpmf( 1.0, 8, 4, 2 )\n ~-0.56\n > y = base.dists.hypergeometric.logpmf( 2.0, 8, 4, 2 )\n ~-1.54\n > y = base.dists.hypergeometric.logpmf( 0.0, 8, 4, 2 )\n ~-1.54\n > y = base.dists.hypergeometric.logpmf( 1.5, 8, 4, 2 )\n -Infinity\n\n > y = base.dists.hypergeometric.logpmf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.logpmf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 5, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.logpmf.factory( N, K, n )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a hypergeometric distribution with population size\n `N`, subpopulation size `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.hypergeometric.logpmf.factory( 30, 20, 5 );\n > var y = mylogPMF( 4.0 )\n ~-1.079\n > y = mylogPMF( 1.0 )\n ~-3.524\n\n",
"base.dists.hypergeometric.mean": "\nbase.dists.hypergeometric.mean( N, K, n )\n Returns the expected value of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.mean( 16, 11, 4 )\n 2.75\n > v = base.dists.hypergeometric.mean( 2, 1, 1 )\n 0.5\n\n > v = base.dists.hypergeometric.mean( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.mean( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.mean( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.mode": "\nbase.dists.hypergeometric.mode( N, K, n )\n Returns the mode of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.mode( 16, 11, 4 )\n 3\n > v = base.dists.hypergeometric.mode( 2, 1, 1 )\n 1\n\n > v = base.dists.hypergeometric.mode( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.mode( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.mode( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.pmf": "\nbase.dists.hypergeometric.pmf( x, N, K, n )\n Evaluates the probability mass function (PMF) for a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.pmf( 1.0, 8, 4, 2 )\n ~0.571\n > y = base.dists.hypergeometric.pmf( 2.0, 8, 4, 2 )\n ~0.214\n > y = base.dists.hypergeometric.pmf( 0.0, 8, 4, 2 )\n ~0.214\n > y = base.dists.hypergeometric.pmf( 1.5, 8, 4, 2 )\n 0.0\n\n > y = base.dists.hypergeometric.pmf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.pmf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 5, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.pmf.factory( N, K, n )\n Returns a function for evaluating the probability mass function (PMF) of a\n hypergeometric distribution with population size `N`, subpopulation size\n `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.hypergeometric.pmf.factory( 30, 20, 5 );\n > var y = myPMF( 4.0 )\n ~0.34\n > y = myPMF( 1.0 )\n ~0.029\n\n",
"base.dists.hypergeometric.quantile": "\nbase.dists.hypergeometric.quantile( p, N, K, n )\n Evaluates the quantile function for a hypergeometric distribution with\n population size `N`, subpopulation size `K`, and number of draws `n` at a\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.quantile( 0.4, 40, 20, 10 )\n 5\n > y = base.dists.hypergeometric.quantile( 0.8, 60, 40, 20 )\n 15\n > y = base.dists.hypergeometric.quantile( 0.5, 100, 10, 10 )\n 1\n > y = base.dists.hypergeometric.quantile( 0.0, 100, 40, 20 )\n 0\n > y = base.dists.hypergeometric.quantile( 1.0, 100, 40, 20 )\n 20\n\n > y = base.dists.hypergeometric.quantile( NaN, 40, 20, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, NaN, 20, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, 40, NaN, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, 40, 20, NaN )\n NaN\n\n\nbase.dists.hypergeometric.quantile.factory( N, K, n )\n Returns a function for evaluating the quantile function of a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.hypergeometric.quantile.factory( 100, 20, 10 );\n > var y = myQuantile( 0.2 )\n 1\n > y = myQuantile( 0.9 )\n 4\n\n",
"base.dists.hypergeometric.skewness": "\nbase.dists.hypergeometric.skewness( N, K, n )\n Returns the skewness of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.skewness( 16, 11, 4 )\n ~-0.258\n > v = base.dists.hypergeometric.skewness( 4, 2, 2 )\n 0.0\n\n > v = base.dists.hypergeometric.skewness( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.skewness( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.stdev": "\nbase.dists.hypergeometric.stdev( N, K, n )\n Returns the standard deviation of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.stdev( 16, 11, 4 )\n ~0.829\n > v = base.dists.hypergeometric.stdev( 2, 1, 1 )\n 0.5\n\n > v = base.dists.hypergeometric.stdev( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.stdev( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.variance": "\nbase.dists.hypergeometric.variance( N, K, n )\n Returns the variance of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.variance( 16, 11, 4 )\n ~0.688\n > v = base.dists.hypergeometric.variance( 2, 1, 1 )\n 0.25\n\n > v = base.dists.hypergeometric.variance( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.variance( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.variance( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 20, 10, NaN )\n NaN\n\n",
"base.dists.invgamma.cdf": "\nbase.dists.invgamma.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for an inverse gamma\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.cdf( 2.0, 1.0, 1.0 )\n ~0.607\n > y = base.dists.invgamma.cdf( 2.0, 3.0, 1.0 )\n ~0.986\n > y = base.dists.invgamma.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.invgamma.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.invgamma.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.invgamma.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.invgamma.cdf( 2.0, -1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an inverse gamma distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.invgamma.cdf.factory( 2.0, 0.5 );\n > var y = myCDF( 0.5 )\n ~0.736\n > y = myCDF( 2.0 )\n ~0.974\n\n",
"base.dists.invgamma.entropy": "\nbase.dists.invgamma.entropy( α, β )\n Returns the differential entropy of an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.invgamma.entropy( 1.0, 1.0 )\n ~2.154\n > v = base.dists.invgamma.entropy( 4.0, 12.0 )\n ~1.996\n > v = base.dists.invgamma.entropy( 8.0, 2.0 )\n ~-0.922\n\n",
"base.dists.invgamma.InvGamma": "\nbase.dists.invgamma.InvGamma( [α, β] )\n Returns an inverse gamma distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n invgamma: Object\n Distribution instance.\n\n invgamma.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n invgamma.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n invgamma.entropy: number\n Read-only property which returns the differential entropy.\n\n invgamma.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n invgamma.mean: number\n Read-only property which returns the expected value.\n\n invgamma.mode: number\n Read-only property which returns the mode.\n\n invgamma.skewness: number\n Read-only property which returns the skewness.\n\n invgamma.stdev: number\n Read-only property which returns the standard deviation.\n\n invgamma.variance: number\n Read-only property which returns the variance.\n\n invgamma.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n invgamma.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n invgamma.pdf: Function\n Evaluates the probability density function (PDF).\n\n invgamma.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var invgamma = base.dists.invgamma.InvGamma( 6.0, 5.0 );\n > invgamma.alpha\n 6.0\n > invgamma.beta\n 5.0\n > invgamma.entropy\n ~0.454\n > invgamma.kurtosis\n 19.0\n > invgamma.mean\n 1.0\n > invgamma.mode\n ~0.714\n > invgamma.skewness\n ~2.667\n > invgamma.stdev\n 0.5\n > invgamma.variance\n 0.25\n > invgamma.cdf( 0.8 )\n ~0.406\n > invgamma.pdf( 1.0 )\n ~0.877\n > invgamma.logpdf( 1.0 )\n ~-0.131\n > invgamma.quantile( 0.8 )\n ~1.281\n\n",
"base.dists.invgamma.kurtosis": "\nbase.dists.invgamma.kurtosis( α, β )\n Returns the excess kurtosis of an inverse gamma distribution.\n\n If `α <= 4` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.invgamma.kurtosis( 7.0, 5.0 )\n 12.0\n > v = base.dists.invgamma.kurtosis( 6.0, 12.0 )\n 19.0\n > v = base.dists.invgamma.kurtosis( 8.0, 2.0 )\n ~8.7\n\n",
"base.dists.invgamma.logpdf": "\nbase.dists.invgamma.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an inverse gamma distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.logpdf( 2.0, 0.5, 1.0 )\n ~-2.112\n > y = base.dists.invgamma.logpdf( 0.2, 1.0, 1.0 )\n ~-1.781\n > y = base.dists.invgamma.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.invgamma.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.logpdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.invgamma.logpdf( 2.0, -1.0, 1.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.invgamma.logpdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) for an inverse gamma distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.invgamma.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 2.0 )\n ~-1.464\n\n",
"base.dists.invgamma.mean": "\nbase.dists.invgamma.mean( α, β )\n Returns the expected value of an inverse gamma distribution.\n\n If `α <= 1` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.invgamma.mean( 4.0, 12.0 )\n 4.0\n > v = base.dists.invgamma.mean( 8.0, 2.0 )\n ~0.286\n\n",
"base.dists.invgamma.mode": "\nbase.dists.invgamma.mode( α, β )\n Returns the mode of an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.invgamma.mode( 1.0, 1.0 )\n 0.5\n > v = base.dists.invgamma.mode( 4.0, 12.0 )\n 2.4\n > v = base.dists.invgamma.mode( 8.0, 2.0 )\n ~0.222\n\n",
"base.dists.invgamma.pdf": "\nbase.dists.invgamma.pdf( x, α, β )\n Evaluates the probability density function (PDF) for an inverse gamma\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.pdf( 2.0, 0.5, 1.0 )\n ~0.121\n > y = base.dists.invgamma.pdf( 0.2, 1.0, 1.0 )\n ~0.168\n > y = base.dists.invgamma.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.invgamma.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.pdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.invgamma.pdf( 2.0, -1.0, 1.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.invgamma.pdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF)\n of an inverse gamma distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.invgamma.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 2.0 )\n ~0.231\n\n",
"base.dists.invgamma.quantile": "\nbase.dists.invgamma.quantile( p, α, β )\n Evaluates the quantile function for an inverse gamma distribution with shape\n parameter `α` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.invgamma.quantile( 0.8, 2.0, 1.0 )\n ~1.213\n > y = base.dists.invgamma.quantile( 0.5, 4.0, 2.0 )\n ~0.545\n > y = base.dists.invgamma.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.invgamma.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( 0.0, 1.0, NaN )\n NaN\n\n // Non-positive shape parameter:\n > y = base.dists.invgamma.quantile( 0.5, -1.0, 1.0 )\n NaN\n\n // Non-positive rate parameter:\n > y = base.dists.invgamma.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of an inverse gamma\n distribution with shape parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.invgamma.quantile.factory( 2.0, 2.0 );\n > var y = myQuantile( 0.8 )\n ~2.426\n > y = myQuantile( 0.4 )\n ~0.989\n\n",
"base.dists.invgamma.skewness": "\nbase.dists.invgamma.skewness( α, β )\n Returns the skewness of an inverse gamma distribution.\n\n If `α <= 3` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.invgamma.skewness( 4.0, 12.0 )\n ~5.657\n > v = base.dists.invgamma.skewness( 8.0, 2.0 )\n ~1.96\n\n",
"base.dists.invgamma.stdev": "\nbase.dists.invgamma.stdev( α, β )\n Returns the standard deviation of an inverse gamma distribution.\n\n If `α <= 2` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.invgamma.stdev( 5.0, 7.0 )\n ~1.01\n > v = base.dists.invgamma.stdev( 4.0, 12.0 )\n ~2.828\n > v = base.dists.invgamma.stdev( 8.0, 2.0 )\n ~0.117\n\n",
"base.dists.invgamma.variance": "\nbase.dists.invgamma.variance( α, β )\n Returns the variance of an inverse gamma distribution.\n\n If `α <= 2` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.invgamma.variance( 5.0, 7.0 )\n ~1.021\n > v = base.dists.invgamma.variance( 4.0, 12.0 )\n 8.0\n > v = base.dists.invgamma.variance( 8.0, 2.0 )\n ~0.014\n\n",
"base.dists.kumaraswamy.cdf": "\nbase.dists.kumaraswamy.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for Kumaraswamy's\n double bounded distribution with first shape parameter `a` and second shape\n parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.cdf( 0.5, 1.0, 1.0 )\n ~0.5\n > y = base.dists.kumaraswamy.cdf( 0.5, 2.0, 4.0 )\n ~0.684\n > y = base.dists.kumaraswamy.cdf( 0.2, 2.0, 2.0 )\n ~0.078\n > y = base.dists.kumaraswamy.cdf( 0.8, 4.0, 4.0 )\n ~0.878\n > y = base.dists.kumaraswamy.cdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.kumaraswamy.cdf( 1.5, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.kumaraswamy.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Kumaraswamy's double bounded distribution with first shape parameter\n `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.kumaraswamy.cdf.factory( 0.5, 1.0 );\n > var y = mycdf( 0.8 )\n ~0.894\n > y = mycdf( 0.3 )\n ~0.548\n\n",
"base.dists.kumaraswamy.Kumaraswamy": "\nbase.dists.kumaraswamy.Kumaraswamy( [a, b] )\n Returns a Kumaraswamy's double bounded distribution object.\n\n Parameters\n ----------\n a: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n b: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n kumaraswamy: Object\n Distribution instance.\n\n kumaraswamy.a: number\n First shape parameter. If set, the value must be greater than `0`.\n\n kumaraswamy.b: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n kumaraswamy.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n kumaraswamy.mean: number\n Read-only property which returns the expected value.\n\n kumaraswamy.mode: number\n Read-only property which returns the mode.\n\n kumaraswamy.skewness: number\n Read-only property which returns the skewness.\n\n kumaraswamy.stdev: number\n Read-only property which returns the standard deviation.\n\n kumaraswamy.variance: number\n Read-only property which returns the variance.\n\n kumaraswamy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n kumaraswamy.pdf: Function\n Evaluates the probability density function (PDF).\n\n kumaraswamy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var kumaraswamy = base.dists.kumaraswamy.Kumaraswamy( 6.0, 5.0 );\n > kumaraswamy.a\n 6.0\n > kumaraswamy.b\n 5.0\n > kumaraswamy.kurtosis\n ~3.194\n > kumaraswamy.mean\n ~0.696\n > kumaraswamy.mode\n ~0.746\n > kumaraswamy.skewness\n ~-0.605\n > kumaraswamy.stdev\n ~0.126\n > kumaraswamy.variance\n ~0.016\n > kumaraswamy.cdf( 0.8 )\n ~0.781\n > kumaraswamy.pdf( 1.0 )\n ~0.0\n > kumaraswamy.quantile( 0.8 )\n ~0.807\n\n",
"base.dists.kumaraswamy.kurtosis": "\nbase.dists.kumaraswamy.kurtosis( a, b )\n Returns the excess kurtosis of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.kurtosis( 1.0, 1.0 )\n ~1.8\n > v = base.dists.kumaraswamy.kurtosis( 4.0, 12.0 )\n ~2.704\n > v = base.dists.kumaraswamy.kurtosis( 16.0, 8.0 )\n ~4.311\n\n",
"base.dists.kumaraswamy.logcdf": "\nbase.dists.kumaraswamy.logcdf( x, a, b )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for Kumaraswamy's double bounded distribution with first shape\n parameter `a` and second shape parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.logcdf( 0.5, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.kumaraswamy.logcdf( 0.5, 2.0, 4.0 )\n ~-0.38\n > y = base.dists.kumaraswamy.logcdf( 0.2, 2.0, 2.0 )\n ~-2.546\n > y = base.dists.kumaraswamy.logcdf( 0.8, 4.0, 4.0 )\n ~-0.13\n > y = base.dists.kumaraswamy.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.kumaraswamy.logcdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.kumaraswamy.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.logcdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Kumaraswamy's double bounded distribution\n with first shape parameter `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.kumaraswamy.logcdf.factory( 0.5, 1.0 );\n > var y = mylogcdf( 0.8 )\n ~-0.112\n > y = mylogcdf( 0.3 )\n ~-0.602\n\n",
"base.dists.kumaraswamy.logpdf": "\nbase.dists.kumaraswamy.logpdf( x, a, b )\n Evaluates the natural logarithm of the probability density function (PDF)\n for Kumaraswamy's double bounded distribution with first shape parameter `a`\n and second shape parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.logpdf( 0.5, 1.0, 1.0 )\n 0.0\n > y = base.dists.kumaraswamy.logpdf( 0.5, 2.0, 4.0 )\n ~0.523\n > y = base.dists.kumaraswamy.logpdf( 0.2, 2.0, 2.0 )\n ~-0.264\n > y = base.dists.kumaraswamy.logpdf( 0.8, 4.0, 4.0 )\n ~0.522\n > y = base.dists.kumaraswamy.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.kumaraswamy.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.kumaraswamy.logpdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.logpdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a Kumaraswamy's double bounded distribution with\n first shape parameter `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.kumaraswamy.logpdf.factory( 0.5, 1.0 );\n > var y = mylogpdf( 0.8 )\n ~-0.582\n > y = mylogpdf( 0.3 )\n ~-0.091\n\n",
"base.dists.kumaraswamy.mean": "\nbase.dists.kumaraswamy.mean( a, b )\n Returns the mean of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mean.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.mean( 1.5, 1.5 )\n ~0.512\n > v = base.dists.kumaraswamy.mean( 4.0, 12.0 )\n ~0.481\n > v = base.dists.kumaraswamy.mean( 16.0, 8.0 )\n ~0.846\n\n",
"base.dists.kumaraswamy.median": "\nbase.dists.kumaraswamy.median( a, b )\n Returns the median of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.median( 1.0, 1.0 )\n 0.5\n > v = base.dists.kumaraswamy.median( 4.0, 12.0 )\n ~0.487\n > v = base.dists.kumaraswamy.median( 16.0, 8.0 )\n ~0.856\n\n",
"base.dists.kumaraswamy.mode": "\nbase.dists.kumaraswamy.mode( a, b )\n Returns the mode of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a < 1`, `b < 1`, or `a = b = 1`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.mode( 1.5, 1.5 )\n ~0.543\n > v = base.dists.kumaraswamy.mode( 4.0, 12.0 )\n ~0.503\n > v = base.dists.kumaraswamy.mode( 16.0, 8.0 )\n ~0.875\n\n",
"base.dists.kumaraswamy.pdf": "\nbase.dists.kumaraswamy.pdf( x, a, b )\n Evaluates the probability density function (PDF) for Kumaraswamy's double\n bounded distribution with first shape parameter `a` and second shape\n parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.pdf( 0.5, 1.0, 1.0 )\n 1.0\n > y = base.dists.kumaraswamy.pdf( 0.5, 2.0, 4.0 )\n ~1.688\n > y = base.dists.kumaraswamy.pdf( 0.2, 2.0, 2.0 )\n ~0.768\n > y = base.dists.kumaraswamy.pdf( 0.8, 4.0, 4.0 )\n ~1.686\n > y = base.dists.kumaraswamy.pdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.kumaraswamy.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.kumaraswamy.pdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF)\n of a Kumaraswamy's double bounded distribution with first shape parameter\n `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.kumaraswamy.pdf.factory( 0.5, 1.0 );\n > var y = mypdf( 0.8 )\n ~0.559\n > y = mypdf( 0.3 )\n ~0.913\n\n",
"base.dists.kumaraswamy.quantile": "\nbase.dists.kumaraswamy.quantile( p, a, b )\n Evaluates the quantile function for a Kumaraswamy's double bounded\n distribution with first shape parameter `a` and second shape parameter `b`\n at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.quantile( 0.5, 1.0, 1.0 )\n 0.5\n > y = base.dists.kumaraswamy.quantile( 0.5, 2.0, 4.0 )\n ~0.399\n > y = base.dists.kumaraswamy.quantile( 0.2, 2.0, 2.0 )\n ~0.325\n > y = base.dists.kumaraswamy.quantile( 0.8, 4.0, 4.0 )\n ~0.759\n\n > y = base.dists.kumaraswamy.quantile( -0.5, 4.0, 2.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 1.5, 4.0, 2.0 )\n NaN\n\n > y = base.dists.kumaraswamy.quantile( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a Kumaraswamy's\n double bounded distribution with first shape parameter `a` and second shape\n parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.kumaraswamy.quantile.factory( 0.5, 1.0 );\n > var y = myQuantile( 0.8 )\n ~0.64\n > y = myQuantile( 0.3 )\n ~0.09\n\n",
"base.dists.kumaraswamy.skewness": "\nbase.dists.kumaraswamy.skewness( a, b )\n Returns the skewness of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.skewness( 1.0, 1.0 )\n ~1.154e-15\n > v = base.dists.kumaraswamy.skewness( 4.0, 12.0 )\n ~-0.201\n > v = base.dists.kumaraswamy.skewness( 16.0, 8.0 )\n ~-0.94\n\n",
"base.dists.kumaraswamy.stdev": "\nbase.dists.kumaraswamy.stdev( a, b )\n Returns the standard deviation of a Kumaraswamy's double bounded\n distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.stdev( 1.0, 1.0 )\n ~0.289\n > v = base.dists.kumaraswamy.stdev( 4.0, 12.0 )\n ~0.13\n > v = base.dists.kumaraswamy.stdev( 16.0, 8.0 )\n ~0.062\n\n",
"base.dists.kumaraswamy.variance": "\nbase.dists.kumaraswamy.variance( a, b )\n Returns the variance of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.variance( 1.0, 1.0 )\n ~0.083\n > v = base.dists.kumaraswamy.variance( 4.0, 12.0 )\n ~0.017\n > v = base.dists.kumaraswamy.variance( 16.0, 8.0 )\n ~0.004\n\n",
"base.dists.laplace.cdf": "\nbase.dists.laplace.cdf( x, μ, b )\n Evaluates the cumulative distribution function (CDF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.laplace.cdf( 2.0, 0.0, 1.0 )\n ~0.932\n > y = base.dists.laplace.cdf( 5.0, 10.0, 3.0 )\n ~0.094\n > y = base.dists.laplace.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.cdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.cdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.cdf.factory( μ, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.laplace.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.965\n > y = myCDF( 2.0 )\n 0.5\n\n",
"base.dists.laplace.entropy": "\nbase.dists.laplace.entropy( μ, b )\n Returns the differential entropy of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var y = base.dists.laplace.entropy( 0.0, 1.0 )\n ~1.693\n > y = base.dists.laplace.entropy( 4.0, 2.0 )\n ~2.386\n > y = base.dists.laplace.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.entropy( 0.0, NaN )\n NaN\n > y = base.dists.laplace.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.kurtosis": "\nbase.dists.laplace.kurtosis( μ, b )\n Returns the excess kurtosis of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.laplace.kurtosis( 0.0, 1.0 )\n 3.0\n > y = base.dists.laplace.kurtosis( 4.0, 2.0 )\n 3.0\n > y = base.dists.laplace.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.laplace.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.Laplace": "\nbase.dists.laplace.Laplace( [μ, b] )\n Returns a Laplace distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n b: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n laplace: Object\n Distribution instance.\n\n laplace.mu: number\n Location parameter.\n\n laplace.b: number\n Scale parameter. If set, the value must be greater than `0`.\n\n laplace.entropy: number\n Read-only property which returns the differential entropy.\n\n laplace.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n laplace.mean: number\n Read-only property which returns the expected value.\n\n laplace.median: number\n Read-only property which returns the median.\n\n laplace.mode: number\n Read-only property which returns the mode.\n\n laplace.skewness: number\n Read-only property which returns the skewness.\n\n laplace.stdev: number\n Read-only property which returns the standard deviation.\n\n laplace.variance: number\n Read-only property which returns the variance.\n\n laplace.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n laplace.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n laplace.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n laplace.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n laplace.pdf: Function\n Evaluates the probability density function (PDF).\n\n laplace.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var laplace = base.dists.laplace.Laplace( -2.0, 3.0 );\n > laplace.mu\n -2.0\n > laplace.b\n 3.0\n > laplace.entropy\n ~2.792\n > laplace.kurtosis\n 3.0\n > laplace.mean\n -2.0\n > laplace.median\n -2.0\n > laplace.mode\n -2.0\n > laplace.skewness\n 0.0\n > laplace.stdev\n ~4.243\n > laplace.variance\n 18.0\n > laplace.cdf( 0.8 )\n ~0.803\n > laplace.logcdf( 0.8 )\n ~-0.219\n > laplace.logpdf( 1.0 )\n ~-2.792\n > laplace.mgf( 0.2 )\n ~1.047\n > laplace.pdf( 2.0 )\n ~0.044\n > laplace.quantile( 0.9 )\n ~2.828\n\n",
"base.dists.laplace.logcdf": "\nbase.dists.laplace.logcdf( x, μ, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Laplace distribution with scale parameter `b` and location parameter `μ` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.laplace.logcdf( 2.0, 0.0, 1.0 )\n ~-0.07\n > y = base.dists.laplace.logcdf( 5.0, 10.0, 3.0 )\n ~-2.36\n > y = base.dists.laplace.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.logcdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.logcdf.factory( μ, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Laplace distribution with scale parameter\n `b` and location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.laplace.logcdf.factory( 2.0, 3.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.035\n > y = mylogcdf( 2.0 )\n ~-0.693\n\n",
"base.dists.laplace.logpdf": "\nbase.dists.laplace.logpdf( x, μ, b )\n Evaluates the logarithm of the probability density function (PDF) for a\n Laplace distribution with scale parameter `b` and location parameter `μ` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.laplace.logpdf( 2.0, 0.0, 1.0 )\n ~-2.693\n > y = base.dists.laplace.logpdf( -1.0, 2.0, 3.0 )\n ~-2.792\n > y = base.dists.laplace.logpdf( 2.5, 2.0, 3.0 )\n ~-1.958\n > y = base.dists.laplace.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.logpdf.factory( μ, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Laplace distribution with scale parameter `b` and\n location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.laplace.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-1.386\n\n",
"base.dists.laplace.mean": "\nbase.dists.laplace.mean( μ, b )\n Returns the expected value of a Laplace distribution with location parameter\n `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.laplace.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.mean( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mean( 0.0, NaN )\n NaN\n > y = base.dists.laplace.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.median": "\nbase.dists.laplace.median( μ, b )\n Returns the median of a Laplace distribution with location parameter `μ` and\n scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.laplace.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.median( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.median( 0.0, NaN )\n NaN\n > y = base.dists.laplace.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.mgf": "\nbase.dists.laplace.mgf( t, μ, b )\n Evaluates the moment-generating function (MGF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.laplace.mgf( 0.5, 0.0, 1.0 )\n ~1.333\n > y = base.dists.laplace.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.laplace.mgf( -1.0, 4.0, 0.2 )\n ~0.019\n > y = base.dists.laplace.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mgf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.laplace.mgf( 1.0, 0.0, 2.0 )\n NaN\n > y = base.dists.laplace.mgf( -0.5, 0.0, 4.0 )\n NaN\n > y = base.dists.laplace.mgf( 2.0, 0.0, 0.0 )\n NaN\n > y = base.dists.laplace.mgf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.mgf.factory( μ, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.laplace.mgf.factory( 4.0, 2.0 );\n > var y = mymgf( 0.2 )\n ~2.649\n > y = mymgf( 0.4 )\n ~13.758\n\n",
"base.dists.laplace.mode": "\nbase.dists.laplace.mode( μ, b )\n Returns the mode of a Laplace distribution with location parameter `μ` and\n scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.laplace.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.mode( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mode( 0.0, NaN )\n NaN\n > y = base.dists.laplace.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.pdf": "\nbase.dists.laplace.pdf( x, μ, b )\n Evaluates the probability density function (PDF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.laplace.pdf( 2.0, 0.0, 1.0 )\n ~0.068\n > y = base.dists.laplace.pdf( -1.0, 2.0, 3.0 )\n ~0.061\n > y = base.dists.laplace.pdf( 2.5, 2.0, 3.0 )\n ~0.141\n > y = base.dists.laplace.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.pdf.factory( μ, b )\n Returns a function for evaluating the probability density function (PDF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.laplace.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n 0.25\n\n",
"base.dists.laplace.quantile": "\nbase.dists.laplace.quantile( p, μ, b )\n Evaluates the quantile function for a Laplace distribution with scale\n parameter `b` and location parameter `μ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.laplace.quantile( 0.8, 0.0, 1.0 )\n ~0.916\n > y = base.dists.laplace.quantile( 0.5, 4.0, 2.0 )\n 4.0\n\n > y = base.dists.laplace.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.laplace.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.laplace.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.quantile.factory( μ, b )\n Returns a function for evaluating the quantile function of a Laplace\n distribution with scale parameter `b` and location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.laplace.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n > y = myQuantile( 0.8 )\n ~11.833\n\n",
"base.dists.laplace.skewness": "\nbase.dists.laplace.skewness( μ, b )\n Returns the skewness of a Laplace distribution with location parameter `μ`\n and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.laplace.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.laplace.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.skewness( 0.0, NaN )\n NaN\n > y = base.dists.laplace.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.stdev": "\nbase.dists.laplace.stdev( μ, b )\n Returns the standard deviation of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.laplace.stdev( 0.0, 1.0 )\n ~1.414\n > y = base.dists.laplace.stdev( 4.0, 2.0 )\n ~2.828\n > y = base.dists.laplace.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.stdev( 0.0, NaN )\n NaN\n > y = base.dists.laplace.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.variance": "\nbase.dists.laplace.variance( μ, b )\n Returns the variance of a Laplace distribution with location parameter `μ`\n and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.laplace.variance( 0.0, 1.0 )\n 2.0\n > y = base.dists.laplace.variance( 4.0, 2.0 )\n 8.0\n > y = base.dists.laplace.variance( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.variance( 0.0, NaN )\n NaN\n > y = base.dists.laplace.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.cdf": "\nbase.dists.levy.cdf( x, μ, c )\n Evaluates the cumulative distribution function (CDF) for a Lévy distribution\n with location parameter `μ` and scale parameter `c` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.levy.cdf( 2.0, 0.0, 1.0 )\n ~0.48\n > y = base.dists.levy.cdf( 12.0, 10.0, 3.0 )\n ~0.221\n > y = base.dists.levy.cdf( 9.0, 10.0, 3.0 )\n 0.0\n > y = base.dists.levy.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.cdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.levy.cdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.cdf.factory( μ, c )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Lévy distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.levy.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.54\n > y = myCDF( 2.0 )\n 0.0\n\n",
"base.dists.levy.entropy": "\nbase.dists.levy.entropy( μ, c )\n Returns the entropy of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.levy.entropy( 0.0, 1.0 )\n ~3.324\n > y = base.dists.levy.entropy( 4.0, 2.0 )\n ~4.018\n > y = base.dists.levy.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.levy.entropy( 0.0, NaN )\n NaN\n > y = base.dists.levy.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.Levy": "\nbase.dists.levy.Levy( [μ, c] )\n Returns a Lévy distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n c: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n levy: Object\n Distribution instance.\n\n levy.mu: number\n Location parameter.\n\n levy.c: number\n Scale parameter. If set, the value must be greater than `0`.\n\n levy.entropy: number\n Read-only property which returns the differential entropy.\n\n levy.mean: number\n Read-only property which returns the expected value.\n\n levy.median: number\n Read-only property which returns the median.\n\n levy.mode: number\n Read-only property which returns the mode.\n\n levy.stdev: number\n Read-only property which returns the standard deviation.\n\n levy.variance: number\n Read-only property which returns the variance.\n\n levy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n levy.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n levy.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n levy.pdf: Function\n Evaluates the probability density function (PDF).\n\n levy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var levy = base.dists.levy.Levy( -2.0, 3.0 );\n > levy.mu\n -2.0\n > levy.c\n 3.0\n > levy.entropy\n ~4.423\n > levy.mean\n Infinity\n > levy.median\n ~4.594\n > levy.mode\n -1.0\n > levy.stdev\n Infinity\n > levy.variance\n Infinity\n > levy.cdf( 0.8 )\n ~0.3\n > levy.logcdf( 0.8 )\n ~-1.2\n > levy.logpdf( 1.0 )\n ~-2.518\n > levy.pdf( 1.0 )\n ~0.081\n > levy.quantile( 0.8 )\n ~44.74\n\n",
"base.dists.levy.logcdf": "\nbase.dists.levy.logcdf( x, μ, c )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Lévy distribution with location parameter `μ` and scale parameter `c` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.levy.logcdf( 2.0, 0.0, 1.0 )\n ~-0.735\n > y = base.dists.levy.logcdf( 12.0, 10.0, 3.0 )\n ~-1.51\n > y = base.dists.levy.logcdf( 9.0, 10.0, 3.0 )\n -Infinity\n > y = base.dists.levy.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.levy.logcdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.logcdf.factory( μ, c )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Lévy distribution with location parameter\n `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.levy.logcdf.factory( 2.0, 3.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.616\n > y = mylogcdf( 2.0 )\n -Infinity\n\n",
"base.dists.levy.logpdf": "\nbase.dists.levy.logpdf( x, μ, c )\n Evaluates the logarithm of the probability density function (PDF) for a Lévy\n distribution with location parameter `μ` and scale parameter `c` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.levy.logpdf( 2.0, 0.0, 1.0 )\n ~-2.209\n > y = base.dists.levy.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.levy.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.logpdf.factory( μ, c )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Lévy distribution with location parameter `μ` and scale\n parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.levy.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 11.0 )\n ~-1.572\n\n",
"base.dists.levy.mean": "\nbase.dists.levy.mean( μ, c )\n Returns the expected value of a Lévy distribution with location parameter\n `μ` and scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.levy.mean( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.mean( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.mean( NaN, 1.0 )\n NaN\n > y = base.dists.levy.mean( 0.0, NaN )\n NaN\n > y = base.dists.levy.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.median": "\nbase.dists.levy.median( μ, c )\n Returns the median of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.levy.median( 0.0, 1.0 )\n ~2.198\n > y = base.dists.levy.median( 4.0, 3.0 )\n ~10.594\n > y = base.dists.levy.median( NaN, 1.0 )\n NaN\n > y = base.dists.levy.median( 0.0, NaN )\n NaN\n > y = base.dists.levy.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.mode": "\nbase.dists.levy.mode( μ, c )\n Returns the mode of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.levy.mode( 0.0, 1.0 )\n ~0.333\n > y = base.dists.levy.mode( 4.0, 3.0 )\n 5.0\n > y = base.dists.levy.mode( NaN, 1.0 )\n NaN\n > y = base.dists.levy.mode( 0.0, NaN )\n NaN\n > y = base.dists.levy.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.pdf": "\nbase.dists.levy.pdf( x, μ, c )\n Evaluates the probability density function (PDF) for a Lévy distribution\n with location parameter `μ` and scale parameter `c` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.levy.pdf( 2.0, 0.0, 1.0 )\n ~0.11\n > y = base.dists.levy.pdf( -1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.levy.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.pdf.factory( μ, c )\n Returns a function for evaluating the probability density function (PDF) of\n a Lévy distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.levy.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 11.0 )\n ~0.208\n\n",
"base.dists.levy.quantile": "\nbase.dists.levy.quantile( p, μ, c )\n Evaluates the quantile function for a Lévy distribution with location\n parameter `μ` and scale parameter `c` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.levy.quantile( 0.8, 0.0, 1.0 )\n ~15.58\n > y = base.dists.levy.quantile( 0.5, 4.0, 2.0 )\n ~8.396\n\n > y = base.dists.levy.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.levy.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.levy.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.quantile.factory( μ, c )\n Returns a function for evaluating the quantile function of a Lévy\n distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.levy.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n ~14.396\n\n",
"base.dists.levy.stdev": "\nbase.dists.levy.stdev( μ, c )\n Returns the standard deviation of a Lévy distribution with location\n parameter `μ` and scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.levy.stdev( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.stdev( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.levy.stdev( 0.0, NaN )\n NaN\n > y = base.dists.levy.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.variance": "\nbase.dists.levy.variance( μ, c )\n Returns the variance of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.levy.variance( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.variance( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.variance( NaN, 1.0 )\n NaN\n > y = base.dists.levy.variance( 0.0, NaN )\n NaN\n > y = base.dists.levy.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.cdf": "\nbase.dists.logistic.cdf( x, μ, s )\n Evaluates the cumulative distribution function (CDF) for a logistic\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.logistic.cdf( 2.0, 0.0, 1.0 )\n ~0.881\n > y = base.dists.logistic.cdf( 5.0, 10.0, 3.0 )\n ~0.159\n\n > y = base.dists.logistic.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.logistic.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.logistic.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.logistic.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.logistic.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.logistic.cdf.factory( μ, s )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a logistic distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.logistic.cdf.factory( 3.0, 1.5 );\n > var y = mycdf( 1.0 )\n ~0.209\n\n",
"base.dists.logistic.entropy": "\nbase.dists.logistic.entropy( μ, s )\n Returns the entropy of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.logistic.entropy( 0.0, 1.0 )\n 2.0\n > y = base.dists.logistic.entropy( 4.0, 2.0 )\n ~2.693\n > y = base.dists.logistic.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.entropy( 0.0, NaN )\n NaN\n > y = base.dists.logistic.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.kurtosis": "\nbase.dists.logistic.kurtosis( μ, s )\n Returns the excess kurtosis of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.logistic.kurtosis( 0.0, 1.0 )\n 1.2\n > y = base.dists.logistic.kurtosis( 4.0, 2.0 )\n 1.2\n > y = base.dists.logistic.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.logistic.kurtosis( 0.0, 0.0 )\n NaN\n\n\n",
"base.dists.logistic.logcdf": "\nbase.dists.logistic.logcdf( x, μ, s )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n logistic distribution with location parameter `μ` and scale parameter `s` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.logistic.logcdf( 2.0, 0.0, 1.0 )\n ~-0.127\n > y = base.dists.logistic.logcdf( 5.0, 10.0, 3.0 )\n ~-1.84\n > y = base.dists.logistic.logcdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.logistic.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.logcdf( NaN, 0.0, 1.0 )\n NaN\n\n\nbase.dists.logistic.logcdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.logistic.logcdf.factory( 3.0, 1.5 );\n > var y = mylogcdf( 1.0 )\n ~-1.567\n\n",
"base.dists.logistic.Logistic": "\nbase.dists.logistic.Logistic( [μ, s] )\n Returns a logistic distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n logistic: Object\n Distribution instance.\n\n logistic.mu: number\n Location parameter.\n\n logistic.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n logistic.entropy: number\n Read-only property which returns the differential entropy.\n\n logistic.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n logistic.mean: number\n Read-only property which returns the expected value.\n\n logistic.median: number\n Read-only property which returns the median.\n\n logistic.mode: number\n Read-only property which returns the mode.\n\n logistic.skewness: number\n Read-only property which returns the skewness.\n\n logistic.stdev: number\n Read-only property which returns the standard deviation.\n\n logistic.variance: number\n Read-only property which returns the variance.\n\n logistic.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n logistic.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n logistic.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n logistic.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n logistic.pdf: Function\n Evaluates the probability density function (PDF).\n\n logistic.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var logistic = base.dists.logistic.Logistic( -2.0, 3.0 );\n > logistic.mu\n -2.0\n > logistic.s\n 3.0\n > logistic.entropy\n ~3.1\n > logistic.kurtosis\n 1.2\n > logistic.mean\n -2.0\n > logistic.median\n -2.0\n > logistic.mode\n -2.0\n > logistic.skewness\n 0.0\n > logistic.stdev\n ~5.441\n > logistic.variance\n ~29.609\n > logistic.cdf( 0.8 )\n ~0.718\n > logistic.logcdf( 0.8 )\n ~-0.332\n > logistic.logpdf( 2.0 )\n ~-2.9\n > logistic.mgf( 0.2 )\n ~1.329\n > logistic.pdf( 2.0 )\n ~0.055\n > logistic.quantile( 0.9 )\n ~4.592\n\n",
"base.dists.logistic.logpdf": "\nbase.dists.logistic.logpdf( x, μ, s )\n Evaluates the logarithm of the probability density function (PDF) for a\n logistic distribution with location parameter `μ` and scale parameter `s` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.logistic.logpdf( 2.0, 0.0, 1.0 )\n ~-2.254\n > y = base.dists.logistic.logpdf( -1.0, 4.0, 2.0 )\n ~-3.351\n > y = base.dists.logistic.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.logistic.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution at `s = 0.0`:\n > y = base.dists.logistic.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.logistic.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.logistic.logpdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Logistic distribution with location parameter `μ` and\n scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.logistic.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-2.079\n\n",
"base.dists.logistic.mean": "\nbase.dists.logistic.mean( μ, s )\n Returns the expected value of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.logistic.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.mean( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mean( 0.0, NaN )\n NaN\n > y = base.dists.logistic.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.median": "\nbase.dists.logistic.median( μ, s )\n Returns the median of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.logistic.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.median( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.median( 0.0, NaN )\n NaN\n > y = base.dists.logistic.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.mgf": "\nbase.dists.logistic.mgf( t, μ, s )\n Evaluates the moment-generating function (MGF) for a logistic distribution\n with location parameter `μ` and scale parameter `s` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.logistic.mgf( 0.9, 0.0, 1.0 )\n ~9.15\n > y = base.dists.logistic.mgf( 0.1, 4.0, 4.0 )\n ~1.971\n > y = base.dists.logistic.mgf( -0.2, 4.0, 4.0 )\n ~1.921\n > y = base.dists.logistic.mgf( 0.5, 0.0, -1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.5, 0.0, 4.0 )\n Infinity\n > y = base.dists.logistic.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.0, 0.0, NaN )\n NaN\n\n\nbase.dists.logistic.mgf.factory( μ, s )\n Returns a function for evaluating the moment-generating function (MGF)\n of a Logistic distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.logistic.mgf.factory( 10.0, 0.5 );\n > var y = mymgf( 0.5 )\n ~164.846\n > y = mymgf( 2.0 )\n Infinity\n\n",
"base.dists.logistic.mode": "\nbase.dists.logistic.mode( μ, s )\n Returns the mode of a logistic distribution with location parameter `μ` and\n scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.logistic.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.mode( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mode( 0.0, NaN )\n NaN\n > y = base.dists.logistic.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.pdf": "\nbase.dists.logistic.pdf( x, μ, s )\n Evaluates the probability density function (PDF) for a logistic distribution\n with location parameter `μ` and scale parameter `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.logistic.pdf( 2.0, 0.0, 1.0 )\n ~0.105\n > y = base.dists.logistic.pdf( -1.0, 4.0, 2.0 )\n ~0.035\n > y = base.dists.logistic.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.logistic.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.logistic.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.logistic.pdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.logistic.pdf.factory( μ, s )\n Returns a function for evaluating the probability density function (PDF) of\n a Logistic distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.logistic.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n 0.125\n\n",
"base.dists.logistic.quantile": "\nbase.dists.logistic.quantile( p, μ, s )\n Evaluates the quantile function for a logistic distribution with location\n parameter `μ` and scale parameter `s` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.logistic.quantile( 0.8, 0.0, 1.0 )\n ~1.386\n > y = base.dists.logistic.quantile( 0.5, 4.0, 2.0 )\n 4\n\n > y = base.dists.logistic.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.logistic.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.logistic.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.logistic.quantile.factory( μ, s )\n Returns a function for evaluating the quantile function of a logistic\n distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.logistic.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.logistic.skewness": "\nbase.dists.logistic.skewness( μ, s )\n Returns the skewness of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.logistic.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.logistic.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.skewness( 0.0, NaN )\n NaN\n > y = base.dists.logistic.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.stdev": "\nbase.dists.logistic.stdev( μ, s )\n Returns the standard deviation of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.logistic.stdev( 0.0, 1.0 )\n ~1.814\n > y = base.dists.logistic.stdev( 4.0, 2.0 )\n ~3.628\n > y = base.dists.logistic.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.stdev( 0.0, NaN )\n NaN\n > y = base.dists.logistic.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.variance": "\nbase.dists.logistic.variance( μ, s )\n Returns the variance of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.logistic.variance( 0.0, 1.0 )\n ~3.29\n > y = base.dists.logistic.variance( 4.0, 2.0 )\n ~13.159\n > y = base.dists.logistic.variance( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.variance( 0.0, NaN )\n NaN\n > y = base.dists.logistic.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.cdf": "\nbase.dists.lognormal.cdf( x, μ, σ )\n Evaluates the cumulative distribution function (CDF) for a lognormal\n distribution with location parameter `μ` and scale parameter `σ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.cdf( 2.0, 0.0, 1.0 )\n ~0.756\n > y = base.dists.lognormal.cdf( 5.0, 10.0, 3.0 )\n ~0.003\n\n > y = base.dists.lognormal.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.lognormal.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.cdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.cdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.cdf.factory( μ, σ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a lognormal distribution with location parameter `μ` and scale parameter\n `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.lognormal.cdf.factory( 3.0, 1.5 );\n > var y = myCDF( 1.0 )\n ~0.023\n > y = myCDF( 4.0 )\n ~0.141\n\n",
"base.dists.lognormal.entropy": "\nbase.dists.lognormal.entropy( μ, σ )\n Returns the differential entropy of a lognormal distribution with location\n `μ` and scale `σ` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.lognormal.entropy( 0.0, 1.0 )\n ~1.419\n > y = base.dists.lognormal.entropy( 5.0, 2.0 )\n ~7.112\n > y = base.dists.lognormal.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.entropy( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.kurtosis": "\nbase.dists.lognormal.kurtosis( μ, σ )\n Returns the excess kurtosis of a lognormal distribution with location `μ`\n and scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var y = base.dists.lognormal.kurtosis( 0.0, 1.0 )\n ~110.936\n > y = base.dists.lognormal.kurtosis( 5.0, 2.0 )\n ~9220556.977\n > y = base.dists.lognormal.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.LogNormal": "\nbase.dists.lognormal.LogNormal( [μ, σ] )\n Returns a lognormal distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n σ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n lognormal: Object\n Distribution instance.\n\n lognormal.mu: number\n Location parameter.\n\n lognormal.sigma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n lognormal.entropy: number\n Read-only property which returns the differential entropy.\n\n lognormal.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n lognormal.mean: number\n Read-only property which returns the expected value.\n\n lognormal.median: number\n Read-only property which returns the median.\n\n lognormal.mode: number\n Read-only property which returns the mode.\n\n lognormal.skewness: number\n Read-only property which returns the skewness.\n\n lognormal.stdev: number\n Read-only property which returns the standard deviation.\n\n lognormal.variance: number\n Read-only property which returns the variance.\n\n lognormal.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n lognormal.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n lognormal.pdf: Function\n Evaluates the probability density function (PDF).\n\n lognormal.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var lognormal = base.dists.lognormal.LogNormal( -2.0, 3.0 );\n > lognormal.mu\n -2.0\n > lognormal.sigma\n 3.0\n > lognormal.entropy\n ~0.518\n > lognormal.kurtosis\n 4312295840576300\n > lognormal.mean\n ~12.182\n > lognormal.median\n ~0.135\n > lognormal.mode\n ~0.0\n > lognormal.skewness\n ~729551.383\n > lognormal.stdev\n ~1096.565\n > lognormal.variance\n ~1202455.871\n > lognormal.cdf( 0.8 )\n ~0.723\n > lognormal.logpdf( 2.0 )\n ~-3.114\n > lognormal.pdf( 2.0 )\n ~0.044\n > lognormal.quantile( 0.9 )\n ~6.326\n\n",
"base.dists.lognormal.logpdf": "\nbase.dists.lognormal.logpdf( x, μ, σ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a lognormal distribution with location parameter `μ` and scale parameter\n `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.logpdf( 2.0, 0.0, 1.0 )\n ~-1.852\n > y = base.dists.lognormal.logpdf( 1.0, 0.0, 1.0 )\n ~-0.919\n > y = base.dists.lognormal.logpdf( 1.0, 3.0, 1.0 )\n ~-5.419\n > y = base.dists.lognormal.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.lognormal.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.logpdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.logpdf.factory( μ, σ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a lognormal distribution with location parameter\n `μ` and scale parameter `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.lognormal.logpdf.factory( 4.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-4.275\n > y = mylogPDF( 2.0 )\n ~-3.672\n\n",
"base.dists.lognormal.mean": "\nbase.dists.lognormal.mean( μ, σ )\n Returns the expected value of a lognormal distribution with location `μ` and\n scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.lognormal.mean( 0.0, 1.0 )\n ~1.649\n > y = base.dists.lognormal.mean( 4.0, 2.0 )\n ~403.429\n > y = base.dists.lognormal.mean( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.mean( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.median": "\nbase.dists.lognormal.median( μ, σ )\n Returns the median of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.lognormal.median( 0.0, 1.0 )\n 1.0\n > y = base.dists.lognormal.median( 5.0, 2.0 )\n ~148.413\n > y = base.dists.lognormal.median( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.median( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.mode": "\nbase.dists.lognormal.mode( μ, σ )\n Returns the mode of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.lognormal.mode( 0.0, 1.0 )\n ~0.368\n > y = base.dists.lognormal.mode( 5.0, 2.0 )\n ~2.718\n > y = base.dists.lognormal.mode( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.mode( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.pdf": "\nbase.dists.lognormal.pdf( x, μ, σ )\n Evaluates the probability density function (PDF) for a lognormal\n distribution with location parameter `μ` and scale parameter `σ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.pdf( 2.0, 0.0, 1.0 )\n ~0.157\n > y = base.dists.lognormal.pdf( 1.0, 0.0, 1.0 )\n ~0.399\n > y = base.dists.lognormal.pdf( 1.0, 3.0, 1.0 )\n ~0.004\n > y = base.dists.lognormal.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.lognormal.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.pdf.factory( μ, σ )\n Returns a function for evaluating the probability density function (PDF) of\n a lognormal distribution with location parameter `μ` and scale parameter\n `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.lognormal.pdf.factory( 4.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.014\n > y = myPDF( 2.0 )\n ~0.025\n\n",
"base.dists.lognormal.quantile": "\nbase.dists.lognormal.quantile( p, μ, σ )\n Evaluates the quantile function for a lognormal distribution with location\n parameter `μ` and scale parameter `σ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.lognormal.quantile( 0.8, 0.0, 1.0 )\n ~2.32\n > y = base.dists.lognormal.quantile( 0.5, 4.0, 2.0 )\n ~54.598\n > y = base.dists.lognormal.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.lognormal.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.quantile( 0.5, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.5, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.quantile.factory( μ, σ )\n Returns a function for evaluating the quantile function of a lognormal\n distribution with location parameter `μ` and scale parameter `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.lognormal.quantile.factory( 4.0, 2.0 );\n > var y = myQuantile( 0.2 )\n ~10.143\n > y = myQuantile( 0.8 )\n ~293.901\n\n",
"base.dists.lognormal.skewness": "\nbase.dists.lognormal.skewness( μ, σ )\n Returns the skewness of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.lognormal.skewness( 0.0, 1.0 )\n ~6.185\n > y = base.dists.lognormal.skewness( 5.0, 2.0 )\n ~414.359\n > y = base.dists.lognormal.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.skewness( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.stdev": "\nbase.dists.lognormal.stdev( μ, σ )\n Returns the standard deviation of a lognormal distribution with location `μ`\n and scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.lognormal.stdev( 0.0, 1.0 )\n ~2.161\n > y = base.dists.lognormal.stdev( 4.0, 2.0 )\n ~2953.533\n > y = base.dists.lognormal.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.stdev( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.variance": "\nbase.dists.lognormal.variance( μ, σ )\n Returns the variance of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.lognormal.variance( 0.0, 1.0 )\n ~4.671\n > y = base.dists.lognormal.variance( 4.0, 2.0 )\n ~8723355.729\n > y = base.dists.lognormal.variance( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.variance( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.negativeBinomial.cdf": "\nbase.dists.negativeBinomial.cdf( x, r, p )\n Evaluates the cumulative distribution function (CDF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.cdf( 5.0, 20.0, 0.8 )\n ~0.617\n > y = base.dists.negativeBinomial.cdf( 21.0, 20.0, 0.5 )\n ~0.622\n > y = base.dists.negativeBinomial.cdf( 5.0, 10.0, 0.4 )\n ~0.034\n > y = base.dists.negativeBinomial.cdf( 0.0, 10.0, 0.9 )\n ~0.349\n > y = base.dists.negativeBinomial.cdf( 21.0, 15.5, 0.5 )\n ~0.859\n > y = base.dists.negativeBinomial.cdf( 5.0, 7.4, 0.4 )\n ~0.131\n\n > y = base.dists.negativeBinomial.cdf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 2.0, -2.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.cdf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 0.0, 20.0, NaN )\n NaN\n\n > y = base.dists.negativeBinomial.cdf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.negativeBinomial.cdf.factory( r, p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a negative binomial distribution with number of successes until\n experiment is stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.negativeBinomial.cdf.factory( 10, 0.5 );\n > var y = myCDF( 3.0 )\n ~0.046\n > y = myCDF( 11.0 )\n ~0.668\n\n",
"base.dists.negativeBinomial.kurtosis": "\nbase.dists.negativeBinomial.kurtosis( r, p )\n Returns the excess kurtosis of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.kurtosis( 100, 0.2 )\n ~0.061\n > v = base.dists.negativeBinomial.kurtosis( 20, 0.5 )\n ~0.325\n\n",
"base.dists.negativeBinomial.logpmf": "\nbase.dists.negativeBinomial.logpmf( x, r, p )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.logpmf( 5.0, 20.0, 0.8 )\n ~-1.853\n > y = base.dists.negativeBinomial.logpmf( 21.0, 20.0, 0.5 )\n ~-2.818\n > y = base.dists.negativeBinomial.logpmf( 5.0, 10.0, 0.4 )\n ~-4.115\n > y = base.dists.negativeBinomial.logpmf( 0.0, 10.0, 0.9 )\n ~-1.054\n > y = base.dists.negativeBinomial.logpmf( 21.0, 15.5, 0.5 )\n ~-3.292\n > y = base.dists.negativeBinomial.logpmf( 5.0, 7.4, 0.4 )\n ~-2.976\n\n > y = base.dists.negativeBinomial.logpmf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, 20, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.logpmf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 0.0, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.logpmf.factory( r, p )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a negative binomial distribution with number of\n successes until experiment is stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.negativeBinomial.logpmf.factory( 10, 0.5 );\n > var y = mylogPMF( 3.0 )\n ~-3.617\n > y = mylogPMF( 5.0 )\n ~-2.795\n\n",
"base.dists.negativeBinomial.mean": "\nbase.dists.negativeBinomial.mean( r, p )\n Returns the expected value of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.mean( 100, 0.2 )\n 400\n > v = base.dists.negativeBinomial.mean( 20, 0.5 )\n 20\n\n",
"base.dists.negativeBinomial.mgf": "\nbase.dists.negativeBinomial.mgf( x, r, p )\n Evaluates the moment-generating function (MGF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.mgf( 0.05, 20.0, 0.8 )\n ~267.839\n > y = base.dists.negativeBinomial.mgf( 0.1, 20.0, 0.1 )\n ~9.347\n > y = base.dists.negativeBinomial.mgf( 0.5, 10.0, 0.4 )\n ~42822.023\n\n > y = base.dists.negativeBinomial.mgf( 0.1, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.1, -2.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.mgf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.0, 20.0, NaN )\n NaN\n\n > y = base.dists.negativeBinomial.mgf( 0.2, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.2, 20, 1.5 )\n NaN\n\n\nbase.dists.negativeBinomial.mgf.factory( r, p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.negativeBinomial.mgf.factory( 4.3, 0.4 );\n > var y = myMGF( 0.2 )\n ~4.696\n > y = myMGF( 0.4 )\n ~30.83\n\n",
"base.dists.negativeBinomial.mode": "\nbase.dists.negativeBinomial.mode( r, p )\n Returns the mode of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.mode( 100, 0.2 )\n 396\n > v = base.dists.negativeBinomial.mode( 20, 0.5 )\n 19\n\n",
"base.dists.negativeBinomial.NegativeBinomial": "\nbase.dists.negativeBinomial.NegativeBinomial( [r, p] )\n Returns a negative binomial distribution object.\n\n Parameters\n ----------\n r: number (optional)\n Number of successes until experiment is stopped. Must be a positive\n number. Default: `1`.\n\n p: number (optional)\n Success probability. Must be a number between `0` and `1`. Default:\n `0.5`.\n\n Returns\n -------\n nbinomial: Object\n Distribution instance.\n\n nbinomial.r: number\n Number of trials. If set, the value must be a positive number.\n\n nbinomial.p: number\n Success probability. If set, the value must be a number between `0` and\n `1`.\n\n nbinomial.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n nbinomial.mean: number\n Read-only property which returns the expected value.\n\n nbinomial.mode: number\n Read-only property which returns the mode.\n\n nbinomial.skewness: number\n Read-only property which returns the skewness.\n\n nbinomial.stdev: number\n Read-only property which returns the standard deviation.\n\n nbinomial.variance: number\n Read-only property which returns the variance.\n\n nbinomial.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n nbinomial.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n nbinomial.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n nbinomial.pmf: Function\n Evaluates the probability mass function (PMF).\n\n nbinomial.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var nbinomial = base.dists.negativeBinomial.NegativeBinomial( 8.0, 0.5 );\n > nbinomial.r\n 8.0\n > nbinomial.p\n 0.5\n > nbinomial.kurtosis\n 0.8125\n > nbinomial.mean\n 8.0\n > nbinomial.mode\n 7.0\n > nbinomial.skewness\n 0.75\n > nbinomial.stdev\n 4.0\n > nbinomial.variance\n 16.0\n > nbinomial.cdf( 2.9 )\n ~0.055\n > nbinomial.logpmf( 3.0 )\n ~-2.837\n > nbinomial.mgf( 0.2 )\n ~36.675\n > nbinomial.pmf( 3.0 )\n ~0.059\n > nbinomial.quantile( 0.8 )\n 11.0\n\n",
"base.dists.negativeBinomial.pmf": "\nbase.dists.negativeBinomial.pmf( x, r, p )\n Evaluates the probability mass function (PMF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.pmf( 5.0, 20.0, 0.8 )\n ~0.157\n > y = base.dists.negativeBinomial.pmf( 21.0, 20.0, 0.5 )\n ~0.06\n > y = base.dists.negativeBinomial.pmf( 5.0, 10.0, 0.4 )\n ~0.016\n > y = base.dists.negativeBinomial.pmf( 0.0, 10.0, 0.9 )\n ~0.349\n > y = base.dists.negativeBinomial.pmf( 21.0, 15.5, 0.5 )\n ~0.037\n > y = base.dists.negativeBinomial.pmf( 5.0, 7.4, 0.4 )\n ~0.051\n\n > y = base.dists.negativeBinomial.pmf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, 20, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.pmf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 0.0, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.pmf.factory( r, p )\n Returns a function for evaluating the probability mass function (PMF) of a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.negativeBinomial.pmf.factory( 10, 0.5 );\n > var y = myPMF( 3.0 )\n ~0.027\n > y = myPMF( 5.0 )\n ~0.061\n\n",
"base.dists.negativeBinomial.quantile": "\nbase.dists.negativeBinomial.quantile( k, r, p )\n Evaluates the quantile function for a negative binomial distribution with\n number of successes until experiment is stopped `r` and success probability\n `p` at a probability `k`.\n\n If provided a `k` outside of `[0,1]`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n k: number\n Input probability.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.quantile( 0.9, 20.0, 0.2 )\n 106\n > y = base.dists.negativeBinomial.quantile( 0.9, 20.0, 0.8 )\n 8\n > y = base.dists.negativeBinomial.quantile( 0.5, 10.0, 0.4 )\n 14\n > y = base.dists.negativeBinomial.quantile( 0.0, 10.0, 0.9 )\n 0\n\n > y = base.dists.negativeBinomial.quantile( 1.1, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( -0.1, 20.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.quantile( 21.0, 15.5, 0.5 )\n 12\n > y = base.dists.negativeBinomial.quantile( 5.0, 7.4, 0.4 )\n 10\n\n > y = base.dists.negativeBinomial.quantile( 0.5, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.5, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.quantile( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.quantile.factory( r, p )\n Returns a function for evaluating the quantile function of a negative\n binomial distribution with number of successes until experiment is stopped\n `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.negativeBinomial.quantile.factory( 10.0, 0.5 );\n > var y = myQuantile( 0.1 )\n 5\n > y = myQuantile( 0.9 )\n 16\n\n",
"base.dists.negativeBinomial.skewness": "\nbase.dists.negativeBinomial.skewness( r, p )\n Returns the skewness of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.skewness( 100, 0.2 )\n ~0.201\n > v = base.dists.negativeBinomial.skewness( 20, 0.5 )\n ~0.474\n\n",
"base.dists.negativeBinomial.stdev": "\nbase.dists.negativeBinomial.stdev( r, p )\n Returns the standard deviation of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.stdev( 100, 0.2 )\n ~44.721\n > v = base.dists.negativeBinomial.stdev( 20, 0.5 )\n ~6.325\n\n",
"base.dists.negativeBinomial.variance": "\nbase.dists.negativeBinomial.variance( r, p )\n Returns the variance of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.variance( 100, 0.2 )\n 2000.0\n > v = base.dists.negativeBinomial.variance( 20, 0.5 )\n 40.0\n\n",
"base.dists.normal.cdf": "\nbase.dists.normal.cdf( x, μ, σ )\n Evaluates the cumulative distribution function (CDF) for a normal\n distribution with mean `μ` and standard deviation `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.normal.cdf( 2.0, 0.0, 1.0 )\n ~0.977\n > y = base.dists.normal.cdf( -1.0, -1.0, 2.0 )\n 0.5\n > y = base.dists.normal.cdf( -1.0, 4.0, 2.0 )\n ~0.006\n > y = base.dists.normal.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.cdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.normal.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.normal.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.normal.cdf.factory( μ, σ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.normal.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 10.0 )\n 0.5\n\n",
"base.dists.normal.entropy": "\nbase.dists.normal.entropy( μ, σ )\n Returns the differential entropy of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.normal.entropy( 0.0, 1.0 )\n ~1.419\n > y = base.dists.normal.entropy( 4.0, 3.0 )\n ~2.518\n > y = base.dists.normal.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.normal.entropy( 0.0, NaN )\n NaN\n > y = base.dists.normal.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.kurtosis": "\nbase.dists.normal.kurtosis( μ, σ )\n Returns the excess kurtosis of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.normal.kurtosis( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.kurtosis( 4.0, 3.0 )\n 0.0\n > y = base.dists.normal.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.normal.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.normal.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.logpdf": "\nbase.dists.normal.logpdf( x, μ, σ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a normal distribution with mean `μ` and standard deviation `σ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.normal.logpdf( 2.0, 0.0, 1.0 )\n ~-2.919\n > y = base.dists.normal.logpdf( -1.0, 4.0, 2.0 )\n ~-4.737\n > y = base.dists.normal.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.normal.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.normal.logpdf.factory( μ, σ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.normal.logpdf.factory( 10.0, 2.0 );\n > var y = myLogPDF( 10.0 )\n ~-1.612\n\n",
"base.dists.normal.mean": "\nbase.dists.normal.mean( μ, σ )\n Returns the expected value of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.normal.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.mean( NaN, 1.0 )\n NaN\n > y = base.dists.normal.mean( 0.0, NaN )\n NaN\n > y = base.dists.normal.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.median": "\nbase.dists.normal.median( μ, σ )\n Returns the median of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.normal.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.median( NaN, 1.0 )\n NaN\n > y = base.dists.normal.median( 0.0, NaN )\n NaN\n > y = base.dists.normal.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.mgf": "\nbase.dists.normal.mgf( x, μ, σ )\n Evaluates the moment-generating function (MGF) for a normal distribution\n with mean `μ` and standard deviation `σ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.normal.mgf( 2.0, 0.0, 1.0 )\n ~7.389\n > y = base.dists.normal.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.mgf( -1.0, 4.0, 2.0 )\n ~0.1353\n > y = base.dists.normal.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.mgf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.normal.mgf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.normal.mgf.factory( μ, σ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.normal.mgf.factory( 4.0, 2.0 );\n > var y = myMGF( 1.0 )\n ~403.429\n > y = myMGF( 0.5 )\n ~12.182\n\n",
"base.dists.normal.mode": "\nbase.dists.normal.mode( μ, σ )\n Returns the mode of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.normal.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.mode( NaN, 1.0 )\n NaN\n > y = base.dists.normal.mode( 0.0, NaN )\n NaN\n > y = base.dists.normal.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.Normal": "\nbase.dists.normal.Normal( [μ, σ] )\n Returns a normal distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Mean parameter. Default: `0.0`.\n\n σ: number (optional)\n Standard deviation. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n normal: Object\n Distribution instance.\n\n normal.mu: number\n Mean parameter.\n\n normal.sigma: number\n Standard deviation. If set, the value must be greater than `0`.\n\n normal.entropy: number\n Read-only property which returns the differential entropy.\n\n normal.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n normal.mean: number\n Read-only property which returns the expected value.\n\n normal.median: number\n Read-only property which returns the median.\n\n normal.mode: number\n Read-only property which returns the mode.\n\n normal.skewness: number\n Read-only property which returns the skewness.\n\n normal.stdev: number\n Read-only property which returns the standard deviation.\n\n normal.variance: number\n Read-only property which returns the variance.\n\n normal.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n normal.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n normal.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n normal.pdf: Function\n Evaluates the probability density function (PDF).\n\n normal.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var normal = base.dists.normal.Normal( -2.0, 3.0 );\n > normal.mu\n -2.0\n > normal.sigma\n 3.0\n > normal.entropy\n ~2.518\n > normal.kurtosis\n 0.0\n > normal.mean\n -2.0\n > normal.median\n -2.0\n > normal.mode\n -2.0\n > normal.skewness\n 0.0\n > normal.stdev\n 3.0\n > normal.variance\n 9.0\n > normal.cdf( 0.8 )\n ~0.825\n > normal.logpdf( 2.0 )\n ~-2.9\n > normal.mgf( 0.2 )\n ~0.803\n > normal.pdf( 2.0 )\n ~0.055\n > normal.quantile( 0.9 )\n ~1.845\n\n",
"base.dists.normal.pdf": "\nbase.dists.normal.pdf( x, μ, σ )\n Evaluates the probability density function (PDF) for a normal distribution\n with mean `μ` and standard deviation `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.normal.pdf( 2.0, 0.0, 1.0 )\n ~0.054\n > y = base.dists.normal.pdf( -1.0, 4.0, 2.0 )\n ~0.009\n > y = base.dists.normal.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.pdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.normal.pdf( 8.0, 8.0, 0.0 )\n infinity\n\n\nbase.dists.normal.pdf.factory( μ, σ )\n Returns a function for evaluating the probability density function (PDF) of\n a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.normal.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.199\n\n",
"base.dists.normal.quantile": "\nbase.dists.normal.quantile( p, μ, σ )\n Evaluates the quantile function for a normal distribution with mean `μ` and\n standard deviation `σ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.normal.quantile( 0.8, 0.0, 1.0 )\n ~0.842\n > y = base.dists.normal.quantile( 0.5, 4.0, 2.0 )\n 4\n\n > y = base.dists.normal.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.normal.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.quantile( 0.3, 8.0, 0.0 )\n 8.0\n > y = base.dists.normal.quantile( 0.9, 8.0, 0.0 )\n 8.0\n\n\nbase.dists.normal.quantile.factory( μ, σ )\n Returns a function for evaluating the quantile function\n of a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.normal.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.normal.skewness": "\nbase.dists.normal.skewness( μ, σ )\n Returns the skewness of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.normal.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.skewness( 4.0, 3.0 )\n 0.0\n > y = base.dists.normal.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.normal.skewness( 0.0, NaN )\n NaN\n > y = base.dists.normal.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.stdev": "\nbase.dists.normal.stdev( μ, σ )\n Returns the standard deviation of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.normal.stdev( 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.stdev( 4.0, 3.0 )\n 3.0\n > y = base.dists.normal.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.normal.stdev( 0.0, NaN )\n NaN\n > y = base.dists.normal.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.variance": "\nbase.dists.normal.variance( μ, σ )\n Returns the variance of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.normal.variance( 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.variance( 4.0, 3.0 )\n 9.0\n > y = base.dists.normal.variance( NaN, 1.0 )\n NaN\n > y = base.dists.normal.variance( 0.0, NaN )\n NaN\n > y = base.dists.normal.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.pareto1.cdf": "\nbase.dists.pareto1.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.cdf( 2.0, 1.0, 1.0 )\n 0.5\n > y = base.dists.pareto1.cdf( 5.0, 2.0, 4.0 )\n ~0.36\n > y = base.dists.pareto1.cdf( 4.0, 2.0, 2.0 )\n 0.75\n > y = base.dists.pareto1.cdf( 1.9, 2.0, 2.0 )\n 0.0\n > y = base.dists.pareto1.cdf( PINF, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.pareto1.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.pareto1.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 3.0 )\n ~0.983\n > y = myCDF( 2.5 )\n ~0.893\n\n",
"base.dists.pareto1.entropy": "\nbase.dists.pareto1.entropy( α, β )\n Returns the differential entropy of a Pareto (Type I) distribution\n (in nats).\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.pareto1.entropy( 0.8, 1.0 )\n ~2.473\n > v = base.dists.pareto1.entropy( 4.0, 12.0 )\n ~2.349\n > v = base.dists.pareto1.entropy( 8.0, 2.0 )\n ~-0.261\n\n",
"base.dists.pareto1.kurtosis": "\nbase.dists.pareto1.kurtosis( α, β )\n Returns the excess kurtosis of a Pareto (Type I) distribution.\n\n If `α <= 4` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.pareto1.kurtosis( 5.0, 1.0 )\n ~70.8\n > v = base.dists.pareto1.kurtosis( 4.5, 12.0 )\n ~146.444\n > v = base.dists.pareto1.kurtosis( 8.0, 2.0 )\n ~19.725\n\n",
"base.dists.pareto1.logcdf": "\nbase.dists.pareto1.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.logcdf( 2.0, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.pareto1.logcdf( 5.0, 2.0, 4.0 )\n ~-1.022\n > y = base.dists.pareto1.logcdf( 4.0, 2.0, 2.0 )\n ~-0.288\n > y = base.dists.pareto1.logcdf( 1.9, 2.0, 2.0 )\n -Infinity\n > y = base.dists.pareto1.logcdf( PINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.pareto1.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Pareto (Type I) distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogCDF = base.dists.pareto1.logcdf.factory( 10.0, 2.0 );\n > var y = mylogCDF( 3.0 )\n ~-0.017\n > y = mylogCDF( 2.5 )\n ~-0.114\n\n",
"base.dists.pareto1.logpdf": "\nbase.dists.pareto1.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.logpdf( 4.0, 1.0, 1.0 )\n ~-2.773\n > y = base.dists.pareto1.logpdf( 20.0, 1.0, 10.0 )\n ~-3.689\n > y = base.dists.pareto1.logpdf( 7.0, 2.0, 6.0 )\n ~-1.561\n > y = base.dists.pareto1.logpdf( 7.0, 6.0, 3.0 )\n ~-5.238\n > y = base.dists.pareto1.logpdf( 1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.pareto1.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.pareto1.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a Pareto (Type I) distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.pareto1.logpdf.factory( 0.5, 0.5 );\n > var y = mylogPDF( 0.8 )\n ~-0.705\n > y = mylogPDF( 2.0 )\n ~-2.079\n\n",
"base.dists.pareto1.mean": "\nbase.dists.pareto1.mean( α, β )\n Returns the expected value of a Pareto (Type I) distribution.\n\n If `0 < α <= 1`, the function returns `Infinity`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.pareto1.mean( 0.8, 1.0 )\n Infinity\n > v = base.dists.pareto1.mean( 4.0, 12.0 )\n 16.0\n > v = base.dists.pareto1.mean( 8.0, 2.0 )\n ~2.286\n\n",
"base.dists.pareto1.median": "\nbase.dists.pareto1.median( α, β )\n Returns the median of a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.pareto1.median( 0.8, 1.0 )\n ~2.378\n > v = base.dists.pareto1.median( 4.0, 12.0 )\n ~14.27\n > v = base.dists.pareto1.median( 8.0, 2.0 )\n ~2.181\n\n",
"base.dists.pareto1.mode": "\nbase.dists.pareto1.mode( α, β )\n Returns the mode of a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.pareto1.mode( 0.8, 1.0 )\n 1.0\n > v = base.dists.pareto1.mode( 4.0, 12.0 )\n 12.0\n > v = base.dists.pareto1.mode( 8.0, 2.0 )\n 2.0\n\n",
"base.dists.pareto1.Pareto1": "\nbase.dists.pareto1.Pareto1( [α, β] )\n Returns a Pareto (Type I) distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n pareto1: Object\n Distribution instance.\n\n pareto1.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n pareto1.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n pareto1.entropy: number\n Read-only property which returns the differential entropy.\n\n pareto1.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n pareto1.mean: number\n Read-only property which returns the expected value.\n\n pareto1.median: number\n Read-only property which returns the median.\n\n pareto1.mode: number\n Read-only property which returns the mode.\n\n pareto1.skewness: number\n Read-only property which returns the skewness.\n\n pareto1.variance: number\n Read-only property which returns the variance.\n\n pareto1.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n pareto1.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF).\n\n pareto1.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (logPDF).\n\n pareto1.pdf: Function\n Evaluates the probability density function (PDF).\n\n pareto1.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var pareto1 = base.dists.pareto1.Pareto1( 6.0, 5.0 );\n > pareto1.alpha\n 6.0\n > pareto1.beta\n 5.0\n > pareto1.entropy\n ~0.984\n > pareto1.kurtosis\n ~35.667\n > pareto1.mean\n 6.0\n > pareto1.median\n ~5.612\n > pareto1.mode\n 5.0\n > pareto1.skewness\n ~3.81\n > pareto1.variance\n 1.5\n > pareto1.cdf( 7.0 )\n ~0.867\n > pareto1.logcdf( 7.0 )\n ~-0.142\n > pareto1.logpdf( 5.0 )\n ~0.182\n > pareto1.pdf( 5.0 )\n 1.2\n > pareto1.quantile( 0.8 )\n ~6.538\n\n",
"base.dists.pareto1.pdf": "\nbase.dists.pareto1.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.pdf( 4.0, 1.0, 1.0 )\n ~0.063\n > y = base.dists.pareto1.pdf( 20.0, 1.0, 10.0 )\n 0.025\n > y = base.dists.pareto1.pdf( 7.0, 2.0, 6.0 )\n ~0.21\n > y = base.dists.pareto1.pdf( 7.0, 6.0, 3.0 )\n ~0.005\n > y = base.dists.pareto1.pdf( 1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.pareto1.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.pareto1.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a Pareto (Type I) distribution with shape parameter `α` and scale parameter\n `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.pareto1.pdf.factory( 0.5, 0.5 );\n > var y = myPDF( 0.8 )\n ~0.494\n > y = myPDF( 2.0 )\n ~0.125\n\n",
"base.dists.pareto1.quantile": "\nbase.dists.pareto1.quantile( p, α, β )\n Evaluates the quantile function for a Pareto (Type I) distribution with\n shape parameter `α` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.pareto1.quantile( 0.8, 2.0, 1.0 )\n ~2.236\n > y = base.dists.pareto1.quantile( 0.8, 1.0, 10.0 )\n ~50.0\n > y = base.dists.pareto1.quantile( 0.1, 1.0, 10.0 )\n ~11.111\n\n > y = base.dists.pareto1.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.pareto1.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.pareto1.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.pareto1.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.pareto1.quantile.factory( 2.5, 0.5 );\n > var y = myQuantile( 0.5 )\n ~0.66\n > y = myQuantile( 0.8 )\n ~0.952\n\n",
"base.dists.pareto1.skewness": "\nbase.dists.pareto1.skewness( α, β )\n Returns the skewness of a Pareto (Type I) distribution.\n\n If `α <= 3` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.pareto1.skewness( 3.5, 1.0 )\n ~11.784\n > v = base.dists.pareto1.skewness( 4.0, 12.0 )\n ~7.071\n > v = base.dists.pareto1.skewness( 8.0, 2.0 )\n ~3.118\n\n",
"base.dists.pareto1.variance": "\nbase.dists.pareto1.variance( α, β )\n Returns the variance of a Pareto (Type I) distribution.\n\n If `0 < α <= 2` and `β > 0`, the function returns positive infinity.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.pareto1.variance( 0.8, 1.0 )\n Infinity\n > v = base.dists.pareto1.variance( 4.0, 12.0 )\n 32.0\n > v = base.dists.pareto1.variance( 8.0, 2.0 )\n ~0.109\n\n",
"base.dists.poisson.cdf": "\nbase.dists.poisson.cdf( x, λ )\n Evaluates the cumulative distribution function (CDF) for a Poisson\n distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.poisson.cdf( 2.0, 0.5 )\n ~0.986\n > y = base.dists.poisson.cdf( 2.0, 10.0 )\n ~0.003\n > y = base.dists.poisson.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.poisson.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.poisson.cdf( 0.0, NaN )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.poisson.cdf( 0.0, 0.0 )\n 1.0\n > y = base.dists.poisson.cdf( 10.0, 0.0 )\n 1.0\n\n\nbase.dists.poisson.cdf.factory( λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.poisson.cdf.factory( 5.0 );\n > var y = mycdf( 3.0 )\n ~0.265\n > y = mycdf( 8.0 )\n ~0.932\n\n",
"base.dists.poisson.entropy": "\nbase.dists.poisson.entropy( λ )\n Returns the entropy of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.poisson.entropy( 11.0 )\n ~2.61\n > v = base.dists.poisson.entropy( 4.5 )\n ~2.149\n\n",
"base.dists.poisson.kurtosis": "\nbase.dists.poisson.kurtosis( λ )\n Returns the excess kurtosis of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.poisson.kurtosis( 11.0 )\n ~0.091\n > v = base.dists.poisson.kurtosis( 4.5 )\n ~0.222\n\n",
"base.dists.poisson.logpmf": "\nbase.dists.poisson.logpmf( x, λ )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n Poisson distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.poisson.logpmf( 4.0, 3.0 )\n ~-1.784\n > y = base.dists.poisson.logpmf( 1.0, 3.0 )\n ~-1.901\n > y = base.dists.poisson.logpmf( -1.0, 2.0 )\n -Infinity\n > y = base.dists.poisson.logpmf( 0.0, NaN )\n NaN\n > y = base.dists.poisson.logpmf( NaN, 0.5 )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.logpmf( 2.0, -0.5 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.logpmf( 2.0, 0.0 )\n -Infinity\n > y = base.dists.poisson.logpmf( 0.0, 0.0 )\n 0.0\n\n\nbase.dists.poisson.logpmf.factory( λ )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.poisson.logpmf.factory( 1.0 );\n > var y = mylogpmf( 3.0 )\n ~-2.792\n > y = mylogpmf( 1.0 )\n ~-1.0\n\n",
"base.dists.poisson.mean": "\nbase.dists.poisson.mean( λ )\n Returns the expected value of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.poisson.mean( 11.0 )\n 11.0\n > v = base.dists.poisson.mean( 4.5 )\n 4.5\n\n",
"base.dists.poisson.median": "\nbase.dists.poisson.median( λ )\n Returns the median of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.poisson.median( 11.0 )\n 11\n > v = base.dists.poisson.median( 4.5 )\n 4\n\n",
"base.dists.poisson.mode": "\nbase.dists.poisson.mode( λ )\n Returns the mode of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.poisson.mode( 11.0 )\n 11\n > v = base.dists.poisson.mode( 4.5 )\n 4\n\n",
"base.dists.poisson.pmf": "\nbase.dists.poisson.pmf( x, λ )\n Evaluates the probability mass function (PMF) for a Poisson\n distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.poisson.pmf( 4.0, 3.0 )\n ~0.168\n > y = base.dists.poisson.pmf( 1.0, 3.0 )\n ~0.149\n > y = base.dists.poisson.pmf( -1.0, 2.0 )\n 0.0\n > y = base.dists.poisson.pmf( 0.0, NaN )\n NaN\n > y = base.dists.poisson.pmf( NaN, 0.5 )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.pmf( 2.0, -0.5 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.pmf( 2.0, 0.0 )\n 0.0\n > y = base.dists.poisson.pmf( 0.0, 0.0 )\n 1.0\n\n\nbase.dists.poisson.pmf.factory( λ )\n Returns a function for evaluating the probability mass function (PMF)\n of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.poisson.pmf.factory( 1.0 );\n > var y = mypmf( 3.0 )\n ~0.061\n > y = mypmf( 1.0 )\n ~0.368\n\n",
"base.dists.poisson.Poisson": "\nbase.dists.poisson.Poisson( [λ] )\n Returns a Poisson distribution object.\n\n Parameters\n ----------\n λ: number (optional)\n Mean parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n poisson: Object\n Distribution instance.\n\n poisson.lambda: number\n Mean parameter. If set, the value must be greater than `0`.\n\n poisson.entropy: number\n Read-only property which returns the differential entropy.\n\n poisson.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n poisson.mean: number\n Read-only property which returns the expected value.\n\n poisson.median: number\n Read-only property which returns the median.\n\n poisson.mode: number\n Read-only property which returns the mode.\n\n poisson.skewness: number\n Read-only property which returns the skewness.\n\n poisson.stdev: number\n Read-only property which returns the standard deviation.\n\n poisson.variance: number\n Read-only property which returns the variance.\n\n poisson.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n poisson.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n poisson.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n poisson.pmf: Function\n Evaluates the probability mass function (PMF).\n\n poisson.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var poisson = base.dists.poisson.Poisson( 6.0 );\n > poisson.lambda\n 6.0\n > poisson.entropy\n ~2.3\n > poisson.kurtosis\n ~0.167\n > poisson.mean\n 6.0\n > poisson.median\n 6.0\n > poisson.mode\n 6.0\n > poisson.skewness\n ~0.408\n > poisson.stdev\n ~2.449\n > poisson.variance\n 6.0\n > poisson.cdf( 4.0 )\n ~0.285\n > poisson.logpmf( 2.0 )\n ~-3.11\n > poisson.mgf( 0.5 )\n ~49.025\n > poisson.pmf( 2.0 )\n ~0.045\n > poisson.quantile( 0.5 )\n 6.0\n\n",
"base.dists.poisson.quantile": "\nbase.dists.poisson.quantile( p, λ )\n Evaluates the quantile function for a Poisson distribution with mean\n parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.poisson.quantile( 0.5, 2.0 )\n 2\n > y = base.dists.poisson.quantile( 0.9, 4.0 )\n 7\n > y = base.dists.poisson.quantile( 0.1, 200.0 )\n 182\n\n > y = base.dists.poisson.quantile( 1.1, 0.0 )\n NaN\n > y = base.dists.poisson.quantile( -0.2, 0.0 )\n NaN\n\n > y = base.dists.poisson.quantile( NaN, 0.5 )\n NaN\n > y = base.dists.poisson.quantile( 0.0, NaN )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.quantile( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.quantile( 0.1, 0.0 )\n 0.0\n > y = base.dists.poisson.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.poisson.quantile.factory( λ )\n Returns a function for evaluating the quantile function of a Poisson\n distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.poisson.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n 0.0\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.poisson.skewness": "\nbase.dists.poisson.skewness( λ )\n Returns the skewness of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.poisson.skewness( 11.0 )\n ~0.302\n > v = base.dists.poisson.skewness( 4.5 )\n ~0.471\n\n",
"base.dists.poisson.stdev": "\nbase.dists.poisson.stdev( λ )\n Returns the standard deviation of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.poisson.stdev( 11.0 )\n ~3.317\n > v = base.dists.poisson.stdev( 4.5 )\n ~2.121\n\n",
"base.dists.poisson.variance": "\nbase.dists.poisson.variance( λ )\n Returns the variance of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.poisson.variance( 11.0 )\n 11.0\n > v = base.dists.poisson.variance( 4.5 )\n 4.5\n\n",
"base.dists.rayleigh.cdf": "\nbase.dists.rayleigh.cdf( x, sigma )\n Evaluates the cumulative distribution function (CDF) for a Rayleigh\n distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.cdf( 2.0, 3.0 )\n ~0.199\n > y = base.dists.rayleigh.cdf( 1.0, 2.0 )\n ~0.118\n > y = base.dists.rayleigh.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.rayleigh.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.cdf( 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `sigma = 0.0`:\n > y = base.dists.rayleigh.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.rayleigh.cdf( 0.0, 0.0 )\n 1.0\n > y = base.dists.rayleigh.cdf( 2.0, 0.0 )\n 1.0\n\n\nbase.dists.rayleigh.cdf.factory( sigma )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.rayleigh.cdf.factory( 0.5 );\n > var y = myCDF( 1.0 )\n ~0.865\n > y = myCDF( 0.5 )\n ~0.393\n\n",
"base.dists.rayleigh.entropy": "\nbase.dists.rayleigh.entropy( σ )\n Returns the differential entropy of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.rayleigh.entropy( 11.0 )\n ~3.34\n > v = base.dists.rayleigh.entropy( 4.5 )\n ~2.446\n\n",
"base.dists.rayleigh.kurtosis": "\nbase.dists.rayleigh.kurtosis( σ )\n Returns the excess kurtosis of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.rayleigh.kurtosis( 11.0 )\n ~0.245\n > v = base.dists.rayleigh.kurtosis( 4.5 )\n ~0.245\n\n",
"base.dists.rayleigh.logcdf": "\nbase.dists.rayleigh.logcdf( x, sigma )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Rayleigh distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.logcdf( 2.0, 3.0 )\n ~-1.613\n > y = base.dists.rayleigh.logcdf( 1.0, 2.0 )\n ~-2.141\n > y = base.dists.rayleigh.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.rayleigh.logcdf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.logcdf( 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.rayleigh.logcdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.logcdf.factory( sigma )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Rayleigh distribution with scale parameter\n `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.rayleigh.logcdf.factory( 0.5 );\n > var y = mylogcdf( 1.0 )\n ~-0.145\n > y = mylogcdf( 0.5 )\n ~-0.933\n\n",
"base.dists.rayleigh.logpdf": "\nbase.dists.rayleigh.logpdf( x, sigma )\n Evaluates the logarithm of the probability density function (PDF) for a\n Rayleigh distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.logpdf( 0.3, 1.0 )\n ~-1.249\n > y = base.dists.rayleigh.logpdf( 2.0, 0.8 )\n ~-1.986\n > y = base.dists.rayleigh.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.rayleigh.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.logpdf( NaN, 2.0 )\n NaN\n // Negative scale parameter:\n > y = base.dists.rayleigh.logpdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.logpdf.factory( sigma )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.rayleigh.logpdf.factory( 4.0 );\n > var y = mylogpdf( 6.0 )\n ~-2.106\n > y = mylogpdf( 4.0 )\n ~-1.886\n\n",
"base.dists.rayleigh.mean": "\nbase.dists.rayleigh.mean( σ )\n Returns the expected value of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.rayleigh.mean( 11.0 )\n ~13.786\n > v = base.dists.rayleigh.mean( 4.5 )\n ~5.64\n\n",
"base.dists.rayleigh.median": "\nbase.dists.rayleigh.median( σ )\n Returns the median of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.rayleigh.median( 11.0 )\n ~12.952\n > v = base.dists.rayleigh.median( 4.5 )\n ~5.298\n\n",
"base.dists.rayleigh.mgf": "\nbase.dists.rayleigh.mgf( t, sigma )\n Evaluates the moment-generating function (MGF) for a Rayleigh distribution\n with scale parameter `sigma` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.mgf( 1.0, 3.0 )\n ~678.508\n > y = base.dists.rayleigh.mgf( 1.0, 2.0 )\n ~38.65\n > y = base.dists.rayleigh.mgf( -1.0, 4.0 )\n ~-0.947\n > y = base.dists.rayleigh.mgf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.mgf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.mgf( 0.5, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.mgf.factory( sigma )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.rayleigh.mgf.factory( 0.5 );\n > var y = myMGF( 1.0 )\n ~2.715\n > y = myMGF( 0.5 )\n ~1.888\n\n",
"base.dists.rayleigh.mode": "\nbase.dists.rayleigh.mode( σ )\n Returns the mode of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.rayleigh.mode( 11.0 )\n 11.0\n > v = base.dists.rayleigh.mode( 4.5 )\n 4.5\n\n",
"base.dists.rayleigh.pdf": "\nbase.dists.rayleigh.pdf( x, sigma )\n Evaluates the probability density function (PDF) for a Rayleigh\n distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.pdf( 0.3, 1.0 )\n ~0.287\n > y = base.dists.rayleigh.pdf( 2.0, 0.8 )\n ~0.137\n > y = base.dists.rayleigh.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.rayleigh.pdf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.pdf( NaN, 2.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `sigma = 0.0`:\n > y = base.dists.rayleigh.pdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.rayleigh.pdf( 0.0, 0.0 )\n Infinity\n > y = base.dists.rayleigh.pdf( 2.0, 0.0 )\n 0.0\n\n\nbase.dists.rayleigh.pdf.factory( sigma )\n Returns a function for evaluating the probability density function (PDF) of\n a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.rayleigh.pdf.factory( 4.0 );\n > var y = myPDF( 6.0 )\n ~0.122\n > y = myPDF( 4.0 )\n ~0.152\n\n",
"base.dists.rayleigh.quantile": "\nbase.dists.rayleigh.quantile( p, sigma )\n Evaluates the quantile function for a Rayleigh distribution with scale\n parameter `sigma` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative probability for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.rayleigh.quantile( 0.8, 1.0 )\n ~1.794\n > y = base.dists.rayleigh.quantile( 0.5, 4.0 )\n ~4.71\n\n > y = base.dists.rayleigh.quantile( 1.1, 1.0 )\n NaN\n > y = base.dists.rayleigh.quantile( -0.2, 1.0 )\n NaN\n\n > y = base.dists.rayleigh.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.quantile( 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.quantile.factory( sigma )\n Returns a function for evaluating the quantile function of a Rayleigh\n distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.rayleigh.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n ~0.404\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.rayleigh.Rayleigh": "\nbase.dists.rayleigh.Rayleigh( [σ] )\n Returns a Rayleigh distribution object.\n\n Parameters\n ----------\n σ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n rayleigh: Object\n Distribution instance.\n\n rayleigh.sigma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n rayleigh.entropy: number\n Read-only property which returns the differential entropy.\n\n rayleigh.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n rayleigh.mean: number\n Read-only property which returns the expected value.\n\n rayleigh.median: number\n Read-only property which returns the median.\n\n rayleigh.mode: number\n Read-only property which returns the mode.\n\n rayleigh.skewness: number\n Read-only property which returns the skewness.\n\n rayleigh.stdev: number\n Read-only property which returns the standard deviation.\n\n rayleigh.variance: number\n Read-only property which returns the variance.\n\n rayleigh.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n rayleigh.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n rayleigh.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n rayleigh.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n rayleigh.pdf: Function\n Evaluates the probability density function (PDF).\n\n rayleigh.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var rayleigh = base.dists.rayleigh.Rayleigh( 6.0 );\n > rayleigh.sigma\n 6.0\n > rayleigh.entropy\n ~2.734\n > rayleigh.kurtosis\n ~0.245\n > rayleigh.mean\n ~7.52\n > rayleigh.median\n ~7.064\n > rayleigh.mode\n 6.0\n > rayleigh.skewness\n ~0.631\n > rayleigh.stdev\n ~3.931\n > rayleigh.variance\n ~15.451\n > rayleigh.cdf( 1.0 )\n ~0.014\n > rayleigh.logcdf( 1.0 )\n ~-4.284\n > rayleigh.logpdf( 1.5 )\n ~-3.209\n > rayleigh.mgf( -0.5 )\n ~-0.91\n > rayleigh.pdf( 1.5 )\n ~0.04\n > rayleigh.quantile( 0.5 )\n ~7.064\n\n",
"base.dists.rayleigh.skewness": "\nbase.dists.rayleigh.skewness( σ )\n Returns the skewness of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.rayleigh.skewness( 11.0 )\n ~0.631\n > v = base.dists.rayleigh.skewness( 4.5 )\n ~0.631\n\n",
"base.dists.rayleigh.stdev": "\nbase.dists.rayleigh.stdev( σ )\n Returns the standard deviation of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.rayleigh.stdev( 9.0 )\n ~5.896\n > v = base.dists.rayleigh.stdev( 4.5 )\n ~2.948\n\n",
"base.dists.rayleigh.variance": "\nbase.dists.rayleigh.variance( σ )\n Returns the variance of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.rayleigh.variance( 9.0 )\n ~34.765\n > v = base.dists.rayleigh.variance( 4.5 )\n ~8.691\n\n",
"base.dists.t.cdf": "\nbase.dists.t.cdf( x, v )\n Evaluates the cumulative distribution function (CDF) for a Student's t\n distribution with degrees of freedom `v` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.t.cdf( 2.0, 0.1 )\n ~0.611\n > y = base.dists.t.cdf( 1.0, 2.0 )\n ~0.789\n > y = base.dists.t.cdf( -1.0, 4.0 )\n ~0.187\n > y = base.dists.t.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.t.cdf( 0.0, NaN )\n NaN\n > y = base.dists.t.cdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.t.cdf.factory( v )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Student's t distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.t.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n ~0.816\n > y = mycdf( 1.0 )\n ~0.699\n\n",
"base.dists.t.entropy": "\nbase.dists.t.entropy( v )\n Returns the differential entropy of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.t.entropy( 11.0 )\n ~1.512\n > v = base.dists.t.entropy( 4.5 )\n ~1.652\n\n",
"base.dists.t.kurtosis": "\nbase.dists.t.kurtosis( v )\n Returns the excess kurtosis of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 2`, the function returns `NaN`.\n\n If provided `2 < v <= 4`, the function returns positive infinity.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.t.kurtosis( 11.0 )\n ~0.857\n > v = base.dists.t.kurtosis( 4.5 )\n 12.0\n\n",
"base.dists.t.mean": "\nbase.dists.t.mean( v )\n Returns the expected value of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.t.mean( 11.0 )\n 0.0\n > v = base.dists.t.mean( 4.5 )\n 0.0\n\n",
"base.dists.t.median": "\nbase.dists.t.median( v )\n Returns the median of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.t.median( 11.0 )\n 0.0\n > v = base.dists.t.median( 4.5 )\n 0.0\n\n",
"base.dists.t.mode": "\nbase.dists.t.mode( v )\n Returns the mode of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.t.mode( 11.0 )\n 0.0\n > v = base.dists.t.mode( 4.5 )\n 0.0\n\n",
"base.dists.t.pdf": "\nbase.dists.t.pdf( x, v )\n Evaluates the probability density function (PDF) for a Student's t\n distribution with degrees of freedom `v` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.t.pdf( 0.3, 4.0 )\n ~0.355\n > y = base.dists.t.pdf( 2.0, 0.7 )\n ~0.058\n > y = base.dists.t.pdf( -1.0, 0.5 )\n ~0.118\n > y = base.dists.t.pdf( 0.0, NaN )\n NaN\n > y = base.dists.t.pdf( NaN, 2.0 )\n NaN\n > y = base.dists.t.pdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.t.pdf.factory( v )\n Returns a function for evaluating the probability density function (PDF)\n of a Student's t distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.t.pdf.factory( 3.0 );\n > var y = myPDF( 1.0 )\n ~0.207\n\n",
"base.dists.t.quantile": "\nbase.dists.t.quantile( p, v )\n Evaluates the quantile function for a Student's t distribution with degrees\n of freedom `v` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.t.quantile( 0.8, 1.0 )\n ~1.376\n > y = base.dists.t.quantile( 0.1, 1.0 )\n ~-3.078\n > y = base.dists.t.quantile( 0.5, 0.1 )\n 0.0\n\n > y = base.dists.t.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.t.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.t.quantile( 0.0, NaN )\n NaN\n\n > y = base.dists.t.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.t.quantile.factory( v )\n Returns a function for evaluating the quantile function of a Student's t\n distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.t.quantile.factory( 4.0 );\n > var y = myQuantile( 0.2 )\n ~-0.941\n > y = myQuantile( 0.9 )\n ~1.533\n\n",
"base.dists.t.skewness": "\nbase.dists.t.skewness( v )\n Returns the skewness of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 3`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.t.skewness( 11.0 )\n 0.0\n > v = base.dists.t.skewness( 4.5 )\n 0.0\n\n",
"base.dists.t.stdev": "\nbase.dists.t.stdev( v )\n Returns the standard deviation of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `1 < v <= 2`, the function returns positive infinity.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.t.stdev( 9.0 )\n ~1.134\n > v = base.dists.t.stdev( 4.5 )\n ~1.342\n\n",
"base.dists.t.T": "\nbase.dists.t.T( [v] )\n Returns a Student's t distribution object.\n\n Parameters\n ----------\n v: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n t: Object\n Distribution instance.\n\n t.v: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n t.entropy: number\n Read-only property which returns the differential entropy.\n\n t.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n t.mean: number\n Read-only property which returns the expected value.\n\n t.median: number\n Read-only property which returns the median.\n\n t.mode: number\n Read-only property which returns the mode.\n\n t.skewness: number\n Read-only property which returns the skewness.\n\n t.stdev: number\n Read-only property which returns the standard deviation.\n\n t.variance: number\n Read-only property which returns the variance.\n\n t.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n t.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n t.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n t.pdf: Function\n Evaluates the probability density function (PDF).\n\n t.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var t = base.dists.t.T( 6.0 );\n > t.v\n 6.0\n > t.entropy\n ~1.592\n > t.kurtosis\n 3.0\n > t.mean\n 0.0\n > t.median\n 0.0\n > t.mode\n 0.0\n > t.skewness\n 0.0\n > t.stdev\n ~1.225\n > t.variance\n 1.5\n > t.cdf( 1.0 )\n ~0.822\n > t.logcdf( 1.0 )\n ~-0.196\n > t.logpdf( 1.5 )\n ~-2.075\n > t.pdf( 1.5 )\n ~0.126\n > t.quantile( 0.8 )\n ~0.906\n\n",
"base.dists.t.variance": "\nbase.dists.t.variance( v )\n Returns the variance of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `1 < v <= 2`, the function returns positive infinity.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.t.variance( 9.0 )\n ~1.286\n > v = base.dists.t.variance( 4.5 )\n ~1.8\n\n",
"base.dists.triangular.cdf": "\nbase.dists.triangular.cdf( x, a, b, c )\n Evaluates the cumulative distribution function (CDF) for a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c` at\n a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.triangular.cdf( 0.5, -1.0, 1.0, 0.0 )\n 0.875\n > y = base.dists.triangular.cdf( 0.5, -1.0, 1.0, 0.5 )\n 0.75\n > y = base.dists.triangular.cdf( -10.0, -20.0, 0.0, -2.0 )\n ~0.278\n > y = base.dists.triangular.cdf( -2.0, -1.0, 1.0, 0.0 )\n 0.0\n > y = base.dists.triangular.cdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.cdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.cdf.factory( a, b, c )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a triangular distribution with minimum support `a`, maximum support `b`,\n and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.triangular.cdf.factory( 0.0, 10.0, 2.0 );\n > var y = mycdf( 0.5 )\n 0.0125\n > y = mycdf( 8.0 )\n 0.95\n\n\n",
"base.dists.triangular.entropy": "\nbase.dists.triangular.entropy( a, b, c )\n Returns the differential entropy of a triangular distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.triangular.entropy( 0.0, 1.0, 0.8 )\n ~-0.193\n > v = base.dists.triangular.entropy( 4.0, 12.0, 5.0 )\n ~1.886\n > v = base.dists.triangular.entropy( 2.0, 8.0, 5.0 )\n ~1.599\n\n",
"base.dists.triangular.kurtosis": "\nbase.dists.triangular.kurtosis( a, b, c )\n Returns the excess kurtosis of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.triangular.kurtosis( 0.0, 1.0, 0.8 )\n -0.6\n > v = base.dists.triangular.kurtosis( 4.0, 12.0, 5.0 )\n -0.6\n > v = base.dists.triangular.kurtosis( 2.0, 8.0, 5.0 )\n -0.6\n\n",
"base.dists.triangular.logcdf": "\nbase.dists.triangular.logcdf( x, a, b, c )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a triangular distribution with minimum support `a`, maximum\n support `b`, and mode `c` at a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.triangular.logcdf( 0.5, -1.0, 1.0, 0.0 )\n ~-0.134\n > y = base.dists.triangular.logcdf( 0.5, -1.0, 1.0, 0.5 )\n ~-0.288\n > y = base.dists.triangular.logcdf( -10.0, -20.0, 0.0, -2.0 )\n ~-1.281\n > y = base.dists.triangular.logcdf( -2.0, -1.0, 1.0, 0.0 )\n -Infinity\n > y = base.dists.triangular.logcdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.logcdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.logcdf.factory( a, b, c )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a triangular distribution with minimum\n support `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n cdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.triangular.logcdf.factory( 0.0, 10.0, 2.0 );\n > var y = mylogcdf( 0.5 )\n ~-4.382\n > y = mylogcdf( 8.0 )\n ~-0.051\n\n\n",
"base.dists.triangular.logpdf": "\nbase.dists.triangular.logpdf( x, a, b, c )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a triangular distribution with minimum support `a`, maximum support `b`,\n and mode `c` at a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.triangular.logpdf( 0.5, -1.0, 1.0, 0.0 )\n ~-0.693\n > y = base.dists.triangular.logpdf( 0.5, -1.0, 1.0, 0.5 )\n 0.0\n > y = base.dists.triangular.logpdf( -10.0, -20.0, 0.0, -2.0 )\n ~-2.89\n > y = base.dists.triangular.logpdf( -2.0, -1.0, 1.0, 0.0 )\n -Infinity\n > y = base.dists.triangular.logpdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.logpdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.logpdf.factory( a, b, c )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a triangular distribution with minimum support\n `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.triangular.logpdf.factory( 0.0, 10.0, 5.0 );\n > var y = mylogpdf( 2.0 )\n ~-2.526\n > y = mylogpdf( 12.0 )\n -Infinity\n\n\n",
"base.dists.triangular.mean": "\nbase.dists.triangular.mean( a, b, c )\n Returns the expected value of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.triangular.mean( 0.0, 1.0, 0.8 )\n ~0.6\n > v = base.dists.triangular.mean( 4.0, 12.0, 5.0 )\n 7.0\n > v = base.dists.triangular.mean( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.median": "\nbase.dists.triangular.median( a, b, c )\n Returns the median of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.triangular.median( 0.0, 1.0, 0.8 )\n ~0.632\n > v = base.dists.triangular.median( 4.0, 12.0, 5.0 )\n ~6.708\n > v = base.dists.triangular.median( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.mgf": "\nbase.dists.triangular.mgf( t, a, b, c )\n Evaluates the moment-generating function (MGF) for a triangular distribution\n with minimum support `a`, maximum support `b`, and mode `c` at a value `t`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.triangular.mgf( 0.5, -1.0, 1.0, 0.0 )\n ~1.021\n > y = base.dists.triangular.mgf( 0.5, -1.0, 1.0, 0.5 )\n ~1.111\n > y = base.dists.triangular.mgf( -0.3, -20.0, 0.0, -2.0 )\n ~24.334\n > y = base.dists.triangular.mgf( -2.0, -1.0, 1.0, 0.0 )\n ~1.381\n > y = base.dists.triangular.mgf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.5, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.mgf( 0.5, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.mgf.factory( a, b, c )\n Returns a function for evaluating the moment-generating function (MGF) of a\n triangular distribution with minimum support `a`, maximum support `b`, and\n mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.triangular.mgf.factory( 0.0, 2.0, 1.0 );\n > var y = mymgf( -1.0 )\n ~0.3996\n > y = mymgf( 2.0 )\n ~10.205\n\n\n",
"base.dists.triangular.mode": "\nbase.dists.triangular.mode( a, b, c )\n Returns the mode of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.triangular.mode( 0.0, 1.0, 0.8 )\n 0.8\n > v = base.dists.triangular.mode( 4.0, 12.0, 5.0 )\n 5.0\n > v = base.dists.triangular.mode( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.pdf": "\nbase.dists.triangular.pdf( x, a, b, c )\n Evaluates the probability density function (PDF) for a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c` at\n a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.triangular.pdf( 0.5, -1.0, 1.0, 0.0 )\n 0.5\n > y = base.dists.triangular.pdf( 0.5, -1.0, 1.0, 0.5 )\n 1.0\n > y = base.dists.triangular.pdf( -10.0, -20.0, 0.0, -2.0 )\n ~0.056\n > y = base.dists.triangular.pdf( -2.0, -1.0, 1.0, 0.0 )\n 0.0\n > y = base.dists.triangular.pdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.pdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.pdf.factory( a, b, c )\n Returns a function for evaluating the probability density function (PDF) of\n a triangular distribution with minimum support `a`, maximum support `b`, and\n mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.triangular.pdf.factory( 0.0, 10.0, 5.0 );\n > var y = mypdf( 2.0 )\n 0.08\n > y = mypdf( 12.0 )\n 0.0\n\n\n",
"base.dists.triangular.quantile": "\nbase.dists.triangular.quantile( p, a, b, c )\n Evaluates the quantile function for a triangular distribution with minimum\n support `a`, maximum support `b`, and mode `c` at a value `x`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.triangular.quantile( 0.9, -1.0, 1.0, 0.0 )\n ~0.553\n > y = base.dists.triangular.quantile( 0.1, -1.0, 1.0, 0.5 )\n ~-0.452\n > y = base.dists.triangular.quantile( 0.1, -20.0, 0.0, -2.0 )\n -14.0\n > y = base.dists.triangular.quantile( 0.8, 0.0, 20.0, 0.0 )\n ~11.056\n\n > y = base.dists.triangular.quantile( 1.1, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.triangular.quantile( -0.1, -1.0, 1.0, 0.0 )\n NaN\n\n > y = base.dists.triangular.quantile( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, 1.0, 0.0, NaN )\n NaN\n\n > y = base.dists.triangular.quantile( 0.3, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.quantile.factory( a, b, c )\n Returns a function for evaluating the quantile function of a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.triangular.quantile.factory( 2.0, 4.0, 2.5 );\n > var y = myquantile( 0.4 )\n ~2.658\n > y = myquantile( 0.8 )\n ~3.225\n\n\n",
"base.dists.triangular.skewness": "\nbase.dists.triangular.skewness( a, b, c )\n Returns the skewness of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.triangular.skewness( 0.0, 1.0, 0.8 )\n ~-0.476\n > v = base.dists.triangular.skewness( 4.0, 12.0, 5.0 )\n ~0.532\n > v = base.dists.triangular.skewness( 2.0, 8.0, 5.0 )\n 0.0\n\n",
"base.dists.triangular.stdev": "\nbase.dists.triangular.stdev( a, b, c )\n Returns the standard deviation of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.triangular.stdev( 0.0, 1.0, 0.8 )\n ~0.216\n > v = base.dists.triangular.stdev( 4.0, 12.0, 5.0 )\n ~1.78\n > v = base.dists.triangular.stdev( 2.0, 8.0, 5.0 )\n ~1.225\n\n",
"base.dists.triangular.Triangular": "\nbase.dists.triangular.Triangular( [a, b, c] )\n Returns a triangular distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be smaller than `b` and `c`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a` and `c`. Default: `1.0`.\n\n c: number (optional)\n Mode. Must be greater than `a` and smaller than `b`. Default: `0.5`.\n\n Returns\n -------\n triangular: Object\n Distribution instance.\n\n triangular.a: number\n Minimum support. If set, the value must be smaller or equal to `b` and\n `c`.\n\n triangular.b: number\n Maximum support. If set, the value must be greater than or equal to `a`\n and `c`.\n\n triangular.c: number\n Mode. If set, the value must be greater than or equal to `a` and smaller\n than or equal to `b`.\n\n triangular.entropy: number\n Read-only property which returns the differential entropy.\n\n triangular.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n triangular.mean: number\n Read-only property which returns the expected value.\n\n triangular.median: number\n Read-only property which returns the median.\n\n triangular.mode: number\n Read-only property which returns the mode.\n\n triangular.skewness: number\n Read-only property which returns the skewness.\n\n triangular.stdev: number\n Read-only property which returns the standard deviation.\n\n triangular.variance: number\n Read-only property which returns the variance.\n\n triangular.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n triangular.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n triangular.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n triangular.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n triangular.pdf: Function\n Evaluates the probability density function (PDF).\n\n triangular.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var triangular = base.dists.triangular.Triangular( 0.0, 1.0, 0.5 );\n > triangular.a\n 0.0\n > triangular.b\n 1.0\n > triangular.c\n 0.5\n > triangular.entropy\n ~-0.193\n > triangular.kurtosis\n -0.6\n > triangular.mean\n 0.5\n > triangular.median\n 0.5\n > triangular.mode\n 0.5\n > triangular.skewness\n 0.0\n > triangular.stdev\n ~0.204\n > triangular.variance\n ~0.042\n > triangular.cdf( 0.8 )\n 0.92\n > triangular.logcdf( 0.8 )\n ~-0.083\n > triangular.logpdf( 0.8 )\n ~-0.223\n > triangular.mgf( 0.8 )\n ~1.512\n > triangular.pdf( 0.8 )\n ~0.8\n > triangular.quantile( 0.8 )\n ~0.684\n\n",
"base.dists.triangular.variance": "\nbase.dists.triangular.variance( a, b, c )\n Returns the variance of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.triangular.variance( 0.0, 1.0, 0.8 )\n ~0.047\n > v = base.dists.triangular.variance( 4.0, 12.0, 5.0 )\n ~3.167\n > v = base.dists.triangular.variance( 2.0, 8.0, 5.0 )\n ~1.5\n\n",
"base.dists.uniform.cdf": "\nbase.dists.uniform.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for a uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.uniform.cdf( 9.0, 0.0, 10.0 )\n 0.9\n > y = base.dists.uniform.cdf( 0.5, 0.0, 2.0 )\n 0.25\n > y = base.dists.uniform.cdf( PINF, 2.0, 4.0 )\n 1.0\n > y = base.dists.uniform.cdf( NINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.uniform.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.cdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.uniform.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.uniform.cdf.factory( 0.0, 10.0 );\n > var y = mycdf( 0.5 )\n 0.05\n > y = mycdf( 8.0 )\n 0.8\n\n",
"base.dists.uniform.entropy": "\nbase.dists.uniform.entropy( a, b )\n Returns the differential entropy of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.uniform.entropy( 0.0, 1.0 )\n 0.0\n > v = base.dists.uniform.entropy( 4.0, 12.0 )\n ~2.079\n > v = base.dists.uniform.entropy( 2.0, 8.0 )\n ~1.792\n\n",
"base.dists.uniform.kurtosis": "\nbase.dists.uniform.kurtosis( a, b )\n Returns the excess kurtosis of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.uniform.kurtosis( 0.0, 1.0 )\n -1.2\n > v = base.dists.uniform.kurtosis( 4.0, 12.0 )\n -1.2\n > v = base.dists.uniform.kurtosis( 2.0, 8.0 )\n -1.2\n\n",
"base.dists.uniform.logcdf": "\nbase.dists.uniform.logcdf( x, a, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n uniform distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.uniform.logcdf( 9.0, 0.0, 10.0 )\n ~-0.105\n > y = base.dists.uniform.logcdf( 0.5, 0.0, 2.0 )\n ~-1.386\n > y = base.dists.uniform.logcdf( PINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.uniform.logcdf( NINF, 2.0, 4.0 )\n -Infinity\n > y = base.dists.uniform.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.logcdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.uniform.logcdf.factory( a, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a uniform distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.uniform.logcdf.factory( 0.0, 10.0 );\n > var y = mylogcdf( 0.5 )\n ~-2.996\n > y = mylogcdf( 8.0 )\n ~-0.223\n\n",
"base.dists.uniform.logpdf": "\nbase.dists.uniform.logpdf( x, a, b )\n Evaluates the logarithm of the probability density function (PDF) for a\n uniform distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.uniform.logpdf( 2.0, 0.0, 4.0 )\n ~-1.386\n > y = base.dists.uniform.logpdf( 5.0, 0.0, 4.0 )\n -infinity\n > y = base.dists.uniform.logpdf( 0.25, 0.0, 1.0 )\n 0.0\n > y = base.dists.uniform.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.logpdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.logpdf.factory( a, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a uniform distribution with minimum support `a` and\n maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.uniform.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 7.0 )\n 0.0\n > y = mylogPDF( 5.0 )\n -infinity\n\n",
"base.dists.uniform.mean": "\nbase.dists.uniform.mean( a, b )\n Returns the expected value of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.uniform.mean( 0.0, 1.0 )\n 0.5\n > v = base.dists.uniform.mean( 4.0, 12.0 )\n 8.0\n > v = base.dists.uniform.mean( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.uniform.median": "\nbase.dists.uniform.median( a, b )\n Returns the median of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.uniform.median( 0.0, 1.0 )\n 0.5\n > v = base.dists.uniform.median( 4.0, 12.0 )\n 8.0\n > v = base.dists.uniform.median( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.uniform.mgf": "\nbase.dists.uniform.mgf( t, a, b )\n Evaluates the moment-generating function (MGF) for a uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.uniform.mgf( 2.0, 0.0, 4.0 )\n ~372.495\n > y = base.dists.uniform.mgf( -0.2, 0.0, 4.0 )\n ~0.688\n > y = base.dists.uniform.mgf( 2.0, 0.0, 1.0 )\n ~3.195\n > y = base.dists.uniform.mgf( 0.5, 3.0, 2.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.5, 3.0, 3.0 )\n NaN\n > y = base.dists.uniform.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.0, 0.0, NaN )\n NaN\n\n\nbase.dists.uniform.mgf.factory( a, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.uniform.mgf.factory( 6.0, 7.0 );\n > var y = mymgf( 0.1 )\n ~1.916\n > y = mymgf( 1.1 )\n ~1339.321\n\n",
"base.dists.uniform.pdf": "\nbase.dists.uniform.pdf( x, a, b )\n Evaluates the probability density function (PDF) for a uniform distribution\n with minimum support `a` and maximum support `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.uniform.pdf( 2.0, 0.0, 4.0 )\n 0.25\n > y = base.dists.uniform.pdf( 5.0, 0.0, 4.0 )\n 0.0\n > y = base.dists.uniform.pdf( 0.25, 0.0, 1.0 )\n 1.0\n > y = base.dists.uniform.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.pdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF) of\n a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.uniform.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n 1.0\n > y = myPDF( 5.0 )\n 0.0\n\n",
"base.dists.uniform.quantile": "\nbase.dists.uniform.quantile( p, a, b )\n Evaluates the quantile function for a uniform distribution with minimum\n support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.uniform.quantile( 0.8, 0.0, 1.0 )\n 0.8\n > y = base.dists.uniform.quantile( 0.5, 0.0, 10.0 )\n 5.0\n\n > y = base.dists.uniform.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.uniform.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.uniform.quantile( 0.5, 2.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a uniform\n distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.uniform.quantile.factory( 0.0, 4.0 );\n > var y = myQuantile( 0.8 )\n 3.2\n\n",
"base.dists.uniform.skewness": "\nbase.dists.uniform.skewness( a, b )\n Returns the skewness of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.uniform.skewness( 0.0, 1.0 )\n 0.0\n > v = base.dists.uniform.skewness( 4.0, 12.0 )\n 0.0\n > v = base.dists.uniform.skewness( 2.0, 8.0 )\n 0.0\n\n",
"base.dists.uniform.stdev": "\nbase.dists.uniform.stdev( a, b )\n Returns the standard deviation of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.uniform.stdev( 0.0, 1.0 )\n ~0.289\n > v = base.dists.uniform.stdev( 4.0, 12.0 )\n ~2.309\n > v = base.dists.uniform.stdev( 2.0, 8.0 )\n ~1.732\n\n",
"base.dists.uniform.Uniform": "\nbase.dists.uniform.Uniform( [a, b] )\n Returns a uniform distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be smaller than `b`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a`. Default: `1.0`.\n\n Returns\n -------\n uniform: Object\n Distribution instance.\n\n uniform.a: number\n Minimum support. If set, the value must be smaller than `b`.\n\n uniform.b: number\n Maximum support. If set, the value must be greater than `a`.\n\n uniform.entropy: number\n Read-only property which returns the differential entropy.\n\n uniform.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n uniform.mean: number\n Read-only property which returns the expected value.\n\n uniform.median: number\n Read-only property which returns the median.\n\n uniform.skewness: number\n Read-only property which returns the skewness.\n\n uniform.stdev: number\n Read-only property which returns the standard deviation.\n\n uniform.variance: number\n Read-only property which returns the variance.\n\n uniform.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n uniform.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n uniform.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n uniform.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n uniform.pdf: Function\n Evaluates the probability density function (PDF).\n\n uniform.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var uniform = base.dists.uniform.Uniform( 0.0, 1.0 );\n > uniform.a\n 0.0\n > uniform.b\n 1.0\n > uniform.entropy\n 0.0\n > uniform.kurtosis\n -1.2\n > uniform.mean\n 0.5\n > uniform.median\n 0.5\n > uniform.skewness\n 0.0\n > uniform.stdev\n ~0.289\n > uniform.variance\n ~0.083\n > uniform.cdf( 0.8 )\n 0.8\n > uniform.logcdf( 0.5 )\n ~-0.693\n > uniform.logpdf( 1.0 )\n ~-0.0\n > uniform.mgf( 0.8 )\n ~1.532\n > uniform.pdf( 0.8 )\n 1.0\n > uniform.quantile( 0.8 )\n 0.8\n\n",
"base.dists.uniform.variance": "\nbase.dists.uniform.variance( a, b )\n Returns the variance of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.uniform.variance( 0.0, 1.0 )\n ~0.083\n > v = base.dists.uniform.variance( 4.0, 12.0 )\n ~5.333\n > v = base.dists.uniform.variance( 2.0, 8.0 )\n 3.0\n\n",
"base.dists.weibull.cdf": "\nbase.dists.weibull.cdf( x, k, λ )\n Evaluates the cumulative distribution function (CDF) for a Weibull\n distribution with shape parameter `k` and scale parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.weibull.cdf( 2.0, 1.0, 1.0 )\n ~0.865\n > y = base.dists.weibull.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.weibull.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.weibull.cdf( NINF, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.cdf.factory( k, λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.weibull.cdf.factory( 2.0, 10.0 );\n > var y = myCDF( 12.0 )\n ~0.763\n\n",
"base.dists.weibull.entropy": "\nbase.dists.weibull.entropy( k, λ )\n Returns the differential entropy of a Weibull distribution (in nats).\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.weibull.entropy( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.entropy( 4.0, 12.0 )\n ~2.532\n > v = base.dists.weibull.entropy( 8.0, 2.0 )\n ~0.119\n\n",
"base.dists.weibull.kurtosis": "\nbase.dists.weibull.kurtosis( k, λ )\n Returns the excess kurtosis of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.weibull.kurtosis( 1.0, 1.0 )\n 6.0\n > v = base.dists.weibull.kurtosis( 4.0, 12.0 )\n ~-0.252\n > v = base.dists.weibull.kurtosis( 8.0, 2.0 )\n ~0.328\n\n",
"base.dists.weibull.logcdf": "\nbase.dists.weibull.logcdf( x, k, λ )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Weibull distribution with shape parameter `k` and scale parameter `λ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.weibull.logcdf( 2.0, 1.0, 1.0 )\n ~-0.145\n > y = base.dists.weibull.logcdf( -1.0, 2.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logcdf( PINF, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.logcdf( NINF, 4.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.logcdf.factory( k, λ)\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Weibull distribution with scale parameter\n `λ` and shape parameter `k`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.weibull.logcdf.factory( 2.0, 10.0 );\n > var y = mylogcdf( 12.0 )\n ~-0.27\n\n",
"base.dists.weibull.logpdf": "\nbase.dists.weibull.logpdf( x, k, λ )\n Evaluates the logarithm of the probability density function (PDF) for a\n Weibull distribution with shape parameter `k` and scale parameter `λ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.weibull.logpdf( 2.0, 1.0, 0.5 )\n ~-3.307\n > y = base.dists.weibull.logpdf( 0.1, 1.0, 1.0 )\n ~-0.1\n > y = base.dists.weibull.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logpdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.weibull.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.logpdf.factory( k, λ )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Weibull distribution with shape parameter `k` and scale\n parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylofpdf = base.dists.weibull.logpdf.factory( 7.0, 6.0 );\n > y = mylofpdf( 7.0 )\n ~-1.863\n\n",
"base.dists.weibull.mean": "\nbase.dists.weibull.mean( k, λ )\n Returns the expected value of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.weibull.mean( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.mean( 4.0, 12.0 )\n ~10.877\n > v = base.dists.weibull.mean( 8.0, 2.0 )\n ~1.883\n\n",
"base.dists.weibull.median": "\nbase.dists.weibull.median( k, λ )\n Returns the median of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.weibull.median( 1.0, 1.0 )\n ~0.693\n > v = base.dists.weibull.median( 4.0, 12.0 )\n ~10.949\n > v = base.dists.weibull.median( 8.0, 2.0 )\n ~1.91\n\n",
"base.dists.weibull.mgf": "\nbase.dists.weibull.mgf( x, k, λ )\n Evaluates the moment-generating function (MGF) for a Weibull distribution\n with shape parameter `k` and scale parameter `λ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.weibull.mgf( 1.0, 1.0, 0.5 )\n ~2.0\n > y = base.dists.weibull.mgf( -1.0, 4.0, 4.0 )\n ~0.019\n\n > y = base.dists.weibull.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.weibull.mgf( 0.2, -1.0, 0.5 )\n NaN\n > y = base.dists.weibull.mgf( 0.2, 0.0, 0.5 )\n NaN\n\n > y = base.dists.weibull.mgf( 0.2, 0.5, -1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.2, 0.5, 0.0 )\n NaN\n\n\nbase.dists.weibull.mgf.factory( k, λ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.weibull.mgf.factory( 8.0, 10.0 );\n > var y = myMGF( 0.8 )\n ~3150.149\n > y = myMGF( 0.08 )\n ~2.137\n\n",
"base.dists.weibull.mode": "\nbase.dists.weibull.mode( k, λ )\n Returns the mode of a Weibull distribution.\n\n If `0 < k <= 1`, the function returns `0.0`.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.weibull.mode( 1.0, 1.0 )\n 0.0\n > v = base.dists.weibull.mode( 4.0, 12.0 )\n ~11.167\n > v = base.dists.weibull.mode( 8.0, 2.0 )\n ~1.967\n\n",
"base.dists.weibull.pdf": "\nbase.dists.weibull.pdf( x, k, λ )\n Evaluates the probability density function (PDF) for a Weibull distribution\n with shape parameter `k` and scale parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.weibull.pdf( 2.0, 1.0, 0.5 )\n ~0.037\n > y = base.dists.weibull.pdf( 0.1, 1.0, 1.0 )\n ~0.905\n > y = base.dists.weibull.pdf( -1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.pdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.weibull.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.pdf.factory( k, λ )\n Returns a function for evaluating the probability density function (PDF) of\n a Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.weibull.pdf.factory( 7.0, 6.0 );\n > var y = myPDF( 7.0 )\n ~0.155\n\n",
"base.dists.weibull.quantile": "\nbase.dists.weibull.quantile( p, k, λ )\n Evaluates the quantile function for a Weibull distribution with scale\n parameter `k` and shape parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.weibull.quantile( 0.8, 1.0, 1.0 )\n ~1.609\n > y = base.dists.weibull.quantile( 0.5, 2.0, 4.0 )\n ~3.33\n\n > y = base.dists.weibull.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.weibull.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.weibull.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.quantile.factory( k, λ )\n Returns a function for evaluating the quantile function of a Weibull\n distribution with scale parameter `k` and shape parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.weibull.quantile.factory( 2.0, 10.0 );\n > var y = myQuantile( 0.4 )\n ~7.147\n\n",
"base.dists.weibull.skewness": "\nbase.dists.weibull.skewness( k, λ )\n Returns the skewness of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.weibull.skewness( 1.0, 1.0 )\n 2.0\n > v = base.dists.weibull.skewness( 4.0, 12.0 )\n ~-0.087\n > v = base.dists.weibull.skewness( 8.0, 2.0 )\n ~-0.534\n\n",
"base.dists.weibull.stdev": "\nbase.dists.weibull.stdev( k, λ )\n Returns the standard deviation of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.weibull.stdev( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.stdev( 4.0, 12.0 )\n ~3.051\n > v = base.dists.weibull.stdev( 8.0, 2.0 )\n ~0.279\n\n",
"base.dists.weibull.variance": "\nbase.dists.weibull.variance( k, λ )\n Returns the variance of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.weibull.variance( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.variance( 4.0, 12.0 )\n ~9.311\n > v = base.dists.weibull.variance( 8.0, 2.0 )\n ~0.078\n\n",
"base.dists.weibull.Weibull": "\nbase.dists.weibull.Weibull( [k, λ] )\n Returns a Weibull distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n λ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n weibull: Object\n Distribution instance.\n\n weibull.k: number\n Shape parameter. If set, the value must be greater than `0`.\n\n weibull.lambda: number\n Scale parameter. If set, the value must be greater than `0`.\n\n weibull.entropy: number\n Read-only property which returns the differential entropy.\n\n weibull.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n weibull.mean: number\n Read-only property which returns the expected value.\n\n weibull.median: number\n Read-only property which returns the median.\n\n weibull.mode: number\n Read-only property which returns the mode.\n\n weibull.skewness: number\n Read-only property which returns the skewness.\n\n weibull.stdev: number\n Read-only property which returns the standard deviation.\n\n weibull.variance: number\n Read-only property which returns the variance.\n\n weibull.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n weibull.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n weibull.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n weibull.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n weibull.pdf: Function\n Evaluates the probability density function (PDF).\n\n weibull.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var weibull = base.dists.weibull.Weibull( 6.0, 5.0 );\n > weibull.k\n 6.0\n > weibull.lambda\n 5.0\n > weibull.entropy\n ~1.299\n > weibull.kurtosis\n ~0.035\n > weibull.mean\n ~4.639\n > weibull.median\n ~4.704\n > weibull.mode\n ~4.85\n > weibull.skewness\n ~-0.373\n > weibull.stdev\n ~0.899\n > weibull.variance\n ~0.808\n > weibull.cdf( 3.0 )\n ~0.046\n > weibull.logcdf( 3.0 )\n ~-3.088\n > weibull.logpdf( 1.0 )\n ~-7.865\n > weibull.mgf( -0.5 )\n ~0.075\n > weibull.pdf( 3.0 )\n ~0.089\n > weibull.quantile( 0.8 )\n ~5.413\n\n",
"base.epsdiff": "\nbase.epsdiff( x, y[, scale] )\n Computes the relative difference of two real numbers in units of double-\n precision floating-point epsilon.\n\n By default, the function scales the absolute difference by dividing the\n absolute difference by the maximum absolute value of `x` and `y`. To scale\n by a different function, specify a scale function name.\n\n The following `scale` functions are supported:\n\n - 'max-abs': maximum absolute value of `x` and `y` (default).\n - 'max': maximum value of `x` and `y`.\n - 'min-abs': minimum absolute value of `x` and `y`.\n - 'min': minimum value of `x` and `y`.\n - 'mean-abs': arithmetic mean of the absolute values of `x` and `y`.\n - 'mean': arithmetic mean of `x` and `y`.\n - 'x': `x` (*noncommutative*).\n - 'y': `y` (*noncommutative*).\n\n To use a custom scale function, provide a function which accepts two numeric\n arguments `x` and `y`.\n\n If computing the relative difference in units of epsilon will result in\n overflow, the function returns the maximum double-precision floating-point\n number.\n\n If the absolute difference of `x` and `y` is `0`, the relative difference is\n always `0`.\n\n If `|x| = |y| = infinity`, the function returns `NaN`.\n\n If `|x| = |-y| = infinity`, the relative difference is `+infinity`.\n\n If a `scale` function returns `0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n scale: string|Function (optional)\n Scale function. Default: `'max-abs'`.\n\n Returns\n -------\n out: number\n Relative difference in units of double-precision floating-point epsilon.\n\n Examples\n --------\n > var d = base.epsdiff( 12.15, 12.149999999999999 )\n ~0.658\n > d = base.epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' )\n ~64761.512\n\n // Custom scale function:\n > function scale( x, y ) { return ( x > y ) ? y : x; };\n > d = base.epsdiff( 1.0000000000000002, 1.0000000000000100, scale )\n ~44\n\n See Also\n --------\n base.absdiff, base.reldiff\n",
"base.erf": "\nbase.erf( x )\n Evaluates the error function.\n\n If provided `NaN`, the function returns `NaN`.\n\n As the error function is an odd function (i.e., `erf(-x) == -erf(x)`), if\n provided `-0`, the function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erf( 2.0 )\n ~0.9953\n > y = base.erf( -1.0 )\n ~-0.8427\n > y = base.erf( -0.0 )\n -0.0\n > y = base.erf( NaN )\n NaN\n\n See Also\n --------\n base.erfc, base.erfinv, base.erfcinv\n",
"base.erfc": "\nbase.erfc( x )\n Evaluates the complementary error function.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfc( 2.0 )\n ~0.0047\n > y = base.erfc( -1.0 )\n ~1.8427\n > y = base.erfc( 0.0 )\n 1.0\n > y = base.erfc( PINF )\n 0.0\n > y = base.erfc( NINF )\n 2.0\n > y = base.erfc( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfinv, base.erfcinv\n",
"base.erfcinv": "\nbase.erfcinv( x )\n Evaluates the inverse complementary error function.\n\n The domain of `x` is restricted to `[0,2]`. If `x` is outside this interval,\n the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfcinv( 0.5 )\n ~0.4769\n > y = base.erfcinv( 0.8 )\n ~0.1791\n > y = base.erfcinv( 0.0 )\n Infinity\n > y = base.erfcinv( 2.0 )\n -Infinity\n > y = base.erfcinv( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfc, base.erfinv\n",
"base.erfinv": "\nbase.erfinv( x )\n Evaluates the inverse error function.\n\n If `|x| > 1`, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n As the inverse error function is an odd function (i.e., `erfinv(-x) ==\n -erfinv(x)`), if provided `-0`, the function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfinv( 0.5 )\n ~0.4769\n > y = base.erfinv( 0.8 )\n ~0.9062\n > y = base.erfinv( 0.0 )\n 0.0\n > y = base.erfinv( -0.0 )\n -0.0\n > y = base.erfinv( -1.0 )\n -Infinity\n > y = base.erfinv( 1.0 )\n Infinity\n > y = base.erfinv( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfc, base.erfcinv\n",
"base.eta": "\nbase.eta( s )\n Evaluates the Dirichlet eta function as a function of a real variable `s`.\n\n Parameters\n ----------\n s: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.eta( 0.0 )\n 0.5\n > y = base.eta( -1.0 )\n 0.25\n > y = base.eta( 1.0 )\n ~0.6931\n > y = base.eta( 3.14 )\n ~0.9096\n > y = base.eta( NaN )\n NaN\n\n",
"base.evalpoly": "\nbase.evalpoly( c, x )\n Evaluates a polynomial.\n\n Parameters\n ----------\n c: Array<number>\n Polynomial coefficients sorted in ascending degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n out: number\n Evaluated polynomial.\n\n Examples\n --------\n > var arr = [ 3.0, 2.0, 1.0 ];\n\n // 3*10^0 + 2*10^1 + 1*10^2\n > var v = base.evalpoly( arr, 10.0 )\n 123.0\n\n\nbase.evalpoly.factory( c )\n Returns a function for evaluating a polynomial.\n\n Parameters\n ----------\n c: Array<number>\n Polynomial coefficients sorted in ascending degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a polynomial.\n\n Examples\n --------\n > var polyval = base.evalpoly.factory( [ 3.0, 2.0, 1.0 ] );\n\n // 3*10^0 + 2*10^1 + 1*10^2\n > var v = polyval( 10.0 )\n 123.0\n\n // 3*5^0 + 2*5^1 + 1*5^2\n > v = polyval( 5.0 )\n 38.0\n\n See Also\n --------\n base.evalrational\n",
"base.evalrational": "\nbase.evalrational( P, Q, x )\n Evaluates a rational function.\n\n A rational function `f(x)` is defined as\n\n P(x)\n f(x) = ----\n Q(x)\n\n where both `P(x)` and `Q(x)` are polynomials in `x`.\n\n The coefficients for both `P` and `Q` should be sorted in ascending degree.\n\n For polynomials of different degree, the coefficient array for the lower\n degree polynomial should be padded with zeros.\n\n Parameters\n ----------\n P: Array<number>\n Numerator polynomial coefficients sorted in ascending degree.\n\n Q: Array<number>\n Denominator polynomial coefficients sorted in ascending degree.\n\n x: number\n Value at which to evaluate the rational function.\n\n Returns\n -------\n out: number\n Evaluated rational function.\n\n Examples\n --------\n // 2x^3 + 4x^2 - 5x^1 - 6x^0\n > var P = [ -6.0, -5.0, 4.0, 2.0 ];\n\n // 0.5x^1 + 3x^0\n > var Q = [ 3.0, 0.5, 0.0, 0.0 ]; // zero-padded\n\n // Evaluate the rational function:\n > var v = base.evalrational( P, Q, 6.0 )\n 90.0\n\n\nbase.evalrational.factory( P, Q )\n Returns a function for evaluating a rational function.\n\n Parameters\n ----------\n P: Array<number>\n Numerator polynomial coefficients sorted in ascending degree.\n\n Q: Array<number>\n Denominator polynomial coefficients sorted in ascending degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a rational function.\n\n Examples\n --------\n > var P = [ 20.0, 8.0, 3.0 ];\n > var Q = [ 10.0, 9.0, 1.0 ];\n > var rational = base.evalrational.factory( P, Q );\n\n // (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2):\n > var v = rational( 10.0 )\n 2.0\n\n // (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2):\n > v = rational( 2.0 )\n 1.5\n\n See Also\n --------\n base.evalpoly\n",
"base.exp": "\nbase.exp( x )\n Evaluates the natural exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp( 4.0 )\n ~54.5982\n > y = base.exp( -9.0 )\n ~1.234e-4\n > y = base.exp( 0.0 )\n 1.0\n > y = base.exp( NaN )\n NaN\n\n See Also\n --------\n base.exp10, base.exp2, base.expm1, base.ln\n",
"base.exp2": "\nbase.exp2( x )\n Evaluates the base 2 exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp2( 3.0 )\n 8.0\n > y = base.exp2( -9.0 )\n ~0.002\n > y = base.exp2( 0.0 )\n 1.0\n > y = base.exp2( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.exp10\n",
"base.exp10": "\nbase.exp10( x )\n Evaluates the base 10 exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp10( 3.0 )\n 1000\n > y = base.exp10( -9.0 )\n 1.0e-9\n > y = base.exp10( 0.0 )\n 1.0\n > y = base.exp10( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.exp2\n",
"base.expm1": "\nbase.expm1( x )\n Computes `exp(x)-1`, where `exp(x)` is the natural exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.expm1( 0.2 )\n ~0.221\n > y = base.expm1( -9.0 )\n ~-1.0\n > y = base.expm1( 0.0 )\n 0.0\n > y = base.expm1( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.expm1rel\n",
"base.expm1rel": "\nbase.expm1rel( x )\n Relative error exponential.\n\n When `x` is near zero,\n\n e^x - 1\n\n can suffer catastrophic cancellation (i.e., significant loss of precision).\n This function avoids the loss of precision when `x` is near zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.expm1rel( 0.0 )\n 1.0\n > y = base.expm1rel( 1.0 )\n ~1.718\n > y = base.expm1rel( -1.0 )\n ~0.632\n > y = base.expm1rel( NaN )\n NaN\n\t\n See Also\n --------\n base.exp, base.expm1\n",
"base.exponent": "\nbase.exponent( x )\n Returns an integer corresponding to the unbiased exponent of a double-\n precision floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unbiased exponent.\n\n Examples\n --------\n > var exponent = base.exponent( 3.14e-307 )\n -1019\n > exponent = base.exponent( -3.14 )\n 1\n > exponent = base.exponent( 0.0 )\n -1023\n > exponent = base.exponent( NaN )\n 1024\n\n See Also\n --------\n base.exponentf\n",
"base.exponentf": "\nbase.exponentf( x )\n Returns an integer corresponding to the unbiased exponent of a single-\n precision floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unbiased exponent.\n\n Examples\n --------\n > var exponent = base.exponentf( base.float64ToFloat32( 3.14e34 ) )\n 114\n > exponent = base.exponentf( base.float64ToFloat32( 3.14e-34 ) )\n -112\n > exponent = base.exponentf( base.float64ToFloat32( -3.14 ) )\n 1\n > exponent = base.exponentf( 0.0 )\n -127\n > exponent = base.exponentf( NaN )\n 128\n\n See Also\n --------\n base.exponent\n",
"base.factorial": "\nbase.factorial( x )\n Evaluates the factorial of `x`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Factorial.\n\n Examples\n --------\n > var y = base.factorial( 3.0 )\n 6.0\n > y = base.factorial( -1.5 )\n ~-3.545\n > y = base.factorial( -0.5 )\n ~1.772\n > y = base.factorial( 0.5 )\n ~0.886\n > y = base.factorial( -10.0 )\n NaN\n > y = base.factorial( 171.0 )\n Infinity\n > y = base.factorial( NaN )\n NaN\n\n See Also\n --------\n base.factorialln\n",
"base.factorialln": "\nbase.factorialln( x )\n Evaluates the natural logarithm of the factorial of `x`.\n\n For input values other than negative integers, the function returns\n\n ln( x! ) = ln( Γ(x+1) )\n\n where `Γ` is the Gamma function. For negative integers, the function returns\n `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Natural logarithm of the factorial of `x`.\n\n Examples\n --------\n > var y = base.factorialln( 3.0 )\n ~1.792\n > y = base.factorialln( 2.4 )\n ~1.092\n > y = base.factorialln( -1.0 )\n NaN\n > y = base.factorialln( -1.5 )\n ~1.266\n > y = base.factorialln( NaN )\n NaN\n\n See Also\n --------\n base.factorial\n",
"base.fallingFactorial": "\nbase.fallingFactorial( x, n )\n Computes the falling factorial of `x` and `n`.\n\n If not provided a non-negative integer for `n`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n n: integer\n Second function parameter.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.fallingFactorial( 0.9, 5 )\n ~0.644\n > v = base.fallingFactorial( -9.0, 3 )\n -990.0\n > v = base.fallingFactorial( 0.0, 2 )\n 0.0\n > v = base.fallingFactorial( 3.0, -2 )\n NaN\n\n See Also\n --------\n base.risingFactorial\n",
"base.fibonacci": "\nbase.fibonacci( n )\n Computes the nth Fibonacci number.\n\n Fibonacci numbers follow the recurrence relation\n\n F_n = F_{n-1} + F_{n-2}\n\n with seed values F_0 = 0 and F_1 = 1.\n\n If `n` is greater than `78`, the function returns `NaN`, as larger Fibonacci\n numbers cannot be accurately represented due to limitations of double-\n precision floating-point format.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n Fibonacci number.\n\n Examples\n --------\n > var y = base.fibonacci( 0 )\n 0\n > y = base.fibonacci( 1 )\n 1\n > y = base.fibonacci( 2 )\n 1\n > y = base.fibonacci( 3 )\n 2\n > y = base.fibonacci( 4 )\n 3\n > y = base.fibonacci( 79 )\n NaN\n > y = base.fibonacci( NaN )\n NaN\n\n See Also\n --------\n base.binet, base.fibonacciIndex, base.lucas, base.negafibonacci\n",
"base.fibonacciIndex": "\nbase.fibonacciIndex( F )\n Computes the Fibonacci number index.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `F <= 1` or `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n F: integer\n Fibonacci number.\n\n Returns\n -------\n n: number\n Fibonacci number index.\n\n Examples\n --------\n > var n = base.fibonacciIndex( 2 )\n 3\n > n = base.fibonacciIndex( 3 )\n 4\n > n = base.fibonacciIndex( 5 )\n 5\n > n = base.fibonacciIndex( NaN )\n NaN\n > n = base.fibonacciIndex( 1 )\n NaN\n\n See Also\n --------\n base.fibonacci\n",
"base.fibpoly": "\nbase.fibpoly( n, x )\n Evaluates a Fibonacci polynomial.\n\n Parameters\n ----------\n n: integer\n Fibonacci polynomial to evaluate.\n\n x: number\n Value at which to evaluate the Fibonacci polynomial.\n\n Returns\n -------\n out: number\n Evaluated Fibonacci polynomial.\n\n Examples\n --------\n // 2^4 + 3*2^2 + 1\n > var v = base.fibpoly( 5, 2.0 )\n 29.0\n\n\nbase.fibpoly.factory( n )\n Returns a function for evaluating a Fibonacci polynomial.\n\n Parameters\n ----------\n n: integer\n Fibonacci polynomial to evaluate.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a Fibonacci polynomial.\n\n Examples\n --------\n > var polyval = base.fibpoly.factory( 5 );\n\n // 1^4 + 3*1^2 + 1\n > var v = polyval( 1.0 )\n 5.0\n\n // 2^4 + 3*2^2 + 1\n > v = polyval( 2.0 )\n 29.0\n\n See Also\n --------\n base.evalpoly, base.lucaspoly\n",
"base.flipsign": "\nbase.flipsign( x, y )\n Returns a double-precision floating-point number with the magnitude of `x`\n and the sign of `x*y`.\n\n The function only returns `-x` when `y` is a negative number.\n\n According to the IEEE 754 standard, a `NaN` has a biased exponent equal to\n `2047`, a significand greater than `0`, and a sign bit equal to either `1`\n or `0`. In which case, `NaN` may not correspond to just one but many binary\n representations. Accordingly, care should be taken to ensure that `y` is not\n `NaN`, else behavior may be indeterminate.\n\n Parameters\n ----------\n x: number\n Number from which to derive a magnitude.\n\n y: number\n Number from which to derive a sign.\n\n Returns\n -------\n z: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var z = base.flipsign( -3.14, 10.0 )\n -3.14\n > z = base.flipsign( -3.14, -1.0 )\n 3.14\n > z = base.flipsign( 1.0, -0.0 )\n -1.0\n > z = base.flipsign( -3.14, -0.0 )\n 3.14\n > z = base.flipsign( -0.0, 1.0 )\n -0.0\n > z = base.flipsign( 0.0, -1.0 )\n -0.0\n\n See Also\n --------\n base.copysign\n",
"base.float32ToInt32": "\nbase.float32ToInt32( x )\n Converts a single-precision floating-point number to a signed 32-bit\n integer.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.float32ToInt32( base.float64ToFloat32( 4294967295.0 ) )\n -1\n > y = base.float32ToInt32( base.float64ToFloat32( 3.14 ) )\n 3\n > y = base.float32ToInt32( base.float64ToFloat32( -3.14 ) )\n -3\n > y = base.float32ToInt32( base.float64ToFloat32( NaN ) )\n 0\n > y = base.float32ToInt32( FLOAT32_PINF )\n 0\n > y = base.float32ToInt32( FLOAT32_NINF )\n 0\n\n See Also\n --------\n base.float32ToUint32",
"base.float32ToUint32": "\nbase.float32ToUint32( x )\n Converts a single-precision floating-point number to a unsigned 32-bit\n integer.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.float32ToUint32( base.float64ToFloat32( 4294967297.0 ) )\n 1\n > y = base.float32ToUint32( base.float64ToFloat32( 3.14 ) )\n 3\n > y = base.float32ToUint32( base.float64ToFloat32( -3.14 ) )\n 4294967293\n > y = base.float32ToUint32( base.float64ToFloat32( NaN ) )\n 0\n > y = base.float32ToUint32( FLOAT32_PINF )\n 0\n > y = base.float32ToUint32( FLOAT32_NINF )\n 0\n\n See Also\n --------\n base.float32ToInt32",
"base.float64ToFloat32": "\nbase.float64ToFloat32( x )\n Converts a double-precision floating-point number to the nearest single-\n precision floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: float\n Nearest single-precision floating-point number.\n\n Examples\n --------\n > var y = base.float64ToFloat32( 1.337 )\n 1.3370000123977661\n",
"base.float64ToInt32": "\nbase.float64ToInt32( x )\n Converts a double-precision floating-point number to a signed 32-bit\n integer.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.float64ToInt32( 4294967295.0 )\n -1\n > y = base.float64ToInt32( 3.14 )\n 3\n > y = base.float64ToInt32( -3.14 )\n -3\n > y = base.float64ToInt32( NaN )\n 0\n > y = base.float64ToInt32( PINF )\n 0\n > y = base.float64ToInt32( NINF )\n 0\n\n See Also\n --------\n base.float64ToUint32",
"base.float64ToUint32": "\nbase.float64ToUint32( x )\n Converts a double-precision floating-point number to a unsigned 32-bit\n integer.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.float64ToUint32( 4294967297.0 )\n 1\n > y = base.float64ToUint32( 3.14 )\n 3\n > y = base.float64ToUint32( -3.14 )\n 4294967293\n > y = base.float64ToUint32( NaN )\n 0\n > y = base.float64ToUint32( PINF )\n 0\n > y = base.float64ToUint32( NINF )\n 0\n\n See Also\n --------\n base.float64ToInt32",
"base.floor": "\nbase.floor( x )\n Rounds a numeric value toward negative infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor( 3.14 )\n 3.0\n > y = base.floor( -4.2 )\n -5.0\n > y = base.floor( -4.6 )\n -5.0\n > y = base.floor( 9.5 )\n 9.0\n > y = base.floor( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.round\n",
"base.floor2": "\nbase.floor2( x )\n Rounds a numeric value to the nearest power of two toward negative infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor2( 3.14 )\n 2.0\n > y = base.floor2( -4.2 )\n -8.0\n > y = base.floor2( -4.6 )\n -8.0\n > y = base.floor2( 9.5 )\n 8.0\n > y = base.floor2( 13.0 )\n 8.0\n > y = base.floor2( -13.0 )\n -16.0\n > y = base.floor2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor, base.floor10, base.round2\n",
"base.floor10": "\nbase.floor10( x )\n Rounds a numeric value to the nearest power of ten toward negative infinity.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor10( 3.14 )\n 1.0\n > y = base.floor10( -4.2 )\n -10.0\n > y = base.floor10( -4.6 )\n -10.0\n > y = base.floor10( 9.5 )\n 1.0\n > y = base.floor10( 13.0 )\n 10.0\n > y = base.floor10( -13.0 )\n -100.0\n > y = base.floor10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor, base.floor2, base.round10\n",
"base.floorb": "\nbase.floorb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward negative\n infinity.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.floorb( 3.14159, -4, 10 )\n 3.1415\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.floorb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two toward negative infinity:\n > y = base.floorb( 5.0, 1, 2 )\n 4.0\n\n See Also\n --------\n base.ceilb, base.floor, base.floorn, base.roundb\n",
"base.floorn": "\nbase.floorn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward negative\n infinity.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.floorn( 3.14159, -4 )\n 3.1415\n\n // If `n = 0`, standard round toward negative infinity behavior:\n > y = base.floorn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.floorn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floor, base.floorb, base.roundn\n",
"base.floorsd": "\nbase.floorsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward negative infinity with\n `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floorsd( 3.14159, 5 )\n 3.1415\n > y = base.floorsd( 3.14159, 1 )\n 3.0\n > y = base.floorsd( 12368.0, 2 )\n 12000.0\n > y = base.floorsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floor, base.roundsd, base.truncsd\n",
"base.fresnel": "\nbase.fresnel( [out,] x )\n Computes the Fresnel integrals S(x) and C(x).\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value.\n\n Returns\n -------\n y: Array|TypedArray|Object\n S(x) and C(x).\n\n Examples\n --------\n > var y = base.fresnel( 0.0 )\n [ ~0.0, ~0.0 ]\n > y = base.fresnel( 1.0 )\n [ ~0.438, ~0.780 ]\n > y = base.fresnel( PINF )\n [ ~0.5, ~0.5 ]\n > y = base.fresnel( NINF )\n [ ~-0.5, ~-0.5 ]\n > y = base.fresnel( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.fresnel( out, 0.0 )\n <Float64Array>[ ~0.0, ~0.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.fresnelc, base.fresnels\n",
"base.fresnelc": "\nbase.fresnelc( x )\n Computes the Fresnel integral C(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n C(x).\n\n Examples\n --------\n > var y = base.fresnelc( 0.0 )\n ~0.0\n > y = base.fresnelc( 1.0 )\n ~0.780\n > y = base.fresnelc( PINF )\n ~0.5\n > y = base.fresnelc( NINF )\n ~-0.5\n > y = base.fresnelc( NaN )\n NaN\n\n See Also\n --------\n base.fresnel, base.fresnels\n",
"base.fresnels": "\nbase.fresnels( x )\n Computes the Fresnel integral S(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n S(x).\n\n Examples\n --------\n > var y = base.fresnels( 0.0 )\n ~0.0\n > y = base.fresnels( 1.0 )\n ~0.438\n > y = base.fresnels( PINF )\n ~0.5\n > y = base.fresnels( NINF )\n ~-0.5\n > y = base.fresnels( NaN )\n NaN\n\n See Also\n --------\n base.fresnel, base.fresnelc\n",
"base.frexp": "\nbase.frexp( [out,] x )\n Splits a double-precision floating-point number into a normalized fraction\n and an integer power of two.\n\n The first element of the returned array is the normalized fraction and the\n second is the exponent. The normalized fraction and exponent satisfy the\n relation\n\n x = frac * 2^exp\n\n If provided positive or negative zero, `NaN`, or positive or negative\n infinity, the function returns a two-element array containing the input\n value and an exponent equal to zero.\n\n For all other numeric input values, the absolute value of the normalized\n fraction resides on the interval [0.5,1).\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n out: Array|TypedArray|Object\n A normalized fraction and an exponent.\n\n Examples\n --------\n > var out = base.frexp( 4.0 )\n [ 0.5, 3 ]\n > out = base.frexp( 0.0 )\n [ 0.0, 0 ]\n > out = base.frexp( -0.0 )\n [ -0.0, 0 ]\n > out = base.frexp( NaN )\n [ NaN, 0 ]\n > out = base.frexp( PINF )\n [ Infinity, 0 ]\n > out = base.frexp( NINF )\n [ -Infinity, 0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var y = base.frexp( out, 4.0 )\n <Float64Array>[ 0.5, 3 ]\n > var bool = ( y === out )\n true\n\n See Also\n --------\n base.ldexp\n",
"base.fromBinaryString": "\nbase.fromBinaryString( bstr )\n Creates a double-precision floating-point number from a literal bit\n representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var bstr;\n > bstr = '0100000000010000000000000000000000000000000000000000000000000000';\n > var val = base.fromBinaryString( bstr )\n 4.0\n > bstr = '0100000000001001001000011111101101010100010001000010110100011000';\n > val = base.fromBinaryString( bstr )\n 3.141592653589793\n > bstr = '1111111111100001110011001111001110000101111010111100100010100000';\n > val = base.fromBinaryString( bstr )\n -1.0e308\n\n // The function handles subnormals:\n > bstr = '1000000000000000000000000000000000000000000000000001100011010011';\n > val = base.fromBinaryString( bstr )\n -3.14e-320\n > bstr = '0000000000000000000000000000000000000000000000000000000000000001';\n > val = base.fromBinaryString( bstr )\n 5.0e-324\n\n // The function handles special values:\n > bstr = '0000000000000000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n 0.0\n > bstr = '1000000000000000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n -0.0\n > bstr = '0111111111111000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n NaN\n > bstr = '0111111111110000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n Infinity\n > bstr = '1111111111110000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n -Infinity\n\n See Also\n --------\n base.fromBinaryStringf, base.toBinaryString\n",
"base.fromBinaryStringf": "\nbase.fromBinaryStringf( bstr )\n Creates a single-precision floating-point number from an IEEE 754 literal\n bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: float\n Single-precision floating-point number.\n\n Examples\n --------\n > var bstr = '01000000100000000000000000000000';\n > var val = base.fromBinaryStringf( bstr )\n 4.0\n > bstr = '01000000010010010000111111011011';\n > val = base.fromBinaryStringf( bstr )\n ~3.14\n > bstr = '11111111011011000011101000110011';\n > val = base.fromBinaryStringf( bstr )\n ~-3.14e+38\n\n // The function handles subnormals:\n > bstr = '10000000000000000000000000010110';\n > val = base.fromBinaryStringf( bstr )\n ~-3.08e-44\n > bstr = '00000000000000000000000000000001';\n > val = base.fromBinaryStringf( bstr )\n ~1.40e-45\n\n // The function handles special values:\n > bstr = '00000000000000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n 0.0\n > bstr = '10000000000000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n -0.0\n > bstr = '01111111110000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n NaN\n > bstr = '01111111100000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n Infinity\n > bstr = '11111111100000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n -Infinity\n\n See Also\n --------\n base.toBinaryStringf, base.fromBinaryString\n",
"base.fromBinaryStringUint8": "\nbase.fromBinaryStringUint8( bstr )\n Creates an unsigned 8-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 8-bit integer.\n\n Examples\n --------\n > var bstr = '01010101';\n > var val = base.fromBinaryStringUint8( bstr )\n 85\n > bstr = '00000000';\n > val = base.fromBinaryStringUint8( bstr )\n 0\n > bstr = '00000010';\n > val = base.fromBinaryStringUint8( bstr )\n 2\n > bstr = '11111111';\n > val = base.fromBinaryStringUint8( bstr )\n 255\n\n See Also\n --------\n base.fromBinaryStringUint16, base.fromBinaryStringUint32, base.toBinaryStringUint8\n",
"base.fromBinaryStringUint16": "\nbase.fromBinaryStringUint16( bstr )\n Creates an unsigned 16-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 16-bit integer.\n\n Examples\n --------\n > var bstr = '0101010101010101';\n > var val = base.fromBinaryStringUint16( bstr )\n 21845\n > bstr = '0000000000000000';\n > val = base.fromBinaryStringUint16( bstr )\n 0\n > bstr = '0000000000000010';\n > val = base.fromBinaryStringUint16( bstr )\n 2\n > bstr = '1111111111111111';\n > val = base.fromBinaryStringUint16( bstr )\n 65535\n\n See Also\n --------\n base.toBinaryStringUint16, base.fromBinaryStringUint32, base.fromBinaryStringUint8\n",
"base.fromBinaryStringUint32": "\nbase.fromBinaryStringUint32( bstr )\n Creates an unsigned 32-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var bstr = '01010101010101010101010101010101';\n > var val = base.fromBinaryStringUint32( bstr )\n 1431655765\n > bstr = '00000000000000000000000000000000';\n > val = base.fromBinaryStringUint32( bstr )\n 0\n > bstr = '00000000000000000000000000000010';\n > val = base.fromBinaryStringUint32( bstr )\n 2\n > bstr = '11111111111111111111111111111111';\n > val = base.fromBinaryStringUint32( bstr )\n 4294967295\n\n See Also\n --------\n base.fromBinaryStringUint16, base.toBinaryStringUint32, base.fromBinaryStringUint8\n",
"base.fromWordf": "\nbase.fromWordf( x )\n Creates a single-precision floating-point number from an unsigned integer\n corresponding to an IEEE 754 binary representation.\n\n Parameters\n ----------\n x: integer\n Unsigned integer.\n\n Returns\n -------\n out: float\n Single-precision floating-point number.\n\n Examples\n --------\n > var word = 1068180177; // => 0 01111111 01010110010001011010001\n > var f32 = base.fromWordf( word ) // when printed, promoted to float64\n 1.3370000123977661\n\n See Also\n --------\n base.fromWords\n",
"base.fromWords": "\nbase.fromWords( high, low )\n Creates a double-precision floating-point number from a higher order word\n (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n\n Parameters\n ----------\n high: integer\n Higher order word (unsigned 32-bit integer).\n\n low: integer\n Lower order word (unsigned 32-bit integer).\n\n Returns\n -------\n out: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var v = base.fromWords( 1774486211, 2479577218 )\n 3.14e201\n > v = base.fromWords( 3221823995, 1413754136 )\n -3.141592653589793\n > v = base.fromWords( 0, 0 )\n 0.0\n > v = base.fromWords( 2147483648, 0 )\n -0.0\n > v = base.fromWords( 2146959360, 0 )\n NaN\n > v = base.fromWords( 2146435072, 0 )\n Infinity\n > v = base.fromWords( 4293918720, 0 )\n -Infinity\n\n See Also\n --------\n base.fromWordf\n",
"base.gamma": "\nbase.gamma( x )\n Evaluates the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gamma( 4.0 )\n 6.0\n > y = base.gamma( -1.5 )\n ~2.363\n > y = base.gamma( -0.5 )\n ~-3.545\n > y = base.gamma( 0.5 )\n ~1.772\n > y = base.gamma( 0.0 )\n Infinity\n > y = base.gamma( -0.0 )\n -Infinity\n > y = base.gamma( NaN )\n NaN\n\n See Also\n --------\n base.gamma1pm1, base.gammainc, base.gammaincinv, base.gammaln\n",
"base.gamma1pm1": "\nbase.gamma1pm1( x )\n Computes `gamma(x+1) - 1` without cancellation errors, where `gamma(x)` is\n the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gamma1pm1( 0.2 )\n ~-0.082\n > y = base.gamma1pm1( -6.7 )\n ~-0.991\n > y = base.gamma1pm1( 0.0 )\n 0.0\n > y = base.gamma1pm1( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammainc, base.gammaincinv, base.gammaln\n",
"base.gammaDeltaRatio": "\nbase.gammaDeltaRatio( z, delta )\n Computes the ratio of two gamma functions.\n\n The ratio is defined as: Γ(z) / Γ(z+Δ).\n\n Parameters\n ----------\n z: number\n First gamma parameter.\n\n delta: number\n Difference.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammaDeltaRatio( 2.0, 3.0 )\n ~0.042\n > y = base.gammaDeltaRatio( 4.0, 0.5 )\n ~0.516\n > y = base.gammaDeltaRatio( 100.0, 0.0 )\n 1.0\n > y = base.gammaDeltaRatio( NaN, 3.0 )\n NaN\n > y = base.gammaDeltaRatio( 5.0, NaN )\n NaN\n > y = base.gammaDeltaRatio( NaN, NaN )\n NaN\n\n See Also\n --------\n base.gamma\n",
"base.gammainc": "\nbase.gammainc( x, s[, regularized[, upper]] )\n Computes the regularized incomplete gamma function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete gamma functions, respectively.\n\n If provided `x < 0` or `s <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n s: number\n Second function parameter.\n\n regularized: boolean (optional)\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete gamma function. Default: `true`.\n\n upper: boolean (optional)\n Boolean indicating whether the function should return the upper tail of\n the incomplete gamma function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammainc( 6.0, 2.0 )\n ~0.9826\n > y = base.gammainc( 1.0, 2.0, true, true )\n ~0.7358\n > y = base.gammainc( 7.0, 5.0 )\n ~0.8270\n > y = base.gammainc( 7.0, 5.0, false )\n ~19.8482\n > y = base.gammainc( NaN, 2.0 )\n NaN\n > y = base.gammainc( 6.0, NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gamma1pm1, base.gammaincinv, base.gammaln\n",
"base.gammaincinv": "\nbase.gammaincinv( p, a[, upper] )\n Computes the inverse of the lower incomplete gamma function.\n\n In contrast to a more commonly used definition, the first argument is the\n probability `p` and the second argument is the scale factor `a`.\n\n By default, the function inverts the lower regularized incomplete gamma\n function, `P(x,a)`. To invert the upper function `Q(x,a)`, set the `upper`\n argument to `true`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Probability.\n\n a: number\n Scale parameter.\n\n upper: boolean (optional)\n Boolean indicating if the function should invert the upper tail of the\n incomplete gamma function; i.e., compute `xr` such that `Q(a,xr) = p`.\n Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammaincinv( 0.5, 2.0 )\n ~1.678\n > y = base.gammaincinv( 0.1, 10.0 )\n ~6.221\n > y = base.gammaincinv( 0.75, 3.0 )\n ~3.92\n > y = base.gammaincinv( 0.75, 3.0, true )\n ~1.727\n > y = base.gammaincinv( 0.75, NaN )\n NaN\n > y = base.gammaincinv( NaN, 3.0 )\n NaN\n\n See Also\n --------\n base.gamma, base.gamma1pm1, base.gammainc, base.gammaln\n",
"base.gammaLanczosSum": "\nbase.gammaLanczosSum( x )\n Calculates the Lanczos sum for the approximation of the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Lanczos sum.\n\n Examples\n --------\n > var y = base.gammaLanczosSum( 4.0 )\n ~950.366\n > y = base.gammaLanczosSum( -1.5 )\n ~1373366.245\n > y = base.gammaLanczosSum( -0.5 )\n ~-699841.735\n > y = base.gammaLanczosSum( 0.5 )\n ~96074.186\n > y = base.gammaLanczosSum( 0.0 )\n Infinity\n > y = base.gammaLanczosSum( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammaLanczosSumExpGScaled\n",
"base.gammaLanczosSumExpGScaled": "\nbase.gammaLanczosSumExpGScaled( x )\n Calculates the scaled Lanczos sum for the approximation of the gamma\n function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Scaled Lanczos sum.\n\n Examples\n --------\n > var y = base.gammaLanczosSumExpGScaled( 4.0 )\n ~0.018\n > y = base.gammaLanczosSumExpGScaled( -1.5 )\n ~25.337\n > y = base.gammaLanczosSumExpGScaled( -0.5 )\n ~-12.911\n > y = base.gammaLanczosSumExpGScaled( 0.5 )\n ~1.772\n > y = base.gammaLanczosSumExpGScaled( 0.0 )\n Infinity\n > y = base.gammaLanczosSumExpGScaled( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammaLanczosSum\n",
"base.gammaln": "\nbase.gammaln( x )\n Evaluates the natural logarithm of the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Natural logarithm of the gamma function.\n\n Examples\n --------\n > var y = base.gammaln( 1.0 )\n 0.0\n > y = base.gammaln( 2.0 )\n 0.0\n > y = base.gammaln( 4.0 )\n ~1.792\n > y = base.gammaln( -0.5 )\n ~1.266\n > y = base.gammaln( 0.5 )\n ~0.572\n > y = base.gammaln( 0.0 )\n Infinity\n > y = base.gammaln( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammainc, base.gammaincinv\n",
"base.gasum": "\nbase.gasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Array<number>|TypedArray\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n > var sum = base.gasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.gasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.gasum( N, x1, stride )\n 12.0\n\n\nbase.gasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Array<number>|TypedArray\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n > var sum = base.gasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n > sum = base.gasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n See Also\n --------\n base.dasum, base.sasum\n",
"base.gaxpy": "\nbase.gaxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n > var alpha = 5.0;\n > base.gaxpy( x.length, alpha, x, 1, y, 1 )\n [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > base.gaxpy( N, alpha, x, 2, y, -1 )\n [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.gaxpy( N, 5.0, x1, -2, y1, 1 )\n [ 40.0, 33.0, 22.0 ]\n > y0\n [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.gaxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n > var alpha = 5.0;\n > base.gaxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gaxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n See Also\n --------\n base.daxpy, base.saxpy\n",
"base.gcd": "\nbase.gcd( a, b )\n Computes the greatest common divisor (gcd).\n\n If both `a` and `b` are `0`, the function returns `0`.\n\n Both `a` and `b` must have integer values; otherwise, the function returns\n `NaN`.\n\n Parameters\n ----------\n a: integer\n First integer.\n\n b: integer\n Second integer.\n\n Returns\n -------\n out: integer\n Greatest common divisor.\n\n Examples\n --------\n > var v = base.gcd( 48, 18 )\n 6\n\n See Also\n --------\n base.lcm\n",
"base.gcopy": "\nbase.gcopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n > base.gcopy( x.length, x, 1, y, 1 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gcopy( N, x, -2, y, 1 )\n [ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.gcopy( N, x1, -2, y1, 1 )\n <Float64Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.gcopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n > base.gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gcopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dcopy\n",
"base.getHighWord": "\nbase.getHighWord( x )\n Returns an unsigned 32-bit integer corresponding to the more significant 32\n bits of a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: integer\n Higher order word (unsigned 32-bit integer).\n\n Examples\n --------\n > var w = base.getHighWord( 3.14e201 )\n 1774486211\n\n See Also\n --------\n base.getLowWord, base.setHighWord\n",
"base.getLowWord": "\nbase.getLowWord( x )\n Returns an unsigned 32-bit integer corresponding to the less significant 32\n bits of a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: integer\n Lower order word (unsigned 32-bit integer).\n\n Examples\n --------\n > var w = base.getLowWord( 3.14e201 )\n 2479577218\n\n See Also\n --------\n base.getHighWord, base.setHighWord\n",
"base.hacovercos": "\nbase.hacovercos( x )\n Computes the half-value coversed cosine.\n\n The half-value coversed cosine is defined as `(1 + sin(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value coversed cosine.\n\n Examples\n --------\n > var y = base.hacovercos( 3.14 )\n ~0.5008\n > y = base.hacovercos( -4.2 )\n ~0.9358\n > y = base.hacovercos( -4.6 )\n ~0.9968\n > y = base.hacovercos( 9.5 )\n ~0.4624\n > y = base.hacovercos( -0.0 )\n 0.5\n\n See Also\n --------\n base.hacoversin, base.havercos\n",
"base.hacoversin": "\nbase.hacoversin( x )\n Computes the half-value coversed sine.\n\n The half-value coversed sine is defined as `(1 - sin(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value coversed sine.\n\n Examples\n --------\n > var y = base.hacoversin( 3.14 )\n ~0.4992\n > y = base.hacoversin( -4.2 )\n ~0.0642\n > y = base.hacoversin( -4.6 )\n ~0.0032\n > y = base.hacoversin( 9.5 )\n ~0.538\n > y = base.hacoversin( -0.0 )\n 0.5\n\n See Also\n --------\n base.hacovercos, base.haversin\n",
"base.havercos": "\nbase.havercos( x )\n Computes the half-value versed cosine.\n\n The half-value versed cosine is defined as `(1 + cos(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value versed cosine.\n\n Examples\n --------\n > var y = base.havercos( 3.14 )\n ~0.0\n > y = base.havercos( -4.2 )\n ~0.2549\n > y = base.havercos( -4.6 )\n ~0.4439\n > y = base.havercos( 9.5 )\n ~0.0014\n > y = base.havercos( -0.0 )\n 1.0\n\n See Also\n --------\n base.haversin, base.vercos\n",
"base.haversin": "\nbase.haversin( x )\n Computes the half-value versed sine.\n\n The half-value versed sine is defined as `(1 - cos(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value versed sine.\n\n Examples\n --------\n > var y = base.haversin( 3.14 )\n ~1.0\n > y = base.haversin( -4.2 )\n ~0.7451\n > y = base.haversin( -4.6 )\n ~0.5561\n > y = base.haversin( 9.5 )\n ~0.9986\n > y = base.haversin( -0.0 )\n 0.0\n\n See Also\n --------\n base.havercos, base.versin\n",
"base.heaviside": "\nbase.heaviside( x[, continuity] )\n Evaluates the Heaviside function.\n\n The `continuity` parameter may be one of the following:\n\n - 'half-maximum': if `x == 0`, the function returns `0.5`.\n - 'left-continuous': if `x == 0`, the function returns `0`.\n - 'right-continuous': if `x == 0`, the function returns `1`.\n\n By default, if `x == 0`, the function returns `NaN` (i.e., the function is\n discontinuous).\n\n Parameters\n ----------\n x: number\n Input value.\n\n continuity: string (optional)\n Specifies how to handle `x == 0`. By default, if `x == 0`, the function\n returns `NaN`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.heaviside( 3.14 )\n 1.0\n > y = base.heaviside( -3.14 )\n 0.0\n > y = base.heaviside( 0.0 )\n NaN\n > y = base.heaviside( 0.0, 'half-maximum' )\n 0.5\n > y = base.heaviside( 0.0, 'left-continuous' )\n 0.0\n > y = base.heaviside( 0.0, 'right-continuous' )\n 1.0\n\n See Also\n --------\n base.ramp\n",
"base.hermitepoly": "\nbase.hermitepoly( n, x )\n Evaluates a physicist's Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.hermitepoly( 1, 0.5 )\n 1.0\n > y = base.hermitepoly( -1, 0.5 )\n NaN\n > y = base.hermitepoly( 0, 0.5 )\n 1.0\n > y = base.hermitepoly( 2, 0.5 )\n -1.0\n\n\nbase.hermitepoly.factory( n )\n Returns a function for evaluating a physicist's Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a physicist's Hermite polynomial.\n\n Examples\n --------\n > var polyval = base.hermitepoly.factory( 2 );\n > var v = polyval( 0.5 )\n -1.0\n\n See Also\n --------\n base.evalpoly, base.normhermitepoly\n",
"base.hypot": "\nbase.hypot( x, y )\n Computes the hypotenuse avoiding overflow and underflow.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = base.hypot( -5.0, 12.0 )\n 13.0\n > h = base.hypot( NaN, 12.0 )\n NaN\n > h = base.hypot( -0.0, -0.0 )\n 0.0\n\n",
"base.imul": "\nbase.imul( a, b )\n Performs C-like multiplication of two signed 32-bit integers.\n\n Parameters\n ----------\n a: integer\n Signed 32-bit integer.\n\n b: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Product.\n\n Examples\n --------\n > var v = base.imul( -10|0, 4|0 )\n -40\n\n See Also\n --------\n base.imuldw, base.uimul\n",
"base.imuldw": "\nbase.imuldw( [out,] a, b )\n Multiplies two signed 32-bit integers and returns an array of two signed 32-\n bit integers which represents the signed 64-bit integer product.\n\n When computing the product of 32-bit integer values in double-precision\n floating-point format (the default JavaScript numeric data type), computing\n the double word product is necessary in order to avoid exceeding the maximum\n safe double-precision floating-point integer value.\n\n Parameters\n ----------\n out: ArrayLikeObject (optional)\n The output array.\n\n a: integer\n Signed 32-bit integer.\n\n b: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: ArrayLikeObject\n Double word product (in big endian order; i.e., the first element\n corresponds to the most significant bits and the second element to the\n least significant bits).\n\n Examples\n --------\n > var v = base.imuldw( 1, 10 )\n [ 0, 10 ]\n\n See Also\n --------\n base.imul, base.uimuldw\n",
"base.int32ToUint32": "\nbase.int32ToUint32( x )\n Converts a signed 32-bit integer to an unsigned 32-bit integer.\n\n Parameters\n ----------\n x: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.int32ToUint32( base.float64ToInt32( -32 ) )\n 4294967264\n > y = base.int32ToUint32( base.float64ToInt32( 3 ) )\n 3\n\n See Also\n --------\n base.uint32ToInt32\n",
"base.inv": "\nbase.inv( x )\n Computes the multiplicative inverse of `x`.\n\n The multiplicative inverse is defined as `1/x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Multiplicative inverse.\n\n Examples\n --------\n > var y = base.inv( -1.0 )\n -1.0\n > y = base.inv( 2.0 )\n 0.5\n > y = base.inv( 0.0 )\n Infinity\n > y = base.inv( -0.0 )\n -Infinity\n > y = base.inv( NaN )\n NaN\n\n See Also\n --------\n base.pow\n",
"base.isEven": "\nbase.isEven( x )\n Tests if a finite numeric value is an even number.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an even number.\n\n Examples\n --------\n > var bool = base.isEven( 5.0 )\n false\n > bool = base.isEven( -2.0 )\n true\n > bool = base.isEven( 0.0 )\n true\n > bool = base.isEven( NaN )\n false\n\n See Also\n --------\n base.isOdd\n",
"base.isEvenInt32": "\nbase.isEvenInt32( x )\n Tests if a 32-bit integer is even.\n\n Parameters\n ----------\n x: integer\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an even number.\n\n Examples\n --------\n > var bool = base.isEvenInt32( 5 )\n false\n > bool = base.isEvenInt32( -2 )\n true\n > bool = base.isEvenInt32( 0 )\n true\n\n See Also\n --------\n base.isEven, base.isOddInt32\n",
"base.isFinite": "\nbase.isFinite( x )\n Tests if a numeric value is finite.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is finite.\n\n Examples\n --------\n > var bool = base.isFinite( 5.0 )\n true\n > bool = base.isFinite( -2.0e64 )\n true\n > bool = base.isFinite( PINF )\n false\n > bool = base.isFinite( NINF )\n false\n\n See Also\n --------\n base.isInfinite\n",
"base.isInfinite": "\nbase.isInfinite( x )\n Tests if a numeric value is infinite.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is infinite.\n\n Examples\n --------\n > var bool = base.isInfinite( PINF )\n true\n > bool = base.isInfinite( NINF )\n true\n > bool = base.isInfinite( 5.0 )\n false\n > bool = base.isInfinite( NaN )\n false\n\n See Also\n --------\n base.isFinite\n",
"base.isInteger": "\nbase.isInteger( x )\n Tests if a finite double-precision floating-point number is an integer.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an integer.\n\n Examples\n --------\n > var bool = base.isInteger( 1.0 )\n true\n > bool = base.isInteger( 3.14 )\n false\n\n",
"base.isnan": "\nbase.isnan( x )\n Tests if a numeric value is `NaN`.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is `NaN`.\n\n Examples\n --------\n > var bool = base.isnan( NaN )\n true\n > bool = base.isnan( 7.0 )\n false\n\n",
"base.isNegativeInteger": "\nbase.isNegativeInteger( x )\n Tests if a finite double-precision floating-point number is a negative\n integer.\n\n The function assumes a finite number. If provided negative infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a negative integer.\n\n Examples\n --------\n > var bool = base.isNegativeInteger( -1.0 )\n true\n > bool = base.isNegativeInteger( 0.0 )\n false\n > bool = base.isNegativeInteger( 10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNonNegativeInteger, base.isNonPositiveInteger, base.isPositiveInteger\n",
"base.isNegativeZero": "\nbase.isNegativeZero( x )\n Tests if a numeric value is negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is negative zero.\n\n Examples\n --------\n > var bool = base.isNegativeZero( -0.0 )\n true\n > bool = base.isNegativeZero( 0.0 )\n false\n\n See Also\n --------\n base.isPositiveZero\n",
"base.isNonNegativeInteger": "\nbase.isNonNegativeInteger( x )\n Tests if a finite double-precision floating-point number is a nonnegative\n integer.\n\n The function assumes a finite number. If provided positive infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n The function does not distinguish between positive and negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a nonnegative integer.\n\n Examples\n --------\n > var bool = base.isNonNegativeInteger( 1.0 )\n true\n > bool = base.isNonNegativeInteger( 0.0 )\n true\n > bool = base.isNonNegativeInteger( -10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonPositiveInteger, base.isPositiveInteger\n",
"base.isNonPositiveInteger": "\nbase.isNonPositiveInteger( x )\n Tests if a finite double-precision floating-point number is a nonpositive\n integer.\n\n The function assumes a finite number. If provided negative infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n The function does not distinguish between positive and negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a nonpositive integer.\n\n Examples\n --------\n > var bool = base.isNonPositiveInteger( -1.0 )\n true\n > bool = base.isNonPositiveInteger( 0.0 )\n true\n > bool = base.isNonPositiveInteger( 10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonNegativeInteger, base.isPositiveInteger\n",
"base.isOdd": "\nbase.isOdd( x )\n Tests if a finite numeric value is an odd number.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an odd number.\n\n Examples\n --------\n > var bool = base.isOdd( 5.0 )\n true\n > bool = base.isOdd( -2.0 )\n false\n > bool = base.isOdd( 0.0 )\n false\n > bool = base.isOdd( NaN )\n false\n\n See Also\n --------\n base.isEven\n",
"base.isOddInt32": "\nbase.isOddInt32( x )\n Tests if a 32-bit integer is odd.\n\n Parameters\n ----------\n x: integer\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an odd number.\n\n Examples\n --------\n > var bool = base.isOddInt32( 5 )\n true\n > bool = base.isOddInt32( -2 )\n false\n > bool = base.isOddInt32( 0 )\n false\n\n See Also\n --------\n base.isEvenInt32, base.isOdd\n",
"base.isPositiveInteger": "\nbase.isPositiveInteger( x )\n Tests if a finite double-precision floating-point number is a positive\n integer.\n\n The function assumes a finite number. If provided positive infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a positive integer.\n\n Examples\n --------\n > var bool = base.isPositiveInteger( 1.0 )\n true\n > bool = base.isPositiveInteger( 0.0 )\n false\n > bool = base.isPositiveInteger( -10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonNegativeInteger, base.isNonPositiveInteger\n",
"base.isPositiveZero": "\nbase.isPositiveZero( x )\n Tests if a numeric value is positive zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is positive zero.\n\n Examples\n --------\n > var bool = base.isPositiveZero( 0.0 )\n true\n > bool = base.isPositiveZero( -0.0 )\n false\n\n See Also\n --------\n base.isNegativeZero\n",
"base.isPow2Uint32": "\nbase.isPow2Uint32( x )\n Tests whether an unsigned integer is a power of 2.\n\n Parameters\n ----------\n x: integer\n Unsigned integer.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a power of 2.\n\n Examples\n --------\n > var bool = base.isPow2Uint32( 2 )\n true\n > bool = base.isPow2Uint32( 5 )\n false\n\n",
"base.isProbability": "\nbase.isProbability( x )\n Tests if a numeric value is a probability.\n\n A probability is defined as a numeric value on the closed interval `[0,1]`.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a probability.\n\n Examples\n --------\n > var bool = base.isProbability( 0.5 )\n true\n > bool = base.isProbability( 3.14 )\n false\n > bool = base.isProbability( NaN )\n false\n\n",
"base.isSafeInteger": "\nbase.isSafeInteger( x )\n Tests if a finite double-precision floating-point number is a safe integer.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a safe integer.\n\n Examples\n --------\n > var bool = base.isSafeInteger( 1.0 )\n true\n > bool = base.isSafeInteger( 2.0e200 )\n false\n > bool = base.isSafeInteger( 3.14 )\n false\n\n",
"base.kernelBetainc": "\nbase.kernelBetainc( [out,] x, a, b, regularized, upper )\n Computes the kernel function for the regularized incomplete beta function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete beta functions, respectively.\n\n If provided `x < 0` or `x > 1`, the function returns `[ NaN, NaN ]`.\n\n If provided `a < 0` or `b < 0`, the function returns `[ NaN, NaN ]`.\n\n If provided `NaN` for `x`, `a`, or `b`, the function returns `[ NaN, NaN ]`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n First function parameter.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n regularized: boolean\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete beta function.\n\n upper: boolean\n Boolean indicating whether the function should return the upper tail of\n the incomplete beta function.\n\n Returns\n -------\n y: Array|TypedArray|Object\n Function value and first derivative.\n\n Examples\n --------\n > var out = base.kernelBetainc( 0.8, 1.0, 0.3, false, false )\n [ ~1.277, ~0.926 ]\n > out = base.kernelBetainc( 0.2, 1.0, 2.0, true, false )\n [ 0.32, 1.6 ]\n\n > out = new Array( 2 );\n > var v = base.kernelBetainc( out, 0.2, 1.0, 2.0, true, true )\n [ 0.64, 1.6 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.betainc\n",
"base.kernelBetaincinv": "\nbase.kernelBetaincinv( a, b, p, q )\n Computes the inverse of the lower incomplete beta function.\n\n Probabilities `p` and `q` must satisfy `p = 1 - q`.\n\n Parameters\n ----------\n a: number\n First function parameter (a positive number).\n\n b: number\n Second function parameter (a positive number).\n\n p: number\n Probability.\n\n q: number\n Probability equal to `1-p`.\n\n Returns\n -------\n out: Array\n Two-element array holding function value `y` and `1-y`.\n\n Examples\n --------\n > var y = base.kernelBetaincinv( 3.0, 3.0, 0.2, 0.8 )\n [ ~0.327, ~0.673 ]\n > y = base.kernelBetaincinv( 3.0, 3.0, 0.4, 0.6 )\n [ ~0.446, ~0.554 ]\n > y = base.kernelBetaincinv( 1.0, 6.0, 0.4, 0.6 )\n [ ~0.082, ~0.918 ]\n > y = base.kernelBetaincinv( 1.0, 6.0, 0.8, 0.2 )\n [ ~0.235, ~0.765 ]\n\n See Also\n --------\n base.betaincinv\n",
"base.kernelCos": "\nbase.kernelCos( x, y )\n Computes the cosine of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the cosine should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The two numbers must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n Returns\n -------\n out: number\n Cosine.\n\n Examples\n --------\n > var out = base.kernelCos( 0.0, 0.0 )\n ~1.0\n > out = base.kernelCos( PI/6.0, 0.0 )\n ~0.866\n > out = base.kernelCos( 0.785, -1.144e-17 )\n ~0.707\n > out = base.kernelCos( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.kernelSin, base.kernelTan\n",
"base.kernelSin": "\nbase.kernelSin( x, y )\n Computes the sine of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the cosine should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The two numbers must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n Returns\n -------\n out: number\n Sine.\n\n Examples\n --------\n > var y = base.kernelSin( 0.0, 0.0 )\n ~0.0\n > y = base.kernelSin( PI/6.0, 0.0 )\n ~0.5\n > y = base.kernelSin( 0.619, 9.279e-18 )\n ~0.58\n\n > y = base.kernelSin( NaN, 0.0 )\n NaN\n > y = base.kernelSin( 2.0, NaN )\n NaN\n > y = base.kernelSin( NaN, NaN )\n NaN\n\n See Also\n --------\n base.kernelCos, base.kernelTan, base.sin\n",
"base.kernelTan": "\nbase.kernelTan( x, y, k )\n Computes the tangent of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the tangent should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The numbers `x` and `y` must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either `x` or `y` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n k: integer\n If `k=1`, the function returns `tan(x+y)`. If `k=-1`, the function\n returns the negative inverse `-1/tan(x+y)`.\n\n Returns\n -------\n out: number\n Tangent.\n\n Examples\n --------\n > var out = base.kernelTan( PI/4.0, 0.0, 1 )\n ~1.0\n > out = base.kernelTan( PI/4.0, 0.0, -1 )\n ~-1.0\n > out = base.kernelTan( PI/6.0, 0.0, 1 )\n ~0.577\n > out = base.kernelTan( 0.664, 5.288e-17, 1 )\n ~0.783\n\n > out = base.kernelTan( NaN, 0.0, 1 )\n NaN\n > out = base.kernelTan( 3.0, NaN, 1 )\n NaN\n > out = base.kernelTan( 3.0, 0.0, NaN )\n NaN\n\n See Also\n --------\n base.kernelCos, base.kernelSin, base.tan\n",
"base.kroneckerDelta": "\nbase.kroneckerDelta( i, j )\n Evaluates the Kronecker delta.\n\n If `i == j`, the function returns `1`; otherwise, the function returns zero.\n\n Parameters\n ----------\n i: number\n Input value.\n\n j: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.kroneckerDelta( 3.14, 0.0 )\n 0.0\n > y = base.kroneckerDelta( 3.14, 3.14 )\n 1.0\n\n See Also\n --------\n base.diracDelta\n",
"base.lcm": "\nbase.lcm( a, b )\n Computes the least common multiple (lcm).\n\n If either `a` or `b` is `0`, the function returns `0`.\n\n Both `a` and `b` must have integer values; otherwise, the function returns\n `NaN`.\n\n Parameters\n ----------\n a: integer\n First integer.\n\n b: integer\n Second integer.\n\n Returns\n -------\n out: integer\n Least common multiple.\n\n Examples\n --------\n > var v = base.lcm( 21, 6 )\n 42\n\n See Also\n --------\n base.gcd\n",
"base.ldexp": "\nbase.ldexp( frac, exp )\n Multiplies a double-precision floating-point number by an integer power of\n two; i.e., `x = frac * 2^exp`.\n\n If `frac` equals positive or negative `zero`, `NaN`, or positive or negative\n infinity, the function returns a value equal to `frac`.\n\n Parameters\n ----------\n frac: number\n Fraction.\n\n exp: number\n Exponent.\n\n Returns\n -------\n out: number\n Double-precision floating-point number equal to `frac * 2^exp`.\n\n Examples\n --------\n > var x = base.ldexp( 0.5, 3 )\n 4.0\n > x = base.ldexp( 4.0, -2 )\n 1.0\n > x = base.ldexp( 0.0, 20 )\n 0.0\n > x = base.ldexp( -0.0, 39 )\n -0.0\n > x = base.ldexp( NaN, -101 )\n NaN\n > x = base.ldexp( PINF, 11 )\n Infinity\n > x = base.ldexp( NINF, -118 )\n -Infinity\n\n See Also\n --------\n base.frexp\n",
"base.ln": "\nbase.ln( x )\n Evaluates the natural logarithm.\n\n For negative numbers, the natural logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.ln( 4.0 )\n ~1.386\n > y = base.ln( 0.0 )\n -Infinity\n > y = base.ln( PINF )\n Infinity\n > y = base.ln( NaN )\n NaN\n > y = base.ln( -4.0 )\n NaN\n\n See Also\n --------\n base.exp, base.log10, base.log1p, base.log2\n",
"base.log": "\nbase.log( x, b )\n Computes the base `b` logarithm of `x`.\n\n For negative `b` or `x`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n b: number\n Base.\n\n Returns\n -------\n y: number\n Logarithm (base `b`).\n\n Examples\n --------\n > var y = base.log( 100.0, 10.0 )\n 2.0\n > y = base.log( 16.0, 2.0 )\n 4.0\n > y = base.log( 5.0, 1.0 )\n Infinity\n > y = base.log( NaN, 2.0 )\n NaN\n > y = base.log( 1.0, NaN )\n NaN\n > y = base.log( -4.0, 2.0 )\n NaN\n > y = base.log( 4.0, -2.0 )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log10, base.log1p, base.log2\n",
"base.log1mexp": "\nbase.log1mexp( x )\n Evaluates the natural logarithm of `1-exp(-|x|)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1mexp( -10.0 )\n ~-0.00005\n > y = base.log1mexp( 0.0 )\n -Infinity\n > y = base.log1mexp( 5.0 )\n ~-0.00676\n > y = base.log1mexp( 10.0 )\n ~-0.00005\n > y = base.log1mexp( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log1p, base.log1pexp",
"base.log1p": "\nbase.log1p( x )\n Evaluates the natural logarithm of `1+x`.\n\n For `x < -1`, the function returns `NaN`, as the natural logarithm is not\n defined for negative numbers.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1p( 4.0 )\n ~1.609\n > y = base.log1p( -1.0 )\n -Infinity\n > y = base.log1p( 0.0 )\n 0.0\n > y = base.log1p( -0.0 )\n -0.0\n > y = base.log1p( -2.0 )\n NaN\n > y = base.log1p( NaN )\n NaN\n\n See Also\n --------\n base.ln, base.log\n",
"base.log1pexp": "\nbase.log1pexp( x )\n Evaluates the natural logarithm of `1+exp(x)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1pexp( -10.0 )\n ~0.000045\n > y = base.log1pexp( 0.0 )\n ~0.693147\n > y = base.log1pexp( 5.0 )\n ~5.006715\n > y = base.log1pexp( 34.0 )\n 34.0\n > y = base.log1pexp( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log1mexp, base.log1p",
"base.log2": "\nbase.log2( x )\n Evaluates the binary logarithm (base two).\n\n For negative numbers, the binary logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log2( 4.0 )\n 2.0\n > y = base.log2( 8.0 )\n 3.0\n > y = base.log2( 0.0 )\n -Infinity\n > y = base.log2( PINF )\n Infinity\n > y = base.log2( NaN )\n NaN\n > y = base.log2( -4.0 )\n NaN\n\n See Also\n --------\n base.exp2, base.ln, base.log\n",
"base.log10": "\nbase.log10( x )\n Evaluates the common logarithm (base 10).\n\n For negative numbers, the common logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log10( 100.0 )\n 2.0\n > y = base.log10( 8.0 )\n ~0.903\n > y = base.log10( 0.0 )\n -Infinity\n > y = base.log10( PINF )\n Infinity\n > y = base.log10( NaN )\n NaN\n > y = base.log10( -4.0 )\n NaN\n\n See Also\n --------\n base.exp10, base.ln, base.log\n",
"base.logaddexp": "\nbase.logaddexp( x, y )\n Computes the natural logarithm of `exp(x) + exp(y)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n v: number\n Function value.\n\n Examples\n --------\n > var v = base.logaddexp( 90.0, 90.0 )\n ~90.6931\n > v = base.logaddexp( -20.0, 90.0 )\n 90.0\n > v = base.logaddexp( 0.0, -100.0 )\n ~3.7201e-44\n > v = base.logaddexp( NaN, NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln\n",
"base.logit": "\nbase.logit( p )\n Evaluates the logit function.\n\n Let `p` be the probability of some event. The logit function is defined as\n the logarithm of the odds `p / (1-p)`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.logit( 0.2 )\n ~-1.386\n > y = base.logit( 0.9 )\n ~2.197\n > y = base.logit( -4.0 )\n NaN\n > y = base.logit( 1.5 )\n NaN\n > y = base.logit( NaN )\n NaN\n\n",
"base.lucas": "\nbase.lucas( n )\n Computes the nth Lucas number.\n\n Lucas numbers follow the recurrence relation\n\n L_n = L_{n-1} + L_{n-2}\n\n with seed values L_0 = 2 and L_1 = 1.\n\n If `n` is greater than `76`, the function returns `NaN`, as larger Lucas\n numbers cannot be accurately represented due to limitations of double-\n precision floating-point format.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n Lucas number.\n\n Examples\n --------\n > var y = base.lucas( 0 )\n 2\n > y = base.lucas( 1 )\n 1\n > y = base.lucas( 2 )\n 3\n > y = base.lucas( 3 )\n 4\n > y = base.lucas( 4 )\n 7\n > y = base.lucas( 77 )\n NaN\n > y = base.lucas( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negalucas\n",
"base.lucaspoly": "\nbase.lucaspoly( n, x )\n Evaluates a Lucas polynomial.\n\n Parameters\n ----------\n n: integer\n Lucas polynomial to evaluate.\n\n x: number\n Value at which to evaluate the Lucas polynomial.\n\n Returns\n -------\n out: number\n Evaluated Lucas polynomial.\n\n Examples\n --------\n // 2^5 + 5*2^3 + 5*2\n > var v = base.lucaspoly( 5, 2.0 )\n 82.0\n\n\nbase.lucaspoly.factory( n )\n Returns a function for evaluating a Lucas polynomial.\n\n Parameters\n ----------\n n: integer\n Lucas polynomial to evaluate.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a Lucas polynomial.\n\n Examples\n --------\n > var polyval = base.lucaspoly.factory( 5 );\n\n // 1^5 + 5*1^2 + 5\n > var v = polyval( 1.0 )\n 11.0\n\n // 2^5 + 5*2^3 + 5*2\n > v = polyval( 2.0 )\n 82.0\n\n See Also\n --------\n base.evalpoly, base.fibpoly\n",
"base.max": "\nbase.max( [x[, y[, ...args]]] )\n Returns the maximum value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), negative infinity is the\n least upper bound. Similar to zero being the identity element for the sum of\n an empty set and to one being the identity element for the product of an\n empty set, negative infinity is the identity element for the maximum, and\n thus, if not provided any arguments, the function returns negative infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var v = base.max( 3.14, 4.2 )\n 4.2\n > v = base.max( 5.9, 3.14, 4.2 )\n 5.9\n > v = base.max( 3.14, NaN )\n NaN\n > v = base.max( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.maxabs, base.min\n",
"base.maxabs": "\nbase.maxabs( [x[, y[, ...args]]] )\n Returns the maximum absolute value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), negative infinity is the\n least upper bound. Similar to zero being the identity element for the sum of\n an empty set and to one being the identity element for the product of an\n empty set, negative infinity is the identity element for the maximum, and\n thus, if not provided any arguments, the function returns `+infinity` (i.e.,\n the absolute value of `-infinity`).\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Maximum absolute value.\n\n Examples\n --------\n > var v = base.maxabs( 3.14, -4.2 )\n 4.2\n > v = base.maxabs( 5.9, 3.14, 4.2 )\n 5.9\n > v = base.maxabs( 3.14, NaN )\n NaN\n > v = base.maxabs( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.max, base.minabs\n",
"base.min": "\nbase.min( [x[, y[, ...args]]] )\n Returns the minimum value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), positive infinity is the\n greatest lower bound. Similar to zero being the identity element for the sum\n of an empty set and to one being the identity element for the product of an\n empty set, positive infinity is the identity element for the minimum, and\n thus, if not provided any arguments, the function returns positive infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var v = base.min( 3.14, 4.2 )\n 3.14\n > v = base.min( 5.9, 3.14, 4.2 )\n 3.14\n > v = base.min( 3.14, NaN )\n NaN\n > v = base.min( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.max, base.minabs\n",
"base.minabs": "\nbase.minabs( [x[, y[, ...args]]] )\n Returns the minimum absolute value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), positive infinity is the\n greatest upper bound. Similar to zero being the identity element for the sum\n of an empty set and to one being the identity element for the product of an\n empty set, positive infinity is the identity element for the minimum, and\n thus, if not provided any arguments, the function returns positive infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Minimum absolute value.\n\n Examples\n --------\n > var v = base.minabs( 3.14, -4.2 )\n 3.14\n > v = base.minabs( 5.9, 3.14, 4.2 )\n 3.14\n > v = base.minabs( 3.14, NaN )\n NaN\n > v = base.minabs( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.maxabs, base.min\n",
"base.minmax": "\nbase.minmax( [out,] x[, y[, ...args]] )\n Returns the minimum and maximum values.\n\n If any argument is `NaN`, the function returns `NaN` for both the minimum\n and maximum values.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output object.\n\n x: number\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Minimum and maximum values.\n\n Examples\n --------\n > var v = base.minmax( 3.14, 4.2 )\n [ 3.14, 4.2 ]\n > v = base.minmax( 5.9, 3.14, 4.2 )\n [ 3.14, 5.9 ]\n > v = base.minmax( 3.14, NaN )\n [ NaN, NaN ]\n > v = base.minmax( +0.0, -0.0 )\n [ -0.0, +0.0 ]\n > v = base.minmax( 3.14 )\n [ 3.14, 3.14 ]\n > var out = new Array( 2 );\n > v = base.minmax( out, 3.14 )\n [ 3.14, 3.14 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.max, base.min, base.minmaxabs\n",
"base.minmaxabs": "\nbase.minmaxabs( [out,] x[, y[, ...args]] )\n Returns the minimum and maximum absolute values.\n\n If any argument is `NaN`, the function returns `NaN` for both the minimum\n and maximum absolute values.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output object.\n\n x: number\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Minimum and maximum absolute values.\n\n Examples\n --------\n > var v = base.minmaxabs( 3.14, 4.2 )\n [ 3.14, 4.2 ]\n > v = base.minmaxabs( -5.9, 3.14, 4.2 )\n [ 3.14, 5.9 ]\n > v = base.minmaxabs( 3.14, NaN )\n [ NaN, NaN ]\n > v = base.minmaxabs( +0.0, -0.0 )\n [ 0.0, 0.0 ]\n > v = base.minmaxabs( 3.14 )\n [ 3.14, 3.14 ]\n > var out = new Array( 2 );\n > v = base.minmaxabs( out, 3.14 )\n [ 3.14, 3.14 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.maxabs, base.minabs, base.minmax\n",
"base.modf": "\nbase.modf( [out,] x )\n Decomposes a double-precision floating-point number into integral and\n fractional parts, each having the same type and sign as the input value.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n parts: Array|TypedArray|Object\n Integral and fractional parts.\n\n Examples\n --------\n > var parts = base.modf( 3.14 )\n [ 3.0, 0.14000000000000012 ]\n > parts = base.modf( 3.14 )\n [ 3.0, 0.14000000000000012 ]\n > parts = base.modf( +0.0 )\n [ +0.0, +0.0 ]\n > parts = base.modf( -0.0 )\n [ -0.0, -0.0 ]\n > parts = base.modf( PINF )\n [ Infinity, +0.0 ]\n > parts = base.modf( NINF )\n [ -Infinity, -0.0 ]\n > parts = base.modf( NaN )\n [ NaN, NaN ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > parts = base.modf( out, 3.14 )\n <Float64Array>[ 3.0, 0.14000000000000012 ]\n > var bool = ( parts === out )\n true\n\n",
"base.ndarray": "\nbase.ndarray( dtype, ndims[, options] )\n Returns an ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n Returns\n -------\n ctor: Function\n ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = base.ndarray( 'float64', 3 )\n <Function>\n\n // To create a new instance...\n > var b = [ 1, 2, 3, 4 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40 );\n > arr.get( 1, 1 )\n 40\n\n // Set an element using a linear index:\n > arr.iset( 3, 99 );\n > arr.get( 1, 1 )\n 99\n\n See Also\n --------\n array, ndarray\n",
"base.ndarrayMemoized": "\nbase.ndarrayMemoized( dtype, ndims[, options] )\n Returns a memoized ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n Returns\n -------\n ctor: Function\n Memoized ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = base.ndarrayMemoized( 'float64', 3 )\n <Function>\n > var f = base.ndarrayMemoized( 'float64', 3 )\n <Function>\n > var bool = ( f === ctor )\n true\n\n // To create a new instance...\n > var b = [ 1, 2, 3, 4 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40 );\n > arr.get( 1, 1 )\n 40\n\n // Set an element using a linear index:\n > arr.iset( 3, 99 );\n > arr.get( 1, 1 )\n 99\n\n See Also\n --------\n array, base.ndarray, ndarray, ndarrayMemoized\n",
"base.negafibonacci": "\nbase.negafibonacci( n )\n Computes the nth negaFibonacci number.\n\n The negaFibonacci numbers follow the recurrence relation\n\n F_{n-2} = F_{n} - F_{n-1}\n\n with seed values F_0 = 0 and F_{-1} = 1.\n\n If `|n|` is greater than `78`, the function returns `NaN` as larger\n negaFibonacci numbers cannot be accurately represented due to limitations of\n double-precision floating-point format.\n\n If not provided a non-positive integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n NegaFibonacci number.\n\n Examples\n --------\n > var y = base.negafibonacci( 0 )\n 0\n > y = base.negafibonacci( -1 )\n 1\n > y = base.negafibonacci( -2 )\n -1\n > y = base.negafibonacci( -3 )\n 2\n > y = base.negafibonacci( -4 )\n -3\n > y = base.negafibonacci( -79 )\n NaN\n > y = base.negafibonacci( -80 )\n NaN\n > y = base.negafibonacci( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negalucas\n",
"base.negalucas": "\nbase.negalucas( n )\n Computes the nth negaLucas number.\n\n The negaLucas numbers follow the recurrence relation\n\n L_{n-2} = L_{n} - L_{n-1}\n\n with seed values L_0 = 2 and L_{-1} = -1.\n\n If `|n|` is greater than `76`, the function returns `NaN` as larger\n negaLucas numbers cannot be accurately represented due to limitations of\n double-precision floating-point format.\n\n If not provided a non-positive integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n NegaLucas number.\n\n Examples\n --------\n > var y = base.negalucas( 0 )\n 2\n > y = base.negalucas( -1 )\n -1\n > y = base.negalucas( -2 )\n 3\n > y = base.negalucas( -3 )\n -4\n > y = base.negalucas( -4 )\n 7\n > y = base.negalucas( -77 )\n NaN\n > y = base.negalucas( -78 )\n NaN\n > y = base.negalucas( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.lucas, base.negafibonacci\n",
"base.nonfibonacci": "\nbase.nonfibonacci( n )\n Computes the nth non-Fibonacci number.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: number\n Non-Fibonacci number.\n\n Examples\n --------\n > var v = base.nonfibonacci( 1 )\n 4\n > v = base.nonfibonacci( 2 )\n 6\n > v = base.nonfibonacci( 3 )\n 7\n > v = base.nonfibonacci( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci\n",
"base.normalize": "\nbase.normalize( [out,] x )\n Returns a normal number and exponent satisfying `x = y * 2^exp` as an array.\n\n The first element of the returned array corresponds to `y` and the second to\n `exp`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n An array containing `y` and `exp`.\n\n Examples\n --------\n > var out = base.normalize( 3.14e-319 )\n [ 1.4141234400356668e-303, -52 ]\n > var y = out[ 0 ];\n > var exponent = out[ 1 ];\n > var bool = ( y*base.pow(2.0, exponent) === 3.14e-319 )\n true\n\n // Special cases:\n > out = base.normalize( 0.0 )\n [ 0.0, 0 ];\n > out = base.normalize( PINF )\n [ Infinity, 0 ]\n > out = base.normalize( NINF )\n [ -Infinity, 0 ]\n > out = base.normalize( NaN )\n [ NaN, 0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.normalize( out, 3.14e-319 )\n <Float64Array>[ 1.4141234400356668e-303, -52 ]\n > bool = ( v === out )\n true\n\n See Also\n --------\n base.normalizef\n",
"base.normalizef": "\nbase.normalizef( [out,] x )\n Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp` as\n an array.\n\n The first element of the returned array corresponds to `y` and the second to\n `exp`.\n\n While the function accepts higher precision floating-point numbers, beware\n that providing such numbers can be a source of subtle bugs as the relation\n `x = y * 2^exp` may not hold.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n An array containing `y` and `exp`.\n\n Examples\n --------\n > var out = base.normalizef( base.float64ToFloat32( 1.401e-45 ) )\n [ 1.1754943508222875e-38, -23 ]\n > var y = out[ 0 ];\n > var exp = out[ 1 ];\n > var bool = ( y*base.pow(2,exp) === base.float64ToFloat32(1.401e-45) )\n true\n\n // Special cases:\n > out = base.normalizef( FLOAT32_PINF )\n [ Infinity, 0 ]\n > out = base.normalizef( FLOAT32_NINF )\n [ -Infinity, 0 ]\n > out = base.normalizef( NaN )\n [ NaN, 0 ]\n\n // Provide an output array:\n > out = new Float32Array( 2 );\n > var v = base.normalizef( out, base.float64ToFloat32( 1.401e-45 ) )\n <Float32Array>[ 1.1754943508222875e-38, -23.0 ]\n > bool = ( v === out )\n true\n\n See Also\n --------\n base.normalize\n",
"base.normhermitepoly": "\nbase.normhermitepoly( n, x )\n Evaluates a normalized Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.normhermitepoly( 1, 0.5 )\n 0.5\n > y = base.normhermitepoly( -1, 0.5 )\n NaN\n > y = base.normhermitepoly( 0, 0.5 )\n 1.0\n > y = base.normhermitepoly( 2, 0.5 )\n -0.75\n\n\nbase.normhermitepoly.factory( n )\n Returns a function for evaluating a normalized Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a normalized Hermite polynomial.\n\n Examples\n --------\n > var polyval = base.normhermitepoly.factory( 2 );\n > var v = polyval( 0.5 )\n -0.75\n\n See Also\n --------\n base.evalpoly, base.hermitepoly\n",
"base.pdiff": "\nbase.pdiff( x, y )\n Returns the positive difference between `x` and `y` if `x > y`; otherwise,\n returns `0`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Positive difference.\n\n Examples\n --------\n > var v = base.pdiff( 5.9, 3.14 )\n 2.76\n > v = base.pdiff( 3.14, 4.2 )\n 0.0\n > v = base.pdiff( 3.14, NaN )\n NaN\n > v = base.pdiff( -0.0, +0.0 )\n +0.0\n\n",
"base.polygamma": "\nbase.polygamma( n, x )\n Evaluates the polygamma function of order `n`; i.e., the (n+1)th derivative\n of the natural logarithm of the gamma function.\n\n If `n` is not a non-negative integer, the function returns `NaN`.\n\n If `x` is zero or a negative integer, the function returns `NaN`.\n\n If provided `NaN` as either parameter, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Derivative order.\n\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.polygamma( 3, 1.2 )\n ~3.245\n > v = base.polygamma( 5, 1.2 )\n ~41.39\n > v = base.polygamma( 3, -4.9 )\n ~60014.239\n > v = base.polygamma( -1, 5.3 )\n NaN\n > v = base.polygamma( 2, -1.0 )\n Infinity\n\n See Also\n --------\n base.trigamma, base.digamma, base.gamma\n",
"base.pow": "\nbase.pow( b, x )\n Evaluates the exponential function `bˣ`.\n\n Parameters\n ----------\n b: number\n Base.\n\n x: number\n Exponent.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.pow( 2.0, 3.0 )\n 8.0\n > y = base.pow( 4.0, 0.5 )\n 2.0\n > y = base.pow( 100.0, 0.0 )\n 1.0\n > y = base.pow( PI, 5.0 )\n ~306.0197\n > y = base.pow( PI, -0.2 )\n ~0.7954\n > y = base.pow( NaN, 3.0 )\n NaN\n > y = base.pow( 5.0, NaN )\n NaN\n > y = base.pow( NaN, NaN )\n NaN\n\n See Also\n --------\n base.exp, base.powm1\n",
"base.powm1": "\nbase.powm1( b, x )\n Evaluates `bˣ - 1`.\n\n When `b` is close to `1` and/or `x` is small, this function is more accurate\n than naively computing `bˣ` and subtracting `1`.\n\n Parameters\n ----------\n b: number\n Base.\n\n x: number\n Exponent.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.powm1( 2.0, 3.0 )\n 7.0\n > y = base.powm1( 4.0, 0.5 )\n 1.0\n > y = base.powm1( 0.0, 100.0 )\n -1.0\n > y = base.powm1( 100.0, 0.0 )\n 0.0\n > y = base.powm1( 0.0, 0.0 )\n 0.0\n > y = base.powm1( PI, 5.0 )\n ~305.0197\n > y = base.powm1( NaN, 3.0 )\n NaN\n > y = base.powm1( 5.0, NaN )\n NaN\n\n See Also\n --------\n base.pow\n",
"base.rad2deg": "\nbase.rad2deg( x )\n Converts an angle from radians to degrees.\n\n Parameters\n ----------\n x: number\n Angle in radians.\n\n Returns\n -------\n d: number\n Angle in degrees.\n\n Examples\n --------\n > var d = base.rad2deg( PI/2.0 )\n 90.0\n > d = base.rad2deg( -PI/4.0 )\n -45.0\n > d = base.rad2deg( NaN )\n NaN\n\n // Due to finite precision, canonical values may not be returned:\n > d = base.rad2deg( PI/6.0 )\n 29.999999999999996\n\n See Also\n --------\n base.deg2rad\n",
"base.ramp": "\nbase.ramp( x )\n Evaluates the ramp function.\n\n If `x >= 0`, the function returns `x`; otherwise, the function returns zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.ramp( 3.14 )\n 3.14\n > y = base.ramp( -3.14 )\n 0.0\n\n See Also\n --------\n base.heaviside\n",
"base.random.arcsine": "\nbase.random.arcsine( a, b )\n Returns a pseudorandom number drawn from an arcsine distribution.\n\n If `a >= b`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.arcsine( 2.0, 5.0 )\n <number>\n\n\nbase.random.arcsine.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an arcsine distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.arcsine.factory();\n > var r = rand( 0.0, 1.0 )\n <number>\n > r = rand( -2.0, 2.0 )\n <number>\n\n // Provide `a` and `b`:\n > rand = base.random.arcsine.factory( 0.0, 1.0 );\n > r = rand()\n <number>\n > r = rand()\n <number>\n\n\nbase.random.arcsine.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.arcsine.NAME\n 'arcsine'\n\n\nbase.random.arcsine.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.arcsine.PRNG;\n\n\nbase.random.arcsine.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.arcsine.seed;\n\n\nbase.random.arcsine.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.arcsine.seedLength;\n\n\nbase.random.arcsine.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.arcsine.state\n <Uint32Array>\n\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n // Set the state:\n > base.random.arcsine.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n\nbase.random.arcsine.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.arcsine.stateLength;\n\n\nbase.random.arcsine.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.arcsine.byteLength;\n\n\nbase.random.arcsine.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.arcsine.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.beta\n",
"base.random.bernoulli": "\nbase.random.bernoulli( p )\n Returns a pseudorandom number drawn from a Bernoulli distribution.\n\n If `p < 0` or `p > 1` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.bernoulli( 0.8 );\n\n\nbase.random.bernoulli.factory( [p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Bernoulli distribution.\n\n If provided `p`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `p`, the returned PRNG requires that `p` be provided at each\n invocation.\n\n Parameters\n ----------\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.bernoulli.factory();\n > var r = rand( 0.3 );\n > r = rand( 0.59 );\n\n // Provide `p`:\n > rand = base.random.bernoulli.factory( 0.3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.bernoulli.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.bernoulli.NAME\n 'bernoulli'\n\n\nbase.random.bernoulli.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.bernoulli.PRNG;\n\n\nbase.random.bernoulli.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.bernoulli.seed;\n\n\nbase.random.bernoulli.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.bernoulli.seedLength;\n\n\nbase.random.bernoulli.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.bernoulli.state\n <Uint32Array>\n\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n // Set the state:\n > base.random.bernoulli.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n\nbase.random.bernoulli.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.bernoulli.stateLength;\n\n\nbase.random.bernoulli.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.bernoulli.byteLength;\n\n\nbase.random.bernoulli.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.bernoulli.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.binomial\n",
"base.random.beta": "\nbase.random.beta( α, β )\n Returns a pseudorandom number drawn from a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.beta( 2.0, 5.0 );\n\n\nbase.random.beta.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a beta distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter.\n\n β: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.beta.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.beta.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.beta.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.beta.NAME\n 'beta'\n\n\nbase.random.beta.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.beta.PRNG;\n\n\nbase.random.beta.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.beta.seed;\n\n\nbase.random.beta.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.beta.seedLength;\n\n\nbase.random.beta.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.beta.state\n <Uint32Array>\n\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.beta.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n\nbase.random.beta.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.beta.stateLength;\n\n\nbase.random.beta.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.beta.byteLength;\n\n\nbase.random.beta.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.beta.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.betaprime": "\nbase.random.betaprime( α, β )\n Returns a pseudorandom number drawn from a beta prime distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.betaprime( 2.0, 5.0 );\n\n\nbase.random.betaprime.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a beta prime distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter.\n\n β: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.betaprime.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.betaprime.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.betaprime.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.betaprime.NAME\n 'betaprime'\n\n\nbase.random.betaprime.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.betaprime.PRNG;\n\n\nbase.random.betaprime.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.betaprime.seed;\n\n\nbase.random.betaprime.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.betaprime.seedLength;\n\n\nbase.random.betaprime.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.betaprime.state\n <Uint32Array>\n\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.betaprime.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n\nbase.random.betaprime.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.betaprime.stateLength;\n\n\nbase.random.betaprime.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.betaprime.byteLength;\n\n\nbase.random.betaprime.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.betaprime.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.binomial": "\nbase.random.binomial( n, p )\n Returns a pseudorandom number drawn from a binomial distribution.\n\n If `n` is not a positive integer or `p` is not a probability, the function\n returns `NaN`.\n\n If `n` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.binomial( 20, 0.8 );\n\n\nbase.random.binomial.factory( [n, p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a binomial distribution.\n\n If provided `n` and `p`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `n` and `p`, the returned PRNG requires that both `n` and\n `p` be provided at each invocation.\n\n Parameters\n ----------\n n: integer (optional)\n Number of trials.\n\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.binomial.factory();\n > var r = rand( 20, 0.3 );\n > r = rand( 10, 0.77 );\n\n // Provide `n` and `p`:\n > rand = base.random.binomial.factory( 10, 0.8 );\n > r = rand();\n > r = rand();\n\n\nbase.random.binomial.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.binomial.NAME\n 'binomial'\n\n\nbase.random.binomial.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.binomial.PRNG;\n\n\nbase.random.binomial.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.binomial.seed;\n\n\nbase.random.binomial.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.binomial.seedLength;\n\n\nbase.random.binomial.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.binomial.state\n <Uint32Array>\n\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n // Set the state:\n > base.random.binomial.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n\nbase.random.binomial.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.binomial.stateLength;\n\n\nbase.random.binomial.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.binomial.byteLength;\n\n\nbase.random.binomial.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.binomial.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.boxMuller": "\nbase.random.boxMuller()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.boxMuller();\n\n\nbase.random.boxMuller.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.boxMuller.factory();\n > r = rand();\n > r = rand();\n\n\nbase.random.boxMuller.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.boxMuller.NAME\n 'box-muller'\n\n\nbase.random.boxMuller.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.boxMuller.PRNG;\n\n\nbase.random.boxMuller.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.boxMuller.seed;\n\n\nbase.random.boxMuller.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.boxMuller.seedLength;\n\n\nbase.random.boxMuller.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.boxMuller.state\n <Uint32Array>\n\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n // Set the state:\n > base.random.boxMuller.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n\nbase.random.boxMuller.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.boxMuller.stateLength;\n\n\nbase.random.boxMuller.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.boxMuller.byteLength;\n\n\nbase.random.boxMuller.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.boxMuller.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.cauchy": "\nbase.random.cauchy( x0, Ɣ )\n Returns a pseudorandom number drawn from a Cauchy distribution.\n\n If `x0` or `Ɣ` is `NaN` or `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.cauchy( 2.0, 5.0 );\n\n\nbase.random.cauchy.factory( [x0, Ɣ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Cauchy distribution.\n\n If provided `x0` and `Ɣ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `x0` and `Ɣ`, the returned PRNG requires that both `x0` and\n `Ɣ` be provided at each invocation.\n\n Parameters\n ----------\n x0: number (optional)\n Location parameter.\n\n Ɣ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.cauchy.factory();\n > var r = rand( 0.0, 1.5 );\n > r = rand( -2.0, 2.0 );\n\n // Provide `x0` and `Ɣ`:\n > rand = base.random.cauchy.factory( 0.0, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.cauchy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.cauchy.NAME\n 'cauchy'\n\n\nbase.random.cauchy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.cauchy.PRNG;\n\n\nbase.random.cauchy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.cauchy.seed;\n\n\nbase.random.cauchy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.cauchy.seedLength;\n\n\nbase.random.cauchy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.cauchy.state\n <Uint32Array>\n\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.cauchy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n\nbase.random.cauchy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.cauchy.stateLength;\n\n\nbase.random.cauchy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.cauchy.byteLength;\n\n\nbase.random.cauchy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.cauchy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.chi": "\nbase.random.chi( k )\n Returns a pseudorandom number drawn from a chi distribution.\n\n If `k <= 0` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.chi( 2 );\n\n\nbase.random.chi.factory( [k, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a chi distribution.\n\n If provided `k`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `k`, the returned PRNG requires that `k` be provided at each\n invocation.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.chi.factory();\n > var r = rand( 5 );\n > r = rand( 3.14 );\n\n // Provide `k`:\n > rand = base.random.chi.factory( 3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.chi.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.chi.NAME\n 'chi'\n\n\nbase.random.chi.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.chi.PRNG;\n\n\nbase.random.chi.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.chi.seed;\n\n\nbase.random.chi.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.chi.seedLength;\n\n\nbase.random.chi.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.chi.state\n <Uint32Array>\n\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n // Set the state:\n > base.random.chi.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n\nbase.random.chi.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.chi.stateLength;\n\n\nbase.random.chi.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.chi.byteLength;\n\n\nbase.random.chi.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.chi.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.chisquare": "\nbase.random.chisquare( k )\n Returns a pseudorandom number drawn from a chi-square distribution.\n\n If `k <= 0` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.chisquare( 2 );\n\n\nbase.random.chisquare.factory( [k, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a chi-square distribution.\n\n If provided `k`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `k`, the returned PRNG requires that `k` be provided at each\n invocation.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.chisquare.factory();\n > var r = rand( 5 );\n > r = rand( 3.14 );\n\n // Provide `k`:\n > rand = base.random.chisquare.factory( 3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.chisquare.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.chisquare.NAME\n 'chisquare'\n\n\nbase.random.chisquare.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.chisquare.PRNG;\n\n\nbase.random.chisquare.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.chisquare.seed;\n\n\nbase.random.chisquare.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.chisquare.seedLength;\n\n\nbase.random.chisquare.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.chisquare.state\n <Uint32Array>\n\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n // Set the state:\n > base.random.chisquare.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n\nbase.random.chisquare.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.chisquare.stateLength;\n\n\nbase.random.chisquare.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.chisquare.byteLength;\n\n\nbase.random.chisquare.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.chisquare.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.cosine": "\nbase.random.cosine( μ, s )\n Returns a pseudorandom number drawn from a raised cosine distribution.\n\n If `μ` or `s` is `NaN` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.cosine( 2.0, 5.0 );\n\n\nbase.random.cosine.factory( [μ, s, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a raised cosine distribution.\n\n If provided `μ` and `s`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `s`, the returned PRNG requires that both `μ` and\n `s` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter.\n\n s: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.cosine.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `s`:\n > rand = base.random.cosine.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.cosine.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.cosine.NAME\n 'cosine'\n\n\nbase.random.cosine.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.cosine.PRNG;\n\n\nbase.random.cosine.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.cosine.seed;\n\n\nbase.random.cosine.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.cosine.seedLength;\n\n\nbase.random.cosine.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.cosine.state\n <Uint32Array>\n\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.cosine.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n\nbase.random.cosine.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.cosine.stateLength;\n\n\nbase.random.cosine.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.cosine.byteLength;\n\n\nbase.random.cosine.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.cosine.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.discreteUniform": "\nbase.random.discreteUniform( a, b )\n Returns a pseudorandom number drawn from a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.discreteUniform( 2, 50 );\n\n\nbase.random.discreteUniform.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a discrete uniform distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: integer (optional)\n Minimum support.\n\n b: integer (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom integers. If provided, the `state` and `seed`\n options are ignored. In order to seed the returned pseudorandom number\n generator, one must seed the provided `prng` (assuming the provided\n `prng` is seedable). The provided PRNG must have `MIN` and `MAX`\n properties specifying the minimum and maximum possible pseudorandom\n integers.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.discreteUniform.factory();\n > var r = rand( 0, 10 );\n > r = rand( -20, 20 );\n\n // Provide `a` and `b`:\n > rand = base.random.discreteUniform.factory( 0, 10 );\n > r = rand();\n > r = rand();\n\n\nbase.random.discreteUniform.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.discreteUniform.NAME\n 'discrete-uniform'\n\n\nbase.random.discreteUniform.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.discreteUniform.PRNG;\n\n\nbase.random.discreteUniform.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.discreteUniform.seed;\n\n\nbase.random.discreteUniform.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.discreteUniform.seedLength;\n\n\nbase.random.discreteUniform.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.discreteUniform.state\n <Uint32Array>\n\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n // Set the state:\n > base.random.discreteUniform.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n\nbase.random.discreteUniform.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.discreteUniform.stateLength;\n\n\nbase.random.discreteUniform.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.discreteUniform.byteLength;\n\n\nbase.random.discreteUniform.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.discreteUniform.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.erlang": "\nbase.random.erlang( k, λ )\n Returns a pseudorandom number drawn from an Erlang distribution.\n\n If `k` is not a positive integer or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.erlang( 2, 5.0 );\n\n\nbase.random.erlang.factory( [k, λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an Erlang distribution.\n\n If provided `k` and `λ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `k` and `λ`, the returned PRNG requires that both `k` and\n `λ` be provided at each invocation.\n\n Parameters\n ----------\n k: integer (optional)\n Shape parameter.\n\n λ: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.erlang.factory();\n > var r = rand( 2, 1.0 );\n > r = rand( 4, 3.14 );\n\n // Provide `k` and `λ`:\n > rand = base.random.erlang.factory( 2, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.erlang.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.erlang.NAME\n 'erlang'\n\n\nbase.random.erlang.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.erlang.PRNG;\n\n\nbase.random.erlang.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.erlang.seed;\n\n\nbase.random.erlang.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.erlang.seedLength;\n\n\nbase.random.erlang.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.erlang.state\n <Uint32Array>\n\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n // Set the state:\n > base.random.erlang.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n\nbase.random.erlang.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.erlang.stateLength;\n\n\nbase.random.erlang.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.erlang.byteLength;\n\n\nbase.random.erlang.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.erlang.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.exponential": "\nbase.random.exponential( λ )\n Returns a pseudorandom number drawn from an exponential distribution.\n\n If `λ <= 0` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.exponential( 7.9 );\n\n\nbase.random.exponential.factory( [λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an exponential distribution.\n\n If provided `λ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `λ`, the returned PRNG requires that `λ` be provided at each\n invocation.\n\n Parameters\n ----------\n λ: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.exponential.factory();\n > var r = rand( 5.0 );\n > r = rand( 3.14 );\n\n // Provide `λ`:\n > rand = base.random.exponential.factory( 10.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.exponential.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.exponential.NAME\n 'exponential'\n\n\nbase.random.exponential.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.exponential.PRNG;\n\n\nbase.random.exponential.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.exponential.seed;\n\n\nbase.random.exponential.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.exponential.seedLength;\n\n\nbase.random.exponential.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.exponential.state\n <Uint32Array>\n\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n // Set the state:\n > base.random.exponential.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n\nbase.random.exponential.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.exponential.stateLength;\n\n\nbase.random.exponential.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.exponential.byteLength;\n\n\nbase.random.exponential.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.exponential.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.f": "\nbase.random.f( d1, d2 )\n Returns a pseudorandom number drawn from an F distribution.\n\n If `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Degrees of freedom.\n\n d2: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.f( 2.0, 5.0 );\n\n\nbase.random.f.factory( [d1, d2, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an F distribution.\n\n If provided `d1` and `d2`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `d1` and `d2`, the returned PRNG requires that both `d1` and\n `d2` be provided at each invocation.\n\n Parameters\n ----------\n d1: number (optional)\n Degrees of freedom.\n\n d2: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.f.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.0, 3.14 );\n\n // Provide `d1` and `d2`:\n > rand = base.random.f.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.f.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.f.NAME\n 'f'\n\n\nbase.random.f.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.f.PRNG;\n\n\nbase.random.f.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.f.seed;\n\n\nbase.random.f.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.f.seedLength;\n\n\nbase.random.f.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.f.state\n <Uint32Array>\n\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n // Set the state:\n > base.random.f.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n\nbase.random.f.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.f.stateLength;\n\n\nbase.random.f.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.f.byteLength;\n\n\nbase.random.f.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.f.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.frechet": "\nbase.random.frechet( α, s, m )\n Returns a pseudorandom number drawn from a Fréchet distribution.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n If either `α`, `s`, or `m` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.frechet( 2.0, 5.0, 3.33 );\n\n\nbase.random.frechet.factory( [α, s, m, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a triangular distribution.\n\n If provided `α`, `s`, and `m`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `α`, `s`, and `m`, the returned PRNG requires that `α`, `s`,\n and `m` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n s: number (optional)\n Scale parameter.\n\n m: number (optional)\n Location parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.frechet.factory();\n > var r = rand( 1.0, 1.0, 0.5 );\n > r = rand( 2.0, 2.0, 1.0 );\n\n // Provide `α`, `s`, and `m`:\n > rand = base.random.frechet.factory( 1.0, 1.0, 0.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.frechet.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.frechet.NAME\n 'frechet'\n\n\nbase.random.frechet.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.frechet.PRNG;\n\n\nbase.random.frechet.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.frechet.seed;\n\n\nbase.random.frechet.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.frechet.seedLength;\n\n\nbase.random.frechet.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.frechet.state\n <Uint32Array>\n\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n // Set the state:\n > base.random.frechet.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n\nbase.random.frechet.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.frechet.stateLength;\n\n\nbase.random.frechet.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.frechet.byteLength;\n\n\nbase.random.frechet.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.frechet.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.gamma": "\nbase.random.gamma( α, β )\n Returns a pseudorandom number drawn from a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.gamma( 2.0, 5.0 );\n\n\nbase.random.gamma.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a gamma distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.gamma.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.14, 2.25 );\n\n // Provide `α` and `β`:\n > rand = base.random.gamma.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.gamma.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.gamma.NAME\n 'gamma'\n\n\nbase.random.gamma.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.gamma.PRNG;\n\n\nbase.random.gamma.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.gamma.seed;\n\n\nbase.random.gamma.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.gamma.seedLength;\n\n\nbase.random.gamma.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.gamma.state\n <Uint32Array>\n\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.gamma.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n\nbase.random.gamma.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.gamma.stateLength;\n\n\nbase.random.gamma.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.gamma.byteLength;\n\n\nbase.random.gamma.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.gamma.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.geometric": "\nbase.random.geometric( p )\n Returns a pseudorandom number drawn from a geometric distribution.\n\n If `p < 0` or `p > 1` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.geometric( 0.8 );\n\n\nbase.random.geometric.factory( [p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a geometric distribution.\n\n If provided `p`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `p`, the returned PRNG requires that `p` be provided at each\n invocation.\n\n Parameters\n ----------\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.geometric.factory();\n > var r = rand( 0.3 );\n > r = rand( 0.59 );\n\n // Provide `p`:\n > rand = base.random.geometric.factory( 0.3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.geometric.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.geometric.NAME\n 'geometric'\n\n\nbase.random.geometric.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.geometric.PRNG;\n\n\nbase.random.geometric.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.geometric.seed;\n\n\nbase.random.geometric.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.geometric.seedLength;\n\n\nbase.random.geometric.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.geometric.state\n <Uint32Array>\n\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n // Set the state:\n > base.random.geometric.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n\nbase.random.geometric.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.geometric.stateLength;\n\n\nbase.random.geometric.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.geometric.byteLength;\n\n\nbase.random.geometric.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.geometric.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.gumbel": "\nbase.random.gumbel( μ, β )\n Returns a pseudorandom number drawn from a Gumbel distribution.\n\n If `μ` or `β` is `NaN` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.gumbel( 2.0, 5.0 );\n\n\nbase.random.gumbel.factory( [μ, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Gumbel distribution.\n\n If provided `μ` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `β`, the returned PRNG requires that both `μ` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.gumbel.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `β`:\n > rand = base.random.gumbel.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.gumbel.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.gumbel.NAME\n 'gumbel'\n\n\nbase.random.gumbel.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.gumbel.PRNG;\n\n\nbase.random.gumbel.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.gumbel.seed;\n\n\nbase.random.gumbel.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.gumbel.seedLength;\n\n\nbase.random.gumbel.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.gumbel.state\n <Uint32Array>\n\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.gumbel.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n\nbase.random.gumbel.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.gumbel.stateLength;\n\n\nbase.random.gumbel.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.gumbel.byteLength;\n\n\nbase.random.gumbel.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.gumbel.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.hypergeometric": "\nbase.random.hypergeometric( N, K, n )\n Returns a pseudorandom number drawn from a hypergeometric distribution.\n\n `N`, `K`, and `n` must all be nonnegative integers; otherwise, the function\n returns `NaN`.\n\n If `n > N` or `K > N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.hypergeometric( 20, 10, 7 );\n\n\nbase.random.hypergeometric.factory( [N, K, n, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a hypergeometric distribution.\n\n If provided `N`, `K`, and `n`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `N`, `K`, and `n`, the returned PRNG requires that `N`, `K`,\n and `n` be provided at each invocation.\n\n Parameters\n ----------\n N: integer (optional)\n Population size.\n\n K: integer (optional)\n Subpopulation size.\n\n n: integer (optional)\n Number of draws.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.hypergeometric.factory();\n > var r = rand( 20, 10, 15 );\n > r = rand( 20, 10, 7 );\n\n // Provide `N`, `K`, and `n`:\n > rand = base.random.hypergeometric.factory( 20, 10, 15 );\n > r = rand();\n > r = rand();\n\n\nbase.random.hypergeometric.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.hypergeometric.NAME\n 'hypergeometric'\n\n\nbase.random.hypergeometric.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.hypergeometric.PRNG;\n\n\nbase.random.hypergeometric.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.hypergeometric.seed;\n\n\nbase.random.hypergeometric.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.hypergeometric.seedLength;\n\n\nbase.random.hypergeometric.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.hypergeometric.state\n <Uint32Array>\n\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n // Set the state:\n > base.random.hypergeometric.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n\nbase.random.hypergeometric.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.hypergeometric.stateLength;\n\n\nbase.random.hypergeometric.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.hypergeometric.byteLength;\n\n\nbase.random.hypergeometric.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.hypergeometric.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.improvedZiggurat": "\nbase.random.improvedZiggurat()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.improvedZiggurat();\n\n\nbase.random.improvedZiggurat.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.improvedZiggurat.factory();\n > r = rand();\n > r = rand();\n\n\nbase.random.improvedZiggurat.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.improvedZiggurat.NAME\n 'improved-ziggurat'\n\n\nbase.random.improvedZiggurat.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.improvedZiggurat.PRNG;\n\n\nbase.random.improvedZiggurat.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.improvedZiggurat.seed;\n\n\nbase.random.improvedZiggurat.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.improvedZiggurat.seedLength;\n\n\nbase.random.improvedZiggurat.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.improvedZiggurat.state\n <Uint32Array>\n\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n // Set the state:\n > base.random.improvedZiggurat.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n\nbase.random.improvedZiggurat.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.improvedZiggurat.stateLength;\n\n\nbase.random.improvedZiggurat.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.improvedZiggurat.byteLength;\n\n\nbase.random.improvedZiggurat.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.improvedZiggurat.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.invgamma": "\nbase.random.invgamma( α, β )\n Returns a pseudorandom number drawn from an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.invgamma( 2.0, 5.0 );\n\n\nbase.random.invgamma.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an inverse gamma distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.invgamma.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.14, 2.25 );\n\n // Provide `α` and `β`:\n > rand = base.random.invgamma.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.invgamma.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.invgamma.NAME\n 'invgamma'\n\n\nbase.random.invgamma.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.invgamma.PRNG;\n\n\nbase.random.invgamma.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.invgamma.seed;\n\n\nbase.random.invgamma.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.invgamma.seedLength;\n\n\nbase.random.invgamma.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.invgamma.state\n <Uint32Array>\n\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.invgamma.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n\nbase.random.invgamma.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.invgamma.stateLength;\n\n\nbase.random.invgamma.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.invgamma.byteLength;\n\n\nbase.random.invgamma.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.invgamma.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.kumaraswamy": "\nbase.random.kumaraswamy( a, b )\n Returns a pseudorandom number drawn from Kumaraswamy's double bounded\n distribution.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.kumaraswamy( 2.0, 5.0 );\n\n\nbase.random.kumaraswamy.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from Kumaraswamy's double bounded distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n First shape parameter.\n\n b: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.kumaraswamy.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `a` and `b`:\n > rand = base.random.kumaraswamy.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.kumaraswamy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.kumaraswamy.NAME\n 'kumaraswamy'\n\n\nbase.random.kumaraswamy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.kumaraswamy.PRNG;\n\n\nbase.random.kumaraswamy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.kumaraswamy.seed;\n\n\nbase.random.kumaraswamy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.kumaraswamy.seedLength;\n\n\nbase.random.kumaraswamy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.kumaraswamy.state\n <Uint32Array>\n\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n // Set the state:\n > base.random.kumaraswamy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n\nbase.random.kumaraswamy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.kumaraswamy.stateLength;\n\n\nbase.random.kumaraswamy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.kumaraswamy.byteLength;\n\n\nbase.random.kumaraswamy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.kumaraswamy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.laplace": "\nbase.random.laplace( μ, b )\n Returns a pseudorandom number drawn from a Laplace distribution.\n\n If `μ` or `b` is `NaN` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.laplace( 2.0, 5.0 );\n\n\nbase.random.laplace.factory( [μ, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Laplace distribution.\n\n If provided `μ` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `b`, the returned PRNG requires that both `μ` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n b: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.laplace.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `b`:\n > rand = base.random.laplace.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.laplace.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.laplace.NAME\n 'laplace'\n\n\nbase.random.laplace.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.laplace.PRNG;\n\n\nbase.random.laplace.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.laplace.seed;\n\n\nbase.random.laplace.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.laplace.seedLength;\n\n\nbase.random.laplace.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.laplace.state\n <Uint32Array>\n\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.laplace.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n\nbase.random.laplace.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.laplace.stateLength;\n\n\nbase.random.laplace.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.laplace.byteLength;\n\n\nbase.random.laplace.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.laplace.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.levy": "\nbase.random.levy( μ, c )\n Returns a pseudorandom number drawn from a Lévy distribution.\n\n If `μ` or `c` is `NaN` or `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.levy( 2.0, 5.0 );\n\n\nbase.random.levy.factory( [μ, c, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Lévy distribution.\n\n If provided `μ` and `c`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `c`, the returned PRNG requires that both `μ` and\n `c` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n c: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.levy.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `b`:\n > rand = base.random.levy.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.levy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.levy.NAME\n 'levy'\n\n\nbase.random.levy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.levy.PRNG;\n\n\nbase.random.levy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.levy.seed;\n\n\nbase.random.levy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.levy.seedLength;\n\n\nbase.random.levy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.levy.state\n <Uint32Array>\n\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.levy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n\nbase.random.levy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.levy.stateLength;\n\n\nbase.random.levy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.levy.byteLength;\n\n\nbase.random.levy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.levy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.logistic": "\nbase.random.logistic( μ, s )\n Returns a pseudorandom number drawn from a logistic distribution.\n\n If `μ` or `s` is `NaN` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.logistic( 2.0, 5.0 );\n\n\nbase.random.logistic.factory( [μ, s, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a logistic distribution.\n\n If provided `μ` and `s`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `s`, the returned PRNG requires that both `μ` and\n `s` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n s: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.logistic.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `s`:\n > rand = base.random.logistic.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.logistic.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.logistic.NAME\n 'logistic'\n\n\nbase.random.logistic.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.logistic.PRNG;\n\n\nbase.random.logistic.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.logistic.seed;\n\n\nbase.random.logistic.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.logistic.seedLength;\n\n\nbase.random.logistic.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.logistic.state\n <Uint32Array>\n\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.logistic.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n\nbase.random.logistic.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.logistic.stateLength;\n\n\nbase.random.logistic.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.logistic.byteLength;\n\n\nbase.random.logistic.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.logistic.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.lognormal": "\nbase.random.lognormal( μ, σ )\n Returns a pseudorandom number drawn from a lognormal distribution.\n\n If `μ` or `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.lognormal( 2.0, 5.0 );\n\n\nbase.random.lognormal.factory( [μ, σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a lognormal distribution.\n\n If provided `μ` and `σ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `σ`, the returned PRNG requires that both `μ` and\n `σ` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter.\n\n σ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.lognormal.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `σ`:\n > rand = base.random.lognormal.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.lognormal.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.lognormal.NAME\n 'lognormal'\n\n\nbase.random.lognormal.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.lognormal.PRNG;\n\n\nbase.random.lognormal.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.lognormal.seed;\n\n\nbase.random.lognormal.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.lognormal.seedLength;\n\n\nbase.random.lognormal.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.lognormal.state\n <Uint32Array>\n\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.lognormal.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n\nbase.random.lognormal.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.lognormal.stateLength;\n\n\nbase.random.lognormal.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.lognormal.byteLength;\n\n\nbase.random.lognormal.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.lognormal.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.minstd": "\nbase.random.minstd()\n Returns a pseudorandom integer on the interval `[1, 2147483646]`.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) based on Park and Miller.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. More\n importantly, the \"randomness quality\" of the generator's output is lacking.\n These defects make the generator unsuitable, for example, in Monte Carlo\n simulations and in cryptographic applications.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstd();\n\n\nbase.random.minstd.normalized()\n Returns a pseudorandom number on the interval `[0,1)`.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstd.normalized();\n\n\nbase.random.minstd.factory( [options] )\n Returns a linear congruential pseudorandom number generator (LCG).\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer on the interval `[1, 2147483646]` or, for\n arbitrary length seeds, an array-like object containing signed 32-bit\n integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.minstd.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.minstd.factory( { 'seed': 1234 } );\n > r = rand()\n 20739838\n\n\nbase.random.minstd.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.minstd.NAME\n 'minstd'\n\n\nbase.random.minstd.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.minstd.MIN\n 1\n\n\nbase.random.minstd.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.minstd.MAX\n 2147483646\n\n\nbase.random.minstd.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.minstd.seed;\n\n\nbase.random.minstd.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.minstd.seedLength;\n\n\nbase.random.minstd.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n // Get the current state:\n > var state = base.random.minstd.state\n <Int32Array>\n\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n // Set the state:\n > base.random.minstd.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n\nbase.random.minstd.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.minstd.stateLength;\n\n\nbase.random.minstd.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.minstd.byteLength;\n\n\nbase.random.minstd.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.minstd.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstdShuffle, base.random.mt19937, base.random.randi\n",
"base.random.minstdShuffle": "\nbase.random.minstdShuffle()\n Returns a pseudorandom integer on the interval `[1, 2147483646]`.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) whose output is shuffled using the Bays-\n Durham algorithm. The shuffle step considerably strengthens the \"randomness\n quality\" of a simple LCG's output.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. In\n general, this generator is unsuitable for Monte Carlo simulations and\n cryptographic applications.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstdShuffle();\n\n\nbase.random.minstdShuffle.normalized()\n Returns a pseudorandom number on the interval `[0,1)`.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstdShuffle.normalized();\n\n\nbase.random.minstdShuffle.factory( [options] )\n Returns a linear congruential pseudorandom number generator (LCG) whose\n output is shuffled.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer on the interval `[1, 2147483646]` or, for\n arbitrary length seeds, an array-like object containing signed 32-bit\n integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.minstdShuffle.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.minstdShuffle.factory( { 'seed': 1234 } );\n > r = rand()\n 1421600654\n\n\nbase.random.minstdShuffle.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.minstdShuffle.NAME\n 'minstd-shuffle'\n\n\nbase.random.minstdShuffle.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.minstdShuffle.MIN\n 1\n\n\nbase.random.minstdShuffle.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.minstdShuffle.MAX\n 2147483646\n\n\nbase.random.minstdShuffle.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.minstdShuffle.seed;\n\n\nbase.random.minstdShuffle.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.minstdShuffle.seedLength;\n\n\nbase.random.minstdShuffle.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.minstdShuffle.state\n <Int32Array>\n\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n // Set the state:\n > base.random.minstdShuffle.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n\nbase.random.minstdShuffle.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.minstdShuffle.stateLength;\n\n\nbase.random.minstdShuffle.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.minstdShuffle.byteLength;\n\n\nbase.random.minstdShuffle.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.minstdShuffle.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.mt19937, base.random.randi\n",
"base.random.mt19937": "\nbase.random.mt19937()\n Returns a pseudorandom integer on the interval `[1, 4294967295]`.\n\n This pseudorandom number generator (PRNG) is a 32-bit Mersenne Twister\n pseudorandom number generator.\n\n The PRNG is *not* a cryptographically secure PRNG.\n\n The PRNG has a period of 2^19937 - 1.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.mt19937();\n\n\nbase.random.mt19937.normalized()\n Returns a pseudorandom number on the interval `[0,1)` with 53-bit precision.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.mt19937.normalized();\n\n\nbase.random.mt19937.factory( [options] )\n Returns a 32-bit Mersenne Twister pseudorandom number generator.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.mt19937.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.mt19937.factory( { 'seed': 1234 } );\n > r = rand()\n 822569775\n\n\nbase.random.mt19937.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.mt19937.NAME\n 'mt19937'\n\n\nbase.random.mt19937.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.mt19937.MIN\n 1\n\n\nbase.random.mt19937.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.mt19937.MAX\n 4294967295\n\n\nbase.random.mt19937.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.mt19937.seed;\n\n\nbase.random.mt19937.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.mt19937.seedLength;\n\n\nbase.random.mt19937.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.mt19937.state\n <Uint32Array>\n\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n // Set the state:\n > base.random.mt19937.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n\nbase.random.mt19937.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.mt19937.stateLength;\n\n\nbase.random.mt19937.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.mt19937.byteLength;\n\n\nbase.random.mt19937.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.mt19937.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.randi\n",
"base.random.negativeBinomial": "\nbase.random.negativeBinomial( r, p )\n Returns a pseudorandom number drawn from a negative binomial distribution.\n\n If `p` is not in the interval `(0,1)`, the function returns `NaN`.\n\n If `r` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.negativeBinomial( 20, 0.8 );\n\n\nbase.random.negativeBinomial.factory( [r, p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a negative binomial distribution.\n\n If provided `r` and `p`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `r` and `p`, the returned PRNG requires that both `r` and\n `p` be provided at each invocation.\n\n Parameters\n ----------\n r: number (optional)\n Number of successes until experiment is stopped.\n\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.negativeBinomial.factory();\n > var r = rand( 20, 0.3 );\n > r = rand( 10, 0.77 );\n\n // Provide `r` and `p`:\n > rand = base.random.negativeBinomial.factory( 10, 0.8 );\n > r = rand();\n > r = rand();\n\n\nbase.random.negativeBinomial.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.negativeBinomial.NAME\n 'negative-binomial'\n\n\nbase.random.negativeBinomial.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.negativeBinomial.PRNG;\n\n\nbase.random.negativeBinomial.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.negativeBinomial.seed;\n\n\nbase.random.negativeBinomial.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.negativeBinomial.seedLength;\n\n\nbase.random.negativeBinomial.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.negativeBinomial.state\n <Uint32Array>\n\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n // Set the state:\n > base.random.negativeBinomial.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n\nbase.random.negativeBinomial.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.negativeBinomial.stateLength;\n\n\nbase.random.negativeBinomial.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.negativeBinomial.byteLength;\n\n\nbase.random.negativeBinomial.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.negativeBinomial.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.normal": "\nbase.random.normal( μ, σ )\n Returns a pseudorandom number drawn from a normal distribution.\n\n If `μ` or `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.normal( 2.0, 5.0 );\n\n\nbase.random.normal.factory( [μ, σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a normal distribution.\n\n If provided `μ` and `σ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `σ`, the returned PRNG requires that both `μ` and\n `σ` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n σ: number (optional)\n Standard deviation.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.normal.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `σ`:\n > rand = base.random.normal.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.normal.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.normal.NAME\n 'normal'\n\n\nbase.random.normal.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.normal.PRNG;\n\n\nbase.random.normal.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.normal.seed;\n\n\nbase.random.normal.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.normal.seedLength;\n\n\nbase.random.normal.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.normal.state\n <Uint32Array>\n\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.normal.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n\nbase.random.normal.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.normal.stateLength;\n\n\nbase.random.normal.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.normal.byteLength;\n\n\nbase.random.normal.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.normal.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.pareto1": "\nbase.random.pareto1( α, β )\n Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.pareto1( 2.0, 5.0 );\n\n\nbase.random.pareto1.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Pareto (Type I) distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.pareto1.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.pareto1.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.pareto1.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.pareto1.NAME\n 'pareto-type1'\n\n\nbase.random.pareto1.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.pareto1.PRNG;\n\n\nbase.random.pareto1.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.pareto1.seed;\n\n\nbase.random.pareto1.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.pareto1.seedLength;\n\n\nbase.random.pareto1.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.pareto1.state\n <Uint32Array>\n\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.pareto1.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n\nbase.random.pareto1.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.pareto1.stateLength;\n\n\nbase.random.pareto1.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.pareto1.byteLength;\n\n\nbase.random.pareto1.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.pareto1.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.poisson": "\nbase.random.poisson( λ )\n Returns a pseudorandom number drawn from a Poisson distribution.\n\n If `λ <= 0` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.poisson( 7.9 );\n\n\nbase.random.poisson.factory( [λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Poisson distribution.\n\n If provided `λ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `λ`, the returned PRNG requires that `λ` be provided at each\n invocation.\n\n Parameters\n ----------\n λ: number (optional)\n Mean.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.poisson.factory();\n > var r = rand( 4.0 );\n > r = rand( 3.14 );\n\n // Provide `λ`:\n > rand = base.random.poisson.factory( 10.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.poisson.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.poisson.NAME\n 'poisson'\n\n\nbase.random.poisson.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.poisson.PRNG;\n\n\nbase.random.poisson.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.poisson.seed;\n\n\nbase.random.poisson.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.poisson.seedLength;\n\n\nbase.random.poisson.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.poisson.state\n <Uint32Array>\n\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n // Set the state:\n > base.random.poisson.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n\nbase.random.poisson.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.poisson.stateLength;\n\n\nbase.random.poisson.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.poisson.byteLength;\n\n\nbase.random.poisson.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.poisson.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.randi": "\nbase.random.randi()\n Returns a pseudorandom number having an integer value.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.randi();\n\n\nbase.random.randi.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers having integer values.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG). The\n following PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: 'mt19937'.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var randi = base.random.randi.factory();\n > var r = randi();\n > r = randi();\n\n // Specify alternative PRNG:\n > randi = base.random.randi.factory({ 'name': 'minstd' });\n > r = randi();\n > r = randi();\n\n\nbase.random.randi.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randi.NAME\n 'randi'\n\n\nbase.random.randi.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randi.PRNG;\n\n\nbase.random.randi.MIN\n Minimum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randi.MIN;\n\n\nbase.random.randi.MAX\n Maximum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randi.MAX;\n\n\nbase.random.randi.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randi.seed;\n\n\nbase.random.randi.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randi.seedLength;\n\n\nbase.random.randi.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randi.state;\n\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n // Set the state:\n > base.random.randi.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n\nbase.random.randi.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randi.stateLength;\n\n\nbase.random.randi.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randi.byteLength;\n\n\nbase.random.randi.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randi.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.minstdShuffle, base.random.mt19937\n",
"base.random.randn": "\nbase.random.randn()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.randn();\n\n\nbase.random.randn.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG) that samples\n from a standard normal distribution. The following PRNGs are supported:\n\n - improved-ziggurat: improved ziggurat method.\n - box-muller: Box-Muller transform.\n\n Default: 'improved-ziggurat'.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.randn.factory();\n > var r = rand();\n > r = rand();\n\n // Specify alternative PRNG:\n > var rand = base.random.randn.factory({ 'name': 'box-muller' });\n > r = rand();\n > r = rand();\n\n\nbase.random.randn.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randn.NAME\n 'randn'\n\n\nbase.random.randn.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randn.PRNG;\n\n\nbase.random.randn.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randn.seed;\n\n\nbase.random.randn.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randn.seedLength;\n\n\nbase.random.randn.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randn.state;\n\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n // Set the state:\n > base.random.randn.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n\nbase.random.randn.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randn.stateLength;\n\n\nbase.random.randn.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randn.byteLength;\n\n\nbase.random.randn.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randn.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.improvedZiggurat, base.random.randu\n",
"base.random.randu": "\nbase.random.randu()\n Returns a pseudorandom number drawn from a uniform distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number on the interval `[0,1)`.\n\n Examples\n --------\n > var r = base.random.randu();\n\n\nbase.random.randu.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a uniform distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG). The\n following PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: 'mt19937'.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.randu.factory();\n > var r = rand();\n > r = rand();\n\n // Specify alternative PRNG:\n > var rand = base.random.randu.factory({ 'name': 'minstd' });\n > r = rand();\n > r = rand();\n\n\nbase.random.randu.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randu.NAME\n 'randu'\n\n\nbase.random.randu.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randu.PRNG;\n\n\nbase.random.randu.MIN\n Minimum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randu.MIN;\n\n\nbase.random.randu.MAX\n Maximum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randu.MAX;\n\n\nbase.random.randu.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randu.seed;\n\n\nbase.random.randu.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randu.seedLength;\n\n\nbase.random.randu.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randu.state;\n\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n // Set the state:\n > base.random.randu.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n\nbase.random.randu.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randu.stateLength;\n\n\nbase.random.randu.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randu.byteLength;\n\n\nbase.random.randu.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randu.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.discreteUniform, base.random.randn\n",
"base.random.rayleigh": "\nbase.random.rayleigh( σ )\n Returns a pseudorandom number drawn from a Rayleigh distribution.\n\n If `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.rayleigh( 2.5 );\n\n\nbase.random.rayleigh.factory( [σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Rayleigh distribution.\n\n If provided `σ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `σ`, the returned PRNG requires that `σ` be provided at each\n invocation.\n\n Parameters\n ----------\n σ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.rayleigh.factory();\n > var r = rand( 5.0 );\n > r = rand( 10.0 );\n\n // Provide `σ`:\n > rand = base.random.rayleigh.factory( 5.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.rayleigh.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.rayleigh.NAME\n 'rayleigh'\n\n\nbase.random.rayleigh.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.rayleigh.PRNG;\n\n\nbase.random.rayleigh.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.rayleigh.seed;\n\n\nbase.random.rayleigh.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.rayleigh.seedLength;\n\n\nbase.random.rayleigh.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.rayleigh.state\n <Uint32Array>\n\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n // Set the state:\n > base.random.rayleigh.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n\nbase.random.rayleigh.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.rayleigh.stateLength;\n\n\nbase.random.rayleigh.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.rayleigh.byteLength;\n\n\nbase.random.rayleigh.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.rayleigh.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.t": "\nbase.random.t( v )\n Returns a pseudorandom number drawn from a Student's t distribution.\n\n If `v <= 0` or `v` is `NaN`, the function\n returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.t( 2.0 );\n\n\nbase.random.t.factory( [v, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Student's t distribution.\n\n If provided `v`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `v`, the returned PRNG requires that `v` be provided at each\n invocation.\n\n Parameters\n ----------\n v: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.t.factory();\n > var r = rand( 5.0 );\n > r = rand( 3.14 );\n\n // Provide `v`:\n > rand = base.random.t.factory( 5.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.t.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.t.NAME\n 't'\n\n\nbase.random.t.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.t.PRNG;\n\n\nbase.random.t.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.t.seed;\n\n\nbase.random.t.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.t.seedLength;\n\n\nbase.random.t.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.t.state\n <Uint32Array>\n\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n // Set the state:\n > base.random.t.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n\nbase.random.t.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.t.stateLength;\n\n\nbase.random.t.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.t.byteLength;\n\n\nbase.random.t.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.t.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.triangular": "\nbase.random.triangular( a, b, c )\n Returns a pseudorandom number drawn from a triangular distribution.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.triangular( 2.0, 5.0, 3.33 );\n\n\nbase.random.triangular.factory( [a, b, c, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a triangular distribution.\n\n If provided `a`, `b`, and `c`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `a`, `b`, and `c`, the returned PRNG requires that `a`, `b`,\n and `c` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n c: number (optional)\n Mode.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.triangular.factory();\n > var r = rand( 0.0, 1.0, 0.5 );\n > r = rand( -2.0, 2.0, 1.0 );\n\n // Provide `a`, `b`, and `c`:\n > rand = base.random.triangular.factory( 0.0, 1.0, 0.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.triangular.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.triangular.NAME\n 'triangular'\n\n\nbase.random.triangular.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.triangular.PRNG;\n\n\nbase.random.triangular.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.triangular.seed;\n\n\nbase.random.triangular.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.triangular.seedLength;\n\n\nbase.random.triangular.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.triangular.state\n <Uint32Array>\n\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n // Set the state:\n > base.random.triangular.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n\nbase.random.triangular.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.triangular.stateLength;\n\n\nbase.random.triangular.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.triangular.byteLength;\n\n\nbase.random.triangular.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.triangular.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.uniform": "\nbase.random.uniform( a, b )\n Returns a pseudorandom number drawn from a continuous uniform distribution.\n\n If `a >= b`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support (inclusive).\n\n b: number\n Maximum support (exclusive).\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.uniform( 2.0, 5.0 );\n\n\nbase.random.uniform.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a continuous uniform distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support (inclusive).\n\n b: number (optional)\n Maximum support (exclusive).\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.uniform.factory();\n > var r = rand( 0.0, 1.0 );\n > r = rand( -2.0, 2.0 );\n\n // Provide `a` and `b`:\n > rand = base.random.uniform.factory( 0.0, 1.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.uniform.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.uniform.NAME\n 'uniform'\n\n\nbase.random.uniform.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.uniform.PRNG;\n\n\nbase.random.uniform.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.uniform.seed;\n\n\nbase.random.uniform.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.uniform.seedLength;\n\n\nbase.random.uniform.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.uniform.state\n <Uint32Array>\n\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.uniform.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n\nbase.random.uniform.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.uniform.stateLength;\n\n\nbase.random.uniform.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.uniform.byteLength;\n\n\nbase.random.uniform.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.uniform.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.discreteUniform, base.random.randu\n",
"base.random.weibull": "\nbase.random.weibull( k, λ )\n Returns a pseudorandom number drawn from a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If either `λ` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Scale parameter.\n\n λ: number\n Shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.weibull( 2.0, 5.0 );\n\n\nbase.random.weibull.factory( [k, λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Weibull distribution.\n\n If provided `k` and `λ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `k` and `λ`, the returned PRNG requires that both\n `k` and `λ` be provided at each invocation.\n\n Parameters\n ----------\n k: number (optional)\n Scale parameter.\n\n λ: number (optional)\n Shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.weibull.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `λ` and `k`:\n > rand = base.random.weibull.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.weibull.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.weibull.NAME\n 'weibull'\n\n\nbase.random.weibull.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.weibull.PRNG;\n\n\nbase.random.weibull.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.weibull.seed;\n\n\nbase.random.weibull.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.weibull.seedLength;\n\n\nbase.random.weibull.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.weibull.state\n <Uint32Array>\n\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.weibull.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n\nbase.random.weibull.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.weibull.stateLength;\n\n\nbase.random.weibull.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.weibull.byteLength;\n\n\nbase.random.weibull.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.weibull.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.reldiff": "\nbase.reldiff( x, y[, scale] )\n Computes the relative difference of two real numbers.\n\n By default, the function scales the absolute difference by dividing the\n absolute difference by the maximum absolute value of `x` and `y`. To scale\n by a different function, specify a scale function name.\n\n The following `scale` functions are supported:\n\n - 'max-abs': maximum absolute value of `x` and `y` (default).\n - 'max': maximum value of `x` and `y`.\n - 'min-abs': minimum absolute value of `x` and `y`.\n - 'min': minimum value of `x` and `y`.\n - 'mean-abs': arithmetic mean of the absolute values of `x` and `y`.\n - 'mean': arithmetic mean of `x` and `y`.\n - 'x': `x` (*noncommutative*).\n - 'y': `y` (*noncommutative*).\n\n To use a custom scale function, provide a function which accepts two numeric\n arguments `x` and `y`.\n\n If the absolute difference of `x` and `y` is `0`, the relative difference is\n always `0`.\n\n If `|x| = |y| = infinity`, the function returns `NaN`.\n\n If `|x| = |-y| = infinity`, the relative difference is `+infinity`.\n\n If a `scale` function returns `0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n scale: string|Function (optional)\n Scale function. Default: `'max-abs'`.\n\n Returns\n -------\n out: number\n Relative difference.\n\n Examples\n --------\n > var d = base.reldiff( 2.0, 5.0 )\n 0.6\n > d = base.reldiff( -1.0, 3.14 )\n ~1.318\n > d = base.reldiff( -2.0, 5.0, 'max-abs' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'max' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'min-abs' )\n 3.5\n > d = base.reldiff( -2.0, 5.0, 'min' )\n 3.5\n > d = base.reldiff( -2.0, 5.0, 'mean-abs' )\n 2.0\n > d = base.reldiff( -2.0, 5.0, 'mean' )\n ~4.667\n > d = base.reldiff( -2.0, 5.0, 'x' )\n 3.5\n > d = base.reldiff( 5.0, -2.0, 'x' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'y' )\n 1.4\n > d = base.reldiff( 5.0, -2.0, 'y' )\n 3.5\n\n // Custom scale function:\n > function scale( x, y ) {\n ... var s;\n ...\n ... x = base.abs( x );\n ... y = base.abs( y );\n ...\n ... // Maximum absolute value:\n ... s = (x < y ) ? y : x;\n ...\n ... // Scale in units of epsilon:\n ... return s * EPS;\n ... };\n > d = base.reldiff( 12.15, 12.149999999999999, scale )\n ~0.658\n\n See Also\n --------\n base.absdiff, base.epsdiff\n",
"base.rempio2": "\nbase.rempio2( x, y )\n Computes `x - nπ/2 = r`.\n\n The function returns `n` and stores the remainder `r` as the two numbers\n `y[0]` and `y[1]`, such that `y[0] + y[1] = r`.\n\n For input values larger than `2^20 * π/2` in magnitude, the function only\n returns the last three binary digits of `n` and not the full result.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: Array|TypedArray|Object\n Remainder elements.\n\n Returns\n -------\n n: integer\n Factor of `π/2`.\n\n Examples\n --------\n > var y = new Array( 2 );\n > var n = base.rempio2( 128.0, y )\n 81\n > var y1 = y[ 0 ]\n ~0.765\n > var y2 = y[ 1 ]\n ~3.618e-17\n\n\n",
"base.risingFactorial": "\nbase.risingFactorial( x, n )\n Computes the rising factorial of `x` and `n`.\n\n If provided a non-integer for `n`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n n: integer\n Second function parameter.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.risingFactorial( 0.9, 5 )\n ~94.766\n > v = base.risingFactorial( -9.0, 3 )\n -504.0\n > v = base.risingFactorial( 0.0, 2 )\n 0.0\n > v = base.risingFactorial( 3.0, -2 )\n 0.5\n\n See Also\n --------\n base.fallingFactorial\n",
"base.rotl32": "\nbase.rotl32( x, shift )\n Performs a bitwise rotation to the left.\n\n If `shift = 0`, the function returns `x`.\n\n If `shift >= 32`, the function only considers the five least significant\n bits of `shift` (i.e., `shift % 32`).\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n shift: integer\n Number of bits to shift.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var x = 2147483649;\n > var bStr = base.toBinaryStringUint32( x )\n '10000000000000000000000000000001'\n > var y = base.rotl32( x, 10 )\n 1536\n > bstr = base.toBinaryStringUint32( y )\n '00000000000000000000011000000000'\n\n See Also\n --------\n base.rotr32\n",
"base.rotr32": "\nbase.rotr32( x, shift )\n Performs a bitwise rotation to the right.\n\n If `shift = 0`, the function returns `x`.\n\n If `shift >= 32`, the function only considers the five least significant\n bits of `shift` (i.e., `shift % 32`).\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n shift: integer\n Number of bits to shift.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var x = 1;\n > var bStr = base.toBinaryStringUint32( x )\n '00000000000000000000000000000001'\n > var y = base.rotr32( x, 10 )\n 4194304\n > bstr = base.toBinaryStringUint32( y )\n '00000000010000000000000000000000'\n\n See Also\n --------\n base.rotl32\n",
"base.round": "\nbase.round( x )\n Rounds a numeric value to the nearest integer.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round( 3.14 )\n 3.0\n > y = base.round( -4.2 )\n -4.0\n > y = base.round( -4.6 )\n -5.0\n > y = base.round( 9.5 )\n 10.0\n > y = base.round( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.floor, base.roundn, base.trunc\n",
"base.round2": "\nbase.round2( x )\n Rounds a numeric value to the nearest power of two on a linear scale.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round2( 3.14 )\n 4.0\n > y = base.round2( -4.2 )\n -4.0\n > y = base.round2( -4.6 )\n -4.0\n > y = base.round2( 9.5 )\n 8.0\n > y = base.round2( 13.0 )\n 16.0\n > y = base.round2( -13.0 )\n -16.0\n > y = base.round2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor2, base.round, base.round10\n",
"base.round10": "\nbase.round10( x )\n Rounds a numeric value to the nearest power of ten on a linear scale.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round10( 3.14 )\n 1.0\n > y = base.round10( -4.2 )\n -1.0\n > y = base.round10( -4.6 )\n -1.0\n > y = base.round10( 9.5 )\n 10.0\n > y = base.round10( 13.0 )\n 10.0\n > y = base.round10( -13.0 )\n -10.0\n > y = base.round10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor10, base.round, base.round2\n",
"base.roundb": "\nbase.roundb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` on a linear scale.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.roundb( 3.14159, -2, 10 )\n 3.14\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.roundb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two:\n > y = base.roundb( 5.0, 1, 2 )\n 6.0\n\n See Also\n --------\n base.ceilb, base.floorb, base.round, base.roundn\n",
"base.roundn": "\nbase.roundn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n`.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.roundn( 3.14159, -2 )\n 3.14\n\n // If `n = 0`, standard round behavior:\n > y = base.roundn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.roundn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floorn, base.round, base.roundb\n",
"base.roundsd": "\nbase.roundsd( x, n[, b] )\n Rounds a numeric value to the nearest number with `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.roundsd( 3.14159, 3 )\n 3.14\n > y = base.roundsd( 3.14159, 1 )\n 3.0\n > y = base.roundsd( 12368.0, 2 )\n 12000.0\n > y = base.roundsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floorsd, base.round, base.truncsd\n",
"base.sasum": "\nbase.sasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float32Array\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: float\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.sasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.sasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.sasum( N, x1, stride )\n 12.0\n\n\nbase.sasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float32Array\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: float\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.sasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > sum = base.sasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n See Also\n --------\n base.dasum\n",
"base.saxpy": "\nbase.saxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.saxpy( x.length, alpha, x, 1, y, 1 )\n <Float32Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > base.saxpy( N, alpha, x, 2, y, -1 )\n <Float32Array>[ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.saxpy( N, 5.0, x1, -2, y1, 1 )\n <Float32Array>[ 40.0, 33.0, 22.0 ]\n > y0\n <Float32Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.saxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n <Float32Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.saxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n <Float32Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n See Also\n --------\n base.daxpy\n",
"base.scopy": "\nbase.scopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.scopy( x.length, x, 1, y, 1 )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.scopy( N, x, -2, y, 1 )\n <Float32Array>[ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.scopy( N, x1, -2, y1, 1 )\n <Float32Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.scopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.scopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.scopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dcopy\n",
"base.setHighWord": "\nbase.setHighWord( x, high )\n Sets the more significant 32 bits of a double-precision floating-point\n number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n high: integer\n Unsigned 32-bit integer to replace the higher order word of `x`.\n\n Returns\n -------\n out: number\n Double having the same lower order word as `x`.\n\n Examples\n --------\n // Set the higher order bits of `+infinity` to return `1`:\n > var high = 1072693248 >>> 0;\n > var y = base.setHighWord( PINF, high )\n 1.0\n\n See Also\n --------\n base.getHighWord, base.setLowWord\n",
"base.setLowWord": "\nbase.setLowWord( x, low )\n Sets the less significant 32 bits of a double-precision floating-point\n number.\n\n Setting the lower order bits of `NaN` or positive or negative infinity will\n return `NaN`, as `NaN` is defined as a double whose exponent bit sequence is\n all ones and whose fraction can be any bit sequence except all zeros.\n Positive and negative infinity are defined as doubles with an exponent bit\n sequence equal to all ones and a fraction equal to all zeros. Hence,\n changing the less significant bits of positive and negative infinity\n converts each value to `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n low: integer\n Unsigned 32-bit integer to replace the lower order word of `x`.\n\n Returns\n -------\n out: number\n Double having the same higher order word as `x`.\n\n Examples\n --------\n > var low = 5 >>> 0;\n > var x = 3.14e201;\n > var y = base.setLowWord( x, low )\n 3.139998651394392e+201\n\n // Special cases:\n > var low = 12345678;\n > var y = base.setLowWord( PINF, low )\n NaN\n > y = base.setLowWord( NINF, low )\n NaN\n > y = base.setLowWord( NaN, low )\n NaN\n\n See Also\n --------\n base.getLowWord, base.setHighWord\n",
"base.sici": "\nbase.sici( [out,] x )\n Computes the sine and cosine integrals.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Sine and cosine integrals.\n\n Examples\n --------\n > var y = base.sici( 3.0 )\n [ ~1.849, ~0.12 ]\n > y = base.sici( 0.0 )\n [ 0.0, -Infinity ]\n > y = base.sici( -9.0 )\n [ ~-1.665, ~0.055 ]\n > y = base.sici( NaN )\n [ NaN, NaN ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > y = base.sici( out, 3.0 )\n <Float64Array>[ ~1.849, ~0.12 ]\n > var bool = ( y === out )\n true\n\n",
"base.signbit": "\nbase.signbit( x )\n Returns a boolean indicating if the sign bit is on (true) or off (false).\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if sign bit is on or off.\n\n Examples\n --------\n > var bool = base.signbit( 4.0 )\n false\n > bool = base.signbit( -9.14e-34 )\n true\n > bool = base.signbit( 0.0 )\n false\n > bool = base.signbit( -0.0 )\n true\n\n See Also\n --------\n base.signbitf\n",
"base.signbitf": "\nbase.signbitf( x )\n Returns a boolean indicating if the sign bit is on (true) or off (false).\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if sign bit is on or off.\n\n Examples\n --------\n > var bool = base.signbitf( base.float64ToFloat32( 4.0 ) )\n false\n > bool = base.signbitf( base.float64ToFloat32( -9.14e-34 ) )\n true\n > bool = base.signbitf( 0.0 )\n false\n > bool = base.signbitf( -0.0 )\n true\n\n See Also\n --------\n base.signbit\n",
"base.significandf": "\nbase.significandf( x )\n Returns an integer corresponding to the significand of a single-precision\n floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Significand.\n\n Examples\n --------\n > var s = base.significandf( base.float64ToFloat32( 3.14e34 ) )\n 4293751\n > s = base.significandf( base.float64ToFloat32( 3.14e-34 ) )\n 5288021\n > s = base.significandf( base.float64ToFloat32( -3.14 ) )\n 4781507\n > s = base.significandf( 0.0 )\n 0\n > s = base.significandf( NaN )\n 4194304\n\n",
"base.signum": "\nbase.signum( x )\n Evaluates the signum function.\n\n Value | Sign\n ----- | -----\n x > 0 | +1\n x < 0 | -1\n 0 | 0\n -0 | -0\n NaN | NaN\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n sign: number\n Function value.\n\n Examples\n --------\n > var sign = base.signum( -5.0 )\n -1.0\n > sign = base.signum( 5.0 )\n 1.0\n > sign = base.signum( -0.0 )\n -0.0\n > sign = base.signum( 0.0 )\n 0.0\n > sign = base.signum( NaN )\n NaN\n\n",
"base.sin": "\nbase.sin( x )\n Computes the sine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Sine.\n\n Examples\n --------\n > var y = base.sin( 0.0 )\n ~0.0\n > y = base.sin( PI/2.0 )\n ~1.0\n > y = base.sin( -PI/6.0 )\n ~-0.5\n > y = base.sin( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sinpi, base.tan\n",
"base.sinc": "\nbase.sinc( x )\n Computes the normalized cardinal sine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Cardinal sine.\n\n Examples\n --------\n > var y = base.sinc( 0.5 )\n ~0.637\n > y = base.sinc( -1.2 )\n ~-0.156\n > y = base.sinc( 0.0 )\n 1.0\n > y = base.sinc( NaN )\n NaN\n\n See Also\n --------\n base.sin\n",
"base.sincos": "\nbase.sincos( [out,] x )\n Simultaneously computes the sine and cosine of a number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: Array|TypedArray|Object\n Sine and cosine.\n\n Examples\n --------\n > var y = base.sincos( 0.0 )\n [ ~0.0, ~1.0 ]\n > y = base.sincos( PI/2.0 )\n [ ~1.0, ~0.0 ]\n > y = base.sincos( -PI/6.0 )\n [ ~-0.5, ~0.866 ]\n > y = base.sincos( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.sincos( out, 0.0 )\n <Float64Array>[ ~0.0, ~1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cos, base.sin, base.sincospi\n",
"base.sincospi": "\nbase.sincospi( [out,] x )\n Simultaneously computes the sine and cosine of a number times π.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value.\n\n Returns\n -------\n y: Array|TypedArray|Object\n Two-element array containing sin(πx) and cos(πx).\n\n Examples\n --------\n > var y = base.sincospi( 0.0 )\n [ 0.0, 1.0 ]\n > y = base.sincospi( 0.5 )\n [ 1.0, 0.0 ]\n > y = base.sincospi( 0.1 )\n [ ~0.309, ~0.951 ]\n > y = base.sincospi( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.sincospi( out, 0.0 )\n <Float64Array>[ 0.0, 1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cospi, base.sincos, base.sinpi\n",
"base.sinh": "\nbase.sinh( x )\n Computes the hyperbolic sine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic sine.\n\n Examples\n --------\n > var y = base.sinh( 0.0 )\n 0.0\n > y = base.sinh( 2.0 )\n ~3.627\n > y = base.sinh( -2.0 )\n ~-3.627\n > y = base.sinh( NaN )\n NaN\n\n See Also\n --------\n base.cosh, base.sin, base.tanh\n",
"base.sinpi": "\nbase.sinpi( x )\n Computes the value of `sin(πx)`.\n\n The function computes `sin(πx)` more accurately than the obvious approach,\n especially for large `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.sinpi( 0.0 )\n 0.0\n > y = base.sinpi( 0.5 )\n 1.0\n > y = base.sinpi( 0.9 )\n ~0.309\n > y = base.sinpi( NaN )\n NaN\n\n See Also\n --------\n base.sin\n",
"base.spence": "\nbase.spence( x )\n Evaluates Spence’s function, which is also known as the dilogarithm.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.spence( 3.0 )\n ~-1.437\n > y = base.spence( 0.0 )\n ~1.645\n > y = base.spence( -9.0 )\n NaN\n > y = base.spence( NaN )\n NaN\n\n",
"base.sqrt": "\nbase.sqrt( x )\n Computes the principal square root.\n\n For `x < 0`, the principal square root is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Principal square root.\n\n Examples\n --------\n > var y = base.sqrt( 4.0 )\n 2.0\n > y = base.sqrt( 9.0 )\n 3.0\n > y = base.sqrt( 0.0 )\n 0.0\n > y = base.sqrt( -4.0 )\n NaN\n > y = base.sqrt( NaN )\n NaN\n\n",
"base.sqrt1pm1": "\nbase.sqrt1pm1( x )\n Computes the principal square root of `1+x` minus one.\n\n This function is more accurate than the obvious approach for small `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Square root of `1+x` minus one.\n\n Examples\n --------\n > var y = base.sqrt1pm1( 3.0 )\n 1.0\n > y = base.sqrt1pm1( 0.5 )\n ~0.225\n > y = base.sqrt1pm1( 0.02 )\n ~0.01\n > y = base.sqrt1pm1( -0.5 )\n ~-0.293\n > y = base.sqrt1pm1( -1.1 )\n NaN\n > y = base.sqrt1pm1( NaN )\n NaN\n\n See Also\n --------\n base.sqrt\n",
"base.sumSeries": "\nbase.sumSeries( generator[, options] )\n Sum the elements of the series given by the supplied function.\n\n Parameters\n ----------\n generator: Function\n Series function.\n\n options: Object (optional)\n Options.\n\n options.maxTerms: integer (optional)\n Maximum number of terms to be added. Default: `1000000`.\n\n options.tolerance: number (optional)\n Further terms are only added as long as the next term is greater than\n the current term times the tolerance. Default: `2.22e-16`.\n\n options.initialValue: number (optional)\n Initial value of the resulting sum. Default: `0`.\n\n Returns\n -------\n out: number\n Sum of series terms.\n\n Examples\n --------\n // Using an ES6 generator function:\n > function* geometricSeriesGenerator( x ) {\n ... var exponent = 0;\n ... while ( true ) {\n ... yield Math.pow( x, exponent );\n ... exponent += 1;\n ... }\n ... };\n > var gen = geometricSeriesGenerator( 0.9 );\n > var out = base.sumSeries( gen )\n 10\n\n // Using a closure:\n > function geometricSeriesClosure( x ) {\n ... var exponent = -1;\n ... return function() {\n ... exponent += 1;\n ... return Math.pow( x, exponent );\n ... };\n ... };\n > gen = geometricSeriesClosure( 0.9 );\n > out = base.sumSeries( gen )\n 10\n\n // Setting an initial value for the sum:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'initialValue': 1 } )\n 3\n // Changing the maximum number of terms to be summed:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'maxTerms': 10 } )\n ~1.998 // Infinite sum is 2\n\n // Adjusting the used tolerance:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'tolerance': 1e-3 } )\n ~1.998\n\n",
"base.tan": "\nbase.tan( x )\n Computes the tangent of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Tangent.\n\n Examples\n --------\n > var y = base.tan( 0.0 )\n ~0.0\n > y = base.tan( -PI/4.0 )\n ~-1.0\n > y = base.tan( PI/4.0 )\n ~1.0\n > y = base.tan( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sin\n",
"base.tanh": "\nbase.tanh( x )\n Computes the hyperbolic tangent of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic tangent.\n\n Examples\n --------\n > var y = base.tanh( 0.0 )\n 0.0\n > var y = base.tanh( -0.0 )\n -0.0\n > y = base.tanh( 2.0 )\n ~0.964\n > y = base.tanh( -2.0 )\n ~-0.964\n > y = base.tanh( NaN )\n NaN\n\n See Also\n --------\n base.cosh, base.sinh, base.tan\n",
"base.toBinaryString": "\nbase.toBinaryString( x )\n Returns a string giving the literal bit representation of a double-precision\n floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n bstr: string\n Bit representation.\n\n Examples\n --------\n > var str = base.toBinaryString( 4.0 )\n '0100000000010000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( PI )\n '0100000000001001001000011111101101010100010001000010110100011000'\n > str = base.toBinaryString( -1.0e308 )\n '1111111111100001110011001111001110000101111010111100100010100000'\n > str = base.toBinaryString( -3.14e-320 )\n '1000000000000000000000000000000000000000000000000001100011010011'\n > str = base.toBinaryString( 5.0e-324 )\n '0000000000000000000000000000000000000000000000000000000000000001'\n > str = base.toBinaryString( 0.0 )\n '0000000000000000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( -0.0 )\n '1000000000000000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( NaN )\n '0111111111111000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( PINF )\n '0111111111110000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( NINF )\n '1111111111110000000000000000000000000000000000000000000000000000'\n\n See Also\n --------\n base.fromBinaryString, base.toBinaryStringf\n",
"base.toBinaryStringf": "\nbase.toBinaryStringf( x )\n Returns a string giving the literal bit representation of a single-precision\n floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var str = base.toBinaryStringf( base.float64ToFloat32( 4.0 ) )\n '01000000100000000000000000000000'\n > str = base.toBinaryStringf( base.float64ToFloat32( PI ) )\n '01000000010010010000111111011011'\n > str = base.toBinaryStringf( base.float64ToFloat32( -1.0e38 ) )\n '11111110100101100111011010011001'\n > str = base.toBinaryStringf( base.float64ToFloat32( -3.14e-39 ) )\n '10000000001000100011000100001011'\n > str = base.toBinaryStringf( base.float64ToFloat32( 1.4e-45 ) )\n '00000000000000000000000000000001'\n > str = base.toBinaryStringf( 0.0 )\n '00000000000000000000000000000000'\n > str = base.toBinaryStringf( -0.0 )\n '10000000000000000000000000000000'\n > str = base.toBinaryStringf( NaN )\n '01111111110000000000000000000000'\n > str = base.toBinaryStringf( FLOAT32_PINF )\n '01111111100000000000000000000000'\n > str = base.toBinaryStringf( FLOAT32_NINF )\n '11111111100000000000000000000000'\n\n See Also\n --------\n base.fromBinaryStringf, base.toBinaryString\n",
"base.toBinaryStringUint8": "\nbase.toBinaryStringUint8( x )\n Returns a string giving the literal bit representation of an unsigned 8-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 8-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 8-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned 8-bit\n integers. Accordingly, care should be taken to ensure that only nonnegative\n integer values less than `256` (`2^8`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint8Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint8( a[ 0 ] )\n '00000001'\n > str = base.toBinaryStringUint8( a[ 1 ] )\n '00000100'\n > str = base.toBinaryStringUint8( a[ 2 ] )\n '00001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toBinaryStringUint16": "\nbase.toBinaryStringUint16( x )\n Returns a string giving the literal bit representation of an unsigned 16-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 16-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 16-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned\n 16-bit integers. Accordingly, care should be taken to ensure that only\n nonnegative integer values less than `65536` (`2^16`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint16Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint16( a[ 0 ] )\n '0000000000000001'\n > str = base.toBinaryStringUint16( a[ 1 ] )\n '0000000000000100'\n > str = base.toBinaryStringUint16( a[ 2 ] )\n '0000000000001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toBinaryStringUint32": "\nbase.toBinaryStringUint32( x )\n Returns a string giving the literal bit representation of an unsigned 32-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 32-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 32-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned\n 32-bit integers. Accordingly, care should be taken to ensure that only\n nonnegative integer values less than `4,294,967,296` (`2^32`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint32Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint32( a[ 0 ] )\n '00000000000000000000000000000001'\n > str = base.toBinaryStringUint32( a[ 1 ] )\n '00000000000000000000000000000100'\n > str = base.toBinaryStringUint32( a[ 2 ] )\n '00000000000000000000000000001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toWordf": "\nbase.toWordf( x )\n Returns an unsigned 32-bit integer corresponding to the IEEE 754 binary\n representation of a single-precision floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var f32 = base.float64ToFloat32( 1.337 )\n 1.3370000123977661\n > var w = base.toWordf( f32 )\n 1068180177\n\n See Also\n --------\n base.fromWordf, base.toWords\n",
"base.toWords": "\nbase.toWords( [out,] x )\n Splits a floating-point number into a higher order word (unsigned 32-bit\n integer) and a lower order word (unsigned 32-bit integer).\n\n When provided a destination object, the function returns an array with two\n elements: a higher order word and a lower order word, respectively. The\n lower order word contains the less significant bits, while the higher order\n word contains the more significant bits and includes the exponent and sign.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Higher and lower order words.\n\n Examples\n --------\n > var w = base.toWords( 3.14e201 )\n [ 1774486211, 2479577218 ]\n\n // Provide an output array:\n > var out = new Uint32Array( 2 );\n > w = base.toWords( out, 3.14e201 )\n <Uint32Array>[ 1774486211, 2479577218 ]\n > var bool = ( w === out )\n true\n\n See Also\n --------\n base.fromWords, base.toWordf",
"base.trigamma": "\nbase.trigamma( x )\n Evaluates the trigamma function.\n\n If `x` is `0` or a negative `integer`, the `function` returns `NaN`.\n\n If provided `NaN`, the `function` returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.trigamma( -2.5 )\n ~9.539\n > y = base.trigamma( 1.0 )\n ~1.645\n > y = base.trigamma( 10.0 )\n ~0.105\n > y = base.trigamma( NaN )\n NaN\n > y = base.trigamma( -1.0 )\n NaN\n\n See Also\n --------\n base.digamma, base.gamma\n",
"base.trunc": "\nbase.trunc( x )\n Rounds a numeric value toward zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc( 3.14 )\n 3.0\n > y = base.trunc( -4.2 )\n -4.0\n > y = base.trunc( -4.6 )\n -4.0\n > y = base.trunc( 9.5 )\n 9.0\n > y = base.trunc( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.floor, base.round\n",
"base.trunc2": "\nbase.trunc2( x )\n Rounds a numeric value to the nearest power of two toward zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc2( 3.14 )\n 2.0\n > y = base.trunc2( -4.2 )\n -4.0\n > y = base.trunc2( -4.6 )\n -4.0\n > y = base.trunc2( 9.5 )\n 8.0\n > y = base.trunc2( 13.0 )\n 8.0\n > y = base.trunc2( -13.0 )\n -8.0\n > y = base.trunc2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor2, base.round2, base.trunc, base.trunc10\n",
"base.trunc10": "\nbase.trunc10( x )\n Rounds a numeric value to the nearest power of ten toward zero.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc10( 3.14 )\n 1.0\n > y = base.trunc10( -4.2 )\n -1.0\n > y = base.trunc10( -4.6 )\n -1.0\n > y = base.trunc10( 9.5 )\n 1.0\n > y = base.trunc10( 13.0 )\n 10.0\n > y = base.trunc10( -13.0 )\n -10.0\n > y = base.trunc10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor10, base.round10, base.trunc, base.trunc2\n",
"base.truncb": "\nbase.truncb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward zero.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.truncb( 3.14159, -4, 10 )\n 3.1415\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.truncb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two toward zero:\n > y = base.truncb( 5.0, 1, 2 )\n 4.0\n\n See Also\n --------\n base.ceilb, base.floorb, base.roundb, base.trunc, base.truncn\n",
"base.truncn": "\nbase.truncn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward zero.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.truncn( 3.14159, -4 )\n 3.1415\n\n // If `n = 0`, standard round behavior:\n > y = base.truncn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.truncn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floorn, base.roundn, base.trunc, base.truncb\n",
"base.truncsd": "\nbase.truncsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward zero with `n`\n significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.truncsd( 3.14159, 5 )\n 3.1415\n > y = base.truncsd( 3.14159, 1 )\n 3.0\n > y = base.truncsd( 12368.0, 2 )\n 12000.0\n > y = base.truncsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floorsd, base.roundsd, base.trunc\n",
"base.uimul": "\nbase.uimul( a, b )\n Performs C-like multiplication of two unsigned 32-bit integers.\n\n Parameters\n ----------\n a: integer\n Unsigned 32-bit integer.\n\n b: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: integer\n Product.\n\n Examples\n --------\n > var v = base.uimul( 10>>>0, 4>>>0 )\n 40\n\n See Also\n --------\n base.imul\n",
"base.uimuldw": "\nbase.uimuldw( [out,] a, b )\n Multiplies two unsigned 32-bit integers and returns an array of two unsigned\n 32-bit integers which represents the unsigned 64-bit integer product.\n\n When computing the product of 32-bit integer values in double-precision\n floating-point format (the default JavaScript numeric data type), computing\n the double word product is necessary in order to avoid exceeding the maximum\n safe double-precision floating-point integer value.\n\n Parameters\n ----------\n out: ArrayLikeObject (optional)\n The output array.\n\n a: integer\n Unsigned 32-bit integer.\n\n b: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: ArrayLikeObject\n Double word product (in big endian order; i.e., the first element\n corresponds to the most significant bits and the second element to the\n least significant bits).\n\n Examples\n --------\n > var v = base.uimuldw( 1, 10 )\n [ 0, 10 ]\n\n See Also\n --------\n base.imuldw, base.uimul\n",
"base.uint32ToInt32": "\nbase.uint32ToInt32( x )\n Converts an unsigned 32-bit integer to a signed 32-bit integer.\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.uint32ToInt32( base.float64ToUint32( 4294967295 ) )\n -1\n > y = base.uint32ToInt32( base.float64ToUint32( 3 ) )\n 3\n\n",
"base.vercos": "\nbase.vercos( x )\n Computes the versed cosine.\n\n The versed cosine is defined as `1 + cos(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Versed cosine.\n\n Examples\n --------\n > var y = base.vercos( 3.14 )\n ~0.0\n > y = base.vercos( -4.2 )\n ~0.5097\n > y = base.vercos( -4.6 )\n ~0.8878\n > y = base.vercos( 9.5 )\n ~0.0028\n > y = base.vercos( -0.0 )\n 2.0\n\n See Also\n --------\n base.cos, base.versin\n",
"base.versin": "\nbase.versin( x )\n Computes the versed sine.\n\n The versed sine is defined as `1 - cos(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Versed sine.\n\n Examples\n --------\n > var y = base.versin( 3.14 )\n ~2.0\n > y = base.versin( -4.2 )\n ~1.490\n > y = base.versin( -4.6 )\n ~1.112\n > y = base.versin( 9.5 )\n ~1.997\n > y = base.versin( -0.0 )\n 0.0\n\n See Also\n --------\n base.cos, base.sin, base.vercos\n",
"base.wrap": "\nbase.wrap( v, min, max )\n Wraps a value on the half-open interval `[min,max)`.\n\n The function does not distinguish between positive and negative zero. Where\n appropriate, the function returns positive zero.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Value to wrap.\n\n min: number\n Minimum value.\n\n max: number\n Maximum value.\n\n Returns\n -------\n y: number\n Wrapped value.\n\n Examples\n --------\n > var y = base.wrap( 3.14, 0.0, 5.0 )\n 3.14\n > y = base.wrap( -3.14, 0.0, 5.0 )\n ~1.86\n > y = base.wrap( 3.14, 0.0, 3.0 )\n ~0.14\n > y = base.wrap( -0.0, 0.0, 5.0 )\n 0.0\n > y = base.wrap( 0.0, -3.14, -0.0 )\n -3.14\n > y = base.wrap( NaN, 0.0, 5.0 )\n NaN\n\n See Also\n --------\n base.clamp\n",
"base.xlog1py": "\nbase.xlog1py( x, y )\n Computes `x * ln(y+1)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlog1py( 3.0, 2.0 )\n ~3.296\n > out = base.xlog1py( 1.5, 5.9 )\n ~2.897\n > out = base.xlog1py( 0.9, 1.0 )\n ~0.624\n > out = base.xlog1py( 1.0, 0.0 )\n 0.0\n > out = base.xlog1py( 0.0, -2.0 )\n 0.0\n > out = base.xlog1py( 1.5, NaN )\n NaN\n > out = base.xlog1py( 0.0, NaN )\n NaN\n > out = base.xlog1py( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.log1p, base.xlogy\n",
"base.xlogy": "\nbase.xlogy( x, y )\n Computes `x * ln(y)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlogy( 3.0, 2.0 )\n ~2.079\n > out = base.xlogy( 1.5, 5.9 )\n ~2.662\n > out = base.xlogy( 0.9, 1.0 )\n 0.0\n > out = base.xlogy( 0.0, -2.0 )\n 0.0\n > out = base.xlogy( 1.5, NaN )\n NaN\n > out = base.xlogy( 0.0, NaN )\n NaN\n > out = base.xlogy( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.ln, base.xlog1py\n",
"base.zeta": "\nbase.zeta( s )\n Evaluates the Riemann zeta function as a function of a real variable `s`.\n\n Parameters\n ----------\n s: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.zeta( 1.1 )\n ~10.584\n > y = base.zeta( -4.0 )\n 0.0\n > y = base.zeta( 70.0 )\n 1.0\n > y = base.zeta( 0.5 )\n ~-1.46\n > y = base.zeta( NaN )\n NaN\n\n // Evaluate at a pole:\n > y = base.zeta( 1.0 )\n NaN\n\n",
"BERNDT_CPS_WAGES_1985": "\nBERNDT_CPS_WAGES_1985()\n Returns a random sample of 534 workers from the Current Population Survey\n (CPS) from 1985, including their wages and and other characteristics.\n\n Each array element has the following eleven fields:\n\n - education: number of years of education.\n - south: indicator variable for southern region (1 if a person lives in the\n South; 0 if a person does not live in the South).\n - gender: gender of the person.\n - experience: number of years of work experience.\n - union: indicator variable for union membership (1 if union member; 0 if\n not a union member).\n - wage: wage (in dollars per hour).\n - age: age (in years).\n - race: ethnicity/race (white, hispanic, and other).\n - occupation: occupational category (management, sales, clerical, service,\n professional, and other).\n - sector: sector (other, manufacturing, or construction).\n - married: marital status (0 if unmarried; 1 if married).\n\n Based on residual plots, wages were log-transformed to stabilize the\n variance.\n\n Returns\n -------\n out: Array<Object>\n CPS data.\n\n Examples\n --------\n > var data = BERNDT_CPS_WAGES_1985()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Berndt, Ernst R. 1991. _The Practice of Econometrics_. Addison Wesley\n Longman Publishing Co.\n\n",
"bifurcate": "\nbifurcate( collection, [options,] filter )\n Splits values into two groups.\n\n If an element in `filter` is truthy, then the corresponding element in the\n input collection belongs to the first group; otherwise, the collection\n element belongs to the second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n filter: Array|TypedArray|Object\n A collection indicating which group an element in the input collection\n belongs to. If an element in `filter` is truthy, the corresponding\n element in `collection` belongs to the first group; otherwise, the\n collection element belongs to the second group. If provided an object,\n the object must be array-like (excluding strings and functions).\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var f = [ true, true, false, true ];\n > var out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n > f = [ 1, 1, 0, 1 ];\n > out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > f = [ true, true, false, true ];\n > var opts = { 'returns': 'indices' };\n > out = bifurcate( collection, opts, f )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-element pairs:\n > opts = { 'returns': '*' };\n > out = bifurcate( collection, opts, f )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo'] ] ]\n\n See Also\n --------\n bifurcateBy, bifurcateOwn, group\n",
"bifurcateBy": "\nbifurcateBy( collection, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If a predicate function returns a truthy value, a collection value is\n placed in the first group; otherwise, a collection value is placed in the\n second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = bifurcateBy( collection, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, groupBy\n",
"bifurcateByAsync": "\nbifurcateByAsync( collection, [options,] predicate, done )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an predicate function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If a predicate function calls the `next` callback with a truthy group value,\n a collection value is placed in the first group; otherwise, a collection\n value is placed in the second group.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty array as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n [ [ 1000, 3000 ], [ 2500 ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ 2, 0 ], [ 1 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ [ 2, 1000 ], [ 0, 3000 ] ], [ [ 1, 2500 ] ] ]\n\n // Limit number of concurrent invocations:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n // Process sequentially:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n\nbifurcateByAsync.factory( [options,] predicate )\n Returns a function which splits values into two groups according to an\n predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A function which splits values into two groups.\n\n Examples\n --------\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = bifurcateByAsync.factory( opts, predicate );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n [ [ 2000, 1000 ], [ 1500 ] ]\n\n See Also\n --------\n bifurcateBy, groupByAsync\n",
"bifurcateIn": "\nbifurcateIn( obj, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n If a predicate function returns a truthy value, a value is placed in the\n first group; otherwise, a value is placed in the second group.\n\n If provided an empty object with no prototype, the function returns an empty\n array.\n\n The function iterates over an object's own and inherited properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function Foo() { this.a = 'beep'; this.b = 'boop'; return this; };\n > Foo.prototype = Object.create( null );\n > Foo.prototype.c = 'foo';\n > Foo.prototype.d = 'bar';\n > var obj = new Foo();\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var out = bifurcateIn( obj, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = bifurcateIn( obj, opts, predicate )\n [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateIn( obj, opts, predicate )\n [ [ ['a', 'beep'], ['b', 'boop'], ['d', 'bar'] ], [ ['c', 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, bifurcateBy, bifurcateOwn, groupIn\n",
"bifurcateOwn": "\nbifurcateOwn( obj, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n If a predicate function returns a truthy value, a value is placed in the\n first group; otherwise, a value is placed in the second group.\n\n If provided an empty object, the function returns an empty array.\n\n The function iterates over an object's own properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' };\n > var out = bifurcateOwn( obj, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = bifurcateOwn( obj, opts, predicate )\n [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateOwn( obj, opts, predicate )\n [ [ ['a', 'beep'], ['b', 'boop'], ['d', 'bar'] ], [ ['c', 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, bifurcateBy, bifurcateIn, groupOwn\n",
"binomialTest": "\nbinomialTest( x[, n][, options] )\n Computes an exact test for the success probability in a Bernoulli\n experiment.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: (number|Array<number>)\n Number of successes or two-element array with successes and failures.\n\n n: Array<number> (optional)\n Total number of observations.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.p: number (optional)\n Hypothesized probability under the null hypothesis. Default: `0.5`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Sample proportion.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the success probability.\n\n out.nullValue: number\n Assumed success probability under H0.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var out = binomialTest( 682, 925 )\n {\n 'pValue': ~3.544e-49,\n 'statistic': ~0.737\n // ...\n }\n\n > out = binomialTest( [ 682, 925 - 682 ] )\n {\n 'pValue': ~3.544e-49,\n 'statistic': ~0.737\n // ...\n }\n\n > out = binomialTest( 21, 40, {\n ... 'p': 0.4,\n ... 'alternative': 'greater'\n ... })\n {\n 'pValue': ~0.074,\n 'statistic': 0.525\n // ...\n }\n\n",
"Buffer": "\nBuffer\n Buffer constructor.\n\n\nBuffer( size )\n Allocates a buffer having a specified number of bytes.\n\n Parameters\n ----------\n size: integer\n Number of bytes to allocate.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( 4 )\n <Buffer>\n\n\nBuffer( buffer )\n Copies buffer data to a new Buffer instance.\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to copy from.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b1 = new Buffer( [ 1, 2, 3, 4 ] );\n > var b2 = new Buffer( b1 )\n <Buffer>[ 1, 2, 3, 4 ]\n\n\nBuffer( array )\n Allocates a buffer using an array of octets.\n\n Parameters\n ----------\n array: Array\n Array of octets.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( [ 1, 2, 3, 4 ] )\n <Buffer>[ 1, 2, 3, 4 ]\n\n\nBuffer( str[, encoding] )\n Allocates a buffer containing a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n encoding: string (optional)\n Character encoding. Default: 'utf8'.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( 'beep boop' )\n <Buffer>\n\n\nTODO: add methods and properties\n\n\n See Also\n --------\n ArrayBuffer\n",
"buffer2json": "\nbuffer2json( buffer )\n Returns a JSON representation of a buffer.\n\n The returned JSON object has the following properties:\n\n - type: value type\n - data: buffer data as a generic array\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var buf = new allocUnsafe( 2 );\n > buf[ 0 ] = 1;\n > buf[ 1 ] = 2;\n > var json = buffer2json( buf )\n { 'type': 'Buffer', 'data': [ 1, 2 ] }\n\n See Also\n --------\n typedarray2json, reviveBuffer\n",
"capitalize": "\ncapitalize( str )\n Capitalizes the first character in a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Capitalized string.\n\n Examples\n --------\n > var out = capitalize( 'beep' )\n 'Beep'\n > out = capitalize( 'Boop' )\n 'Boop'\n\n See Also\n --------\n uncapitalize, uppercase\n",
"capitalizeKeys": "\ncapitalizeKeys( obj )\n Converts the first letter of each object key to uppercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'aa': 1, 'bb': 2 };\n > var out = capitalizeKeys( obj )\n { 'Aa': 1, 'Bb': 2 }\n\n See Also\n --------\n uncapitalizeKeys, uppercaseKeys\n",
"CATALAN": "\nCATALAN\n Catalan's constant.\n\n Examples\n --------\n > CATALAN\n 0.915965594177219\n\n",
"CBRT_EPS": "\nCBRT_EPS\n Cube root of double-precision floating-point epsilon.\n\n Examples\n --------\n > CBRT_EPS\n 0.0000060554544523933395\n\n See Also\n --------\n EPS, SQRT_EPS\n",
"chdir": "\nchdir( path )\n Changes the current working directory.\n\n If unable to set the current working directory (e.g., due to a non-existent\n path), the function returns an error; otherwise, the function returns\n `null`.\n\n Parameters\n ----------\n path: string\n Desired working directory.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = chdir( '/path/to/current/working/directory' )\n\n See Also\n --------\n cwd\n",
"chi2gof": "\nchi2gof( x, y[, ...args][, options] )\n Performs a chi-square goodness-of-fit test.\n\n A chi-square goodness-of-fit test is computed for the null hypothesis that\n the values of `x` come from the discrete probability distribution specified\n by `y`.\n\n The second argument can be expected frequencies, population probabilities\n summing to one, or a discrete probability distribution name to test against.\n\n When providing a discrete probability distribution name, distribution\n parameters *must* be supplied as additional arguments.\n\n The function returns an object containing the test statistic, p-value, and\n decision.\n\n By default, the p-value is computed using a chi-square distribution with\n `k-1` degrees of freedom, where `k` is the length of `x`.\n\n If provided distribution arguments are estimated (e.g., via maximum\n likelihood estimation), the degrees of freedom should be corrected. Set the\n `ddof` option to use `k-1-n` degrees of freedom, where `n` is the degrees of\n freedom adjustment.\n\n The chi-square approximation may be incorrect if the observed or expected\n frequencies in each category are too small. Common practice is to require\n frequencies greater than five.\n\n Instead of relying on chi-square approximation to calculate the p-value, one\n can use Monte Carlo simulation. When the `simulate` option is `true`, the\n simulation is performed by re-sampling from the discrete probability\n distribution specified by `y`.\n\n Parameters\n ----------\n x: Array<number>\n Observation frequencies.\n\n y: Array<number>|string\n Expected frequencies (or probabilities) or a discrete probability\n distribution name.\n\n args: ...number (optional)\n Distribution parameters. Distribution parameters will be passed to a\n probability mass function (PMF) as arguments.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Significance level of the hypothesis test. Must be on the interval\n [0,1]. Default: 0.05.\n\n options.ddof: number (optional)\n Delta degrees of freedom adjustment. Default: 0.\n\n options.simulate: boolean (optional)\n Boolean indicating whether to calculate p-values by Monte Carlo\n simulation. The simulation is performed by re-sampling from the discrete\n distribution specified by `y`. Default: false.\n\n options.iterations: number (optional)\n Number of Monte Carlo iterations. Default: 500.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n Test p-value.\n\n out.statistic: number\n Test statistic.\n\n out.df: number\n Degrees of freedom.\n\n out.method: string\n Test name.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Provide expected probabilities...\n > var x = [ 89, 37, 30, 28, 2 ];\n > var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > var out = chi2gof( x, p )\n { 'pValue': ~0.0406, 'statistic': ~9.9901, ... }\n > out.print()\n\n // Set significance level...\n > var opts = { 'alpha': 0.01 };\n > out = chi2gof( x, p, opts );\n > out.print()\n\n // Calculate the test p-value via Monte Carlo simulation...\n > x = [ 89, 37, 30, 28, 2 ];\n > p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > opts = { 'simulate': true, 'iterations': 1000 };\n > out = chi2gof( x, p, opts )\n {...}\n\n // Verify that data comes from Poisson distribution...\n > var lambda = 3.0;\n > var rpois = base.random.poisson.factory( lambda );\n > var len = 400;\n > x = [];\n > for ( var i = 0; i < len; i++ ) { x.push( rpois() ); };\n\n // Generate a frequency table...\n > var freqs = new Int32Array( len );\n > for ( i = 0; i < len; i++ ) { freqs[ x[ i ] ] += 1; };\n > out = chi2gof( freqs, 'poisson', lambda )\n {...}\n\n",
"CircularBuffer": "\nCircularBuffer( buffer )\n Circular buffer constructor.\n\n Parameters\n ----------\n buffer: integer|ArrayLike\n Buffer size or an array-like object to use as the underlying buffer.\n\n Returns\n -------\n buf: Object\n Circular buffer data structure.\n\n buf.clear: Function\n Clears the buffer.\n\n buf.count: integer\n Number of elements currently in the buffer.\n\n buf.full: boolean\n Boolean indicating whether the buffer is full.\n\n buf.iterator: Function\n Returns an iterator for iterating over a buffer. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that a\n returned iterator does **not** iterate over partially full buffers.\n\n buf.length: integer\n Buffer length (capacity).\n\n buf.push: Function\n Adds a value to the buffer. If the buffer is full, the method returns\n the removed value; otherwise, the method returns `undefined`.\n\n buf.toArray: Function\n Returns an array of buffer values.\n\n buf.toJSON: Function\n Serializes a circular buffer as JSON.\n\n Examples\n --------\n > var b = CircularBuffer( 3 );\n > b.push( 'foo' );\n > b.push( 'bar' );\n > b.push( 'beep' );\n > b.length\n 3\n > b.count\n 3\n > b.push( 'boop' )\n 'foo'\n\n See Also\n --------\n FIFO, Stack\n",
"CMUDICT": "\nCMUDICT( [options] )\n Returns datasets from the Carnegie Mellon Pronouncing Dictionary (CMUdict).\n\n Data includes the following:\n\n - dict: the main pronouncing dictionary\n - phones: manners of articulation for each sound\n - symbols: complete list of ARPABET symbols used by the dictionary\n - vp: verbal pronunciations of punctuation marks\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.data: string (optional)\n Dataset name.\n\n Returns\n -------\n out: Object|Array\n CMUdict dataset.\n\n Examples\n --------\n > var data = CMUDICT();\n > var dict = data.dict\n {...}\n > var phones = data.phones\n {...}\n > var symbols = data.symbols\n [...]\n > var vp = data.vp\n {...}\n\n",
"complex": "\ncomplex( real, imag[, dtype] )\n Creates a complex number.\n\n The function supports the following data types:\n\n - float64\n - float32\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n z: Complex\n Complex number.\n\n Examples\n --------\n > var z = complex( 5.0, 3.0, 'float64' )\n <Complex128>\n > z = complex( 5.0, 3.0, 'float32' )\n <Complex64>\n\n See Also\n --------\n Complex128, Complex64\n",
"Complex64": "\nComplex64( real, imag )\n 64-bit complex number constructor.\n\n Both the real and imaginary components are stored as single-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex64\n 64-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 4.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 8.\n\n Examples\n --------\n > var z = new Complex64( 5.0, 3.0 )\n <Complex64>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n complex, Complex128\n",
"COMPLEX64_NUM_BYTES": "\nCOMPLEX64_NUM_BYTES\n Size (in bytes) of a 64-bit complex number.\n\n Examples\n --------\n > COMPLEX64_NUM_BYTES\n 8\n\n See Also\n --------\n COMPLEX128_NUM_BYTES, FLOAT32_NUM_BYTES\n",
"Complex128": "\nComplex128( real, imag )\n 128-bit complex number constructor.\n\n Both the real and imaginary components are stored as double-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex128\n 128-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 8.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 16.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 )\n <Complex128>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n complex, Complex64\n",
"COMPLEX128_NUM_BYTES": "\nCOMPLEX128_NUM_BYTES\n Size (in bytes) of a 128-bit complex number.\n\n Examples\n --------\n > COMPLEX128_NUM_BYTES\n 16\n\n See Also\n --------\n COMPLEX64_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"compose": "\ncompose( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as an argument\n to the next function. The result of the leftmost function is the result\n of the whole.\n\n Notes:\n\n - Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as unary functions.\n - The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x ) {\n ... return 2 * x;\n ... }\n > function b( x ) {\n ... return x + 3;\n ... }\n > function c( x ) {\n ... return x / 5;\n ... }\n > var f = compose( c, b, a );\n > var z = f( 6 )\n 3\n\n See Also\n --------\n composeAsync\n",
"composeAsync": "\ncomposeAsync( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as the first argument\n of the next function. The result of the leftmost function is the result\n of the whole.\n\n The last argument for each provided function is a `next` callback which\n should be invoked upon function completion. The callback accepts two\n arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a composed function calls the `next` callback with a truthy `error`\n argument, the composite function suspends execution and immediately calls\n the `done` callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as binary functions.\n\n The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, 2*x );\n ... }\n ... };\n > function b( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x+3 );\n ... }\n ... };\n > function c( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x/5 );\n ... }\n ... };\n > var f = composeAsync( c, b, a );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > f( 6, done )\n 3\n\n See Also\n --------\n compose\n",
"configdir": "\nconfigdir( [p] )\n Returns a directory for user-specific configuration files.\n\n On Windows platforms, the function first checks for a `LOCALAPPDATA`\n environment variable before checking for an `APPDATA` environment variable.\n This means that machine specific user configuration files have precedence\n over roaming user configuration files.\n\n On non-Windows platforms, if the function is unable to locate the current\n user's `home` directory, the function returns `null`. Similarly, on Windows\n platforms, if the function is unable to locate an application data\n directory, the function also returns `null`.\n\n Parameters\n ----------\n p: string (optional)\n Path to append to a base directory.\n\n Returns\n -------\n out: string|null\n Directory.\n\n Examples\n --------\n > var dir = configdir()\n e.g., '/Users/<username>/Library/Preferences'\n > dir = configdir( 'appname/config' )\n e.g., '/Users/<username>/Library/Preferences/appname/config'\n\n See Also\n --------\n homedir, tmpdir\n",
"conj": "\nconj( z )\n Returns the complex conjugate of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n out: Complex\n Complex conjugate.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > z.toString()\n '5 + 3i'\n > var v = conj( z );\n > v.toString()\n '5 - 3i'\n\n See Also\n --------\n imag, real, reim\n",
"constantFunction": "\nconstantFunction( val )\n Creates a function which always returns the same value.\n\n Notes:\n\n - When provided an object reference, the returned `function` always returns\n the same reference.\n\n Parameters\n ----------\n val: any\n Value to always return.\n\n Returns\n -------\n out: Function\n Constant function.\n\n Examples\n --------\n > var fcn = constantFunction( 3.14 );\n > var v = fcn()\n 3.14\n > v = fcn()\n 3.14\n > v = fcn()\n 3.14\n\n See Also\n --------\n argumentFunction, identity\n",
"constructorName": "\nconstructorName( val )\n Determines the name of a value's constructor.\n\n Parameters\n ----------\n val: any\n Input value.\n\n Returns\n -------\n out: string\n Name of a value's constructor.\n\n Examples\n --------\n > var v = constructorName( 'a' )\n 'String'\n > v = constructorName( {} )\n 'Object'\n > v = constructorName( true )\n 'Boolean'\n\n See Also\n --------\n functionName\n",
"contains": "\ncontains( val, searchValue[, position] )\n Tests if an array-like value contains a search value.\n\n When `val` is a string, the function checks whether the characters of the\n search string are found in the input string. The search is case-sensitive.\n\n When `val` is an array-like object, the function checks whether the input\n array contains an element strictly equal to the specified search value.\n\n For strings, this function is modeled after `String.prototype.includes`,\n part of the ECMAScript 6 specification. This function is different from a\n call to `String.prototype.includes.call` insofar as type-checking is\n performed for all arguments.\n\n The function does not distinguish between positive and negative zero.\n\n If `position < 0`, the search is performed for the entire input array or\n string.\n\n\n Parameters\n ----------\n val: ArrayLike\n Input value.\n\n searchValue: any\n Value to search for.\n\n position: integer (optional)\n Position at which to start searching for `searchValue`. Default: `0`.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an input value contains another value.\n\n Examples\n --------\n > var bool = contains( 'Hello World', 'World' )\n true\n > bool = contains( 'Hello World', 'world' )\n false\n > bool = contains( [ 1, 2, 3, 4 ], 2 )\n true\n > bool = contains( [ NaN, 2, 3, 4 ], NaN )\n true\n\n // Supply a position:\n > bool = contains( 'Hello World', 'Hello', 6 )\n false\n > bool = contains( [ true, NaN, false ], true, 1 )\n false\n\n",
"convertArray": "\nconvertArray( arr, dtype )\n Converts an input array to an array of a different data type.\n\n The function supports the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n arr: Array|TypedArray\n Array to convert.\n\n dtype: string\n Output data type.\n\n Returns\n -------\n out: Array|TypedArray\n Output array.\n\n Examples\n --------\n > var arr = [ 1.0, 2.0, 3.0, 4.0 ];\n > var out = convertArray( arr, 'float32' )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n See Also\n --------\n convertArraySame\n",
"convertArraySame": "\nconvertArraySame( x, y )\n Converts an input array to the same data type as a second input array.\n\n The function supports input arrays having the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n x: Array|TypedArray\n Array to convert.\n\n y: Array|TypedArray\n Array having desired output data type.\n\n Returns\n -------\n out: Array|TypedArray\n Output array.\n\n Examples\n --------\n > var x = [ 1.0, 2.0, 3.0, 4.0 ];\n > var y = new Float32Array( 0 );\n > var out = convertArraySame( x, y )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n See Also\n --------\n convertArray\n",
"convertPath": "\nconvertPath( from, to )\n Converts between POSIX and Windows paths.\n\n Parameters\n ----------\n from: string\n Input path.\n\n to: string\n Output path convention: 'win32', 'mixed', or 'posix'.\n\n Returns\n -------\n out: string\n Converted path.\n\n Examples\n --------\n > var out = convertPath( '/c/foo/bar/beep.c', 'win32' )\n 'c:\\\\foo\\\\bar\\\\beep.c'\n > out = convertPath( '/c/foo/bar/beep.c', 'mixed' )\n 'c:/foo/bar/beep.c'\n > out = convertPath( '/c/foo/bar/beep.c', 'posix' )\n '/c/foo/bar/beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'win32' )\n 'C:\\\\\\\\foo\\\\bar\\\\beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'mixed' )\n 'C:/foo/bar/beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'posix' )\n '/c/foo/bar/beep.c'\n\n",
"copy": "\ncopy( value[, level] )\n Copy or deep clone a value to an arbitrary depth.\n\n The implementation can handle circular references.\n\n If a `Number`, `String`, or `Boolean` object is encountered, the value is\n cloned as a primitive. This behavior is intentional.\n\n For objects, the implementation only copies enumerable keys and their\n associated property descriptors.\n\n The implementation only checks whether basic `Objects`, `Arrays`, and class\n instances are extensible, sealed, and/or frozen.\n\n Functions are not cloned; their reference is copied.\n\n The implementation supports custom error types which are `Error` instances\n (e.g., ES2015 subclasses).\n\n Support for copying class instances is inherently fragile. Any instances\n with privileged access to variables (e.g., within closures) cannot be\n cloned. This stated, basic copying of class instances is supported. Provided\n an environment which supports ES5, the implementation is greedy and performs\n a deep clone of any arbitrary class instance and its properties. The\n implementation assumes that the concept of `level` applies only to the class\n instance reference, but not to its internal state.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n level: integer (optional)\n Copy depth. Default: Infinity.\n\n Returns\n -------\n out: any\n Value copy.\n\n Examples\n --------\n > var value = [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ];\n > var out = copy( value )\n [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n > var bool = ( value[ 0 ].c === out[ 0 ].c )\n false\n\n // Set the `level` option to limit the copy depth:\n > value = [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ];\n > out = copy( value, 1 );\n > bool = ( value[ 0 ] === out[ 0 ] )\n true\n > bool = ( value[ 0 ].c === out[ 0 ].c )\n true\n\n\n See Also\n --------\n merge\n",
"copyBuffer": "\ncopyBuffer( buffer )\n Copies buffer data to a new Buffer instance.\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to copy from.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b1 = array2buffer( [ 1, 2, 3, 4 ] );\n > var b2 = copyBuffer( b1 )\n <Buffer>[ 1, 2, 3, 4 ]\n\n See Also\n --------\n allocUnsafe, Buffer\n",
"countBy": "\ncountBy( collection, [options,] indicator )\n Groups values according to an indicator function and returns group counts.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = countBy( collection, indicator )\n { 'b': 3, 'other': 1 }\n\n See Also\n --------\n group, groupBy\n",
"countByAsync": "\ncountByAsync( collection, [options,] indicator, done )\n Groups values according to an indicator function and returns group counts.\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty object as the second argument.\n\n The `group` returned by an indicator function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even': 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, indicator, done )\n 1000\n 2500\n 3000\n { \"even\": 2, \"odd\": 1 }\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n { \"even\": 2, \"odd\": 1 }\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n { \"even\": 2, \"odd\": 1 }\n\n\ncountByAsync.factory( [options,] indicator )\n Returns a function which groups values according to an indicator function\n and returns group counts.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A function which groups values and returns group counts.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = countByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n { \"even\": 2, \"odd\": 1 }\n > arr = [ 2000, 1500, 1000, 500 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n 500\n { \"even\": 2, \"odd\": 2 }\n\n See Also\n --------\n countBy, groupByAsync, tabulateByAsync\n",
"curry": "\ncurry( fcn[, arity][, thisArg] )\n Transforms a function into a sequence of functions each accepting a single\n argument.\n\n Until return value resolution, each invocation returns a new partially\n applied curry function.\n\n Parameters\n ----------\n fcn: Function\n Function to curry.\n\n arity: integer (optional)\n Number of parameters. Default: `fcn.length`.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Curry function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var f = curry( add );\n > var sum = f( 2 )( 3 )\n 5\n\n // Supply arity:\n > function add() { return arguments[ 0 ] + arguments[ 1 ]; };\n > f = curry( add, 2 );\n > sum = f( 2 )( 3 )\n 5\n\n // Provide function context:\n > var obj = {\n ... 'name': 'Ada',\n ... 'greet': function greet( word1, word2 ) {\n ... return word1 + ' ' + word2 + ', ' + this.name + '!'\n ... }\n ... };\n > f = curry( obj.greet, obj );\n > var str = f( 'Hello' )( 'there' )\n 'Hello there, Ada!'\n\n See Also\n --------\n curryRight, uncurry, uncurryRight\n",
"curryRight": "\ncurryRight( fcn[, arity][, thisArg] )\n Transforms a function into a sequence of functions each accepting a single\n argument.\n\n Until return value resolution, each invocation returns a new partially\n applied curry function.\n\n This function applies arguments starting from the right.\n\n Parameters\n ----------\n fcn: Function\n Function to curry.\n\n arity: integer (optional)\n Number of parameters. Default: `fcn.length`.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Curry function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var f = curryRight( add );\n > var sum = f( 2 )( 3 )\n 5\n\n // Supply arity:\n > function add() { return arguments[ 0 ] + arguments[ 1 ]; };\n > f = curryRight( add, 2 );\n > sum = f( 2 )( 3 )\n 5\n\n // Provide function context:\n > var obj = {\n ... 'name': 'Ada',\n ... 'greet': function greet( word1, word2 ) {\n ... return word1 + ' ' + word2 + ', ' + this.name + '!'\n ... }\n ... };\n > f = curryRight( obj.greet, obj );\n > var str = f( 'there' )( 'Hello' )\n 'Hello there, Ada!'\n\n See Also\n --------\n curry, uncurry, uncurryRight\n",
"cwd": "\ncwd()\n Returns the current working directory.\n\n Returns\n -------\n path: string\n Current working directory of the process.\n\n Examples\n --------\n > var dir = cwd()\n '/path/to/current/working/directory'\n\n See Also\n --------\n chdir\n",
"DALE_CHALL_NEW": "\nDALE_CHALL_NEW()\n Returns a list of familiar English words.\n\n Returns\n -------\n out: Array<string>\n List of familiar English words.\n\n Examples\n --------\n > var list = DALE_CHALL_NEW()\n [ 'a', 'able', 'aboard', 'about', 'above', ... ]\n\n References\n ----------\n - Chall, Jeanne Sternlicht, and Edgar Dale. 1995. *Readability revisited:\n the new Dale-Chall readability formula*. Brookline Books.\n <https://books.google.com/books?id=2nbuAAAAMAAJ>.\n\n",
"datasets": "\ndatasets( name[, options] )\n Returns a dataset.\n\n The function forwards provided options to the dataset interface specified\n by `name`.\n\n Parameters\n ----------\n name: string\n Dataset name.\n\n options: Object (optional)\n Function options.\n\n Returns\n -------\n out: any\n Dataset.\n\n Examples\n --------\n > var out = datasets( 'MONTH_NAMES_EN' )\n [ 'January', 'February', ... ]\n > var opts = { 'data': 'cities' };\n > out = datasets( 'MINARD_NAPOLEONS_MARCH', opts )\n [ {...}, {...}, ... ]\n\n",
"dayOfQuarter": "\ndayOfQuarter( [month[, day, year]] )\n Returns the day of the quarter.\n\n By default, the function returns the day of the quarter for the current date\n (according to local time). To determine the day of the quarter for a\n particular day, provide `month`, `day`, and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function also accepts a `Date` object.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n day: integer (optional)\n Day.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Day of the quarter.\n\n Examples\n --------\n > var day = dayOfQuarter()\n <number>\n > day = dayOfQuarter( new Date() )\n <number>\n > day = dayOfQuarter( 12, 31, 2017 )\n 92\n\n // Other ways to supply month:\n > day = dayOfQuarter( 'dec', 31, 2017 )\n 92\n > day = dayOfQuarter( 'december', 31, 2017 )\n 92\n\n See Also\n --------\n dayOfYear\n",
"dayOfYear": "\ndayOfYear( [month[, day, year]] )\n Returns the day of the year.\n\n By default, the function returns the day of the year for the current date\n (according to local time). To determine the day of the year for a particular\n day, provide `month`, `day`, and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function also accepts a `Date` object.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n day: integer (optional)\n Day.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Day of the year.\n\n Examples\n --------\n > var day = dayOfYear()\n <number>\n > day = dayOfYear( new Date() )\n <number>\n > day = dayOfYear( 12, 31, 2016 )\n 366\n\n // Other ways to supply month:\n > day = dayOfYear( 'dec', 31, 2016 )\n 366\n > day = dayOfYear( 'december', 31, 2016 )\n 366\n\n See Also\n --------\n dayOfQuarter\n",
"daysInMonth": "\ndaysInMonth( [month[, year]] )\n Returns the number of days in a month.\n\n By default, the function returns the number of days in the current month\n of the current year (according to local time). To determine the number of\n days for a particular month and year, provide `month` and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Days in a month.\n\n Examples\n --------\n > var num = daysInMonth()\n <number>\n > num = daysInMonth( 2 )\n <number>\n > num = daysInMonth( 2, 2016 )\n 29\n > num = daysInMonth( 2, 2017 )\n 28\n\n // Other ways to supply month:\n > num = daysInMonth( 'feb', 2016 )\n 29\n > num = daysInMonth( 'february', 2016 )\n 29\n\n See Also\n --------\n daysInYear\n",
"daysInYear": "\ndaysInYear( [value] )\n Returns the number of days in a year according to the Gregorian calendar.\n\n By default, the function returns the number of days in the current year\n (according to local time). To determine the number of days for a particular\n year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of days in a year.\n\n Examples\n --------\n > var num = daysInYear()\n <number>\n > num = daysInYear( 2016 )\n 366\n > num = daysInYear( 2017 )\n 365\n\n See Also\n --------\n daysInMonth\n",
"debugStream": "\ndebugStream( [options,] [clbk] )\n Returns a transform stream for debugging stream pipelines.\n\n If the `DEBUG` environment variable is not set, no data is logged.\n\n Providing a `name` option is *strongly* encouraged, as the `DEBUG`\n environment variable can be used to filter debuggers.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Debug namespace.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function (optional)\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = debugStream( { 'name': 'foo' } );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ndebugStream.factory( [options] )\n Returns a function for creating transform streams for debugging stream\n pipelines.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream( name[, clbk] ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = debugStream.factory( opts );\n\n\ndebugStream.objectMode( [options,] [clbk] )\n Returns an \"objectMode\" transform stream for debugging stream pipelines.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Debug namespace.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function (optional)\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = debugStream.objectMode( { 'name': 'foo' } );\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n inspectStream\n",
"deepEqual": "\ndeepEqual( a, b )\n Tests for deep equality between two values.\n\n Parameters\n ----------\n a: any\n First comparison value.\n\n b: any\n Second comparison value.\n\n Returns\n -------\n out: bool\n Boolean indicating if `a` is deep equal to `b`.\n\n Examples\n --------\n > var bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, 3 ] )\n true\n\n > bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, '3' ] )\n false\n\n > bool = deepEqual( { 'a': 2 }, { 'a': [ 2 ] } )\n false\n\n See Also\n --------\n isStrictEqual, isSameValue\n",
"deepGet": "\ndeepGet( obj, path[, options] )\n Returns a nested property value.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: any\n Nested property value.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = deepGet( obj, 'a.b.c' )\n 'd'\n\n // Specify a custom separator via the `sep` option:\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = deepGet( obj, 'a/b/c', { 'sep': '/' } )\n 'd'\n\ndeepGet.factory( path[, options] )\n Creates a reusable deep get function.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Deep get factory.\n\n Examples\n --------\n > var dget = deepGet.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = dget( obj )\n 'd'\n\n See Also\n --------\n deepPluck, deepSet\n",
"deepHasOwnProp": "\ndeepHasOwnProp( value, path[, options] )\n Returns a boolean indicating whether an object contains a nested key path.\n\n The function tests for \"own\" properties and will return `false` for\n inherited properties.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Key path array elements are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified path.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = deepHasOwnProp( obj, 'a.b.c' )\n true\n\n // Specify a custom separator via the `sep` option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > bool = deepHasOwnProp( obj, 'a/b/c', { 'sep': '/' } )\n true\n\ndeepHasOwnProp.factory( path[, options] )\n Returns a function which tests whether an object contains a nested key path.\n\n The returned function tests for \"own\" properties and will return `false` for\n inherited properties.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Function which tests whether an object contains a nested key path.\n\n Examples\n --------\n > var has = deepHasOwnProp.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = has( obj )\n true\n\n See Also\n --------\n deepHasProp, hasOwnProp, deepGet, deepPluck, deepSet\n",
"deepHasProp": "\ndeepHasProp( value, path[, options] )\n Returns a boolean indicating whether an object contains a nested key path,\n either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Key path array elements are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified path.\n\n Examples\n --------\n > function Foo() { return this; };\n > Foo.prototype.b = { 'c': 'd' };\n > var obj = { 'a': new Foo() };\n > var bool = deepHasProp( obj, 'a.b.c' )\n true\n\n // Specify a custom separator via the `sep` option:\n > bool = deepHasProp( obj, 'a/b/c', { 'sep': '/' } )\n true\n\ndeepHasProp.factory( path[, options] )\n Returns a function which tests whether an object contains a nested key path,\n either own or inherited.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Function which tests whether an object contains a nested key path.\n\n Examples\n --------\n > function Foo() { return this; };\n > Foo.prototype.b = { 'c': 'd' };\n > var has = deepHasProp.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': new Foo() };\n > var bool = has( obj )\n true\n\n See Also\n --------\n deepHasOwnProp, hasOwnProp, deepGet, deepPluck, deepSet\n",
"deepPluck": "\ndeepPluck( arr, path[, options] )\n Extracts a nested property value from each element of an object array.\n\n If a key path does not exist, the function sets the plucked value as\n `undefined`.\n\n Extracted values are not cloned.\n\n Parameters\n ----------\n arr: Array\n Source array.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to return a new data structure. Default:\n true.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Array\n Destination array.\n\n Examples\n --------\n > var arr = [\n ... { 'a': { 'b': { 'c': 1 } } },\n ... { 'a': { 'b': { 'c': 2 } } }\n ... ];\n > var out = deepPluck( arr, 'a.b.c' )\n [ 1, 2 ]\n > arr = [\n ... { 'a': [ 0, 1, 2 ] },\n ... { 'a': [ 3, 4, 5 ] }\n ... ];\n > out = deepPluck( arr, [ 'a', 1 ] )\n [ 1, 4 ]\n\n See Also\n --------\n deepGet, deepSet\n",
"deepSet": "\ndeepSet( obj, path, value[, options] )\n Sets a nested property value.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n path: string|Array\n Key path.\n\n value: any\n Value to set.\n\n options: Object (optional)\n Options.\n\n options.create: boolean (optional)\n Boolean indicating whether to create a path if the key path does not\n already exist. Default: false.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if the property was successfully set.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = deepSet( obj, 'a.b.c', 'beep' )\n true\n\n // Specify an alternative separator via the sep option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > bool = deepSet( obj, 'a/b/c', 'beep', { 'sep': '/' } );\n > obj\n { 'a': { 'b': { 'c': 'beep' } } }\n\n // To create a key path which does not exist, set the create option to true:\n > bool = deepSet( obj, 'a.e.c', 'boop', { 'create': true } );\n > obj\n { 'a': { 'b': { 'c': 'beep' }, 'e': { 'c': 'boop' } } }\n\n\ndeepSet.factory( path[, options] )\n Creates a reusable deep set function.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.create: boolean (optional)\n Boolean indicating whether to create a path if the key path does not\n already exist. Default: false.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Deep get function.\n\n Examples\n --------\n > var dset = deepSet.factory( 'a/b/c', {\n ... 'create': true,\n ... 'sep': '/'\n ... });\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = dset( obj, 'beep' )\n true\n > obj\n { 'a': { 'b': { 'c': 'beep' } } }\n\n See Also\n --------\n deepGet, deepPluck\n",
"defineProperties": "\ndefineProperties( obj, properties )\n Defines (and/or modifies) object properties.\n\n The second argument is an object whose own enumerable property values are\n descriptors for the properties to be defined or modified.\n\n Property descriptors come in two flavors: data descriptors and accessor\n descriptors. A data descriptor is a property that has a value, which may or\n may not be writable. An accessor descriptor is a property described by a\n getter-setter function pair. A descriptor must be one of these two flavors\n and cannot be both.\n\n A property descriptor has the following optional properties:\n\n - configurable: boolean indicating if property descriptor can be changed and\n if the property can be deleted from the provided object. Default: false.\n\n - enumerable: boolean indicating if the property shows up when enumerating\n object properties. Default: false.\n\n - writable: boolean indicating if the value associated with the property can\n be changed with an assignment operator. Default: false.\n\n - value: property value.\n\n - get: function which serves as a getter for the property, or, if no getter,\n undefined. When the property is accessed, a getter function is called\n without arguments and with the `this` context set to the object through\n which the property is accessed (which may not be the object on which the\n property is defined due to inheritance). The return value will be used as\n the property value. Default: undefined.\n\n - set: function which serves as a setter for the property, or, if no setter,\n undefined. When assigning a property value, a setter function is called with\n one argument (the value being assigned to the property) and with the `this`\n context set to the object through which the property is assigned. Default: undefined.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the properties.\n\n properties: Object\n Object with property descriptors.\n\n Returns\n -------\n obj: Object\n Object on which properties were defined (and/or modified).\n\n Examples\n --------\n > var obj = {};\n > defineProperties( obj, {\n ... 'foo': {\n ... 'value': 'bar',\n ... 'writable': false,\n ... 'configurable': false,\n ... 'enumerable': true\n ... },\n ... 'baz': {\n ... 'value': 13\n ... }\n ... });\n > obj.foo\n 'bar'\n > obj.baz\n 13\n\n See Also\n --------\n defineProperty, setReadOnly\n",
"defineProperty": "\ndefineProperty( obj, prop, descriptor )\n Defines (or modifies) an object property.\n\n Property descriptors come in two flavors: data descriptors and accessor\n descriptors. A data descriptor is a property that has a value, which may or\n may not be writable. An accessor descriptor is a property described by a\n getter-setter function pair. A descriptor must be one of these two flavors\n and cannot be both.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n descriptor: Object\n Property descriptor.\n\n descriptor.configurable: boolean (optional)\n Boolean indicating if property descriptor can be changed and if the\n property can be deleted from the provided object. Default: false.\n\n descriptor.enumerable: boolean (optional)\n Boolean indicating if the property shows up when enumerating object\n properties. Default: false.\n\n descriptor.writable: boolean (optional)\n Boolean indicating if the value associated with the property can be\n changed with an assignment operator. Default: false.\n\n descriptor.value: any (optional)\n Property value.\n\n descriptor.get: Function|void (optional)\n Function which serves as a getter for the property, or, if no getter,\n undefined. When the property is accessed, a getter function is called\n without arguments and with the `this` context set to the object through\n which the property is accessed (which may not be the object on which the\n property is defined due to inheritance). The return value will be used\n as the property value. Default: undefined.\n\n descriptor.set: Function|void (optional)\n Function which serves as a setter for the property, or, if no setter,\n undefined. When assigning a property value, a setter function is called\n with one argument (the value being assigned to the property) and with\n the `this` context set to the object through which the property is\n assigned. Default: undefined.\n\n Returns\n -------\n obj: Object\n Object on which the property was defined (or modified).\n\n Examples\n --------\n > var obj = {};\n > defineProperty( obj, 'foo', {\n ... 'value': 'bar',\n ... 'enumerable': true,\n ... 'writable': false\n ... });\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n defineProperties, setReadOnly\n",
"dirname": "\ndirname( path )\n Returns a directory name.\n\n Parameters\n ----------\n path: string\n Path.\n\n Returns\n -------\n out: string\n Directory name.\n\n Examples\n --------\n > var dir = dirname( './foo/bar/index.js' )\n './foo/bar'\n\n See Also\n --------\n extname\n",
"DoublyLinkedList": "\nDoublyLinkedList()\n Doubly linked list constructor.\n\n Returns\n -------\n list: Object\n Doubly linked list.\n\n list.clear: Function\n Clears the list.\n\n list.first: Function\n Returns the first list node. If the list is empty, the returned value is\n `undefined`.\n\n list.insert: Function\n Inserts a value after a provided list node. For its third argument, the\n method accepts a location: 'before' or 'after'. Default: 'after'.\n\n list.iterator: Function\n Returns an iterator for iterating over a list. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from list mutation during\n iteration, a returned iterator **always** iterates over a list\n \"snapshot\", which is defined as the list of list elements at the time\n of the method's invocation. For its sole argument, the method accepts a\n direction: 'forward' or 'reverse'. Default: 'forward'.\n\n list.last: Function\n Returns the last list node. If the list is empty, the returned value is\n `undefined`.\n\n list.length: integer\n List length.\n\n list.pop: Function\n Removes and returns the last list value. If the list is empty, the\n returned value is `undefined`.\n\n list.push: Function\n Adds a value to the end of the list.\n\n list.remove: Function\n Removes a list node from the list.\n\n list.shift: Function\n Removes and returns the first list value. If the list is empty, the\n returned value is `undefined`.\n\n list.toArray: Function\n Returns an array of list values.\n\n list.toJSON: Function\n Serializes a list as JSON.\n\n list.unshift: Function\n Adds a value to the beginning of the list.\n\n Examples\n --------\n > var list = DoublyLinkedList();\n > list.push( 'foo' ).push( 'bar' );\n > list.length\n 2\n > list.pop()\n 'bar'\n > list.length\n 1\n > list.pop()\n 'foo'\n > list.length\n 0\n\n See Also\n --------\n LinkedList, Stack\n",
"doUntil": "\ndoUntil( fcn, predicate[, thisArg] )\n Invokes a function until a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to stop invoking a\n function.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i >= 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > doUntil( beep, predicate )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntilAsync, doUntilEach, doWhile, until, whilst\n",
"doUntilAsync": "\ndoUntilAsync( fcn, predicate, done[, thisArg] )\n Invokes a function until a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from one)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is falsy, the function continues invoking `fcn`;\n otherwise, the function invokes the `done` callback.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function predicate( i, clbk ) { clbk( null, i >= 5 ); };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > doUntilAsync( fcn, predicate, done )\n boop: 4\n\n See Also\n --------\n doUntil, doWhileAsync, untilAsync, whileAsync\n",
"doUntilEach": "\ndoUntilEach( collection, fcn, predicate[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > doUntilEach( arr, logger, predicate )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n 4: NaN\n\n See Also\n --------\n doUntilEachRight, doWhileEach, untilEach\n",
"doUntilEachRight": "\ndoUntilEachRight( collection, fcn, predicate[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > doUntilEachRight( arr, logger, predicate )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n 1: NaN\n\n See Also\n --------\n doUntilEach, doWhileEachRight, untilEachRight\n",
"doWhile": "\ndoWhile( fcn, predicate[, thisArg] )\n Invokes a function while a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i < 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > doWhile( beep, predicate )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhileAsync, doWhileEach, until, whilst\n",
"doWhileAsync": "\ndoWhileAsync( fcn, predicate, done[, thisArg] )\n Invokes a function while a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from one)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is truthy, the function continues invoking `fcn`;\n otherwise, the function invokes the `done` callback.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function predicate( i, clbk ) { clbk( null, i < 5 ); };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > doWhileAsync( fcn, predicate, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhile, untilAsync, whileAsync\n",
"doWhileEach": "\ndoWhileEach( collection, fcn, predicate[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > doWhileEach( arr, logger, predicate )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n 4: NaN\n\n See Also\n --------\n doUntilEach, doWhileEachRight, whileEach\n",
"doWhileEachRight": "\ndoWhileEachRight( collection, fcn, predicate[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > doWhileEachRight( arr, logger, predicate )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n 1: NaN\n\n See Also\n --------\n doUntilEachRight, doWhileEach, whileEachRight\n",
"E": "\nE\n Euler's number.\n\n Examples\n --------\n > E\n 2.718281828459045\n\n",
"endsWith": "\nendsWith( str, search[, len] )\n Tests if a `string` ends with the characters of another `string`.\n\n If provided an empty `search` string, the function always returns `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string\n Search string.\n\n len: integer (optional)\n Substring length. Restricts the search to a substring within the input\n string beginning from the leftmost character. If provided a negative\n value, `len` indicates to ignore the last `len` characters, returning\n the same output as `str.length + len`. Default: `str.length`.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a `string` ends with the characters of\n another `string`.\n\n Examples\n --------\n > var bool = endsWith( 'beep', 'ep' )\n true\n > bool = endsWith( 'Beep', 'op' )\n false\n > bool = endsWith( 'Beep', 'ee', 3 )\n true\n > bool = endsWith( 'Beep', 'ee', -1 )\n true\n > bool = endsWith( 'beep', '' )\n true\n\n See Also\n --------\n startsWith\n",
"enumerableProperties": "\nenumerableProperties( value )\n Returns an array of an object's own enumerable property names and symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own enumerable properties.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var props = enumerableProperties( obj )\n [ 'beep' ]\n\n See Also\n --------\n enumerablePropertiesIn, enumerablePropertySymbols, inheritedEnumerableProperties, objectKeys, nonEnumerableProperties, properties\n",
"enumerablePropertiesIn": "\nenumerablePropertiesIn( value )\n Returns an array of an object's own and inherited enumerable property names\n and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited enumerable property names and\n symbols.\n\n Examples\n --------\n > var props = enumerablePropertiesIn( [] )\n\n See Also\n --------\n enumerableProperties, enumerablePropertySymbolsIn, inheritedEnumerableProperties, keysIn, nonEnumerablePropertiesIn, propertiesIn\n",
"enumerablePropertySymbols": "\nenumerablePropertySymbols( value )\n Returns an array of an object's own enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = enumerablePropertySymbols( obj )\n\n See Also\n --------\n enumerablePropertySymbolsIn, inheritedEnumerablePropertySymbols, objectKeys, nonEnumerablePropertySymbols, propertySymbols\n",
"enumerablePropertySymbolsIn": "\nenumerablePropertySymbolsIn( value )\n Returns an array of an object's own and inherited enumerable symbol\n properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = enumerablePropertySymbolsIn( obj )\n\n See Also\n --------\n enumerablePropertySymbols, inheritedEnumerablePropertySymbols, keysIn, nonEnumerablePropertySymbolsIn, propertySymbolsIn\n",
"ENV": "\nENV\n An object containing the user environment.\n\n Examples\n --------\n > var user = ENV.USER\n <string>\n\n See Also\n --------\n ARGV\n",
"EPS": "\nEPS\n Difference between one and the smallest value greater than one that can be\n represented as a double-precision floating-point number.\n\n Examples\n --------\n > EPS\n 2.220446049250313e-16\n\n See Also\n --------\n FLOAT32_EPS\n",
"error2json": "\nerror2json( error )\n Returns a JSON representation of an error object.\n\n The following built-in error types are supported:\n\n - Error\n - URIError\n - ReferenceError\n - SyntaxError\n - RangeError\n - EvalError\n - TypeError\n\n The JSON object is guaranteed to have the following properties:\n\n - type: error type.\n - message: error message.\n\n The only standardized cross-platform property is `message`. Depending on the\n platform, the following properties *may* be present:\n\n - name: error name.\n - stack: stack trace.\n - code: error code (Node.js system errors).\n - errno: error code string (Node.js system errors).\n - syscall: string representing the failed system call (Node.js system\n errors).\n\n The function also serializes all enumerable properties.\n\n The implementation supports custom error types and sets the `type` field to\n the closest built-in error type.\n\n Parameters\n ----------\n error: Error\n Error to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var err = new Error( 'beep' );\n > var json = error2json( err )\n <Object>\n\n See Also\n --------\n reviveError\n",
"EULERGAMMA": "\nEULERGAMMA\n The Euler-Mascheroni constant.\n\n Examples\n --------\n > EULERGAMMA\n 0.5772156649015329\n\n",
"every": "\nevery( collection )\n Tests whether all elements in a collection are truthy.\n\n The function immediately returns upon encountering a falsy value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if all elements are truthy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 1, 1, 1, 1, 1 ];\n > var bool = every( arr )\n true\n\n See Also\n --------\n any, everyBy, forEach, none, some\n",
"everyBy": "\neveryBy( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a non-truthy return\n value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a truthy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = everyBy( arr, positive )\n true\n\n See Also\n --------\n anyBy, everyByRight, forEach, noneBy, someBy\n",
"everyByAsync": "\neveryByAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-truthy `result`\n value and calls the `done` callback with `null` as the first argument and\n `false` as the second argument.\n\n If all elements succeed, the function calls the `done` callback with `null`\n as the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\neveryByAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection pass a\n test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = everyByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByAsync, everyBy, everyByRightAsync, forEachAsync, noneByAsync, someByAsync\n",
"everyByRight": "\neveryByRight( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a non-truthy return\n value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a truthy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = everyByRight( arr, positive )\n true\n\n See Also\n --------\n anyBy, every, everyBy, forEachRight, noneByRight, someByRight\n",
"everyByRightAsync": "\neveryByRightAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-truthy `result`\n value and calls the `done` callback with `null` as the first argument and\n `false` as the second argument.\n\n If all elements succeed, the function calls the `done` callback with `null`\n as the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\neveryByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection pass a\n test implemented by a predicate function, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = everyByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByRightAsync, everyByAsync, everyByRight, forEachRightAsync, noneByRightAsync, someByRightAsync\n",
"evil": "\nevil( str )\n Alias for `eval` global.\n\n A reference to `eval` is treated differently by the compiler. For example,\n when evaluating code containing block-scoped declarations (e.g., `let`,\n `const`, `function`, `class`), the compiler may throw an `error` complaining\n that block-scoped declarations are not yet supported outside of\n `strict mode`. One possible workaround is to include `\"use strict\";` in the\n evaluated code.\n\n Parameters\n ----------\n str: string\n Code to evaluate.\n\n Returns\n -------\n out: any\n Returned value if applicable.\n\n Examples\n --------\n > var v = evil( '5*4*3*2*1' )\n 120\n\n",
"exists": "\nexists( path, clbk )\n Asynchronously tests whether a path exists on the filesystem.\n\n Parameters\n ----------\n path: string|Buffer\n Path to test.\n\n clbk: Function\n Callback to invoke after testing for path existence. A callback may\n accept a single argument, a boolean indicating whether a path exists, or\n two arguments, an error argument and a boolean, matching the error-first\n callback convention used in most asynchronous Node.js APIs.\n\n Examples\n --------\n > function done( error, bool ) { console.log( bool ); };\n > exists( './beep/boop', done );\n\n\nexists.sync( path )\n Synchronously tests whether a path exists on the filesystem.\n\n Parameters\n ----------\n path: string|Buffer\n Path to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the path exists.\n\n Examples\n --------\n > var bool = exists.sync( './beep/boop' )\n <boolean>\n\n See Also\n --------\n readFile, readDir\n",
"expandContractions": "\nexpandContractions( str )\n Expands all contractions to their formal equivalents.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with expanded contractions.\n\n Examples\n --------\n > var str = 'I won\\'t be able to get y\\'all out of this one.';\n > var out = expandContractions( str )\n 'I will not be able to get you all out of this one.'\n\n > str = 'It oughtn\\'t to be my fault, because, you know, I didn\\'t know';\n > out = expandContractions( str )\n 'It ought not to be my fault, because, you know, I did not know'\n\n",
"extname": "\nextname( filename )\n Returns a filename extension.\n\n Parameters\n ----------\n filename: string\n Filename.\n\n Returns\n -------\n ext: string\n Filename extension.\n\n Examples\n --------\n > var ext = extname( 'index.js' )\n '.js'\n\n See Also\n --------\n dirname\n",
"fastmath.abs": "\nfastmath.abs( x )\n Computes an absolute value.\n\n This implementation is not IEEE 754 compliant. If provided `-0`, the\n function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Absolute value.\n\n Examples\n --------\n > var v = fastmath.abs( -1.0 )\n 1.0\n > v = fastmath.abs( 2.0 )\n 2.0\n > v = fastmath.abs( 0.0 )\n 0.0\n > v = fastmath.abs( -0.0 )\n -0.0\n > v = fastmath.abs( NaN )\n NaN\n\n See Also\n --------\n base.abs\n",
"fastmath.acosh": "\nfastmath.acosh( x )\n Computes the hyperbolic arccosine of a number.\n\n The domain of `x` is restricted to `[1,+infinity)`. If `x < 1`, the function\n will return `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arccosine (in radians).\n\n Examples\n --------\n > var v = fastmath.acosh( 1.0 )\n 0.0\n > v = fastmath.acosh( 2.0 )\n ~1.317\n > v = fastmath.acosh( NaN )\n NaN\n\n // The function overflows for large `x`:\n > v = fastmath.acosh( 1.0e308 )\n Infinity\n\n See Also\n --------\n base.acosh\n",
"fastmath.ampbm": "\nfastmath.ampbm( x, y )\n Computes the hypotenuse using the alpha max plus beta min algorithm.\n\n The algorithm computes only an approximation.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = fastmath.ampbm( 5.0, 12.0 )\n ~13.514\n\n\nfastmath.ampbm.factory( alpha, beta, [nonnegative[, ints]] )\n Returns a function to compute a hypotenuse using the alpha max plus beta min\n algorithm.\n\n Parameters\n ----------\n alpha: number\n Alpha.\n\n beta: number\n Beta.\n\n nonnegative: boolean (optional)\n Boolean indicating whether input values are always nonnegative.\n\n ints: boolean (optional)\n Boolean indicating whether input values are always 32-bit integers.\n\n Returns\n -------\n fcn: Function\n Function to compute a hypotenuse.\n\n Examples\n --------\n > var hypot = fastmath.ampbm.factory( 1.0, 0.5 )\n <Function>\n\n See Also\n --------\n base.hypot\n",
"fastmath.asinh": "\nfastmath.asinh( x )\n Computes the hyperbolic arcsine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arcsine (in radians).\n\n Examples\n --------\n > var v = fastmath.asinh( 0.0 )\n 0.0\n > v = fastmath.asinh( 2.0 )\n ~1.444\n > v = fastmath.asinh( -2.0 )\n ~-1.444\n > v = fastmath.asinh( NaN )\n NaN\n\n // The function overflows for large `x`:\n > v = fastmath.asinh( 1.0e200 )\n Infinity\n\n // The function underflows for small `x`:\n > v = fastmath.asinh( 1.0e-50 )\n 0.0\n\n See Also\n --------\n base.asinh\n",
"fastmath.atanh": "\nfastmath.atanh( x )\n Computes the hyperbolic arctangent of a number.\n\n The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arctangent (in radians).\n\n Examples\n --------\n > var v = fastmath.atanh( 0.0 )\n 0.0\n > v = fastmath.atanh( 0.9 )\n ~1.472\n > v = fastmath.atanh( 1.0 )\n Infinity\n > v = fastmath.atanh( -1.0 )\n -Infinity\n > v = fastmath.atanh( NaN )\n NaN\n\n // The function underflows for small `x`:\n > v = fastmath.atanh( 1.0e-17 )\n 0.0\n\n See Also\n --------\n base.atanh\n",
"fastmath.hypot": "\nfastmath.hypot( x, y )\n Computes the hypotenuse.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = fastmath.hypot( -5.0, 12.0 )\n 13.0\n\n // For a sufficiently large `x` and/or `y`, the function overflows:\n > h = fastmath.hypot( 1.0e154, 1.0e154 )\n Infinity\n\n // For sufficiently small `x` and/or `y`, the function underflows:\n > h = fastmath.hypot( 1e-200, 1.0e-200 )\n 0.0\n\n See Also\n --------\n base.hypot\n",
"fastmath.log2Uint32": "\nfastmath.log2Uint32( x )\n Returns an approximate binary logarithm (base two) of an unsigned 32-bit\n integer `x`.\n\n This function provides a performance boost when requiring only approximate\n computations for integer arguments.\n\n For high-precision applications, this function is never suitable.\n\n Parameters\n ----------\n x: uinteger\n Input value.\n\n Returns\n -------\n out: uinteger\n Integer binary logarithm (base two).\n\n Examples\n --------\n > var v = fastmath.log2Uint32( 4 >>> 0 )\n 2\n > v = fastmath.log2Uint32( 8 >>> 0 )\n 3\n > v = fastmath.log2Uint32( 9 >>> 0 )\n 3\n\n See Also\n --------\n base.log2\n",
"fastmath.max": "\nfastmath.max( x, y )\n Returns the maximum value.\n\n The function ignores the sign of `0` and does not check for `NaN` arguments.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var v = fastmath.max( 3.14, 4.2 )\n 4.2\n > v = fastmath.max( 3.14, NaN )\n NaN\n > v = fastmath.max( NaN, 3.14 )\n 3.14\n > v = fastmath.max( -0.0, +0.0 )\n +0.0\n > v = fastmath.max( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.max\n",
"fastmath.min": "\nfastmath.min( x, y )\n Returns the minimum value.\n\n The function ignores the sign of `0` and does not check for `NaN` arguments.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var v = fastmath.min( 3.14, 4.2 )\n 3.14\n > v = fastmath.min( 3.14, NaN )\n NaN\n > v = fastmath.min( NaN, 3.14 )\n 3.14\n > v = fastmath.min( -0.0, +0.0 )\n +0.0\n > v = fastmath.min( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.min\n",
"fastmath.powint": "\nfastmath.powint( x, y )\n Evaluates the exponential function given a signed 32-bit integer exponent.\n\n This function is not recommended for high-precision applications due to\n error accumulation.\n\n If provided a negative exponent, the function first computes the reciprocal\n of the base and then evaluates the exponential function. This can introduce\n significant error.\n\n Parameters\n ----------\n x: number\n Base.\n\n y: integer\n Signed 32-bit integer exponent.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var v = fastmath.powint( 2.0, 3 )\n 8.0\n > v = fastmath.powint( 3.14, 0 )\n 1.0\n > v = fastmath.powint( 2.0, -2 )\n 0.25\n > v = fastmath.powint( 0.0, 0 )\n 1.0\n > v = fastmath.powint( -3.14, 1 )\n -3.14\n > v = fastmath.powint( NaN, 0 )\n NaN\n\n See Also\n --------\n base.pow\n",
"fastmath.sqrtUint32": "\nfastmath.sqrtUint32( x )\n Returns an approximate square root of an unsigned 32-bit integer `x`.\n\n Prefer hardware `sqrt` over a software implementation.\n\n When using a software `sqrt`, this function provides a performance boost\n when an application requires only approximate computations for integer\n arguments.\n\n For applications requiring high-precision, this function is never suitable.\n\n Parameters\n ----------\n x: uinteger\n Input value.\n\n Returns\n -------\n out: uinteger\n Integer square root.\n\n Examples\n --------\n > var v = fastmath.sqrtUint32( 9 >>> 0 )\n 3\n > v = fastmath.sqrtUint32( 2 >>> 0 )\n 1\n > v = fastmath.sqrtUint32( 3 >>> 0 )\n 1\n > v = fastmath.sqrtUint32( 0 >>> 0 )\n 0\n\n See Also\n --------\n base.sqrt\n",
"FEMALE_FIRST_NAMES_EN": "\nFEMALE_FIRST_NAMES_EN()\n Returns a list of common female first names in English speaking countries.\n\n Returns\n -------\n out: Array<string>\n List of common female first names.\n\n Examples\n --------\n > var list = FEMALE_FIRST_NAMES_EN()\n [ 'Aaren', 'Aarika', 'Abagael', 'Abagail', ... ]\n\n References\n ----------\n - Ward, Grady. 2002. \"Moby Word II.\" <http://www.gutenberg.org/files/3201/\n 3201.txt>.\n\n See Also\n --------\n MALE_FIRST_NAMES_EN\n",
"FIFO": "\nFIFO()\n First-in-first-out (FIFO) queue constructor.\n\n Returns\n -------\n queue: Object\n First-in-first-out queue.\n\n queue.clear: Function\n Clears the queue.\n\n queue.first: Function\n Returns the \"oldest\" queue value (i.e., the value which is \"first-out\").\n If the queue is empty, the returned value is `undefined`.\n\n queue.iterator: Function\n Returns an iterator for iterating over a queue. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from queue mutation during\n iteration, a returned iterator **always** iterates over a queue\n \"snapshot\", which is defined as the list of queue elements at the time\n of the method's invocation.\n\n queue.last: Function\n Returns the \"newest\" queue value (i.e., the value which is \"last-out\").\n If the queue is empty, the returned value is `undefined`.\n\n queue.length: integer\n Queue length.\n\n queue.pop: Function\n Removes and returns the current \"first-out\" value from the queue. If the\n queue is empty, the returned value is `undefined`.\n\n queue.push: Function\n Adds a value to the queue.\n\n queue.toArray: Function\n Returns an array of queue values.\n\n queue.toJSON: Function\n Serializes a queue as JSON.\n\n Examples\n --------\n > var q = FIFO();\n > q.push( 'foo' ).push( 'bar' );\n > q.length\n 2\n > q.pop()\n 'foo'\n > q.length\n 1\n > q.pop()\n 'bar'\n > q.length\n 0\n\n See Also\n --------\n Stack\n",
"find": "\nfind( arr, [options,] clbk )\n Finds elements in an array-like object that satisfy a test condition.\n\n Parameters\n ----------\n arr: Array|TypedArray|string\n Object from which elements will be tested.\n\n options: Object (optional)\n Options.\n\n options.k: integer (optional)\n Limits the number of returned elements. The sign determines the\n direction in which to search. If set to a negative integer, the function\n searches from last element to first element. Default: arr.length.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'indices'.\n\n clbk: Function\n Function invoked for each array element. If the return value is truthy,\n the value is considered to have satisfied the test condition.\n\n Returns\n -------\n out: Array\n Array of indices, element values, or arrays of index-value pairs.\n\n Examples\n --------\n > var data = [ 30, 20, 50, 60, 10 ];\n > function condition( val ) { return val > 20; };\n > var vals = find( data, condition )\n [ 0, 2, 3 ]\n\n // Limit number of results:\n > data = [ 30, 20, 50, 60, 10 ];\n > var opts = { 'k': 2, 'returns': 'values' };\n > vals = find( data, opts, condition )\n [ 30, 50 ]\n\n // Return both indices and values as index-value pairs:\n > data = [ 30, 20, 50, 60, 10 ];\n > opts = { 'k': -2, 'returns': '*' };\n > vals = find( data, opts, condition )\n [ [ 3, 60 ], [ 2, 50 ] ]\n\n",
"flattenArray": "\nflattenArray( arr[, options] )\n Flattens an array.\n\n Parameters\n ----------\n arr: Array\n Input array.\n\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy array elements. Default: false.\n\n Returns\n -------\n out: Array\n Flattened array.\n\n Examples\n --------\n > var arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > var out = flattenArray( arr )\n [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Set the maximum depth:\n > arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > out = flattenArray( arr, { 'depth': 2 } )\n [ 1, 2, 3, [ 4, [ 5 ], 6 ], 7, 8, 9 ]\n > var bool = ( arr[ 1 ][ 1 ][ 1 ] === out[ 3 ] )\n true\n\n // Deep copy:\n > arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > out = flattenArray( arr, { 'depth': 2, 'copy': true } )\n [ 1, 2, 3, [ 4, [ 5 ], 6 ], 7, 8, 9 ]\n > bool = ( arr[ 1 ][ 1 ][ 1 ] === out[ 3 ] )\n false\n\n\nflattenArray.factory( dims[, options] )\n Returns a function for flattening arrays having specified dimensions.\n\n The returned function does not validate that input arrays actually have the\n specified dimensions.\n\n Parameters\n ----------\n dims: Array<integer>\n Dimensions.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy array elements. Default: false.\n\n Returns\n -------\n fcn: Function\n Flatten function.\n\n Examples\n --------\n > var flatten = flattenArray.factory( [ 2, 2 ], {\n ... 'copy': false\n ... });\n > var out = flatten( [ [ 1, 2 ], [ 3, 4 ] ] )\n [ 1, 2, 3, 4 ]\n > out = flatten( [ [ 5, 6 ], [ 7, 8 ] ] )\n [ 5, 6, 7, 8 ]\n\n See Also\n --------\n flattenObject\n",
"flattenObject": "\nflattenObject( obj[, options] )\n Flattens an object.\n\n Parameters\n ----------\n obj: ObjectLike\n Object to flatten.\n\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy. Default: false.\n\n options.flattenArrays: boolean (optional)\n Boolean indicating whether to flatten arrays. Default: false.\n\n options.delimiter: string (optional)\n Key path delimiter. Default: '.'.\n\n Returns\n -------\n out: ObjectLike\n Flattened object.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var out = flattenObject( obj )\n { 'a.b.c': 'd' }\n\n // Set the `depth` option to flatten to a specified depth:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > out = flattenObject( obj, { 'depth': 1 } )\n { 'a.b': { 'c': 'd' } }\n > var bool = ( obj.a.b === out[ 'a.b' ] )\n true\n\n // Set the `delimiter` option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > out = flattenObject( obj, { 'delimiter': '-|-' } )\n { 'a-|-b-|-c': 'd' }\n\n // Flatten arrays:\n > obj = { 'a': { 'b': [ 1, 2, 3 ] } };\n > out = flattenObject( obj, { 'flattenArrays': true } )\n { 'a.b.0': 1, 'a.b.1': 2, 'a.b.2': 3 }\n\n\nflattenObject.factory( [options] )\n Returns a function to flatten an object.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy. Default: false.\n\n options.flattenArrays: boolean (optional)\n Boolean indicating whether to flatten arrays. Default: false.\n\n options.delimiter: string (optional)\n Key path delimiter. Default: '.'.\n\n Returns\n -------\n fcn: Function\n Flatten function.\n\n Examples\n --------\n > var flatten = flattenObject.factory({\n ... 'depth': 1,\n ... 'copy': true,\n ... 'delimiter': '|'\n ... });\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var out = flatten( obj )\n { 'a|b': { 'c': 'd' } }\n\n See Also\n --------\n flattenArray\n",
"flignerTest": "\nflignerTest( ...x[, options] )\n Computes the Fligner-Killeen test for equal variances.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = flignerTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = flignerTest( arr, { 'groups': groups })\n\n See Also\n --------\n bartlettTest\n",
"FLOAT16_CBRT_EPS": "\nFLOAT16_CBRT_EPS\n Cube root of half-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT16_CBRT_EPS\n 0.09921256574801247\n\n See Also\n --------\n FLOAT16_EPS, FLOAT16_SQRT_EPS, FLOAT32_CBRT_EPS, CBRT_EPS\n",
"FLOAT16_EPS": "\nFLOAT16_EPS\n Difference between one and the smallest value greater than one that can be\n represented as a half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_EPS\n 0.0009765625\n\n See Also\n --------\n FLOAT32_EPS, EPS\n",
"FLOAT16_EXPONENT_BIAS": "\nFLOAT16_EXPONENT_BIAS\n The bias of a half-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT16_EXPONENT_BIAS\n 15\n\n See Also\n --------\n FLOAT32_EXPONENT_BIAS, FLOAT64_EXPONENT_BIAS\n",
"FLOAT16_MAX": "\nFLOAT16_MAX\n Maximum half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_MAX\n 65504.0\n\n See Also\n --------\n FLOAT32_MAX, FLOAT64_MAX\n",
"FLOAT16_MAX_SAFE_INTEGER": "\nFLOAT16_MAX_SAFE_INTEGER\n Maximum safe half-precision floating-point integer.\n\n The maximum safe half-precision floating-point integer is given by\n `2^11 - 1`.\n\n Examples\n --------\n > FLOAT16_MAX_SAFE_INTEGER\n 2047\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT16_MIN_SAFE_INTEGER": "\nFLOAT16_MIN_SAFE_INTEGER\n Minimum safe half-precision floating-point integer.\n\n The minimum safe half-precision floating-point integer is given by\n `-(2^11 - 1)`.\n\n Examples\n --------\n > FLOAT16_MIN_SAFE_INTEGER\n -2047\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT16_NINF": "\nFLOAT16_NINF\n Half-precision floating-point negative infinity.\n\n Examples\n --------\n > FLOAT16_NINF\n -Infinity\n\n See Also\n --------\n FLOAT16_PINF, FLOAT32_NINF, NINF\n",
"FLOAT16_NUM_BYTES": "\nFLOAT16_NUM_BYTES\n Size (in bytes) of a half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_NUM_BYTES\n 2\n\n See Also\n --------\n FLOAT32_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"FLOAT16_PINF": "\nFLOAT16_PINF\n Half-precision floating-point positive infinity.\n\n Examples\n --------\n > FLOAT16_PINF\n Infinity\n\n See Also\n --------\n FLOAT16_NINF, FLOAT32_PINF, PINF\n",
"FLOAT16_PRECISION": "\nFLOAT16_PRECISION\n Effective number of bits in the significand of a half-precision floating-\n point number.\n\n The effective number of bits is `10` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT16_PRECISION\n 11\n\n See Also\n --------\n FLOAT32_PRECISION, FLOAT64_PRECISION\n",
"FLOAT16_SMALLEST_NORMAL": "\nFLOAT16_SMALLEST_NORMAL\n Smallest positive normalized half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_SMALLEST_NORMAL\n 6.103515625e-5\n\n See Also\n --------\n FLOAT16_SMALLEST_SUBNORMAL, FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_NORMAL\n",
"FLOAT16_SMALLEST_SUBNORMAL": "\nFLOAT16_SMALLEST_SUBNORMAL\n Smallest positive denormalized half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_SMALLEST_SUBNORMAL\n 5.960464477539063e-8\n\n See Also\n --------\n FLOAT16_SMALLEST_NORMAL, FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT16_SQRT_EPS": "\nFLOAT16_SQRT_EPS\n Square root of half-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT16_SQRT_EPS\n 0.03125\n\n See Also\n --------\n FLOAT16_EPS, FLOAT32_SQRT_EPS, SQRT_EPS\n",
"FLOAT32_CBRT_EPS": "\nFLOAT32_CBRT_EPS\n Cube root of single-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT32_CBRT_EPS\n 0.004921566601151848\n\n See Also\n --------\n FLOAT32_EPS, FLOAT32_SQRT_EPS, CBRT_EPS\n",
"FLOAT32_EPS": "\nFLOAT32_EPS\n Difference between one and the smallest value greater than one that can be\n represented as a single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_EPS\n 1.1920928955078125e-7\n\n See Also\n --------\n EPS\n",
"FLOAT32_EXPONENT_BIAS": "\nFLOAT32_EXPONENT_BIAS\n The bias of a single-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT32_EXPONENT_BIAS\n 127\n\n See Also\n --------\n FLOAT16_EXPONENT_BIAS, FLOAT64_EXPONENT_BIAS\n",
"FLOAT32_MAX": "\nFLOAT32_MAX\n Maximum single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_MAX\n 3.4028234663852886e+38\n\n See Also\n --------\n FLOAT16_MAX, FLOAT64_MAX\n",
"FLOAT32_MAX_SAFE_INTEGER": "\nFLOAT32_MAX_SAFE_INTEGER\n Maximum safe single-precision floating-point integer.\n\n The maximum safe single-precision floating-point integer is given by\n `2^24 - 1`.\n\n Examples\n --------\n > FLOAT32_MAX_SAFE_INTEGER\n 16777215\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT32_MIN_SAFE_INTEGER": "\nFLOAT32_MIN_SAFE_INTEGER\n Minimum safe single-precision floating-point integer.\n\n The minimum safe single-precision floating-point integer is given by\n `-(2^24 - 1)`.\n\n Examples\n --------\n > FLOAT32_MIN_SAFE_INTEGER\n -16777215\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT32_NINF": "\nFLOAT32_NINF\n Single-precision floating-point negative infinity.\n\n Examples\n --------\n > FLOAT32_NINF\n -Infinity\n\n See Also\n --------\n FLOAT32_PINF, NINF\n",
"FLOAT32_NUM_BYTES": "\nFLOAT32_NUM_BYTES\n Size (in bytes) of a single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_NUM_BYTES\n 4\n\n See Also\n --------\n FLOAT16_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"FLOAT32_PINF": "\nFLOAT32_PINF\n Single-precision floating-point positive infinity.\n\n Examples\n --------\n > FLOAT32_PINF\n Infinity\n\n See Also\n --------\n FLOAT32_NINF, PINF\n",
"FLOAT32_PRECISION": "\nFLOAT32_PRECISION\n Effective number of bits in the significand of a single-precision floating-\n point number.\n\n The effective number of bits is `23` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT32_PRECISION\n 24\n\n See Also\n --------\n FLOAT16_PRECISION, FLOAT64_PRECISION\n",
"FLOAT32_SMALLEST_NORMAL": "\nFLOAT32_SMALLEST_NORMAL\n Smallest positive normalized single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_SMALLEST_NORMAL\n 1.1754943508222875e-38\n\n See Also\n --------\n FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_NORMAL\n",
"FLOAT32_SMALLEST_SUBNORMAL": "\nFLOAT32_SMALLEST_SUBNORMAL\n Smallest positive denormalized single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_SMALLEST_SUBNORMAL\n 1.401298464324817e-45\n\n See Also\n --------\n FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT32_SQRT_EPS": "\nFLOAT32_SQRT_EPS\n Square root of single-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT32_SQRT_EPS\n 0.0003452669770922512\n\n See Also\n --------\n FLOAT32_EPS, SQRT_EPS\n",
"Float32Array": "\nFloat32Array()\n A typed array constructor which returns a typed array representing an array\n of single-precision floating-point numbers in the platform byte order.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float32Array()\n <Float32Array>\n\n\nFloat32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = new Float32Array( arr1 )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = new Float32Array( arr1 )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Float32Array( buf, 0, 4 )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2.0; };\n > var arr = Float32Array.from( [ 1.0, -1.0 ], mapFcn )\n <Float32Array>[ 2.0, -2.0 ]\n\n\nFloat32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = Float32Array.of( 2.0, -2.0 )\n <Float32Array>[ 2.0, -2.0 ]\n\n\nFloat32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Float32Array.BYTES_PER_ELEMENT\n 4\n\n\nFloat32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Float32Array.name\n 'Float32Array'\n\n\nFloat32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nFloat32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.byteLength\n 20\n\n\nFloat32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.byteOffset\n 0\n\n\nFloat32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nFloat32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.length\n 5\n\n\nFloat32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 2.0\n > arr[ 4 ]\n -2.0\n\n\nFloat32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1.0 ]\n > it.next().value\n [ 1, -1.0 ]\n > it.next().done\n true\n\n\nFloat32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > arr.every( predicate )\n false\n\n\nFloat32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > arr.fill( 2.0 );\n > arr[ 0 ]\n 2.0\n > arr[ 1 ]\n 2.0\n\n\nFloat32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nFloat32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = arr.find( predicate )\n -1.0\n\n\nFloat32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nFloat32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:1 1:0 2:-1 '\n\n\nFloat32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var bool = arr.includes( 2.0 )\n false\n > bool = arr.includes( -1.0 )\n true\n\n\nFloat32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var idx = arr.indexOf( 2.0 )\n -1\n > idx = arr.indexOf( -1.0 )\n 2\n\n\nFloat32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > arr.join( '|' )\n '1|0|-1'\n\n\nFloat32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nFloat32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = arr.lastIndexOf( 2.0 )\n -1\n > idx = arr.lastIndexOf( 0.0 )\n 3\n\n\nFloat32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var arr2 = arr1.map( fcn );\n <Float32Array>[ 2.0, 0.0, -2.0 ]\n\n\nFloat32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0.0 )\n 2.0\n\n\nFloat32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0.0 )\n 2.0\n\n\nFloat32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] )\n <Float32Array>[ 1.0, 0.0, -1.0 ]\n > arr.reverse()\n <Float32Array>[ -1.0, 0.0, 1.0 ]\n\n\nFloat32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > arr.set( [ -2.0, 2.0 ], 1 );\n > arr[ 1 ]\n -2.0\n > arr[ 2 ]\n 2.0\n\n\nFloat32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 0.0\n > arr2[ 1 ]\n -1.0\n\n\nFloat32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > arr.some( predicate )\n true\n\n\nFloat32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > arr.sort()\n <Float32Array>[ -2.0, -1.0, 0.0, 1.0, 2.0 ]\n\n\nFloat32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr2 = arr1.subarray( 2 )\n <Float32Array>[ 0.0, 2.0, -2.0 ]\n\n\nFloat32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toLocaleString()\n '1,-1,0'\n\n\nFloat32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toString()\n '1,-1,0'\n\n\nFloat32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"FLOAT64_EXPONENT_BIAS": "\nFLOAT64_EXPONENT_BIAS\n The bias of a double-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT64_EXPONENT_BIAS\n 1023\n\n See Also\n --------\n FLOAT16_EXPONENT_BIAS, FLOAT32_EXPONENT_BIAS\n",
"FLOAT64_HIGH_WORD_EXPONENT_MASK": "\nFLOAT64_HIGH_WORD_EXPONENT_MASK\n High word mask for the exponent of a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_HIGH_WORD_EXPONENT_MASK\n 2146435072\n > base.toBinaryStringUint32( FLOAT64_HIGH_WORD_EXPONENT_MASK )\n '01111111111100000000000000000000'\n\n See Also\n --------\n FLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n",
"FLOAT64_HIGH_WORD_SIGNIFICAND_MASK": "\nFLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n High word mask for the significand of a double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n 1048575\n > base.toBinaryStringUint32( FLOAT64_HIGH_WORD_SIGNIFICAND_MASK )\n '00000000000011111111111111111111'\n\n See Also\n --------\n FLOAT64_HIGH_WORD_EXPONENT_MASK\n",
"FLOAT64_MAX": "\nFLOAT64_MAX\n Maximum double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX\n 1.7976931348623157e+308\n\n See Also\n --------\n FLOAT16_MAX, FLOAT32_MAX\n",
"FLOAT64_MAX_BASE2_EXPONENT": "\nFLOAT64_MAX_BASE2_EXPONENT\n The maximum biased base 2 exponent for a double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE2_EXPONENT\n 1023\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL": "\nFLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL\n The maximum biased base 2 exponent for a subnormal double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL\n -1023\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MAX_BASE10_EXPONENT": "\nFLOAT64_MAX_BASE10_EXPONENT\n The maximum base 10 exponent for a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE10_EXPONENT\n 308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT\n",
"FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL": "\nFLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL\n The maximum base 10 exponent for a subnormal double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL\n -308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n",
"FLOAT64_MAX_LN": "\nFLOAT64_MAX_LN\n Natural logarithm of the maximum double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_LN\n 709.782712893384\n\n See Also\n --------\n FLOAT64_MIN_LN\n",
"FLOAT64_MAX_SAFE_FIBONACCI": "\nFLOAT64_MAX_SAFE_FIBONACCI\n Maximum safe Fibonacci number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_FIBONACCI\n 8944394323791464\n\n See Also\n --------\n FLOAT64_MAX_SAFE_NTH_FIBONACCI\n",
"FLOAT64_MAX_SAFE_INTEGER": "\nFLOAT64_MAX_SAFE_INTEGER\n Maximum safe double-precision floating-point integer.\n\n The maximum safe double-precision floating-point integer is given by\n `2^53 - 1`.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_INTEGER\n 9007199254740991\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT64_MAX_SAFE_LUCAS": "\nFLOAT64_MAX_SAFE_LUCAS\n Maximum safe Lucas number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_LUCAS\n 7639424778862807\n\n See Also\n --------\n FLOAT64_MAX_SAFE_FIBONACCI, FLOAT64_MAX_SAFE_NTH_LUCAS\n",
"FLOAT64_MAX_SAFE_NTH_FIBONACCI": "\nFLOAT64_MAX_SAFE_NTH_FIBONACCI\n Maximum safe nth Fibonacci number when stored in double-precision floating-\n point format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_NTH_FIBONACCI\n 78\n\n See Also\n --------\n FLOAT64_MAX_SAFE_FIBONACCI\n",
"FLOAT64_MAX_SAFE_NTH_LUCAS": "\nFLOAT64_MAX_SAFE_NTH_LUCAS\n Maximum safe nth Lucas number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_NTH_LUCAS\n 76\n\n See Also\n --------\n FLOAT64_MAX_SAFE_LUCAS, FLOAT64_MAX_SAFE_NTH_FIBONACCI\n",
"FLOAT64_MIN_BASE2_EXPONENT": "\nFLOAT64_MIN_BASE2_EXPONENT\n The minimum biased base 2 exponent for a normalized double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE2_EXPONENT\n -1022\n\n See Also\n --------\n FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL": "\nFLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n The minimum biased base 2 exponent for a subnormal double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n -1074\n\n See Also\n --------\n FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MIN_BASE10_EXPONENT": "\nFLOAT64_MIN_BASE10_EXPONENT\n The minimum base 10 exponent for a normalized double-precision floating-\n point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE10_EXPONENT\n -308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL": "\nFLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n The minimum base 10 exponent for a subnormal double-precision floating-\n point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n -324\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MIN_LN": "\nFLOAT64_MIN_LN\n Natural logarithm of the smallest normalized double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MIN_LN\n -708.3964185322641\n\n See Also\n --------\n FLOAT64_MAX_LN\n",
"FLOAT64_MIN_SAFE_INTEGER": "\nFLOAT64_MIN_SAFE_INTEGER\n Minimum safe double-precision floating-point integer.\n\n The minimum safe double-precision floating-point integer is given by\n `-(2^53 - 1)`.\n\n Examples\n --------\n > FLOAT64_MIN_SAFE_INTEGER\n -9007199254740991\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT64_NUM_BYTES": "\nFLOAT64_NUM_BYTES\n Size (in bytes) of a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_NUM_BYTES\n 8\n\n See Also\n --------\n FLOAT16_NUM_BYTES, FLOAT32_NUM_BYTES\n",
"FLOAT64_PRECISION": "\nFLOAT64_PRECISION\n Effective number of bits in the significand of a double-precision floating-\n point number.\n\n The effective number of bits is `52` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT64_PRECISION\n 53\n\n See Also\n --------\n FLOAT16_PRECISION, FLOAT32_PRECISION\n",
"FLOAT64_SMALLEST_NORMAL": "\nFLOAT64_SMALLEST_NORMAL\n Smallest positive normalized double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_SMALLEST_NORMAL\n 2.2250738585072014e-308\n\n See Also\n --------\n FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT64_SMALLEST_SUBNORMAL": "\nFLOAT64_SMALLEST_SUBNORMAL\n Smallest positive denormalized double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_SMALLEST_SUBNORMAL\n 4.940656458412465e-324\n\n See Also\n --------\n FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_NORMAL\n",
"Float64Array": "\nFloat64Array()\n A typed array constructor which returns a typed array representing an array\n of double-precision floating-point numbers in the platform byte order.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float64Array()\n <Float64Array>\n\n\nFloat64Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat64Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = new Float64Array( arr1 )\n <Float64Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat64Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = new Float64Array( arr1 )\n <Float64Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat64Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 32 );\n > var arr = new Float64Array( buf, 0, 4 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat64Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2.0; };\n > var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn )\n <Float64Array>[ 2.0, -2.0 ]\n\n\nFloat64Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = Float64Array.of( 2.0, -2.0 )\n <Float64Array>[ 2.0, -2.0 ]\n\n\nFloat64Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Float64Array.BYTES_PER_ELEMENT\n 8\n\n\nFloat64Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Float64Array.name\n 'Float64Array'\n\n\nFloat64Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nFloat64Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.byteLength\n 40\n\n\nFloat64Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.byteOffset\n 0\n\n\nFloat64Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 8\n\n\nFloat64Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.length\n 5\n\n\nFloat64Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 2.0\n > arr[ 4 ]\n -2.0\n\n\nFloat64Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1.0 ]\n > it.next().value\n [ 1, -1.0 ]\n > it.next().done\n true\n\n\nFloat64Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > arr.every( predicate )\n false\n\n\nFloat64Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > arr.fill( 2.0 );\n > arr[ 0 ]\n 2.0\n > arr[ 1 ]\n 2.0\n\n\nFloat64Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nFloat64Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = arr.find( predicate )\n -1.0\n\n\nFloat64Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nFloat64Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:1 1:0 2:-1 '\n\n\nFloat64Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var bool = arr.includes( 2.0 )\n false\n > bool = arr.includes( -1.0 )\n true\n\n\nFloat64Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var idx = arr.indexOf( 2.0 )\n -1\n > idx = arr.indexOf( -1.0 )\n 2\n\n\nFloat64Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > arr.join( '|' )\n '1|0|-1'\n\n\nFloat64Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nFloat64Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = arr.lastIndexOf( 2.0 )\n -1\n > idx = arr.lastIndexOf( 0.0 )\n 3\n\n\nFloat64Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var arr2 = arr1.map( fcn );\n <Float64Array>[ 2.0, 0.0, -2.0 ]\n\n\nFloat64Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0.0 )\n 2.0\n\n\nFloat64Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0.0 )\n 2.0\n\n\nFloat64Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] )\n <Float64Array>[ 1.0, 0.0, -1.0 ]\n > arr.reverse()\n <Float64Array>[ -1.0, 0.0, 1.0 ]\n\n\nFloat64Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > arr.set( [ -2.0, 2.0 ], 1 );\n > arr[ 1 ]\n -2.0\n > arr[ 2 ]\n 2.0\n\n\nFloat64Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 0.0\n > arr2[ 1 ]\n -1.0\n\n\nFloat64Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > arr.some( predicate )\n true\n\n\nFloat64Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > arr.sort()\n <Float64Array>[ -2.0, -1.0, 0.0, 1.0, 2.0 ]\n\n\nFloat64Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float64Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr2 = arr1.subarray( 2 )\n <Float64Array>[ 0.0, 2.0, -2.0 ]\n\n\nFloat64Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toLocaleString()\n '1,-1,0'\n\n\nFloat64Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toString()\n '1,-1,0'\n\n\nFloat64Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"forEach": "\nforEach( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4 ];\n > forEach( arr, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n forEachAsync, forEachRight\n",
"forEachAsync": "\nforEachAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, onDuration, done )\n 1000\n 2500\n 3000\n Done.\n\n // Limit number of concurrent invocations:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, opts, onDuration, done )\n 2500\n 3000\n 1000\n Done.\n\n // Process sequentially:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, opts, onDuration, done )\n 3000\n 2500\n 1000\n Done.\n\n\nforEachAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = forEachAsync.factory( opts, onDuration );\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n Done.\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n Done.\n\n See Also\n --------\n forEach, forEachRightAsync\n",
"forEachRight": "\nforEachRight( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection, iterating from right to\n left.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4 ];\n > forEachRight( arr, logger )\n 3: 4\n 2: 3\n 1: 2\n 0: 1\n\n See Also\n --------\n forEach, forEachRightAsync\n",
"forEachRightAsync": "\nforEachRightAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection, iterating from\n right to left.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, onDuration, done )\n 1000\n 2500\n 3000\n Done.\n\n // Limit number of concurrent invocations:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, opts, onDuration, done )\n 2500\n 3000\n 1000\n Done.\n\n // Process sequentially:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, opts, onDuration, done )\n 3000\n 2500\n 1000\n Done.\n\n\nforEachRightAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = forEachRightAsync.factory( opts, onDuration );\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n Done.\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n Done.\n\n See Also\n --------\n forEachAsync, forEachRight\n",
"forIn": "\nforIn( obj, fcn[, thisArg] )\n Invokes a function for each own and inherited enumerable property of an\n object.\n\n When invoked, the function is provided three arguments:\n\n - `value`: object property value\n - `key`: object property\n - `obj`: the input object\n\n To terminate iteration before visiting all properties, the provided function\n must explicitly return `false`.\n\n Property iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Input object, including arrays, typed arrays, and other collections.\n\n fcn: Function\n The function to invoke for each own enumerable property.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Input object.\n\n Examples\n --------\n > function logger( v, k ) { console.log( '%s: %d', k, v ); };\n > function Foo() { return this; };\n > Foo.prototype.beep = 'boop';\n > var obj = new Foo();\n > forIn( obj, logger )\n beep: boop\n\n See Also\n --------\n forEach, forOwn\n",
"forOwn": "\nforOwn( obj, fcn[, thisArg] )\n Invokes a function for each own enumerable property of an object.\n\n When invoked, the function is provided three arguments:\n\n - `value`: object property value\n - `key`: object property\n - `obj`: the input object\n\n To terminate iteration before visiting all properties, the provided function\n must explicitly return `false`.\n\n The function determines the list of own enumerable properties *before*\n invoking the provided function. Hence, any modifications made to the input\n object *after* calling this function (such as adding and removing\n properties) will *not* affect the list of visited properties.\n\n Property iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Input object, including arrays, typed arrays, and other collections.\n\n fcn: Function\n The function to invoke for each own enumerable property.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Input object.\n\n Examples\n --------\n > function logger( v, k ) { console.log( '%s: %d', k, v ); };\n > var obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };\n > forOwn( obj, logger )\n a: 1\n b: 2\n c: 3\n d: 4\n\n See Also\n --------\n forEach, forIn\n",
"FOURTH_PI": "\nFOURTH_PI\n One fourth times the mathematical constant `π`.\n\n Examples\n --------\n > FOURTH_PI\n 7.85398163397448309616e-1\n\n See Also\n --------\n PI\n",
"FOURTH_ROOT_EPS": "\nFOURTH_ROOT_EPS\n Fourth root of double-precision floating-point epsilon.\n\n Examples\n --------\n > FOURTH_ROOT_EPS\n 0.0001220703125\n\n See Also\n --------\n EPS\n",
"FRB_SF_WAGE_RIGIDITY": "\nFRB_SF_WAGE_RIGIDITY()\n Returns wage rates for U.S. workers that have not changed jobs within the\n year.\n\n Each array element has the following fields:\n\n - date: collection date (month/day/year; e.g., 01/01/1980).\n - all_workers: wage rates for hourly and non-hourly workers.\n - hourly_workers: wage rates for hourly workers.\n - non_hourly_workers: wage rates for non-hourly workers.\n - less_than_high_school: wage rates for workers with less than a high school\n education.\n - high_school: wage rates for workers with a high school education.\n - some_college: wage rates for workers with some college education.\n - college: wage rates for workers with a college education.\n - construction: wage rates for workers in the construction industry.\n - finance: wage rates for workers in the finance industry.\n - manufacturing: wage rates for workers in the manufacturing industry.\n\n Returns\n -------\n out: Array<Object>\n Wage rates.\n\n Examples\n --------\n > var data = FRB_SF_WAGE_RIGIDITY()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Federal Reserve Bank of San Francisco. 2017. \"Wage Rigidity.\" <http://www.\n frbsf.org/economic-research/indicators-data/nominal-wage-rigidity/>.\n\n",
"fromCodePoint": "\nfromCodePoint( ...pt )\n Creates a string from a sequence of Unicode code points.\n\n In addition to multiple arguments, the function also supports providing an\n array-like object as a single argument containing a sequence of Unicode code\n points.\n\n Parameters\n ----------\n pt: ...integer\n Sequence of Unicode code points.\n\n Returns\n -------\n out: string\n Output string.\n\n Examples\n --------\n > var out = fromCodePoint( 9731 )\n '☃'\n > out = fromCodePoint( [ 9731 ] )\n '☃'\n > out = fromCodePoint( 97, 98, 99 )\n 'abc'\n > out = fromCodePoint( [ 97, 98, 99 ] )\n 'abc'\n\n",
"functionName": "\nfunctionName( fcn )\n Returns the name of a function.\n\n If provided an anonymous function, the function returns an empty `string` or\n the string `\"anonymous\"`.\n\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n Returns\n -------\n out: string\n Function name.\n\n Examples\n --------\n > var v = functionName( String )\n 'String'\n > v = functionName( function foo(){} )\n 'foo'\n > v = functionName( function(){} )\n '' || 'anonymous'\n\n See Also\n --------\n constructorName\n",
"functionSequence": "\nfunctionSequence( ...fcn )\n Returns a pipeline function.\n\n Starting from the left, the pipeline function evaluates each function and\n passes the result as an argument to the next function. The result of the\n rightmost function is the result of the whole.\n\n Only the leftmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as unary functions.\n\n Parameters\n ----------\n fcn: ...Function\n Functions to evaluate in sequential order.\n\n Returns\n -------\n out: Function\n Pipeline function.\n\n Examples\n --------\n > function a( x ) { return 2 * x; };\n > function b( x ) { return x + 3; };\n > function c( x ) { return x / 5; };\n > var f = functionSequence( a, b, c );\n > var z = f( 6 )\n 3\n\n See Also\n --------\n compose, functionSequenceAsync\n",
"functionSequenceAsync": "\nfunctionSequenceAsync( ...fcn )\n Returns a pipeline function.\n\n Starting from the left, the pipeline function evaluates each function and\n passes the result as the first argument of the next function. The result of\n the rightmost function is the result of the whole.\n\n The last argument for each provided function is a `next` callback which\n should be invoked upon function completion. The callback accepts two\n arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the pipeline function suspends execution and immediately calls the\n `done` callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Only the leftmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as binary functions.\n\n The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n fcn: ...Function\n Functions to evaluate in sequential order.\n\n Returns\n -------\n out: Function\n Pipeline function.\n\n Examples\n --------\n > function a( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, 2*x );\n ... }\n ... };\n > function b( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x+3 );\n ... }\n ... };\n > function c( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x/5 );\n ... }\n ... };\n > var f = functionSequenceAsync( a, b, c );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > f( 6, done )\n 3\n\n See Also\n --------\n composeAsync, functionSequence\n",
"GAMMA_LANCZOS_G": "\nGAMMA_LANCZOS_G\n Arbitrary constant `g` to be used in Lanczos approximation functions.\n\n Examples\n --------\n > GAMMA_LANCZOS_G\n 10.900511\n\n",
"getegid": "\ngetegid()\n Returns the effective numeric group identity of the calling process.\n\n The function only returns an effective group identity on POSIX platforms.\n For all other platforms (e.g., Windows and Android), the function returns\n `null`.\n\n Returns\n -------\n id: integer|null\n Effective numeric group identity.\n\n Examples\n --------\n > var gid = getegid()\n\n See Also\n --------\n geteuid, getgid, getuid\n",
"geteuid": "\ngeteuid()\n Returns the effective numeric user identity of the calling process.\n\n The function only returns an effective user identity on POSIX platforms. For\n all other platforms (e.g., Windows and Android), the function returns\n `null`.\n\n Returns\n -------\n id: integer|null\n Effective numeric user identity.\n\n Examples\n --------\n > var uid = geteuid()\n\n See Also\n --------\n getegid, getgid, getuid\n",
"getgid": "\ngetgid()\n Returns the numeric group identity of the calling process.\n\n The function only returns a group identity on POSIX platforms. For all other\n platforms (e.g., Windows and Android), the function returns `null`.\n\n Returns\n -------\n id: integer|null\n Numeric group identity.\n\n Examples\n --------\n > var gid = getgid()\n\n See Also\n --------\n getegid, geteuid, getuid\n",
"getGlobal": "\ngetGlobal( [codegen] )\n Returns the global object.\n\n Parameters\n ----------\n codegen: boolean (optional)\n Boolean indicating whether to use code generation to resolve the global\n object. Code generation is the *most* reliable means for resolving the\n global object; however, using code generation may violate content\n security policies (CSPs). Default: false.\n\n Returns\n -------\n global: Object\n Global object.\n\n Examples\n --------\n > var g = getGlobal()\n {...}\n\n",
"getPrototypeOf": "\ngetPrototypeOf( value )\n Returns the prototype of a provided object.\n\n In contrast to the native `Object.getPrototypeOf`, this function does not\n throw when provided `null` or `undefined`. Instead, similar to when provided\n any value with *no* inherited properties, the function returns `null`.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: Object|null\n Prototype.\n\n Examples\n --------\n > var proto = getPrototypeOf( {} )\n {}\n\n See Also\n --------\n isPrototypeOf\n",
"getuid": "\ngetuid()\n Returns the numeric user identity of the calling process.\n\n The function only returns a user identity on POSIX platforms. For all other\n platforms (e.g., Windows and Android), the function returns `null`.\n\n Returns\n -------\n id: integer|null\n Numeric user identity.\n\n Examples\n --------\n > var uid = getuid()\n\n See Also\n --------\n getegid, geteuid, getgid\n",
"GLAISHER": "\nGLAISHER\n Glaisher-Kinkelin constant.\n\n Examples\n --------\n > GLAISHER\n 1.2824271291006226\n\n",
"group": "\ngroup( collection, [options,] groups )\n Groups values as arrays associated with distinct keys.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n groups: Array|TypedArray|Object\n A collection defining which group an element in the input collection\n belongs to. Each value in `groups` should resolve to a value which can\n be serialized as an object key. If provided an object, the object must\n be array-like (excluding strings and functions).\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var groups = [ 'b', 'b', 'f', 'b' ];\n > var out = group( collection, groups )\n { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n > groups = [ 1, 1, 2, 1 ];\n > out = group( collection, groups )\n { '1': [ 'beep', 'boop', 'bar' ], '2': [ 'foo' ] }\n\n // Output group results as indices:\n > groups = [ 'b', 'b', 'f', 'b' ];\n > var opts = { 'returns': 'indices' };\n > out = group( collection, opts, groups )\n { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n\n // Output group results as index-element pairs:\n > opts = { 'returns': '*' };\n > out = group( collection, opts, groups )\n { 'b': [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], 'f': [ [2, 'foo'] ] }\n\n See Also\n --------\n bifurcate, countBy, groupBy\n",
"groupBy": "\ngroupBy( collection, [options,] indicator )\n Groups values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = groupBy( collection, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > out = groupBy( collection, opts, indicator )\n { 'b': [ 0, 1, 3 ], 'other': [ 2 ] }\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > out = groupBy( collection, opts, indicator )\n { 'b': [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], 'other': [ [2, 'foo' ] ] }\n\n See Also\n --------\n bifurcateBy, countBy, group\n",
"groupByAsync": "\ngroupByAsync( collection, [options,] indicator, done )\n Groups values according to an indicator function.\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty object as the second argument.\n\n The `group` returned by an indicator function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ 1000, 3000 ], \"false\": [ 2500 ] }\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > groupByAsync( arr, opts, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ 2, 0 ], \"false\": [ 1 ] }\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > groupByAsync( arr, opts, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ [ 2, 1000 ], [ 0, 3000 ] ], \"false\": [ [ 1, 2500 ] ] }\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n\n\ngroupByAsync.factory( [options,] indicator )\n Returns a function which groups values according to an indicator function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A group-by function.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = groupByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n { \"true\": [ 2000, 1000 ], \"false\": [ 1500 ] }\n\n See Also\n --------\n bifurcateByAsync, countByAsync, groupBy\n",
"groupIn": "\ngroupIn( obj, [options,] indicator )\n Group values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty object with no prototype, the function returns an empty\n object.\n\n The function iterates over an object's own and inherited properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > function Foo() { this.a = 'beep'; this.b = 'boop'; return this; };\n > Foo.prototype = Object.create( null );\n > Foo.prototype.c = 'foo';\n > Foo.prototype.d = 'bar';\n > var obj = new Foo();\n > var out = groupIn( obj, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = groupIn( obj, opts, indicator )\n { 'b': [ 'a', 'b', 'd' ], 'other': [ 'c' ] }\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = groupIn( obj, opts, indicator )\n { 'b': [['a','beep'], ['b','boop'], ['d','bar']], 'other': [['c','foo' ]] }\n\n See Also\n --------\n bifurcateIn, groupBy, groupOwn\n",
"groupOwn": "\ngroupOwn( obj, [options,] indicator )\n Group values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty object, the function returns an empty object.\n\n The function iterates over an object's own properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' };\n > var out = groupOwn( obj, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = groupOwn( obj, opts, indicator )\n { 'b': [ 'a', 'b', 'd' ], 'other': [ 'c' ] }\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = groupOwn( obj, opts, indicator )\n { 'b': [['a','beep'], ['b','boop'], ['d','bar']], 'other': [['c','foo' ]] }\n\n See Also\n --------\n bifurcateOwn, group, groupBy\n",
"HALF_LN2": "\nHALF_LN2\n One half times the natural logarithm of `2`.\n\n Examples\n --------\n > HALF_LN2\n 3.46573590279972654709e-01\n\n See Also\n --------\n LN2\n",
"HALF_PI": "\nHALF_PI\n One half times the mathematical constant `π`.\n\n Examples\n --------\n > HALF_PI\n 1.5707963267948966\n\n See Also\n --------\n PI\n",
"HARRISON_BOSTON_HOUSE_PRICES": "\nHARRISON_BOSTON_HOUSE_PRICES()\n Returns a dataset derived from information collected by the US Census\n Service concerning housing in Boston, Massachusetts (1978).\n\n The data consists of 14 attributes:\n\n - crim: per capita crime rate by town\n - zn: proportion of residential land zoned for lots over 25,000 square feet\n - indus: proportion of non-retail business acres per town\n - chas: Charles River dummy variable (1 if tract bounds river; 0 otherwise)\n - nox: nitric oxides concentration (parts per 10 million)\n - rm: average number of rooms per dwelling\n - age: proportion of owner-occupied units built prior to 1940\n - dis: weighted distances to five Boston employment centers\n - rad: index of accessibility to radial highways\n - tax: full-value property-tax rate per $10,000\n - ptratio: pupil-teacher ratio by town\n - b: 1000(Bk-0.63)^2 where Bk is the proportion of blacks by town\n - lstat: percent lower status of the population\n - medv: median value of owner-occupied homes in $1000's\n\n The dataset has two prototasks: 1) predict nitrous oxide level and 2)\n predict median home value.\n\n The median home value field seems to be censored at 50.00 (corresponding to\n a median value of $50,000). Censoring is suggested by the fact that the\n highest median value of exactly $50,000 is reported in 16 cases, while 15\n cases have values between $40,000 and $50,000. Values are rounded to the\n nearest hundred. Harrison and Rubinfeld do not, however, mention any\n censoring.\n\n Additionally, as documented by Gilley and Pace (1996), the dataset contains\n eight miscoded median values.\n\n Returns\n -------\n out: Array<Object>\n Boston house prices.\n\n Examples\n --------\n > var data = HARRISON_BOSTON_HOUSE_PRICES()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Harrison, David, and Daniel L Rubinfeld. 1978. \"Hedonic housing prices and\n the demand for clean air.\" _Journal of Environmental Economics and\n Management_ 5 (1): 81–102. doi:10.1016/0095-0696(78)90006-2.\n - Gilley, Otis W., and R.Kelley Pace. 1996. \"On the Harrison and Rubinfeld\n Data.\" _Journal of Environmental Economics and Management_ 31 (3): 403–5.\n doi:10.1006/jeem.1996.0052.\n\n See Also\n --------\n HARRISON_BOSTON_HOUSE_PRICES_CORRECTED\n",
"HARRISON_BOSTON_HOUSE_PRICES_CORRECTED": "\nHARRISON_BOSTON_HOUSE_PRICES_CORRECTED()\n Returns a (corrected) dataset derived from information collected by the US\n Census Service concerning housing in Boston, Massachusetts (1978).\n\n The data consists of 15 attributes:\n\n - crim: per capita crime rate by town\n - zn: proportion of residential land zoned for lots over 25,000 square feet\n - indus: proportion of non-retail business acres per town\n - chas: Charles River dummy variable (1 if tract bounds river; 0 otherwise)\n - nox: nitric oxides concentration (parts per 10 million)\n - rm: average number of rooms per dwelling\n - age: proportion of owner-occupied units built prior to 1940\n - dis: weighted distances to five Boston employment centers\n - rad: index of accessibility to radial highways\n - tax: full-value property-tax rate per $10,000\n - ptratio: pupil-teacher ratio by town\n - b: 1000(Bk-0.63)^2 where Bk is the proportion of blacks by town\n - lstat: percent lower status of the population\n - medv: median value of owner-occupied homes in $1000's\n - cmedv: corrected median value of owner-occupied homes in $1000's\n\n The dataset has two prototasks: 1) predict nitrous oxide level and 2)\n predict median home value.\n\n The median home value field seems to be censored at 50.00 (corresponding to\n a median value of $50,000). Censoring is suggested by the fact that the\n highest median value of exactly $50,000 is reported in 16 cases, while 15\n cases have values between $40,000 and $50,000. Values are rounded to the\n nearest hundred. Harrison and Rubinfeld do not, however, mention any\n censoring.\n\n Returns\n -------\n out: Array<Object>\n Boston house prices.\n\n Examples\n --------\n > var data = HARRISON_BOSTON_HOUSE_PRICES_CORRECTED()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Harrison, David, and Daniel L Rubinfeld. 1978. \"Hedonic housing prices and\n the demand for clean air.\" _Journal of Environmental Economics and\n Management_ 5 (1): 81–102. doi:10.1016/0095-0696(78)90006-2.\n - Gilley, Otis W., and R.Kelley Pace. 1996. \"On the Harrison and Rubinfeld\n Data.\" _Journal of Environmental Economics and Management_ 31 (3): 403–5.\n doi:10.1006/jeem.1996.0052.\n\n See Also\n --------\n HARRISON_BOSTON_HOUSE_PRICES\n",
"hasArrayBufferSupport": "\nhasArrayBufferSupport()\n Tests for native `ArrayBuffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `ArrayBuffer` support.\n\n Examples\n --------\n > var bool = hasArrayBufferSupport()\n <boolean>\n\n See Also\n --------\n hasFloat32ArraySupport, hasFloat64ArraySupport, hasInt16ArraySupport, hasInt32ArraySupport, hasInt8ArraySupport, hasNodeBufferSupport, hasSharedArrayBufferSupport, hasUint16ArraySupport, hasUint32ArraySupport, hasUint8ArraySupport, hasUint8ClampedArraySupport\n",
"hasAsyncAwaitSupport": "\nhasAsyncAwaitSupport()\n Tests for native `async`/`await` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `async`/`await` support.\n\n Examples\n --------\n > var bool = hasAsyncAwaitSupport()\n <boolean>\n\n",
"hasClassSupport": "\nhasClassSupport()\n Tests for native `class` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `class` support.\n\n Examples\n --------\n > var bool = hasClassSupport()\n <boolean>\n\n",
"hasDefinePropertiesSupport": "\nhasDefinePropertiesSupport()\n Tests for `Object.defineProperties` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Object.defineProperties`\n support.\n\n Examples\n --------\n > var bool = hasDefinePropertiesSupport()\n <boolean>\n\n See Also\n --------\n hasDefinePropertySupport\n",
"hasDefinePropertySupport": "\nhasDefinePropertySupport()\n Tests for `Object.defineProperty` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Object.defineProperty`\n support.\n\n Examples\n --------\n > var bool = hasDefinePropertySupport()\n <boolean>\n\n See Also\n --------\n hasDefinePropertiesSupport\n",
"hasFloat32ArraySupport": "\nhasFloat32ArraySupport()\n Tests for native `Float32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Float32Array` support.\n\n Examples\n --------\n > var bool = hasFloat32ArraySupport()\n <boolean>\n\n",
"hasFloat64ArraySupport": "\nhasFloat64ArraySupport()\n Tests for native `Float64Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Float64Array` support.\n\n Examples\n --------\n > var bool = hasFloat64ArraySupport()\n <boolean>\n\n",
"hasFunctionNameSupport": "\nhasFunctionNameSupport()\n Tests for native function `name` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has function `name` support.\n\n Examples\n --------\n > var bool = hasFunctionNameSupport()\n <boolean>\n\n",
"hasGeneratorSupport": "\nhasGeneratorSupport()\n Tests whether an environment supports native generator functions.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment support generator functions.\n\n Examples\n --------\n > var bool = hasGeneratorSupport()\n <boolean>\n\n",
"hasInt8ArraySupport": "\nhasInt8ArraySupport()\n Tests for native `Int8Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int8Array` support.\n\n Examples\n --------\n > var bool = hasInt8ArraySupport()\n <boolean>\n\n",
"hasInt16ArraySupport": "\nhasInt16ArraySupport()\n Tests for native `Int16Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int16Array` support.\n\n Examples\n --------\n > var bool = hasInt16ArraySupport()\n <boolean>\n\n",
"hasInt32ArraySupport": "\nhasInt32ArraySupport()\n Tests for native `Int32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int32Array` support.\n\n Examples\n --------\n > var bool = hasInt32ArraySupport()\n <boolean>\n\n",
"hasIteratorSymbolSupport": "\nhasIteratorSymbolSupport()\n Tests for native `Symbol.iterator` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Symbol.iterator`\n support.\n\n Examples\n --------\n > var bool = hasIteratorSymbolSupport()\n <boolean>\n\n See Also\n --------\n hasSymbolSupport\n",
"hasMapSupport": "\nhasMapSupport()\n Tests for native `Map` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Map` support.\n\n Examples\n --------\n > var bool = hasMapSupport()\n <boolean>\n\n",
"hasNodeBufferSupport": "\nhasNodeBufferSupport()\n Tests for native `Buffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Buffer` support.\n\n Examples\n --------\n > var bool = hasNodeBufferSupport()\n <boolean>\n\n",
"hasOwnProp": "\nhasOwnProp( value, property )\n Tests if an object has a specified property.\n\n In contrast to the native `Object.prototype.hasOwnProperty`, this function\n does not throw when provided `null` or `undefined`. Instead, the function\n returns `false`.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = hasOwnProp( beep, 'boop' )\n true\n > bool = hasOwnProp( beep, 'bop' )\n false\n\n See Also\n --------\n hasProp\n",
"hasProp": "\nhasProp( value, property )\n Tests if an object has a specified property, either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = hasProp( beep, 'boop' )\n true\n > bool = hasProp( beep, 'toString' )\n true\n > bool = hasProp( beep, 'bop' )\n false\n\n See Also\n --------\n hasOwnProp\n",
"hasProxySupport": "\nhasProxySupport()\n Tests whether an environment has native `Proxy` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Proxy` support.\n\n Examples\n --------\n > var bool = hasProxySupport()\n <boolean>\n\n",
"hasSetSupport": "\nhasSetSupport()\n Tests for native `Set` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Set` support.\n\n Examples\n --------\n > var bool = hasSetSupport()\n <boolean>\n\n",
"hasSharedArrayBufferSupport": "\nhasSharedArrayBufferSupport()\n Tests for native `SharedArrayBuffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `SharedArrayBuffer` support.\n\n Examples\n --------\n > var bool = hasSharedArrayBufferSupport()\n <boolean>\n\n See Also\n --------\n hasArrayBufferSupport, hasFloat32ArraySupport, hasFloat64ArraySupport, hasInt16ArraySupport, hasInt32ArraySupport, hasInt8ArraySupport, hasNodeBufferSupport, hasUint16ArraySupport, hasUint32ArraySupport, hasUint8ArraySupport, hasUint8ClampedArraySupport\n",
"hasSymbolSupport": "\nhasSymbolSupport()\n Tests for native `Symbol` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Symbol` support.\n\n Examples\n --------\n > var bool = hasSymbolSupport()\n <boolean>\n\n See Also\n --------\n hasIteratorSymbolSupport\n",
"hasToStringTagSupport": "\nhasToStringTagSupport()\n Tests for native `toStringTag` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `toStringTag` support.\n\n Examples\n --------\n > var bool = hasToStringTagSupport()\n <boolean>\n\n",
"hasUint8ArraySupport": "\nhasUint8ArraySupport()\n Tests for native `Uint8Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint8Array` support.\n\n Examples\n --------\n > var bool = hasUint8ArraySupport()\n <boolean>\n\n",
"hasUint8ClampedArraySupport": "\nhasUint8ClampedArraySupport()\n Tests for native `Uint8ClampedArray` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint8ClampedArray` support.\n\n Examples\n --------\n > var bool = hasUint8ClampedArraySupport()\n <boolean>\n\n",
"hasUint16ArraySupport": "\nhasUint16ArraySupport()\n Tests for native `Uint16Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint16Array` support.\n\n Examples\n --------\n > var bool = hasUint16ArraySupport()\n <boolean>\n\n",
"hasUint32ArraySupport": "\nhasUint32ArraySupport()\n Tests for native `Uint32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint32Array` support.\n\n Examples\n --------\n > var bool = hasUint32ArraySupport()\n <boolean>\n\n",
"hasWeakMapSupport": "\nhasWeakMapSupport()\n Tests for native `WeakMap` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `WeakMap` support.\n\n Examples\n --------\n > var bool = hasWeakMapSupport()\n <boolean>\n\n",
"hasWeakSetSupport": "\nhasWeakSetSupport()\n Tests for native `WeakSet` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `WeakSet` support.\n\n Examples\n --------\n > var bool = hasWeakSetSupport()\n <boolean>\n\n",
"hasWebAssemblySupport": "\nhasWebAssemblySupport()\n Tests for native WebAssembly support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native WebAssembly support.\n\n Examples\n --------\n > var bool = hasWebAssemblySupport()\n <boolean>\n\n",
"HERNDON_VENUS_SEMIDIAMETERS": "\nHERNDON_VENUS_SEMIDIAMETERS()\n Returns fifteen observations of the vertical semidiameter of Venus, made by\n Lieutenant Herndon, with the meridian circle at Washington, in the year\n 1846.\n\n This dataset is a classic dataset commonly used in examples demonstrating\n outlier detection.\n\n Returns\n -------\n out: Array<number>\n Observations.\n\n Examples\n --------\n > var d = HERNDON_VENUS_SEMIDIAMETERS()\n [ -0.30, -0.44, ..., 0.39, 0.10 ]\n\n References\n ----------\n - Chauvenet, William. 1868. _A Manual of Spherical and Practical Astronomy_.\n 5th ed. Vol. 5. London, England: Trübner & Co.\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n - Tietjen, Gary L., and Roger H. Moore. 1972. \"Some Grubbs-Type Statistics\n for the Detection of Several Outliers.\" _Technometrics_ 14 (3). Taylor &\n Francis: 583–97. doi:10.1080/00401706.1972.10488948.\n\n",
"homedir": "\nhomedir()\n Returns the current user's home directory.\n\n If unable to locate a home directory, the function returns `null`.\n\n Returns\n -------\n out: string|null\n Home directory.\n\n Examples\n --------\n > var home = homedir()\n e.g., '/Users/<username>'\n\n See Also\n --------\n configdir, tmpdir\n",
"HOURS_IN_DAY": "\nHOURS_IN_DAY\n Number of hours in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var hrs = days * HOURS_IN_DAY\n 75.36\n\n See Also\n --------\n HOURS_IN_WEEK\n",
"HOURS_IN_WEEK": "\nHOURS_IN_WEEK\n Number of hours in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var hrs = wks * HOURS_IN_WEEK\n 527.52\n\n See Also\n --------\n HOURS_IN_DAY\n",
"hoursInMonth": "\nhoursInMonth( [month[, year]] )\n Returns the number of hours in a month.\n\n By default, the function returns the number of hours in the current month of\n the current year (according to local time). To determine the number of hours\n for a particular month and year, provide `month` and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Hours in a month.\n\n Examples\n --------\n > var num = hoursInMonth()\n <number>\n > num = hoursInMonth( 2 )\n <number>\n > num = hoursInMonth( 2, 2016 )\n 696\n > num = hoursInMonth( 2, 2017 )\n 672\n\n // Other ways to supply month:\n > num = hoursInMonth( 'feb', 2016 )\n 696\n > num = hoursInMonth( 'february', 2016 )\n 696\n\n See Also\n --------\n hoursInYear\n",
"hoursInYear": "\nhoursInYear( [value] )\n Returns the number of hours in a year according to the Gregorian calendar.\n\n By default, the function returns the number of hours in the current year\n (according to local time). To determine the number of hours for a particular\n year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of hours in a year.\n\n Examples\n --------\n > var num = hoursInYear()\n <number>\n > num = hoursInYear( 2016 )\n 8784\n > num = hoursInYear( 2017 )\n 8760\n\n See Also\n --------\n hoursInMonth\n",
"httpServer": "\nhttpServer( [options,] [requestListener] )\n Returns a function to create an HTTP server.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.port: integer (optional)\n Server port. Default: `0` (i.e., randomly assigned).\n\n options.maxport: integer (optional)\n Max server port when port hunting. Default: `maxport = port`.\n\n options.hostname: string (optional)\n Server hostname.\n\n options.address: string (optional)\n Server address. Default: `'127.0.0.1'`.\n\n requestListener: Function (optional)\n Request callback.\n\n Returns\n -------\n createServer: Function\n Function to create an HTTP server.\n\n Examples\n --------\n // Basic usage:\n > var createServer = httpServer()\n <Function>\n\n // Provide a request callback:\n > function onRequest( request, response ) {\n ... console.log( request.url );\n ... response.end( 'OK' );\n ... };\n > createServer = httpServer( onRequest )\n <Function>\n\n // Specify a specific port:\n > var opts = { 'port': 7331 };\n > createServer = httpServer( opts )\n <Function>\n\n\ncreateServer( done )\n Creates an HTTP server.\n\n Parameters\n ----------\n done: Function\n Callback to invoke after creating a server.\n\n Examples\n --------\n > function done( error, server ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Success!' );\n ... server.close();\n ... };\n > var createServer = httpServer();\n > createServer( done );\n\n",
"identity": "\nidentity( x )\n Identity function.\n\n Parameters\n ----------\n x: any\n Input value.\n\n Returns\n -------\n out: any\n Input value.\n\n Examples\n --------\n > var v = identity( 3.14 )\n 3.14\n\n See Also\n --------\n constantFunction\n",
"ifelse": "\nifelse( bool, x, y )\n If a condition is truthy, returns `x`; otherwise, returns `y`.\n\n Parameters\n ----------\n bool: boolean\n Condition.\n\n x: any\n Value to return if a condition is truthy.\n\n y: any\n Value to return if a condition is falsy.\n\n Returns\n -------\n z: any\n Either `x` or `y`.\n\n Examples\n --------\n > var z = ifelse( true, 1.0, -1.0 )\n 1.0\n > z = ifelse( false, 1.0, -1.0 )\n -1.0\n\n See Also\n --------\n ifelseAsync, ifthen\n",
"ifelseAsync": "\nifelseAsync( predicate, x, y, done )\n If a predicate function returns a truthy value, returns `x`; otherwise,\n returns `y`.\n\n A predicate function is provided a single argument:\n\n - clbk: callback to invoke upon predicate completion\n\n The callback function accepts two arguments:\n\n - error: error object\n - bool: condition used to determine whether to invoke `x` or `y`\n\n The `done` callback is invoked upon function completion and is provided at\n most two arguments:\n\n - error: error object\n - result: either `x` or `y`\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n Predicate function.\n\n x: any\n Value to return if a condition is truthy.\n\n y: any\n Value to return if a condition is falsy.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function predicate( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, true );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > ifelseAsync( predicate, 'beep', 'boop', done )\n 'beep'\n\n See Also\n --------\n ifelse, ifthenAsync\n",
"ifthen": "\nifthen( bool, x, y )\n If a condition is truthy, invoke `x`; otherwise, invoke `y`.\n\n Parameters\n ----------\n bool: boolean\n Condition.\n\n x: Function\n Function to invoke if a condition is truthy.\n\n y: Function\n Function to invoke if a condition is falsy.\n\n Returns\n -------\n z: any\n Return value of either `x` or `y`.\n\n Examples\n --------\n > function x() { return 1.0; };\n > function y() { return -1.0; };\n > var z = ifthen( true, x, y )\n 1.0\n > z = ifthen( false, x, y )\n -1.0\n\n See Also\n --------\n ifelse, ifthenAsync\n",
"ifthenAsync": "\nifthenAsync( predicate, x, y, done )\n If a predicate function returns a truthy value, invokes `x`; otherwise,\n invokes `y`.\n\n The predicate function is provided a single argument:\n\n - clbk: callback to invoke upon predicate function completion\n\n The predicate function callback accepts two arguments:\n\n - error: error object\n - bool: condition used to determine whether to invoke `x` or `y`\n\n Both `x` and `y` are provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the `done` callback is invoked with its\n first argument as `null` and all other provided arguments.\n\n If the error argument is truthy, the `done` callback is invoked with only an\n error argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n Predicate function.\n\n x: Function\n Function to invoke if a condition is truthy.\n\n y: Function\n Function to invoke if a condition is falsy.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function predicate( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, false );\n ... }\n ... };\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'beep' );\n ... }\n ... };\n > function y( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'boop' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > ifthenAsync( predicate, x, y, done )\n 'boop'\n\n See Also\n --------\n ifelseAsync, ifthen\n",
"imag": "\nimag( z )\n Returns the imaginary component of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n im: number\n Imaginary component.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var im = imag( z )\n 3.0\n\n See Also\n --------\n real, reim\n",
"IMG_ACANTHUS_MOLLIS": "\nIMG_ACANTHUS_MOLLIS()\n Returns a `Buffer` containing image data of Karl Blossfeldt's gelatin silver\n print *Acanthus mollis*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_ACANTHUS_MOLLIS()\n <Buffer>\n\n References\n ----------\n - Blossfeldt, Karl. 1928. *Acanthus mollis*. <http://www.getty.edu/art/\n collection/objects/35443/karl-blossfeldt-acanthus-mollis-german-1928/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_ALLIUM_OREOPHILUM\n",
"IMG_AIRPLANE_FROM_ABOVE": "\nIMG_AIRPLANE_FROM_ABOVE()\n Returns a `Buffer` containing image data of Fédèle Azari's gelatin silver\n print of an airplane, viewed from above looking down.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_AIRPLANE_FROM_ABOVE()\n <Buffer>\n\n References\n ----------\n - Azari, Fédèle. 1929. (no title). <http://www.getty.edu/art/collection/\n objects/134512/fedele-azari-airplane-viewed-from-above-looking-down-italian-\n 1914-1929/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_ALLIUM_OREOPHILUM": "\nIMG_ALLIUM_OREOPHILUM()\n Returns a `Buffer` containing image data of Karl Blossfeldt's gelatin silver\n print *Allium ostrowskianum*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_ALLIUM_OREOPHILUM()\n <Buffer>\n\n References\n ----------\n - Blossfeldt, Karl. 1928. *Allium ostrowskianum*. <http://www.getty.edu/art/\n collection/objects/35448/karl-blossfeldt-allium-ostrowskianum-\n knoblauchpflanze-german-1928/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_ACANTHUS_MOLLIS\n",
"IMG_BLACK_CANYON": "\nIMG_BLACK_CANYON()\n Returns a `Buffer` containing image data of Timothy H. O'Sullivan's albumen\n silver print *Black Cañon, Colorado River, From Camp 8, Looking Above*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_BLACK_CANYON()\n <Buffer>\n\n References\n ----------\n - O'Sullivan, Timothy H. 1871. *Black Cañon, Colorado River, From Camp 8,\n Looking Above*. <http://www.getty.edu/art/collection/objects/40209/timothy-\n h-o'sullivan-black-canon-colorado-river-from-camp-8-looking-above-american-\n 1871/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_DUST_BOWL_HOME": "\nIMG_DUST_BOWL_HOME()\n Returns a `Buffer` containing image data of Dorothea Lange's gelatin silver\n print of an abandoned Dust Bowl home.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_DUST_BOWL_HOME()\n <Buffer>\n\n References\n ----------\n - Lange, Dorothea. 1940. *Abandoned Dust Bowl Home*. <http://www.getty.edu/\n art/collection/objects/128362/dorothea-lange-abandoned-dust-bowl-home-\n american-about-1935-1940/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_FRENCH_ALPINE_LANDSCAPE": "\nIMG_FRENCH_ALPINE_LANDSCAPE()\n Returns a `Buffer` containing image data of Adolphe Braun's carbon print of\n a French alpine landscape.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_FRENCH_ALPINE_LANDSCAPE()\n <Buffer>\n\n References\n ----------\n - Braun, Adolphe. 1870. (no title). <http://www.getty.edu/art/collection/\n objects/54324/adolphe-braun-alpine-landscape-french-1865-1870/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_LOCOMOTION_HOUSE_CAT": "\nIMG_LOCOMOTION_HOUSE_CAT()\n Returns a `Buffer` containing image data of Eadweard J. Muybridge's\n collotype of a house cat (24 views).\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_LOCOMOTION_HOUSE_CAT()\n <Buffer>\n\n References\n ----------\n - Muybridge, Eadweard J. 1887. *Animal Locomotion*. <http://www.getty.edu/\n art/collection/objects/40918/eadweard-j-muybridge-animal-locomotion-american\n -1887/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_LOCOMOTION_NUDE_MALE\n",
"IMG_LOCOMOTION_NUDE_MALE": "\nIMG_LOCOMOTION_NUDE_MALE()\n Returns a `Buffer` containing image data of Eadweard J. Muybridge's\n collotype of a nude male moving in place (48 views).\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_LOCOMOTION_NUDE_MALE()\n <Buffer>\n\n References\n ----------\n - Muybridge, Eadweard J. 1887. *Animal Locomotion*. <http://www.getty.edu/\n art/collection/objects/40918/eadweard-j-muybridge-animal-locomotion-american\n -1887/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_LOCOMOTION_HOUSE_CAT\n",
"IMG_MARCH_PASTORAL": "\nIMG_MARCH_PASTORAL()\n Returns a `Buffer` containing image data of Peter Henry Emerson's\n photogravure of sheep in a pastoral setting.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_MARCH_PASTORAL()\n <Buffer>\n\n References\n ----------\n - Emerson, Peter Henry. 1888. *A March Pastoral*. <http://www.getty.edu/art/\n collection/objects/141994/peter-henry-emerson-a-march-pastoral-suffolk-\n british-1888/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_NAGASAKI_BOATS": "\nIMG_NAGASAKI_BOATS()\n Returns a `Buffer` containing image data of Felice Beato's albumen silver\n print of boats in a river in Nagasaki.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_NAGASAKI_BOATS()\n <Buffer>\n\n References\n ----------\n - Beato, Felice. 1865. (no title). <http://www.getty.edu/art/collection/\n objects/241797/felice-beato-boats-in-river-nagasaki-british-about-1865/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"incrapcorr": "\nincrapcorr( [mx, my] )\n Returns an accumulator function which incrementally computes the absolute\n value of the sample Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated accumulated\n value. If not provided values, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrapcorr();\n > var ar = accumulator()\n null\n > ar = accumulator( 2.0, 1.0 )\n 0.0\n > ar = accumulator( -5.0, 3.14 )\n ~1.0\n > ar = accumulator()\n ~1.0\n\n See Also\n --------\n incrmapcorr, incrpcorr, incrpcorr2\n",
"incrcount": "\nincrcount()\n Returns an accumulator function which incrementally updates a count.\n\n If provided a value, the accumulator function returns an updated count. If\n not provided a value, the accumulator function returns the current count.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcount();\n > var v = accumulator()\n 0\n > v = accumulator( 2.0 )\n 1\n > v = accumulator( -5.0 )\n 2\n > v = accumulator()\n 2\n\n See Also\n --------\n incrmean, incrsum, incrsummary\n",
"incrcovariance": "\nincrcovariance( [mx, my] )\n Returns an accumulator function which incrementally computes an unbiased\n sample covariance.\n\n If provided values, the accumulator function returns an updated unbiased\n sample covariance. If not provided values, the accumulator function returns\n the current unbiased sample covariance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcovariance();\n > var v = accumulator()\n null\n > v = accumulator( 2.0, 1.0 )\n 0.0\n > v = accumulator( -5.0, 3.14 )\n ~-7.49\n > v = accumulator()\n ~-7.49\n\n See Also\n --------\n incrmcovariance, incrpcorr, incrvariance\n",
"incrcovmat": "\nincrcovmat( out[, means] )\n Returns an accumulator function which incrementally computes an unbiased\n sample covariance matrix.\n\n If provided a data vector, the accumulator function returns an updated\n unbiased sample covariance matrix. If not provided a data vector, the\n accumulator function returns the current unbiased sample covariance matrix.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the covariance matrix or a square 2-dimensional ndarray for\n storing the covariance matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcovmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrcovariance, incrpcorrmat\n",
"incrcv": "\nincrcv( [mean] )\n Returns an accumulator function which incrementally computes the coefficient\n of variation (CV).\n\n If provided a value, the accumulator function returns an updated accumulated\n value. If not provided a value, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcv();\n > var cv = accumulator()\n null\n > cv = accumulator( 2.0 )\n 0.0\n > cv = accumulator( 1.0 )\n ~0.47\n > cv = accumulator()\n ~0.47\n\n See Also\n --------\n incrmean, incrmcv, incrstdev, incrvmr\n",
"increwmean": "\nincrewmean( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted mean, where α is a smoothing factor between 0 and 1.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwmean( 0.5 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( -5.0 )\n -1.5\n > v = accumulator()\n -1.5\n\n See Also\n --------\n increwvariance, incrmean, incrmmean\n",
"increwstdev": "\nincrewstdev( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted standard deviation, where α is a smoothing factor\n between 0 and 1.\n\n If provided a value, the accumulator function returns an updated standard\n deviation. If not provided a value, the accumulator function returns the\n current standard deviation.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwstdev( 0.5 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n 3.5\n > s = accumulator()\n 3.5\n\n See Also\n --------\n increwvariance, incrmstdev, incrstdev\n",
"increwvariance": "\nincrewvariance( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted variance, where α is a smoothing factor between 0 and\n 1.\n\n If provided a value, the accumulator function returns an updated variance.\n If not provided a value, the accumulator function returns the current\n variance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwvariance( 0.5 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 0.0\n > v = accumulator( -5.0 )\n 12.25\n > v = accumulator()\n 12.25\n\n See Also\n --------\n increwmean, increwstdev, incrvariance, incrmvariance\n",
"incrgmean": "\nincrgmean()\n Returns an accumulator function which incrementally computes a geometric\n mean.\n\n If provided a value, the accumulator function returns an updated geometric\n mean. If not provided a value, the accumulator function returns the current\n geometric mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n If provided a negative value, the accumulated value is `NaN` for all future\n invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrgmean();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~3.16\n > v = accumulator()\n ~3.16\n\n See Also\n --------\n incrhmean, incrmean, incrmgmean, incrsummary\n",
"incrgrubbs": "\nincrgrubbs( [options] )\n Returns an accumulator function which incrementally performs Grubbs' test\n for detecting outliers.\n\n Grubbs' test assumes that data is normally distributed. Accordingly, one\n should first verify that the data can be reasonably approximated by a normal\n distribution before applying the Grubbs' test.\n\n If provided a value, the accumulator function returns updated test results.\n If not provided a value, the accumulator function returns the current test\n results.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the test statistic is `NaN` for all future invocations.\n\n The accumulator must be provided *at least* three data points before\n performing Grubbs' test. Until at least three data points are provided, the\n accumulator returns `null`.\n\n The accumulator function returns an object having the following fields:\n\n - rejected: boolean indicating whether the null hypothesis should be\n rejected.\n - alpha: significance level.\n - criticalValue: critical value.\n - statistic: test statistic.\n - df: degrees of freedom.\n - mean: sample mean.\n - sd: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - alt: alternative hypothesis.\n - method: method name.\n - print: method for pretty-printing test output.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Significance level. Default: 0.05.\n\n options.alternative: string (optional)\n Alternative hypothesis. The option may be one of the following values:\n\n - 'two-sided': test whether the minimum or maximum value is an outlier.\n - 'min': test whether the minimum value is an outlier.\n - 'max': test whether the maximum value is an outlier.\n\n Default: 'two-sided'.\n\n options.init: integer (optional)\n Number of data points the accumulator should use to compute initial\n statistics *before* testing for an outlier. Until the accumulator is\n provided the number of data points specified by this option, the\n accumulator returns `null`. Default: 100.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var acc = incrgrubbs();\n > var res = acc()\n null\n > for ( var i = 0; i < 200; i++ ) {\n ... res = acc( base.random.normal( 10.0, 5.0 ) );\n ... };\n > res.print()\n\n References\n ----------\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n\n See Also\n --------\n incrmgrubbs\n",
"incrhmean": "\nincrhmean()\n Returns an accumulator function which incrementally computes a harmonic\n mean.\n\n If provided a value, the accumulator function returns an updated harmonic\n mean. If not provided a value, the accumulator function returns the current\n harmonic mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrhmean();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~2.86\n > v = accumulator()\n ~2.86\n\n See Also\n --------\n incrgmean, incrmean, incrmhmean, incrsummary\n",
"incrkmeans": "\nincrkmeans( k[, ndims][, options] )\n Returns an accumulator function which incrementally partitions data into `k`\n clusters.\n\n If not provided initial centroids, the accumulator caches data vectors for\n subsequent centroid initialization. Until an accumulator computes initial\n centroids, an accumulator returns `null`.\n\n Once an accumulator has initial centroids (either provided or computed), if\n provided a data vector, the accumulator function returns updated cluster\n results. If not provided a data vector, the accumulator function returns the\n current cluster results.\n\n Cluster results are comprised of the following:\n\n - centroids: a `k x ndims` matrix containing centroid locations. Each\n centroid is the component-wise mean of the data points assigned to a\n centroid's corresponding cluster.\n - stats: a `k x 4` matrix containing cluster statistics.\n\n Cluster statistics consists of the following columns:\n\n - 0: number of data points assigned to a cluster.\n - 1: total within-cluster sum of squared distances.\n - 2: arithmetic mean of squared distances.\n - 3: corrected sample standard deviation of squared distances.\n\n Because an accumulator incrementally partitions data, one should *not*\n expect cluster statistics to match similar statistics had provided data been\n analyzed via a batch algorithm. In an incremental context, data points which\n would not be considered part of a particular cluster when analyzed via a\n batch algorithm may contribute to that cluster's statistics when analyzed\n incrementally.\n\n In general, the more data provided to an accumulator, the more reliable the\n cluster statistics.\n\n Parameters\n ----------\n k: integer|ndarray\n Number of clusters or a `k x ndims` matrix containing initial centroids.\n\n ndims: integer (optional)\n Number of dimensions. This argument must accompany an integer-valued\n first argument.\n\n options: Object (optional)\n Function options.\n\n options.metric: string (optional)\n Distance metric. Must be one of the following: 'euclidean', 'cosine', or\n 'correlation'. Default: 'euclidean'.\n\n options.init: ArrayLike (optional)\n Centroid initialization method and associated (optional) parameters. The\n first array element specifies the initialization method and must be one\n of the following: 'kmeans++', 'sample', or 'forgy'. The second array\n element specifies the number of data points to use when calculating\n initial centroids. When performing kmeans++ initialization, the third\n array element specifies the number of trials to perform when randomly\n selecting candidate centroids. Typically, more trials is correlated with\n initial centroids which lead to better clustering; however, a greater\n number of trials increases computational overhead. Default: ['kmeans++',\n k, 2+⌊ln(k)⌋ ].\n\n options.normalize: boolean (optional)\n Boolean indicating whether to normalize incoming data. This option is\n only relevant for non-Euclidean distance metrics. If set to `true`, an\n accumulator partitioning data based on cosine distance normalizes\n provided data to unit Euclidean length. If set to `true`, an accumulator\n partitioning data based on correlation distance first centers provided\n data and then normalizes data dimensions to have zero mean and unit\n variance. If this option is set to `false` and the metric is either\n cosine or correlation distance, then incoming data *must* already be\n normalized. Default: true.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy incoming data to prevent mutation\n during normalization. Default: true.\n\n options.seed: any (optional)\n PRNG seed. Setting this option is useful when wanting reproducible\n initial centroids.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n acc.predict: Function\n Predicts centroid assignment for each data point in a provided matrix.\n To specify an output vector, provide a 1-dimensional ndarray as the\n first argument. Each element in the returned vector corresponds to a\n predicted cluster index for a respective data point.\n\n Examples\n --------\n > var accumulator = incrkmeans( 5, 2 );\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v );\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v );\n\n",
"incrkurtosis": "\nincrkurtosis()\n Returns an accumulator function which incrementally computes a corrected\n sample excess kurtosis.\n\n If provided a value, the accumulator function returns an updated corrected\n sample excess kurtosis. If not provided a value, the accumulator function\n returns the current corrected sample excess kurtosis.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrkurtosis();\n > var v = accumulator( 2.0 )\n null\n > v = accumulator( 2.0 )\n null\n > v = accumulator( -4.0 )\n null\n > v = accumulator( -4.0 )\n -6.0\n\n See Also\n --------\n incrmean, incrskewness, incrstdev, incrsummary, incrvariance\n",
"incrmaape": "\nincrmaape()\n Returns an accumulator function which incrementally computes the mean\n arctangent absolute percentage error (MAAPE).\n\n If provided input values, the accumulator function returns an updated mean\n arctangent absolute percentage error. If not provided input values, the\n accumulator function returns the current mean arctangent absolute percentage\n error.\n\n Note that, unlike the mean absolute percentage error (MAPE), the mean\n arctangent absolute percentage error is expressed in radians on the interval\n [0,π/2].\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmaape();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~0.3218\n > m = accumulator( 5.0, 2.0 )\n ~0.6523\n > m = accumulator()\n ~0.6523\n\n See Also\n --------\n incrmae, incrmape, incrmean, incrmmaape\n",
"incrmae": "\nincrmae()\n Returns an accumulator function which incrementally computes the mean\n absolute error (MAE).\n\n If provided input values, the accumulator function returns an updated mean\n absolute error. If not provided input values, the accumulator function\n returns the current mean absolute error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmae();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator()\n 4.0\n\n See Also\n --------\n incrmape, incrme, incrmean, incrmmae\n",
"incrmapcorr": "\nincrmapcorr( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample absolute Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample absolute correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n sample absolute correlation coefficient. If not provided values, the\n accumulator function returns the current moving sample absolute correlation\n coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmapcorr( 3 );\n > var ar = accumulator()\n null\n > ar = accumulator( 2.0, 1.0 )\n 0.0\n > ar = accumulator( -5.0, 3.14 )\n ~1.0\n > ar = accumulator( 3.0, -1.0 )\n ~0.925\n > ar = accumulator( 5.0, -9.5 )\n ~0.863\n > ar = accumulator()\n ~0.863\n\n See Also\n --------\n incrapcorr, incrmpcorr, incrmpcorr2\n",
"incrmape": "\nincrmape()\n Returns an accumulator function which incrementally computes the mean\n absolute percentage error (MAPE).\n\n If provided input values, the accumulator function returns an updated mean\n absolute percentage error. If not provided input values, the accumulator\n function returns the current mean absolute percentage error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmape();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~91.67\n > m = accumulator()\n ~91.67\n\n See Also\n --------\n incrmaape, incrmae, incrmean, incrmmape\n",
"incrmax": "\nincrmax()\n Returns an accumulator function which incrementally computes a maximum\n value.\n\n If provided a value, the accumulator function returns an updated maximum\n value. If not provided a value, the accumulator function returns the current\n maximum value.\n\n If provided `NaN`, the maximum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmax();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 3.14\n > m = accumulator( 10.1 )\n 10.1\n > m = accumulator()\n 10.1\n\n See Also\n --------\n incrmidrange, incrmin, incrmmax, incrrange, incrsummary\n",
"incrmaxabs": "\nincrmaxabs()\n Returns an accumulator function which incrementally computes a maximum\n absolute value.\n\n If provided a value, the accumulator function returns an updated maximum\n absolute value. If not provided a value, the accumulator function returns\n the current maximum absolute value.\n\n If provided `NaN`, the maximum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmaxabs();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 5.0\n > m = accumulator( 10.1 )\n 10.1\n > m = accumulator()\n 10.1\n\n See Also\n --------\n incrmax, incrminabs, incrmmaxabs\n",
"incrmcovariance": "\nincrmcovariance( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n unbiased sample covariance.\n\n The `W` parameter defines the number of values over which to compute the\n moving unbiased sample covariance.\n\n If provided values, the accumulator function returns an updated moving\n unbiased sample covariance. If not provided values, the accumulator function\n returns the current moving unbiased sample covariance.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmcovariance( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0, 1.0 )\n 0.0\n > v = accumulator( -5.0, 3.14 )\n ~-7.49\n > v = accumulator( 3.0, -1.0 )\n -8.35\n > v = accumulator( 5.0, -9.5 )\n -29.42\n > v = accumulator()\n -29.42\n\n See Also\n --------\n incrcovariance, incrmpcorr, incrmvariance\n",
"incrmcv": "\nincrmcv( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n coefficient of variation (CV).\n\n The `W` parameter defines the number of values over which to compute the\n moving coefficient of variation.\n\n If provided a value, the accumulator function returns an updated moving\n coefficient of variation. If not provided a value, the accumulator function\n returns the current moving coefficient of variation.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmcv( 3 );\n > var cv = accumulator()\n null\n > cv = accumulator( 2.0 )\n 0.0\n > cv = accumulator( 1.0 )\n ~0.47\n > cv = accumulator( 3.0 )\n 0.5\n > cv = accumulator( 7.0 )\n ~0.83\n > cv = accumulator()\n ~0.83\n\n See Also\n --------\n incrcv, incrmmean, incrmstdev, incrmvmr\n",
"incrmda": "\nincrmda()\n Returns an accumulator function which incrementally computes the mean\n directional accuracy (MDA).\n\n If provided input values, the accumulator function returns an updated mean\n directional accuracy. If not provided input values, the accumulator function\n returns the current mean directional accuracy.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmda();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 4.0 )\n 0.5\n > m = accumulator()\n 0.5\n\n See Also\n --------\n incrmape, incrmmda\n",
"incrme": "\nincrme()\n Returns an accumulator function which incrementally computes the mean error\n (ME).\n\n If provided input values, the accumulator function returns an updated mean\n error. If not provided input values, the accumulator function returns the\n current mean error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrme();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator()\n 4.0\n\n See Also\n --------\n incrmae, incrmean, incrmme\n",
"incrmean": "\nincrmean()\n Returns an accumulator function which incrementally computes an arithmetic\n mean.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmean();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n -1.5\n > mu = accumulator()\n -1.5\n\n See Also\n --------\n incrmidrange, incrmmean, incrstdev, incrsum, incrsummary, incrvariance\n",
"incrmeanabs": "\nincrmeanabs()\n Returns an accumulator function which incrementally computes an arithmetic\n mean of absolute values.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanabs();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n 3.5\n > mu = accumulator()\n 3.5\n\n See Also\n --------\n incrmean, incrmmeanabs, incrsumabs\n",
"incrmeanabs2": "\nincrmeanabs2()\n Returns an accumulator function which incrementally computes an arithmetic\n mean of squared absolute values.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanabs2();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 4.0\n > mu = accumulator( -5.0 )\n 14.5\n > mu = accumulator()\n 14.5\n\n See Also\n --------\n incrmean, incrmeanabs, incrmmeanabs2, incrsumabs2\n",
"incrmeanstdev": "\nincrmeanstdev( [out] )\n Returns an accumulator function which incrementally computes an arithmetic\n mean and corrected sample standard deviation.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current accumulated values.\n\n If provided `NaN`, the accumulated values are equal to `NaN` for all future\n invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanstdev();\n > var ms = accumulator()\n null\n > ms = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > ms = accumulator( -5.0 )\n [ -1.5, ~4.95 ]\n > ms = accumulator( 3.0 )\n [ 0.0, ~4.36 ]\n > ms = accumulator( 5.0 )\n [ 1.25, ~4.35 ]\n > ms = accumulator()\n [ 1.25, ~4.35 ]\n\n See Also\n --------\n incrmean, incrmeanvar, incrmmeanstdev, incrstdev\n",
"incrmeanvar": "\nincrmeanvar( [out] )\n Returns an accumulator function which incrementally computes an arithmetic\n mean and unbiased sample variance.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current accumulated values.\n\n If provided `NaN`, the accumulated values are equal to `NaN` for all future\n invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanvar();\n > var mv = accumulator()\n null\n > mv = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > mv = accumulator( -5.0 )\n [ -1.5, 24.5 ]\n > mv = accumulator( 3.0 )\n [ 0.0, 19.0 ]\n > mv = accumulator( 5.0 )\n [ 1.25, ~18.92 ]\n > mv = accumulator()\n [ 1.25, ~18.92 ]\n\n See Also\n --------\n incrmean, incrmeanstdev, incrmmeanvar, incrvariance\n",
"incrmgmean": "\nincrmgmean( W )\n Returns an accumulator function which incrementally computes a moving\n geometric mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving geometric mean.\n\n If provided a value, the accumulator function returns an updated moving\n geometric mean. If not provided a value, the accumulator function returns\n the current moving geometric mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmgmean( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~3.16\n > v = accumulator( 3.0 )\n ~3.11\n > v = accumulator( 5.0 )\n ~4.22\n > v = accumulator()\n ~4.22\n\n See Also\n --------\n incrgmean, incrmhmean, incrmmean\n",
"incrmgrubbs": "\nincrmgrubbs( W[, options] )\n Returns an accumulator function which incrementally performs a moving\n Grubbs' test for detecting outliers.\n\n Grubbs' test assumes that data is normally distributed. Accordingly, one\n should first verify that the data can be reasonably approximated by a normal\n distribution before applying the Grubbs' test.\n\n The `W` parameter defines the number of values over which to perform Grubbs'\n test. The minimum window size is 3.\n\n If provided a value, the accumulator function returns updated test results.\n If not provided a value, the accumulator function returns the current test\n results.\n\n Until provided `W` values, the accumulator function returns `null`.\n\n The accumulator function returns an object having the following fields:\n\n - rejected: boolean indicating whether the null hypothesis should be\n rejected.\n - alpha: significance level.\n - criticalValue: critical value.\n - statistic: test statistic.\n - df: degrees of freedom.\n - mean: sample mean.\n - sd: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - alt: alternative hypothesis.\n - method: method name.\n - print: method for pretty-printing test output.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Significance level. Default: 0.05.\n\n options.alternative: string (optional)\n Alternative hypothesis. The option may be one of the following values:\n\n - 'two-sided': test whether the minimum or maximum value is an outlier.\n - 'min': test whether the minimum value is an outlier.\n - 'max': test whether the maximum value is an outlier.\n\n Default: 'two-sided'.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var acc = incrmgrubbs( 20 );\n > var res = acc()\n null\n > for ( var i = 0; i < 200; i++ ) {\n ... res = acc( base.random.normal( 10.0, 5.0 ) );\n ... };\n > res.print()\n\n References\n ----------\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n\n See Also\n --------\n incrgrubbs\n",
"incrmhmean": "\nincrmhmean( W )\n Returns an accumulator function which incrementally computes a moving\n harmonic mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving harmonic mean.\n\n If provided a value, the accumulator function returns an updated moving\n harmonic mean. If not provided a value, the accumulator function returns the\n current moving harmonic mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmhmean( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~2.86\n > v = accumulator( 3.0 )\n ~2.90\n > v = accumulator( 5.0 )\n ~4.09\n > v = accumulator()\n ~4.09\n\n See Also\n --------\n incrhmean, incrmgmean, incrmmean\n",
"incrmidrange": "\nincrmidrange()\n Returns an accumulator function which incrementally computes a mid-range.\n\n The mid-range is the arithmetic mean of maximum and minimum values.\n Accordingly, the mid-range is the midpoint of the range and a measure of\n central tendency.\n\n If provided a value, the accumulator function returns an updated mid-range.\n If not provided a value, the accumulator function returns the current mid-\n range.\n\n If provided `NaN`, the mid-range is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmidrange();\n > var v = accumulator()\n null\n > v = accumulator( 3.14 )\n 3.14\n > v = accumulator( -5.0 )\n ~-0.93\n > v = accumulator( 10.1 )\n 2.55\n > v = accumulator()\n 2.55\n\n See Also\n --------\n incrmean, incrmax, incrmin, incrrange, incrsummary\n",
"incrmin": "\nincrmin()\n Returns an accumulator function which incrementally computes a minimum\n value.\n\n If provided a value, the accumulator function returns an updated minimum\n value. If not provided a value, the accumulator function returns the current\n minimum value.\n\n If provided `NaN`, the minimum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmin();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n -5.0\n > m = accumulator( 10.1 )\n -5.0\n > m = accumulator()\n -5.0\n\n See Also\n --------\n incrmax, incrmidrange, incrmmin, incrrange, incrsummary\n",
"incrminabs": "\nincrminabs()\n Returns an accumulator function which incrementally computes a minimum\n absolute value.\n\n If provided a value, the accumulator function returns an updated minimum\n absolute value. If not provided a value, the accumulator function returns\n the current minimum absolute value.\n\n If provided `NaN`, the minimum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminabs();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 3.14\n > m = accumulator( 10.1 )\n 3.14\n > m = accumulator()\n 3.14\n\n See Also\n --------\n incrmaxabs, incrmin, incrmminabs\n",
"incrminmax": "\nincrminmax( [out] )\n Returns an accumulator function which incrementally computes a minimum and\n maximum.\n\n If provided a value, the accumulator function returns an updated minimum and\n maximum. If not provided a value, the accumulator function returns the\n current minimum and maximum.\n\n If provided `NaN`, the minimum and maximum values are equal to `NaN` for all\n future invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminmax();\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ -5.0, 2.0 ]\n > mm = accumulator( 3.0 )\n [ -5.0, 3.0 ]\n > mm = accumulator( 5.0 )\n [ -5.0, 5.0 ]\n > mm = accumulator()\n [ -5.0, 5.0 ]\n\n See Also\n --------\n incrmax, incrmin, incrmminmax, incrrange\n",
"incrminmaxabs": "\nincrminmaxabs( [out] )\n Returns an accumulator function which incrementally computes a minimum and\n maximum absolute value.\n\n If provided a value, the accumulator function returns an updated minimum and\n maximum. If not provided a value, the accumulator function returns the\n current minimum and maximum.\n\n If provided `NaN`, the minimum and maximum values are equal to `NaN` for all\n future invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminmaxabs();\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 3.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator()\n [ 2.0, 5.0 ]\n\n See Also\n --------\n incrmaxabs, incrminabs, incrminmax, incrmminmaxabs\n",
"incrmmaape": "\nincrmmaape( W )\n Returns an accumulator function which incrementally computes a moving\n mean arctangent absolute percentage error (MAAPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean arctangent absolute percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean arctangent absolute percentage error. If not provided input values, the\n accumulator function returns the current moving mean arctangent absolute\n percentage error.\n\n Note that, unlike the mean absolute percentage error (MAPE), the mean\n arctangent absolute percentage error is expressed in radians on the interval\n [0,π/2].\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmaape( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~0.32\n > m = accumulator( 5.0, 2.0 )\n ~0.65\n > m = accumulator( 3.0, 2.0 )\n ~0.59\n > m = accumulator( 2.0, 5.0 )\n ~0.66\n > m = accumulator()\n ~0.66\n\n See Also\n --------\n incrmaape, incrmmape, incrmmpe, incrmmean\n",
"incrmmae": "\nincrmmae( W )\n Returns an accumulator function which incrementally computes a moving\n mean absolute error (MAE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean absolute error.\n\n If provided a value, the accumulator function returns an updated moving\n mean absolute error. If not provided a value, the accumulator function\n returns the current moving mean absolute error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmae( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator( 3.0, 2.0 )\n 3.0\n > m = accumulator( 5.0, -2.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmae, incrmme, incrmmean\n",
"incrmmape": "\nincrmmape( W )\n Returns an accumulator function which incrementally computes a moving\n mean absolute percentage error (MAPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean absolute percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean absolute percentage error. If not provided input values, the\n accumulator function returns the current moving mean absolute percentage\n error.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmape( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~91.67\n > m = accumulator( 3.0, 2.0 )\n ~77.78\n > m = accumulator( 2.0, 5.0 )\n ~86.67\n > m = accumulator()\n ~86.67\n\n See Also\n --------\n incrmape, incrmmaape, incrmmpe, incrmmean\n",
"incrmmax": "\nincrmmax( W )\n Returns an accumulator function which incrementally computes a moving\n maximum value.\n\n The `W` parameter defines the number of values over which to compute the\n moving maximum.\n\n If provided a value, the accumulator function returns an updated moving\n maximum. If not provided a value, the accumulator function returns the\n current moving maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmax( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 2.0\n > m = accumulator( 3.0 )\n 3.0\n > m = accumulator( 5.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmax, incrmmidrange, incrmmin, incrmrange, incrmsummary\n",
"incrmmaxabs": "\nincrmmaxabs( W )\n Returns an accumulator function which incrementally computes a moving\n maximum absolute value.\n\n The `W` parameter defines the number of values over which to compute the\n moving maximum absolute value.\n\n If provided a value, the accumulator function returns an updated moving\n maximum absolute value. If not provided a value, the accumulator function\n returns the current moving maximum absolute value.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmaxabs( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 5.0\n > m = accumulator( 3.0 )\n 5.0\n > m = accumulator( 5.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmaxabs, incrmmax, incrmminabs\n",
"incrmmda": "\nincrmmda( W )\n Returns an accumulator function which incrementally computes a moving\n mean directional accuracy (MDA).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean directional accuracy.\n\n If provided input values, the accumulator function returns an updated moving\n mean directional accuracy. If not provided input values, the accumulator\n function returns the current moving mean directional accuracy.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmda( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( 5.0, 2.0 )\n 0.5\n > m = accumulator( 3.0, 2.0 )\n ~0.33\n > m = accumulator( 4.0, 5.0 )\n ~0.33\n > m = accumulator()\n ~0.33\n\n See Also\n --------\n incrmda, incrmmape\n",
"incrmme": "\nincrmme( W )\n Returns an accumulator function which incrementally computes a moving\n mean error (ME).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean error.\n\n If provided a value, the accumulator function returns an updated moving\n mean error. If not provided a value, the accumulator function returns the\n current moving mean error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmme( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator( 3.0, 2.0 )\n ~2.33\n > m = accumulator( 5.0, -2.0 )\n ~-0.33\n > m = accumulator()\n ~-0.33\n\n See Also\n --------\n incrme, incrmmae, incrmmean\n",
"incrmmean": "\nincrmmean( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmean( 3 );\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n -1.5\n > mu = accumulator( 3.0 )\n 0.0\n > mu = accumulator( 5.0 )\n 1.0\n > mu = accumulator()\n 1.0\n\n See Also\n --------\n incrmean, incrmsum, incrmstdev, incrmsummary, incrmvariance\n",
"incrmmeanabs": "\nincrmmeanabs( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean of absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanabs( 3 );\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n 3.5\n > mu = accumulator( 3.0 )\n ~3.33\n > mu = accumulator( 5.0 )\n ~4.33\n > mu = accumulator()\n ~4.33\n\n See Also\n --------\n incrmeanabs, incrmmean, incrmsumabs\n",
"incrmmeanabs2": "\nincrmmeanabs2( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean of squared absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanabs2( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 4.0\n > m = accumulator( -5.0 )\n 14.5\n > m = accumulator( 3.0 )\n ~12.67\n > m = accumulator( 5.0 )\n ~19.67\n > m = accumulator()\n ~19.67\n\n See Also\n --------\n incrmeanabs2, incrmmeanabs, incrmsumabs2\n",
"incrmmeanstdev": "\nincrmmeanstdev( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean and corrected sample standard deviation.\n\n The `W` parameter defines the number of values over which to compute the\n moving arithmetic mean and corrected sample standard deviation.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current moving accumulated values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n accumulated values are calculated from smaller sample sizes. Until the\n window is full, each returned accumulated value is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanstdev( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > v = accumulator( -5.0 )\n [ -1.5, ~4.95 ]\n > v = accumulator( 3.0 )\n [ 0.0, ~4.36 ]\n > v = accumulator( 5.0 )\n [ 1.0, ~5.29 ]\n > v = accumulator()\n [ 1.0, ~5.29 ]\n\n See Also\n --------\n incrmeanstdev, incrmmean, incrmmeanvar, incrmstdev\n",
"incrmmeanvar": "\nincrmmeanvar( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean and unbiased sample variance.\n\n The `W` parameter defines the number of values over which to compute the\n moving arithmetic mean and unbiased sample variance.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current moving accumulated values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n accumulated values are calculated from smaller sample sizes. Until the\n window is full, each returned accumulated value is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanvar( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > v = accumulator( -5.0 )\n [ -1.5, 24.5 ]\n > v = accumulator( 3.0 )\n [ 0.0, 19.0 ]\n > v = accumulator( 5.0 )\n [ 1.0, 28.0 ]\n > v = accumulator()\n [ 1.0, 28.0 ]\n\n See Also\n --------\n incrmeanvar, incrmmean, incrmmeanstdev, incrmvariance\n",
"incrmmidrange": "\nincrmmidrange( W )\n Returns an accumulator function which incrementally computes a moving mid-\n range.\n\n The mid-range is the arithmetic mean of maximum and minimum values.\n Accordingly, the mid-range is the midpoint of the range and a measure of\n central tendency.\n\n The `W` parameter defines the number of values over which to compute\n the moving mid-range.\n\n If provided a value, the accumulator function returns an updated moving mid-\n range. If not provided a value, the accumulator function returns the current\n moving mid-range.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmidrange( 3 );\n > var mr = accumulator()\n null\n > mr = accumulator( 2.0 )\n 2.0\n > mr = accumulator( -5.0 )\n -1.5\n > mr = accumulator( 3.0 )\n -1.0\n > mr = accumulator( 5.0 )\n 0.0\n > mr = accumulator()\n 0.0\n\n See Also\n --------\n incrmmean, incrmmax, incrmmin, incrmrange\n",
"incrmmin": "\nincrmmin( W )\n Returns an accumulator function which incrementally computes a moving\n minimum value.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum.\n\n If provided a value, the accumulator function returns an updated moving\n minimum. If not provided a value, the accumulator function returns the\n current moving minimum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmin( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n -5.0\n > m = accumulator( 3.0 )\n -5.0\n > m = accumulator( 5.0 )\n -5.0\n > m = accumulator()\n -5.0\n\n See Also\n --------\n incrmin, incrmmax, incrmmidrange, incrmrange, incrmsummary\n",
"incrmminabs": "\nincrmminabs( W )\n Returns an accumulator function which incrementally computes a moving\n minimum absolute value.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum absolute value.\n\n If provided a value, the accumulator function returns an updated moving\n minimum absolute value. If not provided a value, the accumulator function\n returns the current moving minimum absolute value.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminabs( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 2.0\n > m = accumulator( 3.0 )\n 2.0\n > m = accumulator( 5.0 )\n 3.0\n > m = accumulator()\n 3.0\n\n See Also\n --------\n incrminabs, incrmmaxabs, incrmmin\n",
"incrmminmax": "\nincrmminmax( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n minimum and maximum.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum and maximum.\n\n If provided a value, the accumulator function returns an updated moving\n minimum and maximum. If not provided a value, the accumulator function\n returns the current moving minimum and maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n minimum and maximum values are calculated from smaller sample sizes. Until\n the window is full, each returned minimum and maximum is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminmax( 3 );\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ -5.0, 2.0 ]\n > mm = accumulator( 3.0 )\n [ -5.0, 3.0 ]\n > mm = accumulator( 5.0 )\n [ -5.0, 5.0 ]\n > mm = accumulator()\n [ -5.0, 5.0 ]\n\n See Also\n --------\n incrmax, incrmin, incrmmax, incrminmax, incrmmin, incrmrange\n",
"incrmminmaxabs": "\nincrmminmaxabs( [out,] W )\n Returns an accumulator function which incrementally computes moving minimum\n and maximum absolute values.\n\n The `W` parameter defines the number of values over which to compute moving\n minimum and maximum absolute values.\n\n If provided a value, the accumulator function returns an updated moving\n minimum and maximum. If not provided a value, the accumulator function\n returns the current moving minimum and maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n minimum and maximum values are calculated from smaller sample sizes. Until\n the window is full, each returned minimum and maximum is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminmaxabs( 3 );\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 3.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 5.0 )\n [ 3.0, 5.0 ]\n > mm = accumulator()\n [ 3.0, 5.0 ]\n\n See Also\n --------\n incrminmaxabs, incrmmax, incrmmaxabs, incrmmin, incrmminabs, incrmminmax\n",
"incrmmpe": "\nincrmmpe( W )\n Returns an accumulator function which incrementally computes a moving\n mean percentage error (MPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean percentage error. If not provided input values, the accumulator\n function returns the current moving mean percentage error.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmpe( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~-58.33\n > m = accumulator( 3.0, 2.0 )\n ~-55.56\n > m = accumulator( 2.0, 5.0 )\n ~-46.67\n > m = accumulator()\n ~-46.67\n\n See Also\n --------\n incrmmape, incrmme, incrmpe\n",
"incrmmse": "\nincrmmse( W )\n Returns an accumulator function which incrementally computes a moving mean\n squared error (MSE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean squared error.\n\n If provided a value, the accumulator function returns an updated moving mean\n squared error. If not provided a value, the accumulator function returns the\n current moving mean squared error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmse( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 25.0\n > m = accumulator( 3.0, 2.0 )\n 17.0\n > m = accumulator( 5.0, -2.0 )\n 33.0\n > m = accumulator()\n 33.0\n\n See Also\n --------\n incrmrmse, incrmrss, incrmse\n",
"incrmpcorr": "\nincrmpcorr( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n sample correlation coefficient. If not provided values, the accumulator\n function returns the current moving sample correlation coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorr( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 1.0 )\n 0.0\n > r = accumulator( -5.0, 3.14 )\n ~-1.0\n > r = accumulator( 3.0, -1.0 )\n ~-0.925\n > r = accumulator( 5.0, -9.5 )\n ~-0.863\n > r = accumulator()\n ~-0.863\n\n See Also\n --------\n incrmcovariance, incrmpcorrdist, incrpcorr\n",
"incrmpcorr2": "\nincrmpcorr2( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n squared sample Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving squared sample correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n squared sample correlation coefficient. If not provided values, the\n accumulator function returns the current moving squared sample correlation\n coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorr2( 3 );\n > var r2 = accumulator()\n null\n > r2 = accumulator( 2.0, 1.0 )\n 0.0\n > r2 = accumulator( -5.0, 3.14 )\n ~1.0\n > r2 = accumulator( 3.0, -1.0 )\n ~0.86\n > r2 = accumulator( 5.0, -9.5 )\n ~0.74\n > r2 = accumulator()\n ~0.74\n\n See Also\n --------\n incrmapcorr, incrmpcorr, incrpcorr2\n",
"incrmpcorrdist": "\nincrmpcorrdist( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample Pearson product-moment correlation distance.\n\n The correlation distance is defined as one minus the Pearson product-moment\n correlation coefficient and, thus, resides on the interval [0,2].\n\n However, due to limitations inherent in representing numeric values using\n floating-point format (i.e., the inability to represent numeric values with\n infinite precision), the correlation distance between perfectly correlated\n random variables may *not* be `0` or `2`. In fact, the correlation distance\n is *not* guaranteed to be strictly on the interval [0,2]. Any computed\n distance should, however, be within floating-point roundoff error.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample correlation distance.\n\n If provided values, the accumulator function returns an updated moving\n sample correlation distance. If not provided values, the accumulator\n function returns the current moving sample correlation distance.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorrdist( 3 );\n > var d = accumulator()\n null\n > d = accumulator( 2.0, 1.0 )\n 1.0\n > d = accumulator( -5.0, 3.14 )\n ~2.0\n > d = accumulator( 3.0, -1.0 )\n ~1.925\n > d = accumulator( 5.0, -9.5 )\n ~1.863\n > d = accumulator()\n ~1.863\n\n See Also\n --------\n incrmpcorr, incrpcorrdist\n",
"incrmpe": "\nincrmpe()\n Returns an accumulator function which incrementally computes the mean\n percentage error (MPE).\n\n If provided input values, the accumulator function returns an updated mean\n percentage error. If not provided input values, the accumulator function\n returns the current mean percentage error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpe();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~-58.33\n > m = accumulator()\n ~-58.33\n\n See Also\n --------\n incrmape, incrme, incrmmpe\n",
"incrmprod": "\nincrmprod( W )\n Returns an accumulator function which incrementally computes a moving\n product.\n\n The `W` parameter defines the number of values over which to compute the\n moving product.\n\n If provided a value, the accumulator function returns an updated moving\n product. If not provided a value, the accumulator function returns the\n current moving product.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n For accumulations over large windows or accumulations of large numbers, care\n should be taken to prevent overflow. Note, however, that overflow/underflow\n may be transient, as the accumulator does not use a double-precision\n floating-point number to store an accumulated product. Instead, the\n accumulator splits an accumulated product into a normalized fraction and\n exponent and updates each component separately. Doing so guards against a\n loss in precision.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmprod( 3 );\n > var p = accumulator()\n null\n > p = accumulator( 2.0 )\n 2.0\n > p = accumulator( -5.0 )\n -10.0\n > p = accumulator( 3.0 )\n -30.0\n > p = accumulator( 5.0 )\n -75.0\n > p = accumulator()\n -75.0\n\n See Also\n --------\n incrmsum, incrprod\n",
"incrmrange": "\nincrmrange( W )\n Returns an accumulator function which incrementally computes a moving range.\n\n The `W` parameter defines the number of values over which to compute the\n moving range.\n\n If provided a value, the accumulator function returns an updated moving\n range. If not provided a value, the accumulator function returns the current\n moving range.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrange( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0 )\n 0.0\n > r = accumulator( -5.0 )\n 7.0\n > r = accumulator( 3.0 )\n 8.0\n > r = accumulator( 5.0 )\n 10.0\n > r = accumulator()\n 10.0\n\n See Also\n --------\n incrmmax, incrmmean, incrmmin, incrmsummary, incrrange\n",
"incrmrmse": "\nincrmrmse( W )\n Returns an accumulator function which incrementally computes a moving root\n mean squared error (RMSE).\n\n The `W` parameter defines the number of values over which to compute the\n moving root mean squared error.\n\n If provided a value, the accumulator function returns an updated moving root\n mean squared error. If not provided a value, the accumulator function\n returns the current moving root mean squared error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrmse( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 5.0\n > r = accumulator( 3.0, 2.0 )\n ~4.12\n > r = accumulator( 5.0, -2.0 )\n ~5.74\n > r = accumulator()\n ~5.74\n\n See Also\n --------\n incrmmse, incrmrss, incrrmse\n",
"incrmrss": "\nincrmrss( W )\n Returns an accumulator function which incrementally computes a moving\n residual sum of squares (RSS).\n\n The `W` parameter defines the number of values over which to compute the\n moving residual sum of squares.\n\n If provided a value, the accumulator function returns an updated moving\n residual sum of squares. If not provided a value, the accumulator function\n returns the current moving residual sum of squares.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrss( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 50.0\n > r = accumulator( 3.0, 2.0 )\n 51.0\n > r = accumulator( 5.0, -2.0 )\n 99.0\n > r = accumulator()\n 99.0\n\n See Also\n --------\n incrrss, incrmmse, incrmrmse\n",
"incrmse": "\nincrmse()\n Returns an accumulator function which incrementally computes the mean\n squared error (MSE).\n\n If provided input values, the accumulator function returns an updated mean\n squared error. If not provided input values, the accumulator function\n returns the current mean squared error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmse();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 25.0\n > m = accumulator()\n 25.0\n\n See Also\n --------\n incrmmse, incrrmse, incrrss\n",
"incrmstdev": "\nincrmstdev( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n corrected sample standard deviation.\n\n The `W` parameter defines the number of values over which to compute the\n moving corrected sample standard deviation.\n\n If provided a value, the accumulator function returns an updated moving\n corrected sample standard deviation. If not provided a value, the\n accumulator function returns the current moving corrected sample standard\n deviation.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmstdev( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n ~4.95\n > s = accumulator( 3.0 )\n ~4.36\n > s = accumulator( 5.0 )\n ~5.29\n > s = accumulator()\n ~5.29\n\n See Also\n --------\n incrmmean, incrmsummary, incrmvariance, incrstdev\n",
"incrmsum": "\nincrmsum( W )\n Returns an accumulator function which incrementally computes a moving sum.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsum( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n -3.0\n > s = accumulator( 3.0 )\n 0.0\n > s = accumulator( 5.0 )\n 3.0\n > s = accumulator()\n 3.0\n\n See Also\n --------\n incrmmean, incrmsummary, incrsum\n",
"incrmsumabs": "\nincrmsumabs( W )\n Returns an accumulator function which incrementally computes a moving sum of\n absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumabs( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n 7.0\n > s = accumulator( 3.0 )\n 10.0\n > s = accumulator( -5.0 )\n 13.0\n > s = accumulator()\n 13.0\n\n See Also\n --------\n incrmmeanabs, incrmsum, incrsum, incrsumabs\n",
"incrmsumabs2": "\nincrmsumabs2( W )\n Returns an accumulator function which incrementally computes a moving sum of\n squared absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumabs2( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 4.0\n > s = accumulator( -5.0 )\n 29.0\n > s = accumulator( 3.0 )\n 38.0\n > s = accumulator( -5.0 )\n 59.0\n > s = accumulator()\n 59.0\n\n See Also\n --------\n incrmmeanabs2, incrmsumabs, incrsumabs, incrsumabs2\n",
"incrmsummary": "\nincrmsummary( W )\n Returns an accumulator function which incrementally computes a moving\n statistical summary.\n\n The `W` parameter defines the number of values over which to compute the\n moving statistical summary.\n\n If provided a value, the accumulator function returns an updated moving\n statistical summary. If not provided a value, the accumulator function\n returns the current moving statistical summary.\n\n The returned summary is an object containing the following fields:\n\n - window: window size.\n - sum: sum.\n - mean: arithmetic mean.\n - variance: unbiased sample variance.\n - stdev: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - range: range.\n - midrange: arithmetic mean of the minimum and maximum values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n summaries are calculated from smaller sample sizes. Until the window is\n full, each returned summary is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsummary( 3 );\n > var s = accumulator()\n {}\n > s = accumulator( 2.0 )\n {...}\n > s = accumulator( -5.0 )\n {...}\n > s = accumulator()\n {...}\n\n See Also\n --------\n incrmmean, incrmstdev, incrmsum, incrmvariance, incrsummary\n",
"incrmsumprod": "\nincrmsumprod( W )\n Returns an accumulator function which incrementally computes a moving sum of\n products.\n\n The `W` parameter defines the number of (x,y) pairs over which to compute\n the moving sum of products.\n\n If provided input values, the accumulator function returns an updated moving\n sum. If not provided input values, the accumulator function returns the\n current moving sum.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumprod( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0, 3.0 )\n 6.0\n > s = accumulator( -5.0, 2.0 )\n -4.0\n > s = accumulator( 3.0, -2.0 )\n -10.0\n > s = accumulator( 5.0, 3.0 )\n -1.0\n > s = accumulator()\n -1.0\n\n See Also\n --------\n incrmprod, incrmsum, incrsumprod\n",
"incrmvariance": "\nincrmvariance( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n unbiased sample variance.\n\n The `W` parameter defines the number of values over which to compute the\n moving unbiased sample variance.\n\n If provided a value, the accumulator function returns an updated moving\n unbiased sample variance. If not provided a value, the accumulator function\n returns the current moving unbiased sample variance.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmvariance( 3 );\n > var s2 = accumulator()\n null\n > s2 = accumulator( 2.0 )\n 0.0\n > s2 = accumulator( -5.0 )\n 24.5\n > s2 = accumulator( 3.0 )\n 19.0\n > s2 = accumulator( 5.0 )\n 28.0\n > s2 = accumulator()\n 28.0\n\n See Also\n --------\n incrmmean, incrmstdev, incrmsummary, incrvariance\n",
"incrmvmr": "\nincrmvmr( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n variance-to-mean (VMR).\n\n The `W` parameter defines the number of values over which to compute the\n moving variance-to-mean ratio.\n\n If provided a value, the accumulator function returns an updated moving\n variance-to-mean ratio. If not provided a value, the accumulator function\n returns the current moving variance-to-mean ratio.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmvmr( 3 );\n > var F = accumulator()\n null\n > F = accumulator( 2.0 )\n 0.0\n > F = accumulator( 1.0 )\n ~0.33\n > F = accumulator( 3.0 )\n 0.5\n > F = accumulator( 7.0 )\n ~2.55\n > F = accumulator()\n ~2.55\n\n See Also\n --------\n incrmmean, incrmvariance, incrvmr\n",
"incrpcorr": "\nincrpcorr( [mx, my] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated sample\n correlation coefficient. If not provided values, the accumulator function\n returns the current sample correlation coefficient.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorr();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 1.0 )\n 0.0\n > r = accumulator( -5.0, 3.14 )\n ~-1.0\n > r = accumulator()\n ~-1.0\n\n See Also\n --------\n incrcovariance, incrmpcorr, incrsummary\n",
"incrpcorr2": "\nincrpcorr2( [mx, my] )\n Returns an accumulator function which incrementally computes the squared\n sample Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated accumulated\n value. If not provided values, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorr2();\n > var r2 = accumulator()\n null\n > r2 = accumulator( 2.0, 1.0 )\n 0.0\n > r2 = accumulator( -5.0, 3.14 )\n ~1.0\n > r2 = accumulator()\n ~1.0\n\n See Also\n --------\n incrapcorr, incrmpcorr2, incrpcorr\n",
"incrpcorrdist": "\nincrpcorrdist( [mx, my] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation distance.\n\n The correlation distance is defined as one minus the Pearson product-moment\n correlation coefficient and, thus, resides on the interval [0,2].\n\n If provided values, the accumulator function returns an updated sample\n correlation distance. If not provided values, the accumulator function\n returns the current sample correlation distance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrdist();\n > var d = accumulator()\n null\n > d = accumulator( 2.0, 1.0 )\n 1.0\n > d = accumulator( -5.0, 3.14 )\n ~2.0\n > d = accumulator()\n ~2.0\n\n See Also\n --------\n incrcovariance, incrpcorr, incrsummary\n",
"incrpcorrdistmat": "\nincrpcorrdistmat( out[, means] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation distance matrix.\n\n If provided a data vector, the accumulator function returns an updated\n sample correlation distance matrix. If not provided a data vector, the\n accumulator function returns the current sample correlation distance matrix.\n\n Due to limitations inherent in representing numeric values using floating-\n point format (i.e., the inability to represent numeric values with infinite\n precision), the correlation distance between perfectly correlated random\n variables may *not* be `0` or `2`. In fact, the correlation distance is\n *not* guaranteed to be strictly on the interval [0,2]. Any computed distance\n should, however, be within floating-point roundoff error.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the correlation distance matrix or a square 2-dimensional\n ndarray for storing the correlation distance matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrdistmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrpcorrdist, incrpcorrmat\n",
"incrpcorrmat": "\nincrpcorrmat( out[, means] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation matrix.\n\n If provided a data vector, the accumulator function returns an updated\n sample correlation matrix. If not provided a data vector, the accumulator\n function returns the current sample correlation matrix.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the correlation matrix or a square 2-dimensional ndarray for\n storing the correlation matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrcovmat, incrpcorr, incrpcorrdistmat\n",
"incrprod": "\nincrprod()\n Returns an accumulator function which incrementally computes a product.\n\n If provided a value, the accumulator function returns an updated product. If\n not provided a value, the accumulator function returns the current product.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow. Note, however, that overflow/underflow\n may be transient, as the accumulator does not use a double-precision\n floating-point number to store an accumulated product. Instead, the\n accumulator splits an accumulated product into a normalized fraction and\n exponent and updates each component separately. Doing so guards against a\n loss in precision.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrprod();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( -5.0 )\n -10.0\n > v = accumulator()\n -10.0\n\n See Also\n --------\n incrsum, incrsummary\n",
"incrrange": "\nincrrange()\n Returns an accumulator function which incrementally computes a range.\n\n If provided a value, the accumulator function returns an updated range. If\n not provided a value, the accumulator function returns the current range.\n\n If provided `NaN`, the range is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrange();\n > var v = accumulator()\n null\n > v = accumulator( -2.0 )\n 0.0\n > v = accumulator( 1.0 )\n 3.0\n > v = accumulator( 3.0 )\n 5.0\n > v = accumulator()\n 5.0\n\n See Also\n --------\n incrmax, incrmean, incrmin, incrmrange, incrsummary\n",
"incrrmse": "\nincrrmse()\n Returns an accumulator function which incrementally computes the root mean\n squared error (RMSE).\n\n If provided input values, the accumulator function returns an updated root\n mean squared error. If not provided input values, the accumulator function\n returns the current root mean squared error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrmse();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 5.0\n > r = accumulator()\n 5.0\n\n See Also\n --------\n incrmrmse, incrmse, incrrss\n",
"incrrss": "\nincrrss()\n Returns an accumulator function which incrementally computes the residual\n sum of squares (RSS).\n\n If provided input values, the accumulator function returns an updated\n residual sum of squares. If not provided input values, the accumulator\n function returns the current residual sum of squares.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrss();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 50.0\n > r = accumulator()\n 50.0\n\n See Also\n --------\n incrmrss, incrmse, incrrmse\n",
"incrskewness": "\nincrskewness()\n Returns an accumulator function which incrementally computes a corrected\n sample skewness.\n\n If provided a value, the accumulator function returns an updated corrected\n sample skewness. If not provided a value, the accumulator function returns\n the current corrected sample skewness.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrskewness();\n > var v = accumulator( 2.0 )\n null\n > v = accumulator( -5.0 )\n null\n > v = accumulator( -10.0 )\n ~0.492\n > v = accumulator()\n ~0.492\n\n See Also\n --------\n incrkurtosis, incrmean, incrstdev, incrsummary, incrvariance\n",
"incrspace": "\nincrspace( start, stop[, increment] )\n Generates a linearly spaced numeric array using a provided increment.\n\n If an `increment` is not provided, the default `increment` is `1`.\n\n The output array is guaranteed to include the `start` value but does not\n include the `stop` value.\n\n Parameters\n ----------\n start: number\n First array value.\n\n stop: number\n Array element bound.\n\n increment: number (optional)\n Increment. Default: `1`.\n\n Returns\n -------\n arr: Array\n Linearly spaced numeric array.\n\n Examples\n --------\n > var arr = incrspace( 0, 11, 2 )\n [ 0, 2, 4, 6, 8, 10 ]\n\n See Also\n --------\n linspace, logspace\n",
"incrstdev": "\nincrstdev( [mean] )\n Returns an accumulator function which incrementally computes a corrected\n sample standard deviation.\n\n If provided a value, the accumulator function returns an updated corrected\n sample standard deviation. If not provided a value, the accumulator function\n returns the current corrected sample standard deviation.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrstdev();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n ~4.95\n > s = accumulator()\n ~4.95\n\n See Also\n --------\n incrkurtosis, incrmean, incrmstdev, incrskewness, incrsummary, incrvariance\n",
"incrsum": "\nincrsum()\n Returns an accumulator function which incrementally computes a sum.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsum();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n -3.0\n > s = accumulator()\n -3.0\n\n See Also\n --------\n incrcount, incrmean, incrmsum, incrprod, incrsummary\n",
"incrsumabs": "\nincrsumabs()\n Returns an accumulator function which incrementally computes a sum of\n absolute values.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumabs();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n 7.0\n > s = accumulator()\n 7.0\n\n See Also\n --------\n incrmeanabs, incrmsumabs, incrsum\n",
"incrsumabs2": "\nincrsumabs2()\n Returns an accumulator function which incrementally computes a sum of\n squared absolute values.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumabs2();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 4.0\n > s = accumulator( -5.0 )\n 29.0\n > s = accumulator()\n 29.0\n\n See Also\n --------\n incrmeanabs2, incrmsumabs2, incrsumabs\n",
"incrsummary": "\nincrsummary()\n Returns an accumulator function which incrementally computes a statistical\n summary.\n\n If provided a value, the accumulator function returns an updated summary. If\n not provided a value, the accumulator function returns the current summary.\n\n The returned summary is an object containing the following fields:\n\n - count: count.\n - max: maximum value.\n - min: minimum value.\n - range: range.\n - midrange: mid-range.\n - sum: sum.\n - mean: arithmetic mean.\n - variance: unbiased sample variance.\n - stdev: corrected sample standard deviation.\n - skewness: corrected sample skewness.\n - kurtosis: corrected sample excess kurtosis.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsummary();\n > var s = accumulator()\n {}\n > s = accumulator( 2.0 )\n {...}\n > s = accumulator( -5.0 )\n {...}\n > s = accumulator()\n {...}\n\n See Also\n --------\n incrcount, incrkurtosis, incrmax, incrmean, incrmidrange, incrmin, incrmsummary, incrrange, incrskewness, incrstdev, incrsum, incrvariance\n",
"incrsumprod": "\nincrsumprod()\n Returns an accumulator function which incrementally computes a sum of\n products.\n\n If provided input values, the accumulator function returns an updated sum.\n If not provided input values, the accumulator function returns the current\n sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumprod();\n > var s = accumulator()\n null\n > s = accumulator( 2.0, 3.0 )\n 6.0\n > s = accumulator( -5.0, 2.0 )\n -4.0\n > s = accumulator()\n -4.0\n\n See Also\n --------\n incrmsumprod, incrprod, incrsum\n",
"incrvariance": "\nincrvariance( [mean] )\n Returns an accumulator function which incrementally computes an unbiased\n sample variance.\n\n If provided a value, the accumulator function returns an updated unbiased\n sample variance. If not provided a value, the accumulator function returns\n the current unbiased sample variance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrvariance();\n > var s2 = accumulator()\n null\n > s2 = accumulator( 2.0 )\n 0.0\n > s2 = accumulator( -5.0 )\n 24.5\n > s2 = accumulator()\n 24.5\n\n See Also\n --------\n incrkurtosis, incrmean, incrmstdev, incrskewness, incrstdev, incrsummary\n",
"incrvmr": "\nincrvmr( [mean] )\n Returns an accumulator function which incrementally computes a variance-to-\n mean ratio (VMR).\n\n If provided a value, the accumulator function returns an updated accumulated\n value. If not provided a value, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrvmr();\n > var D = accumulator()\n null\n > D = accumulator( 2.0 )\n 0.0\n > D = accumulator( 1.0 )\n ~0.33\n > D = accumulator()\n ~0.33\n\n See Also\n --------\n incrmean, incrmvmr, incrvariance\n",
"ind2sub": "\nind2sub( [out,] shape, idx[, options] )\n Converts a linear index to an array of subscripts.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n shape: ArrayLike\n Array shape.\n\n idx: integer\n Linear index.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Specifies whether an array is row-major (C-style) or column-major\n (Fortran style). Default: 'row-major'.\n\n options.mode: string (optional)\n Specifies how to handle a linear index which exceeds array dimensions.\n If equal to 'throw', the function throws an error when a linear index\n exceeds array dimensions. If equal to 'wrap', the function wraps around\n a linear index exceeding array dimensions using modulo arithmetic. If\n equal to 'clamp', the function sets a linear index exceeding array\n dimensions to either `0` (minimum linear index) or the maximum linear\n index. Default: 'throw'.\n\n Returns\n -------\n out: Array<integer>\n Subscripts.\n\n Examples\n --------\n > var d = [ 3, 3, 3 ];\n > var s = ind2sub( d, 17 )\n [ 1, 2, 2 ]\n\n // Provide an output array:\n > var out = new Array( d.length );\n > s = ind2sub( out, d, 17 )\n [ 1, 2, 2 ]\n > var bool = ( s === out )\n true\n\n See Also\n --------\n array, ndarray, sub2ind\n",
"indexOf": "\nindexOf( arr, searchElement[, fromIndex] )\n Returns the first index at which a given element can be found.\n\n Search is performed using *strict equality* comparison.\n\n Parameters\n ----------\n arr: ArrayLike\n Array-like object.\n\n searchElement: any\n Element to find.\n\n fromIndex: integer (optional)\n Starting index (if negative, the start index is determined relative to\n last element).\n\n Returns\n -------\n out: integer\n Index or -1.\n\n Examples\n --------\n // Basic usage:\n > var arr = [ 4, 3, 2, 1 ];\n > var idx = indexOf( arr, 3 )\n 1\n > arr = [ 4, 3, 2, 1 ];\n > idx = indexOf( arr, 5 )\n -1\n\n // Using a `fromIndex`:\n > arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n > idx = indexOf( arr, 2, 3 )\n 5\n\n // `fromIndex` which exceeds `array` length:\n > arr = [ 1, 2, 3, 4, 2, 5 ];\n > idx = indexOf( arr, 2, 10 )\n -1\n\n // Negative `fromIndex`:\n > arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n > idx = indexOf( arr, 2, -4 )\n 5\n > idx = indexOf( arr, 2, -1 )\n 7\n\n // Negative `fromIndex` exceeding input `array` length:\n > arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n > idx = indexOf( arr, 2, -10 )\n 1\n\n // Array-like objects:\n > var str = 'bebop';\n > idx = indexOf( str, 'o' )\n 3\n\n",
"inherit": "\ninherit( ctor, superCtor )\n Prototypical inheritance by replacing the prototype of one constructor with\n the prototype of another constructor.\n\n This function is not designed to work with ES2015/ES6 classes. For\n ES2015/ES6 classes, use `class` with `extends`.\n\n Parameters\n ----------\n ctor: Object|Function\n Constructor which will inherit.\n\n superCtor: Object|Function\n Super (parent) constructor.\n\n Returns\n -------\n out: Object|Function\n Child constructor.\n\n Examples\n --------\n // Create a parent constructor:\n > function Foo() { return this; };\n > Foo.prototype.beep = function beep() { return 'boop'; };\n\n // Create a child constructor:\n > function Bar() { Foo.call( this ); return this; };\n\n // Setup inheritance:\n > inherit( Bar, Foo );\n > var bar = new Bar();\n > var v = bar.beep()\n 'boop'\n\n",
"inheritedEnumerableProperties": "\ninheritedEnumerableProperties( value[, level] )\n Returns an array of an object's inherited enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n props: Array\n List of an object's inherited enumerable properties.\n\n Examples\n --------\n > var props = inheritedEnumerableProperties( {} )\n\n See Also\n --------\n enumerableProperties, enumerablePropertiesIn, inheritedEnumerablePropertySymbols, inheritedKeys, inheritedNonEnumerableProperties, inheritedProperties\n",
"inheritedEnumerablePropertySymbols": "\ninheritedEnumerablePropertySymbols( value[, level] )\n Returns an array of an object's inherited enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited enumerable symbol properties.\n\n Examples\n --------\n > var symbols = inheritedEnumerablePropertySymbols( [] )\n\n See Also\n --------\n enumerableProperties, enumerablePropertySymbols, inheritedKeys, nonEnumerablePropertySymbols, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"inheritedKeys": "\ninheritedKeys( value[, level] )\n Returns an array of an object's inherited enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited enumerable property names.\n\n Examples\n --------\n > var keys = inheritedKeys( {} )\n\n See Also\n --------\n objectKeys, keysIn, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedNonEnumerableProperties": "\ninheritedNonEnumerableProperties( value[, level] )\n Returns an array of an object's inherited non-enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n props: Array\n List of an object's inherited non-enumerable properties.\n\n Examples\n --------\n > var props = inheritedNonEnumerableProperties( {} )\n\n See Also\n --------\n inheritedEnumerableProperties, inheritedNonEnumerablePropertyNames, inheritedNonEnumerablePropertySymbols, inheritedKeys, nonEnumerableProperties, nonEnumerablePropertiesIn, properties\n",
"inheritedNonEnumerablePropertyNames": "\ninheritedNonEnumerablePropertyNames( value[, level] )\n Returns an array of an object's inherited non-enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited non-enumerable property names.\n\n Examples\n --------\n > var keys = inheritedNonEnumerablePropertyNames( {} )\n\n See Also\n --------\n inheritedNonEnumerableProperties, inheritedNonEnumerablePropertySymbols, objectKeys, nonEnumerablePropertyNames, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbols, propertyNames\n",
"inheritedNonEnumerablePropertySymbols": "\ninheritedNonEnumerablePropertySymbols( value[, level] )\n Returns an array of an object's inherited non-enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited non-enumerable symbol properties.\n\n Examples\n --------\n > var symbols = inheritedNonEnumerablePropertySymbols( [] )\n\n See Also\n --------\n inheritedNonEnumerableProperties, inheritedNonEnumerablePropertyNames, nonEnumerableProperties, nonEnumerablePropertyNames, nonEnumerablePropertySymbols, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"inheritedProperties": "\ninheritedProperties( value[, level] )\n Returns an array of an object's inherited property names and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited property names and symbols.\n\n Examples\n --------\n > var symbols = inheritedProperties( [] )\n\n See Also\n --------\n properties, propertiesIn, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyDescriptor": "\ninheritedPropertyDescriptor( value, property[, level] )\n Returns a property descriptor for an object's inherited property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var desc = inheritedPropertyDescriptor( {}, 'toString' )\n {...}\n\n See Also\n --------\n propertyDescriptor, propertyDescriptorIn, inheritedKeys, inheritedPropertyDescriptors, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyDescriptors": "\ninheritedPropertyDescriptors( value[, level] )\n Returns an object's inherited property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n desc: Object\n An object's inherited property descriptors.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var desc = inheritedPropertyDescriptors( obj )\n { 'foo': {...}, ... }\n\n See Also\n --------\n propertyDescriptors, propertyDescriptorsIn, inheritedKeys, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyNames": "\ninheritedPropertyNames( value[, level] )\n Returns an array of an object's inherited enumerable and non-enumerable\n property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited enumerable and non-enumerable property\n names.\n\n Examples\n --------\n > var keys = inheritedPropertyNames( [] )\n\n See Also\n --------\n inheritedKeys, inheritedPropertyDescriptors, inheritedPropertySymbols, propertyNames, propertyNamesIn\n",
"inheritedPropertySymbols": "\ninheritedPropertySymbols( value[, level] )\n Returns an array of an object's inherited symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited symbol properties.\n\n Examples\n --------\n > var symbols = inheritedPropertySymbols( [] )\n\n See Also\n --------\n inheritedKeys, inheritedPropertyDescriptors, inheritedPropertyNames, propertySymbols, propertySymbolsIn\n",
"inmap": "\ninmap( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection and updates the\n collection in-place.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n fcn: Function\n Function to invoke for each element in the input collection. The\n function's return value is used to update the collection in-place.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function foo( v, i ) { return v * i; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = inmap( arr, foo )\n [ 0.0, 2.0, 6.0 ]\n > var bool = ( out === arr )\n true\n\n See Also\n --------\n forEach, inmapRight\n",
"inmapAsync": "\ninmapAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection and updates a\n collection in-place.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: value used to update the collection\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling. Note, however, that the function\n may have mutated an input collection during prior invocations, resulting in\n a partially mutated collection.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, fcn, done )\n 1000\n 2500\n 3000\n true\n [ 0, 2500, 2000 ]\n\n // Limit number of concurrent invocations:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, opts, fcn, done )\n 2500\n 3000\n 1000\n true\n [ 0, 2500, 2000 ]\n\n // Process sequentially:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, opts, fcn, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 2000 ]\n\n\ninmapAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection and updates a collection in-place.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = inmapAsync.factory( opts, fcn );\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 2000 ]\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n [ 0, 1500, 2000 ]\n\n See Also\n --------\n forEachAsync, inmap, inmapRightAsync\n",
"inmapRight": "\ninmapRight( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection and updates the\n collection in-place, iterating from right to left.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n fcn: Function\n Function to invoke for each element in the input collection. The\n function's return value is used to update the collection in-place.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function foo( v, i ) { console.log( '%s: %d', i, v ); return v * i; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = inmapRight( arr, foo )\n 2: 3.0\n 1: 2.0\n 0: 1.0\n [ 0.0, 2.0, 6.0 ]\n > var bool = ( out === arr )\n true\n\n See Also\n --------\n forEachRight, inmap\n",
"inmapRightAsync": "\ninmapRightAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection and updates a\n collection in-place, iterating from right to left.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: value used to update the collection\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling. Note, however, that the function\n may have mutated an input collection during prior invocations, resulting in\n a partially mutated collection.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, fcn, done )\n 1000\n 2500\n 3000\n true\n [ 0, 2500, 6000 ]\n\n // Limit number of concurrent invocations:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, opts, fcn, done )\n 2500\n 3000\n 1000\n true\n [ 0, 2500, 6000 ]\n\n // Process sequentially:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, opts, fcn, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 6000 ]\n\n\ninmapRightAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection and updates a collection in-place, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = inmapRightAsync.factory( opts, fcn );\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 6000 ]\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n [ 0, 1500, 4000 ]\n\n See Also\n --------\n forEachRightAsync, inmapAsync, inmapRight\n",
"inspectStream": "\ninspectStream( [options,] clbk )\n Returns a transform stream for inspecting stream data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = inspectStream( clbk );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ninspectStream.factory( [options] )\n Returns a function for creating transform streams for inspecting stream\n data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream( clbk ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = inspectStream.factory( opts );\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = createStream( clbk );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ninspectStream.objectMode( [options,] clbk )\n Returns an \"objectMode\" transform stream for inspecting stream data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = inspectStream.objectMode( clbk );\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n debugStream\n",
"instanceOf": "\ninstanceOf( value, constructor )\n Tests whether a value has in its prototype chain a specified constructor as\n a prototype property.\n\n While the prototype of an `object` created using object literal notion is\n `undefined`, the function returns `true` when provided an `object` literal\n and the `Object` constructor. This maintains consistent behavior with the\n `instanceof` operator.\n\n Parameters\n ----------\n value: any\n Input value.\n\n constructor: Function\n Constructor.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an instance of a provided constructor.\n\n Examples\n --------\n > var bool = instanceOf( [], Array )\n true\n > bool = instanceOf( {}, Object )\n true\n > bool = instanceOf( null, Object )\n false\n\n See Also\n --------\n isPrototypeOf, constructorName, inherit, typeOf\n",
"INT8_MAX": "\nINT8_MAX\n Maximum signed 8-bit integer.\n\n The maximum signed 8-bit integer is given by `2^7 - 1`.\n\n Examples\n --------\n > INT8_MAX\n 127\n\n See Also\n --------\n INT8_MIN\n",
"INT8_MIN": "\nINT8_MIN\n Minimum signed 8-bit integer.\n\n The minimum signed 8-bit integer is given by `-(2^7)`.\n\n Examples\n --------\n > INT8_MIN\n -128\n\n See Also\n --------\n INT8_MAX\n",
"INT8_NUM_BYTES": "\nINT8_NUM_BYTES\n Size (in bytes) of an 8-bit signed integer.\n\n Examples\n --------\n > INT8_NUM_BYTES\n 1\n\n See Also\n --------\n INT16_NUM_BYTES, INT32_NUM_BYTES, UINT8_NUM_BYTES\n",
"Int8Array": "\nInt8Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 8-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int8Array()\n <Int8Array>\n\n\nInt8Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 )\n <Int8Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt8Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Int8Array( arr1 )\n <Int8Array>[ 5, 5, 5 ]\n\n\nInt8Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int8Array( arr1 )\n <Int8Array>[ 5, 5, 5 ]\n\n\nInt8Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Int8Array( buf, 0, 4 )\n <Int8Array>[ 0, 0, 0, 0 ]\n\n\nInt8Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int8Array.from( [ 1, 2 ], mapFcn )\n <Int8Array>[ 2, 4 ]\n\n\nInt8Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = Int8Array.of( 1, 2 )\n <Int8Array>[ 1, 2 ]\n\n\nInt8Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int8Array.BYTES_PER_ELEMENT\n 1\n\n\nInt8Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int8Array.name\n 'Int8Array'\n\n\nInt8Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt8Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.byteLength\n 5\n\n\nInt8Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt8Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nInt8Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.length\n 5\n\n\nInt8Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt8Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt8Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt8Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt8Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt8Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt8Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt8Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int8Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt8Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt8Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt8Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt8Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt8Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt8Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int8Array>[ 2, 4, 6 ]\n\n\nInt8Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt8Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt8Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] )\n <Int8Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int8Array>[ 3, 2, 1 ]\n\n\nInt8Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt8Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt8Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt8Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int8Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt8Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int8Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int8Array>[ 3, 4, 5 ]\n\n\nInt8Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt8Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt8Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"INT16_MAX": "\nINT16_MAX\n Maximum signed 16-bit integer.\n\n The maximum signed 16-bit integer is given by `2^15 - 1`.\n\n Examples\n --------\n > INT16_MAX\n 32767\n\n See Also\n --------\n INT16_MIN\n",
"INT16_MIN": "\nINT16_MIN\n Minimum signed 16-bit integer.\n\n The minimum signed 16-bit integer is given by `-(2^15)`.\n\n Examples\n --------\n > INT16_MIN\n -32768\n\n See Also\n --------\n INT16_MAX\n",
"INT16_NUM_BYTES": "\nINT16_NUM_BYTES\n Size (in bytes) of a 16-bit signed integer.\n\n Examples\n --------\n > INT16_NUM_BYTES\n 2\n\n See Also\n --------\n INT32_NUM_BYTES, INT8_NUM_BYTES, UINT16_NUM_BYTES\n",
"Int16Array": "\nInt16Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 16-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int16Array()\n <Int16Array>\n\n\nInt16Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 )\n <Int16Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt16Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Int16Array( arr1 )\n <Int16Array>[ 5, 5, 5 ]\n\n\nInt16Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int16Array( arr1 )\n <Int16Array>[ 5, 5, 5 ]\n\n\nInt16Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 8 );\n > var arr = new Int16Array( buf, 0, 4 )\n <Int16Array>[ 0, 0, 0, 0 ]\n\n\nInt16Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int16Array.from( [ 1, 2 ], mapFcn )\n <Int16Array>[ 2, 4 ]\n\n\nInt16Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = Int16Array.of( 1, 2 )\n <Int16Array>[ 1, 2 ]\n\n\nInt16Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int16Array.BYTES_PER_ELEMENT\n 2\n\n\nInt16Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int16Array.name\n 'Int16Array'\n\n\nInt16Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt16Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.byteLength\n 10\n\n\nInt16Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt16Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 2\n\n\nInt16Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.length\n 5\n\n\nInt16Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt16Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt16Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt16Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt16Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt16Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt16Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt16Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int16Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt16Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt16Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt16Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt16Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt16Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt16Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int16Array>[ 2, 4, 6 ]\n\n\nInt16Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt16Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt16Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] )\n <Int16Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int16Array>[ 3, 2, 1 ]\n\n\nInt16Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt16Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt16Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt16Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int16Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt16Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int16Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int16Array>[ 3, 4, 5 ]\n\n\nInt16Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt16Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt16Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"INT32_MAX": "\nINT32_MAX\n Maximum signed 32-bit integer.\n\n The maximum signed 32-bit integer is given by `2^31 - 1`.\n\n Examples\n --------\n > INT32_MAX\n 2147483647\n\n See Also\n --------\n INT32_MIN\n",
"INT32_MIN": "\nINT32_MIN\n Minimum signed 32-bit integer.\n\n The minimum signed 32-bit integer is given by `-(2^31)`.\n\n Examples\n --------\n > INT32_MIN\n -2147483648\n\n See Also\n --------\n INT32_MAX\n",
"INT32_NUM_BYTES": "\nINT32_NUM_BYTES\n Size (in bytes) of a 32-bit signed integer.\n\n Examples\n --------\n > INT32_NUM_BYTES\n 4\n\n See Also\n --------\n INT16_NUM_BYTES, INT8_NUM_BYTES, UINT32_NUM_BYTES\n",
"Int32Array": "\nInt32Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 32-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int32Array()\n <Int32Array>\n\n\nInt32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 5, 5, 5 ] );\n > var arr2 = new Int32Array( arr1 )\n <Int32Array>[ 5, 5, 5 ]\n\n\nInt32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int32Array( arr1 )\n <Int32Array>[ 5, 5, 5 ]\n\n\nInt32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Int32Array( buf, 0, 4 )\n <Int32Array>[ 0, 0, 0, 0 ]\n\n\nInt32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int32Array.from( [ 1, 2 ], mapFcn )\n <Int32Array>[ 2, 4 ]\n\n\nInt32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = Int32Array.of( 1, 2 )\n <Int32Array>[ 1, 2 ]\n\n\nInt32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int32Array.BYTES_PER_ELEMENT\n 4\n\n\nInt32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int32Array.name\n 'Int32Array'\n\n\nInt32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.byteLength\n 20\n\n\nInt32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nInt32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.length\n 5\n\n\nInt32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int32Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int32Array>[ 2, 4, 6 ]\n\n\nInt32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] )\n <Int32Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int32Array>[ 3, 2, 1 ]\n\n\nInt32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int32Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int32Array>[ 3, 4, 5 ]\n\n\nInt32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"IS_BIG_ENDIAN": "\nIS_BIG_ENDIAN\n Boolean indicating if the environment is big endian.\n\n Examples\n --------\n > IS_BIG_ENDIAN\n <boolean>\n\n See Also\n --------\n IS_LITTLE_ENDIAN\n",
"IS_BROWSER": "\nIS_BROWSER\n Boolean indicating if the runtime is a web browser.\n\n Examples\n --------\n > IS_BROWSER\n <boolean>\n\n",
"IS_DARWIN": "\nIS_DARWIN\n Boolean indicating if the current process is running on Darwin.\n\n Examples\n --------\n > IS_DARWIN\n <boolean>\n\n",
"IS_ELECTRON": "\nIS_ELECTRON\n Boolean indicating if the runtime is Electron.\n\n Examples\n --------\n > IS_ELECTRON\n <boolean>\n\n See Also\n --------\n IS_ELECTRON_MAIN, IS_ELECTRON_RENDERER\n",
"IS_ELECTRON_MAIN": "\nIS_ELECTRON_MAIN\n Boolean indicating if the runtime is the main Electron process.\n\n Examples\n --------\n > IS_ELECTRON_MAIN\n <boolean>\n\n See Also\n --------\n IS_ELECTRON, IS_ELECTRON_RENDERER\n",
"IS_ELECTRON_RENDERER": "\nIS_ELECTRON_RENDERER\n Boolean indicating if the runtime is the Electron renderer process.\n\n Examples\n --------\n > IS_ELECTRON_RENDERER\n <boolean>\n\n See Also\n --------\n IS_ELECTRON, IS_ELECTRON_MAIN\n",
"IS_LITTLE_ENDIAN": "\nIS_LITTLE_ENDIAN\n Boolean indicating if the environment is little endian.\n\n Examples\n --------\n > IS_LITTLE_ENDIAN\n <boolean>\n\n See Also\n --------\n IS_BIG_ENDIAN\n",
"IS_NODE": "\nIS_NODE\n Boolean indicating if the runtime is Node.js.\n\n Examples\n --------\n > IS_NODE\n <boolean>\n\n",
"IS_WEB_WORKER": "\nIS_WEB_WORKER\n Boolean indicating if the runtime is a web worker.\n\n Examples\n --------\n > IS_WEB_WORKER\n <boolean>\n\n",
"IS_WINDOWS": "\nIS_WINDOWS\n Boolean indicating if the current process is running on Windows.\n\n Examples\n --------\n > IS_WINDOWS\n <boolean>\n\n",
"isAbsolutePath": "\nisAbsolutePath( value )\n Tests if a value is an absolute path.\n\n Function behavior is platform-specific. On Windows platforms, the function\n is equal to `.win32()`. On POSIX platforms, the function is equal to\n `.posix()`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an absolute path.\n\n Examples\n --------\n // Windows environment:\n > var bool = isAbsolutePath( 'C:\\\\foo\\\\bar\\\\baz' )\n true\n\n // POSIX environment:\n > bool = isAbsolutePath( '/foo/bar/baz' )\n true\n\n\nisAbsolutePath.posix( value )\n Tests if a value is a POSIX absolute path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a POSIX absolute path.\n\n Examples\n --------\n > var bool = isAbsolutePath.posix( '/foo/bar/baz' )\n true\n > bool = isAbsolutePath.posix( 'foo/bar/baz' )\n false\n\n\nisAbsolutePath.win32( value )\n Tests if a value is a Windows absolute path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a Windows absolute path.\n\n Examples\n --------\n > var bool = isAbsolutePath.win32( 'C:\\\\foo\\\\bar\\\\baz' )\n true\n > bool = isAbsolutePath.win32( 'foo\\\\bar\\\\baz' )\n false\n\n See Also\n --------\n isRelativePath\n",
"isAccessorProperty": "\nisAccessorProperty( value, property )\n Tests if an object's own property has an accessor descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property has an accessor\n descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isAccessorProperty( obj, 'boop' )\n false\n > bool = isAccessorProperty( obj, 'beep' )\n true\n\n See Also\n --------\n hasOwnProp, isAccessorPropertyIn, isDataProperty\n",
"isAccessorPropertyIn": "\nisAccessorPropertyIn( value, property )\n Tests if an object's own or inherited property has an accessor descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property has an\n accessor descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isAccessorPropertyIn( obj, 'boop' )\n false\n > bool = isAccessorPropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n hasProp, isAccessorProperty, isDataPropertyIn\n",
"isAlphagram": "\nisAlphagram( value )\n Tests if a value is an alphagram (i.e., a sequence of characters arranged in\n alphabetical order).\n\n The function first checks that an input value is a string before validating\n that the value is an alphagram. For non-string values, the function returns\n `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an alphagram.\n\n Examples\n --------\n > var out = isAlphagram( 'beep' )\n true\n > out = isAlphagram( 'zba' )\n false\n > out = isAlphagram( '' )\n false\n\n See Also\n --------\n isAnagram\n",
"isAlphaNumeric": "\nisAlphaNumeric( str )\n Tests whether a string contains only alphanumeric characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only alphanumeric\n characters.\n\n Examples\n --------\n > var bool = isAlphaNumeric( 'abc0123456789' )\n true\n > bool = isAlphaNumeric( 'abcdef' )\n true\n > bool = isAlphaNumeric( '0xff' )\n true\n > bool = isAlphaNumeric( '' )\n false\n\n See Also\n --------\n isDigitString\n",
"isAnagram": "\nisAnagram( str, value )\n Tests if a value is an anagram.\n\n Parameters\n ----------\n str: string\n Comparison string.\n\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an anagram.\n\n Examples\n --------\n > var str1 = 'I am a weakish speller';\n > var str2 = 'William Shakespeare';\n > var bool = isAnagram( str1, str2 )\n true\n > bool = isAnagram( 'bat', 'tabba' )\n false\n\n See Also\n --------\n isAlphagram\n",
"isArguments": "\nisArguments( value )\n Tests if a value is an arguments object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an arguments object.\n\n Examples\n --------\n > function foo() { return arguments; };\n > var bool = isArguments( foo() )\n true\n > bool = isArguments( [] )\n false\n\n",
"isArray": "\nisArray( value )\n Tests if a value is an array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array.\n\n Examples\n --------\n > var bool = isArray( [] )\n true\n > bool = isArray( {} )\n false\n\n See Also\n --------\n isArrayLike\n",
"isArrayArray": "\nisArrayArray( value )\n Tests if a value is an array of arrays.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of arrays.\n\n Examples\n --------\n > var bool = isArrayArray( [ [], [] ] )\n true\n > bool = isArrayArray( [ {}, {} ] )\n false\n > bool = isArrayArray( [] )\n false\n\n",
"isArrayBuffer": "\nisArrayBuffer( value )\n Tests if a value is an ArrayBuffer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an ArrayBuffer.\n\n Examples\n --------\n > var bool = isArrayBuffer( new ArrayBuffer( 10 ) )\n true\n > bool = isArrayBuffer( [] )\n false\n\n See Also\n --------\n isSharedArrayBuffer, isTypedArray\n",
"isArrayLength": "\nisArrayLength( value )\n Tests if a value is a valid array length.\n\n A valid length property for an Array instance is any integer value on the\n interval [0, 2^32-1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a valid array length.\n\n Examples\n --------\n > var bool = isArrayLength( 5 )\n true\n > bool = isArrayLength( 2.0e200 )\n false\n > bool = isArrayLength( -3.14 )\n false\n > bool = isArrayLength( null )\n false\n\n See Also\n --------\n isArray\n",
"isArrayLike": "\nisArrayLike( value )\n Tests if a value is array-like.\n\n If provided a string, the function returns `true`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is array-like.\n\n Examples\n --------\n > var bool = isArrayLike( [] )\n true\n > bool = isArrayLike( { 'length': 10 } )\n true\n > bool = isArrayLike( 'beep' )\n true\n > bool = isArrayLike( null )\n false\n\n See Also\n --------\n isArray, isArrayLikeObject\n",
"isArrayLikeObject": "\nisArrayLikeObject( value )\n Tests if a value is an array-like object.\n\n If provided a string, the function returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object.\n\n Examples\n --------\n > var bool = isArrayLikeObject( [] )\n true\n > bool = isArrayLikeObject( { 'length': 10 } )\n true\n > bool = isArrayLikeObject( 'beep' )\n false\n\n See Also\n --------\n isArray, isArrayLike\n",
"isASCII": "\nisASCII( str )\n Tests whether a character belongs to the ASCII character set and whether\n this is true for all characters in a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string has all ASCII characters.\n\n Examples\n --------\n > var str = 'beep boop';\n > var bool = isASCII( str )\n true\n > bool = isASCII( fromCodePoint( 130 ) )\n false\n\n See Also\n --------\n isString\n",
"isBetween": "\nisBetween( value, a, b[, left, right] )\n Tests if a value is between two values.\n\n Parameters\n ----------\n value: any\n Input value.\n\n a: any\n Left comparison value.\n\n b: any\n Right comparison value.\n\n left: string (optional)\n Indicates whether the left comparison value is inclusive. Must be either\n 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n right: string (optional)\n Indicates whether the right comparison value is inclusive. Must be\n either 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is between two values.\n\n Examples\n --------\n > var bool = isBetween( 3.14, 3.0, 4.0 )\n true\n > bool = isBetween( 3.0, 3.0, 4.0 )\n true\n > bool = isBetween( 4.0, 3.0, 4.0 )\n true\n > bool = isBetween( 3.0, 3.14, 4.0 )\n false\n > bool = isBetween( 3.14, 3.14, 4.0, 'open', 'closed' )\n false\n > bool = isBetween( 3.14, 3.0, 3.14, 'closed', 'open' )\n false\n\n See Also\n --------\n isBetweenArray\n",
"isBetweenArray": "\nisBetweenArray( value, a, b[, left, right] )\n Tests if a value is an array-like object where every element is between two\n values.\n\n Parameters\n ----------\n value: any\n Input value.\n\n a: any\n Left comparison value.\n\n b: any\n Right comparison value.\n\n left: string (optional)\n Indicates whether the left comparison value is inclusive. Must be either\n 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n right: string (optional)\n Indicates whether the right comparison value is inclusive. Must be\n either 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object where every\n element is between two values.\n\n Examples\n --------\n > var arr = [ 3.0, 3.14, 4.0 ];\n > var bool = isBetweenArray( arr, 3.0, 4.0 )\n true\n > bool = isBetweenArray( arr, 3.14, 4.0 )\n false\n > bool = isBetweenArray( arr, 3.0, 3.14 )\n false\n > bool = isBetweenArray( arr, 3.0, 4.0, 'open', 'closed' )\n false\n > bool = isBetweenArray( arr, 3.0, 4.0, 'closed', 'open' )\n false\n\n See Also\n --------\n isBetween\n",
"isBinaryString": "\nisBinaryString( value )\n Tests if a value is a binary string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a binary string.\n\n Examples\n --------\n > var bool = isBinaryString( '1000101' )\n true\n > bool = isBinaryString( 'beep' )\n false\n > bool = isBinaryString( '' )\n false\n\n See Also\n --------\n isString\n",
"isBoolean": "\nisBoolean( value )\n Tests if a value is a boolean.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean.\n\n Examples\n --------\n > var bool = isBoolean( false )\n true\n > bool = isBoolean( new Boolean( false ) )\n true\n\n\nisBoolean.isPrimitive( value )\n Tests if a value is a boolean primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean primitive.\n\n Examples\n --------\n > var bool = isBoolean.isPrimitive( true )\n true\n > bool = isBoolean.isPrimitive( false )\n true\n > bool = isBoolean.isPrimitive( new Boolean( true ) )\n false\n\n\nisBoolean.isObject( value )\n Tests if a value is a boolean object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean object.\n\n Examples\n --------\n > var bool = isBoolean.isObject( true )\n false\n > bool = isBoolean.isObject( new Boolean( false ) )\n true\n\n",
"isBooleanArray": "\nisBooleanArray( value )\n Tests if a value is an array-like object of booleans.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object of booleans.\n\n Examples\n --------\n > var bool = isBooleanArray( [ true, false, true ] )\n true\n > bool = isBooleanArray( [ true, 'abc', false ] )\n false\n\n\nisBooleanArray.primitives( value )\n Tests if a value is an array-like object containing only boolean primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n boolean primitives.\n\n Examples\n --------\n > var bool = isBooleanArray.primitives( [ true, false ] )\n true\n > bool = isBooleanArray.primitives( [ false, new Boolean( true ) ] )\n false\n\n\nisBooleanArray.objects( value )\n Tests if a value is an array-like object containing only Boolean objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n Boolean objects.\n\n Examples\n --------\n > var bool = isBooleanArray.objects( [ new Boolean( false ), true ] )\n false\n > bool = isBooleanArray.objects( [ new Boolean( false ), new Boolean( true ) ] )\n true\n\n",
"isBoxedPrimitive": "\nisBoxedPrimitive( value )\n Tests if a value is a JavaScript boxed primitive.\n\n Boxed primitive objects can be created with one of the following:\n\n - new Boolean()\n - new Number()\n - new String()\n - Object( Symbol() ) (ES6/ES2015)\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a JavaScript boxed primitive.\n\n Examples\n --------\n > var bool = isBoxedPrimitive( new Boolean( false ) )\n true\n > bool = isBoxedPrimitive( true )\n false\n\n See Also\n --------\n isPrimitive\n",
"isBuffer": "\nisBuffer( value )\n Tests if a value is a Buffer instance.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Buffer instance.\n\n Examples\n --------\n > var bool = isBuffer( new Buffer( 'beep' ) )\n true\n > bool = isBuffer( new Buffer( [ 1, 2, 3, 4 ] ) )\n true\n > bool = isBuffer( {} )\n false\n > bool = isBuffer( [] )\n false\n\n",
"isCapitalized": "\nisCapitalized( value )\n Tests if a value is a string having an uppercase first character.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string with an uppercase first\n character.\n\n Examples\n --------\n > var bool = isCapitalized( 'Hello' )\n true\n > bool = isCapitalized( 'world' )\n false\n\n See Also\n --------\n isString\n",
"isCentrosymmetricMatrix": "\nisCentrosymmetricMatrix( value )\n Tests if a value is a matrix which is symmetric about its center.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a centrosymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isCentrosymmetricMatrix( M )\n true\n > bool = isCentrosymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isCentrosymmetricMatrix( 3.14 )\n false\n > bool = isCentrosymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isCircular": "\nisCircular( value )\n Tests if an object-like value contains a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an object-like value contains a circular\n reference.\n\n Examples\n --------\n > var obj = { 'beep': 'boop' };\n > obj.self = obj;\n > var bool = isCircular( obj )\n true\n > bool = isCircular( {} )\n false\n > bool = isCircular( null )\n false\n\n See Also\n --------\n isCircularArray, isCircularPlainObject\n",
"isCircularArray": "\nisCircularArray( value )\n Tests if a value is an array containing a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing a\n circular reference.\n\n Examples\n --------\n > var arr = [ 1, 2, 3 ];\n > arr.push( arr );\n > var bool = isCircularArray( arr )\n true\n > bool = isCircularArray( [] )\n false\n > bool = isCircularArray( null )\n false\n\n See Also\n --------\n isCircular, isCircularPlainObject\n",
"isCircularPlainObject": "\nisCircularPlainObject( value )\n Tests if a value is a plain object containing a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a plain object containing a\n circular reference.\n\n Examples\n --------\n > var obj = { 'beep': 'boop' };\n > obj.self = obj;\n > var bool = isCircularPlainObject( obj )\n true\n > bool = isCircularPlainObject( {} )\n false\n > bool = isCircularPlainObject( null )\n false\n\n See Also\n --------\n isCircular, isCircularArray\n",
"isCollection": "\nisCollection( value )\n Tests if a value is a collection.\n\n A collection is defined as an array, typed array, or an array-like object\n (excluding strings and functions).\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a collection.\n\n Examples\n --------\n > var bool = isCollection( [] )\n true\n > bool = isCollection( { 'length': 0 } )\n true\n > bool = isCollection( {} )\n false\n\n See Also\n --------\n isArrayLike\n",
"isComplex": "\nisComplex( value )\n Tests if a value is a 64-bit or 128-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 64-bit or 128-bit complex\n number.\n\n Examples\n --------\n > var bool = isComplex( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplex( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplex( 3.14 )\n false\n > bool = isComplex( {} )\n false\n\n See Also\n --------\n isComplex64, isComplex128\n",
"isComplex64": "\nisComplex64( value )\n Tests if a value is a 64-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 64-bit complex number.\n\n Examples\n --------\n > var bool = isComplex64( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplex64( new Complex128( 3.0, 1.0 ) )\n false\n > bool = isComplex64( 3.14 )\n false\n > bool = isComplex64( {} )\n false\n\n See Also\n --------\n isComplex, isComplex128\n",
"isComplex64Array": "\nisComplex64Array( value )\n Tests if a value is a Complex64Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Complex64Array.\n\n Examples\n --------\n > var bool = isComplex64Array( new Complex64Array( 10 ) )\n true\n > bool = isComplex64Array( [] )\n false\n\n See Also\n --------\n isComplex, isComplex64, isComplex128Array, isComplexTypedArray\n",
"isComplex128": "\nisComplex128( value )\n Tests if a value is a 128-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 128-bit complex number.\n\n Examples\n --------\n > var bool = isComplex128( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplex128( new Complex64( 2.0, 2.0 ) )\n false\n > bool = isComplex128( 3.14 )\n false\n > bool = isComplex128( {} )\n false\n\n See Also\n --------\n isComplex, isComplex64\n",
"isComplex128Array": "\nisComplex128Array( value )\n Tests if a value is a Complex128Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Complex128Array.\n\n Examples\n --------\n > var bool = isComplex128Array( new Complex128Array( 10 ) )\n true\n > bool = isComplex128Array( [] )\n false\n\n See Also\n --------\n isComplex, isComplex128, isComplex64Array, isComplexTypedArray\n",
"isComplexLike": "\nisComplexLike( value )\n Tests if a value is a complex number-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a complex number-like object.\n\n Examples\n --------\n > var bool = isComplexLike( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplexLike( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplexLike( 3.14 )\n false\n > bool = isComplexLike( {} )\n false\n\n See Also\n --------\n isComplex, isComplex64, isComplex128\n",
"isComplexTypedArray": "\nisComplexTypedArray( value )\n Tests if a value is a complex typed array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a complex typed array.\n\n Examples\n --------\n > var bool = isComplexTypedArray( new Complex64Array( 10 ) )\n true\n\n See Also\n --------\n isComplex, isComplex64Array, isComplex128Array\n",
"isConfigurableProperty": "\nisConfigurableProperty( value, property )\n Tests if an object's own property is configurable.\n\n A property is configurable if the property may be deleted or its descriptor\n may be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isConfigurableProperty( obj, 'boop' )\n true\n > bool = isConfigurableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isConfigurablePropertyIn": "\nisConfigurablePropertyIn( value, property )\n Tests if an object's own or inherited property is configurable.\n\n A property is configurable if the property may be deleted or its descriptor\n may be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is\n configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isConfigurablePropertyIn( obj, 'boop' )\n true\n > bool = isConfigurablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurableProperty, isEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isDataProperty": "\nisDataProperty( value, property )\n Tests if an object's own property has a data descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property has a data descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isDataProperty( obj, 'boop' )\n true\n > bool = isDataProperty( obj, 'beep' )\n false\n\n See Also\n --------\n hasOwnProp, isAccessorProperty, isDataPropertyIn\n",
"isDataPropertyIn": "\nisDataPropertyIn( value, property )\n Tests if an object's own or inherited property has a data descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property has a data\n descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isDataPropertyIn( obj, 'boop' )\n true\n > bool = isDataPropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n hasProp, isAccessorPropertyIn, isDataProperty\n",
"isDateObject": "\nisDateObject( value )\n Tests if a value is a Date object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Date object.\n\n Examples\n --------\n > var bool = isDateObject( new Date() )\n true\n > bool = isDateObject( '2017-01-01' )\n false\n\n",
"isDigitString": "\nisDigitString( str )\n Tests whether a string contains only numeric digits.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only numeric digits.\n\n Examples\n --------\n > var bool = isDigitString( '0123456789' )\n true\n > bool = isDigitString( 'abcdef' )\n false\n > bool = isDigitString( '0xff' )\n false\n > bool = isDigitString( '' )\n false\n\n See Also\n --------\n isHexString, isString\n",
"isEmailAddress": "\nisEmailAddress( value )\n Tests if a value is an email address.\n\n Validation is not rigorous. *9* RFCs relate to email addresses, and\n accounting for all of them is a fool's errand. The function performs the\n simplest validation; i.e., requiring at least one `@` symbol.\n\n For rigorous validation, send a confirmation email. If the email bounces,\n consider the email invalid.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an email address.\n\n Examples\n --------\n > var bool = isEmailAddress( '[email protected]' )\n true\n > bool = isEmailAddress( 'beep' )\n false\n > bool = isEmailAddress( null )\n false\n\n",
"isEmptyArray": "\nisEmptyArray( value )\n Tests if a value is an empty array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty array.\n\n Examples\n --------\n > var bool = isEmptyArray( [] )\n true\n > bool = isEmptyArray( [ 1, 2, 3 ] )\n false\n > bool = isEmptyArray( {} )\n false\n\n See Also\n --------\n isArray\n",
"isEmptyObject": "\nisEmptyObject( value )\n Tests if a value is an empty object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty object.\n\n Examples\n --------\n > var bool = isEmptyObject( {} )\n true\n > bool = isEmptyObject( { 'beep': 'boop' } )\n false\n > bool = isEmptyObject( [] )\n false\n\n See Also\n --------\n isObject, isPlainObject\n",
"isEmptyString": "\nisEmptyString( value )\n Tests if a value is an empty string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty string.\n\n Examples\n --------\n > var bool = isEmptyString( '' )\n true\n > bool = isEmptyString( new String( '' ) )\n true\n > bool = isEmptyString( 'beep' )\n false\n > bool = isEmptyString( [] )\n false\n\n\nisEmptyString.isPrimitive( value )\n Tests if a value is an empty string primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an empty string primitive.\n\n Examples\n --------\n > var bool = isEmptyString.isPrimitive( '' )\n true\n > bool = isEmptyString.isPrimitive( new String( '' ) )\n false\n\n\nisEmptyString.isObject( value )\n Tests if a value is an empty `String` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an empty `String` object.\n\n Examples\n --------\n > var bool = isEmptyString.isObject( new String( '' ) )\n true\n > bool = isEmptyString.isObject( '' )\n false\n\n See Also\n --------\n isString\n",
"isEnumerableProperty": "\nisEnumerableProperty( value, property )\n Tests if an object's own property is enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is enumerable.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isEnumerableProperty( beep, 'boop' )\n true\n > bool = isEnumerableProperty( beep, 'hasOwnProperty' )\n false\n\n See Also\n --------\n isConfigurableProperty, isEnumerablePropertyIn, isNonEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isEnumerablePropertyIn": "\nisEnumerablePropertyIn( value, property )\n Tests if an object's own or inherited property is enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is\n enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = true;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isEnumerablePropertyIn( obj, 'boop' )\n true\n > bool = isEnumerablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerableProperty, isNonEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isError": "\nisError( value )\n Tests if a value is an Error object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Error object.\n\n Examples\n --------\n > var bool = isError( new Error( 'beep' ) )\n true\n > bool = isError( {} )\n false\n\n",
"isEvalError": "\nisEvalError( value )\n Tests if a value is an EvalError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided an EvalError (or a descendant) object,\n false positives may occur due to the fact that the EvalError constructor\n inherits from Error and has no internal class of its own. Hence, EvalError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an EvalError object.\n\n Examples\n --------\n > var bool = isEvalError( new EvalError( 'beep' ) )\n true\n > bool = isEvalError( {} )\n false\n\n See Also\n --------\n isError\n",
"isEven": "\nisEven( value )\n Tests if a value is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether is an even number.\n\n Examples\n --------\n > var bool = isEven( 4.0 )\n true\n > bool = isEven( new Number( 4.0 ) )\n true\n > bool = isEven( 3.0 )\n false\n > bool = isEven( -3.14 )\n false\n > bool = isEven( null )\n false\n\n\nisEven.isPrimitive( value )\n Tests if a value is a number primitive that is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive that is an even\n number.\n\n Examples\n --------\n > var bool = isEven.isPrimitive( -4.0 )\n true\n > bool = isEven.isPrimitive( new Number( -4.0 ) )\n false\n\n\nisEven.isObject( value )\n Tests if a value is a number object that is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object that is an even\n number.\n\n Examples\n --------\n > var bool = isEven.isObject( 4.0 )\n false\n > bool = isEven.isObject( new Number( 4.0 ) )\n true\n\n See Also\n --------\n isOdd\n",
"isFalsy": "\nisFalsy( value )\n Tests if a value is a value which translates to `false` when evaluated in a\n boolean context.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is falsy.\n\n Examples\n --------\n > var bool = isFalsy( false )\n true\n > bool = isFalsy( '' )\n true\n > bool = isFalsy( 0 )\n true\n > bool = isFalsy( null )\n true\n > bool = isFalsy( void 0 )\n true\n > bool = isFalsy( NaN )\n true\n > bool = isFalsy( {} )\n false\n > bool = isFalsy( [] )\n false\n\n See Also\n --------\n isFalsyArray, isTruthy\n",
"isFalsyArray": "\nisFalsyArray( value )\n Tests if a value is an array-like object containing only falsy values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only falsy values.\n\n Examples\n --------\n > var bool = isFalsyArray( [ null, '' ] )\n true\n > bool = isFalsyArray( [ {}, [] ] )\n false\n > bool = isFalsyArray( [] )\n false\n\n See Also\n --------\n isFalsy, isTruthyArray\n",
"isFinite": "\nisFinite( value )\n Tests if a value is a finite number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a finite number.\n\n Examples\n --------\n > var bool = isFinite( 5.0 )\n true\n > bool = isFinite( new Number( 5.0 ) )\n true\n > bool = isFinite( 1.0/0.0 )\n false\n > bool = isFinite( null )\n false\n\n\nisFinite.isPrimitive( value )\n Tests if a value is a number primitive having a finite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive having a finite\n value.\n\n Examples\n --------\n > var bool = isFinite.isPrimitive( -3.0 )\n true\n > bool = isFinite.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisFinite.isObject( value )\n Tests if a value is a number object having a finite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a finite\n value.\n\n Examples\n --------\n > var bool = isFinite.isObject( 3.0 )\n false\n > bool = isFinite.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isFiniteArray, isInfinite\n",
"isFiniteArray": "\nisFiniteArray( value )\n Tests if a value is an array-like object of finite numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object of finite\n numbers.\n\n Examples\n --------\n > var bool = isFiniteArray( [ -3.0, new Number(0.0), 2.0 ] )\n true\n > bool = isFiniteArray( [ -3.0, 1.0/0.0 ] )\n false\n\n\nisFiniteArray.primitives( value )\n Tests if a value is an array-like object containing only primitive finite\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only primitive finite numbers.\n\n Examples\n --------\n > var bool = isFiniteArray.primitives( [ -1.0, 10.0 ] )\n true\n > bool = isFiniteArray.primitives( [ -1.0, 0.0, 5.0 ] )\n true\n > bool = isFiniteArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisFiniteArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having finite values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only number objects having finite values.\n\n Examples\n --------\n > var bool = isFiniteArray.objects( [ new Number(1.0), new Number(3.0) ] )\n true\n > bool = isFiniteArray.objects( [ -1.0, 0.0, 3.0 ] )\n false\n > bool = isFiniteArray.objects( [ 3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isFinite, isInfinite\n",
"isFloat32Array": "\nisFloat32Array( value )\n Tests if a value is a Float32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Float32Array.\n\n Examples\n --------\n > var bool = isFloat32Array( new Float32Array( 10 ) )\n true\n > bool = isFloat32Array( [] )\n false\n\n See Also\n --------\n isFloat64Array\n",
"isFloat64Array": "\nisFloat64Array( value )\n Tests if a value is a Float64Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Float64Array.\n\n Examples\n --------\n > var bool = isFloat64Array( new Float64Array( 10 ) )\n true\n > bool = isFloat64Array( [] )\n false\n\n See Also\n --------\n isFloat32Array\n",
"isFunction": "\nisFunction( value )\n Tests if a value is a function.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a function.\n\n Examples\n --------\n > function beep() {};\n > var bool = isFunction( beep )\n true\n > bool = isFunction( {} )\n false\n\n",
"isFunctionArray": "\nisFunctionArray( value )\n Tests if a value is an array-like object containing only functions.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n functions.\n\n Examples\n --------\n > function beep() {};\n > function boop() {};\n > var bool = isFunctionArray( [ beep, boop ] )\n true\n > bool = isFunctionArray( [ {}, beep ] )\n false\n > bool = isFunctionArray( [] )\n false\n\n See Also\n --------\n isArray\n",
"isGeneratorObject": "\nisGeneratorObject( value )\n Tests if a value is a generator object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a generator object.\n\n Examples\n --------\n > function* generateID() {\n ... var idx = 0;\n ... while ( idx < idx+1 ) {\n ... yield idx;\n ... idx += 1;\n ... }\n ... };\n > var bool = isGeneratorObject( generateID() )\n true\n > bool = isGeneratorObject( generateID )\n false\n > bool = isGeneratorObject( {} )\n false\n > bool = isGeneratorObject( null )\n false\n\n See Also\n --------\n hasGeneratorSupport, isGeneratorObjectLike\n",
"isGeneratorObjectLike": "\nisGeneratorObjectLike( value )\n Tests if a value is generator object-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is generator object-like.\n\n Examples\n --------\n > var obj = {\n ... 'next': function noop() {},\n ... 'return': function noop() {},\n ... 'throw': function noop() {}\n ... };\n > var bool = isGeneratorObjectLike( obj )\n true\n > bool = isGeneratorObjectLike( {} )\n false\n > bool = isGeneratorObjectLike( null )\n false\n\n See Also\n --------\n hasGeneratorSupport, isGeneratorObject\n",
"isHexString": "\nisHexString( str )\n Tests whether a string contains only hexadecimal digits.\n\n The function does not recognize `x` (as in the standard `0x` prefix).\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only hexadecimal digits.\n\n Examples\n --------\n > var bool = isHexString( '0123456789abcdefABCDEF' )\n true\n > bool = isHexString( '0xffffff' )\n false\n > bool = isHexString( 'x' )\n false\n > bool = isHexString( '' )\n false\n\n See Also\n --------\n isString\n",
"isInfinite": "\nisInfinite( value )\n Tests if a value is an infinite number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an infinite number.\n\n Examples\n --------\n > var bool = isInfinite( 1.0/0.0 )\n true\n > bool = isInfinite( new Number( -1.0/0.0 ) )\n true\n > bool = isInfinite( 5.0 )\n false\n > bool = isInfinite( '1.0/0.0' )\n false\n\n\nisInfinite.isPrimitive( value )\n Tests if a value is a number primitive having an infinite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive having an\n infinite value.\n\n Examples\n --------\n > var bool = isInfinite.isPrimitive( -1.0/0.0 )\n true\n > bool = isInfinite.isPrimitive( new Number( -1.0/0.0 ) )\n false\n\n\nisInfinite.isObject( value )\n Tests if a value is a number object having an infinite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having an infinite\n value.\n\n Examples\n --------\n > var bool = isInfinite.isObject( 1.0/0.0 )\n false\n > bool = isInfinite.isObject( new Number( 1.0/0.0 ) )\n true\n\n See Also\n --------\n isFinite\n",
"isInheritedProperty": "\nisInheritedProperty( value, property )\n Tests if an object has an inherited property.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has an inherited property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isInheritedProperty( beep, 'boop' )\n false\n > bool = isInheritedProperty( beep, 'toString' )\n true\n > bool = isInheritedProperty( beep, 'bop' )\n false\n\n See Also\n --------\n hasOwnProp, hasProp\n",
"isInt8Array": "\nisInt8Array( value )\n Tests if a value is an Int8Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int8Array.\n\n Examples\n --------\n > var bool = isInt8Array( new Int8Array( 10 ) )\n true\n > bool = isInt8Array( [] )\n false\n\n See Also\n --------\n isInt16Array, isInt32Array\n",
"isInt16Array": "\nisInt16Array( value )\n Tests if a value is an Int16Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int16Array.\n\n Examples\n --------\n > var bool = isInt16Array( new Int16Array( 10 ) )\n true\n > bool = isInt16Array( [] )\n false\n\n See Also\n --------\n isInt32Array, isInt8Array\n",
"isInt32Array": "\nisInt32Array( value )\n Tests if a value is an Int32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int32Array.\n\n Examples\n --------\n > var bool = isInt32Array( new Int32Array( 10 ) )\n true\n > bool = isInt32Array( [] )\n false\n\n See Also\n --------\n isInt16Array, isInt8Array\n",
"isInteger": "\nisInteger( value )\n Tests if a value is an integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an integer.\n\n Examples\n --------\n > var bool = isInteger( 5.0 )\n true\n > bool = isInteger( new Number( 5.0 ) )\n true\n > bool = isInteger( -3.14 )\n false\n > bool = isInteger( null )\n false\n\n\nisInteger.isPrimitive( value )\n Tests if a value is a number primitive having an integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having an integer\n value.\n\n Examples\n --------\n > var bool = isInteger.isPrimitive( -3.0 )\n true\n > bool = isInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisInteger.isObject( value )\n Tests if a value is a number object having an integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having an integer\n value.\n\n Examples\n --------\n > var bool = isInteger.isObject( 3.0 )\n false\n > bool = isInteger.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isNumber\n",
"isIntegerArray": "\nisIntegerArray( value )\n Tests if a value is an array-like object of integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object of integer\n values.\n\n Examples\n --------\n > var bool = isIntegerArray( [ -3.0, new Number(0.0), 2.0 ] )\n true\n > bool = isIntegerArray( [ -3.0, '3.0' ] )\n false\n\n\nisIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only primitive integer\n values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only primitive integer values.\n\n Examples\n --------\n > var bool = isIntegerArray.primitives( [ -1.0, 10.0 ] )\n true\n > bool = isIntegerArray.primitives( [ -1.0, 0.0, 5.0 ] )\n true\n > bool = isIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only number objects having integer values.\n\n Examples\n --------\n > var bool = isIntegerArray.objects( [ new Number(1.0), new Number(3.0) ] )\n true\n > bool = isIntegerArray.objects( [ -1.0, 0.0, 3.0 ] )\n false\n > bool = isIntegerArray.objects( [ 3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isJSON": "\nisJSON( value )\n Tests if a value is a parseable JSON string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a parseable JSON string.\n\n Examples\n --------\n > var bool = isJSON( '{\"a\":5}' )\n true\n > bool = isJSON( '{a\":5}' )\n false\n\n",
"isLeapYear": "\nisLeapYear( value )\n Tests whether a value corresponds to a leap year in the Gregorian calendar.\n\n A leap year is defined as any year which is exactly divisible by 4, except\n for years which are exactly divisible by 100 and not by 400. In this\n definition, 100 corresponds to years marking a new century, and 400\n corresponds to the length of the *leap cycle*.\n\n If not provided any arguments, the function returns a boolean indicating\n if the current year (according to local time) is a leap year.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value corresponds to a leap year.\n\n Examples\n --------\n > var bool = isLeapYear( new Date() )\n <boolean>\n > bool = isLeapYear( 1996 )\n true\n > bool = isLeapYear( 2001 )\n false\n\n",
"isLowercase": "\nisLowercase( value )\n Tests if a value is a lowercase string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a lowercase string.\n\n Examples\n --------\n > var bool = isLowercase( 'hello' )\n true\n > bool = isLowercase( 'World' )\n false\n\n See Also\n --------\n isString, isUppercase\n",
"isMatrixLike": "\nisMatrixLike( value )\n Tests if a value is a 2-dimensional ndarray-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 2-dimensional ndarray-like\n object.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 2;\n > M.shape = [ 2, 2 ];\n > M.strides = [ 2, 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isMatrixLike( M )\n true\n > bool = isMatrixLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isMatrixLike( 3.14 )\n false\n > bool = isMatrixLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isndarrayLike, isTypedArrayLike, isVectorLike\n",
"isMethod": "\nisMethod( value, property )\n Tests if an object has a specified method name.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Property arguments are coerced to strings.\n\n The function only searches own properties.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified method name.\n\n Examples\n --------\n > var beep = { 'boop': function beep() { return 'beep'; } };\n > var bool = isMethod( beep, 'boop' )\n true\n > bool = isMethod( beep, 'toString' )\n false\n\n See Also\n --------\n hasOwnProp, isFunction, isMethodIn\n",
"isMethodIn": "\nisMethodIn( value, property )\n Tests if an object has a specified method name, either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified method name.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isMethodIn( beep, 'toString' )\n true\n > bool = isMethodIn( beep, 'boop' )\n false\n > bool = isMethodIn( beep, 'bop' )\n false\n\n See Also\n --------\n hasProp, isFunction, isMethod\n",
"isNamedTypedTupleLike": "\nisNamedTypedTupleLike( value )\n Tests if a value is named typed tuple-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is named typed tuple-like.\n\n Examples\n --------\n > var Point = namedtypedtuple( [ 'x', 'y' ] );\n > var p = new Point();\n > var bool = isNamedTypedTupleLike( p )\n true\n > bool = isNamedTypedTupleLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isNamedTypedTupleLike( 3.14 )\n false\n > bool = isNamedTypedTupleLike( {} )\n false\n\n See Also\n --------\n namedtypedtuple\n",
"isnan": "\nisnan( value )\n Tests if a value is NaN.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is NaN.\n\n Examples\n --------\n > var bool = isnan( NaN )\n true\n > bool = isnan( new Number( NaN ) )\n true\n > bool = isnan( 3.14 )\n false\n > bool = isnan( null )\n false\n\n\nisnan.isPrimitive( value )\n Tests if a value is a NaN number primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a NaN number primitive.\n\n Examples\n --------\n > var bool = isnan.isPrimitive( NaN )\n true\n > bool = isnan.isPrimitive( 3.14 )\n false\n > bool = isnan.isPrimitive( new Number( NaN ) )\n false\n\n\nisnan.isObject( value )\n Tests if a value is a number object having a value of NaN.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a value of\n NaN.\n\n Examples\n --------\n > var bool = isnan.isObject( NaN )\n false\n > bool = isnan.isObject( new Number( NaN ) )\n true\n\n See Also\n --------\n isNumber\n",
"isNaNArray": "\nisNaNArray( value )\n Tests if a value is an array-like object containing only NaN values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n NaN values.\n\n Examples\n --------\n > var bool = isNaNArray( [ NaN, NaN, NaN ] )\n true\n > bool = isNaNArray( [ NaN, 2 ] )\n false\n\n\nisNaNArray.primitives( value )\n Tests if a value is an array-like object containing only primitive NaN\n values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive NaN values.\n\n Examples\n --------\n > var bool = isNaNArray.primitives( [ NaN, new Number( NaN ) ] )\n false\n > bool = isNaNArray.primitives( [ NaN, NaN, NaN ] )\n true\n\n\nisNaNArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having NaN values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having NaN values.\n\n Examples\n --------\n > var bool = isNaNArray.objects( [ new Number( NaN ), new Number( NaN ) ] )\n true\n > bool = isNaNArray.objects( [ NaN, new Number( NaN ), new Number( NaN ) ] )\n false\n > bool = isNaNArray.objects( [ NaN, NaN, NaN ] )\n false\n\n See Also\n --------\n isnan\n",
"isNativeFunction": "\nisNativeFunction( value )\n Tests if a value is a native function.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a native function.\n\n Examples\n --------\n > var bool = isNativeFunction( Date )\n true\n > function beep() {};\n > bool = isNativeFunction( beep )\n false\n > bool = isNativeFunction( {} )\n false\n\n See Also\n --------\n isFunction\n",
"isndarrayLike": "\nisndarrayLike( value )\n Tests if a value is ndarray-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is ndarray-like.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 2;\n > M.shape = [ 2, 2 ];\n > M.strides = [ 2, 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isndarrayLike( M )\n true\n > bool = isndarrayLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isndarrayLike( 3.14 )\n false\n > bool = isndarrayLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isMatrixLike, isTypedArrayLike, isVectorLike\n",
"isNegativeInteger": "\nisNegativeInteger( value )\n Tests if a value is a negative integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a negative integer.\n\n Examples\n --------\n > var bool = isNegativeInteger( -5.0 )\n true\n > bool = isNegativeInteger( new Number( -5.0 ) )\n true\n > bool = isNegativeInteger( 5.0 )\n false\n > bool = isNegativeInteger( -3.14 )\n false\n > bool = isNegativeInteger( null )\n false\n\n\nisNegativeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a negative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a negative\n integer value.\n\n Examples\n --------\n > var bool = isNegativeInteger.isPrimitive( -3.0 )\n true\n > bool = isNegativeInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNegativeInteger.isObject( value )\n Tests if a value is a number object having a negative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a negative\n integer value.\n\n Examples\n --------\n > var bool = isNegativeInteger.isObject( -3.0 )\n false\n > bool = isNegativeInteger.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNegativeIntegerArray": "\nisNegativeIntegerArray( value )\n Tests if a value is an array-like object containing only negative integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative integers.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNegativeIntegerArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNegativeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only negative primitive\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative primitive integer values.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray.primitives( [ -1.0, -10.0 ] )\n true\n > bool = isNegativeIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNegativeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having negative integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having negative integer values.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNegativeIntegerArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeIntegerArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNegativeNumber": "\nisNegativeNumber( value )\n Tests if a value is a negative number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a negative number.\n\n Examples\n --------\n > var bool = isNegativeNumber( -5.0 )\n true\n > bool = isNegativeNumber( new Number( -5.0 ) )\n true\n > bool = isNegativeNumber( -3.14 )\n true\n > bool = isNegativeNumber( 5.0 )\n false\n > bool = isNegativeNumber( null )\n false\n\n\nisNegativeNumber.isPrimitive( value )\n Tests if a value is a number primitive having a negative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a negative\n value.\n\n Examples\n --------\n > var bool = isNegativeNumber.isPrimitive( -3.0 )\n true\n > bool = isNegativeNumber.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNegativeNumber.isObject( value )\n Tests if a value is a number object having a negative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a negative\n value.\n\n Examples\n --------\n > var bool = isNegativeNumber.isObject( -3.0 )\n false\n > bool = isNegativeNumber.isObject( new Number( -3.0 ) )\n true\n\n See Also\n --------\n isNumber\n",
"isNegativeNumberArray": "\nisNegativeNumberArray( value )\n Tests if a value is an array-like object containing only negative numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative numbers.\n\n Examples\n --------\n > var bool = isNegativeNumberArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNegativeNumberArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNegativeNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive negative\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive negative numbers.\n\n Examples\n --------\n > var bool = isNegativeNumberArray.primitives( [ -1.0, -10.0 ] )\n true\n > bool = isNegativeNumberArray.primitives( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeNumberArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNegativeNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having negative number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having negative number values.\n\n Examples\n --------\n > var bool = isNegativeNumberArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNegativeNumberArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeNumberArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNegativeZero": "\nisNegativeZero( value )\n Tests if a value is negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero( -0.0 )\n true\n > bool = isNegativeZero( new Number( -0.0 ) )\n true\n > bool = isNegativeZero( -3.14 )\n false\n > bool = isNegativeZero( 0.0 )\n false\n > bool = isNegativeZero( null )\n false\n\n\nisNegativeZero.isPrimitive( value )\n Tests if a value is a number primitive equal to negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive equal to\n negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero.isPrimitive( -0.0 )\n true\n > bool = isNegativeZero.isPrimitive( new Number( -0.0 ) )\n false\n\n\nisNegativeZero.isObject( value )\n Tests if a value is a number object having a value equal to negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a value\n equal to negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero.isObject( -0.0 )\n false\n > bool = isNegativeZero.isObject( new Number( -0.0 ) )\n true\n\n See Also\n --------\n isNumber, isPositiveZero\n",
"isNodeBuiltin": "\nisNodeBuiltin( str )\n Tests whether a string matches a Node.js built-in module name.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string matches a Node.js built-in module\n name.\n\n Examples\n --------\n > var bool = isNodeBuiltin( 'cluster' )\n true\n > bool = isNodeBuiltin( 'crypto' )\n true\n > bool = isNodeBuiltin( 'fs-extra' )\n false\n > bool = isNodeBuiltin( '' )\n false\n\n",
"isNodeDuplexStreamLike": "\nisNodeDuplexStreamLike( value )\n Tests if a value is Node duplex stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node duplex stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Duplex;\n > s = new Stream();\n > var bool = isNodeDuplexStreamLike( s )\n true\n > bool = isNodeDuplexStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeReadableStreamLike": "\nisNodeReadableStreamLike( value )\n Tests if a value is Node readable stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node readable stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Readable;\n > s = new Stream();\n > var bool = isNodeReadableStreamLike( s )\n true\n > bool = isNodeReadableStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeREPL": "\nisNodeREPL()\n Returns a boolean indicating if running in a Node.js REPL environment.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if running in a Node.js REPL environment.\n\n Examples\n --------\n > var bool = isNodeREPL()\n <boolean>\n\n",
"isNodeStreamLike": "\nisNodeStreamLike( value )\n Tests if a value is Node stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Stream;\n > s = new Stream();\n > var bool = isNodeStreamLike( s )\n true\n > bool = isNodeStreamLike( {} )\n false\n\n",
"isNodeTransformStreamLike": "\nisNodeTransformStreamLike( value )\n Tests if a value is Node transform stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node transform stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Transform;\n > s = new Stream();\n > var bool = isNodeTransformStreamLike( s )\n true\n > bool = isNodeTransformStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeWritableStreamLike": "\nisNodeWritableStreamLike( value )\n Tests if a value is Node writable stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node writable stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Writable;\n > s = new Stream();\n > var bool = isNodeWritableStreamLike( s )\n true\n > bool = isNodeWritableStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNonConfigurableProperty": "\nisNonConfigurableProperty( value, property )\n Tests if an object's own property is non-configurable.\n\n A non-configurable property is a property which cannot be deleted and whose\n descriptor cannot be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is non-configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonConfigurableProperty( obj, 'boop' )\n false\n > bool = isNonConfigurableProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurableProperty, isEnumerableProperty, isNonConfigurablePropertyIn, isNonEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isNonConfigurablePropertyIn": "\nisNonConfigurablePropertyIn( value, property )\n Tests if an object's own or inherited property is non-configurable.\n\n A non-configurable property is a property which cannot be deleted and whose\n descriptor cannot be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is non-\n configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonConfigurablePropertyIn( obj, 'boop' )\n false\n > bool = isNonConfigurablePropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerablePropertyIn, isNonConfigurableProperty, isNonEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isNonEnumerableProperty": "\nisNonEnumerableProperty( value, property )\n Tests if an object's own property is non-enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is non-enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonEnumerableProperty( obj, 'boop' )\n false\n > bool = isNonEnumerableProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurableProperty, isEnumerableProperty, isNonConfigurableProperty, isNonEnumerablePropertyIn, isReadableProperty, isWritableProperty\n",
"isNonEnumerablePropertyIn": "\nisNonEnumerablePropertyIn( value, property )\n Tests if an object's own or inherited property is non-enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is non-\n enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = true;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonEnumerablePropertyIn( obj, 'boop' )\n false\n > bool = isNonEnumerablePropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerablePropertyIn, isNonConfigurablePropertyIn, isNonEnumerableProperty, isReadablePropertyIn, isWritablePropertyIn\n",
"isNonNegativeInteger": "\nisNonNegativeInteger( value )\n Tests if a value is a nonnegative integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonnegative integer.\n\n Examples\n --------\n > var bool = isNonNegativeInteger( 5.0 )\n true\n > bool = isNonNegativeInteger( new Number( 5.0 ) )\n true\n > bool = isNonNegativeInteger( 3.14 )\n false\n > bool = isNonNegativeInteger( -5.0 )\n false\n > bool = isNonNegativeInteger( null )\n false\n\n\nisNonNegativeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a nonnegative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonnegative integer value.\n\n Examples\n --------\n > var bool = isNonNegativeInteger.isPrimitive( 3.0 )\n true\n > bool = isNonNegativeInteger.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisNonNegativeInteger.isObject( value )\n Tests if a value is a number object having a nonnegative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonnegative\n integer value.\n\n Examples\n --------\n > var bool = isNonNegativeInteger.isObject( 3.0 )\n false\n > bool = isNonNegativeInteger.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNonNegativeIntegerArray": "\nisNonNegativeIntegerArray( value )\n Tests if a value is an array-like object containing only nonnegative\n integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative integers.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] )\n false\n\n\nisNonNegativeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only nonnegative\n primitive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative primitive integer values.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] )\n true\n > bool = isNonNegativeIntegerArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisNonNegativeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonnegative integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonnegative integer values.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isNonNegativeIntegerArray.objects( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isNonNegativeIntegerArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonNegativeNumber": "\nisNonNegativeNumber( value )\n Tests if a value is a nonnegative number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonnegative number.\n\n Examples\n --------\n > var bool = isNonNegativeNumber( 5.0 )\n true\n > bool = isNonNegativeNumber( new Number( 5.0 ) )\n true\n > bool = isNonNegativeNumber( 3.14 )\n true\n > bool = isNonNegativeNumber( -5.0 )\n false\n > bool = isNonNegativeNumber( null )\n false\n\n\nisNonNegativeNumber.isPrimitive( value )\n Tests if a value is a number primitive having a nonnegative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonnegative value.\n\n Examples\n --------\n > var bool = isNonNegativeNumber.isPrimitive( 3.0 )\n true\n > bool = isNonNegativeNumber.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisNonNegativeNumber.isObject( value )\n Tests if a value is a number object having a nonnegative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonnegative\n value.\n\n Examples\n --------\n > var bool = isNonNegativeNumber.isObject( 3.0 )\n false\n > bool = isNonNegativeNumber.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isNonNegativeNumberArray": "\nisNonNegativeNumberArray( value )\n Tests if a value is an array-like object containing only nonnegative\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative numbers.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isNonNegativeNumberArray( [ 3.0, '3.0' ] )\n false\n\n\nisNonNegativeNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n nonnegative numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive nonnegative numbers.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray.primitives( [ 1.0, 0.0, 10.0 ] )\n true\n > bool = isNonNegativeNumberArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisNonNegativeNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonnegative number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonnegative number values.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isNonNegativeNumberArray.objects( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isNonNegativeNumberArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonPositiveInteger": "\nisNonPositiveInteger( value )\n Tests if a value is a nonpositive integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonpositive integer.\n\n Examples\n --------\n > var bool = isNonPositiveInteger( -5.0 )\n true\n > bool = isNonPositiveInteger( new Number( -5.0 ) )\n true\n > bool = isNonPositiveInteger( 5.0 )\n false\n > bool = isNonPositiveInteger( -3.14 )\n false\n > bool = isNonPositiveInteger( null )\n false\n\n\nisNonPositiveInteger.isPrimitive( value )\n Tests if a value is a number primitive having a nonpositive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonpositive integer value.\n\n Examples\n --------\n > var bool = isNonPositiveInteger.isPrimitive( -3.0 )\n true\n > bool = isNonPositiveInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNonPositiveInteger.isObject( value )\n Tests if a value is a number object having a nonpositive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonpositive\n integer value.\n\n Examples\n --------\n > var bool = isNonPositiveInteger.isObject( -3.0 )\n false\n > bool = isNonPositiveInteger.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNonPositiveIntegerArray": "\nisNonPositiveIntegerArray( value )\n Tests if a value is an array-like object containing only nonpositive\n integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive integers.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNonPositiveIntegerArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNonPositiveIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only nonpositive\n primitive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive primitive integer values.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] )\n true\n > bool = isNonPositiveIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNonPositiveIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonpositive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonpositive integer values.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNonPositiveIntegerArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNonPositiveIntegerArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonPositiveNumber": "\nisNonPositiveNumber( value )\n Tests if a value is a nonpositive number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonpositive number.\n\n Examples\n --------\n > var bool = isNonPositiveNumber( -5.0 )\n true\n > bool = isNonPositiveNumber( new Number( -5.0 ) )\n true\n > bool = isNonPositiveNumber( -3.14 )\n true\n > bool = isNonPositiveNumber( 5.0 )\n false\n > bool = isNonPositiveNumber( null )\n false\n\n\nisNonPositiveNumber.isPrimitive( value )\n Tests if a value is a number primitive having a nonpositive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonpositive value.\n\n Examples\n --------\n > var bool = isNonPositiveNumber.isPrimitive( -3.0 )\n true\n > bool = isNonPositiveNumber.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNonPositiveNumber.isObject( value )\n Tests if a value is a number object having a nonpositive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonpositive\n value.\n\n Examples\n --------\n > var bool = isNonPositiveNumber.isObject( -3.0 )\n false\n > bool = isNonPositiveNumber.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isNonPositiveNumberArray": "\nisNonPositiveNumberArray( value )\n Tests if a value is an array-like object containing only nonpositive\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive numbers.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNonPositiveNumberArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNonPositiveNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n nonpositive numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive nonpositive numbers.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray.primitives( [ -1.0, 0.0, -10.0 ] )\n true\n > bool = isNonPositiveNumberArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNonPositiveNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonpositive number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonpositive number values.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNonPositiveNumberArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNonPositiveNumberArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonSymmetricMatrix": "\nisNonSymmetricMatrix( value )\n Tests if a value is a non-symmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a non-symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isNonSymmetricMatrix( M )\n true\n > bool = isNonSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isNonSymmetricMatrix( 3.14 )\n false\n > bool = isNonSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isNull": "\nisNull( value )\n Tests if a value is null.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is null.\n\n Examples\n --------\n > var bool = isNull( null )\n true\n > bool = isNull( true )\n false\n\n See Also\n --------\n isUndefined, isUndefinedOrNull\n",
"isNullArray": "\nisNullArray( value )\n Tests if a value is an array-like object containing only null values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n null values.\n\n Examples\n --------\n > var bool = isNullArray( [ null, null, null ] )\n true\n > bool = isNullArray( [ NaN, 2, null ] )\n false\n\n See Also\n --------\n isArray, isNull\n",
"isNumber": "\nisNumber( value )\n Tests if a value is a number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number.\n\n Examples\n --------\n > var bool = isNumber( 3.14 )\n true\n > bool = isNumber( new Number( 3.14 ) )\n true\n > bool = isNumber( NaN )\n true\n > bool = isNumber( null )\n false\n\n\nisNumber.isPrimitive( value )\n Tests if a value is a number primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive.\n\n Examples\n --------\n > var bool = isNumber.isPrimitive( 3.14 )\n true\n > bool = isNumber.isPrimitive( NaN )\n true\n > bool = isNumber.isPrimitive( new Number( 3.14 ) )\n false\n\n\nisNumber.isObject( value )\n Tests if a value is a `Number` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `Number` object.\n\n Examples\n --------\n > var bool = isNumber.isObject( 3.14 )\n false\n > bool = isNumber.isObject( new Number( 3.14 ) )\n true\n\n",
"isNumberArray": "\nisNumberArray( value )\n Tests if a value is an array-like object containing only numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n numbers.\n\n Examples\n --------\n > var bool = isNumberArray( [ 1, 2, 3 ] )\n true\n > bool = isNumberArray( [ '1', 2, 3 ] )\n false\n\n\nisNumberArray.primitives( value )\n Tests if a value is an array-like object containing only number primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number primitives.\n\n Examples\n --------\n > var arr = [ 1, 2, 3 ];\n > var bool = isNumberArray.primitives( arr )\n true\n > arr = [ 1, new Number( 2 ) ];\n > bool = isNumberArray.primitives( arr )\n false\n\n\nisNumberArray.objects( value )\n Tests if a value is an array-like object containing only `Number` objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n `Number` objects.\n\n Examples\n --------\n > var arr = [ new Number( 1 ), new Number( 2 ) ];\n > var bool = isNumberArray.objects( arr )\n true\n > arr = [ new Number( 1 ), 2 ];\n > bool = isNumberArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isNumber, isNumericArray\n",
"isNumericArray": "\nisNumericArray( value )\n Tests if a value is a numeric array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a numeric array.\n\n Examples\n --------\n > var bool = isNumericArray( new Int8Array( 10 ) )\n true\n > bool = isNumericArray( [ 1, 2, 3 ] )\n true\n > bool = isNumericArray( [ '1', '2', '3' ] )\n false\n\n See Also\n --------\n isArray, isNumberArray, isTypedArray\n\n",
"isObject": "\nisObject( value )\n Tests if a value is an object; e.g., `{}`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an object.\n\n Examples\n --------\n > var bool = isObject( {} )\n true\n > bool = isObject( true )\n false\n\n See Also\n --------\n isObjectLike, isPlainObject\n",
"isObjectArray": "\nisObjectArray( value )\n Tests if a value is an array-like object containing only objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n objects.\n\n Examples\n --------\n > var bool = isObjectArray( [ {}, new Number(3.0) ] )\n true\n > bool = isObjectArray( [ {}, { 'beep': 'boop' } ] )\n true\n > bool = isObjectArray( [ {}, '3.0' ] )\n false\n\n See Also\n --------\n isArray, isObject\n",
"isObjectLike": "\nisObjectLike( value )\n Tests if a value is object-like.\n\n Return values are the same as would be obtained using the built-in `typeof`\n operator except that `null` is not considered an object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is object-like.\n\n Examples\n --------\n > var bool = isObjectLike( {} )\n true\n > bool = isObjectLike( [] )\n true\n > bool = isObjectLike( null )\n false\n\n See Also\n --------\n isObject, isPlainObject\n",
"isOdd": "\nisOdd( value )\n Tests if a value is an odd number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an odd number.\n\n Examples\n --------\n > var bool = isOdd( 5.0 )\n true\n > bool = isOdd( new Number( 5.0 ) )\n true\n > bool = isOdd( 4.0 )\n false\n > bool = isOdd( new Number( 4.0 ) )\n false\n > bool = isOdd( -3.14 )\n false\n > bool = isOdd( null )\n false\n\nisOdd.isPrimitive( value )\n Tests if a value is a number primitive that is an odd number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive that is an odd\n number.\n\n Examples\n --------\n > var bool = isOdd.isPrimitive( -5.0 )\n true\n > bool = isOdd.isPrimitive( new Number( -5.0 ) )\n false\n\n\nisOdd.isObject( value )\n Tests if a value is a number object that has an odd number value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object that has an odd\n number value.\n\n Examples\n --------\n > var bool = isOdd.isObject( 5.0 )\n false\n > bool = isOdd.isObject( new Number( 5.0 ) )\n true\n\n See Also\n --------\n isEven\n",
"isoWeeksInYear": "\nisoWeeksInYear( [year] )\n Returns the number of ISO weeks in a year according to the Gregorian\n calendar.\n\n By default, the function returns the number of ISO weeks in the current year\n (according to local time). To determine the number of ISO weeks for a\n particular year, provide either a year or a `Date` object.\n\n Parameters\n ----------\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Number of ISO weeks in a year.\n\n Examples\n --------\n > var num = isoWeeksInYear()\n <number>\n > num = isoWeeksInYear( 2015 )\n 53\n > num = isoWeeksInYear( 2017 )\n 52\n\n",
"isPersymmetricMatrix": "\nisPersymmetricMatrix( value )\n Tests if a value is a square matrix which is symmetric about its\n antidiagonal.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a persymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isPersymmetricMatrix( M )\n true\n > bool = isPersymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isPersymmetricMatrix( 3.14 )\n false\n > bool = isPersymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isPlainObject": "\nisPlainObject( value )\n Tests if a value is a plain object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a plain object.\n\n Examples\n --------\n > var bool = isPlainObject( {} )\n true\n > bool = isPlainObject( null )\n false\n\n See Also\n --------\n isObject\n",
"isPlainObjectArray": "\nisPlainObjectArray( value )\n Tests if a value is an array-like object containing only plain objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n plain objects.\n\n Examples\n --------\n > var bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] )\n true\n > bool = isPlainObjectArray( [ {}, new Number(3.0) ] )\n false\n > bool = isPlainObjectArray( [ {}, '3.0' ] )\n false\n\n See Also\n --------\n isArray, isPlainObject\n",
"isPositiveInteger": "\nisPositiveInteger( value )\n Tests if a value is a positive integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a positive integer.\n\n Examples\n --------\n > var bool = isPositiveInteger( 5.0 )\n true\n > bool = isPositiveInteger( new Number( 5.0 ) )\n true\n > bool = isPositiveInteger( 3.14 )\n false\n > bool = isPositiveInteger( -5.0 )\n false\n > bool = isPositiveInteger( null )\n false\n\n\nisPositiveInteger.isPrimitive( value )\n Tests if a value is a number primitive having a positive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n positive integer value.\n\n Examples\n --------\n > var bool = isPositiveInteger.isPrimitive( 3.0 )\n true\n > bool = isPositiveInteger.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisPositiveInteger.isObject( value )\n Tests if a value is a number object having a positive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a positive\n integer value.\n\n Examples\n --------\n > var bool = isPositiveInteger.isObject( 3.0 )\n false\n > bool = isPositiveInteger.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isPositiveIntegerArray": "\nisPositiveIntegerArray( value )\n Tests if a value is an array-like object containing only positive integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive integers.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isPositiveIntegerArray( [ 3.0, '3.0' ] )\n false\n\n\nisPositiveIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only positive primitive\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive primitive integer values.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray.primitives( [ 1.0, 10.0 ] )\n true\n > bool = isPositiveIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isPositiveIntegerArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisPositiveIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having positive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having positive integer values.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isPositiveIntegerArray.objects( [ 1.0, 2.0, 10.0 ] )\n false\n > bool = isPositiveIntegerArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray, isInteger, isPositiveInteger\n",
"isPositiveNumber": "\nisPositiveNumber( value )\n Tests if a value is a positive number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a positive number.\n\n Examples\n --------\n > var bool = isPositiveNumber( 5.0 )\n true\n > bool = isPositiveNumber( new Number( 5.0 ) )\n true\n > bool = isPositiveNumber( 3.14 )\n true\n > bool = isPositiveNumber( -5.0 )\n false\n > bool = isPositiveNumber( null )\n false\n\n\nisPositiveNumber.isPrimitive( value )\n Tests if a value is a number primitive having a positive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a positive\n value.\n\n Examples\n --------\n > var bool = isPositiveNumber.isPrimitive( 3.0 )\n true\n > bool = isPositiveNumber.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisPositiveNumber.isObject( value )\n Tests if a value is a number object having a positive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a positive\n value.\n\n Examples\n --------\n > var bool = isPositiveNumber.isObject( 3.0 )\n false\n > bool = isPositiveNumber.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isPositiveNumberArray": "\nisPositiveNumberArray( value )\n Tests if a value is an array-like object containing only positive numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive numbers.\n\n Examples\n --------\n > var bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isPositiveNumberArray( [ 3.0, '3.0' ] )\n false\n\n\nisPositiveNumberArray.primitives( value )\n Tests if a value is an array-like object containing only positive primitive\n number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive primitive number values.\n\n Examples\n --------\n > var bool = isPositiveNumberArray.primitives( [ 1.0, 10.0 ] )\n true\n > bool = isPositiveNumberArray.primitives( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isPositiveNumberArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisPositiveNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having positive values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having positive values.\n\n Examples\n --------\n > var bool = isPositiveNumberArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isPositiveNumberArray.objects( [ 1.0, 2.0, 10.0 ] )\n false\n > bool = isPositiveNumberArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray, isNumber, isPositiveNumber\n",
"isPositiveZero": "\nisPositiveZero( value )\n Tests if a value is positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero( 0.0 )\n true\n > bool = isPositiveZero( new Number( 0.0 ) )\n true\n > bool = isPositiveZero( -3.14 )\n false\n > bool = isPositiveZero( -0.0 )\n false\n > bool = isPositiveZero( null )\n false\n\n\nisPositiveZero.isPrimitive( value )\n Tests if a value is a number primitive equal to positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive equal to\n positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero.isPrimitive( 0.0 )\n true\n > bool = isPositiveZero.isPrimitive( new Number( 0.0 ) )\n false\n\n\nisPositiveZero.isObject( value )\n Tests if a value is a number object having a value equal to positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a value\n equal to positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero.isObject( 0.0 )\n false\n > bool = isPositiveZero.isObject( new Number( 0.0 ) )\n true\n\n See Also\n --------\n isNumber, isNegativeZero\n",
"isPrimitive": "\nisPrimitive( value )\n Tests if a value is a JavaScript primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a JavaScript primitive.\n\n Examples\n --------\n > var bool = isPrimitive( true )\n true\n > bool = isPrimitive( {} )\n false\n\n See Also\n --------\n isBoxedPrimitive\n",
"isPrimitiveArray": "\nisPrimitiveArray( value )\n Tests if a value is an array-like object containing only JavaScript\n primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n JavaScript primitives.\n\n Examples\n --------\n > var bool = isPrimitiveArray( [ '3', 2, null ] )\n true\n > bool = isPrimitiveArray( [ {}, 2, 1 ] )\n false\n > bool = isPrimitiveArray( [ new String('abc'), '3.0' ] )\n false\n\n See Also\n --------\n isArray, isPrimitive\n",
"isPRNGLike": "\nisPRNGLike( value )\n Tests if a value is PRNG-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is PRNG-like.\n\n Examples\n --------\n > var bool = isPRNGLike( base.random.randu )\n true\n > bool = isPRNGLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isPRNGLike( 3.14 )\n false\n > bool = isPRNGLike( {} )\n false\n\n",
"isProbability": "\nisProbability( value )\n Tests if a value is a probability.\n\n A probability is defined as a numeric value on the interval [0,1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a probability.\n\n Examples\n --------\n > var bool = isProbability( 0.5 )\n true\n > bool = isProbability( new Number( 0.5 ) )\n true\n > bool = isProbability( 3.14 )\n false\n > bool = isProbability( -5.0 )\n false\n > bool = isProbability( null )\n false\n\n\nisProbability.isPrimitive( value )\n Tests if a value is a number primitive which is a probability.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive which is a\n probability.\n\n Examples\n --------\n > var bool = isProbability.isPrimitive( 0.3 )\n true\n > bool = isProbability.isPrimitive( new Number( 0.3 ) )\n false\n\n\nisProbability.isObject( value )\n Tests if a value is a number object having a value which is a probability.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a value which\n is a probability.\n\n Examples\n --------\n > var bool = isProbability.isObject( 0.77 )\n false\n > bool = isProbability.isObject( new Number( 0.77 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isProbabilityArray": "\nisProbabilityArray( value )\n Tests if a value is an array-like object containing only probabilities.\n\n A probability is defined as a numeric value on the interval [0,1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n probabilities.\n\n Examples\n --------\n > var bool = isProbabilityArray( [ 0.5, new Number(0.8) ] )\n true\n > bool = isProbabilityArray( [ 0.8, 1.2 ] )\n false\n > bool = isProbabilityArray( [ 0.8, '0.2' ] )\n false\n\n\nisProbabilityArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n probabilities.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive probabilities.\n\n Examples\n --------\n > var bool = isProbabilityArray.primitives( [ 1.0, 0.0, 0.5 ] )\n true\n > bool = isProbabilityArray.primitives( [ 0.3, new Number(0.4) ] )\n false\n\n\nisProbabilityArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having probability values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having probability values.\n\n Examples\n --------\n > var bool = isProbabilityArray.objects( [ new Number(0.7), new Number(1.0) ] )\n true\n > bool = isProbabilityArray.objects( [ 1.0, 0.0, new Number(0.7) ] )\n false\n\n See Also\n --------\n isArray, isProbability\n",
"isPrototypeOf": "\nisPrototypeOf( value, proto )\n Tests if an object's prototype chain contains a provided prototype.\n\n The function returns `false` if provided a primitive value.\n\n This function is generally more robust than the `instanceof` operator (e.g.,\n where inheritance is performed without using constructors).\n\n Parameters\n ----------\n value: any\n Input value.\n\n proto: Object|Function\n Prototype.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a provided prototype exists in a prototype chain.\n\n Examples\n --------\n > function Foo() { return this; };\n > function Bar() { return this; };\n > inherit( Bar, Foo );\n > var bar = new Bar();\n > var bool = isPrototypeOf( bar, Foo.prototype )\n true\n\n See Also\n --------\n getPrototypeOf\n",
"isRangeError": "\nisRangeError( value )\n Tests if a value is a RangeError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a RangeError (or a descendant) object,\n false positives may occur due to the fact that the RangeError constructor\n inherits from Error and has no internal class of its own. Hence, RangeError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a RangeError object.\n\n Examples\n --------\n > var bool = isRangeError( new RangeError( 'beep' ) )\n true\n > bool = isRangeError( {} )\n false\n\n See Also\n --------\n isError\n",
"isReadableProperty": "\nisReadableProperty( value, property )\n Tests if an object's own property is readable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is readable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadableProperty( obj, 'boop' )\n true\n > bool = isReadableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWriteProperty, isReadablePropertyIn, isWritableProperty\n",
"isReadablePropertyIn": "\nisReadablePropertyIn( value, property )\n Tests if an object's own or inherited property is readable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is readable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadablePropertyIn( obj, 'boop' )\n true\n > bool = isReadablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWritePropertyIn, isReadableProperty, isWritablePropertyIn\n",
"isReadOnlyProperty": "\nisReadOnlyProperty( value, property )\n Tests if an object's own property is read-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is read-only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = false;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadOnlyProperty( obj, 'boop' )\n true\n > bool = isReadOnlyProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWriteProperty, isReadableProperty, isWritableProperty\n",
"isReadOnlyPropertyIn": "\nisReadOnlyPropertyIn( value, property )\n Tests if an object's own or inherited property is read-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is read-\n only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = false;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadOnlyPropertyIn( obj, 'boop' )\n true\n > bool = isReadOnlyPropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWritePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isReadWriteProperty": "\nisReadWriteProperty( value, property )\n Tests if an object's own property is readable and writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is readable and writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadWriteProperty( obj, 'boop' )\n true\n > bool = isReadWriteProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWritePropertyIn, isReadableProperty, isWritableProperty\n",
"isReadWritePropertyIn": "\nisReadWritePropertyIn( value, property )\n Tests if an object's own or inherited property is readable and writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is readable\n and writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadWritePropertyIn( obj, 'boop' )\n true\n > bool = isReadWritePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWriteProperty, isReadablePropertyIn, isWritablePropertyIn\n",
"isReferenceError": "\nisReferenceError( value )\n Tests if a value is a ReferenceError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a ReferenceError (or a descendant)\n object, false positives may occur due to the fact that the ReferenceError\n constructor inherits from Error and has no internal class of its own.\n Hence, ReferenceError impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a ReferenceError object.\n\n Examples\n --------\n > var bool = isReferenceError( new ReferenceError( 'beep' ) )\n true\n > bool = isReferenceError( {} )\n false\n\n See Also\n --------\n isError\n",
"isRegExp": "\nisRegExp( value )\n Tests if a value is a regular expression.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a regular expression.\n\n Examples\n --------\n > var bool = isRegExp( /\\.+/ )\n true\n > bool = isRegExp( {} )\n false\n\n",
"isRegExpString": "\nisRegExpString( value )\n Tests if a value is a regular expression string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a regular expression string.\n\n Examples\n --------\n > var bool = isRegExpString( '/beep/' )\n true\n > bool = isRegExpString( 'beep' )\n false\n > bool = isRegExpString( '' )\n false\n > bool = isRegExpString( null )\n false\n\n See Also\n --------\n isRegExp\n",
"isRelativePath": "\nisRelativePath( value )\n Tests if a value is a relative path.\n\n Function behavior is platform-specific. On Windows platforms, the function\n is equal to `.win32()`. On POSIX platforms, the function is equal to\n `.posix()`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a relative path.\n\n Examples\n --------\n // Windows environments:\n > var bool = isRelativePath( 'foo\\\\bar\\\\baz' )\n true\n\n // POSIX environments:\n > bool = isRelativePath( './foo/bar/baz' )\n true\n\n\nisRelativePath.posix( value )\n Tests if a value is a POSIX relative path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a POSIX relative path.\n\n Examples\n --------\n > var bool = isRelativePath.posix( './foo/bar/baz' )\n true\n > bool = isRelativePath.posix( '/foo/../bar/baz' )\n false\n\n\nisRelativePath.win32( value )\n Tests if a value is a Windows relative path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Windows relative path.\n\n Examples\n --------\n > var bool = isRelativePath( 'foo\\\\bar\\\\baz' )\n true\n > bool = isRelativePath( 'C:\\\\foo\\\\..\\\\bar\\\\baz' )\n false\n\n See Also\n --------\n isAbsolutePath\n",
"isSafeInteger": "\nisSafeInteger( value )\n Tests if a value is a safe integer.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a safe integer.\n\n Examples\n --------\n > var bool = isSafeInteger( 5.0 )\n true\n > bool = isSafeInteger( new Number( 5.0 ) )\n true\n > bool = isSafeInteger( 2.0e200 )\n false\n > bool = isSafeInteger( -3.14 )\n false\n > bool = isSafeInteger( null )\n false\n\n\nisSafeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a safe integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a safe\n integer value.\n\n Examples\n --------\n > var bool = isSafeInteger.isPrimitive( -3.0 )\n true\n > bool = isSafeInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisSafeInteger.isObject( value )\n Tests if a value is a `Number` object having a safe integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `Number` object having a safe\n integer value.\n\n Examples\n --------\n > var bool = isSafeInteger.isObject( 3.0 )\n false\n > bool = isSafeInteger.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isInteger, isNumber\n",
"isSafeIntegerArray": "\nisSafeIntegerArray( value )\n Tests if a value is an array-like object containing only safe integers.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing\n only safe integers.\n\n Examples\n --------\n > var arr = [ -3.0, new Number(0.0), 2.0 ];\n > var bool = isSafeIntegerArray( arr )\n true\n > arr = [ -3.0, '3.0' ];\n > bool = isSafeIntegerArray( arr )\n false\n\n\nisSafeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only primitive safe\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive safe integer values.\n\n Examples\n --------\n > var arr = [ -1.0, 10.0 ];\n > var bool = isSafeIntegerArray.primitives( arr )\n true\n > arr = [ -1.0, 0.0, 5.0 ];\n > bool = isSafeIntegerArray.primitives( arr )\n true\n > arr = [ -3.0, new Number(-1.0) ];\n > bool = isSafeIntegerArray.primitives( arr )\n false\n\n\nisSafeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only `Number` objects\n having safe integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n `Number` objects having safe integer values.\n\n Examples\n --------\n > var arr = [ new Number(1.0), new Number(3.0) ];\n > var bool = isSafeIntegerArray.objects( arr )\n true\n > arr = [ -1.0, 0.0, 3.0 ];\n > bool = isSafeIntegerArray.objects( arr )\n false\n > arr = [ 3.0, new Number(-1.0) ];\n > bool = isSafeIntegerArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isSafeInteger\n",
"isSameValue": "\nisSameValue( a, b )\n Tests if two arguments are the same value.\n\n The function differs from the `===` operator in that the function treats\n `-0` and `+0` as distinct and `NaNs` as the same.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are the same value.\n\n Examples\n --------\n > var bool = isSameValue( true, true )\n true\n > bool = isSameValue( {}, {} )\n false\n > bool = isSameValue( -0.0, -0.0 )\n true\n > bool = isSameValue( -0.0, 0.0 )\n false\n > bool = isSameValue( NaN, NaN )\n true\n\n See Also\n --------\n isSameValueZero, isStrictEqual\n",
"isSameValueZero": "\nisSameValueZero( a, b )\n Tests if two arguments are the same value.\n\n The function differs from the `===` operator in that the function treats\n `NaNs` as the same.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are the same value.\n\n Examples\n --------\n > var bool = isSameValueZero( true, true )\n true\n > bool = isSameValueZero( {}, {} )\n false\n > bool = isSameValueZero( -0.0, -0.0 )\n true\n > bool = isSameValueZero( -0.0, 0.0 )\n true\n > bool = isSameValueZero( NaN, NaN )\n true\n\n See Also\n --------\n isSameValue, isStrictEqual\n",
"isSharedArrayBuffer": "\nisSharedArrayBuffer( value )\n Tests if a value is a SharedArrayBuffer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a SharedArrayBuffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffer...\n > var bool = isSharedArrayBuffer( new SharedArrayBuffer( 10 ) )\n true\n > bool = isSharedArrayBuffer( [] )\n false\n\n See Also\n --------\n isArrayBuffer, isTypedArray\n",
"isSkewCentrosymmetricMatrix": "\nisSkewCentrosymmetricMatrix( value )\n Tests if a value is a skew-centrosymmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-centrosymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 2, 1, -1, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewCentrosymmetricMatrix( M )\n true\n > bool = isSkewCentrosymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewCentrosymmetricMatrix( 3.14 )\n false\n > bool = isSkewCentrosymmetricMatrix( {} )\n false\n\n See Also\n --------\n isCentrosymmetricMatrix, isMatrixLike, isSkewSymmetricMatrix\n",
"isSkewPersymmetricMatrix": "\nisSkewPersymmetricMatrix( value )\n Tests if a value is a skew-persymmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-persymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 0, 0, -1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewPersymmetricMatrix( M )\n true\n > bool = isSkewPersymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewPersymmetricMatrix( 3.14 )\n false\n > bool = isSkewPersymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isPersymmetricMatrix, isSkewSymmetricMatrix\n",
"isSkewSymmetricMatrix": "\nisSkewSymmetricMatrix( value )\n Tests if a value is a skew-symmetric (or antisymmetric) matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, -1, 1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewSymmetricMatrix( M )\n true\n > bool = isSkewSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewSymmetricMatrix( 3.14 )\n false\n > bool = isSkewSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSkewSymmetricMatrix, isSquareMatrix\n",
"isSquareMatrix": "\nisSquareMatrix( value )\n Tests if a value is a 2-dimensional ndarray-like object having equal\n dimensions.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 2-dimensional ndarray-like\n object having equal dimensions.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSquareMatrix( M )\n true\n > bool = isSquareMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSquareMatrix( 3.14 )\n false\n > bool = isSquareMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSymmetricMatrix\n",
"isStrictEqual": "\nisStrictEqual( a, b )\n Tests if two arguments are strictly equal.\n\n The function differs from the `===` operator in that the function treats\n `-0` and `+0` as distinct.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are strictly equal.\n\n Examples\n --------\n > var bool = isStrictEqual( true, true )\n true\n > bool = isStrictEqual( {}, {} )\n false\n > bool = isStrictEqual( -0.0, -0.0 )\n true\n > bool = isStrictEqual( -0.0, 0.0 )\n false\n > bool = isStrictEqual( NaN, NaN )\n false\n\n See Also\n --------\n isSameValue\n",
"isString": "\nisString( value )\n Tests if a value is a string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string.\n\n Examples\n --------\n > var bool = isString( 'beep' )\n true\n > bool = isString( new String( 'beep' ) )\n true\n > bool = isString( 5 )\n false\n\n\nisString.isPrimitive( value )\n Tests if a value is a string primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string primitive.\n\n Examples\n --------\n > var bool = isString.isPrimitive( 'beep' )\n true\n > bool = isString.isPrimitive( new String( 'beep' ) )\n false\n\n\nisString.isObject( value )\n Tests if a value is a `String` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `String` object.\n\n Examples\n --------\n > var bool = isString.isObject( new String( 'beep' ) )\n true\n > bool = isString.isObject( 'beep' )\n false\n\n",
"isStringArray": "\nisStringArray( value )\n Tests if a value is an array of strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of strings.\n\n Examples\n --------\n > var bool = isStringArray( [ 'abc', 'def' ] )\n true\n > bool = isStringArray( [ 'abc', 123 ] )\n false\n\n\nisStringArray.primitives( value )\n Tests if a value is an array containing only string primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing only string\n primitives.\n\n Examples\n --------\n > var arr = [ 'abc', 'def' ];\n > var bool = isStringArray.primitives( arr )\n true\n > arr = [ 'abc', new String( 'def' ) ];\n > bool = isStringArray.primitives( arr )\n false\n\n\nisStringArray.objects( value )\n Tests if a value is an array containing only `String` objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing only `String`\n objects.\n\n Examples\n --------\n > var arr = [ new String( 'ab' ), new String( 'cd' ) ];\n > var bool = isStringArray.objects( arr )\n true\n > arr = [ new String( 'abc' ), 'def' ];\n > bool = isStringArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isString\n",
"isSymbol": "\nisSymbol( value )\n Tests if a value is a symbol.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a symbol.\n\n Examples\n --------\n > var bool = isSymbol( Symbol( 'beep' ) )\n true\n > bool = isSymbol( Object( Symbol( 'beep' ) ) )\n true\n > bool = isSymbol( {} )\n false\n > bool = isSymbol( null )\n false\n > bool = isSymbol( true )\n false\n\n",
"isSymbolArray": "\nisSymbolArray( value )\n Tests if a value is an array-like object containing only symbols.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only symbols.\n\n Examples\n --------\n > var bool = isSymbolArray( [ Symbol( 'beep' ), Symbol( 'boop' ) ] )\n true\n > bool = isSymbolArray( Symbol( 'beep' ) )\n false\n > bool = isSymbolArray( [] )\n false\n > bool = isSymbolArray( {} )\n false\n > bool = isSymbolArray( null )\n false\n > bool = isSymbolArray( true )\n false\n\n\nisSymbolArray.primitives( value )\n Tests if a value is an array-like object containing only `symbol`\n primitives.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only `symbol` primitives.\n\n Examples\n --------\n > var bool = isSymbolArray.primitives( [ Symbol( 'beep' ) ] )\n true\n > bool = isSymbolArray.primitives( [ Object( Symbol( 'beep' ) ) ] )\n false\n > bool = isSymbolArray.primitives( [] )\n false\n > bool = isSymbolArray.primitives( {} )\n false\n > bool = isSymbolArray.primitives( null )\n false\n > bool = isSymbolArray.primitives( true )\n false\n\n\nisSymbolArray.objects( value )\n Tests if a value is an array-like object containing only `Symbol`\n objects.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only `Symbol` objects.\n\n Examples\n --------\n > var bool = isSymbolArray.objects( [ Object( Symbol( 'beep' ) ) ] )\n true\n > bool = isSymbolArray.objects( [ Symbol( 'beep' ) ] )\n false\n > bool = isSymbolArray.objects( [] )\n false\n > bool = isSymbolArray.objects( {} )\n false\n > bool = isSymbolArray.objects( null )\n false\n > bool = isSymbolArray.objects( true )\n false\n\n See Also\n --------\n isArray, isSymbol\n",
"isSymmetricMatrix": "\nisSymmetricMatrix( value )\n Tests if a value is a square matrix which equals its transpose.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSymmetricMatrix( M )\n true\n > bool = isSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSymmetricMatrix( 3.14 )\n false\n > bool = isSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isNonSymmetricMatrix, isSquareMatrix\n",
"isSyntaxError": "\nisSyntaxError( value )\n Tests if a value is a SyntaxError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a SyntaxError (or a descendant) object,\n false positives may occur due to the fact that the SyntaxError constructor\n inherits from Error and has no internal class of its own. Hence, SyntaxError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a SyntaxError object.\n\n Examples\n --------\n > var bool = isSyntaxError( new SyntaxError( 'beep' ) )\n true\n > bool = isSyntaxError( {} )\n false\n\n See Also\n --------\n isError\n",
"isTruthy": "\nisTruthy( value )\n Tests if a value is a value which translates to `true` when evaluated in a\n boolean context.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is truthy.\n\n Examples\n --------\n > var bool = isTruthy( true )\n true\n > bool = isTruthy( {} )\n true\n > bool = isTruthy( [] )\n true\n > bool = isTruthy( false )\n false\n > bool = isTruthy( '' )\n false\n > bool = isTruthy( 0 )\n false\n > bool = isTruthy( null )\n false\n > bool = isTruthy( void 0 )\n false\n > bool = isTruthy( NaN )\n false\n\n See Also\n --------\n isFalsy\n",
"isTruthyArray": "\nisTruthyArray( value )\n Tests if a value is an array-like object containing only truthy values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only truthy values.\n\n Examples\n --------\n > var bool = isTruthyArray( [ {}, [] ] )\n true\n > bool = isTruthyArray( [ null, '' ] )\n false\n > bool = isTruthyArray( [] )\n false\n\n See Also\n --------\n isFalsyArray, isTruthy\n",
"isTypedArray": "\nisTypedArray( value )\n Tests if a value is a typed array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a typed array.\n\n Examples\n --------\n > var bool = isTypedArray( new Int8Array( 10 ) )\n true\n\n See Also\n --------\n isArray, isTypedArrayLike\n",
"isTypedArrayLength": "\nisTypedArrayLength( value )\n Tests if a value is a valid typed array length.\n\n A valid length property for a typed array instance is any integer value on\n the interval [0, 2^53-1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a valid typed array length.\n\n Examples\n --------\n > var bool = isTypedArrayLength( 5 )\n true\n > bool = isTypedArrayLength( 2.0e200 )\n false\n > bool = isTypedArrayLength( -3.14 )\n false\n > bool = isTypedArrayLength( null )\n false\n\n See Also\n --------\n isArrayLength, isTypedArray\n",
"isTypedArrayLike": "\nisTypedArrayLike( value )\n Tests if a value is typed-array-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is typed-array-like.\n\n Examples\n --------\n > var bool = isTypedArrayLike( new Int16Array() )\n true\n > bool = isTypedArrayLike({\n ... 'length': 10,\n ... 'byteOffset': 0,\n ... 'byteLength': 10,\n ... 'BYTES_PER_ELEMENT': 4\n ... })\n true\n\n See Also\n --------\n isTypedArray\n",
"isTypeError": "\nisTypeError( value )\n Tests if a value is a TypeError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a TypeError (or a descendant) object,\n false positives may occur due to the fact that the TypeError constructor\n inherits from Error and has no internal class of its own. Hence, TypeError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a TypeError object.\n\n Examples\n --------\n > var bool = isTypeError( new TypeError( 'beep' ) )\n true\n > bool = isTypeError( {} )\n false\n\n See Also\n --------\n isError\n",
"isUint8Array": "\nisUint8Array( value )\n Tests if a value is a Uint8Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint8Array.\n\n Examples\n --------\n > var bool = isUint8Array( new Uint8Array( 10 ) )\n true\n > bool = isUint8Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint16Array, isUint32Array\n",
"isUint8ClampedArray": "\nisUint8ClampedArray( value )\n Tests if a value is a Uint8ClampedArray.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint8ClampedArray.\n\n Examples\n --------\n > var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) )\n true\n > bool = isUint8ClampedArray( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint8Array\n",
"isUint16Array": "\nisUint16Array( value )\n Tests if a value is a Uint16Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint16Array.\n\n Examples\n --------\n > var bool = isUint16Array( new Uint16Array( 10 ) )\n true\n > bool = isUint16Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint32Array, isUint8Array\n",
"isUint32Array": "\nisUint32Array( value )\n Tests if a value is a Uint32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint32Array.\n\n Examples\n --------\n > var bool = isUint32Array( new Uint32Array( 10 ) )\n true\n > bool = isUint32Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint16Array, isUint8Array\n",
"isUNCPath": "\nisUNCPath( value )\n Tests if a value is a UNC path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a UNC path.\n\n Examples\n --------\n > var bool = isUNCPath( '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz' )\n true\n > bool = isUNCPath( '/foo/bar/baz' )\n false\n\n",
"isUndefined": "\nisUndefined( value )\n Tests if a value is undefined.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is undefined.\n\n Examples\n --------\n > var bool = isUndefined( void 0 )\n true\n > bool = isUndefined( null )\n false\n\n See Also\n --------\n isNull, isUndefinedOrNull\n",
"isUndefinedOrNull": "\nisUndefinedOrNull( value )\n Tests if a value is undefined or null.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is undefined or null.\n\n Examples\n --------\n > var bool = isUndefinedOrNull( void 0 )\n true\n > bool = isUndefinedOrNull( null )\n true\n > bool = isUndefinedOrNull( false )\n false\n\n See Also\n --------\n isNull, isUndefined\n",
"isUnityProbabilityArray": "\nisUnityProbabilityArray( value )\n Tests if a value is an array of probabilities that sum to one.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of probabilities that sum\n to one.\n\n Examples\n --------\n > var bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] )\n true\n > bool = isUnityProbabilityArray( new Uint8Array( [ 0, 1 ] ) )\n true\n > bool = isUnityProbabilityArray( [ 0.4, 0.4, 0.4 ] )\n false\n > bool = isUnityProbabilityArray( [ 3.14, 0.0 ] )\n false\n\n See Also\n --------\n isProbability, isProbabilityArray\n",
"isUppercase": "\nisUppercase( value )\n Tests if a value is an uppercase string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an uppercase string.\n\n Examples\n --------\n > var bool = isUppercase( 'HELLO' )\n true\n > bool = isUppercase( 'World' )\n false\n\n See Also\n --------\n isLowercase, isString\n",
"isURI": "\nisURI( value )\n Tests if a value is a URI.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a URI.\n\n Examples\n --------\n > var bool = isURI( 'http://google.com' )\n true\n > bool = isURI( 'http://localhost/' )\n true\n > bool = isURI( 'http://example.w3.org/path%20with%20spaces.html' )\n true\n > bool = isURI( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' )\n true\n\n // No scheme:\n > bool = isURI( '' )\n false\n > bool = isURI( 'foo@bar' )\n false\n > bool = isURI( '://foo/' )\n false\n\n // Illegal characters:\n > bool = isURI( 'http://<foo>' )\n false\n\n // Invalid path:\n > bool = isURI( 'http:////foo.html' )\n false\n\n // Incomplete hex escapes:\n > bool = isURI( 'http://example.w3.org/%a' )\n false\n\n",
"isURIError": "\nisURIError( value )\n Tests if a value is a URIError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a URIError (or a descendant) object,\n false positives may occur due to the fact that the URIError constructor\n inherits from Error and has no internal class of its own. Hence, URIError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a URIError object.\n\n Examples\n --------\n > var bool = isURIError( new URIError( 'beep' ) )\n true\n > bool = isURIError( {} )\n false\n\n See Also\n --------\n isError\n",
"isVectorLike": "\nisVectorLike( value )\n Tests if a value is a 1-dimensional ndarray-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 1-dimensional ndarray-like\n object.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 1;\n > M.shape = [ 4 ];\n > M.strides = [ 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isVectorLike( M )\n true\n > bool = isVectorLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isVectorLike( 3.14 )\n false\n > bool = isVectorLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isMatrixLike, isndarrayLike, isTypedArrayLike\n",
"isWhitespace": "\nisWhitespace( str )\n Tests whether a string contains only white space characters.\n\n A white space character is defined as one of the 25 characters defined as a\n white space (\"WSpace=Y\",\"WS\") character in the Unicode 9.0 character\n database, as well as one related white space character without the Unicode\n character property \"WSpace=Y\" (zero width non-breaking space which was\n deprecated as of Unicode 3.2).\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only white space\n characters.\n\n Examples\n --------\n > var bool = isWhitespace( ' ' )\n true\n > bool = isWhitespace( 'abcdef' )\n false\n > bool = isWhitespace( '' )\n false\n\n See Also\n --------\n RE_WHITESPACE\n",
"isWritableProperty": "\nisWritableProperty( value, property )\n Tests if an object's own property is writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isWritableProperty( obj, 'boop' )\n true\n > bool = isWritableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadableProperty, isReadWriteProperty, isWritablePropertyIn, isWriteOnlyProperty\n",
"isWritablePropertyIn": "\nisWritablePropertyIn( value, property )\n Tests if an object's own or inherited property is writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isWritablePropertyIn( obj, 'boop' )\n true\n > bool = isWritablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadablePropertyIn, isReadWritePropertyIn, isWritableProperty, isWriteOnlyPropertyIn\n",
"isWriteOnlyProperty": "\nisWriteOnlyProperty( value, property )\n Tests if an object's own property is write-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is write-only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isWriteOnlyProperty( obj, 'boop' )\n false\n > bool = isWriteOnlyProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isReadOnlyProperty, isReadWriteProperty, isWritableProperty, isWriteOnlyPropertyIn\n",
"isWriteOnlyPropertyIn": "\nisWriteOnlyPropertyIn( value, property )\n Tests if an object's own or inherited property is write-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is write-\n only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isWriteOnlyPropertyIn( obj, 'boop' )\n false\n > bool = isWriteOnlyPropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWritePropertyIn, isWritablePropertyIn, isWriteOnlyProperty\n",
"IteratorSymbol": "\nIteratorSymbol\n Iterator symbol.\n\n This symbol specifies the default iterator for an object.\n\n The symbol is only supported in ES6/ES2015+ environments. For non-supporting\n environments, the value is `null`.\n\n Examples\n --------\n > var s = IteratorSymbol\n\n See Also\n --------\n Symbol\n",
"joinStream": "\njoinStream( [options] )\n Returns a transform stream which joins streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = joinStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\njoinStream.factory( [options] )\n Returns a function for creating transform streams for joined streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream: Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = joinStream.factory( opts );\n > var s = createStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\njoinStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream for joining streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = joinStream.objectMode();\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n splitStream\n",
"kde2d": "",
"keyBy": "\nkeyBy( collection, fcn[, thisArg] )\n Converts a collection to an object whose keys are determined by a provided\n function and whose values are the collection values.\n\n When invoked, the input function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If more than one element in a collection resolves to the same key, the key\n value is the collection element which last resolved to the key.\n\n Object values are shallow copies.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Output object.\n\n Examples\n --------\n > function toKey( v ) { return v.a; };\n > var arr = [ { 'a': 1 }, { 'a': 2 } ];\n > keyBy( arr, toKey )\n { '1': { 'a': 1 }, '2': { 'a': 2 } }\n\n See Also\n --------\n forEach\n",
"keyByRight": "\nkeyByRight( collection, fcn[, thisArg] )\n Converts a collection to an object whose keys are determined by a provided\n function and whose values are the collection values, iterating from right to\n left.\n\n When invoked, the input function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If more than one element in a collection resolves to the same key, the key\n value is the collection element which last resolved to the key.\n\n Object values are shallow copies.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Output object.\n\n Examples\n --------\n > function toKey( v ) { return v.a; };\n > var arr = [ { 'a': 1 }, { 'a': 2 } ];\n > keyByRight( arr, toKey )\n { '2': { 'a': 2 }, '1': { 'a': 1 } }\n\n See Also\n --------\n forEachRight, keyBy\n",
"keysIn": "\nkeysIn( obj )\n Returns an array of an object's own and inherited enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: any\n Input value.\n\n Returns\n -------\n keys: Array\n Value array.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = keysIn( obj )\n e.g., [ 'beep', 'foo' ]\n\n See Also\n --------\n objectEntriesIn, objectKeys, objectValuesIn\n",
"kruskalTest": "\nkruskalTest( ...x[, options] )\n Computes the Kruskal-Wallis test for equal medians.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = kruskalTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = kruskalTest( arr, { 'groups': groups })\n\n",
"kstest": "\nkstest( x, y[, ...params][, options] )\n Computes a Kolmogorov-Smirnov goodness-of-fit test.\n\n For a numeric array or typed array `x`, a Kolmogorov-Smirnov goodness-of-fit\n is computed for the null hypothesis that the values of `x` come from the\n distribution specified by `y`. `y` can be either a string with the name of\n the distribution to test against, or a function.\n\n In the latter case, `y` is expected to be the cumulative distribution\n function (CDF) of the distribution to test against, with its first parameter\n being the value at which to evaluate the CDF and the remaining parameters\n constituting the parameters of the distribution. The parameters of the\n distribution are passed as additional arguments after `y` from `kstest` to\n the chosen CDF. The function returns an object holding the calculated test\n statistic `statistic` and the `pValue` of the test.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the hypothesis test results.\n\n Parameters\n ----------\n x: Array<number>\n Input array holding numeric values.\n\n y: Function|string\n Either a CDF function or a string denoting the name of a distribution.\n\n params: ...number (optional)\n Distribution parameters passed to reference CDF.\n\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.sorted: boolean (optional)\n Boolean indicating if the input array is already in sorted order.\n Default: `false`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that the true distribution of `x` is not equal\n to the reference distribution specified by `y` (`two-sided`), whether it\n is `less` than the reference distribution or `greater` than the\n reference distribution. Default: `'two-sided'`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.alternative: string\n Used test alternative. Either `two-sided`, `less` or `greater`.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Verify that data is drawn from a normal distribution:\n > var rnorm = base.random.normal.factory({ 'seed': 4839 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < 100; i++ ) { x[ i ] = rnorm( 3.0, 1.0 ); }\n\n // Test against N(0,1)\n > var out = kstest( x, 'normal', 0.0, 1.0 )\n { pValue: 0.0, statistic: 0.847, ... }\n\n // Test against N(3,1)\n > out = kstest( x, 'normal', 3.0, 1.0 )\n { pValue: 0.6282, statistic: 0.0733, ... }\n\n // Verify that data is drawn from a uniform distribution:\n > runif = base.random.uniform.factory( 0.0, 1.0, { 'seed': 8798 })\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) { x[ i ] = runif(); }\n > out = kstest( x, 'uniform', 0.0, 1.0 )\n { pValue: ~0.703, statistic: ~0.069, ... }\n\n // Print output:\n > out.print()\n Kolmogorov-Smirnov goodness-of-fit test.\n\n Null hypothesis: the CDF of `x` is equal equal to the reference CDF.\n\n pValue: 0.7039\n statistic: 0.0689\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Set custom significance level:\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alpha': 0.1 })\n { pValue: ~0.7039, statistic: ~0.069, ... }\n\n // Carry out one-sided hypothesis tests:\n > runif = base.random.uniform.factory( 0.0, 1.0, { 'seed': 8798 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) { x[ i ] = runif(); }\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alternative': 'less' })\n { pValue: ~0.358, statistic: ~0.07, ... }\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alternative': 'greater' })\n { pValue: ~0.907, statistic: ~0.02, ... }\n\n // Set `sorted` option to true when data is in increasing order:\n > x = [ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 ];\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'sorted': true })\n { pValue: ~1, statistic: 0.1, ... }\n\n",
"LinkedList": "\nLinkedList()\n Linked list constructor.\n\n Returns\n -------\n list: Object\n Linked list.\n\n list.clear: Function\n Clears the list.\n\n list.first: Function\n Returns the last node. If the list is empty, the returned value is\n `undefined`.\n\n list.insert: Function\n Inserts a value after a provided list node.\n\n list.iterator: Function\n Returns an iterator for iterating over a list. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from list mutation during\n iteration, a returned iterator **always** iterates over a list\n \"snapshot\", which is defined as the list of list elements at the time\n of the method's invocation.\n\n list.last: Function\n Returns the last list node. If the list is empty, the returned value is\n `undefined`.\n\n list.length: integer\n List length.\n\n list.pop: Function\n Removes and returns the last list value. If the list is empty, the\n returned value is `undefined`.\n\n list.push: Function\n Adds a value to the end of the list.\n\n list.remove: Function\n Removes a list node from the list.\n\n list.shift: Function\n Removes and returns the first list value. If the list is empty, the\n returned value is `undefined`.\n\n list.toArray: Function\n Returns an array of list values.\n\n list.toJSON: Function\n Serializes a list as JSON.\n\n list.unshift: Function\n Adds a value to the beginning of the list.\n\n Examples\n --------\n > var list = LinkedList();\n > list.push( 'foo' ).push( 'bar' );\n > list.length\n 2\n > list.pop()\n 'bar'\n > list.length\n 1\n > list.pop()\n 'foo'\n > list.length\n 0\n\n See Also\n --------\n DoublyLinkedList, Stack\n",
"linspace": "\nlinspace( start, stop[, length] )\n Generates a linearly spaced numeric array.\n\n If a `length` is not provided, the default output array length is `100`.\n\n The output array is guaranteed to include the `start` and `stop` values.\n\n Parameters\n ----------\n start: number\n First array value.\n\n stop: number\n Last array value.\n\n length: integer (optional)\n Length of output array. Default: `100`.\n\n Returns\n -------\n arr: Array\n Linearly spaced numeric array.\n\n Examples\n --------\n > var arr = linspace( 0, 100, 6 )\n [ 0, 20, 40, 60, 80, 100 ]\n\n See Also\n --------\n incrspace, logspace\n",
"LIU_NEGATIVE_OPINION_WORDS_EN": "\nLIU_NEGATIVE_OPINION_WORDS_EN()\n Returns a list of negative opinion words.\n\n A word's appearance in a sentence does *not* necessarily imply a positive or\n negative opinion.\n\n The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n\n Returns\n -------\n out: Array<string>\n List of negative opinion words.\n\n Examples\n --------\n > var list = LIU_NEGATIVE_OPINION_WORDS_EN()\n [ '2-faced', '2-faces', 'abnormal', 'abolish', ... ]\n\n References\n ----------\n - Hu, Minqing, and Bing Liu. 2004. \"Mining and Summarizing Customer\n Reviews.\" In *Proceedings of the Tenth Acm Sigkdd International Conference\n on Knowledge Discovery and Data Mining*, 168–77. KDD '04. New York, NY, USA:\n ACM. doi:10.1145/1014052.1014073.\n - Liu, Bing, Minqing Hu, and Junsheng Cheng. 2005. \"Opinion Observer:\n Analyzing and Comparing Opinions on the Web.\" In *Proceedings of the 14th\n International Conference on World Wide Web*, 342–51. WWW '05. New York, NY,\n USA: ACM. doi:10.1145/1060745.1060797.\n\n * If you use the list for publication or third party consumption, please\n cite one of the listed references.\n\n See Also\n --------\n LIU_POSITIVE_OPINION_WORDS_EN\n",
"LIU_POSITIVE_OPINION_WORDS_EN": "\nLIU_POSITIVE_OPINION_WORDS_EN()\n Returns a list of positive opinion words.\n\n A word's appearance in a sentence does *not* necessarily imply a positive or\n negative opinion.\n\n The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n\n Returns\n -------\n out: Array<string>\n List of positive opinion words.\n\n Examples\n --------\n > var list = LIU_POSITIVE_OPINION_WORDS_EN()\n [ 'a+', 'abound', 'abounds', 'abundance', ... ]\n\n References\n ----------\n - Hu, Minqing, and Bing Liu. 2004. 'Mining and Summarizing Customer\n Reviews.' In *Proceedings of the Tenth Acm Sigkdd International Conference\n on Knowledge Discovery and Data Mining*, 168–77. KDD '04. New York, NY, USA:\n ACM. doi:10.1145/1014052.1014073.\n - Liu, Bing, Minqing Hu, and Junsheng Cheng. 2005. 'Opinion Observer:\n Analyzing and Comparing Opinions on the Web.' In *Proceedings of the 14th\n International Conference on World Wide Web*, 342–51. WWW '05. New York, NY,\n USA: ACM. doi:10.1145/1060745.1060797.\n\n * If you use the list for publication or third party consumption, please\n cite one of the listed references.\n\n See Also\n --------\n LIU_NEGATIVE_OPINION_WORDS_EN\n",
"LN_HALF": "\nLN_HALF\n Natural logarithm of `1/2`.\n\n Examples\n --------\n > LN_HALF\n -0.6931471805599453\n\n",
"LN_PI": "\nLN_PI\n Natural logarithm of the mathematical constant `π`.\n\n Examples\n --------\n > LN_PI\n 1.1447298858494002\n\n See Also\n --------\n PI\n",
"LN_SQRT_TWO_PI": "\nLN_SQRT_TWO_PI\n Natural logarithm of the square root of `2π`.\n\n Examples\n --------\n > LN_SQRT_TWO_PI\n 0.9189385332046728\n\n See Also\n --------\n PI\n",
"LN_TWO_PI": "\nLN_TWO_PI\n Natural logarithm of `2π`.\n\n Examples\n --------\n > LN_TWO_PI\n 1.8378770664093456\n\n See Also\n --------\n TWO_PI\n",
"LN2": "\nLN2\n Natural logarithm of `2`.\n\n Examples\n --------\n > LN2\n 0.6931471805599453\n\n See Also\n --------\n LN10\n",
"LN10": "\nLN10\n Natural logarithm of `10`.\n\n Examples\n --------\n > LN10\n 2.302585092994046\n\n See Also\n --------\n LN2\n",
"LOG2E": "\nLOG2E\n Base 2 logarithm of Euler's number.\n\n Examples\n --------\n > LOG2E\n 1.4426950408889634\n\n See Also\n --------\n E, LOG10E\n",
"LOG10E": "\nLOG10E\n Base 10 logarithm of Euler's number.\n\n Examples\n --------\n > LOG10E\n 0.4342944819032518\n\n See Also\n --------\n E, LOG2E\n",
"logspace": "\nlogspace( a, b[, length] )\n Generates a logarithmically spaced numeric array between `10^a` and `10^b`.\n\n If a `length` is not provided, the default output array length is `10`.\n\n The output array includes the values `10^a` and `10^b`.\n\n Parameters\n ----------\n a: number\n Exponent of start value.\n\n b: number\n Exponent of end value.\n\n length: integer (optional)\n Length of output array. Default: `10`.\n\n Returns\n -------\n arr: Array\n Logarithmically spaced numeric array.\n\n Examples\n --------\n > var arr = logspace( 0, 2, 6 )\n [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ]\n\n See Also\n --------\n incrspace, linspace\n",
"lowercase": "\nlowercase( str )\n Converts a `string` to lowercase.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Lowercase string.\n\n Examples\n --------\n > var out = lowercase( 'bEEp' )\n 'beep'\n\n See Also\n --------\n uncapitalize, uppercase\n",
"lowercaseKeys": "\nlowercaseKeys( obj )\n Converts each object key to lowercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'A': 1, 'B': 2 };\n > var out = lowercaseKeys( obj )\n { 'a': 1, 'b': 2 }\n\n See Also\n --------\n uncapitalizeKeys, uppercaseKeys\n",
"lowess": "\nlowess( x, y[, options] )\n Locally-weighted polynomial regression via the LOWESS algorithm.\n\n Parameters\n ----------\n x: Array<number>\n x-axis values (abscissa values).\n\n y: Array<number>\n Corresponding y-axis values (ordinate values).\n\n options: Object (optional)\n Function options.\n\n options.f: number (optional)\n Positive number specifying the smoothing span, i.e., the proportion of\n points which influence smoothing at each value. Larger values\n correspond to more smoothing. Default: `2/3`.\n\n options.nsteps: number (optional)\n Number of iterations in the robust fit (fewer iterations translates to\n faster function execution). If set to zero, the nonrobust fit is\n returned. Default: `3`.\n\n options.delta: number (optional)\n Nonnegative number which may be used to reduce the number of\n computations. Default: 1/100th of the range of `x`.\n\n options.sorted: boolean (optional)\n Boolean indicating if the input array `x` is sorted. Default: `false`.\n\n Returns\n -------\n out: Object\n Object with ordered x-values and fitted values.\n\n Examples\n --------\n > var x = new Float64Array( 100 );\n > var y = new Float64Array( x.length );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = i;\n ... y[ i ] = ( 0.5*i ) + ( 10.0*base.random.randn() );\n ... }\n > var out = lowess( x, y );\n > var yhat = out.y;\n\n > var h = Plot( [ x, x ], [ y, yhat ] );\n > h.lineStyle = [ 'none', '-' ];\n > h.symbols = [ 'closed-circle', 'none' ];\n\n > h.view( 'window' );\n\n",
"lpad": "\nlpad( str, len[, pad] )\n Left pads a `string` such that the padded `string` has a length of at least\n `len`.\n\n An output string is not guaranteed to have a length of exactly `len`, but to\n have a length of at least `len`. To generate a padded string having a length\n equal to `len`, post-process a padded string by trimming off excess\n characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Minimum string length.\n\n pad: string (optional)\n String used to pad. Default: ' '.\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n > var out = lpad( 'a', 5 )\n ' a'\n > out = lpad( 'beep', 10, 'b' )\n 'bbbbbbbeep'\n > out = lpad( 'boop', 12, 'beep' )\n 'beepbeepboop'\n\n See Also\n --------\n pad, rpad\n",
"ltrim": "\nltrim( str )\n Trims whitespace from the beginning of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = ltrim( ' \\r\\n\\t Beep \\t\\t\\n ' )\n 'Beep \\t\\t\\n '\n\n See Also\n --------\n trim, rtrim\n",
"MALE_FIRST_NAMES_EN": "\nMALE_FIRST_NAMES_EN()\n Returns a list of common male first names in English speaking countries.\n\n Returns\n -------\n out: Array<string>\n List of common male first names.\n\n Examples\n --------\n > var list = MALE_FIRST_NAMES_EN()\n [ 'Aaron', 'Ab', 'Abba', 'Abbe', ... ]\n\n References\n ----------\n - Ward, Grady. 2002. 'Moby Word II.' <http://www.gutenberg.org/files/3201/\n 3201.txt>.\n\n See Also\n --------\n FEMALE_FIRST_NAMES_EN\n",
"mapFun": "\nmapFun( fcn, n[, thisArg] )\n Invokes a function `n` times and returns an array of accumulated function\n return values.\n\n The invoked function is provided a single argument: the invocation index\n (zero-based).\n\n Parameters\n ----------\n fcn: Function\n Function to invoke.\n\n n: integer\n Number of times to invoke a function.\n\n thisArg: any (optional)\n Function execution context.\n\n Returns\n -------\n out: Array\n Array of accumulated function return values.\n\n Examples\n --------\n > function fcn( i ) { return i; };\n > var arr = mapFun( fcn, 5 )\n [ 0, 1, 2, 3, 4 ]\n\n See Also\n --------\n mapFunAsync\n",
"mapFunAsync": "\nmapFunAsync( fcn, n, [options,] done )\n Invokes a function `n` times and returns an array of accumulated function\n return values.\n\n For each iteration, the provided function is invoked with two arguments:\n\n - `index`: invocation index (starting from zero)\n - `next`: callback to be invoked upon function completion\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n Function to invoke.\n\n n: integer\n Number of times to invoke a function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to allow only one pending invocation at a\n time. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n done: Function\n A callback invoked upon executing a provided function `n` times or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > mapFunAsync( fcn, 10, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Limit number of concurrent invocations:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > var opts = { 'limit': 2 };\n > mapFunAsync( fcn, 10, opts, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Sequential invocation:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > var opts = { 'series': true };\n > mapFunAsync( fcn, 10, opts, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n\nmapFunAsync.factory( [options,] fcn )\n Returns a function which invokes a function `n` times and returns an array\n of accumulated function return values.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to allow only one pending invocation at a\n time. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n Function to invoke.\n\n Returns\n -------\n out: Function\n A function which invokes a function `n` times and returns an array of\n accumulated function return values.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapFunAsync.factory( opts, fcn );\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > f( 10, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n See Also\n --------\n mapFun\n",
"mapKeys": "\nmapKeys( obj, transform )\n Maps keys from one object to a new object having the same values.\n\n The transform function is provided three arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n\n The value returned by a transform function should be a value which can be\n serialized as an object key.\n\n The function only maps own properties. Hence, the function does not map\n inherited properties.\n\n The function shallow copies key values.\n\n Key iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n transform: Function\n Transform function. Return values specify the keys of the output object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function transform( key, value ) { return key + value; };\n > var obj = { 'a': 1, 'b': 2 };\n > var out = mapKeys( obj, transform )\n { 'a1': 1, 'b2': 2 }\n\n See Also\n --------\n mapValues\n",
"mapKeysAsync": "\nmapKeysAsync( obj, [options,] transform, done )\n Maps keys from one object to a new object having the same values.\n\n When invoked, `transform` is provided a maximum of four arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n - `next`: a callback to be invoked after processing an object `key`\n\n The actual number of provided arguments depends on function length. If\n `transform` accepts two arguments, `transform` is provided:\n\n - `key`\n - `next`\n\n If `transform` accepts three arguments, `transform` is provided:\n\n - `key`\n - `value`\n - `next`\n\n For every other `transform` signature, `transform` is provided all four\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `key`: transformed key\n\n If a `transform` function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The key returned by a transform function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function only maps own properties. Hence, the function does not map\n inherited properties.\n\n The function shallow copies key values.\n\n Key iteration and insertion order are *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Returned values specify the keys of the output\n object.\n\n done: Function\n A callback invoked either upon processing all own properties or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2 };\n > mapKeysAsync( obj, transform, done )\n { 'a:1': 1, 'b:2': 2 }\n\n // Limit number of concurrent invocations:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'limit': 2 };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapKeysAsync( obj, opts, transform, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n\n // Process sequentially:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'series': true };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapKeysAsync( obj, opts, transform, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n\n\nmapKeysAsync.factory( [options,] transform )\n Returns a function which maps keys from one object to a new object having\n the same values.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Returned values specify the keys of the output\n object.\n\n Returns\n -------\n out: Function\n A function which maps keys from one object to a new object having the\n same values.\n\n Examples\n --------\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapKeysAsync.factory( opts, transform );\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > f( obj, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n > obj = { 'beep': 'boop' };\n > f( obj, done )\n { 'beep:boop': 'beep' }\n\n See Also\n --------\n mapKeys, mapValuesAsync\n",
"mapValues": "\nmapValues( obj, transform )\n Maps values from one object to a new object having the same keys.\n\n The transform function is provided three arguments:\n\n - `value`: object value corresponding to `key`\n - `key`: object key\n - `obj`: the input object\n\n The function only maps values from own properties. Hence, the function does\n not map inherited properties.\n\n The function shallow copies key values.\n\n Key iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function transform( value, key ) { return key + value; };\n > var obj = { 'a': 1, 'b': 2 };\n > var out = mapValues( obj, transform )\n { 'a': 'a1', 'b': 'b2' }\n\n See Also\n --------\n mapKeys, omitBy, pickBy\n",
"mapValuesAsync": "\nmapValuesAsync( obj, [options,] transform, done )\n Maps values from one object to a new object having the same keys.\n\n When invoked, `transform` is provided a maximum of four arguments:\n\n - `value`: object value corresponding to `key`\n - `key`: object key\n - `obj`: the input object\n - `next`: a callback to be invoked after processing an object `value`\n\n The actual number of provided arguments depends on function length. If\n `transform` accepts two arguments, `transform` is provided:\n\n - `value`\n - `next`\n\n If `transform` accepts three arguments, `transform` is provided:\n\n - `value`\n - `key`\n - `next`\n\n For every other `transform` signature, `transform` is provided all four\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `value`: transformed value\n\n If a `transform` function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function only maps values from own properties. Hence, the function does\n not map inherited properties.\n\n The function shallow copies key values.\n\n Key iteration and insertion order are *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n done: Function\n A callback invoked either upon processing all own properties or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2 };\n > mapValuesAsync( obj, transform, done )\n { 'a': 'a:1', 'b': 'b:2' }\n\n // Limit number of concurrent invocations:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'limit': 2 };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapValuesAsync( obj, opts, transform, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n\n // Process sequentially:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'series': true };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapValuesAsync( obj, opts, transform, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n\n\nmapValuesAsync.factory( [options,] transform )\n Returns a function which maps values from one object to a new object having\n the same keys.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n Returns\n -------\n out: Function\n A function which maps values from one object to a new object having the\n same keys.\n\n Examples\n --------\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapValuesAsync.factory( opts, transform );\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > f( obj, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n > obj = { 'beep': 'boop' };\n > f( obj, done )\n { 'beep': 'beep:boop' }\n\n See Also\n --------\n mapKeysAsync, mapValues\n",
"MAX_ARRAY_LENGTH": "\nMAX_ARRAY_LENGTH\n Maximum length for a generic array.\n\n Examples\n --------\n > MAX_ARRAY_LENGTH\n 4294967295\n\n See Also\n --------\n MAX_TYPED_ARRAY_LENGTH\n",
"MAX_TYPED_ARRAY_LENGTH": "\nMAX_TYPED_ARRAY_LENGTH\n Maximum length for a typed array.\n\n Examples\n --------\n > MAX_TYPED_ARRAY_LENGTH\n 9007199254740991\n\n See Also\n --------\n MAX_ARRAY_LENGTH\n",
"memoize": "\nmemoize( fcn[, hashFunction] )\n Returns a memoized function.\n\n The function does not set the `length` property of the returned function.\n Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n The function serializes provided arguments as a string and stores results\n using the string as an identifier. To use a custom hash function, provide a\n hash function argument.\n\n Parameters\n ----------\n fcn: Function\n Function to memoize.\n\n hashFunction: Function (optional)\n Function to map a set of arguments to a single value identifying that\n set.\n\n Returns\n -------\n out: Function\n Memoized function.\n\n Examples\n --------\n > function factorial( n ) {\n ... var prod;\n ... var i;\n ... prod = 1;\n ... for ( i = n; i > 1; i-- ) {\n ... prod *= i;\n ... }\n ... return prod;\n ... };\n > var memoized = memoize( factorial );\n > var v = memoized( 5 )\n 120\n > v = memoized( 5 )\n 120\n\n",
"merge": "\nmerge( target, ...source )\n Merges objects into a target object.\n\n The target object is mutated.\n\n Only plain objects are merged and extended. Other values/types are either\n deep copied or assigned.\n\n Support for deep merging class instances is inherently fragile.\n\n `Number`, `String`, and `Boolean` objects are merged as primitives.\n\n Functions are not deep copied.\n\n Parameters\n ----------\n target: Object\n Target object.\n\n source: ...Object\n Source objects (i.e., objects to be merged into the target object).\n\n Returns\n -------\n out: Object\n Merged (target) object.\n\n Examples\n --------\n > var target = { 'a': 'beep' };\n > var source = { 'a': 'boop', 'b': 'bap' };\n > var out = merge( target, source )\n { 'a': 'boop', 'b': 'bap' }\n > var bool = ( out === target )\n true\n\n\nmerge.factory( options )\n Returns a function for merging and extending objects.\n\n Parameters\n ----------\n options: Object\n Options.\n\n options.level: integer (optional)\n Merge level. Default: Infinity.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy merged values. Deep copying\n prevents shared references and source object mutation. Default: true.\n\n options.override: boolean|Function (optional)\n Defines the merge strategy. If `true`, source object values will always\n override target object values. If `false`, source values never override\n target values (useful for adding, but not overwriting, properties). To\n define a custom merge strategy, provide a function. Default: true.\n\n options.extend: boolean (optional)\n Boolean indicating whether new properties can be added to the target\n object. If `false`, only shared properties are merged. Default: true.\n\n Returns\n -------\n fcn: Function\n Function which can be used to merge objects.\n\n Examples\n --------\n > var opts = {\n ... 'level': 100,\n ... 'copy': true,\n ... 'override': true,\n ... 'extend': true\n ... };\n > var merge = merge.factory( opts )\n <Function>\n\n // Set the `level` option to limit the merge depth:\n > merge = merge.factory( { 'level': 2 } );\n > var target = {\n ... '1': { 'a': 'beep', '2': { '3': null, 'b': [ 5, 6, 7 ] } }\n ... };\n > var source = {\n ... '1': { 'b': 'boop', '2': { '3': [ 1, 2, 3 ] } }\n ... };\n > var out = merge( target, source )\n { '1': { 'a': 'beep', 'b': 'boop', '2': { '3': [ 1, 2, 3 ] } } }\n\n // Set the `copy` option to `false` to allow shared references:\n > merge = merge.factory( { 'copy': false } );\n > target = {};\n > source = { 'a': [ 1, 2, 3 ] };\n > out = merge( target, source );\n > var bool = ( out.a === source.a )\n true\n\n // Set the `override` option to `false` to preserve existing properties:\n > merge = merge.factory( { 'override': false } );\n > target = { 'a': 'beep', 'b': 'boop' };\n > source = { 'a': null, 'c': 'bop' };\n > out = merge( target, source )\n { 'a': 'beep', 'b': 'boop', 'c': 'bop' }\n\n // Define a custom merge strategy:\n > function strategy( a, b, key ) {\n ... // a => target value\n ... // b => source value\n ... // key => object key\n ... if ( key === 'a' ) {\n ... return b;\n ... }\n ... if ( key === 'b' ) {\n ... return a;\n ... }\n ... return 'bebop';\n ... };\n > merge = merge.factory( { 'override': strategy } );\n > target = { 'a': 'beep', 'b': 'boop', 'c': 1234 };\n > source = { 'a': null, 'b': {}, 'c': 'bop' };\n > out = merge( target, source )\n { 'a': null, 'b': 'boop', 'c': 'bebop' }\n\n // Prevent non-existent properties from being added to the target object:\n > merge = merge.factory( { 'extend': false } );\n > target = { 'a': 'beep', 'b': 'boop' };\n > source = { 'b': 'hello', 'c': 'world' };\n > out = merge( target, source )\n { 'a': 'beep', 'b': 'hello' }\n\n See Also\n --------\n copy\n",
"MILLISECONDS_IN_DAY": "\nMILLISECONDS_IN_DAY\n Number of milliseconds in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var ms = days * MILLISECONDS_IN_DAY\n 271296000\n\n",
"MILLISECONDS_IN_HOUR": "\nMILLISECONDS_IN_HOUR\n Number of milliseconds in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var ms = hrs * MILLISECONDS_IN_HOUR\n 11304000\n\n",
"MILLISECONDS_IN_MINUTE": "\nMILLISECONDS_IN_MINUTE\n Number of milliseconds in a minute.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var mins = 3.14;\n > var ms = mins * MILLISECONDS_IN_MINUTE\n 188400\n\n",
"MILLISECONDS_IN_SECOND": "\nMILLISECONDS_IN_SECOND\n Number of milliseconds in a second.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var secs = 3.14;\n > var ms = secs * MILLISECONDS_IN_SECOND\n 3140\n\n",
"MILLISECONDS_IN_WEEK": "\nMILLISECONDS_IN_WEEK\n Number of milliseconds in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var weeks = 3.14;\n > var ms = weeks * MILLISECONDS_IN_WEEK\n 1899072000\n\n",
"MINARD_NAPOLEONS_MARCH": "\nMINARD_NAPOLEONS_MARCH( [options] )\n Returns data for Charles Joseph Minard's cartographic depiction of\n Napoleon's Russian campaign of 1812.\n\n Data includes the following:\n\n - army: army size\n - cities: cities\n - labels: map labels\n - temperature: temperature during the army's return from Russia\n - rivers: river data\n\n Temperatures are on the Réaumur scale. Multiply each temperature by `1.25`\n to convert to Celsius.\n\n River data is formatted as GeoJSON.\n\n River data is incomplete, with portions of rivers missing.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.data: string (optional)\n Dataset name.\n\n Returns\n -------\n out: Object|Array<Object>\n Minard's data.\n\n Examples\n --------\n > var data = MINARD_NAPOLEONS_MARCH();\n > var army = data.army\n [...]\n > var cities = data.cities\n [...]\n > var labels = data.labels\n [...]\n > var river = data.river\n {...}\n > var t = data.temperature\n [...]\n\n References\n ----------\n - Minard, Charles Joseph. 1869. *Tableaux graphiques et cartes figuratives*.\n Ecole nationale des ponts et chaussées.\n - Wilkinson, Leland. 2005. *The Grammar of Graphics*. Springer-Verlag New\n York. doi:10.1007/0-387-28695-0.\n\n",
"MINUTES_IN_DAY": "\nMINUTES_IN_DAY\n Number of minutes in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var mins = days * MINUTES_IN_DAY\n 4521.6\n\n",
"MINUTES_IN_HOUR": "\nMINUTES_IN_HOUR\n Number of minutes in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var mins = hrs * MINUTES_IN_HOUR\n 188.4\n\n",
"MINUTES_IN_WEEK": "\nMINUTES_IN_WEEK\n Number of minutes in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var mins = wks * MINUTES_IN_WEEK\n 31651.2\n\n",
"minutesInMonth": "\nminutesInMonth( [month[, year]] )\n Returns the number of minutes in a month.\n\n By default, the function returns the number of minutes in the current month\n of the current year (according to local time). To determine the number of\n minutes for a particular month and year, provide `month` and `year`\n arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Minutes in a month.\n\n Examples\n --------\n > var num = minutesInMonth()\n <number>\n > num = minutesInMonth( 2 )\n <number>\n > num = minutesInMonth( 2, 2016 )\n 41760\n > num = minutesInMonth( 2, 2017 )\n 40320\n\n // Other ways to supply month:\n > num = minutesInMonth( 'feb', 2016 )\n 41760\n > num = minutesInMonth( 'february', 2016 )\n 41760\n\n See Also\n --------\n minutesInYear\n",
"minutesInYear": "\nminutesInYear( [value] )\n Returns the number of minutes in a year according to the Gregorian calendar.\n\n By default, the function returns the number of minutes in the current year\n (according to local time). To determine the number of minutes for a\n particular year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of minutes in a year.\n\n Examples\n --------\n > var num = minutesInYear()\n <number>\n > num = minutesInYear( 2016 )\n 527040\n > num = minutesInYear( 2017 )\n 525600\n\n See Also\n --------\n minutesInMonth\n",
"MOBY_DICK": "\nMOBY_DICK()\n Returns the text of Moby Dick by Herman Melville.\n\n Each array element has the following fields:\n\n - chapter: book chapter (number or identifier)\n - title: chapter title (if available; otherwise, empty)\n - text: chapter text\n\n Returns\n -------\n out: Array<Object>\n Book text.\n\n Examples\n --------\n > var data = MOBY_DICK()\n [ {...}, {...}, ... ]\n\n",
"MONTH_NAMES_EN": "\nMONTH_NAMES_EN()\n Returns a list of month names (English).\n\n Returns\n -------\n out: Array<string>\n List of month names.\n\n Examples\n --------\n > var list = MONTH_NAMES_EN()\n [ 'January', 'February', 'March', 'April', ... ]\n\n",
"MONTHS_IN_YEAR": "\nMONTHS_IN_YEAR\n Number of months in a year.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var yrs = 3.14;\n > var mons = yrs * MONTHS_IN_YEAR\n 37.68\n\n",
"moveProperty": "\nmoveProperty( source, prop, target )\n Moves a property from one object to another object.\n\n The property is deleted from the source object and the property's descriptor\n is preserved during transfer.\n\n If a source property is not configurable, the function throws an error, as\n the property cannot be deleted from the source object.\n\n Parameters\n ----------\n source: Object\n Source object.\n\n prop: string\n Property to move.\n\n target: Object\n Target object.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether operation was successful.\n\n Examples\n --------\n > var obj1 = { 'a': 'b' };\n > var obj2 = {};\n > var bool = moveProperty( obj1, 'a', obj2 )\n true\n > bool = moveProperty( obj1, 'c', obj2 )\n false\n\n",
"namedtypedtuple": "\nnamedtypedtuple( fields[, options] )\n Returns a named typed tuple factory.\n\n Named tuples assign a property name, and thus a meaning, to each position in\n a tuple and allow for more readable, self-documenting code.\n\n Named typed tuples can be used wherever typed arrays are used, with the\n added benefit that they allow accessing fields by both field name and\n position index.\n\n Named typed tuples may be one the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n fields: Array<string>\n Field (property) names.\n\n options: Object (optional)\n Function options.\n\n options.dtype: string (optional)\n Default tuple data type. If a data type is not provided to a named typed\n tuple factory, this option specifies the underlying tuple data type.\n Default: 'float64'.\n\n options.name: string (optional)\n Tuple name. Default: 'tuple'.\n\n Returns\n -------\n factory: Function\n Named typed tuple factory.\n\n Examples\n --------\n > var opts = {};\n > opts.name = 'Point';\n > var factory = namedtypedtuple( [ 'x', 'y' ], opts );\n > var tuple = factory();\n\n\nfactory()\n Returns a named typed tuple of the default data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory();\n > p.x\n 0.0\n > p.y\n 0.0\n > p[ 0 ]\n 0.0\n > p[ 1 ]\n 0.0\n\n\nfactory( dtype )\n Returns a named typed tuple of the specified data type.\n\n Parameters\n ----------\n dtype: string\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( 'int32' );\n > p.x\n 0\n > p.y\n 0\n > p[ 0 ]\n 0\n > p[ 1 ]\n 0\n\n\nfactory( typedarray[, dtype] )\n Creates a named typed tuple from a typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate a named typed tuple.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( Float64Array[ 1.0, -1.0 ] );\n > p.x\n 1.0\n > p.y\n -1.0\n > p[ 0 ]\n 1.0\n > p[ 1 ]\n -1.0\n\n\nfactory( obj[, dtype] )\n Creates a named typed tuple from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a named typed\n tuple.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( [ 1, -1 ], 'int32' );\n > p.x\n 1\n > p.y\n -1\n > p[ 0 ]\n 1\n > p[ 1 ]\n -1\n\n\nfactory( buffer[, byteOffset][, dtype] )\n Returns a named typed tuple view of an ArrayBuffer.\n\n The view length equals the number of tuple fields.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first tuple element.\n Default: 0.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var buf = new ArrayBuffer( 16 );\n > var p = factory( buf, 4, 'float32' );\n > p.x\n 0.0\n > p.y\n 0.0\n > p[ 0 ]\n 0.0\n > p[ 1 ]\n 0.0\n\n\nfactory.from( src[, map[, thisArg]] )\n Creates a new named typed tuple from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n - field: tuple field.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of tuple elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > function mapFcn( v ) { return v * 2.0; };\n > var p = factory.from( [ 1.0, -1.0 ], mapFcn );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\nfactory.fromObject( obj[, map[, thisArg]] )\n Creates a new named typed tuple from an object containing tuple fields.\n\n A callback is provided the following arguments:\n\n - value: source object tuple field value.\n - field: source object tuple field name.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n map: Function (optional)\n Callback to invoke for each source object tuple field.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory.fromObject( { 'x': 2.0, 'y': -2.0 } );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\nfactory.of( element0[, element1[, ...[, elementN]]] )\n Creates a new named typed tuple from a variable number of arguments.\n\n The number of arguments *must* equal the number of tuple fields.\n\n Parameters\n ----------\n element: number\n Tuple elements.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory.of( 2.0, -2.0 );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\ntuple.BYTES_PER_ELEMENT\n Size (in bytes) of each tuple element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.BYTES_PER_ELEMENT\n 8\n\n\ntuple.buffer\n Pointer to the underlying data buffer.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.buffer\n <ArrayBuffer>\n\n\ntuple.byteLength\n Length (in bytes) of the tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.byteLength\n 16\n\n\ntuple.byteOffset\n Offset (in bytes) of a tuple from the start of its underlying ArrayBuffer.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.byteOffset\n 0\n\n\ntuple.length\n Tuple length (i.e., number of elements).\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.length\n 2\n\n\ntuple.name\n Tuple name.\n\n Examples\n --------\n > var opts = { 'name': 'Point' };\n > var factory = namedtypedtuple( [ 'x', 'y' ], opts );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.name\n 'Point'\n\n\ntuple.fields\n Returns the list of tuple fields.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.fields\n [ 'x', 'y' ]\n\n\ntuple.orderedFields\n Returns the list of tuple fields in index order.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p[ 0 ]\n 1.0\n > p.sort();\n > p[ 0 ]\n -1.0\n > p.fields\n [ 'x', 'y' ]\n > p.orderedFields\n [ 'y', 'x' ]\n\n\ntuple.copyWithin( target, start[, end] )\n Copies a sequence of elements within the tuple starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > p.copyWithin( 3, 0, 2 );\n > p.w\n 2.0\n > p.v\n -2.0\n\n\ntuple.entries()\n Returns an iterator for iterating over tuple key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple key-value pairs.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.entries();\n > it.next().value\n [ 0, 'x', 1.0 ]\n > it.next().value\n [ 1, 'y', -1.0 ]\n > it.next().done\n true\n\n\ntuple.every( predicate[, thisArg] )\n Tests whether all tuple elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements. If a predicate function\n returns a truthy value, a tuple element passes; otherwise, a tuple\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all tuple elements pass.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > p.every( predicate )\n false\n\n\ntuple.fieldOf( searchElement[, fromIndex] )\n Returns the field of the first tuple element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `undefined`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var f = p.fieldOf( 2.0 )\n undefined\n > f = p.fieldOf( -1.0 )\n 'z'\n\n\ntuple.fill( value[, start[, end]] )\n Fills a tuple from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last tuple element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.fill( 2.0 );\n > p.x\n 2.0\n > p.y\n 2.0\n\n\ntuple.filter( predicate[, thisArg] )\n Creates a new tuple which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n The returned tuple has the same data type as the host tuple.\n\n If a predicate function does not return a truthy value for any tuple\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters tuple elements. If a predicate function\n returns a truthy value, a tuple element is included in the output tuple;\n otherwise, a tuple element is not included in the output tuple.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var p2 = p1.filter( predicate );\n > p2.fields\n [ 'x', 'y' ]\n\n\ntuple.find( predicate[, thisArg] )\n Returns the first tuple element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Tuple element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = p.find( predicate )\n -1.0\n\n\ntuple.findField( predicate[, thisArg] )\n Returns the field of the first tuple element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var f = p.findField( predicate )\n 'z'\n\n\ntuple.findIndex( predicate[, thisArg] )\n Returns the index of the first tuple element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = p.findIndex( predicate )\n 2\n\n\ntuple.forEach( fcn[, thisArg] )\n Invokes a callback for each tuple element.\n\n A provided function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each tuple element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1, 0, -1 ], 'int32' );\n > var str = ' ';\n > function fcn( v, i, f ) { str += f + '=' + v + ' '; };\n > p.forEach( fcn );\n > str\n ' x=1 y=0 z=-1 '\n\n\ntuple.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether a tuple includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a tuple includes a search element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var bool = p.includes( 2.0 )\n false\n > bool = p.includes( -1.0 )\n true\n\n\ntuple.indexOf( searchElement[, fromIndex] )\n Returns the index of the first tuple element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var idx = p.indexOf( 2.0 )\n -1\n > idx = p.indexOf( -1.0 )\n 2\n\n\ntuple.ind2key( ind )\n Converts a tuple index to a field name.\n\n If provided an out-of-bounds index, the method returns `undefined`.\n\n Parameters\n ----------\n ind: integer\n Tuple index. If less than zero, the method resolves the index relative\n to the last tuple element.\n\n Returns\n -------\n field: string|undefined\n Field name.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p.ind2key( 1 )\n 'y'\n > p.ind2key( 100 )\n undefined\n\n\ntuple.join( [separator] )\n Serializes a tuple by joining all tuple elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating tuple elements. Default: ','.\n\n Returns\n -------\n str: string\n Tuple serialized as a string.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1, 0, -1 ], 'int32' );\n > p.join( '|' )\n '1|0|-1'\n\n\ntuple.keys()\n Returns an iterator for iterating over tuple keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple keys.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.keys();\n > it.next().value\n [ 0, 'x' ]\n > it.next().value\n [ 1, 'y' ]\n > it.next().done\n true\n\n\ntuple.key2ind( field )\n Converts a field name to a tuple index.\n\n If provided an unknown field name, the method returns `-1`.\n\n Parameters\n ----------\n field: string\n Tuple field name.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p.key2ind( 'y' )\n 1\n\n\ntuple.lastFieldOf( searchElement[, fromIndex] )\n Returns the field of the last tuple element strictly equal to a search\n element.\n\n The method iterates from the last tuple element to the first tuple element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `undefined`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: -1.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var f = p.lastFieldOf( 2.0 )\n undefined\n > f = p.lastFieldOf( 0.0 )\n 'w'\n\n\ntuple.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last tuple element strictly equal to a search\n element.\n\n The method iterates from the last tuple element to the first tuple element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = p.lastIndexOf( 2.0 )\n -1\n > idx = p.lastIndexOf( 0.0 )\n 3\n\n\ntuple.map( fcn[, thisArg] )\n Maps each tuple element to an element in a new tuple.\n\n A provided function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n The returned tuple has the same data type as the host tuple.\n\n Parameters\n ----------\n fcn: Function\n Function which maps tuple elements to elements in the new tuple.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var p2 = p1.map( fcn );\n > p2.x\n 2.0\n > p2.y\n 0.0\n > p2.z\n -2.0\n\n\ntuple.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in a tuple and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current tuple element.\n - index: index of the current tuple element.\n - field: field name corresponding to the current tuple element.\n - tuple: tuple on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first tuple element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first tuple element as the first argument and the second tuple\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = p.reduce( fcn, 0.0 )\n 2.0\n\n\ntuple.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in a tuple and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current tuple element.\n - index: index of the current tuple element.\n - field: field name corresponding to the current tuple element.\n - tuple: tuple on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last tuple element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last tuple element as the first argument and the second-to-last\n tuple element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = p.reduceRight( fcn, 0.0 )\n 2.0\n\n\ntuple.reverse()\n Reverses a tuple *in-place*.\n\n This method mutates the tuple on which the method is invoked.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p[ 0 ]\n 1.0\n > p.x\n 1.0\n > p.reverse();\n > p[ 0 ]\n -1.0\n > p.x\n 1.0\n\n\ntuple.set( arr[, offset] )\n Sets tuple elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing tuple values to set.\n\n offset: integer (optional)\n Tuple index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p[ 1 ]\n 0.0\n > p.y\n 0.0\n > p.set( [ -2.0, 2.0 ], 1 );\n > p[ 1 ]\n -2.0\n > p.y\n -2.0\n > p[ 2 ]\n 2.0\n > p.z\n 2.0\n\n\ntuple.slice( [begin[, end]] )\n Copies tuple elements to a new tuple with the same underlying data type as\n the host tuple.\n\n If the method is unable to resolve indices to a non-empty tuple subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > p1.fields\n [ 'x', 'y', 'z' ]\n > var p2 = p1.slice( 1 );\n > p2.fields\n [ 'y', 'z' ]\n > p2.y\n 0.0\n > p2.z\n -1.0\n\n\ntuple.some( predicate[, thisArg] )\n Tests whether at least one tuple element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements. If a predicate function\n returns a truthy value, a tuple element passes; otherwise, a tuple\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one tuple element passes.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > p.some( predicate )\n true\n\n\ntuple.sort( [compareFunction] )\n Sorts a tuple *in-place*.\n\n Sorting a tuple does *not* affect field assignments. Accessing a tuple field\n before and after sorting will always return the same tuple element. However,\n this behavior is generally not true when accessing tuple elements according\n to tuple index. In summary, sorting affects index order but not field\n assignments.\n\n The comparison function is provided two tuple elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the tuple on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > p.sort();\n > p.orderedFields\n [ 'v', 'y', 'z', 'x', 'w' ]\n > p[ 0 ]\n -2.0\n > p.x\n 1.0\n > p[ 1 ]\n -1.0\n > p.y\n -1.0\n > p.key2ind( 'x' )\n 3\n\n\ntuple.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host tuple.\n\n If the method is unable to resolve indices to a non-empty tuple subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n arr: TypedArray\n A new typed array view.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr = p.subarray( 2 )\n <Float64Array>[ 0.0, 2.0, -2.0 ]\n > arr.length\n 3\n\n\ntuple.subtuple( [begin[, end]] )\n Creates a new named typed tuple over the same underlying ArrayBuffer and\n with the same underlying data type as the host tuple.\n\n If the function is unable to resolve indices to a non-empty tuple\n subsequence, the function returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray|null\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p1 = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var p2 = p1.subtuple( 2 );\n > p2.fields\n [ 'z', 'w', 'v' ]\n > p2[ 0 ]\n 0.0\n > p2.z\n 0.0\n > p2[ 1 ]\n 2.0\n > p2.w\n 2.0\n > p2[ 2 ]\n -2.0\n > p2.v\n -2.0\n > p2.length\n 3\n\n\ntuple.toJSON()\n Serializes a tuple as JSON.\n\n Returns\n -------\n obj: Object\n A tuple JSON representation.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, -1.0, 0.0 ] );\n > p.toJSON()\n { 'x': 1.0, 'y': -1.0, 'z': 0.0 }\n\n\ntuple.toLocaleString( [locales[, options]] )\n Serializes a tuple as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, -1.0, 0.0 ], 'int32' );\n > p.toLocaleString()\n '1,-1,0'\n\n\ntuple.toString()\n Serializes a tuple as a string.\n\n Returns\n -------\n str: string\n A tuple string representation.\n\n Examples\n --------\n > opts = { 'name': 'Point' };\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ], opts );\n > var p = factory( [ 1.0, -1.0, 0.0 ] );\n > p.toString()\n 'Point(x=1, y=-1, z=0)'\n\n\ntuple.values()\n Returns an iterator for iterating over tuple elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple elements.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n See Also\n --------\n typedarray\n",
"nativeClass": "\nnativeClass( value )\n Returns a string value indicating a specification defined classification of\n an object.\n\n The function is *not* robust for ES2015+ environments. In ES2015+,\n `Symbol.toStringTag` allows overriding the default description of an object.\n While measures are taken to uncover the default description, such measures\n can be thwarted. While this function remains useful for type-checking, be\n aware that value impersonation is possible. Where possible, prefer functions\n tailored to checking for particular value types, as specialized functions\n are better equipped to address `Symbol.toStringTag`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: string\n String value indicating a specification defined classification of the\n input value.\n\n Examples\n --------\n > var str = nativeClass( 'a' )\n '[object String]'\n > str = nativeClass( 5 )\n '[object Number]'\n > function Beep(){};\n > str = nativeClass( new Beep() )\n '[object Object]'\n\n See Also\n --------\n constructorName, typeOf\n",
"ndarray": "\nndarray( dtype, ndims[, options] )\n Returns an ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n ctor: Function\n ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = ndarray( 'generic', 2 )\n <Function>\n\n // To create a new instance...\n > var b = [ 1.0, 2.0, 3.0, 4.0 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n array\n",
"ndarrayCastingModes": "\nndarrayCastingModes()\n Returns a list of ndarray casting modes.\n\n The output array contains the following modes:\n\n - 'none': only allow casting between identical types\n - 'equiv': allow casting between identical and byte swapped types\n - 'safe': only allow \"safe\" casts\n - 'same-kind': allow \"safe\" casts and casts within the same kind (e.g.,\n between signed integers or between floats)\n - 'unsafe': allow casting between all types (including between integers and\n floats)\n\n Returns\n -------\n out: Array<string>\n List of ndarray casting modes.\n\n Examples\n --------\n > var out = ndarrayCastingModes()\n [ 'none', 'equiv', 'safe', 'same-kind', 'unsafe' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayDataTypes": "\nndarrayDataTypes()\n Returns a list of ndarray data types.\n\n The output array contains the following data types:\n\n - binary: binary.\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of ndarray data types.\n\n Examples\n --------\n > var out = ndarrayDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, array, ndarray, typedarrayDataTypes\n",
"ndarrayIndexModes": "\nndarrayIndexModes()\n Returns a list of ndarray index modes.\n\n The output array contains the following modes:\n\n - throw: specifies that a function should throw an error when an index is\n outside a restricted interval.\n - wrap: specifies that a function should wrap around an index using modulo\n arithmetic.\n - clamp: specifies that a function should set an index less than zero to\n zero (minimum index) and set an index greater than a maximum index value to\n the maximum possible index.\n\n Returns\n -------\n out: Array<string>\n List of ndarray index modes.\n\n Examples\n --------\n > var out = ndarrayIndexModes()\n [ 'throw', 'clamp', 'wrap' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayMemoized": "\nndarrayMemoized( dtype, ndims[, options] )\n Returns a memoized ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n ctor: Function\n Memoized ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = ndarrayMemoized( 'generic', 2 )\n <Function>\n > var f = ndarrayMemoized( 'generic', 2 )\n <Function>\n > var bool = ( f === ctor )\n true\n\n // To create a new instance...\n > var b = [ 1.0, 2.0, 3.0, 4.0 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n array, ndarray\n",
"ndarrayMinDataType": "\nndarrayMinDataType( value )\n Returns the minimum ndarray data type of the closest \"kind\" necessary for\n storing a provided scalar value.\n\n The function does *not* provide precision guarantees for non-integer-valued\n real numbers. In other words, the function returns the smallest possible\n floating-point (i.e., inexact) data type for storing numbers having\n decimals.\n\n Parameters\n ----------\n value: any\n Scalar value.\n\n Returns\n -------\n dt: string\n ndarray data type.\n\n Examples\n --------\n > var dt = ndarrayMinDataType( 3.141592653589793 )\n 'float32'\n > dt = ndarrayMinDataType( 3 )\n 'uint8'\n > dt = ndarrayMinDataType( -3 )\n 'int8'\n > dt = ndarrayMinDataType( '-3' )\n 'generic'\n\n See Also\n --------\n ndarrayDataTypes, ndarrayPromotionRules, ndarraySafeCasts\n",
"ndarrayNextDataType": "\nndarrayNextDataType( [dtype] )\n Returns the next larger ndarray data type of the same kind.\n\n If not provided a data type, the function returns a table.\n\n If a data type does not have a next larger data type or the next larger type\n is not supported, the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Next larger type(s).\n\n Examples\n --------\n > var out = ndarrayNextDataType( 'float32' )\n 'float64'\n\n See Also\n --------\n ndarrayDataTypes, ndarrayPromotionRules, ndarraySafeCasts\n",
"ndarrayOrders": "\nndarrayOrders()\n Returns a list of ndarray orders.\n\n The output array contains the following orders:\n\n - row-major: row-major (C-style) order.\n - column-major: column-major (Fortran-style) order.\n\n Returns\n -------\n out: Array<string>\n List of ndarray orders.\n\n Examples\n --------\n > var out = ndarrayOrders()\n [ 'row-major', 'column-major' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayPromotionRules": "\nndarrayPromotionRules( [dtype1, dtype2] )\n Returns the ndarray data type with the smallest size and closest \"kind\" to\n which ndarray data types can be safely cast.\n\n If not provided data types, the function returns a type promotion table.\n\n If a data type to which data types can be safely cast does *not* exist (or\n is not supported), the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype1: string (optional)\n ndarray data type.\n\n dtype2: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Promotion rule(s).\n\n Examples\n --------\n > var out = ndarrayPromotionRules( 'float32', 'int32' )\n 'float64'\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySafeCasts\n",
"ndarraySafeCasts": "\nndarraySafeCasts( [dtype] )\n Returns a list of ndarray data types to which a provided ndarray data type\n can be safely cast.\n\n If not provided an ndarray data type, the function returns a casting table.\n\n If provided an unrecognized ndarray data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n ndarray data types to which a data type can be safely cast.\n\n Examples\n --------\n > var out = ndarraySafeCasts( 'float32' )\n <Array>\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySameKindCasts\n",
"ndarraySameKindCasts": "\nndarraySameKindCasts( [dtype] )\n Returns a list of ndarray data types to which a provided ndarray data type\n can be safely cast or cast within the same \"kind\".\n\n If not provided an ndarray data type, the function returns a casting table.\n\n If provided an unrecognized ndarray data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n ndarray data types to which a data type can be safely cast or cast\n within the same \"kind\".\n\n Examples\n --------\n > var out = ndarraySameKindCasts( 'float32' )\n <Array>\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySafeCasts\n",
"NIGHTINGALES_ROSE": "\nNIGHTINGALES_ROSE()\n Returns data for Nightingale's famous polar area diagram.\n\n Returns\n -------\n out: Array<Object>\n Nightingale's data.\n\n Examples\n --------\n > var data = NIGHTINGALES_ROSE()\n [{...}, {...}, ...]\n\n References\n ----------\n - Nightingale, Florence. 1859. *A contribution to the sanitary history of\n the British army during the late war with Russia*. London, United Kingdom:\n John W. Parker and Son. <http://ocp.hul.harvard.edu/dl/contagion/010164675>.\n\n",
"NINF": "\nNINF\n Double-precision floating-point negative infinity.\n\n Examples\n --------\n > NINF\n -Infinity\n\n See Also\n --------\n FLOAT16_NINF, FLOAT32_NINF, PINF\n",
"NODE_VERSION": "\nNODE_VERSION\n Node version.\n\n Examples\n --------\n > NODE_VERSION\n <string>\n\n",
"none": "\nnone( collection )\n Tests whether all elements in a collection are falsy.\n\n The function immediately returns upon encountering a truthy value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if all elements are falsy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 0, 0, 0 ];\n > var bool = none( arr )\n true\n\n See Also\n --------\n any, every, forEach, noneBy, some\n",
"noneBy": "\nnoneBy( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a falsy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = noneBy( arr, negative )\n true\n\n See Also\n --------\n anyBy, everyBy, forEach, none, noneByRight, someBy\n",
"noneByAsync": "\nnoneByAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a truthy `result` value\n and calls the `done` callback with `null` as the first argument and `false`\n as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null` as\n the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\nnoneByAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection fail a\n test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = noneByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByAsync, everyByAsync, forEachAsync, noneBy, noneByRightAsync, someByAsync\n",
"noneByRight": "\nnoneByRight( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a falsy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ -1, -2, -3, -4 ];\n > var bool = noneByRight( arr, positive )\n true\n\n See Also\n --------\n anyByRight, everyByRight, forEachRight, none, noneBy, someByRight\n",
"noneByRightAsync": "\nnoneByRightAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a truthy `result` value\n and calls the `done` callback with `null` as the first argument and `false`\n as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null` as\n the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\nnoneByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection fail a\n test implemented by a predicate function, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = noneByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByRightAsync, everyByRightAsync, forEachRightAsync, noneByAsync, noneByRight, someByRightAsync\n",
"nonEnumerableProperties": "\nnonEnumerableProperties( value )\n Returns an array of an object's own non-enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own non-enumerable properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var props = nonEnumerableProperties( obj )\n [ 'beep' ]\n\n See Also\n --------\n enumerableProperties, inheritedNonEnumerableProperties, nonEnumerablePropertiesIn, properties\n",
"nonEnumerablePropertiesIn": "\nnonEnumerablePropertiesIn( value )\n Returns an array of an object's own and inherited non-enumerable property\n names and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited non-enumerable property names and\n symbols.\n\n Examples\n --------\n > var props = nonEnumerablePropertiesIn( [] )\n\n See Also\n --------\n enumerablePropertiesIn, inheritedNonEnumerableProperties, nonEnumerableProperties, propertiesIn\n",
"nonEnumerablePropertyNames": "\nnonEnumerablePropertyNames( value )\n Returns an array of an object's own non-enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own non-enumerable property names.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var keys = nonEnumerablePropertyNames( obj )\n e.g., [ 'beep', ... ]\n\n See Also\n --------\n objectKeys, inheritedNonEnumerablePropertyNames, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbolsIn, propertyNames\n",
"nonEnumerablePropertyNamesIn": "\nnonEnumerablePropertyNamesIn( value )\n Returns an array of an object's own and inherited non-enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own and inherited non-enumerable property names.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var keys = nonEnumerablePropertyNamesIn( obj )\n e.g., [ 'beep', ... ]\n\n See Also\n --------\n keysIn, inheritedNonEnumerablePropertyNames, nonEnumerablePropertyNames, propertyNamesIn\n",
"nonEnumerablePropertySymbols": "\nnonEnumerablePropertySymbols( value )\n Returns an array of an object's own non-enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own non-enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = nonEnumerablePropertySymbols( obj )\n\n See Also\n --------\n enumerablePropertySymbols, inheritedNonEnumerablePropertySymbols, nonEnumerablePropertyNames, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"nonEnumerablePropertySymbolsIn": "\nnonEnumerablePropertySymbolsIn( value )\n Returns an array of an object's own and inherited non-enumerable symbol\n properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited non-enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = nonEnumerablePropertySymbolsIn( obj )\n\n See Also\n --------\n enumerablePropertySymbolsIn, inheritedNonEnumerablePropertySymbols, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbols, propertySymbolsIn\n",
"noop": "\nnoop()\n A function which does nothing.\n\n Examples\n --------\n > noop();\n\n",
"now": "\nnow()\n Returns the time in seconds since the epoch.\n\n The Unix epoch is 00:00:00 UTC on 1 January 1970.\n\n Returns\n -------\n out: integer\n Time in seconds since the epoch.\n\n Examples\n --------\n > var ts = now()\n <number>\n\n",
"NUM_CPUS": "\nNUM_CPUS\n Number of CPUs.\n\n In browser environments, the number of CPUs is determined by querying the\n hardware concurrency API.\n\n In Node.js environments, the number of CPUs is determined via the `os`\n module.\n\n Examples\n --------\n > NUM_CPUS\n <number>\n\n",
"Number": "\nNumber( value )\n Returns a Number object.\n\n This constructor should be used sparingly. Always prefer number primitives.\n\n Parameters\n ----------\n value: number\n Value to wrap in a Number object.\n\n Returns\n -------\n out: Number\n Number object.\n\n Examples\n --------\n > var v = new Number( 5 )\n <Number>\n\n",
"objectEntries": "\nobjectEntries( obj )\n Returns an array of an object's own enumerable property `[key, value]`\n pairs.\n\n Entry order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic return values.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n arr: Array\n Array containing key-value pairs.\n\n Examples\n --------\n > var obj = { 'beep': 'boop', 'foo': 'bar' };\n > var entries = objectEntries( obj )\n e.g., [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ]\n\n See Also\n --------\n objectEntriesIn, objectFromEntries, objectKeys, objectValues\n",
"objectEntriesIn": "\nobjectEntriesIn( obj )\n Returns an array of an object's own and inherited enumerable property\n `[key, value]` pairs.\n\n Entry order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic return values.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n arr: Array\n Array containing key-value pairs.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var entries = objectEntriesIn( obj )\n e.g., [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ]\n\n See Also\n --------\n objectEntries, objectFromEntries, keysIn, objectValuesIn\n",
"objectFromEntries": "\nobjectFromEntries( entries )\n Creates an object from an array of key-value pairs.\n\n Parameters\n ----------\n entries: Array<Array>\n Input object.\n\n Returns\n -------\n out: Object\n Object created from `[key, value]` pairs.\n\n Examples\n --------\n > var entries = [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ];\n > var obj = objectFromEntries( entries )\n { 'beep': 'boop', 'foo': 'bar' }\n\n See Also\n --------\n objectEntries\n",
"objectInverse": "\nobjectInverse( obj[, options] )\n Inverts an object, such that keys become values and values become keys.\n\n Beware when providing objects having values which are themselves objects.\n The function relies on native object serialization (`#toString`) when\n converting values to keys.\n\n Insertion order is not guaranteed, as object key enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's keys, thus allowing for\n deterministic inversion.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n options: Object (optional)\n Options.\n\n options.duplicates: boolean (optional)\n Boolean indicating whether to store keys mapped to duplicate values in\n arrays. Default: `true`.\n\n Returns\n -------\n out: Object\n Inverted object.\n\n Examples\n --------\n // Basic usage:\n > var obj = { 'a': 'beep', 'b': 'boop' };\n > var out = objectInverse( obj )\n { 'beep': 'a', 'boop': 'b' }\n\n // Duplicate values:\n > obj = { 'a': 'beep', 'b': 'beep' };\n > out = objectInverse( obj )\n { 'beep': [ 'a', 'b' ] }\n\n // Override duplicate values:\n > obj = {};\n > obj.a = 'beep';\n > obj.b = 'boop';\n > obj.c = 'beep';\n > out = objectInverse( obj, { 'duplicates': false } )\n { 'beep': 'c', 'boop': 'b' }\n\n See Also\n --------\n objectInverseBy\n",
"objectInverseBy": "\nobjectInverseBy( obj, [options,] transform )\n Inverts an object, such that keys become values and values become keys,\n according to a transform function.\n\n The transform function is provided three arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n\n The value returned by a transform function should be a value which can be\n serialized as an object key. Hence, beware when providing objects having\n values which are themselves objects. The function relies on native object\n serialization (`#toString`) when converting transform function return values\n to keys.\n\n Insertion order is not guaranteed, as object key enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's keys, thus allowing for\n deterministic inversion.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n options: Object (optional)\n Options.\n\n options.duplicates: boolean (optional)\n Boolean indicating whether to store keys mapped to duplicate values in\n arrays. Default: `true`.\n\n transform: Function\n Transform function.\n\n Returns\n -------\n out: Object\n Inverted object.\n\n Examples\n --------\n // Basic usage:\n > function transform( key, value ) { return key + value; };\n > var obj = { 'a': 'beep', 'b': 'boop' };\n > var out = objectInverseBy( obj, transform )\n { 'abeep': 'a', 'bboop': 'b' }\n\n // Duplicate values:\n > function transform( key, value ) { return value; };\n > obj = { 'a': 'beep', 'b': 'beep' };\n > out = objectInverseBy( obj, transform )\n { 'beep': [ 'a', 'b' ] }\n\n // Override duplicate values:\n > obj = {};\n > obj.a = 'beep';\n > obj.b = 'boop';\n > obj.c = 'beep';\n > out = objectInverseBy( obj, { 'duplicates': false }, transform )\n { 'beep': 'c', 'boop': 'b' }\n\n See Also\n --------\n objectInverse\n",
"objectKeys": "\nobjectKeys( value )\n Returns an array of an object's own enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own enumerable property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = objectKeys( obj )\n [ 'beep' ]\n\n See Also\n --------\n objectEntries, keysIn, objectValues\n",
"objectValues": "\nobjectValues( obj )\n Returns an array of an object's own enumerable property values.\n\n Value order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n values: Array\n Value array.\n\n Examples\n --------\n > var obj = { 'beep': 'boop', 'foo': 'bar' };\n > var vals = objectValues( obj )\n e.g., [ 'boop', 'bar' ]\n\n See Also\n --------\n objectEntries, objectKeys\n",
"objectValuesIn": "\nobjectValuesIn( obj )\n Returns an array of an object's own and inherited enumerable property\n values.\n\n Value order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n values: Array\n Value array.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var values = objectValuesIn( obj )\n e.g., [ 'boop', 'bar' ]\n\n See Also\n --------\n objectEntriesIn, keysIn, objectValues\n",
"omit": "\nomit( obj, keys )\n Returns a partial object copy excluding specified keys.\n\n The function returns a shallow copy.\n\n The function ignores non-existent keys.\n\n The function only copies own properties. Hence, the function never copies\n inherited properties.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n keys: string|Array<string>\n Keys to exclude.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = omit( obj1, 'b' )\n { 'a': 1 }\n\n See Also\n --------\n omitBy\n",
"omitBy": "\nomitBy( obj, predicate )\n Returns a partial object copy excluding properties for which a predicate\n returns a truthy value.\n\n The function returns a shallow copy.\n\n The function only copies own properties. Hence, the function never copies\n inherited properties.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n predicate: Function\n Predicate function.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function predicate( key, value ) { return ( value > 1 ); };\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = omitBy( obj1, predicate )\n { 'a': 1 }\n\n See Also\n --------\n omit\n",
"openURL": "\nopenURL( url )\n Opens a URL in a user's default browser.\n\n In a non-browser environment, the function returns an unreferenced child\n process. In a browser environment, the function returns a reference to a\n `window` object.\n\n Parameters\n ----------\n url: string\n URL to open.\n\n Returns\n -------\n out: process|Window\n Child process or `window` object.\n\n Examples\n --------\n > var out = openURL( 'https://google.com' );\n\n",
"pad": "\npad( str, len[, options] )\n Pads a `string` such that the padded `string` has length `len`.\n\n Any padding which does not evenly divide available space is trimmed such\n that the returned string length is always `len`.\n\n If `len < str.length`, the input string is trimmed.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Output string length.\n\n options: Object (optional)\n Options.\n\n options.lpad: string (optional)\n String used to left pad.\n\n options.rpad: string (optional)\n String used to right pad.\n\n options.centerRight: boolean (optional)\n Boolean indicating whether to center right in the event of a tie.\n Default: `false` (i.e., center left).\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n // Standard usage:\n > var out = pad( 'a', 5 )\n 'a '\n\n // Left pad:\n > out = pad( 'a', 10, { 'lpad': 'b' })\n 'bbbbbbbbba'\n\n // Right pad:\n > out = pad( 'a', 12, { 'rpad': 'b' })\n 'abbbbbbbbbbb'\n\n // Center an input string:\n > var opts = { 'lpad': 'a', 'rpad': 'c' };\n > out = pad( 'b', 11, opts )\n 'aaaaabccccc'\n\n // Left center:\n > opts.centerRight = false;\n > out = pad( 'b', 10, opts )\n 'aaaabccccc'\n\n // Right center:\n > opts.centerRight = true;\n > out = pad( 'b', 10, opts )\n 'aaaaabcccc'\n\n // Output string always length `len`:\n > opts = { 'lpad': 'boop', 'rpad': 'woot' };\n > out = pad( 'beep', 10, opts )\n 'boobeepwoo'\n\n // Pad right, trim right:\n > out = pad( 'beep', 2 )\n 'be'\n\n // Pad left, trim left:\n > opts = { 'lpad': 'b' };\n > out = pad( 'beep', 2, opts )\n 'ep'\n\n // Pad both, trim both:\n > opts = { 'lpad': '@', 'rpad': '!' };\n > out = pad( 'beep', 2, opts )\n 'ee'\n\n // Pad both, trim both starting from left:\n > out = pad( 'abcdef', 3, opts )\n 'cde'\n\n // Pad both, trim both starting from right:\n > opts.centerRight = true;\n > out = pad( 'abcdef', 3, opts )\n 'bcd'\n\n See Also\n --------\n lpad, rpad\n",
"papply": "\npapply( fcn, ...args )\n Returns a function of smaller arity by partially applying arguments.\n\n The implementation does not set the `length` property of the returned\n function. Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n Parameters\n ----------\n fcn: Function\n Function to partially apply.\n\n args: ...any\n Arguments to partially apply.\n\n Returns\n -------\n out: Function\n Partially applied function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var add2 = papply( add, 2 );\n > var sum = add2( 3 )\n 5\n\n See Also\n --------\n papplyRight\n",
"papplyRight": "\npapplyRight( fcn, ...args )\n Returns a function of smaller arity by partially applying arguments from the\n right.\n\n The implementation does not set the `length` property of the returned\n function. Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n Parameters\n ----------\n fcn: Function\n Function to partially apply.\n\n args: ...any\n Arguments to partially apply.\n\n Returns\n -------\n out: Function\n Partially applied function.\n\n Examples\n --------\n > function say( text, name ) { return text + ', ' + name + '.'; };\n > var toGrace = papplyRight( say, 'Grace Hopper' );\n > var str = toGrace( 'Hello' )\n 'Hello, Grace Hopper.'\n > str = toGrace( 'Thank you' )\n 'Thank you, Grace Hopper.'\n\n See Also\n --------\n papply\n",
"parallel": "\nparallel( files, [options,] clbk )\n Executes scripts in parallel.\n\n Relative file paths are resolved relative to the current working directory.\n\n Ordered script output does not imply that scripts are executed in order. To\n preserve script order, execute the scripts sequentially via some other\n means.\n\n Parameters\n ----------\n files: Array<string>\n Script file paths.\n\n options: Object (optional)\n Options.\n\n options.cmd: string (optional)\n Executable file/command. Default: `'node'`.\n\n options.concurrency: integer (optional)\n Number of scripts to execute concurrently. Script concurrency cannot\n exceed the number of scripts. By specifying a concurrency greater than\n the number of workers, a worker may be executing more than `1` script at\n any one time. While not likely to be advantageous for synchronous\n scripts, setting a higher concurrency may be advantageous for scripts\n performing asynchronous tasks. If the script concurrency is less than\n the number of workers, the number of workers is reduced to match the\n specified concurrency. Default: `options.workers`.\n\n options.workers: integer (optional)\n Number of workers. Default: number of CPUs minus `1`.\n\n options.ordered: boolean (optional)\n Boolean indicating whether to preserve the order of script output. By\n default, the `stdio` output for each script is interleaved; i.e., the\n `stdio` output from one script may be interleaved with the `stdio`\n output from one or more other scripts. To preserve the `stdio` output\n order for each script, set the `ordered` option to `true`. Default:\n `false`.\n\n options.uid: integer (optional)\n Process user identity.\n\n options.gid: integer (optional)\n Process group identity.\n\n options.maxBuffer: integer (optional)\n Max child process `stdio` buffer size. This option is only applied when\n `options.ordered = true`. Default: `200*1024*1024`.\n\n clbk: Function\n Callback to invoke after executing all scripts.\n\n Examples\n --------\n > function done( error ) { if ( error ) { throw error; } };\n > var files = [ './a.js', './b.js' ];\n > parallel( files, done );\n\n // Specify the number of workers:\n > var opts = { 'workers': 8 };\n > parallel( files, opts, done );\n\n",
"parseJSON": "\nparseJSON( str[, reviver] )\n Attempts to parse a string as JSON.\n\n Function behavior differs from `JSON.parse()` as follows:\n\n - throws a `TypeError` if provided any value which is not a string.\n - throws a `TypeError` if provided a `reviver` argument which is not a\n function.\n - returns, rather than throws, a `SyntaxError` if unable to parse a string\n as JSON.\n\n Parameters\n ----------\n str: string\n String to parse.\n\n reviver: Function (optional)\n Transformation function.\n\n Returns\n -------\n out: any|Error\n Parsed value or an error.\n\n Examples\n --------\n > var obj = parseJSON( '{\"beep\":\"boop\"}' )\n { 'beep': 'boop' }\n\n // Provide a reviver:\n > function reviver( key, value ) {\n ... if ( key === '' ) { return value; }\n ... if ( key === 'beep' ) { return value; }\n ... };\n > var str = '{\"beep\":\"boop\",\"a\":\"b\"}';\n > var out = parseJSON( str, reviver )\n { 'beep': 'boop' }\n\n",
"PATH_DELIMITER": "\nPATH_DELIMITER\n Platform-specific path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER\n <string>\n\n // POSIX environment:\n > var path = '/usr/bin:/bin:/usr/sbin';\n > var parts = path.split( PATH_DELIMITER )\n [ '/usr/bin', '/bin', '/usr/sbin' ]\n\n // Windows environment:\n > path = 'C:\\\\Windows\\\\system32;C:\\\\Windows';\n > parts = path.split( PATH_DELIMITER )\n [ 'C:\\\\Windows\\system32', 'C:\\\\Windows' ]\n\n See Also\n --------\n PATH_DELIMITER_POSIX, PATH_DELIMITER_WIN32\n",
"PATH_DELIMITER_POSIX": "\nPATH_DELIMITER_POSIX\n POSIX path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER_POSIX\n ':'\n > var PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin';\n > var paths = PATH.split( PATH_DELIMITER_POSIX )\n [ '/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin' ]\n\n See Also\n --------\n PATH_DELIMITER, PATH_DELIMITER_WIN32\n",
"PATH_DELIMITER_WIN32": "\nPATH_DELIMITER_WIN32\n Windows path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER_WIN32\n ';'\n > var PATH = 'C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Program Files\\\\node\\\\';\n > var paths = PATH.split( PATH_DELIMITER_WIN32 )\n [ 'C:\\\\Windows\\\\system32', 'C:\\\\Windows', 'C:\\\\Program Files\\\\node\\\\' ]\n\n See Also\n --------\n PATH_DELIMITER, PATH_DELIMITER_POSIX\n",
"PATH_SEP": "\nPATH_SEP\n Platform-specific path segment separator.\n\n Examples\n --------\n > PATH_SEP\n <string>\n\n // Windows environment:\n > var parts = 'foo\\\\bar\\\\baz'.split( PATH_SEP )\n [ 'foo', 'bar', 'baz' ]\n\n // POSIX environment:\n > parts = 'foo/bar/baz'.split( PATH_SEP )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP_POSIX, PATH_SEP_WIN32\n",
"PATH_SEP_POSIX": "\nPATH_SEP_POSIX\n POSIX path segment separator.\n\n Examples\n --------\n > PATH_SEP_POSIX\n '/'\n > var parts = 'foo/bar/baz'.split( PATH_SEP_POSIX )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP, PATH_SEP_WIN32\n",
"PATH_SEP_WIN32": "\nPATH_SEP_WIN32\n Windows path segment separator.\n\n Examples\n --------\n > PATH_SEP_WIN32\n '\\\\'\n > var parts = 'foo\\\\bar\\\\baz'.split( PATH_SEP_WIN32 )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP, PATH_SEP_POSIX\n",
"pcorrtest": "\npcorrtest( x, y[, options] )\n Computes a Pearson product-moment correlation test between paired samples.\n\n By default, the function performs a t-test for the null hypothesis that the\n data in arrays or typed arrays `x` and `y` is not correlated. A test against\n a different population correlation can be carried out by supplying the `rho`\n option. In this case, a test using the Fisher's z transform is conducted.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Nnumber in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.rho: number (optional)\n Number denoting the correlation under the null hypothesis.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the Pearson product-moment correlation\n coefficient. The confidence interval is calculated using Fisher's\n z-transform.\n\n out.nullValue: number\n Assumed correlation under H0 (equal to the supplied `rho` option).\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var rho = 0.5;\n > var x = new Array( 300 );\n > var y = new Array( 300 );\n > for ( var i = 0; i < 300; i++ ) {\n ... x[ i ] = base.random.normal( 0.0, 1.0 );\n ... y[ i ] = ( rho * x[ i ] ) + base.random.normal( 0.0,\n ... base.sqrt( 1.0 - (rho*rho) ) );\n ... }\n > var out = pcorrtest( x, y )\n {\n alpha: 0.05,\n rejected: true,\n pValue: 0,\n statistic: 10.115805615994121,\n ci: [ 0.4161679018930295, 0.5853122968949995 ],\n alternative: 'two-sided',\n method: 't-test for Pearson correlation coefficient',\n nullValue: 0,\n pcorr: 0.505582072355616,\n }\n\n // Print output:\n > var table = out.print()\n t-test for Pearson correlation coefficient\n\n Alternative hypothesis: True correlation coefficient is not equal to 0\n\n pValue: 0\n statistic: 9.2106\n 95% confidence interval: [0.3776,0.5544]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n",
"percentEncode": "\npercentEncode( str )\n Percent-encodes a UTF-16 encoded string according to RFC 3986.\n\n Parameters\n ----------\n str: string\n UTF-16 encoded string.\n\n Returns\n -------\n out: string\n Percent-encoded string.\n\n Examples\n --------\n > var out = percentEncode( '☃' )\n '%E2%98%83'\n\n",
"PHI": "\nPHI\n Golden ratio.\n\n Examples\n --------\n > PHI\n 1.618033988749895\n\n",
"PI": "\nPI\n The mathematical constant `π`.\n\n Examples\n --------\n > PI\n 3.141592653589793\n\n See Also\n --------\n TWO_PI\n",
"PI_SQUARED": "\nPI_SQUARED\n Square of the mathematical constant `π`.\n\n Examples\n --------\n > PI_SQUARED\n 9.869604401089358\n\n See Also\n --------\n PI\n",
"pick": "\npick( obj, keys )\n Returns a partial object copy containing only specified keys.\n\n If a key does not exist as an own property in a source object, the key is\n ignored.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n keys: string|Array<string>\n Keys to copy.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = pick( obj1, 'b' )\n { 'b': 2 }\n\n See Also\n --------\n pickBy\n",
"pickBy": "\npickBy( obj, predicate )\n Returns a partial object copy containing properties for which a predicate\n returns a truthy value.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n predicate: Function\n Predicate function.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function predicate( key, value ) {\n ... return ( value > 1 );\n ... };\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = pickBy( obj1, predicate )\n { 'b': 2 }\n\n See Also\n --------\n pick\n",
"PINF": "\nPINF\n Double-precision floating-point positive infinity.\n\n Examples\n --------\n > PINF\n Infinity\n\n See Also\n --------\n NINF\n",
"PLATFORM": "\nPLATFORM\n Platform on which the current process is running.\n\n Possible values:\n\n - win32\n - darwin\n - linux\n - freebsd\n - sunos\n\n Examples\n --------\n > PLATFORM\n <string>\n\n See Also\n --------\n ARCH\n",
"plot": "\nplot( [x, y,] [options] )\n Returns a plot instance for creating 2-dimensional plots.\n\n `x` and `y` arguments take precedence over `x` and `y` options.\n\n Parameters\n ----------\n x: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing x-coordinate values.\n\n y: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing y-coordinate values.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.autoView: boolean (optional)\n Boolean indicating whether to generate an updated view on a 'render'\n event. Default: false.\n\n options.colors: string|Array<string> (optional)\n Data color(s). Default: 'category10'.\n\n options.description: string (optional)\n Plot description.\n\n options.engine: string (optional)\n Plot engine. Default: 'svg'.\n\n options.height: number (optional)\n Plot height (in pixels). Default: 400.\n\n options.labels: Array|Array<string> (optional)\n Data labels.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.lineStyle: string|Array<string> (optional)\n Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'.\n Default: '-'.\n\n options.lineOpacity: number|Array<number> (optional)\n Data line opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.lineWidth: integer|Array<integer> (optional)\n Data line width (in pixels). Default: 2.\n\n options.paddingBottom: integer (optional)\n Bottom padding (in pixels). Default: 80.\n\n options.paddingLeft: integer (optional)\n Left padding (in pixels). Default: 90.\n\n options.paddingRight: integer (optional)\n Right padding (in pixels). Default: 20.\n\n options.paddingTop: integer (optional)\n Top padding (in pixels). Default: 80.\n\n options.renderFormat: string (optional)\n Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'.\n\n options.symbols: string|Array<string> (optional)\n Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'.\n Default: 'none'.\n\n options.symbolsOpacity: number|Array<number> (optional)\n Symbols opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.symbolsSize: integer|Array<integer> (optional)\n Symbols size (in pixels). Default: 6.\n\n options.title: string (optional)\n Plot title.\n\n options.viewer: string (optional)\n Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window',\n or 'none'. Default: 'none'.\n\n options.width: number (optional)\n Plot width (in pixels). Default: 400.\n\n options.x: Array<Array>|Array<TypedArray> (optional)\n x-coordinate values.\n\n options.xAxisOrient: string (optional)\n x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'.\n\n options.xLabel: string (optional)\n x-axis label. Default: 'x'.\n\n options.xMax: number|null (optional)\n Maximum value of the x-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.xMin: number|null (optional)\n Minimum value of the x-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.xNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.xRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the x-axis.\n\n options.xRugOrient: string|Array<string> (optional)\n x-axis rug plot orientation(s). Must be either 'bottom' or 'top'.\n Default: 'bottom'.\n\n options.xRugOpacity: number|Array<number> (optional)\n x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.xRugSize: integer|Array<integer> (optional)\n x-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.xScale: string\n x-axis scale. Default: 'linear'.\n\n options.xTickFormat: string|null\n x-axis tick format. Default: null.\n\n options.y: Array<Array>|Array<TypedArray> (optional)\n y-coordinate values.\n\n options.yAxisOrient: string (optional)\n x-axis orientation. Must be either 'left' or 'right'. Default: 'left'.\n\n options.yLabel: string (optional)\n y-axis label. Default: 'y'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.yNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.yRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the y-axis.\n\n options.yRugOrient: string|Array<string> (optional)\n y-axis rug plot orientation(s). Must be either 'left' or 'right'.\n Default: 'left'.\n\n options.yRugOpacity: number|Array<number> (optional)\n y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.yRugSize: integer|Array<integer> (optional)\n y-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.yScale: string\n y-axis scale. Default: 'linear'.\n\n options.yTickFormat: string|null\n y-axis tick format. Default: null.\n\n Returns\n -------\n plot: Plot\n Plot instance.\n\n plot.render()\n Renders a plot as a virtual DOM tree.\n\n plot.view( [viewer] )\n Generates a plot view.\n\n plot.x\n x-coordinate values. An assigned value must be an array where each\n element corresponds to a plotted dataset.\n\n plot.y\n y-coordinate values. An assigned value must be an array, where each\n element corresponds to a plotted dataset.\n\n plot.labels\n Data labels. During plot creation, each plotted dataset is assigned a\n label. If the number of labels is less than the number of plotted\n datasets, labels are reused using modulo arithmetic.\n\n plot.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n plot.colors\n Data colors. To set the color all plotted datasets, provide a color\n name. To specify the colors for each dataset, provide an array of\n colors. During plot creation, each plotted dataset is assigned one of\n the provided colors. If the number of colors is less than the number of\n plotted datasets, colors are reused using modulo arithmetic. Lastly,\n colors may also be specified by providing the name of a predefined color\n scheme. The following schemes are supported: 'category10', 'category20',\n 'category20b', and 'category20c'.\n\n plot.lineStyle\n Data line style(s). The following line styles are supported: '-' (solid\n line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes\n and dots), and 'none' (no line). To specify the line style for each\n dataset, provide an array of line styles. During plot creation, each\n plotted dataset is assigned a line style. If the number of line styles\n is less than the number of plotted datasets, line styles are reused\n using modulo arithmetic.\n\n plot.lineOpacity\n Data line opacity, where an opacity of `0.0` make a line completely\n transparent and an opacity of `1.0` makes a line completely opaque. To\n specify the line opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.lineWidth\n Data line width(s). To specify the line width for each dataset, provide\n an array of widths. During plot creation, each plotted dataset is\n assigned a line width. If the number of line widths is less than the\n number of plotted datasets, line widths are reused using modulo\n arithmetic.\n\n plot.symbols\n Data symbols. The following symbols are supported: 'closed-circle'\n (closed circles), 'open-circle' (open circles), and 'none' (no symbols).\n To specify the symbols used for each dataset, provide an array of\n symbols. During plot creation, each plotted dataset is assigned a\n symbol. If the number of symbols is less than the number of plotted\n datasets, symbols are reused using modulo arithmetic.\n\n plot.symbolSize\n Symbols size. To specify the symbols size for each dataset, provide an\n array of sizes. During plot creation, each plotted dataset is assigned\n a symbols size. If the number of sizes is less than the number of\n plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.symbolsOpacity\n Symbols opacity, where an opacity of `0.0` makes a symbol completely\n transparent and an opacity of `1.0` makes a symbol completely opaque. To\n specify the opacity for each dataset, provide an array of opacities.\n During plot creation, each plotted dataset is assigned an opacity. If\n the number of opacities is less than the number of plotted datasets,\n opacities are reused using modulo arithmetic.\n\n plot.width\n Plot width (in pixels).\n\n plot.height\n Plot height (in pixels).\n\n plot.paddingLeft\n Plot left padding (in pixels). Left padding is typically used to create\n space for a left-oriented y-axis.\n\n plot.paddingRight\n Plot right padding (in pixels). Right padding is typically used to\n create space for a right-oriented y-axis.\n\n plot.paddingTop\n Plot top padding (in pixels). Top padding is typically used to create\n space for a title or top-oriented x-axis.\n\n plot.paddingBottom\n Plot bottom padding (in pixels). Bottom padding is typically used to\n create space for a bottom-oriented x-axis.\n\n plot.xMin\n Minimum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.xMax\n Maximum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.yMin\n Minimum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.yMax\n Maximum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.xScale\n Scale function for mapping values to a coordinate along the x-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.yScale\n Scale function for mapping values to a coordinate along the y-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.xTickFormat\n x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.yTickFormat\n y-axis tick format (e.g., '%%'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.xNumTicks\n Number of x-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.yNumTicks\n Number of y-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.xAxisOrient\n x-axis orientation. The following orientations are supported: 'bottom'\n and 'top'.\n\n plot.yAxisOrient\n y-axis orientation. The following orientations are supported: 'left' and\n 'right'.\n\n plot.xRug\n Boolean flag(s) indicating whether to display a rug plot along the x-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.yRug\n Boolean flag(s) indicating whether to display a rug plot along the y-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.xRugOrient\n x-axis rug orientation. The following orientations are supported:\n 'bottom' or 'top'. To specify the x-axis rug orientation for each\n dataset, provide an array of orientations. During plot creation, each\n plotted dataset is assigned an orientation. If the number of\n orientations is less than the number of plotted datasets, orientations\n are reused using modulo arithmetic.\n\n plot.yRugOrient\n y-axis rug orientation. The following orientations are supported: 'left'\n or 'right'. To specify the y-axis rug orientation for each dataset,\n provide an array of orientations. During plot creation, each plotted\n dataset is assigned an orientation. If the number of orientations is\n less than the number of plotted datasets, orientations are reused using\n modulo arithmetic.\n\n plot.xRugOpacity\n x-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the x-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.yRugOpacity\n y-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the y-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.xRugSize\n x-axis rug tick (tassel) size. To specify the x-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.yRugSize\n y-axis rug tick (tassel) size. To specify the y-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.description\n Plot description.\n\n plot.title\n Plot title.\n\n plot.xLabel\n x-axis label.\n\n plot.yLabel\n y-axis label.\n\n plot.engine\n Plot rendering engine. The following engines are supported: 'svg'.\n\n plot.renderFormat\n Plot render format. The following formats are supported: 'vdom' and\n 'html'.\n\n plot.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n plot.viewer\n Plot viewer. The following viewers are supported: 'none', 'stdout',\n 'window', and 'browser'.\n\n plot.autoView\n Viewer mode. If `true`, an instance generates an updated view on each\n 'render' event; otherwise, generating a view must be triggered manually.\n\n plot.graphWidth\n Computed property corresponding to the expected graph width.\n\n plot.graphHeight\n Computed property corresponding to the expected graph height.\n\n plot.xDomain\n Computed property corresponding to the x-axis domain.\n\n plot.yDomain\n Computed property corresponding to the y-axis domain.\n\n plot.xRange\n Computed property corresponding to the x-axis range.\n\n plot.yRange\n Computed property correspond to the y-axis range.\n\n plot.xPos\n A function which maps values to x-axis coordinate values.\n\n plot.yPos\n A function which maps values to y-axis coordinate values.\n\n Examples\n --------\n > var plot = plot()\n <Plot>\n\n // Provide plot data at instantiation:\n > var x = [[0.10, 0.20, 0.30]];\n > var y = [[0.52, 0.79, 0.64]];\n > plot = plot( x, y )\n <Plot>\n\n See Also\n --------\n Plot\n",
"Plot": "\nPlot( [x, y,] [options] )\n Returns a plot instance for creating 2-dimensional plots.\n\n `x` and `y` arguments take precedence over `x` and `y` options.\n\n Parameters\n ----------\n x: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing x-coordinate values.\n\n y: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing y-coordinate values.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.autoView: boolean (optional)\n Boolean indicating whether to generate an updated view on a 'render'\n event. Default: false.\n\n options.colors: string|Array<string> (optional)\n Data color(s). Default: 'category10'.\n\n options.description: string (optional)\n Plot description.\n\n options.engine: string (optional)\n Plot engine. Default: 'svg'.\n\n options.height: number (optional)\n Plot height (in pixels). Default: 400.\n\n options.labels: Array|Array<string> (optional)\n Data labels.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.lineStyle: string|Array<string> (optional)\n Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'.\n Default: '-'.\n\n options.lineOpacity: number|Array<number> (optional)\n Data line opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.lineWidth: integer|Array<integer> (optional)\n Data line width (in pixels). Default: 2.\n\n options.paddingBottom: integer (optional)\n Bottom padding (in pixels). Default: 80.\n\n options.paddingLeft: integer (optional)\n Left padding (in pixels). Default: 90.\n\n options.paddingRight: integer (optional)\n Right padding (in pixels). Default: 20.\n\n options.paddingTop: integer (optional)\n Top padding (in pixels). Default: 80.\n\n options.renderFormat: string (optional)\n Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'.\n\n options.symbols: string|Array<string> (optional)\n Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'.\n Default: 'none'.\n\n options.symbolsOpacity: number|Array<number> (optional)\n Symbols opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.symbolsSize: integer|Array<integer> (optional)\n Symbols size (in pixels). Default: 6.\n\n options.title: string (optional)\n Plot title.\n\n options.viewer: string (optional)\n Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window',\n or 'none'. Default: 'none'.\n\n options.width: number (optional)\n Plot width (in pixels). Default: 400.\n\n options.x: Array<Array>|Array<TypedArray> (optional)\n x-coordinate values.\n\n options.xAxisOrient: string (optional)\n x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'.\n\n options.xLabel: string (optional)\n x-axis label. Default: 'x'.\n\n options.xMax: number|null (optional)\n Maximum value of the x-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.xMin: number|null (optional)\n Minimum value of the x-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.xNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.xRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the x-axis.\n\n options.xRugOrient: string|Array<string> (optional)\n x-axis rug plot orientation(s). Must be either 'bottom' or 'top'.\n Default: 'bottom'.\n\n options.xRugOpacity: number|Array<number> (optional)\n x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.xRugSize: integer|Array<integer> (optional)\n x-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.xScale: string\n x-axis scale. Default: 'linear'.\n\n options.xTickFormat: string|null\n x-axis tick format. Default: null.\n\n options.y: Array<Array>|Array<TypedArray> (optional)\n y-coordinate values.\n\n options.yAxisOrient: string (optional)\n x-axis orientation. Must be either 'left' or 'right'. Default: 'left'.\n\n options.yLabel: string (optional)\n y-axis label. Default: 'y'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.yNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.yRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the y-axis.\n\n options.yRugOrient: string|Array<string> (optional)\n y-axis rug plot orientation(s). Must be either 'left' or 'right'.\n Default: 'left'.\n\n options.yRugOpacity: number|Array<number> (optional)\n y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.yRugSize: integer|Array<integer> (optional)\n y-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.yScale: string\n y-axis scale. Default: 'linear'.\n\n options.yTickFormat: string|null\n y-axis tick format. Default: null.\n\n Returns\n -------\n plot: Plot\n Plot instance.\n\n plot.render()\n Renders a plot as a virtual DOM tree.\n\n plot.view( [viewer] )\n Generates a plot view.\n\n plot.x\n x-coordinate values. An assigned value must be an array where each\n element corresponds to a plotted dataset.\n\n plot.y\n y-coordinate values. An assigned value must be an array, where each\n element corresponds to a plotted dataset.\n\n plot.labels\n Data labels. During plot creation, each plotted dataset is assigned a\n label. If the number of labels is less than the number of plotted\n datasets, labels are reused using modulo arithmetic.\n\n plot.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n plot.colors\n Data colors. To set the color all plotted datasets, provide a color\n name. To specify the colors for each dataset, provide an array of\n colors. During plot creation, each plotted dataset is assigned one of\n the provided colors. If the number of colors is less than the number of\n plotted datasets, colors are reused using modulo arithmetic. Lastly,\n colors may also be specified by providing the name of a predefined color\n scheme. The following schemes are supported: 'category10', 'category20',\n 'category20b', and 'category20c'.\n\n plot.lineStyle\n Data line style(s). The following line styles are supported: '-' (solid\n line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes\n and dots), and 'none' (no line). To specify the line style for each\n dataset, provide an array of line styles. During plot creation, each\n plotted dataset is assigned a line style. If the number of line styles\n is less than the number of plotted datasets, line styles are reused\n using modulo arithmetic.\n\n plot.lineOpacity\n Data line opacity, where an opacity of `0.0` make a line completely\n transparent and an opacity of `1.0` makes a line completely opaque. To\n specify the line opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.lineWidth\n Data line width(s). To specify the line width for each dataset, provide\n an array of widths. During plot creation, each plotted dataset is\n assigned a line width. If the number of line widths is less than the\n number of plotted datasets, line widths are reused using modulo\n arithmetic.\n\n plot.symbols\n Data symbols. The following symbols are supported: 'closed-circle'\n (closed circles), 'open-circle' (open circles), and 'none' (no symbols).\n To specify the symbols used for each dataset, provide an array of\n symbols. During plot creation, each plotted dataset is assigned a\n symbol. If the number of symbols is less than the number of plotted\n datasets, symbols are reused using modulo arithmetic.\n\n plot.symbolSize\n Symbols size. To specify the symbols size for each dataset, provide an\n array of sizes. During plot creation, each plotted dataset is assigned\n a symbols size. If the number of sizes is less than the number of\n plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.symbolsOpacity\n Symbols opacity, where an opacity of `0.0` makes a symbol completely\n transparent and an opacity of `1.0` makes a symbol completely opaque. To\n specify the opacity for each dataset, provide an array of opacities.\n During plot creation, each plotted dataset is assigned an opacity. If\n the number of opacities is less than the number of plotted datasets,\n opacities are reused using modulo arithmetic.\n\n plot.width\n Plot width (in pixels).\n\n plot.height\n Plot height (in pixels).\n\n plot.paddingLeft\n Plot left padding (in pixels). Left padding is typically used to create\n space for a left-oriented y-axis.\n\n plot.paddingRight\n Plot right padding (in pixels). Right padding is typically used to\n create space for a right-oriented y-axis.\n\n plot.paddingTop\n Plot top padding (in pixels). Top padding is typically used to create\n space for a title or top-oriented x-axis.\n\n plot.paddingBottom\n Plot bottom padding (in pixels). Bottom padding is typically used to\n create space for a bottom-oriented x-axis.\n\n plot.xMin\n Minimum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.xMax\n Maximum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.yMin\n Minimum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.yMax\n Maximum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.xScale\n Scale function for mapping values to a coordinate along the x-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.yScale\n Scale function for mapping values to a coordinate along the y-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.xTickFormat\n x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.yTickFormat\n y-axis tick format (e.g., '%%'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.xNumTicks\n Number of x-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.yNumTicks\n Number of y-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.xAxisOrient\n x-axis orientation. The following orientations are supported: 'bottom'\n and 'top'.\n\n plot.yAxisOrient\n y-axis orientation. The following orientations are supported: 'left' and\n 'right'.\n\n plot.xRug\n Boolean flag(s) indicating whether to display a rug plot along the x-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.yRug\n Boolean flag(s) indicating whether to display a rug plot along the y-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.xRugOrient\n x-axis rug orientation. The following orientations are supported:\n 'bottom' or 'top'. To specify the x-axis rug orientation for each\n dataset, provide an array of orientations. During plot creation, each\n plotted dataset is assigned an orientation. If the number of\n orientations is less than the number of plotted datasets, orientations\n are reused using modulo arithmetic.\n\n plot.yRugOrient\n y-axis rug orientation. The following orientations are supported: 'left'\n or 'right'. To specify the y-axis rug orientation for each dataset,\n provide an array of orientations. During plot creation, each plotted\n dataset is assigned an orientation. If the number of orientations is\n less than the number of plotted datasets, orientations are reused using\n modulo arithmetic.\n\n plot.xRugOpacity\n x-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the x-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.yRugOpacity\n y-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the y-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.xRugSize\n x-axis rug tick (tassel) size. To specify the x-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.yRugSize\n y-axis rug tick (tassel) size. To specify the y-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.description\n Plot description.\n\n plot.title\n Plot title.\n\n plot.xLabel\n x-axis label.\n\n plot.yLabel\n y-axis label.\n\n plot.engine\n Plot rendering engine. The following engines are supported: 'svg'.\n\n plot.renderFormat\n Plot render format. The following formats are supported: 'vdom' and\n 'html'.\n\n plot.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n plot.viewer\n Plot viewer. The following viewers are supported: 'none', 'stdout',\n 'window', and 'browser'.\n\n plot.autoView\n Viewer mode. If `true`, an instance generates an updated view on each\n 'render' event; otherwise, generating a view must be triggered manually.\n\n plot.graphWidth\n Computed property corresponding to the expected graph width.\n\n plot.graphHeight\n Computed property corresponding to the expected graph height.\n\n plot.xDomain\n Computed property corresponding to the x-axis domain.\n\n plot.yDomain\n Computed property corresponding to the y-axis domain.\n\n plot.xRange\n Computed property corresponding to the x-axis range.\n\n plot.yRange\n Computed property correspond to the y-axis range.\n\n plot.xPos\n A function which maps values to x-axis coordinate values.\n\n plot.yPos\n A function which maps values to y-axis coordinate values.\n\n Examples\n --------\n > var plot = Plot()\n <Plot>\n\n // Provide plot data at instantiation:\n > var x = [[0.10, 0.20, 0.30]];\n > var y = [[0.52, 0.79, 0.64]];\n > plot = Plot( x, y )\n <Plot>\n\n See Also\n --------\n plot\n",
"pluck": "\npluck( arr, prop[, options] )\n Extracts a property value from each element of an object array.\n\n The function skips `null` and `undefined` array elements.\n\n Extracted values are not cloned.\n\n Parameters\n ----------\n arr: Array\n Source array.\n\n prop: string\n Property to access.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to return a new data structure. To mutate the\n input data structure (e.g., when input values can be discarded or when\n optimizing memory usage), set the `copy` option to `false`. Default:\n true.\n\n Returns\n -------\n out: Array\n Destination array.\n\n Examples\n --------\n > var arr = [\n ... { 'a': 1, 'b': 2 },\n ... { 'a': 0.5, 'b': 3 }\n ... ];\n > var out = pluck( arr, 'a' )\n [ 1, 0.5 ]\n\n > arr = [\n ... { 'a': 1, 'b': 2 },\n ... { 'a': 0.5, 'b': 3 }\n ... ];\n > out = pluck( arr, 'a', { 'copy': false } )\n [ 1, 0.5 ]\n > var bool = ( arr[ 0 ] === out[ 0 ] )\n true\n\n See Also\n --------\n deepPluck, pick\n",
"pop": "\npop( collection )\n Removes and returns the last element of a collection.\n\n The function returns an array with two elements: the shortened collection\n and the removed element.\n\n If the input collection is a typed array whose length is greater than `0`,\n the first return value does not equal the input reference.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the value should be\n array-like.\n\n Returns\n -------\n out: Array\n Updated collection and the removed item.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var out = pop( arr )\n [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > out = pop( arr )\n [ <Float64Array>[ 1.0 ], 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 2, '0': 1.0, '1': 2.0 };\n > out = pop( arr )\n [ { 'length': 1, '0': 1.0 }, 2.0 ]\n\n See Also\n --------\n push, shift, unshift\n",
"prepend": "\nprepend( collection1, collection2 )\n Adds the elements of one collection to the beginning of another collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection1: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n collection2: Array|TypedArray|Object\n A collection containing the elements to add. If the collection is an\n `Object`, the collection should be array-like.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = prepend( arr, [ 6.0, 7.0 ] )\n [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = prepend( arr, [ 3.0, 4.0 ] )\n <Float64Array>[ 3.0, 4.0, 1.0, 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 1, '0': 1.0 };\n > arr = prepend( arr, [ 2.0, 3.0 ] )\n { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }\n\n See Also\n --------\n append, unshift\n",
"properties": "\nproperties( value )\n Returns an array of an object's own enumerable and non-enumerable property\n names and symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own enumerable and non-enumerable properties.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var props = properties( obj )\n [ 'beep' ]\n\n See Also\n --------\n defineProperties, inheritedProperties, propertiesIn, propertyNames, propertySymbols\n",
"propertiesIn": "\npropertiesIn( value )\n Returns an array of an object's own and inherited property names and\n symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited property names and symbols.\n\n Examples\n --------\n > var props = propertiesIn( [] )\n\n See Also\n --------\n defineProperties, inheritedProperties, properties, propertyNamesIn, propertySymbolsIn\n",
"propertyDescriptor": "\npropertyDescriptor( value, property )\n Returns a property descriptor for an object's own property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptor( obj, 'a' )\n {...}\n\n See Also\n --------\n hasOwnProp, defineProperty, propertyDescriptorIn, propertyDescriptors\n",
"propertyDescriptorIn": "\npropertyDescriptorIn( value, property )\n Returns a property descriptor for an object's own or inherited property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptorIn( obj, 'a' )\n {...}\n\n See Also\n --------\n hasProp, defineProperty, propertyDescriptor, propertyDescriptorsIn\n",
"propertyDescriptors": "\npropertyDescriptors( value )\n Returns an object's own property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n desc: Object\n Property descriptors.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptors( obj )\n { 'a': {...} }\n\n See Also\n --------\n defineProperty, defineProperties, propertyDescriptor, propertyDescriptorsIn, propertyNames, propertySymbols\n",
"propertyDescriptorsIn": "\npropertyDescriptorsIn( value )\n Returns an object's own and inherited property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n desc: Object\n An object's own and inherited property descriptors.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var desc = propertyDescriptorsIn( obj )\n { 'beep': {...}, 'foo': {...}, ... }\n\n See Also\n --------\n defineProperties, propertyDescriptorIn, propertyDescriptors, propertyNamesIn, propertySymbolsIn\n",
"propertyNames": "\npropertyNames( value )\n Returns an array of an object's own enumerable and non-enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own enumerable and non-enumerable property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = propertyNames( obj )\n [ 'beep' ]\n\n See Also\n --------\n objectKeys, nonEnumerablePropertyNames, propertyNamesIn, propertySymbols\n",
"propertyNamesIn": "\npropertyNamesIn( value )\n Returns an array of an object's own and inherited enumerable and non-\n enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own and inherited enumerable and non-enumerable\n property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = propertyNamesIn( obj )\n e.g., [ 'beep', 'foo', ... ]\n\n See Also\n --------\n objectKeys, nonEnumerablePropertyNamesIn, propertyNames, propertySymbolsIn\n",
"propertySymbols": "\npropertySymbols( value )\n Returns an array of an object's own symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own symbol properties.\n\n Examples\n --------\n > var s = propertySymbols( {} )\n\n See Also\n --------\n propertyNames, propertySymbolsIn\n",
"propertySymbolsIn": "\npropertySymbolsIn( value )\n Returns an array of an object's own and inherited symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited symbol properties.\n\n Examples\n --------\n > var s = propertySymbolsIn( [] )\n\n See Also\n --------\n propertyNamesIn, propertySymbols\n",
"Proxy": "\nProxy( target, handlers )\n Returns a proxy object implementing custom behavior for specified object\n operations.\n\n The following \"traps\" are supported:\n\n - getPrototypeOf( target )\n Trap for `Object.getPrototypeOf()`. Can be used to intercept the\n `instanceof` operator. The method must return an object or `null`.\n\n - setPrototypeOf( target, prototype )\n Trap for `Object.setPrototypeOf()`. The method must return a boolean\n indicating if prototype successfully set.\n\n - isExtensible( target )\n Trap for `Object.isExtensible()`. The method must return a boolean.\n\n - preventExtensions( target )\n Trap for `Object.preventExtensions()`. The method must return a boolean.\n\n - getOwnPropertyDescriptor( target, property )\n Trap for `Object.getOwnPropertyDescriptor()`. The method must return an\n object or `undefined`.\n\n - defineProperty( target, property, descriptor )\n Trap for `Object.defineProperty()`. The method must return a boolean\n indicating whether the operation succeeded.\n\n - has( target, property )\n Trap for the `in` operator. The method must return a boolean.\n\n - get( target, property, receiver )\n Trap for retrieving property values. The method can return any value.\n\n - set( target, property, value, receiver )\n Trap for setting property values. The method should return a boolean\n indicating whether assignment succeeded.\n\n - deleteProperty( target, property )\n Trap for the `delete` operator. The method must return a boolean\n indicating whether operation succeeded.\n\n - ownKeys( target )\n Trap for `Object.keys`, `Object.getOwnPropertyNames()`, and\n `Object.getOwnPropertySymbols()`. The method must return an enumerable\n object.\n\n - apply( target, thisArg, argumentsList )\n Trap for a function call. The method can return any value.\n\n - construct( target, argumentsList, newTarget )\n Trap for the `new` operator. The method must return an object.\n\n All traps are optional. If a trap is not defined, the default behavior is to\n forward the operation to the target.\n\n Parameters\n ----------\n target: Object\n Object which the proxy virtualizes.\n\n handlers: Object\n Object whose properties are functions which define the behavior of the\n proxy when performing operations.\n\n Returns\n -------\n p: Object\n Proxy object.\n\n Examples\n --------\n > function get( obj, prop ) { return obj[ prop ] * 2.0 };\n > var h = { 'get': get };\n > var p = new Proxy( {}, h );\n > p.a = 3.14;\n > p.a\n 6.28\n\n\nProxy.revocable( target, handlers )\n Returns a revocable proxy object\n\n Parameters\n ----------\n target: Object\n Object which the proxy virtualizes.\n\n handlers: Object\n Object whose properties are functions which define the behavior of the\n proxy when performing operations.\n\n Returns\n -------\n p: Object\n Revocable proxy object.\n\n p.proxy: Object\n Proxy object.\n\n p.revoke: Function\n Invalidates a proxy, rendering a proxy object unusable.\n\n Examples\n --------\n > function get( obj, prop ) { return obj[ prop ] * 2.0 };\n > var h = { 'get': get };\n > var p = Proxy.revocable( {}, h );\n > p.proxy.a = 3.14;\n > p.proxy.a\n 6.28\n > p.revoke();\n\n",
"push": "\npush( collection, ...items )\n Adds one or more elements to the end of a collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n items: ...any\n Items to add.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = push( arr, 6.0, 7.0 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = push( arr, 3.0, 4.0 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n // Array-like object:\n > arr = { 'length': 0 };\n > arr = push( arr, 1.0, 2.0 )\n { 'length': 2, '0': 1.0, '1': 2.0 }\n\n See Also\n --------\n pop, shift, unshift\n",
"quarterOfYear": "\nquarterOfYear( [month] )\n Returns the quarter of the year.\n\n By default, the function returns the quarter of the year for the current\n month in the current year (according to local time). To determine the\n quarter for a particular month, provide either a month or a `Date`\n object.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n Parameters\n ----------\n month: integer|string|Date (optional)\n Month (or `Date`).\n\n Returns\n -------\n out: integer\n Quarter of the year.\n\n Examples\n --------\n > var q = quarterOfYear( new Date() )\n <number>\n > q = quarterOfYear( 4 )\n 2\n > q = quarterOfYear( 'June' )\n 2\n\n // Other ways to supply month:\n > q = quarterOfYear( 'April' )\n 2\n > q = quarterOfYear( 'apr' )\n 2\n\n See Also\n --------\n dayOfYear\n",
"random.iterators.arcsine": "\nrandom.iterators.arcsine( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n arcsine distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.arcsine( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.arcsine\n",
"random.iterators.bernoulli": "\nrandom.iterators.bernoulli( p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Bernoulli distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.bernoulli( 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.bernoulli\n",
"random.iterators.beta": "\nrandom.iterators.beta( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n beta distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.beta( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.beta\n",
"random.iterators.betaprime": "\nrandom.iterators.betaprime( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n beta prime distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.betaprime( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.betaprime\n",
"random.iterators.binomial": "\nrandom.iterators.binomial( n, p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n binomial distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.binomial( 10, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.binomial\n",
"random.iterators.boxMuller": "\nrandom.iterators.boxMuller( [options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n standard normal distribution using the Box-Muller transform.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.boxMuller();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.boxMuller\n",
"random.iterators.cauchy": "\nrandom.iterators.cauchy( x0, Ɣ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Cauchy distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.cauchy( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.cauchy\n",
"random.iterators.chi": "\nrandom.iterators.chi( k[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a chi\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.chi( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.chi\n",
"random.iterators.chisquare": "\nrandom.iterators.chisquare( k[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n chi-square distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.chisquare( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.chisquare\n",
"random.iterators.cosine": "\nrandom.iterators.cosine( μ, s[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a raised\n cosine distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.cosine( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.cosine\n",
"random.iterators.discreteUniform": "\nrandom.iterators.discreteUniform( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n discrete uniform distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom integers. If provided, the `state` and `seed`\n options are ignored. In order to seed the returned iterator, one must\n seed the provided `prng` (assuming the provided `prng` is seedable). The\n provided PRNG must have `MIN` and `MAX` properties specifying the\n minimum and maximum possible pseudorandom integers.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.discreteUniform( 0, 3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.discreteUniform\n",
"random.iterators.erlang": "\nrandom.iterators.erlang( k, λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an Erlang\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n If `k` is not a positive integer or `λ <= 0`, the function throws an error.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.erlang( 1, 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.erlang\n",
"random.iterators.exponential": "\nrandom.iterators.exponential( λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n exponential distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.exponential( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.exponential\n",
"random.iterators.f": "\nrandom.iterators.f( d1, d2[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an F\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `d1 <= 0` or `d2 <= 0`.\n\n Parameters\n ----------\n d1: number\n Degrees of freedom.\n\n d2: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.f( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.f\n",
"random.iterators.frechet": "\nrandom.iterators.frechet( α, s, m[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Fréchet\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `s <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.frechet( 1.0, 1.0, 0.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.frechet\n",
"random.iterators.gamma": "\nrandom.iterators.gamma( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a gamma\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.gamma( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.gamma\n",
"random.iterators.geometric": "\nrandom.iterators.geometric( p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n geometric distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.geometric( 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.geometric\n",
"random.iterators.gumbel": "\nrandom.iterators.gumbel( μ, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Gumbel\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.gumbel( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.gumbel\n",
"random.iterators.hypergeometric": "\nrandom.iterators.hypergeometric( N, K, n[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n hypergeometric distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n `N`, `K`, and `n` must all be nonnegative integers; otherwise, the function\n throws an error.\n\n If `n > N` or `K > N`, the function throws an error.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.hypergeometric( 20, 10, 7 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.hypergeometric\n",
"random.iterators.improvedZiggurat": "\nrandom.iterators.improvedZiggurat( [options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n standard normal distribution using the Improved Ziggurat algorithm.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.improvedZiggurat();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.improvedZiggurat\n",
"random.iterators.invgamma": "\nrandom.iterators.invgamma( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n inverse gamma distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.invgamma( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.invgamma\n",
"random.iterators.kumaraswamy": "\nrandom.iterators.kumaraswamy( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from\n Kumaraswamy's double bounded distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `a <= 0` or `b <= 0`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.kumaraswamy( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.kumaraswamy\n",
"random.iterators.laplace": "\nrandom.iterators.laplace( μ, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Laplace\n (double exponential) distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n b: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.laplace( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.laplace\n",
"random.iterators.levy": "\nrandom.iterators.levy( μ, c[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Lévy\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n c: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.levy( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.levy\n",
"random.iterators.logistic": "\nrandom.iterators.logistic( μ, s[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n logistic distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n s: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.logistic( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.logistic\n",
"random.iterators.lognormal": "\nrandom.iterators.lognormal( μ, σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n lognormal distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.lognormal( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.lognormal\n",
"random.iterators.minstd": "\nrandom.iterators.minstd( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 2147483646]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) based on Park and Miller.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. More\n importantly, the \"randomness quality\" of the generator's output is lacking.\n These defects make the generator unsuitable, for example, in Monte Carlo\n simulations and in cryptographic applications.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer or, for arbitrary length seeds, an array-like\n object containing positive signed 32-bit integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Int32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Int32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.minstd();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.minstd, random.iterators.minstdShuffle, random.iterators.mt19937, random.iterators.randi, random.iterators.randu\n",
"random.iterators.minstdShuffle": "\nrandom.iterators.minstdShuffle( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 2147483646]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) whose output is shuffled using the Bays-\n Durham algorithm. The shuffle step considerably strengthens the \"randomness\n quality\" of a simple LCG's output.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. In\n general, this generator is unsuitable for Monte Carlo simulations and\n cryptographic applications.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer or, for arbitrary length seeds, an array-like\n object containing positive signed 32-bit integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Int32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Int32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.minstdShuffle();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.minstdShuffle, random.iterators.minstd, random.iterators.mt19937, random.iterators.randi, random.iterators.randu\n",
"random.iterators.mt19937": "\nrandom.iterators.mt19937( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 4294967295]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a 32-bit Mersenne Twister\n pseudorandom number generator.\n\n The PRNG is *not* a cryptographically secure PRNG.\n\n The PRNG has a period of 2^19937 - 1.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Uint32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Uint32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.mt19937();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.mt19937, random.iterators.minstd, random.iterators.minstdShuffle, random.iterators.randi, random.iterators.randu\n",
"random.iterators.negativeBinomial": "\nrandom.iterators.negativeBinomial( r, p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n negative binomial distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.negativeBinomial( 10, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.negativeBinomial\n",
"random.iterators.normal": "\nrandom.iterators.normal( μ, σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a normal\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n σ: number\n Standard deviation.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.normal( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.normal\n",
"random.iterators.pareto1": "\nrandom.iterators.pareto1( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Pareto\n (Type I) distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.pareto1( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.pareto1\n",
"random.iterators.poisson": "\nrandom.iterators.poisson( λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Poisson\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n λ: number\n Mean.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.poisson( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.poisson\n",
"random.iterators.randi": "\nrandom.iterators.randi( [options] )\n Create an iterator for generating pseudorandom numbers having integer\n values.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: `'mt19937'`.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: any\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randi();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randi\n",
"random.iterators.randn": "\nrandom.iterators.randn( [options] )\n Create an iterator for generating pseudorandom numbers drawn from a standard\n normal distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - improved-ziggurat: improved ziggurat method.\n - box-muller: Box-Muller transform.\n\n Default: `'improved-ziggurat'`.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randn();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randn\n",
"random.iterators.randu": "\nrandom.iterators.randu( [options] )\n Create an iterator for generating uniformly distributed pseudorandom numbers\n between 0 and 1.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: `'mt19937'`.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: any\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randu();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randu\n",
"random.iterators.rayleigh": "\nrandom.iterators.rayleigh( σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Rayleigh distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.rayleigh( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.rayleigh\n",
"random.iterators.t": "\nrandom.iterators.t( v[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Student's t distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.t( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.t\n",
"random.iterators.triangular": "\nrandom.iterators.triangular( a, b, c[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n triangular distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.triangular( 0.0, 1.0, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.triangular\n",
"random.iterators.uniform": "\nrandom.iterators.uniform( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n continuous uniform distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.uniform( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.uniform\n",
"random.iterators.weibull": "\nrandom.iterators.weibull( k, λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Weibull distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `k <= 0` or `λ <= 0`.\n\n Parameters\n ----------\n k: number\n Scale parameter.\n\n λ: number\n Shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.weibull( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.weibull\n",
"random.streams.arcsine": "\nrandom.streams.arcsine( a, b[, options] )\n Returns a readable stream for generating pseudorandom numbers drawn from an\n arcsine distribution.\n\n In addition to standard readable stream events, the returned stream emits a\n 'state' event after internally generating `siter` pseudorandom numbers,\n which is useful when wanting to deterministically capture a stream's\n underlying PRNG state.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.sep: string (optional)\n Separator used to join streamed data. This option is only applicable\n when a stream is not in \"objectMode\". Default: '\\n'.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n stream: ReadableStream\n Readable stream.\n\n stream.PRNG: Function\n Underlying pseudorandom number generator.\n\n stream.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n stream.seedLength: integer|null\n Length of generator seed.\n\n stream.state: Uint32Array|null\n Generator state.\n\n stream.stateLength: integer|null\n Length of generator state.\n\n stream.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > function fcn( chunk ) { console.log( chunk.toString() ); };\n > var opts = { 'iter': 10 };\n > var s = random.streams.arcsine( 2.0, 5.0, opts );\n > var o = inspectStream( fcn );\n > s.pipe( o );\n\n\nrandom.streams.arcsine.factory( [a, b, ][options] )\n Returns a function for creating readable streams which generate pseudorandom\n numbers drawn from an arcsine distribution.\n\n If provided distribution parameters, the returned function returns readable\n streams which generate pseudorandom numbers drawn from the specified\n distribution.\n\n If not provided distribution parameters, the returned function requires that\n distribution parameters be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.sep: string (optional)\n Separator used to join streamed data. This option is only applicable\n when a stream is not in \"objectMode\". Default: '\\n'.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n fcn: Function\n Function for creating readable streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = random.streams.arcsine.factory( opts );\n\n\nrandom.streams.arcsine.objectMode( a, b[, options] )\n Returns an \"objectMode\" readable stream for generating pseudorandom numbers\n drawn from an arcsine distribution.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n stream: ReadableStream\n Readable stream operating in \"objectMode\".\n\n stream.PRNG: Function\n Underlying pseudorandom number generator.\n\n stream.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n stream.seedLength: integer|null\n Length of generator seed.\n\n stream.state: Uint32Array|null\n Generator state.\n\n stream.stateLength: integer|null\n Length of generator state.\n\n stream.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > function fcn( v ) { console.log( v ); };\n > var opts = { 'iter': 10 };\n > var s = random.streams.arcsine.objectMode( 2.0, 5.0, opts );\n > var o = inspectStream.objectMode( fcn );\n > s.pipe( o );\n\n See Also\n --------\n random.iterators.arcsine\n",
"ranks": "\nranks( arr[, options] )\n Computes the sample ranks for the values of an array-like object.\n\n When all elements of the `array` are different, the ranks are uniquely\n determined. When there are equal elements (called *ties*), the `method`\n option determines how they are handled. The default, `'average'`, replaces\n the ranks of the ties by their mean. Other possible options are `'min'` and\n `'max'`, which replace the ranks of the ties by their minimum and maximum,\n respectively. `'dense'` works like `'min'`, with the difference that the\n next highest element after a tie is assigned the next smallest integer.\n Finally, `ordinal` gives each element in `arr` a distinct rank, according to\n the position they appear in.\n\n The `missing` option is used to specify how to handle missing data.\n By default, `NaN` or `null` are treated as missing values. `'last'`specifies\n that missing values are placed last, `'first'` that the are assigned the\n lowest ranks and `'remove'` means that they are removed from the array\n before the ranks are calculated.\n\n Parameters\n ----------\n arr: Array<number>\n Input values.\n\n options: Object (optional)\n Function options.\n\n options.method (optional)\n Method name determining how ties are treated (`average`, `min`, `max`,\n `dense`, or `ordinal`). Default: `'average'`.\n\n options.missing (optional)\n Determines where missing values go (`first`, `last`, or `remove`).\n Default: `'last'`.\n\n options.encoding (optional)\n Array of values encoding missing values. Default: `[ null, NaN ]`.\n\n Returns\n -------\n out: Array\n Array containing the computed ranks for the elements of the input array.\n\n Examples\n --------\n > var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ] ;\n > var out = ranks( arr )\n [ 2, 3, 5, 1, 4 ]\n\n // Ties are averaged:\n > arr = [ 2, 2, 1, 4, 3 ];\n > out = ranks( arr )\n [ 2.5, 2.5, 1, 5, 4 ]\n\n // Missing values are placed last:\n > arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];\n > out = ranks( arr )\n [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]\n\n",
"RE_BASENAME": "\nRE_BASENAME\n Regular expression to capture the last part of a path.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_BASENAME.posix\n Regular expression to capture the last part of a POSIX path.\n\n Examples\n --------\n > var base = RE_BASENAME.exec( '/foo/bar/index.js' )[ 1 ]\n 'index.js'\n\n\nRE_BASENAME.win32\n Regular expression to capture the last part of a Windows path.\n\n Examples\n --------\n > var base = RE_BASENAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'index.js'\n\n See Also\n --------\n RE_BASENAME_POSIX, RE_BASENAME_WINDOWS\n",
"RE_BASENAME_POSIX": "\nRE_BASENAME_POSIX\n Regular expression to capture the last part of a POSIX path.\n\n Examples\n --------\n > var base = RE_BASENAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n '.gitignore'\n > base = RE_BASENAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n 'file.pdf'\n > base = RE_BASENAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n 'file'\n > base = RE_BASENAME_POSIX.exec( 'index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_POSIX.exec( '.' )[ 1 ]\n '.'\n > base = RE_BASENAME_POSIX.exec( './' )[ 1 ]\n '.'\n > base = RE_BASENAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_BASENAME, RE_BASENAME_WINDOWS\n",
"RE_BASENAME_WINDOWS": "\nRE_BASENAME_WINDOWS\n Regular expression to capture the last part of a Windows path.\n\n Examples\n --------\n > var base = RE_BASENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n '.gitignore'\n > base = RE_BASENAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n 'file.pdf'\n > base = RE_BASENAME_WINDOWS.exec( 'foo\\\\bar\\\\file' )[ 1 ]\n 'file'\n > base = RE_BASENAME_WINDOWS.exec( 'index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_WINDOWS.exec( '.' )[ 1 ]\n '.'\n > base = RE_BASENAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_BASENAME, RE_BASENAME_POSIX\n",
"RE_COLOR_HEXADECIMAL": "\nRE_COLOR_HEXADECIMAL\n Regular expression to match a hexadecimal color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.test( 'ffffff' )\n true\n > bool = RE_COLOR_HEXADECIMAL.test( '000' )\n false\n > bool = RE_COLOR_HEXADECIMAL.test( 'beep' )\n false\n\n\nRE_COLOR_HEXADECIMAL.shorthand\n Regular expression to match a shorthand hexadecimal color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.shorthand.test( 'ffffff' )\n false\n > bool = RE_COLOR_HEXADECIMAL.shorthand.test( '000' )\n true\n > bool = RE_COLOR_HEXADECIMAL.shorthand.test( 'beep' )\n false\n\n\nRE_COLOR_HEXADECIMAL.either\n Regular expression to match either a shorthand or full length hexadecimal\n color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.either.test( 'ffffff' )\n true\n > bool = RE_COLOR_HEXADECIMAL.either.test( '000' )\n true\n > bool = RE_COLOR_HEXADECIMAL.either.test( 'beep' )\n false\n\n",
"RE_DECIMAL_NUMBER": "\nRE_DECIMAL_NUMBER\n Regular expression to capture a decimal number.\n\n A leading digit is not required.\n\n A decimal point and at least one trailing digit is required.\n\n Examples\n --------\n > var bool = RE_DECIMAL_NUMBER.test( '1.234' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '-1.234' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '0.0' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '.0' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '0' )\n false\n > bool = RE_DECIMAL_NUMBER.test( 'beep' )\n false\n\n // Create a RegExp to capture all decimal numbers:\n > var re = new RegExp( RE_DECIMAL_NUMBER.source, 'g' );\n > var str = '1.234 5.6, 7.8';\n > var out = str.match( re )\n [ '1.234', '5.6', '7.8' ]\n\n\n",
"RE_DIRNAME": "\nRE_DIRNAME\n Regular expression to capture a path dirname.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_DIRNAME.posix\n Regular expression to capture a POSIX path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME.exec( '/foo/bar/index.js' )[ 1 ]\n '/foo/bar'\n\n\nRE_DIRNAME.win32\n Regular expression to capture a Windows path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'C:\\\\foo\\\\bar'\n\n See Also\n --------\n RE_DIRNAME_POSIX, RE_DIRNAME_WINDOWS, dirname\n",
"RE_DIRNAME_POSIX": "\nRE_DIRNAME_POSIX\n Regular expression to capture a POSIX path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n '/foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n './foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n 'foo'\n > dir = RE_DIRNAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n '/foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( 'index.js' )[ 1 ]\n ''\n > dir = RE_DIRNAME_POSIX.exec( '.' )[ 1 ]\n '.'\n > dir = RE_DIRNAME_POSIX.exec( './' )[ 1 ]\n '.'\n > dir = RE_DIRNAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_DIRNAME, RE_DIRNAME_WINDOWS, dirname\n",
"RE_DIRNAME_WINDOWS": "\nRE_DIRNAME_WINDOWS\n Regular expression to capture a Windows path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME_WINDOWS.exec( 'foo\\\\bar\\\\index.js' )[ 1 ]\n 'foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n 'C:\\\\foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n 'foo'\n > dir = RE_DIRNAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' )[ 1 ]\n '\\\\foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'index.js' )[ 1 ]\n ''\n > dir = RE_DIRNAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_DIRNAME, RE_DIRNAME_POSIX, dirname\n",
"RE_EOL": "\nRE_EOL\n Regular expression to match a newline character sequence: /\\r?\\n/.\n\n Examples\n --------\n > var bool = RE_EOL.test( '\\n' )\n true\n > bool = RE_EOL.test( '\\r\\n' )\n true\n > bool = RE_EOL.test( '\\\\r\\\\n' )\n false\n\n",
"RE_EXTENDED_LENGTH_PATH": "\nRE_EXTENDED_LENGTH_PATH\n Regular expression to test if a string is an extended-length path.\n\n Extended-length paths are Windows paths which begin with `\\\\?\\`.\n\n Examples\n --------\n > var path = '\\\\\\\\?\\\\C:\\\\foo\\\\bar';\n > var bool = RE_EXTENDED_LENGTH_PATH.test( path )\n true\n > path = '\\\\\\\\?\\\\UNC\\\\server\\\\share';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n true\n > path = 'C:\\\\foo\\\\bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n > path = '/c/foo/bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n > path = '/foo/bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n\n",
"RE_EXTNAME": "\nRE_EXTNAME\n Regular expression to capture a filename extension.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_EXTNAME.posix\n Regular expression to capture a POSIX filename extension.\n\n Examples\n --------\n > var dir = RE_EXTNAME.exec( '/foo/bar/index.js' )[ 1 ]\n '.js'\n\n\nRE_EXTNAME.win32\n Regular expression to capture a Windows filename extension.\n\n Examples\n --------\n > var dir = RE_EXTNAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n '.js'\n\n See Also\n --------\n RE_EXTNAME_POSIX, RE_EXTNAME_WINDOWS, extname\n",
"RE_EXTNAME_POSIX": "\nRE_EXTNAME_POSIX\n Regular expression to capture a POSIX filename extension.\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var ext = RE_EXTNAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n '.pdf'\n > ext = RE_EXTNAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_POSIX.exec( '.' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( './' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_EXTNAME, RE_EXTNAME_WINDOWS, extname\n",
"RE_EXTNAME_WINDOWS": "\nRE_EXTNAME_WINDOWS\n Regular expression to capture a Windows filename extension.\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var ext = RE_EXTNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n ''\n > ext = RE_EXTNAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n '.pdf'\n > ext = RE_EXTNAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' )[ 1 ]\n ''\n > ext = RE_EXTNAME_WINDOWS.exec( 'beep\\\\boop.' )[ 1 ]\n '.'\n > ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_EXTNAME, RE_EXTNAME_POSIX, extname\n",
"RE_FILENAME": "\nRE_FILENAME\n Regular expression to split a filename.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_FILENAME.posix\n Regular expression to split a POSIX filename.\n\n When executed, the regular expression splits a POSIX filename into the\n following parts:\n\n - input value\n - root\n - dirname\n - basename\n - extname\n\n Examples\n --------\n > var f = '/foo/bar/index.js';\n > var parts = RE_FILENAME.exec( f ).slice()\n [ '/foo/bar/index.js', '/', 'foo/bar/', 'index.js', '.js' ]\n\n\nRE_FILENAME.win32\n Regular expression to split a Windows filename.\n\n When executed, the regular expression splits a Windows filename into the\n following parts:\n\n - input value\n - device\n - slash\n - dirname\n - basename\n - extname\n\n Examples\n --------\n > var f = 'C:\\\\foo\\\\bar\\\\index.js';\n > var parts = RE_FILENAME.exec( f ).slice()\n [ 'C:\\\\foo\\\\bar\\\\index.js', 'C:', '\\\\', 'foo\\\\bar\\\\', 'index.js', '.js' ]\n\n See Also\n --------\n RE_FILENAME_POSIX, RE_FILENAME_WINDOWS\n",
"RE_FILENAME_POSIX": "\nRE_FILENAME_POSIX\n Regular expression to split a POSIX filename.\n\n When executed, the regular expression splits a POSIX filename into the\n following parts:\n\n - input value\n - root\n - dirname\n - basename\n - extname\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var parts = RE_FILENAME_POSIX.exec( '/foo/bar/index.js' ).slice()\n [ '/foo/bar/index.js', '/', 'foo/bar/', 'index.js', '.js' ]\n > parts = RE_FILENAME_POSIX.exec( './foo/bar/.gitignore' ).slice()\n [ './foo/bar/.gitignore', '', './foo/bar/', '.gitignore', '' ]\n > parts = RE_FILENAME_POSIX.exec( 'foo/file.pdf' ).slice()\n [ 'foo/file.pdf', '', 'foo/', 'file.pdf', '.pdf' ]\n > parts = RE_FILENAME_POSIX.exec( '/foo/bar/file' ).slice()\n [ '/foo/bar/file', '/', 'foo/bar/', 'file', '' ]\n > parts = RE_FILENAME_POSIX.exec( 'index.js' ).slice()\n [ 'index.js', '', '', 'index.js', '.js' ]\n > parts = RE_FILENAME_POSIX.exec( '.' ).slice()\n [ '.', '', '', '.', '' ]\n > parts = RE_FILENAME_POSIX.exec( './' ).slice()\n [ './', '', '.', '.', '' ]\n > parts = RE_FILENAME_POSIX.exec( '' ).slice()\n [ '', '', '', '', '' ]\n\n See Also\n --------\n RE_FILENAME, RE_FILENAME_WINDOWS\n",
"RE_FILENAME_WINDOWS": "\nRE_FILENAME_WINDOWS\n Regular expression to split a Windows filename.\n\n When executed, the regular expression splits a Windows filename into the\n following parts:\n\n - input value\n - device\n - slash\n - dirname\n - basename\n - extname\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var parts = RE_FILENAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\index.js' ).slice()\n [ 'C:\\\\foo\\\\bar\\\\index.js', 'C:', '\\\\', 'foo\\\\bar\\\\', 'index.js', '.js' ]\n > parts = RE_FILENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\.gitignore' ).slice()\n [ '\\\\foo\\\\bar\\\\.gitignore', '', '\\\\', 'foo\\\\bar\\\\', '.gitignore', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( 'foo\\\\file.pdf' ).slice()\n [ 'foo\\\\file.pdf', '', '', 'foo\\\\', 'file.pdf', '.pdf' ]\n > parts = RE_FILENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' ).slice()\n [ '\\\\foo\\\\bar\\\\file', '', '\\\\', 'foo\\\\bar\\\\', 'file', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( 'index.js' ).slice()\n [ 'index.js', '', '', '', 'index.js', '.js' ]\n > parts = RE_FILENAME_WINDOWS.exec( '.' ).slice()\n [ '.', '', '', '', '.', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( './' ).slice()\n [ './', '', '', '.', '.', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( '' ).slice()\n [ '', '', '', '', '', '' ]\n\n See Also\n --------\n RE_FILENAME, RE_FILENAME_POSIX\n",
"RE_FUNCTION_NAME": "\nRE_FUNCTION_NAME\n Regular expression to capture a function name.\n\n Examples\n --------\n > function beep() { return 'boop'; };\n > var name = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]\n 'beep'\n > name = RE_FUNCTION_NAME.exec( function () {} )[ 1 ]\n ''\n\n See Also\n --------\n functionName\n",
"RE_NATIVE_FUNCTION": "\nRE_NATIVE_FUNCTION\n Regular expression to match a native function.\n\n Examples\n --------\n > var bool = RE_NATIVE_FUNCTION.test( Date.toString() )\n true\n > bool = RE_NATIVE_FUNCTION.test( (function noop() {}).toString() )\n false\n\n See Also\n --------\n RE_FUNCTION_NAME, functionName\n",
"RE_REGEXP": "\nRE_REGEXP\n Regular expression to parse a regular expression string.\n\n Regular expression strings should be escaped.\n\n Examples\n --------\n > var bool = RE_REGEXP.test( '/^beep$/' )\n true\n > bool = RE_REGEXP.test( '/boop' )\n false\n\n // Escape regular expression strings:\n > bool = RE_REGEXP.test( '/^\\/([^\\/]+)\\/(.*)$/' )\n false\n > bool = RE_REGEXP.test( '/^\\\\/([^\\\\/]+)\\\\/(.*)$/' )\n true\n\n See Also\n --------\n reFromString\n",
"RE_UNC_PATH": "\nRE_UNC_PATH\n Regular expression to parse a UNC path.\n\n Examples\n --------\n > var path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:b';\n > var bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz::b';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\\\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = 'beep boop \\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz::';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:b:c';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '//server/share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '/foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = 'foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = './foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '/foo/../bar';\n > bool = RE_UNC_PATH.test( path )\n false\n\n See Also\n --------\n isUNCPath\n",
"RE_UTF16_SURROGATE_PAIR": "\nRE_UTF16_SURROGATE_PAIR\n Regular expression to match a UTF-16 surrogate pair.\n\n Examples\n --------\n > var bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\\uD800\\uDC00def' )\n true\n > bool = RE_UTF16_SURROGATE_PAIR.test( 'abcdef' )\n false\n\n See Also\n --------\n RE_UTF16_UNPAIRED_SURROGATE\n",
"RE_UTF16_UNPAIRED_SURROGATE": "\nRE_UTF16_UNPAIRED_SURROGATE\n Regular expression to match an unpaired UTF-16 surrogate.\n\n Examples\n --------\n > var bool = RE_UTF16_UNPAIRED_SURROGATE.test( 'abc' )\n false\n > bool = RE_UTF16_UNPAIRED_SURROGATE.test( '\\uD800' )\n true\n\n See Also\n --------\n RE_UTF16_SURROGATE_PAIR\n",
"RE_WHITESPACE": "\nRE_WHITESPACE\n Regular expression to match a white space character.\n\n Matches the 25 characters defined as white space (\"WSpace=Y\",\"WS\")\n characters in the Unicode 9.0 character database.\n\n Matches one related white space character without the Unicode character\n property \"WSpace=Y\" (zero width non-breaking space which was deprecated as\n of Unicode 3.2).\n\n Examples\n --------\n > var bool = RE_WHITESPACE.test( '\\n' )\n true\n > bool = RE_WHITESPACE.test( ' ' )\n true\n > bool = RE_WHITESPACE.test( 'a' )\n false\n\n See Also\n --------\n isWhitespace\n",
"readDir": "\nreadDir( path, clbk )\n Asynchronously reads the contents of a directory.\n\n Parameters\n ----------\n path: string|Buffer\n Directory path.\n\n clbk: Function\n Callback to invoke after reading directory contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readDir( './beep/boop', onRead );\n\n\nreadDir.sync( path )\n Synchronously reads the contents of a directory.\n\n Parameters\n ----------\n path: string|Buffer\n Directory path.\n\n Returns\n -------\n out: Error|Array|Array<string>\n Directory contents.\n\n Examples\n --------\n > var out = readDir.sync( './beep/boop' );\n\n See Also\n --------\n exists, readFile\n",
"readFile": "\nreadFile( file[, options,] clbk )\n Asynchronously reads the entire contents of a file.\n\n If provided an encoding, the function returns a string. Otherwise, the\n function returns a Buffer object.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readFile( './beep/boop.js', onRead );\n\n\nreadFile.sync( file[, options] )\n Synchronously reads the entire contents of a file.\n\n If provided an encoding, the function returns a string. Otherwise, the\n function returns a Buffer object.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Buffer|string\n File contents.\n\n Examples\n --------\n > var out = readFile.sync( './beep/boop.js' );\n\n See Also\n --------\n exists, readDir, readJSON, writeFile\n",
"readFileList": "\nreadFileList( filepaths[, options,] clbk )\n Asynchronously reads the entire contents of each file in a file list.\n\n If a provided an encoding, the function returns file contents as strings.\n Otherwise, the function returns Buffer objects.\n\n Each file is represented by an object with the following fields:\n\n - file: file path\n - data: file contents as either a Buffer or string\n\n Parameters\n ----------\n filepaths: Array<string>\n Filepaths.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > var filepaths = [ './beep/boop.txt', './foo/bar.txt' ];\n > readFileList( filepaths, onRead );\n\n\nreadFileList.sync( filepaths[, options] )\n Synchronously reads the entire contents of each file in a file list.\n\n If a provided an encoding, the function returns file contents as strings.\n Otherwise, the function returns Buffer objects.\n\n Parameters\n ----------\n filepaths: Array<string>\n Filepaths.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Array|Array<string>\n File contents.\n\n out[ i ].file: string\n File path.\n\n out[ i ].data: Buffer|string\n File contents.\n\n Examples\n --------\n > var filepaths = [ './beep/boop.txt', './foo/bar.txt' ];\n > var out = readFileList.sync( filepaths );\n\n",
"readJSON": "\nreadJSON( file[, options,] clbk )\n Asynchronously reads a file as JSON.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. If the encoding option is set to `utf8` and the file has a\n UTF-8 byte order mark (BOM), the byte order mark is *removed* before\n attempting to parse as JSON. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n options.reviver: Function (optional)\n JSON transformation function.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readJSON( './beep/boop.json', onRead );\n\n\nreadJSON.sync( file[, options] )\n Synchronously reads a file as JSON.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. If the encoding option is set to `utf8` and the file has a\n UTF-8 byte order mark (BOM), the byte order mark is *removed* before\n attempting to parse as JSON. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n options.reviver: Function (optional)\n JSON transformation function.\n\n Returns\n -------\n out: Error|JSON\n File contents.\n\n Examples\n --------\n > var out = readJSON.sync( './beep/boop.json' );\n\n See Also\n --------\n readFile\n",
"readWASM": "\nreadWASM( file, [options,] clbk )\n Asynchronously reads a file as WebAssembly.\n\n The function returns file contents as a Uint8Array.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object (optional)\n Options.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readWASM( './beep/boop.wasm', onRead );\n\n\nreadWASM.sync( file[, options] )\n Synchronously reads a file as WebAssembly.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object (optional)\n Options.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Uint8Array\n File contents.\n\n Examples\n --------\n > var out = readWASM.sync( './beep/boop.wasm' );\n\n See Also\n --------\n readFile\n",
"real": "\nreal( z )\n Returns the real component of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n re: number\n Real component.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var re = real( z )\n 5.0\n\n See Also\n --------\n imag, reim\n",
"realmax": "\nrealmax( dtype )\n Returns the maximum finite value capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum finite value.\n\n Examples\n --------\n > var m = realmax( 'float16' )\n 65504.0\n > m = realmax( 'float32' )\n 3.4028234663852886e+38\n\n See Also\n --------\n realmin, typemax\n",
"realmin": "\nrealmin( dtype )\n Returns the smallest positive normal value capable of being represented by a\n numeric real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Smallest finite normal value.\n\n Examples\n --------\n > var m = realmin( 'float16' )\n 0.00006103515625\n > m = realmin( 'float32' )\n 1.1754943508222875e-38\n\n See Also\n --------\n realmax, typemin\n",
"reduce": "\nreduce( collection, initial, reducer[, thisArg] )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result.\n\n When invoked, the reduction function is provided four arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, the function returns the initial value.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n reducer: Function\n Function to invoke for each element in the input collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: any\n Accumulated result.\n\n Examples\n --------\n > function sum( acc, v ) { return acc + v; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = reduce( arr, 0, sum )\n 6.0\n\n See Also\n --------\n forEach, reduceAsync, reduceRight\n",
"reduceAsync": "\nreduceAsync( collection, initial, [options,] reducer, done )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result.\n\n When invoked, `reducer` is provided a maximum of five arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If\n `reducer` accepts three arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `next`\n\n If `reducer` accepts four arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `index`\n - `next`\n\n For every other `reducer` signature, `reducer` is provided all five\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `accumulator`: accumulated value\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n If provided an empty collection, the function invokes the `done` callback\n with the `initial` value as the second argument.\n\n The function does not skip `undefined` elements.\n\n When processing collection elements concurrently, *beware* of race\n conditions when updating an accumulator. This is especially true when an\n accumulator is a primitive (e.g., a number). In general, prefer object\n accumulators.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n reducer: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, fcn, done )\n 3000\n 2500\n 1000\n 6500\n\n // Limit number of concurrent invocations:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, opts, fcn, done )\n 2500\n 3000\n 1000\n 6500\n\n // Process concurrently:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'series': false };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, opts, fcn, done )\n 1000\n 2500\n 3000\n 6500\n\n\nreduceAsync.factory( [options,] fcn )\n Returns a function which applies a function against an accumulator and each\n element in a collection and returns the accumulated result.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > var opts = { 'series': false };\n > var f = reduceAsync.factory( opts, fcn );\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > f( arr, acc, done )\n 1000\n 2500\n 3000\n 6500\n > acc = { 'sum': 0 };\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, acc, done )\n 1000\n 1500\n 2000\n 4500\n\n See Also\n --------\n forEachAsync, reduce, reduceRightAsync\n",
"reduceRight": "\nreduceRight( collection, initial, reducer[, thisArg] )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result, iterating from right to left.\n\n When invoked, the reduction function is provided four arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, the function returns the initial value.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n reducer: Function\n Function to invoke for each element in the input collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: any\n Accumulated result.\n\n Examples\n --------\n > function sum( acc, v ) {\n ... console.log( '%s: %d', acc, v );\n ... return acc + v;\n ... };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = reduceRight( arr, 0, sum );\n 2: 3.0\n 1: 2.0\n 0: 1.0\n > out\n 6.0\n\n See Also\n --------\n forEachRight, reduce, reduceRightAsync\n",
"reduceRightAsync": "\nreduceRightAsync( collection, initial, [options,] reducer, done )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result, iterating from right to left.\n\n When invoked, `reducer` is provided a maximum of five arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If\n `reducer` accepts three arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `next`\n\n If `reducer` accepts four arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `index`\n - `next`\n\n For every other `reducer` signature, `reducer` is provided all five\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `accumulator`: accumulated value\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n If provided an empty collection, the function invokes the `done` callback\n with the `initial` value as the second argument.\n\n The function does not skip `undefined` elements.\n\n When processing collection elements concurrently, *beware* of race\n conditions when updating an accumulator. This is especially true when an\n accumulator is a primitive (e.g., a number). In general, prefer object\n accumulators.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n reducer: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, fcn, done )\n 3000\n 2500\n 1000\n 6500\n\n // Limit number of concurrent invocations:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, opts, fcn, done )\n 2500\n 3000\n 1000\n 6500\n\n // Process concurrently:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'series': false };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, opts, fcn, done )\n 1000\n 2500\n 3000\n 6500\n\n\nreduceRightAsync.factory( [options,] fcn )\n Returns a function which applies a function against an accumulator and each\n element in a collection and returns the accumulated result, iterating from\n right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > var opts = { 'series': false };\n > var f = reduceRightAsync.factory( opts, fcn );\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > f( arr, acc, done )\n 1000\n 2500\n 3000\n 6500\n > acc = { 'sum': 0 };\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, acc, done )\n 1000\n 1500\n 2000\n 4500\n\n See Also\n --------\n forEachRightAsync, reduceAsync, reduceRight\n",
"reFromString": "\nreFromString( str )\n Parses a regular expression string and returns a new regular expression.\n\n Provided strings should be properly escaped.\n\n If unable to parse a string as a regular expression, the function returns\n `null`.\n\n Parameters\n ----------\n str: string\n Regular expression string.\n\n Returns\n -------\n out: RegExp|null\n Regular expression or null.\n\n Examples\n --------\n > var re = reFromString( '/beep/' )\n /beep/\n > re = reFromString( '/beep' )\n null\n\n",
"reim": "\nreim( z )\n Returns the real and imaginary components of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n out: Float64Array|Float32Array\n Array containing the real and imaginary components, respectively.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var out = reim( z )\n <Float64Array>[ 5.0, 3.0 ]\n\n See Also\n --------\n imag, real\n",
"removeFirst": "\nremoveFirst( str )\n Removes the first character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Updated string.\n\n Examples\n --------\n > var out = removeFirst( 'beep' )\n 'eep'\n > out = removeFirst( 'Boop' )\n 'oop'\n\n See Also\n --------\n removeLast\n",
"removeLast": "\nremoveLast( str )\n Removes the last character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Updated string.\n\n Examples\n --------\n > var out = removeLast( 'beep' )\n 'bee'\n > out = removeLast( 'Boop' )\n 'Boo'\n\n See Also\n --------\n removeFirst\n",
"removePunctuation": "\nremovePunctuation( str )\n Removes punctuation characters from a `string`.\n\n The function removes the following characters:\n\n - Apostrophe: `\n - Braces : { }\n - Brackets: [ ]\n - Colon: :\n - Comma: ,\n - Exclamation Mark: !\n - Fraction Slash: /\n - Guillemets: < >\n - Parentheses: ( )\n - Period: .\n - Semicolon: ;\n - Tilde: ~\n - Vertical Bar: |\n - Question Mark: ?\n - Quotation Marks: ' \"\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with punctuation characters removed.\n\n Examples\n --------\n > var str = 'Sun Tzu said: \"A leader leads by example not by force.\"';\n > var out = removePunctuation( str )\n 'Sun Tzu said A leader leads by example not by force'\n\n > str = 'This function removes these characters: `{}[]:,!/<>().;~|?\\'\"';\n > out = removePunctuation( str )\n 'This function removes these characters '\n\n",
"removeUTF8BOM": "\nremoveUTF8BOM( str )\n Removes a UTF-8 byte order mark (BOM) from the beginning of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with BOM removed.\n\n Examples\n --------\n > var out = removeUTF8BOM( '\\ufeffbeep' )\n 'beep'\n\n",
"removeWords": "\nremoveWords( str, words[, ignoreCase] )\n Removes all occurrences of the given words from a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n words: Array<string>\n Array of words to be removed.\n\n ignoreCase: boolean (optional)\n Boolean indicating whether to perform a case-insensitive operation.\n Default: `false`.\n\n Returns\n -------\n out: string\n String with words removed.\n\n Examples\n --------\n > var out = removeWords( 'beep boop Foo bar', [ 'boop', 'foo' ] )\n 'beep Foo bar'\n\n // Case-insensitive:\n > out = removeWords( 'beep boop Foo bar', [ 'boop', 'foo' ], true )\n 'beep bar'\n\n",
"rename": "\nrename( oldPath, newPath, clbk )\n Asynchronously renames a file.\n\n The old path can specify a directory. In this case, the new path must either\n not exist, or it must specify an empty directory.\n\n The old pathname should not name an ancestor directory of the new pathname.\n\n If the old path points to the pathname of a file that is not a directory,\n the new path should not point to the pathname of a directory.\n\n Write access permission is required for both the directory containing the\n old path and the directory containing the new path.\n\n If the link named by the new path exists, the new path is removed and the\n old path is renamed to the new path. The link named by the new path will\n remain visible to other threads throughout the renaming operation and refer\n to either the file referred to by the new path or to the file referred to by\n the old path before the operation began.\n\n If the old path and the new path resolve to either the same existing\n directory entry or to different directory entries for the same existing\n file, no action is taken, and no error is returned.\n\n If the old path points to a pathname of a symbolic link, the symbolic link\n is renamed. If the new path points to a pathname of a symbolic link, the\n symbolic link is removed.\n\n If a link named by the new path exists and the file's link count becomes 0\n when it is removed and no process has the file open, the space occupied by\n the file is freed and the file is no longer accessible. If one or more\n processes have the file open when the last link is removed, the link is\n removed before the function returns, but the removal of file contents is\n postponed until all references to the file are closed.\n\n Parameters\n ----------\n oldPath: string|Buffer\n Old path.\n\n newPath: string|Buffer\n New path.\n\n clbk: Function\n Callback to invoke upon renaming a file.\n\n Examples\n --------\n > function done( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > rename( './beep/boop.txt', './beep/foo.txt', done );\n\n\nrename.sync( oldPath, newPath )\n Synchronously renames a file.\n\n Parameters\n ----------\n oldPath: string|Buffer\n Old path.\n\n newPath: string|Buffer\n New path.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = rename.sync( './beep/boop.txt', './beep/foo.txt' );\n\n See Also\n --------\n exists, readFile, writeFile, unlink\n",
"reorderArguments": "\nreorderArguments( fcn, indices[, thisArg] )\n Returns a function that invokes a provided function with reordered\n arguments.\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n indices: Array<integer>\n Argument indices.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Function with reordered arguments.\n\n Examples\n --------\n > function foo( a, b, c ) { return [ a, b, c ]; };\n > var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n > var out = bar( 1, 2, 3 )\n [ 3, 1, 2 ]\n\n See Also\n --------\n reverseArguments\n",
"repeat": "\nrepeat( str, n )\n Repeats a string `n` times and returns the concatenated result.\n\n Parameters\n ----------\n str: string\n Input string.\n\n n: integer\n Number of repetitions.\n\n Returns\n -------\n out: string\n Repeated string.\n\n Examples\n --------\n > var out = repeat( 'a', 5 )\n 'aaaaa'\n > out = repeat( '', 100 )\n ''\n > out = repeat( 'beep', 0 )\n ''\n\n See Also\n --------\n pad\n",
"replace": "\nreplace( str, search, newval )\n Replaces `search` occurrences with a replacement `string`.\n\n When provided a `string` as the `search` value, the function replaces *all*\n occurrences. To remove only the first match, use a regular expression.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string|RegExp\n Search expression.\n\n newval: string|Function\n Replacement value or function.\n\n Returns\n -------\n out: string\n String containing replacement(s).\n\n Examples\n --------\n // Standard usage:\n > var out = replace( 'beep', 'e', 'o' )\n 'boop'\n\n // Replacer function:\n > function replacer( match, p1 ) { return '/'+p1+'/'; };\n > var str = 'Oranges and lemons';\n > out = replace( str, /([^\\s]+)/gi, replacer )\n '/Oranges/ /and/ /lemons/'\n\n // Replace only first match:\n > out = replace( 'beep', /e/, 'o' )\n 'boep'\n\n",
"rescape": "\nrescape( str )\n Escapes a regular expression string.\n\n Parameters\n ----------\n str: string\n Regular expression string.\n\n Returns\n -------\n out: string\n Escaped string.\n\n Examples\n --------\n > var str = rescape( '[A-Z]*' )\n '\\\\[A\\\\-Z\\\\]\\\\*'\n\n",
"resolveParentPath": "\nresolveParentPath( path[, options,] clbk )\n Asynchronously resolves a path by walking parent directories.\n\n If unable to resolve a path, the function returns `null` as the path result.\n\n Parameters\n ----------\n path: string\n Path to resolve.\n\n options: Object (optional)\n Options.\n\n options.dir: string (optional)\n Base directory from which to search. Default: current working directory.\n\n clbk: Function\n Callback to invoke after resolving a path.\n\n Examples\n --------\n > function onPath( error, path ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( path );\n ... }\n ... };\n > resolveParentPath( 'package.json', onPath );\n\n\nresolveParentPath.sync( path[, options] )\n Synchronously resolves a path by walking parent directories.\n\n Parameters\n ----------\n path: string\n Path to resolve.\n\n options: Object (optional)\n Options.\n\n options.dir: string (optional)\n Base directory from which to search. Default: current working directory.\n\n Returns\n -------\n out: string|null\n Resolved path.\n\n Examples\n --------\n > var out = resolveParentPath.sync( 'package.json' );\n\n",
"reverseArguments": "\nreverseArguments( fcn[, thisArg] )\n Returns a function that invokes a provided function with arguments in\n reverse order.\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Function with reversed arguments.\n\n Examples\n --------\n > function foo( a, b, c ) { return [ a, b, c ]; };\n > var bar = reverseArguments( foo );\n > var out = bar( 1, 2, 3 )\n [ 3, 2, 1 ]\n\n See Also\n --------\n reorderArguments\n",
"reverseString": "\nreverseString( str )\n Reverses a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Reversed string.\n\n Examples\n --------\n > var out = reverseString( 'foo' )\n 'oof'\n > out = reverseString( 'abcdef' )\n 'fedcba'\n\n",
"reviveBasePRNG": "\nreviveBasePRNG( key, value )\n Revives a JSON-serialized pseudorandom number generator (PRNG).\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or PRNG.\n\n Examples\n --------\n > var str = JSON.stringify( base.random.mt19937 );\n > var r = parseJSON( str, reviveBasePRNG )\n <Function>\n\n",
"reviveBuffer": "\nreviveBuffer( key, value )\n Revives a JSON-serialized Buffer.\n\n The serialization format for a Buffer is an object having the following\n fields:\n\n - type: value type (Buffer)\n - data: buffer data as an array of integers\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or Buffer.\n\n Examples\n --------\n > var str = '{\"type\":\"Buffer\",\"data\":[5,3]}';\n > var buf = parseJSON( str, reviveBuffer )\n <Buffer>[ 5, 3 ]\n\n See Also\n --------\n buffer2json\n",
"reviveComplex": "\nreviveComplex( key, value )\n Revives a JSON-serialized complex number.\n\n The serialization format for complex numbers is an object having the\n following fields:\n\n - type: complex number type (e.g., \"Complex128\", \"Complex64\")\n - re: real component (number)\n - im: imaginary component (number)\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex )\n <Complex128>\n\n See Also\n --------\n Complex128, Complex64, reviveComplex128, reviveComplex64\n",
"reviveComplex64": "\nreviveComplex64( key, value )\n Revives a JSON-serialized 64-bit complex number.\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex64\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex64 )\n <Complex64>\n\n See Also\n --------\n Complex64, reviveComplex128, reviveComplex\n",
"reviveComplex128": "\nreviveComplex128( key, value )\n Revives a JSON-serialized 128-bit complex number.\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex128 )\n <Complex128>\n\n See Also\n --------\n Complex128, reviveComplex64, reviveComplex\n",
"reviveError": "\nreviveError( key, value )\n Revives a JSON-serialized error object.\n\n The following built-in error types are supported:\n\n - Error\n - URIError\n - ReferenceError\n - SyntaxError\n - RangeError\n - EvalError\n - TypeError\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or error object.\n\n Examples\n --------\n > var str = '{\"type\":\"TypeError\",\"message\":\"beep\"}';\n > var err = JSON.parse( str, reviveError )\n <TypeError>\n\n See Also\n --------\n error2json\n",
"reviveTypedArray": "\nreviveTypedArray( key, value )\n Revives a JSON-serialized typed array.\n\n The serialization format for typed array is an object having the following\n fields:\n\n - type: typed array type (e.g., \"Float64Array\", \"Int8Array\")\n - data: typed array data as an array of numbers\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or typed array.\n\n Examples\n --------\n > var str = '{\"type\":\"Float64Array\",\"data\":[5,3]}';\n > var arr = parseJSON( str, reviveTypedArray )\n <Float64Array>[ 5.0, 3.0 ]\n\n See Also\n --------\n typedarray2json\n",
"rpad": "\nrpad( str, len[, pad] )\n Right pads a `string` such that the padded `string` has a length of at least\n `len`.\n\n An output string is not guaranteed to have a length of exactly `len`, but to\n have a length of at least `len`. To generate a padded string having a length\n equal to `len`, post-process a padded string by trimming off excess\n characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Minimum string length.\n\n pad: string (optional)\n String used to pad. Default: ' '.\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n > var out = rpad( 'a', 5 )\n 'a '\n > out = rpad( 'beep', 10, 'p' )\n 'beeppppppp'\n > out = rpad( 'beep', 12, 'boop' )\n 'beepboopboop'\n\n See Also\n --------\n lpad, pad\n",
"rtrim": "\nrtrim( str )\n Trims whitespace from the end of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = rtrim( ' \\t\\t\\n Beep \\r\\n\\t ' )\n ' \\t\\t\\n Beep'\n\n See Also\n --------\n ltrim, trim\n",
"safeintmax": "\nsafeintmax( dtype )\n Returns the maximum safe integer capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum safe integer.\n\n Examples\n --------\n > var m = safeintmax( 'float16' )\n 2047\n > m = safeintmax( 'float32' )\n 16777215\n\n See Also\n --------\n safeintmin, realmax, typemax\n",
"safeintmin": "\nsafeintmin( dtype )\n Returns the minimum safe integer capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Minimum safe integer.\n\n Examples\n --------\n > var m = safeintmin( 'float16' )\n -2047\n > m = safeintmin( 'float32' )\n -16777215\n\n See Also\n --------\n safeintmax, realmin, typemin\n",
"sample": "\nsample( x[, options] )\n Samples elements from an array-like object.\n\n Parameters\n ----------\n x: ArrayLike\n Array-like object from which to sample.\n\n options: Object (optional)\n Options.\n\n options.size: integer (optional)\n Sample size. By default, the function returns an array having the same\n length as `x`. Specify the `size` option to generate a sample of a\n different size.\n\n options.probs: Array<number> (optional)\n Element probabilities. By default, the probability of sampling an\n element is the same for all elements. To assign elements different\n probabilities, set the `probs` option. The `probs` option must be a\n numeric array consisting of nonnegative values which sum to one. When\n sampling without replacement, note that the `probs` option denotes the\n initial element probabilities which are then updated after each draw.\n\n options.replace: boolean (optional)\n Boolean indicating whether to sample with replacement. If the `replace`\n option is set to `false`, the `size` option cannot be an integer larger\n than the number of elements in `x`. Default: `true`.\n\n Returns\n -------\n out: Array\n Sample.\n\n Examples\n --------\n > var out = sample( 'abc' )\n e.g., [ 'a', 'a', 'b' ]\n > out = sample( [ 3, 6, 9 ] )\n e.g., [ 3, 9, 6 ]\n > var bool = ( out.length === 3 )\n true\n\n > out = sample( [ 3, null, NaN, 'abc', function(){} ] )\n e.g., [ 3, 'abc', null, 3, null ]\n\n // Set sample size:\n > out = sample( [ 3, 6, 9 ], { 'size': 10 })\n e.g., [ 6, 3, 9, 9, 9, 6, 9, 6, 9, 3 ]\n > out = sample( [ 0, 1 ], { 'size': 20 })\n e.g., [ 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0 ]\n\n // Draw without replacement:\n > out = sample( [ 1, 2, 3, 4, 5, 6 ], { 'replace': false, 'size': 3 })\n e.g., [ 6, 1, 5 ]\n > out = sample( [ 0, 1 ], { 'replace': false })\n e.g., [ 0, 1 ]\n\n // Assigning non-uniform element probabilities:\n > var x = [ 1, 2, 3, 4, 5, 6 ];\n > var probs = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.5 ];\n > out = sample( x, { 'probs': probs })\n e.g., [ 5, 6, 6, 5, 6, 4 ]\n > out = sample( x, { 'probs': probs, 'size': 3, 'replace': false })\n e.g., [ 6, 4, 1 ]\n\n\nsample.factory( [pool, ][options] )\n Returns a function to sample elements from an array-like object.\n\n If provided an array-like object `pool`, the returned function will always\n sample from the supplied object.\n\n Parameters\n ----------\n pool: ArrayLike (optional)\n Array-like object from which to sample.\n\n options: Object (optional)\n Options.\n\n options.seed: integer (optional)\n Integer-valued seed.\n\n options.size: integer (optional)\n Sample size.\n\n options.replace: boolean (optional)\n Boolean indicating whether to sample with replacement. Default: `true`.\n\n options.mutate: boolean (optional)\n Boolean indicating whether to mutate the `pool` when sampling without\n replacement. If a population from which to sample is provided, the\n underlying `pool` remains by default constant for each function\n invocation. To mutate the `pool` by permanently removing observations\n when sampling without replacement, set the `mutate` option to `true`.\n The returned function returns `null` after all population units are\n exhausted. Default: `false`.\n\n Returns\n -------\n fcn: Function\n Function to sample elements from an array-like object.\n\n Examples\n --------\n // Set a seed:\n > var mysample = sample.factory({ 'seed': 232 });\n > var out = mysample( 'abcdefg' )\n e.g., [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n\n // Provide `pool` and set a seed plus a default sample size:\n > var pool = [ 1, 2, 3, 4, 5, 6 ];\n > mysample = sample.factory( pool, { 'seed': 232, 'size': 2 });\n > out = mysample()\n e.g., [ 6, 4 ]\n > out = mysample()\n e.g., [ 6, 5 ]\n\n // Mutate the `pool`:\n > var opts = { 'seed': 474, 'size': 3, 'mutate': true, 'replace': false };\n > pool = [ 1, 2, 3, 4, 5, 6 ];\n > mysample = sample.factory( pool, opts );\n > out = mysample()\n e.g., [ 4, 3, 6 ]\n > out = mysample()\n e.g., [ 1, 5, 2 ]\n > out = mysample()\n null\n\n // Override default `size` parameter when invoking created function:\n > mysample = sample.factory( [ 0, 1 ], { 'size': 2 });\n > out = mysample()\n e.g., [ 1, 1 ]\n > out = mysample({ 'size': 10 })\n e.g, [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n\n // Sample with and without replacement:\n > mysample = sample.factory( [ 0, 1 ], { 'size': 2 });\n > out = mysample()\n e.g., [ 1, 1 ]\n > out = mysample({ 'replace': false })\n e.g., [ 0, 1 ] or [ 1, 0 ]\n > out = mysample()\n e.g., [ 1, 1 ]\n\n",
"SAVOY_STOPWORDS_FIN": "\nSAVOY_STOPWORDS_FIN()\n Returns a list of Finnish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_FIN()\n [ 'aiemmin', 'aika', 'aikaa', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_FR": "\nSAVOY_STOPWORDS_FR()\n Returns a list of French stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_FR()\n [ 'a', 'à', 'â', 'abord', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_GER": "\nSAVOY_STOPWORDS_GER()\n Returns a list of German stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_GER()\n [ 'a', 'ab', 'aber', 'ach', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_IT": "\nSAVOY_STOPWORDS_IT()\n Returns a list of Italian stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_IT()\n [ 'a', 'abbastanza', 'accidenti', 'ad', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_POR": "\nSAVOY_STOPWORDS_POR()\n Returns a list of Portuguese stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_POR()\n [ 'aiemmin', 'aika', 'aikaa', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_SP": "\nSAVOY_STOPWORDS_SP()\n Returns a list of Spanish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_SP()\n [ 'a', 'acuerdo', 'adelante', 'ademas', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_SWE": "\nSAVOY_STOPWORDS_SWE()\n Returns a list of Swedish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_SWE()\n [ 'aderton', 'adertonde', 'adjö', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SECONDS_IN_DAY": "\nSECONDS_IN_DAY\n Number of seconds in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var secs = days * SECONDS_IN_DAY\n 271296\n\n",
"SECONDS_IN_HOUR": "\nSECONDS_IN_HOUR\n Number of seconds in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var secs = hrs * SECONDS_IN_HOUR\n 11304\n\n",
"SECONDS_IN_MINUTE": "\nSECONDS_IN_MINUTE\n Number of seconds in a minute.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var mins = 3.14;\n > var secs = mins * SECONDS_IN_MINUTE\n 188.4\n\n",
"SECONDS_IN_WEEK": "\nSECONDS_IN_WEEK\n Number of seconds in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var secs = wks * SECONDS_IN_WEEK\n 1899072\n\n",
"secondsInMonth": "\nsecondsInMonth( [month[, year]] )\n Returns the number of seconds in a month.\n\n By default, the function returns the number of seconds in the current month\n of the current year (according to local time). To determine the number of\n seconds for a particular month and year, provide `month` and `year`\n arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Seconds in a month.\n\n Examples\n --------\n > var num = secondsInMonth()\n <number>\n > num = secondsInMonth( 2 )\n <number>\n > num = secondsInMonth( 2, 2016 )\n 2505600\n > num = secondsInMonth( 2, 2017 )\n 2419200\n\n // Other ways to supply month:\n > num = secondsInMonth( 'feb', 2016 )\n 2505600\n > num = secondsInMonth( 'february', 2016 )\n 2505600\n\n See Also\n --------\n secondsInYear\n",
"secondsInYear": "\nsecondsInYear( [value] )\n Returns the number of seconds in a year according to the Gregorian calendar.\n\n By default, the function returns the number of seconds in the current year\n (according to local time). To determine the number of seconds for a\n particular year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of seconds in a year.\n\n Examples\n --------\n > var num = secondsInYear()\n <number>\n > num = secondsInYear( 2016 )\n 31622400\n > num = secondsInYear( 2017 )\n 31536000\n\n See Also\n --------\n secondsInMonth\n",
"setNonEnumerableProperty": "\nsetNonEnumerableProperty( obj, prop, value )\n Defines a non-enumerable property.\n\n Non-enumerable properties are writable and configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setNonEnumerableProperty( obj, 'foo', 'bar' );\n > obj.foo\n 'bar'\n > objectKeys( obj )\n []\n\n See Also\n --------\n setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnly\n",
"setNonEnumerableReadOnly": "\nsetNonEnumerableReadOnly( obj, prop, value )\n Defines a non-enumerable read-only property.\n\n Non-enumerable read-only properties are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnly\n",
"setNonEnumerableReadOnlyAccessor": "\nsetNonEnumerableReadOnlyAccessor( obj, prop, getter )\n Defines a non-enumerable read-only accessor.\n\n Non-enumerable read-only accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n Examples\n --------\n > var obj = {};\n > function getter() { return 'bar'; };\n > setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n > obj.foo\n 'bar'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnlyAccessor\n",
"setNonEnumerableReadWriteAccessor": "\nsetNonEnumerableReadWriteAccessor( obj, prop, getter, setter )\n Defines a non-enumerable property having read-write accessors.\n\n Non-enumerable read-write accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var name = 'bar';\n > function getter() { return name + ' foo'; };\n > function setter( v ) { name = v; };\n > setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n > obj.foo\n 'bar foo'\n > obj.foo = 'beep';\n > obj.foo\n 'beep foo'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableWriteOnlyAccessor, setReadWriteAccessor\n",
"setNonEnumerableWriteOnlyAccessor": "\nsetNonEnumerableWriteOnlyAccessor( obj, prop, setter )\n Defines a non-enumerable write-only accessor.\n\n Non-enumerable write-only accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var val = '';\n > function setter( v ) { val = v; };\n > setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n > obj.foo = 'bar';\n > val\n 'bar'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadOnly": "\nsetReadOnly( obj, prop, value )\n Defines a read-only property.\n\n Read-only properties are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setReadOnly( obj, 'foo', 'bar' );\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n setReadOnlyAccessor, setReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadOnlyAccessor": "\nsetReadOnlyAccessor( obj, prop, getter )\n Defines a read-only accessor.\n\n Read-only accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n Examples\n --------\n > var obj = {};\n > function getter() { return 'bar'; };\n > setReadOnlyAccessor( obj, 'foo', getter );\n > obj.foo\n 'bar'\n\n See Also\n --------\n setReadOnly, setReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadWriteAccessor": "\nsetReadWriteAccessor( obj, prop, getter, setter )\n Defines a property having read-write accessors.\n\n Read-write accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var name = 'bar';\n > function getter() { return name + ' foo'; };\n > function setter( v ) { name = v; };\n > setReadWriteAccessor( obj, 'foo', getter, setter );\n > obj.foo\n 'bar foo'\n > obj.foo = 'beep';\n > obj.foo\n 'beep foo'\n\n See Also\n --------\n setReadOnly, setReadOnlyAccessor, setWriteOnlyAccessor\n",
"setWriteOnlyAccessor": "\nsetWriteOnlyAccessor( obj, prop, setter )\n Defines a write-only accessor.\n\n Write-only accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var val = '';\n > function setter( v ) { val = v; };\n > setWriteOnlyAccessor( obj, 'foo', setter );\n > obj.foo = 'bar';\n > val\n 'bar'\n\n See Also\n --------\n setReadOnly, setReadOnlyAccessor, setReadWriteAccessor\n",
"SharedArrayBuffer": "\nSharedArrayBuffer( size )\n Returns a shared array buffer having a specified number of bytes.\n\n A shared array buffer behaves similarly to a non-shared array buffer, except\n that a shared array buffer allows creating views of memory shared between\n threads.\n\n Buffer contents are initialized to 0.\n\n If an environment does not support shared array buffers, the function throws\n an error.\n\n Parameters\n ----------\n size: integer\n Number of bytes.\n\n Returns\n -------\n out: SharedArrayBuffer\n A shared array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var buf = new SharedArrayBuffer( 5 )\n <SharedArrayBuffer>\n\n\nSharedArrayBuffer.length\n Number of input arguments the constructor accepts.\n\n Examples\n --------\n > SharedArrayBuffer.length\n 1\n\n\nSharedArrayBuffer.prototype.byteLength\n Read-only property which returns the length (in bytes) of the array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var buf = new SharedArrayBuffer( 5 );\n > buf.byteLength\n 5\n\n\nSharedArrayBuffer.prototype.slice( [start[, end]] )\n Copies the bytes of a shared array buffer to a new shared array buffer.\n\n Parameters\n ----------\n start: integer (optional)\n Index at which to start copying buffer contents (inclusive). If\n negative, the index is relative to the end of the buffer.\n\n end: integer (optional)\n Index at which to stop copying buffer contents (exclusive). If negative,\n the index is relative to the end of the buffer.\n\n Returns\n -------\n out: SharedArrayBuffer\n A new shared array buffer whose contents have been copied from the\n calling shared array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var b1 = new SharedArrayBuffer( 10 );\n > var b2 = b1.slice( 2, 6 );\n > var bool = ( b1 === b2 )\n false\n > b2.byteLength\n 4\n\n See Also\n --------\n Buffer, ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"shift": "\nshift( collection )\n Removes and returns the first element of a collection.\n\n The function returns an array with two elements: the shortened collection\n and the removed element.\n\n If the input collection is a typed array whose length is greater than `0`,\n the first return value does not equal the input reference.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the value should be\n array-like.\n\n Returns\n -------\n out: Array\n Updated collection and the removed item.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var out = shift( arr )\n [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > out = shift( arr )\n [ <Float64Array>[ 2.0 ], 1.0 ]\n\n // Array-like object:\n > arr = { 'length': 2, '0': 1.0, '1': 2.0 };\n > out = shift( arr )\n [ { 'length': 1, '0': 2.0 }, 1.0 ]\n\n See Also\n --------\n pop, push, unshift\n",
"shuffle": "\nshuffle( arr[, options] )\n Shuffles elements of an array-like object.\n\n Parameters\n ----------\n arr: ArrayLike\n Array-like object to shuffle.\n\n options: Object (optional)\n Options.\n\n options.copy: string (optional)\n String indicating whether to return a copy (`deep`,`shallow` or `none`).\n Default: `'shallow'`.\n\n Returns\n -------\n out: ArrayLike\n Shuffled array-like object.\n\n Examples\n --------\n > var data = [ 1, 2, 3 ];\n > var out = shuffle( data )\n e.g., [ 3, 1, 2 ]\n > out = shuffle( data, { 'copy': 'none' });\n > var bool = ( data === out )\n true\n\n\nshuffle.factory( [options] )\n Returns a function to shuffle elements of array-like objects.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer (optional)\n Integer-valued seed.\n\n options.copy: string (optional)\n String indicating whether to return a copy (`deep`,`shallow` or `none`).\n Default: `'shallow'`.\n\n Returns\n -------\n fcn: Function\n Shuffle function.\n\n Examples\n --------\n > var myshuffle = shuffle.factory();\n\n // Set a seed:\n > myshuffle = shuffle.factory({ 'seed': 239 });\n > var arr = [ 0, 1, 2, 3, 4 ];\n > var out = myshuffle( arr )\n e.g., [ 3, 4, 1, 0, 2 ]\n\n // Use a different copy strategy:\n > myshuffle = shuffle.factory({ 'copy': 'none', 'seed': 867 });\n\n // Created shuffle function mutates input array by default:\n > arr = [ 1, 2, 3, 4, 5, 6 ];\n > out = myshuffle( arr );\n > var bool = ( arr === out )\n true\n // Default option can be overridden:\n > arr = [ 1, 2, 3, 4 ];\n > out = myshuffle( arr, { 'copy': 'shallow' });\n > bool = ( arr === out )\n false\n\n See Also\n --------\n sample\n",
"sizeOf": "\nsizeOf( dtype )\n Returns the size (in bytes) of the canonical binary representation of a\n specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n - complex128: 128-bit complex numbers\n - complex64: 64-bit complex numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Size (in bytes).\n\n Examples\n --------\n > var s = sizeOf( 'int8' )\n 1\n > s = sizeOf( 'uint32' )\n 4\n\n See Also\n --------\n realmax, typemax\n",
"some": "\nsome( collection, n )\n Tests whether at least `n` elements in a collection are truthy.\n\n The function immediately returns upon finding `n` truthy elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of truthy elements.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n` truthy\n elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 1, 2, 3 ];\n > var bool = some( arr, 3 )\n true\n\n See Also\n --------\n any, every, forEach, none, someBy\n",
"someBy": "\nsomeBy( collection, n, predicate[, thisArg ] )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon finding `n` successful elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n`\n successful elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, -3, 4, -1 ];\n > var bool = someBy( arr, 2, negative )\n true\n\n See Also\n --------\n anyBy, everyBy, forEach, noneBy, someByAsync, someByRight\n",
"someByAsync": "\nsomeByAsync( collection, n, [options,] predicate, done )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon receiving `n` non-falsy `result`\n values and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nsomeByAsync.factory( [options,] predicate )\n Returns a function which tests whether a collection contains at least `n`\n elements which pass a test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = someByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, 2, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, 2, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByAsync, everyByAsync, forEachAsync, noneByAsync, someBy, someByRightAsync\n",
"someByRight": "\nsomeByRight( collection, n, predicate[, thisArg ] )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon finding `n` successful elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n`\n successful elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ -1, 1, -2, 3, 4 ];\n > var bool = someByRight( arr, 2, negative )\n true\n\n See Also\n --------\n anyByRight, everyByRight, forEachRight, noneByRight, someBy, someByRightAsync\n",
"someByRightAsync": "\nsomeByRightAsync( collection, n, [options,] predicate, done )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon receiving `n` non-falsy `result`\n values and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nsomeByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether a collection contains at least `n`\n elements which pass a test implemented by a predicate function, iterating\n from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = someByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, 2, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, 2, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByRightAsync, everyByRightAsync, forEachRightAsync, noneByRightAsync, someByAsync, someByRight\n",
"SOTU": "\nSOTU( [options] )\n Returns State of the Union (SOTU) addresses.\n\n Each State of the Union address is represented by an object with the\n following fields:\n\n - year: speech year\n - name: President name\n - party: the President's political party\n - text: speech text\n\n The following political parties are recognized:\n\n - Democratic\n - Republican\n - Democratic-Republican\n - Federalist\n - National Union\n - Whig\n - Whig & Democratic\n - none\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.name: String|Array<string> (optional)\n President name(s).\n\n options.party: String|Array<string> (optional)\n Political party (or parties).\n\n options.year: integer|Array<integer> (optional)\n Year(s).\n\n options.range: Array<integer> (optional)\n Two-element array specifying a year range.\n\n Returns\n -------\n out: Array<Object>\n State of the Union addresses.\n\n Examples\n --------\n > var out = SOTU()\n [ {...}, {...}, ... ]\n\n // Retrieve addresses by one or more Presidents...\n > var opts = { 'name': 'Barack Obama' };\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n // Retrieve addresses by one or more political parties...\n > opts = { 'party': [ 'Democratic', 'Federalist' ] };\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n // Retrieve addresses from one or more years...\n > opts = { 'year': [ 2008, 2009, 2011 ] };\n > out = SOTU( opts )\n [ {...}, {...}, {...} ]\n\n // Retrieve addresses from a range of consecutive years...\n > opts = { 'range': [ 2008, 2016 ] }\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n",
"SPACHE_REVISED": "\nSPACHE_REVISED()\n Returns a list of simple American-English words (revised Spache).\n\n Returns\n -------\n out: Array<string>\n List of simple American-English words.\n\n Examples\n --------\n > var list = SPACHE_REVISED()\n [ 'a', 'able', 'about', 'above', ... ]\n\n References\n ----------\n - Spache, George. 1953. \"A New Readability Formula for Primary-Grade Reading\n Materials.\" *The Elementary School Journal* 53 (7): 410–13. doi:10.1086/\n 458513.\n - Klare, George R. 1974. \"Assessing Readability.\" *Reading Research\n Quarterly* 10 (1). Wiley, International Reading Association: 62–102.\n <http://www.jstor.org/stable/747086>.\n - Stone, Clarence R. 1956. \"Measuring Difficulty of Primary Reading\n Material: A Constructive Criticism of Spache's Measure.\" *The Elementary\n School Journal* 57 (1). University of Chicago Press: 36–41.\n <http://www.jstor.org/stable/999700>.\n - Perera, Katherine. 2012. \"The assessment of linguistic difficulty in\n reading material.\" In *Linguistics and the Teacher*, edited by Ronald\n Carter, 101–13. Routledge Library Editions: Education. Taylor & Francis.\n <https://books.google.com/books?id=oNXFQ9Gn6XIC>.\n\n",
"SPAM_ASSASSIN": "\nSPAM_ASSASSIN()\n Returns the Spam Assassin public mail corpus.\n\n Each array element has the following fields:\n\n - id: message id (relative to message group)\n - group: message group\n - checksum: object containing checksum info\n - text: message text (including headers)\n\n The message group may be one of the following:\n\n - easy-ham-1: easier to detect non-spam e-mails (2500 messages)\n - easy-ham-2: easier to detect non-spam e-mails collected at a later date\n (1400 messages)\n - hard-ham-1: harder to detect non-spam e-mails (250 messages)\n - spam-1: spam e-mails (500 messages)\n - spam-2: spam e-mails collected at a later date (1396 messages)\n\n The checksum object contains the following fields:\n\n - type: checksum type (e.g., MD5)\n - value: checksum value\n\n Returns\n -------\n out: Array<Object>\n Corpus.\n\n Examples\n --------\n > var data = SPAM_ASSASSIN()\n [ {...}, {...}, ... ]\n\n",
"SparklineBase": "\nSparklineBase( [data,] [options] )\n Returns a Sparkline instance.\n\n This constructor is a base Sparkline constructor from which constructors\n tailored to generating particular types of Sparkline graphics should be\n derived.\n\n At a minimum, descendants should implement a private `_render()` method\n which will be automatically invoked by the public `render()` method.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Sparkline data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Sparkline data.\n\n options.description: string (optional)\n Sparkline description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n sparkline: Sparkline\n Sparkline instance.\n\n sparkline.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n sparkline.bufferSize\n Data buffer size.\n\n sparkline.description\n Sparkline description.\n\n sparkline.data\n Sparkline data.\n\n sparkline.label\n Data label.\n\n sparkline.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n sparkline.render()\n Renders a sparkline. This method calls `_render()` which must be\n implemented by instances and child classes. The default behavior is\n throw an error.\n\n Examples\n --------\n > var sparkline = new SparklineBase()\n <Sparkline>\n\n // Provide sparkline data at instantiation:\n > var data = [ 1, 2, 3 ];\n > sparkline = new SparklineBase( data )\n <Sparkline>\n\n See Also\n --------\n plot, Plot, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeWinLossChartSparkline\n",
"splitStream": "\nsplitStream( [options] )\n Returns a transform stream which splits streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream.Default: /\\r?\\n/.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = splitStream();\n > s.write( 'a\\nb\\nc' );\n > s.end();\n\n\nsplitStream.factory( [options] )\n Returns a function for creating transform streams for splitting streamed\n data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream. Default: /\\r?\\n/.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream: Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = splitStream.factory( opts );\n > var s = createStream();\n > s.write( 'a\\nb\\nc' );\n > s.end();\n\n\nsplitStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream for splitting streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream. Default: /\\r?\\n/.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = splitStream.objectMode();\n > s.write( 'a\\nb\\c' );\n > s.end();\n\n See Also\n --------\n joinStream\n",
"SQRT_EPS": "\nSQRT_EPS\n Square root of double-precision floating-point epsilon.\n\n Examples\n --------\n > SQRT_EPS\n 0.14901161193847656e-7\n\n See Also\n --------\n EPS\n",
"SQRT_HALF": "\nSQRT_HALF\n Square root of `1/2`.\n\n Examples\n --------\n > SQRT_HALF\n 0.7071067811865476\n\n See Also\n --------\n LN_HALF\n",
"SQRT_HALF_PI": "\nSQRT_HALF_PI\n Square root of the mathematical constant `π` divided by `2`.\n\n Examples\n --------\n > SQRT_HALF_PI\n 1.2533141373155003\n\n See Also\n --------\n PI\n",
"SQRT_PHI": "\nSQRT_PHI\n Square root of the golden ratio.\n\n Examples\n --------\n > SQRT_PHI\n 1.272019649514069\n\n See Also\n --------\n PHI\n",
"SQRT_PI": "\nSQRT_PI\n Square root of the mathematical constant `π`.\n\n Examples\n --------\n > SQRT_PI\n 1.7724538509055160\n\n See Also\n --------\n PI\n",
"SQRT_THREE": "\nSQRT_THREE\n Square root of `3`.\n\n Examples\n --------\n > SQRT_THREE\n 1.7320508075688772\n\n",
"SQRT_TWO": "\nSQRT_TWO\n Square root of `2`.\n\n Examples\n --------\n > SQRT_TWO\n 1.4142135623730951\n\n See Also\n --------\n LN2\n",
"SQRT_TWO_PI": "\nSQRT_TWO_PI\n Square root of the mathematical constant `π` times `2`.\n\n Examples\n --------\n > SQRT_TWO_PI\n 2.5066282746310007\n\n See Also\n --------\n TWO_PI\n",
"Stack": "\nStack()\n Stack constructor.\n\n A stack is also referred to as a \"last-in-first-out\" queue.\n\n Returns\n -------\n stack: Object\n Stack data structure.\n\n stack.clear: Function\n Clears the stack.\n\n stack.first: Function\n Returns the \"newest\" stack value (i.e., the value which is \"first-out\").\n If the stack is empty, the returned value is `undefined`.\n\n stack.iterator: Function\n Returns an iterator for iterating over a stack. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from stack mutation during\n iteration, a returned iterator **always** iterates over a stack\n \"snapshot\", which is defined as the list of stack elements at the time\n of the method's invocation.\n\n stack.last: Function\n Returns the \"oldest\" stack value (i.e., the value which is \"last-out\").\n If the stack is empty, the returned value is `undefined`.\n\n stack.length: integer\n Stack length.\n\n stack.pop: Function\n Removes and returns the current \"first-out\" value from the stack. If the\n stack is empty, the returned value is `undefined`.\n\n stack.push: Function\n Adds a value to the stack.\n\n stack.toArray: Function\n Returns an array of stack values.\n\n stack.toJSON: Function\n Serializes a stack as JSON.\n\n Examples\n --------\n > var s = Stack();\n > s.push( 'foo' ).push( 'bar' );\n > s.length\n 2\n > s.pop()\n 'bar'\n > s.length\n 1\n > s.pop()\n 'foo'\n > s.length\n 0\n\n See Also\n --------\n FIFO\n",
"startcase": "\nstartcase( str )\n Capitalizes the first letter of each word in an input `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String containing words where each first letter is capitalized.\n\n Examples\n --------\n > var out = startcase( 'beep boop' )\n 'Beep Boop'\n\n See Also\n --------\n lowercase, uppercase\n",
"startsWith": "\nstartsWith( str, search[, position] )\n Tests if a `string` starts with the characters of another `string`.\n\n If provided an empty `search` string, the function always returns `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string\n Search string.\n\n position: integer (optional)\n Position at which to start searching for `search`. If less than `0`, the\n start position is determined relative to the end of the input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a `string` starts with the characters of\n another `string`.\n\n Examples\n --------\n > var bool = startsWith( 'Beep', 'Be' )\n true\n > bool = startsWith( 'Beep', 'ep' )\n false\n > bool = startsWith( 'Beep', 'ee', 1 )\n true\n > bool = startsWith( 'Beep', 'ee', -3 )\n true\n > bool = startsWith( 'Beep', '' )\n true\n\n See Also\n --------\n endsWith\n",
"STOPWORDS_EN": "\nSTOPWORDS_EN()\n Returns a list of English stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = STOPWORDS_EN()\n [ 'a', 'about', 'above', 'across', ... ]\n\n",
"string2buffer": "\nstring2buffer( str[, encoding] )\n Allocates a buffer containing a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n encoding: string (optional)\n Character encoding. Default: 'utf8'.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = string2buffer( 'beep boop' )\n <Buffer>\n > b = string2buffer( '7468697320697320612074c3a97374', 'hex' );\n > b.toString()\n 'this is a tést'\n\n See Also\n --------\n Buffer, array2buffer, arraybuffer2buffer, copyBuffer\n",
"sub2ind": "\nsub2ind( shape, ...subscript[, options] )\n Converts subscripts to a linear index.\n\n Parameters\n ----------\n shape: ArrayLike\n Array shape.\n\n subscript: ...integer\n Subscripts.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Specifies whether an array is row-major (C-style) or column-major\n (Fortran style). Default: 'row-major'.\n\n options.mode: string|Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If\n equal to 'throw', the function throws an error when a subscript exceeds\n array dimensions. If equal to 'wrap', the function wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', the function sets subscripts exceeding array dimensions to\n either `0` (minimum index) or the maximum index along a particular\n dimension. If provided a mode array, each array element specifies the\n mode for a corresponding array dimension. If provided fewer modes than\n dimensions, the function recycles modes using modulo arithmetic.\n Default: [ 'throw' ].\n\n Returns\n -------\n idx: integer\n Linear index.\n\n Examples\n --------\n > var d = [ 3, 3, 3 ];\n > var idx = sub2ind( d, 1, 2, 2 )\n 17\n\n See Also\n --------\n array, ndarray, ind2sub\n",
"SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK": "\nSUTHAHARAN_MULTI_HOP_SENSOR_NETWORK()\n Returns a dataset consisting of labeled wireless sensor network data set\n collected from a multi-hop wireless sensor network deployment using TelosB\n motes.\n\n Humidity and temperature measurements were collected at 5 second intervals\n over a six hour period on July 10, 2010.\n\n Temperature is in degrees Celsius.\n\n Humidity is temperature corrected relative humidity, ranging from 0-100%.\n\n The label '0' denotes normal data, and the label '1' denotes an introduced\n event.\n\n If a mote was an indoor sensor, the corresponding indicator is '1'. If a\n mote was an outdoor sensor, the indoor indicator is '0'.\n\n Returns\n -------\n out: Array<Object>\n Sensor data.\n\n Examples\n --------\n > var data = SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK()\n [{...}, {...}, ...]\n\n References\n ----------\n - Suthaharan, Shan, Mohammed Alzahrani, Sutharshan Rajasegarar, Christopher\n Leckie, and Marimuthu Palaniswami. 2010. \"Labelled data collection for\n anomaly detection in wireless sensor networks.\" In _Proceedings of the Sixth\n International Conference on Intelligent Sensors, Sensor Networks and\n Information Processing (ISSNIP 2010)_. Brisbane, Australia: IEEE.\n\n * If you use the data for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK\n",
"SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK": "\nSUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK()\n Returns a dataset consisting of labeled wireless sensor network data set\n collected from a simple single-hop wireless sensor network deployment using\n TelosB motes.\n\n Humidity and temperature measurements were collected at 5 second intervals\n over a six hour period on May 9, 2010.\n\n Temperature is in degrees Celsius.\n\n Humidity is temperature corrected relative humidity, ranging from 0-100%.\n\n The label '0' denotes normal data, and the label '1' denotes an introduced\n event.\n\n If a mote was an indoor sensor, the corresponding indicator is '1'. If a\n mote was an outdoor sensor, the indoor indicator is '0'.\n\n Returns\n -------\n out: Array<Object>\n Sensor data.\n\n Examples\n --------\n > var data = SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK()\n [{...}, {...}, ...]\n\n References\n ----------\n - Suthaharan, Shan, Mohammed Alzahrani, Sutharshan Rajasegarar, Christopher\n Leckie, and Marimuthu Palaniswami. 2010. \"Labelled data collection for\n anomaly detection in wireless sensor networks.\" In _Proceedings of the Sixth\n International Conference on Intelligent Sensors, Sensor Networks and\n Information Processing (ISSNIP 2010)_. Brisbane, Australia: IEEE.\n\n * If you use the data for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK\n",
"Symbol": "\nSymbol( [description] )\n Returns a symbol.\n\n Unlike conventional constructors, this function does **not** support the\n `new` keyword.\n\n This function is only supported in environments which support symbols.\n\n Parameters\n ----------\n description: string (optional)\n Symbol description which can be used for debugging but not to access the\n symbol itself.\n\n Returns\n -------\n out: symbol\n Symbol.\n\n Examples\n --------\n > var s = ( Symbol ) ? Symbol( 'beep' ) : null\n\n",
"tabulate": "\ntabulate( collection )\n Generates a frequency table.\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to tabulate. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n Returns\n -------\n out: Array<Array>|Array\n Frequency table.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'beep' ];\n > var out = tabulate( collection )\n [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n\n See Also\n --------\n countBy, groupBy, tabulateBy\n",
"tabulateBy": "\ntabulateBy( collection, [options,] indicator )\n Generates a frequency table according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to tabulate. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n Returns\n -------\n out: Array<Array>|Array\n Frequency table.\n\n Examples\n --------\n > function indicator( value ) { return value[ 0 ]; };\n > var collection = [ 'beep', 'boop', 'foo', 'beep' ];\n > var out = tabulateBy( collection, indicator )\n [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n\n See Also\n --------\n countBy, groupBy, tabulate\n",
"tabulateByAsync": "\ntabulateByAsync( collection, [options,] indicator, done )\n Generates a frequency table according to an indicator function.\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty array as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even': 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, indicator, done )\n 750\n 1000\n 2500\n 3000\n [ [ 'odd', 2, 0.5 ], [ 'even', 2, 0.5 ] ]\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n 750\n [ [ 'odd', 2, 0.5 ], [ 'even', 2, 0.5 ] ]\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n\n\ntabulateByAsync.factory( [options,] indicator )\n Returns a function which generates a frequency table according to an\n indicator function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n Returns\n -------\n out: Function\n A function which generates a frequency table according to an indicator\n function.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = tabulateByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n > arr = [ 2000, 1500, 1000, 750 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n\n See Also\n --------\n countByAsync, groupByAsync, tabulateBy\n",
"tic": "\ntic()\n Returns a high-resolution time.\n\n The returned array has the following format: `[seconds, nanoseconds]`.\n\n Returns\n -------\n out: Array<integer>\n High resolution time.\n\n Examples\n --------\n > var t = tic()\n [ <number>, <number> ]\n\n See Also\n --------\n toc\n",
"timeit": "\ntimeit( code, [options,] clbk )\n Times a snippet.\n\n If the `asynchronous` option is set to `true`, the implementation assumes\n that `before`, `after`, and `code` snippets are all asynchronous.\n Accordingly, these snippets should invoke a `next( [error] )` callback\n once complete. The implementation wraps the snippet within a function\n accepting two arguments: `state` and `next`.\n\n The `state` parameter is simply an empty object which allows the `before`,\n `after`, and `code` snippets to share state.\n\n Notes:\n\n - Snippets always run in strict mode.\n - Always verify results. Doing so prevents the compiler from performing dead\n code elimination and other optimization techniques, which would render\n timing results meaningless.\n - Executed code is not sandboxed and has access to the global state. You are\n strongly advised against timing untrusted code. To time untrusted code,\n do so in an isolated environment (e.g., a separate process with restricted\n access to both global state and the host environment).\n - Wrapping asynchronous code does add overhead, but, in most cases, the\n overhead should be negligible compared to the execution cost of the timed\n snippet.\n - When the `asynchronous` options is `true`, ensure that the main `code`\n snippet is actually asynchronous. If a snippet releases the zalgo, an\n error complaining about exceeding the maximum call stack size is highly\n likely.\n - While many benchmark frameworks calculate various statistics over raw\n timing results (e.g., mean and standard deviation), do not do this.\n Instead, consider the fastest time an approximate lower bound for how fast\n an environment can execute a snippet. Slower times are more likely\n attributable to other processes interfering with timing accuracy rather\n than attributable to variability in JavaScript's speed. In which case, the\n minimum time is most likely the only result of interest. When considering\n all raw timing results, apply common sense rather than statistics.\n\n Parameters\n ----------\n code: string\n Snippet to time.\n\n options: Object (optional)\n Options.\n\n options.before: string (optional)\n Setup code. Default: `''`.\n\n options.after: string (optional)\n Cleanup code. Default: `''`.\n\n options.iterations: integer|null (optional)\n Number of iterations. If `null`, the number of iterations is determined\n by trying successive powers of `10` until the total time is at least\n `0.1` seconds. Default: `1e6`.\n\n options.repeats: integer (optional)\n Number of repeats. Default: `3`.\n\n options.asynchronous: boolean (optional)\n Boolean indicating whether a snippet is asynchronous. Default: `false`.\n\n clbk: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > var code = 'var x = Math.pow( Math.random(), 3 );';\n > code += 'if ( x !== x ) {';\n > code += 'throw new Error( \\'Something went wrong.\\' );';\n > code += '}';\n > function done( error, results ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.dir( results );\n ... };\n > timeit( code, done )\n e.g.,\n {\n \"iterations\": 1000000,\n \"repeats\": 3,\n \"min\": [ 0, 135734733 ], // [seconds,nanoseconds]\n \"elapsed\": 0.135734733, // seconds\n \"rate\": 7367311.062526641, // iterations/second\n \"times\": [ // raw timing results\n [ 0, 145641393 ],\n [ 0, 135734733 ],\n [ 0, 140462721 ]\n ]\n }\n\n",
"tmpdir": "\ntmpdir()\n Returns the directory for storing temporary files.\n\n Returns\n -------\n dir: string\n Directory for temporary files.\n\n Examples\n --------\n > var dir = tmpdir()\n e.g., '/path/to/temporary/files/directory'\n\n See Also\n --------\n configdir, homedir\n",
"toc": "\ntoc( time )\n Returns a high-resolution time difference, where `time` is a two-element\n array with format `[seconds, nanoseconds]`.\n\n Similar to `time`, the returned array has format `[seconds, nanoseconds]`.\n\n Parameters\n ----------\n time: Array<integer>\n High-resolution time.\n\n Returns\n -------\n out: Array<integer>\n High resolution time difference.\n\n Examples\n --------\n > var start = tic();\n > var delta = toc( start )\n [ <number>, <number> ]\n\n See Also\n --------\n tic\n",
"tokenize": "\ntokenize( str[, keepWhitespace] )\n Tokenizes a string.\n\n To include whitespace characters (spaces, tabs, line breaks) in the output\n array, set `keepWhitespace` to `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n keepWhitespace: boolean (optional)\n Boolean indicating whether whitespace characters should be returned as\n part of the token array. Default: `false`.\n\n Returns\n -------\n out: Array\n Array of tokens.\n\n Examples\n --------\n > var out = tokenize( 'Hello Mrs. Maple, could you call me back?' )\n [ 'Hello', 'Mrs.', 'Maple', ',', 'could', 'you', 'call', 'me', 'back', '?' ]\n\n > out = tokenize( 'Hello World!', true )\n [ 'Hello', ' ', 'World', '!' ]\n\n",
"transformStream": "\ntransformStream( [options] )\n Returns a transform stream.\n\n If a transform function is not provided, the returned stream will be a\n simple pass through stream.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = transformStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ntransformStream.factory( [options] )\n Returns a function for creating transform streams.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n createStream( transform[, flush] ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = transformStream.factory( opts );\n > function fcn( chunk, enc, cb ) { cb( null, chunk.toString()+'-beep' ); };\n > var s = createStream( fcn );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ntransformStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = transformStream.objectMode();\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n\ntransformStream.ctor( [options] )\n Returns a custom transform stream constructor.\n\n If provided `transform` and `flush` options, these methods are bound to the\n constructor prototype.\n\n If not provided a transform function, the returned constructor creates\n simple pass through streams.\n\n The returned constructor accepts the same options as the constructor\n factory, *except* for the `transform` and `flush` options, which are not\n supported.\n\n Any options provided to the constructor *override* options provided to the\n constructor factory.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n ctor: Function\n Custom transform stream constructor.\n\n Examples\n --------\n > function fcn( chunk, enc, cb ) { cb( null, chunk.toString()+'-beep' ); };\n > var opts = { 'highWaterMark': 64, 'transform': fcn };\n > var customStream = transformStream.ctor( opts );\n > var s = customStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n",
"trim": "\ntrim( str )\n Trims whitespace from the beginning and end of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = trim( ' \\t\\t\\n Beep \\r\\n\\t ' )\n 'Beep'\n\n See Also\n --------\n ltrim, pad, rtrim\n",
"trycatch": "\ntrycatch( x, y )\n If a function does not throw, returns the function return value; otherwise,\n returns `y`.\n\n Parameters\n ----------\n x: Function\n Function to try invoking.\n\n y: any\n Value to return if a function throws an error.\n\n Returns\n -------\n z: any\n Either the return value of `x` or the provided argument `y`.\n\n Examples\n --------\n > function x() {\n ... if ( base.random.randu() < 0.5 ) {\n ... throw new Error( 'beep' );\n ... }\n ... return 1.0;\n ... };\n > var z = trycatch( x, -1.0 )\n <number>\n\n See Also\n --------\n trycatchAsync, trythen\n",
"trycatchAsync": "\ntrycatchAsync( x, y, done )\n If a function does not return an error, invokes a callback with the function\n result; otherwise, invokes a callback with a value `y`.\n\n A function `x` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts two arguments:\n\n - error: error object\n - result: function result\n\n The `done` callback is invoked upon function completion and is provided two\n arguments:\n\n - error: error object\n - result: either the result of `x` or the provided argument `y`\n\n If `x` invokes `clbk` with an error argument, the function invokes the\n `done` callback with both the error and the argument `y`.\n\n If `x` does not invoke `clbk` with an error argument, the function invokes\n the `done` callback with a first argument equal to `null` and the function\n `result`.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n x: Function\n Function to invoke.\n\n y: any\n Value to return if `x` returns an error.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( new Error( 'beep' ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... // process error...\n ... }\n ... console.log( result );\n ... };\n > trycatchAsync( x, 'boop', done )\n 'boop'\n\n See Also\n --------\n trycatch, trythenAsync\n",
"tryFunction": "\ntryFunction( fcn[, thisArg] )\n Wraps a function in a try/catch block.\n\n If provided an asynchronous function, the returned function only traps\n errors which occur during the current event loop tick.\n\n If a function throws a literal, the literal is serialized as a string and\n returned as an `Error` object.\n\n Parameters\n ----------\n fcn: Function\n Function to wrap.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Wrapped function.\n\n Examples\n --------\n > function fcn() { throw new Error( 'beep boop' ); };\n > var f = tryFunction( fcn );\n > var out = f();\n > out.message\n 'beep boop'\n\n",
"tryRequire": "\ntryRequire( id )\n Wraps `require` in a `try/catch` block.\n\n This function traps and returns any errors encountered when attempting to\n require a module.\n\n Use caution when attempting to resolve a relative path or a local module.\n This function attempts to resolve a module from its current path. Thus, the\n function is unable to resolve anything which is not along its search path.\n For local requires, use an absolute file path.\n\n Parameters\n ----------\n id: string\n Module id.\n\n Returns\n -------\n out: any|Error\n Resolved module or an `Error`.\n\n Examples\n --------\n > var out = tryRequire( '_unknown_module_id_' )\n <Error>\n\n",
"trythen": "\ntrythen( x, y )\n If a function does not throw, returns the function return value; otherwise,\n returns the value returned by a second function `y`.\n\n The function `y` is provided a single argument:\n\n - error: the error thrown by `x`\n\n Parameters\n ----------\n x: Function\n Function to try invoking.\n\n y: Function\n Function to invoke if an initial function throws an error.\n\n Returns\n -------\n z: any\n The return value of either `x` or `y`.\n\n Examples\n --------\n > function x() {\n ... if ( base.random.randu() < 0.5 ) {\n ... throw new Error( 'beep' );\n ... }\n ... return 1.0;\n ... };\n > function y() {\n ... return -1.0;\n ... };\n > var z = trythen( x, y )\n <number>\n\n See Also\n --------\n trycatch, trythenAsync\n",
"trythenAsync": "\ntrythenAsync( x, y, done )\n If a function does not return an error, invokes a callback with the function\n result; otherwise, invokes a second function `y`.\n\n A function `x` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the function invokes a `done` callback with\n its first argument as `null` and all other provided arguments.\n\n If the error argument is truthy, the function invokes a function `y`. The\n number of arguments provided to `y` depends on the function's length. If `y`\n is a unary function, `y` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n Otherwise, `y` is provided two arguments:\n\n - error: the error from `x`\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the `done` callback is invoked with its\n first argument equal to `null` and all other arguments provided by `y`.\n\n If the error argument is truthy, the `done` callback is invoked with only\n the error argument provided by `y`.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n x: Function\n Function to invoke.\n\n y: Function\n Function to invoke if `x` returns an error.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( new Error( 'beep' ) );\n ... }\n ... };\n > function y( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'boop' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > trythenAsync( x, y, done )\n 'boop'\n\n See Also\n --------\n trycatchAsync, trythen\n",
"ttest": "\nttest( x[, y][, options] )\n Computes a one-sample or paired Student's t test.\n\n When no `y` is supplied, the function performs a one-sample t-test for the\n null hypothesis that the data in array or typed array `x` is drawn from a\n normal distribution with mean zero and unknown variance.\n\n When array or typed array `y` is supplied, the function tests whether the\n differences `x - y` come from a normal distribution with mean zero and\n unknown variance via the paired t-test.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n Data array.\n\n y: Array<number> (optional)\n Paired data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.mu: number (optional)\n Hypothesized true mean under the null hypothesis. Set this option to\n test whether the data comes from a distribution with the specified `mu`.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed mean under H0 (or difference in means when `y` is supplied).\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.df: number\n Degrees of freedom.\n\n out.mean: number\n Sample mean of `x` or `x - y`, respectively.\n\n out.sd: number\n Standard error of the mean.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // One-sample t-test:\n > var rnorm = base.random.normal.factory( 0.0, 2.0, { 'seed': 5776 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... }\n > var out = ttest( x )\n {\n rejected: false,\n pValue: ~0.722,\n statistic: ~0.357,\n ci: [~-0.333,~0.479],\n // ...\n }\n\n // Paired t-test:\n > rnorm = base.random.normal.factory( 1.0, 2.0, { 'seed': 786 });\n > x = new Array( 100 );\n > var y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... y[ i ] = rnorm();\n ... }\n > out = ttest( x, y )\n {\n rejected: false,\n pValue: ~0.191,\n statistic: ~1.315,\n ci: [ ~-0.196, ~0.964 ],\n // ...\n }\n\n // Print formatted output:\n > var table = out.print()\n Paired t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.1916\n statistic: 1.3148\n df: 99\n 95% confidence interval: [-0.1955,0.9635]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose custom significance level:\n > arr = [ 2, 4, 3, 1, 0 ];\n > out = ttest( arr, { 'alpha': 0.01 });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is not equal to 0\n\n pValue: 0.0474\n statistic: 2.8284\n df: 4\n 99% confidence interval: [-1.2556,5.2556]\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n // Test for a mean equal to five:\n > var arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'mu': 5 })\n {\n rejected: false,\n pValue: 1,\n statistic: 0,\n ci: [ ~3.758, ~6.242 ],\n // ...\n }\n\n // Perform one-sided tests:\n > arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'alternative': 'less' });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is less than 0\n\n pValue: 0.9998\n statistic: 11.1803\n df: 4\n 95% confidence interval: [-Infinity,5.9534]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n > out = ttest( arr, { 'alternative': 'greater' });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is greater than 0\n\n pValue: 0.0002\n statistic: 11.1803\n df: 4\n 95% confidence interval: [4.0466,Infinity]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n See Also\n --------\n ttest2\n",
"ttest2": "\nttest2( x, y[, options] )\n Computes a two-sample Student's t test.\n\n By default, the function performs a two-sample t-test for the null\n hypothesis that the data in arrays or typed arrays `x` and `y` is\n independently drawn from normal distributions with equal means.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.difference: number (optional)\n Number denoting the difference in means under the null hypothesis.\n Default: `0`.\n\n options.variance: string (optional)\n String indicating if the test should be conducted under the assumption\n that the unknown variances of the normal distributions are `equal` or\n `unequal`. As a default choice, the function carries out the Welch test\n (using the Satterthwaite approximation for the degrees of freedom),\n which does not have the requirement that the variances of the underlying\n distributions are equal. If the equal variances assumption seems\n warranted, set the option to `equal`. Default: `unequal`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed difference in means under H0.\n\n out.xmean: number\n Sample mean of `x`.\n\n out.ymean: number\n Sample mean of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.df: number\n Degrees of freedom.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Student's sleep data:\n > var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ];\n > var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ];\n > var out = ttest2( x, y )\n {\n rejected: false,\n pValue: ~0.079,\n statistic: ~-1.861,\n ci: [ ~-3.365, ~0.205 ],\n // ...\n }\n\n // Print table output:\n > var table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 95% confidence interval: [-3.3655,0.2055]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose a different significance level than `0.05`:\n > out = ttest2( x, y, { 'alpha': 0.1 });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 90% confidence interval: [-3.0534,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 10% significance level\n\n // Perform one-sided tests:\n > out = ttest2( x, y, { 'alternative': 'less' });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is less than 0\n\n pValue: 0.0397\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-Infinity,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n > out = ttest2( x, y, { 'alternative': 'greater' });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is greater than 0\n\n pValue: 0.9603\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-3.0534,Infinity]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Run tests with equal variances assumption:\n > x = [ 2, 3, 1, 4 ];\n > y = [ 1, 2, 3, 1, 2, 5, 3, 4 ];\n > out = ttest2( x, y, { 'variance': 'equal' });\n > table = out.print()\n Two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.8848\n statistic: -0.1486\n df: 10\n 95% confidence interval: [-1.9996,1.7496]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Test for a difference in means besides zero:\n > var rnorm = base.random.normal.factory({ 'seed': 372 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm( 2.0, 3.0 );\n ... }\n > y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... y[ i ] = rnorm( 1.0, 3.0 );\n ... }\n > out = ttest2( x, y, { 'difference': 1.0, 'variance': 'equal' })\n {\n rejected: false,\n pValue: ~0.642,\n statistic: ~-0.466,\n ci: [ ~-0.0455, ~1.646 ],\n // ...\n }\n\n See Also\n --------\n ttest\n",
"TWO_PI": "\nTWO_PI\n The mathematical constant `π` times `2`.\n\n Examples\n --------\n > TWO_PI\n 6.283185307179586\n\n See Also\n --------\n PI\n",
"typedarray": "\ntypedarray( [dtype] )\n Creates a typed array.\n\n The function supports the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n The default typed array data type is `float64`.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray()\n <Float64Array>\n > arr = typedarray( 'float32' )\n <Float32Array>\n\n\ntypedarray( length[, dtype] )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarray( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarray( typedarray[, dtype] )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( obj[, dtype] )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( buffer[, byteOffset[, length]][, dtype] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = typedarray( buf, 0, 4, 'float32' )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n See Also\n --------\n Float64Array, Float32Array, Int32Array, Uint32Array, Int16Array, Uint16Array, Int8Array, Uint8Array, Uint8ClampedArray\n",
"typedarray2json": "\ntypedarray2json( arr )\n Returns a JSON representation of a typed array.\n\n The following typed array types are supported:\n\n - Float64Array\n - Float32Array\n - Int32Array\n - Uint32Array\n - Int16Array\n - Uint16Array\n - Int8Array\n - Uint8Array\n - Uint8ClampedArray\n\n The returned JSON object has the following properties:\n\n - type: typed array type\n - data: typed array data as a generic array\n\n The implementation supports custom typed arrays and sets the `type` field to\n the closest known typed array type.\n\n Parameters\n ----------\n arr: TypedArray\n Typed array to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var arr = new Float64Array( 2 );\n > arr[ 0 ] = 5.0;\n > arr[ 1 ] = 3.0;\n > var json = typedarray2json( arr )\n { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n\n See Also\n --------\n reviveTypedArray\n",
"typedarrayComplexCtors": "\ntypedarrayComplexCtors( dtype )\n Returns a complex typed array constructor.\n\n The function returns constructors for the following data types:\n\n - complex64: single-precision floating-point complex numbers.\n - complex128: double-precision floating-point complex numbers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Complex typed array constructor.\n\n Examples\n --------\n > var ctor = typedarrayComplexCtors( 'complex64' )\n <Function>\n > ctor = typedarrayComplexCtors( 'float32' )\n null\n\n See Also\n --------\n arrayCtors, typedarrayCtors\n",
"typedarrayComplexDataTypes": "\ntypedarrayComplexDataTypes()\n Returns a list of complex typed array data types.\n\n The output array contains the following data types:\n\n - complex64: single-precision floating-point complex numbers.\n - complex128: double-precision floating-point complex numbers.\n\n Returns\n -------\n out: Array<string>\n List of complex typed array data types.\n\n Examples\n --------\n > var out = typedarrayComplexDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, typedarrayDataTypes, ndarrayDataTypes\n",
"typedarrayCtors": "\ntypedarrayCtors( dtype )\n Returns a typed array constructor.\n\n The function returns constructors for the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Typed array constructor.\n\n Examples\n --------\n > var ctor = typedarrayCtors( 'float64' )\n <Function>\n > ctor = typedarrayCtors( 'float' )\n null\n\n See Also\n --------\n arrayCtors\n",
"typedarrayDataTypes": "\ntypedarrayDataTypes()\n Returns a list of typed array data types.\n\n The output array contains the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of typed array data types.\n\n Examples\n --------\n > var out = typedarrayDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, ndarrayDataTypes\n",
"typedarraypool": "\ntypedarraypool( [dtype] )\n Returns an uninitialized typed array from a typed array memory pool.\n\n Memory is **uninitialized**, which means that the contents of a returned\n typed array may contain sensitive contents.\n\n The function supports the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n The default typed array data type is `float64`.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool()\n <Float64Array>[]\n > arr = typedarraypool( 'float32' )\n <Float32Array>[]\n\n\ntypedarraypool( length[, dtype] )\n Returns an uninitialized typed array having a specified length from a typed\n array memory pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > arr = typedarraypool( 5, 'int32' )\n <Int32Array>\n\n\ntypedarraypool( typedarray[, dtype] )\n Creates a pooled typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = typedarraypool( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarraypool( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool( obj[, dtype] )\n Creates a pooled typed array from an array-like object.\n\n Parameters\n ----------\n obj: Object\n Array-like object from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarraypool( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.malloc( [dtype] )\n Returns an uninitialized typed array from a typed array memory pool.\n\n This method shares the same security vulnerabilities mentioned above.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.malloc()\n <Float64Array>\n > arr = typedarraypool.malloc( 'float32' )\n <Float32Array>\n\n\ntypedarraypool.malloc( length[, dtype] )\n Returns a typed array having a specified length from a typed array memory\n pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.malloc( 5 )\n <Float64Array>\n > arr = typedarraypool.malloc( 5, 'int32' )\n <Int32Array>\n\n\ntypedarraypool.malloc( typedarray[, dtype] )\n Creates a pooled typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarraypool.malloc( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.malloc( obj[, dtype] )\n Creates a pooled typed array from an array-like object.\n\n Parameters\n ----------\n obj: Object\n Array-like object from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarraypool.malloc( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.calloc( [dtype] )\n Returns a zero-initialized typed array from a typed array memory pool.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.calloc()\n <Float64Array>[]\n > arr = typedarraypool.calloc( 'float32' )\n <Float32Array>[]\n\n\ntypedarraypool.calloc( length[, dtype] )\n Returns a zero-initialized typed array having a specified length from a\n typed array memory pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.calloc( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarraypool.calloc( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarraypool.free( buf )\n Frees a typed array or typed array buffer for use in a future allocation.\n\n Parameters\n ----------\n buf: TypedArray|ArrayBuffer\n Typed array or typed array buffer to free.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.free( arr )\n\n\ntypedarraypool.clear()\n Clears the typed array pool allowing garbage collection of previously\n allocated (and currently free) array buffers.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.free( arr );\n > typedarraypool.clear()\n\n\ntypedarraypool.highWaterMark\n Read-only property returning the pool's high water mark.\n\n Once a high water mark is reached, typed array allocation fails.\n\n Examples\n --------\n > typedarraypool.highWaterMark\n\n\ntypedarraypool.nbytes\n Read-only property returning the total number of allocated bytes.\n\n The returned value is the total accumulated value. Hence, anytime a pool\n must allocate a new array buffer (i.e., more memory), the pool increments\n this value.\n\n The only time this value is decremented is when a pool is cleared.\n\n This behavior means that, while allocated buffers which are never freed may,\n in fact, be garbage collected, they continue to count against the high water\n mark limit.\n\n Accordingly, you should *always* free allocated buffers in order to prevent\n the pool from believing that non-freed buffers are continually in use.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.nbytes\n\n\ntypedarraypool.factory( [options] )\n Creates a typed array pool.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.highWaterMark: integer (optional)\n Maximum total memory (in bytes) which can be allocated.\n\n Returns\n -------\n fcn: Function\n Function for creating typed arrays from a typed array memory pool.\n\n Examples\n --------\n > var pool = typedarraypool.factory();\n > var arr1 = pool( 3, 'float64' )\n <Float64Array>\n\n See Also\n --------\n typedarray\n",
"typemax": "\ntypemax( dtype )\n Returns the maximum value of a specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var m = typemax( 'int8' )\n 127\n > m = typemax( 'uint32' )\n 4294967295\n\n See Also\n --------\n realmax, typemin\n",
"typemin": "\ntypemin( dtype )\n Returns the minimum value of a specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var m = typemin( 'int8' )\n -128\n > m = typemin( 'uint32' )\n 0\n\n See Also\n --------\n realmin, typemax\n",
"typeOf": "\ntypeOf( value )\n Determines a value's type.\n\n The following values are not natively provided in older JavaScript engines:\n\n - Map\n - Set\n - WeakMap\n - WeakSet\n - Symbol\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: string\n The value's type.\n\n Examples\n --------\n // Built-ins:\n > var t = typeOf( 'a' )\n 'string'\n > t = typeOf( 5 )\n 'number'\n > t = typeOf( NaN )\n 'number'\n > t = typeOf( true )\n 'boolean'\n > t = typeOf( false )\n 'boolean'\n > t = typeOf( null )\n 'null'\n > t = typeOf( undefined )\n 'undefined'\n > t = typeOf( [] )\n 'array'\n > t = typeOf( {} )\n 'object'\n > t = typeOf( function noop() {} )\n 'function'\n > t = typeOf( Symbol( 'beep' ) )\n 'symbol'\n > t = typeOf( /.+/ )\n 'regexp'\n > t = typeOf( new String( 'beep' ) )\n 'string'\n > t = typeOf( new Number( 5 ) )\n 'number'\n > t = typeOf( new Boolean( false ) )\n 'boolean'\n > t = typeOf( new Array() )\n 'array'\n > t = typeOf( new Object() )\n 'object'\n > t = typeOf( new Int8Array( 10 ) )\n 'int8array'\n > t = typeOf( new Uint8Array( 10 ) )\n 'uint8array'\n > t = typeOf( new Uint8ClampedArray( 10 ) )\n 'uint8clampedarray'\n > t = typeOf( new Int16Array( 10 ) )\n 'int16array'\n > t = typeOf( new Uint16Array( 10 ) )\n 'uint16array'\n > t = typeOf( new Int32Array( 10 ) )\n 'int32array'\n > t = typeOf( new Uint32Array( 10 ) )\n 'uint32array'\n > t = typeOf( new Float32Array( 10 ) )\n 'float32array'\n > t = typeOf( new Float64Array( 10 ) )\n 'float64array'\n > t = typeOf( new ArrayBuffer( 10 ) )\n 'arraybuffer'\n > t = typeOf( new Date() )\n 'date'\n > t = typeOf( new RegExp( '.+' ) )\n 'regexp'\n > t = typeOf( new Map() )\n 'map'\n > t = typeOf( new Set() )\n 'set'\n > t = typeOf( new WeakMap() )\n 'weakmap'\n > t = typeOf( new WeakSet() )\n 'weakset'\n > t = typeOf( new Error( 'beep' ) )\n 'error'\n > t = typeOf( new TypeError( 'beep' ) )\n 'typeerror'\n > t = typeOf( new SyntaxError( 'beep' ) )\n 'syntaxerror'\n > t = typeOf( new ReferenceError( 'beep' ) )\n 'referenceerror'\n > t = typeOf( new URIError( 'beep' ) )\n 'urierror'\n > t = typeOf( new RangeError( 'beep' ) )\n 'rangeerror'\n > t = typeOf( new EvalError( 'beep' ) )\n 'evalerror'\n > t = typeOf( Math )\n 'math'\n > t = typeOf( JSON )\n 'json'\n\n // Arguments object:\n > function beep() { return arguments; };\n > t = typeOf( beep() )\n 'arguments'\n\n // Node.js Buffer object:\n > t = typeOf( new Buffer( 10 ) )\n 'buffer'\n\n // Custom constructor:\n > function Person() { return this };\n > t = typeOf( new Person() )\n 'person'\n\n // Anonymous constructor:\n > var Foo = function () { return this; };\n > t = typeOf( new Foo() )\n '' || 'foo'\n\n See Also\n --------\n constructorName, nativeClass\n",
"UINT8_MAX": "\nUINT8_MAX\n Maximum unsigned 8-bit integer.\n\n The maximum unsigned 8-bit integer is given by `2^8 - 1`.\n\n Examples\n --------\n > UINT8_MAX\n 255\n\n See Also\n --------\n INT8_MAX\n",
"UINT8_NUM_BYTES": "\nUINT8_NUM_BYTES\n Size (in bytes) of an 8-bit unsigned integer.\n\n Examples\n --------\n > UINT8_NUM_BYTES\n 1\n\n See Also\n --------\n INT8_NUM_BYTES, UINT16_NUM_BYTES, UINT32_NUM_BYTES\n",
"Uint8Array": "\nUint8Array()\n A typed array constructor which returns a typed array representing an array\n of 8-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8Array()\n <Uint8Array>\n\n\nUint8Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 )\n <Uint8Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint8Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint8Array( arr1 )\n <Uint8Array>[ 5, 5, 5 ]\n\n\nUint8Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint8Array( arr1 )\n <Uint8Array>[ 5, 5, 5 ]\n\n\nUint8Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Uint8Array( buf, 0, 4 )\n <Uint8Array>[ 0, 0, 0, 0 ]\n\n\nUint8Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint8Array.from( [ 1, 2 ], mapFcn )\n <Uint8Array>[ 2, 4 ]\n\n\nUint8Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint8Array.of( 1, 2 )\n <Uint8Array>[ 1, 2 ]\n\n\nUint8Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint8Array.BYTES_PER_ELEMENT\n 1\n\n\nUint8Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint8Array.name\n 'Uint8Array'\n\n\nUint8Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint8Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.byteLength\n 5\n\n\nUint8Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint8Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nUint8Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.length\n 5\n\n\nUint8Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint8Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint8Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint8Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint8Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint8Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint8Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint8Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint8Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint8Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint8Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint8Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint8Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint8Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint8Array>[ 2, 4, 6 ]\n\n\nUint8Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint8Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint8Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] )\n <Uint8Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint8Array>[ 3, 2, 1 ]\n\n\nUint8Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint8Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint8Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint8Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint8Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint8Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint8Array>[ 3, 4, 5 ]\n\n\nUint8Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint8Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint8Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8ClampedArray\n",
"Uint8ClampedArray": "\nUint8ClampedArray()\n A typed array constructor which returns a typed array representing an array\n of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray()\n <Uint8ClampedArray>\n\n\nUint8ClampedArray( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 )\n <Uint8ClampedArray>[ 0, 0, 0, 0, 0 ]\n\n\nUint8ClampedArray( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint8ClampedArray( arr1 )\n <Uint8ClampedArray>[ 5, 5, 5 ]\n\n\nUint8ClampedArray( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint8ClampedArray( arr1 )\n <Uint8ClampedArray>[ 5, 5, 5 ]\n\n\nUint8ClampedArray( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Uint8ClampedArray( buf, 0, 4 )\n <Uint8ClampedArray>[ 0, 0, 0, 0 ]\n\n\nUint8ClampedArray.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn )\n <Uint8ClampedArray>[ 2, 4 ]\n\n\nUint8ClampedArray.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = Uint8ClampedArray.of( 1, 2 )\n <Uint8ClampedArray>[ 1, 2 ]\n\n\nUint8ClampedArray.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint8ClampedArray.BYTES_PER_ELEMENT\n 1\n\n\nUint8ClampedArray.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint8ClampedArray.name\n 'Uint8ClampedArray'\n\n\nUint8ClampedArray.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint8ClampedArray.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.byteLength\n 5\n\n\nUint8ClampedArray.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.byteOffset\n 0\n\n\nUint8ClampedArray.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nUint8ClampedArray.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.length\n 5\n\n\nUint8ClampedArray.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint8ClampedArray.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint8ClampedArray.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint8ClampedArray.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint8ClampedArray.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint8ClampedArray.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint8ClampedArray.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint8ClampedArray.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint8ClampedArray.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint8ClampedArray.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint8ClampedArray.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint8ClampedArray.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint8ClampedArray.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint8ClampedArray.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint8ClampedArray>[ 2, 4, 6 ]\n\n\nUint8ClampedArray.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint8ClampedArray.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint8ClampedArray.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] )\n <Uint8ClampedArray>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint8ClampedArray>[ 3, 2, 1 ]\n\n\nUint8ClampedArray.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint8ClampedArray.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint8ClampedArray.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint8ClampedArray.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint8ClampedArray>[ 0, 1, 1, 2, 2 ]\n\n\nUint8ClampedArray.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint8ClampedArray>[ 3, 4, 5 ]\n\n\nUint8ClampedArray.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint8ClampedArray.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint8ClampedArray.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array\n",
"UINT16_MAX": "\nUINT16_MAX\n Maximum unsigned 16-bit integer.\n\n The maximum unsigned 16-bit integer is given by `2^16 - 1`.\n\n Examples\n --------\n > UINT16_MAX\n 65535\n\n See Also\n --------\n INT16_MAX\n",
"UINT16_NUM_BYTES": "\nUINT16_NUM_BYTES\n Size (in bytes) of a 16-bit unsigned integer.\n\n Examples\n --------\n > UINT16_NUM_BYTES\n 2\n\n See Also\n --------\n INT16_NUM_BYTES, UINT32_NUM_BYTES, UINT8_NUM_BYTES\n",
"Uint16Array": "\nUint16Array()\n A typed array constructor which returns a typed array representing an array\n of 16-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint16Array()\n <Uint16Array>\n\n\nUint16Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 )\n <Uint16Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint16Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint16Array( arr1 )\n <Uint16Array>[ 5, 5, 5 ]\n\n\nUint16Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint16Array( arr1 )\n <Uint16Array>[ 5, 5, 5 ]\n\n\nUint16Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 8 );\n > var arr = new Uint16Array( buf, 0, 4 )\n <Uint16Array>[ 0, 0, 0, 0 ]\n\n\nUint16Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint16Array.from( [ 1, 2 ], mapFcn )\n <Uint16Array>[ 2, 4 ]\n\n\nUint16Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint16Array.of( 1, 2 )\n <Uint16Array>[ 1, 2 ]\n\n\nUint16Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint16Array.BYTES_PER_ELEMENT\n 2\n\n\nUint16Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint16Array.name\n 'Uint16Array'\n\n\nUint16Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint16Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.byteLength\n 10\n\n\nUint16Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint16Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 2\n\n\nUint16Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.length\n 5\n\n\nUint16Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint16Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint16Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint16Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint16Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint16Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint16Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint16Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint16Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint16Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint16Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint16Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint16Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint16Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint16Array>[ 2, 4, 6 ]\n\n\nUint16Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint16Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint16Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] )\n <Uint16Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint16Array>[ 3, 2, 1 ]\n\n\nUint16Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint16Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint16Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint16Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint16Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint16Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint16Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint16Array>[ 3, 4, 5 ]\n\n\nUint16Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint16Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint16Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"UINT32_MAX": "\nUINT32_MAX\n Maximum unsigned 32-bit integer.\n\n The maximum unsigned 32-bit integer is given by `2^32 - 1`.\n\n Examples\n --------\n > UINT32_MAX\n 4294967295\n\n See Also\n --------\n INT32_MAX\n",
"UINT32_NUM_BYTES": "\nUINT32_NUM_BYTES\n Size (in bytes) of a 32-bit unsigned integer.\n\n Examples\n --------\n > UINT32_NUM_BYTES\n 4\n\n See Also\n --------\n INT32_NUM_BYTES, UINT16_NUM_BYTES, UINT8_NUM_BYTES\n",
"Uint32Array": "\nUint32Array()\n A typed array constructor which returns a typed array representing an array\n of 32-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint32Array()\n <Uint32Array>\n\n\nUint32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 )\n <Uint32Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint32Array( arr1 )\n <Uint32Array>[ 5, 5, 5 ]\n\n\nUint32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint32Array( arr1 )\n <Uint32Array>[ 5, 5, 5 ]\n\n\nUint32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Uint32Array( buf, 0, 4 )\n <Uint32Array>[ 0, 0, 0, 0 ]\n\n\nUint32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint32Array.from( [ 1, 2 ], mapFcn )\n <Uint32Array>[ 2, 4 ]\n\n\nUint32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint32Array.of( 1, 2 )\n <Uint32Array>[ 1, 2 ]\n\n\nUint32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint32Array.BYTES_PER_ELEMENT\n 4\n\n\nUint32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint32Array.name\n 'Uint32Array'\n\n\nUint32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.byteLength\n 20\n\n\nUint32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nUint32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.length\n 5\n\n\nUint32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint32Array>[ 2, 4, 6 ]\n\n\nUint32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] )\n <Uint32Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint32Array>[ 3, 2, 1 ]\n\n\nUint32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint32Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint32Array>[ 3, 4, 5 ]\n\n\nUint32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint8Array, Uint8ClampedArray\n",
"umask": "\numask( [mask,] [options] )\n Returns the current process mask, if not provided a mask; otherwise, sets\n the process mask and returns the previous mask.\n\n A mask is a set of bits, each of which restricts how its corresponding\n permission is set for newly created files.\n\n On POSIX platforms, each file has a set of attributes that control who can\n read, write, or execute that file. Upon creating a file, file permissions\n must be set to an initial setting. The process mask restricts those\n permission settings.\n\n If the mask contains a bit set to \"1\", the corresponding initial file\n permission is disabled. If the mask contains a bit set to \"0\", the\n corresponding permission is left to be determined by the requesting process\n and the system.\n\n The process mask is thus a filter that removes permissions as a file is\n created; i.e., each bit set to a \"1\" removes its corresponding permission.\n\n In octal representation, a mask is a four digit number, e.g., 0077,\n comprised as follows:\n\n - 0: special permissions (setuid, setgid, sticky bit)\n - 0: (u)ser/owner permissions\n - 7: (g)roup permissions\n - 7: (o)thers/non-group permissions\n\n Octal codes correspond to the following permissions:\n\n - 0: read, write, execute\n - 1: read, write\n - 2: read, execute\n - 3: read\n - 4: write, execute\n - 5: write\n - 6: execute\n - 7: no permissions\n\n If provided fewer than four digits, the mask is left-padded with zeros.\n\n Note, however, that only the last three digits (i.e., the file permissions\n digits) of the mask are actually used when the mask is applied.\n\n Permissions can be represented using the following symbolic form:\n\n u=rwx,g=rwx,o=rwx\n\n where\n\n - u: user permissions\n - g: group permissions\n - o: other/non-group permissions\n - r: read\n - w: write\n - x: execute\n\n When setting permissions using symbolic notation, the function accepts a\n mask expression of the form:\n\n [<classes>]<operator><symbols>\n\n where \"classes\" may be a combination of\n\n - u: user\n - g: group\n - o: other/non-group\n - a: all\n\n \"symbols\" may be a combination of\n\n - r: read\n - w: write\n - x: execute\n - X: special execute\n - s: setuid/gid on execution\n - t: sticky\n\n and \"operator\" may be one of\n\n - `+`: enable\n - `-`: disable\n - `=`: enable specified and disable unspecified permissions\n\n For example,\n\n - `u-w`: disable user write permissions\n - `u+w`: enable user write permissions\n - `u=w`: enable user write permissions and disable user read and execute\n\n To specify multiple changes, provide a comma-separated list of mask\n expressions. For example,\n\n u+rwx,g-x,o=r\n\n would enable user read, write, and execute permissions, disable group\n execute permissions, enable other read permissions, and disable other\n write and execute permissions.\n\n The `a` class indicates \"all\", which is the same as specifying \"ugo\". This\n is the default class if a class is omitted when specifying permissions. For\n example, `+x` is equivalent to `a+x` which is equivalent to `ugo+x` which\n is equivalent to `u+x,g+x,o+x` and enables execution for all classes.\n\n Parameters\n ----------\n mask: integer|string (optional)\n Mask or mask expression. If the mask is a string, the mask is assumed to\n be in symbolic notation.\n\n options: Object (optional)\n Options.\n\n options.symbolic: boolean (optional)\n Boolean indicating whether to return the mask using symbolic notation.\n\n Returns\n -------\n mask: integer|string\n Process mask. If provided a mask, the returned value is the previous\n mask; otherwise, the returned value is the current process mask.\n\n Examples\n --------\n > var mask = umask()\n <number>\n > mask = umask( { 'symbolic': true } )\n <string>\n\n",
"uncapitalize": "\nuncapitalize( str )\n Lowercases the first character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Uncapitalized string.\n\n Examples\n --------\n > var out = uncapitalize( 'Beep' )\n 'beep'\n > out = uncapitalize( 'bOOp' )\n 'bOOp'\n\n See Also\n --------\n capitalize, lowercase\n",
"uncapitalizeKeys": "\nuncapitalizeKeys( obj )\n Converts the first letter of each object key to lowercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'AA': 1, 'BB': 2 };\n > var out = uncapitalizeKeys( obj )\n { 'aA': 1, 'bB': 2 }\n\n See Also\n --------\n capitalizeKeys, lowercaseKeys\n",
"uncurry": "\nuncurry( fcn[, arity, ][thisArg] )\n Transforms a curried function into a function invoked with multiple\n arguments.\n\n Parameters\n ----------\n fcn: Function\n Curried function.\n\n arity: integer (optional)\n Number of parameters.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Uncurried function.\n\n Examples\n --------\n > function addX( x ) {\n ... return function addY( y ) {\n ... return x + y;\n ... };\n ... };\n > var fcn = uncurry( addX );\n > var sum = fcn( 2, 3 )\n 5\n\n // To enforce a fixed number of parameters, provide an `arity` argument:\n > function add( x ) {\n ... return function add( y ) {\n ... return x + y;\n ... };\n ... };\n > fcn = uncurry( add, 2 );\n > sum = fcn( 9 )\n <Error>\n\n // To specify an execution context, provide a `thisArg` argument:\n > function addX( x ) {\n ... this.x = x;\n ... return addY;\n ... };\n > function addY( y ) {\n ... return this.x + y;\n ... };\n > fcn = uncurry( addX, {} );\n > sum = fcn( 2, 3 )\n 5\n\n See Also\n --------\n curry, uncurryRight\n",
"uncurryRight": "\nuncurryRight( fcn[, arity, ][thisArg] )\n Transforms a curried function into a function invoked with multiple\n arguments.\n\n Provided arguments are applied starting from the right.\n\n Parameters\n ----------\n fcn: Function\n Curried function.\n\n arity: integer (optional)\n Number of parameters.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Uncurried function.\n\n Examples\n --------\n > function addX( x ) {\n ... return function addY( y ) {\n ... return x + y;\n ... };\n ... };\n > var fcn = uncurryRight( addX );\n > var sum = fcn( 3, 2 )\n 5\n\n // To enforce a fixed number of parameters, provide an `arity` argument:\n > function add( y ) {\n ... return function add( x ) {\n ... return x + y;\n ... };\n ... };\n > fcn = uncurryRight( add, 2 );\n > sum = fcn( 9 )\n <Error>\n\n // To specify an execution context, provide a `thisArg` argument:\n > function addY( y ) {\n ... this.y = y;\n ... return addX;\n ... };\n > function addX( x ) {\n ... return x + this.y;\n ... };\n > fcn = uncurryRight( addY, {} );\n > sum = fcn( 3, 2 )\n 5\n\n See Also\n --------\n curry, curryRight, uncurry\n",
"UNICODE_MAX": "\nUNICODE_MAX\n Maximum Unicode code point.\n\n Examples\n --------\n > UNICODE_MAX\n 1114111\n\n See Also\n --------\n UNICODE_MAX_BMP\n",
"UNICODE_MAX_BMP": "\nUNICODE_MAX_BMP\n Maximum Unicode code point in the Basic Multilingual Plane (BMP).\n\n Examples\n --------\n > UNICODE_MAX_BMP\n 65535\n\n See Also\n --------\n UNICODE_MAX\n",
"UnicodeColumnChartSparkline": "\nUnicodeColumnChartSparkline( [data,] [options] )\n Returns a sparkline column chart instance.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: ColumnChart\n Column chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a column chart sparkline.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeColumnChartSparkline( data );\n > chart.render()\n '▁█▅▃▆▆▅'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeLineChartSparkline": "\nUnicodeLineChartSparkline( [data,] [options] )\n Returns a sparkline line chart instance.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: LineChart\n Line chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a line chart sparkline.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeLineChartSparkline( data );\n > chart.render()\n '⡈⠑⠢⠔⠒⠒⠒'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeSparkline": "\nUnicodeSparkline( [data,] [options] )\n Returns a Unicode sparkline instance.\n\n The following chart types are supported:\n\n - column: column chart (e.g., ▃▆▂▄▁▅▅).\n - line: line chart (e.g., ⡈⠑⠢⠔⠒⠒⠒).\n - tristate: tristate chart (e.g., ▄▀──▀▄▄▀).\n - up-down: up/down chart (e.g., ↓↑↑↑↑↓↓↑).\n - win-loss: win/loss chart (e.g., ┌╵└┴╵╷╷╵).\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.type: string (optional)\n Chart type. Default: 'column'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: ColumnChart\n Column chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a column chart sparkline.\n\n chart.type\n Chart type.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeSparkline( data );\n > chart.render()\n '▁█▅▃▆▆▅'\n > chart.type = 'line';\n > chart.render()\n '⡈⠑⠢⠔⠒⠒⠒'\n\n See Also\n --------\n plot, Plot, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeTristateChartSparkline": "\nUnicodeTristateChartSparkline( [data,] [options] )\n Returns a sparkline tristate chart instance.\n\n In a tristate chart, negative values are encoded as lower blocks, positive\n values are encoded as upper blocks, and values equal to zero are encoded as\n middle lines.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: TristateChart\n Tristate chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a tristate chart sparkline.\n\n Examples\n --------\n > var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ];\n > var chart = new UnicodeTristateChartSparkline( data );\n > chart.render()\n '▄▀──▀▄▄▀'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeUpDownChartSparkline": "\nUnicodeUpDownChartSparkline( [data,] [options] )\n Returns a sparkline up/down chart instance.\n\n Glyphs:\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 1 | ↑ |\n | -1 | ↓ |\n\n If provided any other value other than 1 or -1, the value is encoded as a\n missing value.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: UpDownChart\n Chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore any values which are not 1 or -1.\n\n chart.render()\n Renders an up/down chart sparkline.\n\n Examples\n --------\n > var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ];\n > var chart = new UnicodeUpDownChartSparkline( data );\n > chart.render()\n '↓↑↑↑↑↓↓↑'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeWinLossChartSparkline": "\nUnicodeWinLossChartSparkline( [data,] [options] )\n Returns a sparkline win/loss chart instance.\n\n Glyphs:\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 1 | ╵ |\n | -1 | ╷ |\n | 2 | └ |\n | -2 | ┌ |\n\n If a `2` or `-2` is preceded by a `2` or `-2`,\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 2 | ┴ |\n | -2 | ┬ |\n\n Based on the win/loss analogy,\n\n - 1: win away\n - 2: win at home\n - -1: loss away\n - -2: loss at home\n\n If provided any value other than 1, -1, 2, or -2, the value is encoded as a\n missing value.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: WinLossChart\n Chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore any values which are not 1, -1, 2, or -2.\n\n chart.render()\n Renders a win/loss chart sparkline.\n\n Examples\n --------\n > var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ];\n > var chart = new UnicodeWinLossChartSparkline( data );\n > chart.render()\n '┌╵└┴╵╷╷╵'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline\n",
"unlink": "\nunlink( path, clbk )\n Asynchronously removes a directory entry.\n\n If a provided path is a symbolic link, the function removes the symbolic\n link named by the path and does not affect any file or directory named by\n the contents of the symbolic link.\n\n Otherwise, the function removes the link named by the provided path and\n decrements the link count of the file referenced by the link.\n\n When a file's link count becomes 0 and no process has the file open, the\n space occupied by the file is freed and the file is no longer accessible.\n\n If one or more processes have the file open when the last link is removed,\n the link is removed before the function returns; however, the removal of\n file contents is postponed until all references to the file are closed.\n\n If the path refers to a socket, FIFO, or device, processes which have the\n object open may continue to use it.\n\n The path argument should *not* be a directory. To remove a directory, use\n rmdir().\n\n Parameters\n ----------\n path: string|Buffer|integer\n Entry path.\n\n clbk: Function\n Callback to invoke upon removing an entry.\n\n Examples\n --------\n > function done( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > unlink( './beep/boop.txt', done );\n\n\nunlink.sync( path )\n Synchronously removes a directory entry.\n\n Parameters\n ----------\n path: string|Buffer|integer\n Entry path.\n\n Returns\n -------\n out: Error|null\n Error object or null.\n\n Examples\n --------\n > var out = unlink.sync( './beep/boop.txt' );\n\n See Also\n --------\n exists\n",
"unshift": "\nunshift( collection, ...items )\n Adds one or more elements to the beginning of a collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n items: ...any\n Items to add.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = unshift( arr, 6.0, 7.0 )\n [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = unshift( arr, 3.0, 4.0 )\n <Float64Array>[ 3.0, 4.0, 1.0, 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 1, '0': 1.0 };\n > arr = unshift( arr, 2.0, 3.0 )\n { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }\n\n See Also\n --------\n pop, push, shift\n",
"until": "\nuntil( predicate, fcn[, thisArg] )\n Invokes a function until a test condition is true.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to stop invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i >= 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > until( predicate, beep )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhile, untilAsync, untilEach, whilst\n",
"untilAsync": "\nuntilAsync( predicate, fcn, done[, thisArg] )\n Invokes a function until a test condition is true.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is falsy, the function invokes `fcn`; otherwise, the\n function invokes the `done` callback.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i, clbk ) { clbk( null, i >= 5 ); };\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > untilAsync( predicate, fcn, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhileAsync, until, whileAsync\n",
"untilEach": "\nuntilEach( collection, predicate, fcn[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > untilEach( arr, predicate, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n untilEachRight, whileEach\n",
"untilEachRight": "\nuntilEachRight( collection, predicate, fcn[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > untilEachRight( arr, predicate, logger )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n\n See Also\n --------\n untilEach, whileEachRight\n",
"unzip": "\nunzip( arr[, idx] )\n Unzips a zipped array (i.e., a nested array of tuples).\n\n Parameters\n ----------\n arr: Array\n Zipped array.\n\n idx: Array<number> (optional)\n Array of indices specifying which tuple elements to unzip.\n\n Returns\n -------\n out: Array\n Array of unzipped arrays.\n\n Examples\n --------\n // Basic usage:\n > var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n > var out = unzip( arr )\n [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n\n // Provide indices:\n > arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n > out = unzip( arr, [ 0, 2 ] )\n [ [ 1, 2 ], [ 3, 4 ] ]\n\n See Also\n --------\n zip\n",
"uppercase": "\nuppercase( str )\n Converts a `string` to uppercase.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Uppercase string.\n\n Examples\n --------\n > var out = uppercase( 'bEEp' )\n 'BEEP'\n\n See Also\n --------\n capitalize, lowercase\n",
"uppercaseKeys": "\nuppercaseKeys( obj )\n Converts each object key to uppercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'a': 1, 'b': 2 };\n > var out = uppercaseKeys( obj )\n { 'A': 1, 'B': 2 }\n\n See Also\n --------\n capitalizeKeys, lowercaseKeys\n",
"US_STATES_ABBR": "\nUS_STATES_ABBR()\n Returns a list of US state two-letter abbreviations in alphabetical order\n according to state name.\n\n Returns\n -------\n out: Array<string>\n List of US state two-letter abbreviations.\n\n Examples\n --------\n > var list = US_STATES_ABBR()\n [ 'AL', 'AK', 'AZ', 'AR', ... ]\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES\n",
"US_STATES_CAPITALS": "\nUS_STATES_CAPITALS()\n Returns a list of US state capitals in alphabetical order according to state\n name.\n\n Returns\n -------\n out: Array<string>\n List of US state capitals.\n\n Examples\n --------\n > var list = US_STATES_CAPITALS()\n [ 'Montgomery', 'Juneau', 'Phoenix', ... ]\n\n See Also\n --------\n US_STATES_ABBR, US_STATES_CAPITALS_NAMES, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_CAPITALS_NAMES": "\nUS_STATES_CAPITALS_NAMES()\n Returns an object mapping US state capitals to state names.\n\n Returns\n -------\n out: Object\n An object mapping US state capitals to state names.\n\n Examples\n --------\n > var out = US_STATES_CAPITALS_NAMES()\n { 'Montgomery': 'Alabama', 'Juneau': 'Alaska', ... }\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_NAMES": "\nUS_STATES_NAMES()\n Returns a list of US state names in alphabetical order.\n\n Returns\n -------\n out: Array<string>\n List of US state names.\n\n Examples\n --------\n > var list = US_STATES_NAMES()\n [ 'Alabama', 'Alaska', 'Arizona', ... ]\n\n See Also\n --------\n US_STATES_ABBR, US_STATES_CAPITALS, US_STATES_CAPITALS_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_NAMES_CAPITALS": "\nUS_STATES_NAMES_CAPITALS()\n Returns an object mapping US state names to state capitals.\n\n Returns\n -------\n out: Object\n An object mapping US state names to state capitals.\n\n Examples\n --------\n > var out = US_STATES_NAMES_CAPITALS()\n { 'Alabama': 'Montgomery', 'Alaska': 'Juneau', ... }\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"utf16ToUTF8Array": "\nutf16ToUTF8Array( str )\n Converts a UTF-16 encoded string to an array of integers using UTF-8\n encoding.\n\n The following byte sequences are used to represent a character. The sequence\n depends on the code point:\n\n 0x00000000 - 0x0000007F:\n 0xxxxxxx\n\n 0x00000080 - 0x000007FF:\n 110xxxxx 10xxxxxx\n\n 0x00000800 - 0x0000FFFF:\n 1110xxxx 10xxxxxx 10xxxxxx\n\n 0x00010000 - 0x001FFFFF:\n 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\n The `x` bit positions correspond to code point bits.\n\n Only the shortest possible multi-byte sequence which can represent a code\n point is used.\n\n Parameters\n ----------\n str: string\n UTF-16 encoded string.\n\n Returns\n -------\n out: Array\n Array of integers.\n\n Examples\n --------\n > var str = '☃';\n > var out = utf16ToUTF8Array( str )\n [ 226, 152, 131 ]\n\n",
"vartest": "\nvartest( x, y[, options] )\n Computes a two-sample F-test for equal variances.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`.\n\n options.ratio: number (optional)\n Positive number denoting the ratio of the two population variances under\n the null hypothesis. Default: `1`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the ratio of variances.\n\n out.nullValue: number\n Assumed ratio of variances under H0.\n\n out.xvar: number\n Sample variance of `x`.\n\n out.yvar: number\n Sample variance of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.dfX: number\n Numerator degrees of freedom.\n\n out.dfY: number\n Denominator degrees of freedom.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var x = [ 610, 610, 550, 590, 565, 570 ];\n > var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ];\n > var out = vartest( x, y )\n {\n rejected: false,\n pValue: ~0.399,\n statistic: ~1.976,\n ci: [ ~0.374, ~13.542 ],\n // ...\n }\n\n // Print table output:\n > var table = out.print()\n F test for comparing two variances\n\n Alternative hypothesis: True ratio in variances is not equal to 1\n\n pValue: 0.3992\n statistic: 1.976\n variance of x: 617.5 (df of x: 5)\n variance of y: 312.5 (df of y: 7)\n 95% confidence interval: [0.3739,13.5417]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n See Also\n --------\n bartlettTest\n",
"waterfall": "\nwaterfall( fcns, clbk[, thisArg] )\n Executes functions in series, passing the results of one function as\n arguments to the next function.\n\n The last argument applied to each waterfall function is a callback. The\n callback should be invoked upon a series function completion. The first\n argument is reserved as an error argument (which can be `null`). Any results\n which should be passed to the next function in the series should be provided\n beginning with the second argument.\n\n If any function calls the provided callback with a truthy `error` argument,\n the waterfall suspends execution and immediately calls the completion\n callback for subsequent error handling.\n\n Execution is *not* guaranteed to be asynchronous. To ensure asynchrony, wrap\n the completion callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcns: Array<Function>\n Array of functions.\n\n clbk: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Function context.\n\n Examples\n --------\n > function foo( next ) { next( null, 'beep' ); };\n > function bar( str, next ) { console.log( str ); next(); };\n > function done( error ) { if ( error ) { throw error; } };\n > var fcns = [ foo, bar ];\n > waterfall( fcns, done );\n\n\nwaterfall.factory( fcns, clbk[, thisArg] )\n Returns a reusable waterfall function.\n\n Parameters\n ----------\n fcns: Array<Function>\n Array of functions.\n\n clbk: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n fcn: Function\n Waterfall function.\n\n Examples\n --------\n > function foo( next ) { next( null, 'beep' ); };\n > function bar( str, next ) { console.log( str ); next(); };\n > function done( error ) { if ( error ) { throw error; } };\n > var fcns = [ foo, bar ];\n > var waterfall = waterfall.factory( fcns, done );\n > waterfall();\n > waterfall();\n > waterfall();\n\n",
"whileAsync": "\nwhileAsync( predicate, fcn, done[, thisArg] )\n Invokes a function while a test condition is true.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is truthy, the function invokes `fcn`; otherwise, the\n function invokes the `done` callback.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i, clbk ) { clbk( null, i < 5 ); };\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > whileAsync( predicate, fcn, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhileAsync, untilAsync, whilst\n",
"whileEach": "\nwhileEach( collection, predicate, fcn[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > whileEach( arr, predicate, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n untilEach, whileEachRight\n",
"whileEachRight": "\nwhileEachRight( collection, predicate, fcn[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > whileEachRight( arr, predicate, logger )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n\n See Also\n --------\n whileEach, untilEachRight\n",
"whilst": "\nwhilst( predicate, fcn[, thisArg] )\n Invokes a function while a test condition is true.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i < 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > whilst( predicate, beep )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhile, until, whileAsync, whileEach\n",
"writeFile": "\nwriteFile( file, data[, options,] clbk )\n Asynchronously writes data to a file.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n data: string|Buffer\n Data to write.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. The encoding option is ignored if the data argument is a\n buffer. Default: 'utf8'.\n\n options.flag: string (optional)\n Flag. Default: 'w'.\n\n options.mode: integer (optional)\n Mode. Default: 0o666.\n\n clbk: Function\n Callback to invoke upon writing data to a file.\n\n Examples\n --------\n > function onWrite( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > writeFile( './beep/boop.txt', 'beep boop', onWrite );\n\n\nwriteFile.sync( file, data[, options] )\n Synchronously writes data to a file.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n data: string|Buffer\n Data to write.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. The encoding option is ignored if the data argument is a\n buffer. Default: 'utf8'.\n\n options.flag: string (optional)\n Flag. Default: 'w'.\n\n options.mode: integer (optional)\n Mode. Default: 0o666.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = writeFile.sync( './beep/boop.txt', 'beep boop' );\n\n See Also\n --------\n exists, readFile\n",
"zip": "\nzip( ...arr[, options] )\n Generates array tuples from input arrays.\n\n Parameters\n ----------\n arr: ...Array\n Input arrays to be zipped.\n\n options: Object (optional)\n Options.\n\n options.trunc: boolean (optional)\n Boolean indicating whether to truncate arrays longer than the shortest\n input array. Default: `true`.\n\n options.fill: any (optional)\n Fill value used for arrays of unequal length. Default: `null`.\n\n options.arrays: boolean (optional)\n Boolean indicating whether an input array should be interpreted as an\n array of arrays to be zipped. Default: `false`.\n\n Returns\n -------\n out: Array\n Array of arrays.\n\n Examples\n --------\n // Basic usage:\n > var out = zip( [ 1, 2 ], [ 'a', 'b' ] )\n [ [ 1, 'a' ], [ 2, 'b' ] ]\n\n // Turn off truncation:\n > var opts = { 'trunc': false };\n > out = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts )\n [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n\n See Also\n --------\n unzip\n",
"ztest": "\nztest( x, sigma[, options] )\n Computes a one-sample z-test.\n\n The function performs a one-sample z-test for the null hypothesis that the\n data in array or typed array `x` is drawn from a normal distribution with\n mean zero and standard deviation `sigma`.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n Data array.\n\n sigma: number\n Known standard deviation.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.mu: number (optional)\n Hypothesized true mean under the null hypothesis. Set this option to\n test whether the data comes from a distribution with the specified `mu`.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for mean.\n\n out.nullValue: number\n Assumed mean value under H0.\n\n out.sd: number\n Standard error.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test (`One-Sample z-test`).\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // One-sample z-test:\n > var rnorm = base.random.normal.factory( 0.0, 2.0, { 'seed': 212 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... }\n > var out = ztest( x, 2.0 )\n {\n alpha: 0.05,\n rejected: false,\n pValue: ~0.180,\n statistic: ~-1.34,\n ci: [ ~-0.66, ~0.124 ],\n ...\n }\n\n // Choose custom significance level and print output:\n > arr = [ 2, 4, 3, 1, 0 ];\n > out = ztest( arr, 2.0, { 'alpha': 0.01 });\n > table = out.print()\n One-sample z-test\n\n Alternative hypothesis: True mean is not equal to 0\n\n pValue: 0.0253\n statistic: 2.2361\n 99% confidence interval: [-0.3039,4.3039]\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n\n // Test for a mean equal to five:\n > var arr = [ 4, 4, 6, 6, 5 ];\n > out = ztest( arr, 1.0, { 'mu': 5 })\n {\n rejected: false,\n pValue: 1,\n statistic: 0,\n ci: [ ~4.123, ~5.877 ],\n // ...\n }\n\n // Perform one-sided tests:\n > arr = [ 4, 4, 6, 6, 5 ];\n > out = ztest( arr, 1.0, { 'alternative': 'less' })\n {\n alpha: 0.05,\n rejected: false,\n pValue: 1,\n statistic: 11.180339887498949,\n ci: [ -Infinity, 5.735600904580115 ],\n // ...\n }\n > out = ztest( arr, 1.0, { 'alternative': 'greater' })\n {\n alpha: 0.05,\n rejected: true,\n pValue: 0,\n statistic: 11.180339887498949,\n ci: [ 4.264399095419885, Infinity ],\n //...\n }\n\n See Also\n --------\n ztest2\n",
"ztest2": "\nztest2( x, y, sigmax, sigmay[, options] )\n Computes a two-sample z-test.\n\n By default, the function performs a two-sample z-test for the null\n hypothesis that the data in arrays or typed arrays `x` and `y` is\n independently drawn from normal distributions with equal means and known\n standard deviations `sigmax` and `sigmay`.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n sigmax: number\n Known standard deviation of first group.\n\n sigmay: number\n Known standard deviation of second group.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.difference: number (optional)\n Number denoting the difference in means under the null hypothesis.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed difference in means under H0.\n\n out.xmean: number\n Sample mean of `x`.\n\n out.ymean: number\n Sample mean of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Drawn from Normal(0,2):\n > var x = [ -0.21, 0.14, 1.65, 2.11, -1.86, -0.29, 1.48, 0.81, 0.86, 1.04 ];\n\n // Drawn from Normal(1,2):\n > var y = [ -1.53, -2.93, 2.34, -1.15, 2.7, -0.12, 4.22, 1.66, 3.43, 4.66 ];\n > var out = ztest2( x, y, 2.0, 2.0 )\n {\n alpha: 0.05,\n rejected: false,\n pValue: ~0.398,\n statistic: ~-0.844\n ci: [ ~-2.508, ~0.988 ],\n alternative: 'two-sided',\n method: 'Two-sample z-test',\n nullValue: 0,\n xmean: ~0.573,\n ymean: ~1.328\n }\n\n // Print table output:\n > var table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.3986\n statistic: -0.8441\n 95% confidence interval: [-2.508,0.998]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose a different significance level than `0.05`:\n > out = ztest2( x, y, 2.0, 2.0, { 'alpha': 0.4 });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.3986\n statistic: -0.8441\n 60% confidence interval: [-1.5078,-0.0022]\n\n Test Decision: Reject null in favor of alternative at 40% significance level\n\n // Perform one-sided tests:\n > out = ztest2( x, y, 2.0, 2.0, { 'alternative': 'less' });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is less than 0\n\n pValue: 0.1993\n statistic: -0.8441\n 95% confidence interval: [-Infinity,0.7162]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n\n > out = ztest2( x, y, 2.0, 2.0, { 'alternative': 'greater' });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is greater than 0\n\n pValue: 0.8007\n statistic: -0.8441\n 95% confidence interval: [-2.2262,Infinity]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Test for a difference in means besides zero:\n > var rnorm = base.random.normal.factory({ 'seed': 372 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm( 2.0, 1.0 );\n ... }\n > y = new Array( 100 );\n ... for ( i = 0; i < x.length; i++ ) {\n ... y[ i ] = rnorm( 0.0, 2.0 );\n ... }\n > out = ztest2( x, y, 1.0, 2.0, { 'difference': 2.0 })\n {\n rejected: false,\n pValue: ~0.35,\n statistic: ~-0.935\n ci: [ ~1.353, ~2.229 ],\n // ...\n }\n\n See Also\n --------\n ztest\n"
};
module.exports = db;
| lib/node_modules/@stdlib/repl/help/lib/db.js | /* eslint-disable quotes, max-lines */
/**
* @license Apache-2.0
*
* Copyright (c) 2018 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.
*/
/*
* This file is generated by scripts/build.js.
*/
'use strict';
var db = {
"AFINN_96": "\nAFINN_96()\n Returns a list of English words rated for valence.\n\n The returned list contains 1468 English words (and phrases) rated for\n valence. Negative words have a negative valence [-5,0). Positive words have\n a positive valence (0,5]. Neutral words have a valence of 0.\n\n A few notes:\n\n - The list is an earlier version of AFINN-111.\n - The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n - All words are lowercase.\n - Some \"words\" are phrases; e.g., \"cashing in\", \"cool stuff\".\n - Words may contain apostrophes; e.g., \"can't stand\".\n - Words may contain dashes; e.g., \"cover-up\", \"made-up\".\n\n Returns\n -------\n out: Array<Array>\n List of English words and their valence.\n\n Examples\n --------\n > var list = AFINN_96()\n [ [ 'abandon', -2 ], [ 'abandons', -2 ], [ 'abandoned', -2 ], ... ]\n\n References\n ----------\n - Nielsen, Finn Årup. 2011. \"A new ANEW: Evaluation of a word list for\n sentiment analysis in microblogs.\" In *Proceedings of the ESWC2011 Workshop\n on 'Making Sense of Microposts': Big Things Come in Small Packages.*,\n 718:93–98. CEUR Workshop Proceedings. <http://ceur-ws.org/Vol-718/paper_16.\n pdf>.\n\n * If you use the list for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n AFINN_111\n",
"AFINN_111": "\nAFINN_111()\n Returns a list of English words rated for valence.\n\n The returned list contains 2477 English words (and phrases) rated for\n valence. Negative words have a negative valence [-5,0). Positive words have\n a positive valence (0,5]. Neutral words have a valence of 0.\n\n A few notes:\n\n - The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n - All words are lowercase.\n - Words may contain numbers; e.g., \"n00b\".\n - Some \"words\" are phrases; e.g., \"cool stuff\", \"not good\".\n - Words may contain apostrophes; e.g., \"can't stand\".\n - Words may contain diaeresis; e.g., \"naïve\".\n - Words may contain dashes; e.g., \"self-deluded\", \"self-confident\".\n\n Returns\n -------\n out: Array<Array>\n List of English words and their valence.\n\n Examples\n --------\n > var list = AFINN_111()\n [ [ 'abandon', -2 ], [ 'abandoned', -2 ], [ 'abandons', -2 ], ... ]\n\n References\n ----------\n - Nielsen, Finn Årup. 2011. \"A new ANEW: Evaluation of a word list for\n sentiment analysis in microblogs.\" In *Proceedings of the ESWC2011 Workshop\n on 'Making Sense of Microposts': Big Things Come in Small Packages.*,\n 718:93–98. CEUR Workshop Proceedings. <http://ceur-ws.org/Vol-718/paper_16.\n pdf>.\n\n * If you use the list for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n AFINN_96\n",
"allocUnsafe": "\nallocUnsafe( size )\n Allocates a buffer having a specified number of bytes.\n\n The underlying memory of returned buffers is not initialized. Memory\n contents are unknown and may contain sensitive data.\n\n When the size is less than half a buffer pool size, memory is allocated from\n the buffer pool for faster allocation of Buffer instances.\n\n Parameters\n ----------\n size: integer\n Number of bytes to allocate.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var buf = allocUnsafe( 100 )\n <Buffer>\n\n See Also\n --------\n Buffer, array2buffer, arraybuffer2buffer, copyBuffer, string2buffer\n",
"anova1": "\nanova1( x, factor[, options] )\n Performs a one-way analysis of variance.\n\n Parameters\n ----------\n x: Array<number>\n Measured values.\n\n factor: Array\n Array of treatments.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.means: Object\n Group means alongside sample sizes and standard errors.\n\n out.treatmentDf: number\n Treatment degrees of freedom.\n\n out.treatmentSS: number\n Treatment sum of squares.\n\n out.treatmentMSS: number\n Treatment mean sum of squares.\n\n out.errorDf: number\n Error degrees of freedom.\n\n out.errorSS: number\n Error sum of squares.\n\n out.errorMSS: number\n Error mean sum of squares.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var x = [1, 3, 5, 2, 4, 6, 8, 7, 10, 11, 12, 15];\n > var f = [\n ... 'control', 'treatA', 'treatB', 'treatC', 'control',\n ... 'treatA', 'treatB', 'treatC', 'control', 'treatA', 'treatB', 'treatC'\n ... ];\n > var out = anova1( x, f )\n {...}\n\n",
"ANSCOMBES_QUARTET": "\nANSCOMBES_QUARTET()\n Returns Anscombe's quartet.\n\n Anscombe's quartet is a set of 4 datasets which all have nearly identical\n simple statistical properties but vary considerably when graphed. Anscombe\n created the datasets to demonstrate why graphical data exploration should\n precede statistical data analysis and to show the effect of outliers on\n statistical properties.\n\n Returns\n -------\n out: Array<Array>\n Anscombe's quartet.\n\n Examples\n --------\n > var d = ANSCOMBES_QUARTET()\n [[[10,8.04],...],[[10,9.14],...],[[10,7.46],...],[[8,6.58],...]]\n\n References\n ----------\n - Anscombe, Francis J. 1973. \"Graphs in Statistical Analysis.\" *The American\n Statistician* 27 (1). [American Statistical Association, Taylor & Francis,\n Ltd.]: 17–21. <http://www.jstor.org/stable/2682899>.\n\n",
"any": "\nany( collection )\n Tests whether at least one element in a collection is truthy.\n\n The function immediately returns upon encountering a truthy value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if an element is truthy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 0, 0, 1 ];\n > var bool = any( arr )\n true\n\n See Also\n --------\n anyBy, every, forEach, none, some\n",
"anyBy": "\nanyBy( collection, predicate[, thisArg ] )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns `true` for\n any element; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, 3, 4, -1 ];\n > var bool = anyBy( arr, negative )\n true\n\n See Also\n --------\n anyByAsync, anyByRight, everyBy, forEach, noneBy, someBy\n",
"anyByAsync": "\nanyByAsync( collection, [options,] predicate, done )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-falsy `result`\n value and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > anyByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nanyByAsync.factory( [options,] predicate )\n Returns a function which tests whether at least one element in a collection\n passes a test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = anyByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyBy, anyByRightAsync, everyByAsync, forEachAsync, noneByAsync, someByAsync\n",
"anyByRight": "\nanyByRight( collection, predicate[, thisArg ] )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns `true` for\n any element; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ -1, 1, 2, 3, 4 ];\n > var bool = anyByRight( arr, negative )\n true\n\n See Also\n --------\n anyBy, anyByRightAsync, everyByRight, forEachRight, noneByRight, someByRight\n",
"anyByRightAsync": "\nanyByRightAsync( collection, [options,] predicate, done )\n Tests whether at least one element in a collection passes a test implemented\n by a predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-falsy `result`\n value and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > anyByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nanyByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether at least one element in a collection\n passes a test implemented by a predicate function, iterating from right to\n left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = anyByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByAsync, anyByRight, everyByRightAsync, forEachRightAsync, noneByRightAsync, someByRightAsync\n",
"APERY": "\nAPERY\n Apéry's constant.\n\n Examples\n --------\n > APERY\n 1.2020569031595942\n\n",
"append": "\nappend( collection1, collection2 )\n Adds the elements of one collection to the end of another collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection1: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n collection2: Array|TypedArray|Object\n A collection containing the elements to add. If the collection is an\n `Object`, the collection should be array-like.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = append( arr, [ 6.0, 7.0 ] )\n [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = append( arr, [ 3.0, 4.0 ] )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n // Array-like object:\n > arr = { 'length': 0 };\n > arr = append( arr, [ 1.0, 2.0 ] )\n { 'length': 2, '0': 1.0, '1': 2.0 }\n\n See Also\n --------\n prepend, push\n",
"ARCH": "\nARCH\n Operating system CPU architecture.\n\n Current possible values:\n\n - arm\n - arm64\n - ia32\n - mips\n - mipsel\n - ppc\n - ppc64\n - s390\n - s390x\n - x32\n - x64\n\n Examples\n --------\n > ARCH\n <string>\n\n See Also\n --------\n PLATFORM\n",
"argumentFunction": "\nargumentFunction( idx )\n Returns a function which always returns a specified argument.\n\n The input argument corresponds to the zero-based index of the argument to\n return.\n\n Parameters\n ----------\n idx: integer\n Argument index to return (zero-based).\n\n Returns\n -------\n out: Function\n Argument function.\n\n Examples\n --------\n > var argn = argumentFunction( 1 );\n > var v = argn( 3.14, -3.14, 0.0 )\n -3.14\n > v = argn( -1.0, -0.0, 1.0 )\n -0.0\n > v = argn( 'beep', 'boop', 'bop' )\n 'boop'\n > v = argn( 'beep' )\n undefined\n\n See Also\n --------\n constantFunction, identity\n",
"ARGV": "\nARGV\n An array containing command-line arguments passed when launching the calling\n process.\n\n The first element is the absolute pathname of the executable that started\n the calling process.\n\n The second element is the path of the executed file.\n\n Any additional elements are additional command-line arguments.\n\n In browser environments, the array is empty.\n\n Examples\n --------\n > var execPath = ARGV[ 0 ]\n e.g., /usr/local/bin/node\n\n See Also\n --------\n ENV\n",
"array": "\narray( [buffer,] [options] )\n Returns a multidimensional array.\n\n Parameters\n ----------\n buffer: Array|TypedArray|Buffer|ndarray (optional)\n Data source.\n\n options: Object (optional)\n Options.\n\n options.buffer: Array|TypedArray|Buffer|ndarray (optional)\n Data source. If provided along with a `buffer` argument, the argument\n takes precedence.\n\n options.dtype: string (optional)\n Underlying storage data type. If not specified and a data source is\n provided, the data type is inferred from the provided data source. If an\n input data source is not of the same type, this option specifies the\n data type to which to cast the input data. For non-ndarray generic array\n data sources, the function casts generic array data elements to the\n default data type. In order to prevent this cast, the `dtype` option\n must be explicitly set to `'generic'`. Any time a cast is required, the\n `copy` option is set to `true`, as memory must be copied from the data\n source to an output data buffer. Default: 'float64'.\n\n options.order: string (optional)\n Specifies the memory layout of the data source as either row-major (C-\n style) or column-major (Fortran-style). The option may be one of the\n following values:\n\n - 'row-major': the order of the returned array is row-major.\n - 'column-major': the order of the returned array is column-major.\n - 'any': if a data source is column-major and not row-major, the order\n of the returned array is column-major; otherwise, the order of the\n returned array is row-major.\n - 'same': the order of the returned array matches the order of an input\n data source.\n\n Note that specifying an order which differs from the order of a\n provided data source does *not* entail a conversion from one memory\n layout to another. In short, this option is descriptive, not\n prescriptive. Default: 'row-major'.\n\n options.shape: Array<integer> (optional)\n Array shape (dimensions). If a shape is not specified, the function\n attempts to infer a shape based on a provided data source. For example,\n if provided a nested array, the function resolves nested array\n dimensions. If provided a multidimensional array data source, the\n function uses the array's associated shape. For most use cases, such\n inference suffices. For the remaining use cases, specifying a shape is\n necessary. For example, provide a shape to create a multidimensional\n array view over a linear data buffer, ignoring any existing shape meta\n data associated with a provided data source.\n\n options.flatten: boolean (optional)\n Boolean indicating whether to automatically flatten generic array data\n sources. If an array shape is not specified, the shape is inferred from\n the dimensions of nested arrays prior to flattening. If a use case\n requires partial flattening, partially flatten prior to invoking this\n function and set the option value to `false` to prevent further\n flattening during invocation. Default: true.\n\n options.copy: boolean (optional)\n Boolean indicating whether to (shallow) copy source data to a new data\n buffer. The function does *not* perform a deep copy. To prevent\n undesired shared changes in state for generic arrays containing objects,\n perform a deep copy prior to invoking this function. Default: false.\n\n options.ndmin: integer (optional)\n Specifies the minimum number of dimensions. If an array shape has fewer\n dimensions than required by `ndmin`, the function prepends singleton\n dimensions to the array shape in order to satisfy the dimensions\n requirement. Default: 0.\n\n options.casting: string (optional)\n Specifies the casting rule used to determine acceptable casts. The\n option may be one of the following values:\n\n - 'none': only allow casting between identical types.\n - 'equiv': allow casting between identical and byte swapped types.\n - 'safe': only allow \"safe\" casts.\n - 'same-kind': allow \"safe\" casts and casts within the same kind (e.g.,\n between signed integers or between floats).\n - 'unsafe': allow casting between all types (including between integers\n and floats).\n\n Default: 'safe'.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. The\n option may be one of the following values:\n\n - 'throw': an ndarray instance throws an error when an index exceeds\n array dimensions.\n - 'wrap': an ndarray instance wraps around indices exceeding array\n dimensions using modulo arithmetic.\n - 'clamp', an ndarray instance sets an index exceeding array dimensions\n to either `0` (minimum index) or the maximum index.\n\n Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to\n\n - 'throw': an ndarray instance throws an error when a subscript exceeds\n array dimensions.\n - 'wrap': an ndarray instance wraps around subscripts exceeding array\n dimensions using modulo arithmetic.\n - 'clamp': an ndarray instance sets a subscript exceeding array\n dimensions to either `0` (minimum index) or the maximum index.\n\n If the number of modes is fewer than the number of dimensions, the\n function recycles modes using modulo arithmetic.\n\n Default: [ options.mode ].\n\n Returns\n -------\n out: ndarray\n Multidimensional array.\n\n Examples\n --------\n // Create a 2x2 matrix:\n > var arr = array( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n ndarray\n",
"array2buffer": "\narray2buffer( arr )\n Allocates a buffer using an octet array.\n\n Parameters\n ----------\n arr: Array<integer>\n Array (or array-like object) of octets from which to copy.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var buf = array2buffer( [ 1, 2, 3, 4 ] )\n <Buffer>[ 1, 2, 3, 4 ]\n\n See Also\n --------\n Buffer, arraybuffer2buffer, copyBuffer, string2buffer\n",
"ArrayBuffer": "\nArrayBuffer( size )\n Returns an array buffer having a specified number of bytes.\n\n Buffer contents are initialized to 0.\n\n Parameters\n ----------\n size: integer\n Number of bytes.\n\n Returns\n -------\n out: ArrayBuffer\n An array buffer.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 5 )\n <ArrayBuffer>\n\n\nArrayBuffer.length\n Number of input arguments the constructor accepts.\n\n Examples\n --------\n > ArrayBuffer.length\n 1\n\n\nArrayBuffer.isView( arr )\n Returns a boolean indicating if provided an array buffer view.\n\n Parameters\n ----------\n arr: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an input argument is a buffer view.\n\n Examples\n --------\n > var arr = new Float64Array( 10 );\n > ArrayBuffer.isView( arr )\n true\n\n\nArrayBuffer.prototype.byteLength\n Read-only property which returns the length (in bytes) of the array buffer.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 5 );\n > buf.byteLength\n 5\n\n\nArrayBuffer.prototype.slice( [start[, end]] )\n Copies the bytes of an array buffer to a new array buffer.\n\n Parameters\n ----------\n start: integer (optional)\n Index at which to start copying buffer contents (inclusive). If\n negative, the index is relative to the end of the buffer.\n\n end: integer (optional)\n Index at which to stop copying buffer contents (exclusive). If negative,\n the index is relative to the end of the buffer.\n\n Returns\n -------\n out: ArrayBuffer\n A new array buffer whose contents have been copied from the calling\n array buffer.\n\n Examples\n --------\n > var b1 = new ArrayBuffer( 10 );\n > var b2 = b1.slice( 2, 6 );\n > var bool = ( b1 === b2 )\n false\n > b2.byteLength\n 4\n\n See Also\n --------\n Buffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, SharedArrayBuffer, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"arraybuffer2buffer": "\narraybuffer2buffer( buf[, byteOffset[, length]] )\n Allocates a buffer from an ArrayBuffer.\n\n The behavior of this function varies across Node.js versions due to changes\n in the underlying Node.js APIs:\n\n - <3.0.0: the function copies ArrayBuffer bytes to a new Buffer instance.\n - >=3.0.0 and <5.10.0: if provided a byte offset, the function copies\n ArrayBuffer bytes to a new Buffer instance; otherwise, the function\n returns a view of an ArrayBuffer without copying the underlying memory.\n - <6.0.0: if provided an empty ArrayBuffer, the function returns an empty\n Buffer which is not an ArrayBuffer view.\n - >=6.0.0: the function returns a view of an ArrayBuffer without copying\n the underlying memory.\n\n Parameters\n ----------\n buf: ArrayBuffer\n Input array buffer.\n\n byteOffset: integer (optional)\n Index offset specifying the location of the first byte.\n\n length: integer (optional)\n Number of bytes to expose from the underlying ArrayBuffer.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var ab = new ArrayBuffer( 10 )\n <ArrayBuffer>\n > var buf = arraybuffer2buffer( ab )\n <Buffer>\n > var len = buf.length\n 10\n > buf = arraybuffer2buffer( ab, 2, 6 )\n <Buffer>\n > len = buf.length\n 6\n\n See Also\n --------\n Buffer, array2buffer, copyBuffer, string2buffer\n",
"arrayCtors": "\narrayCtors( dtype )\n Returns an array constructor.\n\n The function returns constructors for the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Constructor.\n\n Examples\n --------\n > var ctor = arrayCtors( 'float64' )\n <Function>\n > ctor = arrayCtors( 'float' )\n null\n\n See Also\n --------\n typedarrayCtors\n",
"arrayDataType": "\narrayDataType( array )\n Returns the data type of an array.\n\n If provided an argument having an unknown or unsupported type, the function\n returns `null`.\n\n Parameters\n ----------\n array: any\n Input value.\n\n Returns\n -------\n out: string|null\n Data type.\n\n Examples\n --------\n > var arr = new Float64Array( 10 );\n > var dt = arrayDataType( arr )\n 'float64'\n > dt = arrayDataType( 'beep' )\n null\n\n See Also\n --------\n arrayDataTypes\n",
"arrayDataTypes": "\narrayDataTypes()\n Returns a list of array data types.\n\n The output array contains the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of array data types.\n\n Examples\n --------\n > var out = arrayDataTypes()\n <Array>\n\n See Also\n --------\n typedarrayDataTypes, ndarrayDataTypes\n",
"arrayMinDataType": "\narrayMinDataType( value )\n Returns the minimum array data type of the closest \"kind\" necessary for\n storing a provided scalar value.\n\n The function does *not* provide precision guarantees for non-integer-valued\n real numbers. In other words, the function returns the smallest possible\n floating-point (i.e., inexact) data type for storing numbers having\n decimals.\n\n Parameters\n ----------\n value: any\n Scalar value.\n\n Returns\n -------\n dt: string\n Array data type.\n\n Examples\n --------\n > var dt = arrayMinDataType( 3.141592653589793 )\n 'float32'\n > dt = arrayMinDataType( 3 )\n 'uint8'\n > dt = arrayMinDataType( -3 )\n 'int8'\n > dt = arrayMinDataType( '-3' )\n 'generic'\n\n See Also\n --------\n arrayDataTypes, arrayPromotionRules, arraySafeCasts\n",
"arrayNextDataType": "\narrayNextDataType( [dtype] )\n Returns the next larger array data type of the same kind.\n\n If not provided a data type, the function returns a table.\n\n If a data type does not have a next larger data type or the next larger type\n is not supported, the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Next larger type(s).\n\n Examples\n --------\n > var out = arrayNextDataType( 'float32' )\n 'float64'\n\n See Also\n --------\n arrayDataType, arrayDataTypes\n",
"arrayPromotionRules": "\narrayPromotionRules( [dtype1, dtype2] )\n Returns the array data type with the smallest size and closest \"kind\" to\n which array data types can be safely cast.\n\n If not provided data types, the function returns a type promotion table.\n\n If a data type to which data types can be safely cast does *not* exist (or\n is not supported), the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype1: string (optional)\n Array data type.\n\n dtype2: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Promotion rule(s).\n\n Examples\n --------\n > var out = arrayPromotionRules( 'float32', 'int32' )\n 'float64'\n\n See Also\n --------\n arrayDataTypes, arraySafeCasts, ndarrayPromotionRules\n",
"arraySafeCasts": "\narraySafeCasts( [dtype] )\n Returns a list of array data types to which a provided array data type can\n be safely cast.\n\n If not provided an array data type, the function returns a casting table.\n\n If provided an unrecognized array data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n Array data types to which a data type can be safely cast.\n\n Examples\n --------\n > var out = arraySafeCasts( 'float32' )\n <Array>\n\n See Also\n --------\n convertArray, convertArraySame, arrayDataTypes, arraySameKindCasts, ndarraySafeCasts\n",
"arraySameKindCasts": "\narraySameKindCasts( [dtype] )\n Returns a list of array data types to which a provided array data type can\n be safely cast or cast within the same \"kind\".\n\n If not provided an array data type, the function returns a casting table.\n\n If provided an unrecognized array data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n Array data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n Array data types to which a data type can be safely cast or cast within\n the same \"kind\".\n\n Examples\n --------\n > var out = arraySameKindCasts( 'float32' )\n <Array>\n\n See Also\n --------\n convertArray, convertArraySame, arrayDataTypes, arraySafeCasts, ndarraySameKindCasts\n",
"arrayShape": "\narrayShape( arr )\n Determines array dimensions.\n\n Parameters\n ----------\n arr: Array\n Input array.\n\n Returns\n -------\n out: Array\n Array shape.\n\n Examples\n --------\n > var out = arrayShape( [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] )\n [ 2, 3 ]\n\n See Also\n --------\n ndarray\n",
"bartlettTest": "\nbartlettTest( ...x[, options] )\n Computes Bartlett’s test for equal variances.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = bartlettTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = bartlettTest( arr, { 'groups': groups })\n\n See Also\n --------\n vartest\n",
"base.abs": "\nbase.abs( x )\n Computes the absolute value of `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Absolute value.\n\n Examples\n --------\n > var y = base.abs( -1.0 )\n 1.0\n > y = base.abs( 2.0 )\n 2.0\n > y = base.abs( 0.0 )\n 0.0\n > y = base.abs( -0.0 )\n 0.0\n > y = base.abs( NaN )\n NaN\n\n See Also\n --------\n base.abs2\n",
"base.abs2": "\nbase.abs2( x )\n Computes the squared absolute value of `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Squared absolute value.\n\n Examples\n --------\n > var y = base.abs2( -1.0 )\n 1.0\n > y = base.abs2( 2.0 )\n 4.0\n > y = base.abs2( 0.0 )\n 0.0\n > y = base.abs2( -0.0 )\n 0.0\n > y = base.abs2( NaN )\n NaN\n\n See Also\n --------\n base.abs\n",
"base.absdiff": "\nbase.absdiff( x, y )\n Computes the absolute difference.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Absolute difference.\n\n Examples\n --------\n > var d = base.absdiff( 2.0, 5.0 )\n 3.0\n > d = base.absdiff( -1.0, 3.14 )\n ~4.14\n > d = base.absdiff( 10.1, -2.05 )\n ~12.15\n > d = base.absdiff( -0.0, 0.0 )\n +0.0\n > d = base.absdiff( NaN, 5.0 )\n NaN\n > d = base.absdiff( PINF, NINF )\n Infinity\n > d = base.absdiff( PINF, PINF )\n NaN\n\n See Also\n --------\n base.reldiff, base.epsdiff\n",
"base.absInt32": "\nbase.absInt32( x )\n Computes an absolute value of a signed 32-bit integer in two's complement\n format.\n\n Parameters\n ----------\n x: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Absolute value.\n\n Examples\n --------\n > var v = base.absInt32( -1|0 )\n 1\n > v = base.absInt32( 2|0 )\n 2\n > v = base.absInt32( 0|0 )\n 0\n\n See Also\n --------\n base.abs\n",
"base.acos": "\nbase.acos( x )\n Compute the arccosine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arccosine (in radians).\n\n Examples\n --------\n > var y = base.acos( 1.0 )\n 0.0\n > y = base.acos( 0.707 )\n ~0.7855\n > y = base.acos( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asin, base.atan\n",
"base.acosh": "\nbase.acosh( x )\n Computes the hyperbolic arccosine of a number.\n\n If `x < 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arccosine (in radians).\n\n Examples\n --------\n > var y = base.acosh( 1.0 )\n 0.0\n > y = base.acosh( 2.0 )\n ~1.317\n > y = base.acosh( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asinh, base.atanh\n",
"base.acoth": "\nbase.acoth( x )\n Computes the inverse hyperbolic cotangent of a number.\n\n The domain of the inverse hyperbolic cotangent is the union of the intervals\n (-inf,-1] and [1,inf).\n\n If provided a value on the open interval (-1,1), the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse hyperbolic cotangent (in radians).\n\n Examples\n --------\n > var y = base.acoth( 2.0 )\n ~0.5493\n > y = base.acoth( 0.0 )\n NaN\n > y = base.acoth( 0.5 )\n NaN\n > y = base.acoth( 1.0 )\n Infinity\n > y = base.acoth( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asinh, base.atanh\n",
"base.acovercos": "\nbase.acovercos( x )\n Computes the inverse coversed cosine.\n\n The inverse coversed cosine is defined as `asin(1+x)`.\n\n If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse coversed cosine.\n\n Examples\n --------\n > var y = base.acovercos( -1.5 )\n ~-0.5236\n > y = base.acovercos( -0.0 )\n ~1.5708\n\n See Also\n --------\n base.acoversin, base.avercos, base.covercos, base.vercos\n",
"base.acoversin": "\nbase.acoversin( x )\n Computes the inverse coversed sine.\n\n The inverse coversed sine is defined as `asin(1-x)`.\n\n If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse coversed sine.\n\n Examples\n --------\n > var y = base.acoversin( 1.5 )\n ~-0.5236\n > y = base.acoversin( 0.0 )\n ~1.5708\n\n See Also\n --------\n base.acovercos, base.aversin, base.coversin, base.versin\n",
"base.ahavercos": "\nbase.ahavercos( x )\n Computes the inverse half-value versed cosine.\n\n The inverse half-value versed cosine is defined as `2*acos(sqrt(x))`.\n\n If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse half-value versed cosine.\n\n Examples\n --------\n > var y = base.ahavercos( 0.5 )\n ~1.5708\n > y = base.ahavercos( 0.0 )\n ~3.1416\n\n See Also\n --------\n base.ahaversin, base.havercos, base.vercos\n",
"base.ahaversin": "\nbase.ahaversin( x )\n Computes the inverse half-value versed sine.\n\n The inverse half-value versed sine is defined as `2*asin(sqrt(x))`.\n\n If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse half-value versed sine.\n\n Examples\n --------\n > var y = base.ahaversin( 0.5 )\n ~1.5708\n > y = base.ahaversin( 0.0 )\n 0.0\n\n See Also\n --------\n base.ahavercos, base.haversin, base.versin\n",
"base.asin": "\nbase.asin( x )\n Computes the arcsine of a number.\n\n If `|x| > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arcsine (in radians).\n\n Examples\n --------\n > var y = base.asin( 0.0 )\n 0.0\n > y = base.asin( PI/2.0 )\n ~1.0\n > y = base.asin( -PI/6.0 )\n ~-0.551\n > y = base.asin( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asinh, base.atan\n",
"base.asinh": "\nbase.asinh( x )\n Computes the hyperbolic arcsine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arcsine (in radians).\n\n Examples\n --------\n > var y = base.asinh( 0.0 )\n 0.0\n > y = base.asinh( 2.0 )\n ~1.444\n > y = base.asinh( -2.0 )\n ~-1.444\n > y = base.asinh( NaN )\n NaN\n > y = base.asinh( NINF )\n -Infinity\n > y = base.asinh( PINF )\n Infinity\n\n See Also\n --------\n base.acosh, base.asin, base.atanh\n",
"base.atan": "\nbase.atan( x )\n Computes the arctangent of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Arctangent (in radians).\n\n Examples\n --------\n > var y = base.atan( 0.0 )\n ~0.0\n > y = base.atan( -PI/2.0 )\n ~-1.004\n > y = base.atan( PI/2.0 )\n ~1.004\n > y = base.atan( NaN )\n NaN\n\n See Also\n --------\n base.acos, base.asin, base.atanh\n",
"base.atan2": "\nbase.atan2( y, x )\n Evaluates the arctangent of the quotient of two numbers.\n\n Parameters\n ----------\n y: number\n Numerator.\n\n x: number\n Denominator.\n\n Returns\n -------\n out: number\n Arctangent of `y/x` (in radians).\n\n Examples\n --------\n > var v = base.atan2( 2.0, 2.0 )\n ~0.785\n > v = base.atan2( 6.0, 2.0 )\n ~1.249\n > v = base.atan2( -1.0, -1.0 )\n ~-2.356\n > v = base.atan2( 3.0, 0.0 )\n ~1.571\n > v = base.atan2( -2.0, 0.0 )\n ~-1.571\n > v = base.atan2( 0.0, 0.0 )\n 0.0\n > v = base.atan2( 3.0, NaN )\n NaN\n > v = base.atan2( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.atan\n",
"base.atanh": "\nbase.atanh( x )\n Computes the hyperbolic arctangent of a number.\n\n If `|x| > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Hyperbolic arctangent (in radians).\n\n Examples\n --------\n > var y = base.atanh( 0.0 )\n 0.0\n > y = base.atanh( 0.9 )\n ~1.472\n > y = base.atanh( 1.0 )\n Infinity\n > y = base.atanh( -1.0 )\n -Infinity\n > y = base.atanh( NaN )\n NaN\n\n See Also\n --------\n base.acosh, base.asinh, base.atan\n",
"base.avercos": "\nbase.avercos( x )\n Computes the inverse versed cosine.\n\n The inverse versed cosine is defined as `acos(1+x)`.\n\n If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse versed cosine.\n\n Examples\n --------\n > var y = base.avercos( -1.5 )\n ~2.0944\n > y = base.avercos( -0.0 )\n 0.0\n\n See Also\n --------\n base.aversin, base.versin\n",
"base.aversin": "\nbase.aversin( x )\n Computes the inverse versed sine.\n\n The inverse versed sine is defined as `acos(1-x)`.\n\n If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Inverse versed sine.\n\n Examples\n --------\n > var y = base.aversin( 1.5 )\n ~2.0944\n > y = base.aversin( 0.0 )\n 0.0\n\n See Also\n --------\n base.avercos, base.vercos\n",
"base.bernoulli": "\nbase.bernoulli( n )\n Computes the nth Bernoulli number.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: number\n Bernoulli number.\n\n Examples\n --------\n > var y = base.bernoulli( 0 )\n 1.0\n > y = base.bernoulli( 1 )\n 0.0\n > y = base.bernoulli( 2 )\n ~0.167\n > y = base.bernoulli( 3 )\n 0.0\n > y = base.bernoulli( 4 )\n ~-0.033\n > y = base.bernoulli( 5 )\n 0.0\n > y = base.bernoulli( 20 )\n ~-529.124\n > y = base.bernoulli( 260 )\n -Infinity\n > y = base.bernoulli( 262 )\n Infinity\n > y = base.bernoulli( NaN )\n NaN\n\n",
"base.besselj0": "\nbase.besselj0( x )\n Computes the Bessel function of the first kind of order zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.besselj0( 0.0 )\n 1.0\n > y = base.besselj0( 1.0 )\n ~0.765\n > y = base.besselj0( PINF )\n 0.0\n > y = base.besselj0( NINF )\n 0.0\n > y = base.besselj0( NaN )\n NaN\n\n See Also\n --------\n base.besselj1, base.bessely0, base.bessely1\n",
"base.besselj1": "\nbase.besselj1( x )\n Computes the Bessel function of the first kind of order one.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.besselj1( 0.0 )\n 0.0\n > y = base.besselj1( 1.0 )\n ~0.440\n > y = base.besselj1( PINF )\n 0.0\n > y = base.besselj1( NINF )\n 0.0\n > y = base.besselj1( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.bessely0, base.bessely1\n",
"base.bessely0": "\nbase.bessely0( x )\n Computes the Bessel function of the second kind of order zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.bessely0( 0.0 )\n -Infinity\n > y = base.bessely0( 1.0 )\n ~0.088\n > y = base.bessely0( -1.0 )\n NaN\n > y = base.bessely0( PINF )\n 0.0\n > y = base.bessely0( NINF )\n NaN\n > y = base.bessely0( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.besselj1, base.bessely1\n",
"base.bessely1": "\nbase.bessely1( x )\n Computes the Bessel function of the second kind of order one.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.bessely1( 0.0 )\n -Infinity\n > y = base.bessely1( 1.0 )\n ~-0.781\n > y = base.bessely1( -1.0 )\n NaN\n > y = base.bessely1( PINF )\n 0.0\n > y = base.bessely1( NINF )\n NaN\n > y = base.bessely1( NaN )\n NaN\n\n See Also\n --------\n base.besselj0, base.besselj1, base.bessely0\n",
"base.beta": "\nbase.beta( x, y )\n Evaluates the beta function.\n\n Parameters\n ----------\n x: number\n First function parameter (non-negative).\n\n y: number\n Second function parameter (non-negative).\n\n Returns\n -------\n out: number\n Evaluated beta function.\n\n Examples\n --------\n > var v = base.beta( 0.0, 0.0 )\n Infinity\n > v = base.beta( 1.0, 1.0 )\n 1.0\n > v = base.beta( -1.0, 2.0 )\n NaN\n > v = base.beta( 5.0, 0.2 )\n ~3.382\n > v = base.beta( 4.0, 1.0 )\n 0.25\n > v = base.beta( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.betainc, base.betaincinv, base.betaln\n",
"base.betainc": "\nbase.betainc( x, a, b[, regularized[, upper]] )\n Computes the regularized incomplete beta function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete beta functions, respectively.\n\n If provided `x < 0` or `x > 1`, the function returns `NaN`.\n\n If provided `a < 0` or `b < 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n regularized: boolean (optional)\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete beta function. Default: `true`.\n\n upper: boolean (optional)\n Boolean indicating whether the function should return the upper tail of\n the incomplete beta function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.betainc( 0.5, 2.0, 2.0 )\n 0.5\n > y = base.betainc( 0.5, 2.0, 2.0, false )\n ~0.083\n > y = base.betainc( 0.2, 1.0, 2.0 )\n 0.36\n > y = base.betainc( 0.2, 1.0, 2.0, true, true )\n 0.64\n > y = base.betainc( NaN, 1.0, 1.0 )\n NaN\n > y = base.betainc( 0.8, NaN, 1.0 )\n NaN\n > y = base.betainc( 0.8, 1.0, NaN )\n NaN\n > y = base.betainc( 1.5, 1.0, 1.0 )\n NaN\n > y = base.betainc( -0.5, 1.0, 1.0 )\n NaN\n > y = base.betainc( 0.5, -2.0, 2.0 )\n NaN\n > y = base.betainc( 0.5, 2.0, -2.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betaincinv, base.betaln\n",
"base.betaincinv": "\nbase.betaincinv( p, a, b[, upper] )\n Computes the inverse of the lower incomplete beta function.\n\n In contrast to a more commonly used definition, the first argument is the\n probability `p` and the second and third arguments are `a` and `b`,\n respectively.\n\n By default, the function inverts the lower regularized incomplete beta\n function. To invert the upper function, set the `upper` argument to `true`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Probability.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n upper: boolean (optional)\n Boolean indicating if the function should invert the upper tail of the\n incomplete beta function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.betaincinv( 0.2, 3.0, 3.0 )\n ~0.327\n > y = base.betaincinv( 0.4, 3.0, 3.0 )\n ~0.446\n > y = base.betaincinv( 0.4, 3.0, 3.0, true )\n ~0.554\n > y = base.betaincinv( 0.4, 1.0, 6.0 )\n ~0.082\n > y = base.betaincinv( 0.8, 1.0, 6.0 )\n ~0.235\n > y = base.betaincinv( NaN, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, NaN, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, 1.0, NaN )\n NaN\n > y = base.betaincinv( 1.2, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( -0.5, 1.0, 1.0 )\n NaN\n > y = base.betaincinv( 0.5, -2.0, 2.0 )\n NaN\n > y = base.betaincinv( 0.5, 0.0, 2.0 )\n NaN\n > y = base.betaincinv( 0.5, 2.0, -2.0 )\n NaN\n > y = base.betaincinv( 0.5, 2.0, 0.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betainc, base.betaln\n",
"base.betaln": "\nbase.betaln( a, b )\n Evaluates the natural logarithm of the beta function.\n\n Parameters\n ----------\n a: number\n First function parameter (non-negative).\n\n b: number\n Second function parameter (non-negative).\n\n Returns\n -------\n out: number\n Natural logarithm of the beta function.\n\n Examples\n --------\n > var v = base.betaln( 0.0, 0.0 )\n Infinity\n > v = base.betaln( 1.0, 1.0 )\n 0.0\n > v = base.betaln( -1.0, 2.0 )\n NaN\n > v = base.betaln( 5.0, 0.2 )\n ~1.218\n > v = base.betaln( 4.0, 1.0 )\n ~-1.386\n > v = base.betaln( NaN, 2.0 )\n NaN\n\n See Also\n --------\n base.beta, base.betainc, base.betaincinv\n",
"base.binet": "\nbase.binet( x )\n Evaluates Binet's formula extended to real numbers.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function result.\n\n Examples\n --------\n > var y = base.binet( 0.0 )\n 0.0\n > y = base.binet( 1.0 )\n 1.0\n > y = base.binet( 2.0 )\n 1.0\n > y = base.binet( 3.0 )\n 2.0\n > y = base.binet( 4.0 )\n 3.0\n > y = base.binet( 5.0 )\n ~5.0\n > y = base.binet( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negafibonacci\n",
"base.binomcoef": "\nbase.binomcoef( n, k )\n Computes the binomial coefficient of two integers.\n\n If `k < 0`, the function returns `0`.\n\n The function returns `NaN` for non-integer `n` or `k`.\n\n Parameters\n ----------\n n: integer\n First input value.\n\n k: integer\n Second input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var v = base.binomcoef( 8, 2 )\n 28\n > v = base.binomcoef( 0, 0 )\n 1\n > v = base.binomcoef( -4, 2 )\n 10\n > v = base.binomcoef( 5, 3 )\n 10\n > v = base.binomcoef( NaN, 3 )\n NaN\n > v = base.binomcoef( 5, NaN )\n NaN\n > v = base.binomcoef( NaN, NaN )\n NaN\n\n",
"base.binomcoefln": "\nbase.binomcoefln( n, k )\n Computes the natural logarithm of the binomial coefficient of two integers.\n\n If `k < 0`, the function returns negative infinity.\n\n The function returns `NaN` for non-integer `n` or `k`.\n\n Parameters\n ----------\n n: integer\n First input value.\n\n k: integer\n Second input value.\n\n Returns\n -------\n out: number\n Natural logarithm of the binomial coefficient.\n\n Examples\n --------\n > var v = base.binomcoefln( 8, 2 )\n ~3.332\n > v = base.binomcoefln( 0, 0 )\n 0.0\n > v = base.binomcoefln( -4, 2 )\n ~2.303\n > v = base.binomcoefln( 88, 3 )\n ~11.606\n > v = base.binomcoefln( NaN, 3 )\n NaN\n > v = base.binomcoefln( 5, NaN )\n NaN\n > v = base.binomcoefln( NaN, NaN )\n NaN\n\n",
"base.boxcox": "\nbase.boxcox( x, lambda )\n Computes a one-parameter Box-Cox transformation.\n\n Parameters\n ----------\n x: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox( 1.0, 2.5 )\n 0.0\n > v = base.boxcox( 4.0, 2.5 )\n 12.4\n > v = base.boxcox( 10.0, 2.5 )\n ~126.0911\n > v = base.boxcox( 2.0, 0.0 )\n ~0.6931\n > v = base.boxcox( -1.0, 2.5 )\n NaN\n > v = base.boxcox( 0.0, -1.0 )\n -Infinity\n\n See Also\n --------\n base.boxcoxinv, base.boxcox1p, base.boxcox1pinv",
"base.boxcox1p": "\nbase.boxcox1p( x, lambda )\n Computes a one-parameter Box-Cox transformation of 1+x.\n\n Parameters\n ----------\n x: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox1p( 1.0, 2.5 )\n ~1.8627\n > v = base.boxcox1p( 4.0, 2.5 )\n ~21.9607\n > v = base.boxcox1p( 10.0, 2.5 )\n ~160.1246\n > v = base.boxcox1p( 2.0, 0.0 )\n ~1.0986\n > v = base.boxcox1p( -1.0, 2.5 )\n -0.4\n > v = base.boxcox1p( 0.0, -1.0 )\n 0.0\n > v = base.boxcox1p( -1.0, -1.0 )\n -Infinity\n\n See Also\n --------\n base.boxcox, base.boxcox1pinv, base.boxcoxinv",
"base.boxcox1pinv": "\nbase.boxcox1pinv( y, lambda )\n Computes the inverse of a one-parameter Box-Cox transformation for 1+x.\n\n Parameters\n ----------\n y: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n v: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcox1pinv( 1.0, 2.5 )\n ~0.6505\n > v = base.boxcox1pinv( 4.0, 2.5 )\n ~1.6095\n > v = base.boxcox1pinv( 10.0, 2.5 )\n ~2.6812\n > v = base.boxcox1pinv( 2.0, 0.0 )\n ~6.3891\n > v = base.boxcox1pinv( -1.0, 2.5 )\n NaN\n > v = base.boxcox1pinv( 0.0, -1.0 )\n 0.0\n > v = base.boxcox1pinv( 1.0, NaN )\n NaN\n > v = base.boxcox1pinv( NaN, 3.1 )\n NaN\n\n See Also\n --------\n base.boxcox, base.boxcox1p, base.boxcoxinv",
"base.boxcoxinv": "\nbase.boxcoxinv( y, lambda )\n Computes the inverse of a one-parameter Box-Cox transformation.\n\n Parameters\n ----------\n y: number\n Input value.\n\n lambda: number\n Power parameter.\n\n Returns\n -------\n b: number\n Function value.\n\n Examples\n --------\n > var v = base.boxcoxinv( 1.0, 2.5 )\n ~1.6505\n > v = base.boxcoxinv( 4.0, 2.5 )\n ~2.6095\n > v = base.boxcoxinv( 10.0, 2.5 )\n ~3.6812\n > v = base.boxcoxinv( 2.0, 0.0 )\n ~7.3891\n > v = base.boxcoxinv( -1.0, 2.5 )\n NaN\n > v = base.boxcoxinv( 0.0, -1.0 )\n 1.0\n > v = base.boxcoxinv( 1.0, NaN )\n NaN\n > v = base.boxcoxinv( NaN, 3.1 )\n NaN\n\n See Also\n --------\n base.boxcox, base.boxcox1p, base.boxcox1pinv",
"base.cabs": "\nbase.cabs( re, im )\n Computes the absolute value of a complex number.\n\n The absolute value of a complex number is its distance from zero.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n y: number\n Absolute value.\n\n Examples\n --------\n > var y = base.cabs( 5.0, 3.0 )\n ~5.831\n\n See Also\n --------\n base.cabs2, base.abs\n",
"base.cabs2": "\nbase.cabs2( re, im )\n Computes the squared absolute value of a complex number.\n\n The absolute value of a complex number is its distance from zero.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n y: number\n Squared absolute value.\n\n Examples\n --------\n > var y = base.cabs2( 5.0, 3.0 )\n 34.0\n\n See Also\n --------\n base.cabs, base.abs2\n",
"base.cadd": "\nbase.cadd( [out,] re1, im1, re2, im2 )\n Adds two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cadd( 5.0, 3.0, -2.0, 1.0 )\n [ 3.0, 4.0 ]\n\n // Provide an output array:\n > var out = new Float32Array( 2 );\n > y = base.cadd( out, 5.0, 3.0, -2.0, 1.0 )\n <Float32Array>[ 3.0, 4.0 ]\n > var bool = ( y === out )\n true\n\n See Also\n --------\n base.cdiv, base.cmul, base.csub\n",
"base.cbrt": "\nbase.cbrt( x )\n Computes the cube root.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Cube root.\n\n Examples\n --------\n > var y = base.cbrt( 64.0 )\n 4.0\n > y = base.cbrt( 27.0 )\n 3.0\n > y = base.cbrt( 0.0 )\n 0.0\n > y = base.cbrt( -0.0 )\n -0.0\n > y = base.cbrt( -9.0 )\n ~-2.08\n > y = base.cbrt( NaN )\n NaN\n\n See Also\n --------\n base.pow, base.sqrt\n",
"base.cceil": "\nbase.cceil( [out,] re, im )\n Rounds a complex number toward positive infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cceil( 5.5, 3.3 )\n [ 6.0, 4.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cceil( out, 5.5, 3.3 )\n <Float64Array>[ 6.0, 4.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloor, base.cround\n",
"base.cceiln": "\nbase.cceiln( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n` toward positive\n infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cceiln( 5.555, -3.333, -2 )\n [ 5.56, -3.33 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cceiln( out, 5.555, -3.333, -2 )\n <Float64Array>[ 5.56, -3.33 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloorn, base.croundn\n",
"base.ccis": "\nbase.ccis( [out,] re, im )\n Computes the cis function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.ccis( 0.0, 0.0 )\n [ 1.0, 0.0 ]\n\n > var y = base.ccis( 1.0, 0.0 )\n [ ~0.540, ~0.841 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.ccis( out, 1.0, 0.0 )\n <Float64Array>[ ~0.540, ~0.841 ]\n > var bool = ( v === out )\n true\n\n",
"base.cdiv": "\nbase.cdiv( [out,] re1, im1, re2, im2 )\n Divides two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cdiv( -13.0, -1.0, -2.0, 1.0 )\n [ 5.0, 3.0 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cdiv( out, -13.0, -1.0, -2.0, 1.0 )\n <Float64Array>[ 5.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cmul, base.csub\n",
"base.ceil": "\nbase.ceil( x )\n Rounds a numeric value toward positive infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil( 3.14 )\n 4.0\n > y = base.ceil( -4.2 )\n -4.0\n > y = base.ceil( -4.6 )\n -4.0\n > y = base.ceil( 9.5 )\n 10.0\n > y = base.ceil( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceiln, base.floor, base.round\n",
"base.ceil2": "\nbase.ceil2( x )\n Rounds a numeric value to the nearest power of two toward positive infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil2( 3.14 )\n 4.0\n > y = base.ceil2( -4.2 )\n -4.0\n > y = base.ceil2( -4.6 )\n -4.0\n > y = base.ceil2( 9.5 )\n 16.0\n > y = base.ceil2( 13.0 )\n 16.0\n > y = base.ceil2( -13.0 )\n -8.0\n > y = base.ceil2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.ceil10, base.floor2, base.round2\n",
"base.ceil10": "\nbase.ceil10( x )\n Rounds a numeric value to the nearest power of ten toward positive infinity.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceil10( 3.14 )\n 10.0\n > y = base.ceil10( -4.2 )\n -1.0\n > y = base.ceil10( -4.6 )\n -1.0\n > y = base.ceil10( 9.5 )\n 10.0\n > y = base.ceil10( 13.0 )\n 100.0\n > y = base.ceil10( -13.0 )\n -10.0\n > y = base.ceil10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.ceil2, base.floor10, base.round10\n",
"base.ceilb": "\nbase.ceilb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward positive\n infinity.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.ceilb( 3.14159, -4, 10 )\n 3.1416\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.ceilb( 3.14159, 0, 2 )\n 4.0\n\n // Round to nearest multiple of two toward positive infinity:\n > y = base.ceilb( 5.0, 1, 2 )\n 6.0\n\n See Also\n --------\n base.ceil, base.ceiln, base.floorb, base.roundb\n",
"base.ceiln": "\nbase.ceiln( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward positive\n infinity.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.ceiln( 3.14159, -2 )\n 3.15\n\n // If `n = 0`, standard round toward positive infinity behavior:\n > y = base.ceiln( 3.14159, 0 )\n 4.0\n\n // Round to nearest thousand:\n > y = base.ceiln( 12368.0, 3 )\n 13000.0\n\n\n See Also\n --------\n base.ceil, base.ceilb, base.floorn, base.roundn\n",
"base.ceilsd": "\nbase.ceilsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward positive infinity with\n `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.ceilsd( 3.14159, 5 )\n 3.1416\n > y = base.ceilsd( 3.14159, 1 )\n 4.0\n > y = base.ceilsd( 12368.0, 2 )\n 13000.0\n > y = base.ceilsd( 0.0313, 2, 2 )\n 0.046875\n\n See Also\n --------\n base.ceil, base.floorsd, base.roundsd, base.truncsd\n",
"base.cexp": "\nbase.cexp( [out,] re, im )\n Computes the exponential function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cexp( 0.0, 0.0 )\n [ 1.0, 0.0 ]\n\n > y = base.cexp( 0.0, 1.0 )\n [ ~0.540, ~0.841 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cexp( out, 0.0, 1.0 )\n <Float64Array>[ ~0.540, ~0.841 ]\n > var bool = ( v === out )\n true\n\n",
"base.cflipsign": "\nbase.cflipsign( [out,] re, im, y )\n Returns a complex number with the same magnitude as `z` and the sign of\n `y*z`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n y: number\n Number from which to derive the sign.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Function result.\n\n Examples\n --------\n > var out = base.cflipsign( -4.2, 5.5, -9 )\n [ 4.2, -5.5 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cflipsign( out, -4.2, 5.5, 8 )\n <Float64Array>[ -4.2, 5.5 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cneg, base.csignum\n",
"base.cfloor": "\nbase.cfloor( [out,] re, im )\n Rounds a complex number toward negative infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Rounded components.\n\n Examples\n --------\n > var out = base.cfloor( 5.5, 3.3 )\n [ 5.0, 3.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cfloor( out, 5.5, 3.3 )\n <Float64Array>[ 5.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloorn, base.cround\n",
"base.cfloorn": "\nbase.cfloorn( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n` toward negative\n infinity.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.cfloorn( 5.555, -3.333, -2 )\n [ 5.55, -3.34 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cfloorn( out, 5.555, -3.333, -2 )\n <Float64Array>[ 5.55, -3.34 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloor, base.croundn\n",
"base.cinv": "\nbase.cinv( [out,] re, im )\n Computes the inverse of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var y = base.cinv( 2.0, 4.0 )\n [ 0.1, -0.2 ]\n\n > var out = new Float64Array( 2 );\n > var v = base.cinv( out, 2.0, 4.0 )\n <Float64Array>[ 0.1, -0.2 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cdiv\n",
"base.clamp": "\nbase.clamp( v, min, max )\n Restricts a value to a specified range.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Value to restrict.\n\n min: number\n Minimum value.\n\n max: number\n Maximum value.\n\n Returns\n -------\n y: number\n Restricted value.\n\n Examples\n --------\n > var y = base.clamp( 3.14, 0.0, 5.0 )\n 3.14\n > y = base.clamp( -3.14, 0.0, 5.0 )\n 0.0\n > y = base.clamp( 3.14, 0.0, 3.0 )\n 3.0\n > y = base.clamp( -0.0, 0.0, 5.0 )\n 0.0\n > y = base.clamp( 0.0, -3.14, -0.0 )\n -0.0\n > y = base.clamp( NaN, 0.0, 5.0 )\n NaN\n\n See Also\n --------\n base.wrap\n",
"base.cmul": "\nbase.cmul( [out,] re1, im1, re2, im2 )\n Multiplies two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Array containing the real and imaginary components of the result.\n\n Examples\n --------\n > var out = base.cmul( 5.0, 3.0, -2.0, 1.0 )\n [ -13.0, -1.0 ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > var v = base.cmul( out, 5.0, 3.0, -2.0, 1.0 )\n <Float64Array>[ -13.0, -1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cdiv, base.csub\n",
"base.cneg": "\nbase.cneg( [out,] re, im )\n Negates a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Negated components.\n\n Examples\n --------\n > var out = base.cneg( -4.2, 5.5 )\n [ 4.2, -5.5 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cneg( out, -4.2, 5.5 )\n <Float64Array>[ 4.2, -5.5 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cabs\n",
"base.continuedFraction": "\nbase.continuedFraction( generator[, options] )\n Evaluates the continued fraction approximation for the supplied series\n generator using the modified Lentz algorithm.\n\n `generator` can be either a function which returns an array with two\n elements, the `a` and `b` terms of the fraction, or an ES6 Generator object.\n\n By default, the function computes\n\n a1\n ---------------\n b1 + a2\n ----------\n b2 + a3\n -----\n b3 + ...\n\n To evaluate\n\n b0 +\t a1\n ---------------\n b1 +\t a2\n ----------\n b2 + a3\n -----\n b3 + ...\n\n set the `keep` option to `true`.\n\n Parameters\n ----------\n generator: Function\n Function returning terms of continued fraction expansion.\n\n options: Object (optional)\n Options.\n\n options.maxIter: integer (optional)\n Maximum number of iterations. Default: `1000000`.\n\n options.tolerance: number (optional)\n Further terms are only added as long as the next term is greater than\n current term times the tolerance. Default: `2.22e-16`.\n\n options.keep: boolean (optional)\n Boolean indicating whether to keep the `b0` term in the continued\n fraction. Default: `false`.\n\n Returns\n -------\n out: number\n Value of continued fraction.\n\n Examples\n --------\n // Continued fraction for (e-1)^(-1):\n > function closure() {\n ... var i = 0;\n ... return function() {\n ... i += 1;\n ... return [ i, i ];\n ... };\n ... };\n > var gen = closure();\n > var out = base.continuedFraction( gen )\n ~0.582\n\n // Using an ES6 generator:\n > function* generator() {\n ... var i = 0;\n ... while ( true ) {\n ... i += 1;\n ... yield [ i, i ];\n ... }\n ... };\n > gen = generator();\n > out = base.continuedFraction( gen )\n ~0.582\n\n // Set options:\n > out = base.continuedFraction( generator(), { 'keep': true } )\n ~1.718\n > out = base.continuedFraction( generator(), { 'maxIter': 10 } )\n ~0.582\n > out = base.continuedFraction( generator(), { 'tolerance': 1e-1 } )\n ~0.579\n\n",
"base.copysign": "\nbase.copysign( x, y )\n Returns a double-precision floating-point number with the magnitude of `x`\n and the sign of `y`.\n\n Parameters\n ----------\n x: number\n Number from which to derive a magnitude.\n\n y: number\n Number from which to derive a sign.\n\n Returns\n -------\n z: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var z = base.copysign( -3.14, 10.0 )\n 3.14\n > z = base.copysign( 3.14, -1.0 )\n -3.14\n > z = base.copysign( 1.0, -0.0 )\n -1.0\n > z = base.copysign( -3.14, -0.0 )\n -3.14\n > z = base.copysign( -0.0, 1.0 )\n 0.0\n\n See Also\n --------\n base.flipsign\n",
"base.cos": "\nbase.cos( x )\n Computes the cosine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Cosine.\n\n Examples\n --------\n > var y = base.cos( 0.0 )\n 1.0\n > y = base.cos( PI/4.0 )\n ~0.707\n > y = base.cos( -PI/6.0 )\n ~0.866\n > y = base.cos( NaN )\n NaN\n\n See Also\n --------\n base.cospi, base.cosm1, base.sin, base.tan\n",
"base.cosh": "\nbase.cosh( x )\n Computes the hyperbolic cosine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic cosine.\n\n Examples\n --------\n > var y = base.cosh( 0.0 )\n 1.0\n > y = base.cosh( 2.0 )\n ~3.762\n > y = base.cosh( -2.0 )\n ~3.762\n > y = base.cosh( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sinh, base.tanh\n",
"base.cosm1": "\nbase.cosm1( x )\n Computes the cosine of a number minus one.\n\n This function should be used instead of manually calculating `cos(x)-1` when\n `x` is near unity.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Cosine minus one.\n\n Examples\n --------\n > var y = base.cosm1( 0.0 )\n 0.0\n > y = base.cosm1( PI/4.0 )\n ~-0.293\n > y = base.cosm1( -PI/6.0 )\n ~-0.134\n > y = base.cosm1( NaN )\n NaN\n\n See Also\n --------\n base.cos\n",
"base.cospi": "\nbase.cospi( x )\n Computes the value of `cos(πx)`.\n\n This function computes `cos(πx)` more accurately than the obvious approach,\n especially for large `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.cospi( 0.0 )\n 1.0\n > y = base.cospi( 0.5 )\n 0.0\n > y = base.cospi( 0.1 )\n ~0.951\n > y = base.cospi( NaN )\n NaN\n\n See Also\n --------\n base.cos\n",
"base.covercos": "\nbase.covercos( x )\n Computes the coversed cosine.\n\n The coversed cosine is defined as `1 + sin(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Coversed cosine.\n\n Examples\n --------\n > var y = base.covercos( 3.14 )\n ~1.0016\n > y = base.covercos( -4.2 )\n ~1.8716\n > y = base.covercos( -4.6 )\n ~1.9937\n > y = base.covercos( 9.5 )\n ~0.9248\n > y = base.covercos( -0.0 )\n 1.0\n\n See Also\n --------\n base.coversin, base.vercos\n",
"base.coversin": "\nbase.coversin( x )\n Computes the coversed sine.\n\n The coversed sine is defined as `1 - sin(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Coversed sine.\n\n Examples\n --------\n > var y = base.coversin( 3.14 )\n ~0.9984\n > y = base.coversin( -4.2 )\n ~0.1284\n > y = base.coversin( -4.6 )\n ~0.0063\n > y = base.coversin( 9.5 )\n ~1.0752\n > y = base.coversin( -0.0 )\n 1.0\n\n See Also\n --------\n base.covercos, base.versin\n",
"base.cphase": "\nbase.cphase( re, im )\n Computes the argument of a complex number in radians.\n\n The argument of a complex number, also known as the phase, is the angle of\n the radius extending from the origin to the complex number plotted in the\n complex plane and the positive real axis.\n\n Parameters\n ----------\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n phi: number\n Argument.\n\n Examples\n --------\n > var phi = base.cphase( 5.0, 3.0 )\n ~0.5404\n\n See Also\n --------\n base.cabs\n",
"base.cpolar": "\nbase.cpolar( [out,] re, im )\n Returns the absolute value and phase of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Absolute value and phase, respectively.\n\n Examples\n --------\n > var out = base.cpolar( 5.0, 3.0 )\n [ ~5.83, ~0.5404 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cpolar( out, 5.0, 3.0 )\n <Float64Array>[ ~5.83, ~0.5404 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cabs, base.cphase\n",
"base.cround": "\nbase.cround( [out,] re, im )\n Rounds a complex number to the nearest integer.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Rounded components.\n\n Examples\n --------\n > var out = base.cround( 5.5, 3.3 )\n [ 6.0, 3.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.cround( out, 5.5, 3.3 )\n <Float64Array>[ 6.0, 3.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceil, base.cfloor, base.croundn\n",
"base.croundn": "\nbase.croundn( [out,] re, im, n )\n Rounds a complex number to the nearest multiple of `10^n`.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Real and imaginary components.\n\n Examples\n --------\n > var out = base.croundn( 5.555, -3.336, -2 )\n [ 5.56, -3.34 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.croundn( out, 5.555, -3.336, -2 )\n <Float64Array>[ 5.56, -3.34 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cceiln, base.cfloorn, base.cround\n",
"base.csignum": "\nbase.csignum( [out,] re, im )\n Evaluates the signum function of a complex number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re: number\n Real component.\n\n im: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Function result.\n\n Examples\n --------\n > var out = base.csignum( -4.2, 5.5 )\n [ -0.6069136033622302, 0.79476781392673 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.csignum( out, -4.2, 5.5 )\n <Float64Array>[ -0.6069136033622302, 0.79476781392673 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.signum\n",
"base.csub": "\nbase.csub( [out,] re1, im1, re2, im2 )\n Subtracts two complex numbers.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n re1: number\n Real component.\n\n im1: number\n Imaginary component.\n\n re2: number\n Real component.\n\n im2: number\n Imaginary component.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Array containing the real and imaginary components of the result.\n\n Examples\n --------\n > var out = base.csub( 5.0, 3.0, -2.0, 1.0 )\n [ 7.0, 2.0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.csub( out, 5.0, 3.0, -2.0, 1.0 )\n <Float64Array>[ 7.0, 2.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cadd, base.cdiv, base.cmul\n",
"base.dasum": "\nbase.dasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float64Array\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.dasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.dasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.dasum( N, x1, stride )\n 12.0\n\n\nbase.dasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float64Array\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.dasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > sum = base.dasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n\nbase.dasum.wasm( [options] )\n Returns a memory managed function to compute the sum of absolute values.\n\n For an externally defined `Float64Array`, data must be copied to the heap.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.memory: integer (optional)\n Total memory. If not provided a buffer, setting the memory option\n instructs the returned function to allocate an internal memory store of\n the specified size.\n\n options.stack: integer (optional)\n Total stack size. Must be less than the memory option and large enough\n for a program's needs. Default: `1024` bytes.\n\n options.buffer: ArrayBuffer (optional)\n `ArrayBuffer` serving as the underlying memory store. If not provided,\n each returned function will allocate and manage its own memory. If\n provided a memory option, the buffer `byteLength` must equal the\n specified total memory.\n\n Returns\n -------\n out: Function\n Memory managed function.\n\n Examples\n --------\n > var wasm = base.dasum.wasm();\n > var N = 5;\n\n // Allocate space on the heap:\n > var bytes = wasm.malloc( N * 8 );\n\n // Create a Float64Array view:\n > var view = new Float64Array( bytes.buffer, bytes.byteOffset, N );\n\n // Copy data to the heap:\n > view.set( [ 1.0, -2.0, 3.0, -4.0, 5.0 ] );\n\n // Compute the sum of absolute values (passing in the heap buffer):\n > var s = wasm( N, bytes, 1 )\n 15.0\n\n // Free the memory:\n > wasm.free( bytes );\n\n See Also\n --------\n base.daxpy, base.dcopy\n",
"base.daxpy": "\nbase.daxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.daxpy( x.length, alpha, x, 1, y, 1 )\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > base.daxpy( N, alpha, x, 2, y, -1 )\n <Float64Array>[ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.daxpy( N, 5.0, x1, -2, y1, 1 )\n <Float64Array>[ 40.0, 33.0, 22.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.daxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.daxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.daxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n <Float64Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.daxpy.wasm( [options] )\n Returns a memory managed function to multiply `x` by a constant `alpha` and\n add the result to `y`.\n\n For externally defined `Float64Arrays`, data must be copied to the heap.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.memory: integer (optional)\n Total memory. If not provided a buffer, setting the memory option\n instructs the returned function to allocate an internal memory store of\n the specified size.\n\n options.stack: integer (optional)\n Total stack size. Must be less than the memory option and large enough\n for a program's needs. Default: `1024` bytes.\n\n options.buffer: ArrayBuffer (optional)\n `ArrayBuffer` serving as the underlying memory store. If not provided,\n each returned function will allocate and manage its own memory. If\n provided a memory option, the buffer `byteLength` must equal the\n specified total memory.\n\n Returns\n -------\n out: Function\n Memory managed function.\n\n Examples\n --------\n > var wasm = base.daxpy.wasm();\n > var N = 5;\n\n // Allocate space on the heap:\n > var xbytes = wasm.malloc( N * 8 );\n > var ybytes = wasm.malloc( N * 8 );\n\n // Create Float64Array views:\n > var x = new Float64Array( xbytes.buffer, xbytes.byteOffset, N );\n > var y = new Float64Array( ybytes.buffer, ybytes.byteOffset, N );\n\n // Copy data to the heap:\n > x.set( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > y.set( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n\n // Multiply and add alpha:\n > var alpha = 5.0;\n > wasm( x.length, alpha, xbytes, 1, ybytes, 1 );\n > y\n <Float64Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Free the memory:\n > wasm.free( xbytes );\n > wasm.free( ybytes );\n\n See Also\n --------\n base.dasum, base.dcopy\n",
"base.dcopy": "\nbase.dcopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.dcopy( x.length, x, 1, y, 1 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.dcopy( N, x, -2, y, 1 )\n <Float64Array>[ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.dcopy( N, x1, -2, y1, 1 )\n <Float64Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.dcopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float64Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float64Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float64Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float64Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.dcopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.dcopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dasum, base.daxpy\n",
"base.deg2rad": "\nbase.deg2rad( x )\n Converts an angle from degrees to radians.\n\n Parameters\n ----------\n x: number\n Angle in degrees.\n\n Returns\n -------\n r: number\n Angle in radians.\n\n Examples\n --------\n > var r = base.deg2rad( 90.0 )\n ~1.571\n > r = base.deg2rad( -45.0 )\n ~-0.785\n > r = base.deg2rad( NaN )\n NaN\n\n See Also\n --------\n base.rad2deg\n",
"base.digamma": "\nbase.digamma( x )\n Evaluates the digamma function.\n\n If `x` is `0` or a negative `integer`, the `function` returns `NaN`.\n\n If provided `NaN`, the `function` returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.digamma( -2.5 )\n ~1.103\n > y = base.digamma( 1.0 )\n ~-0.577\n > y = base.digamma( 10.0 )\n ~2.252\n > y = base.digamma( NaN )\n NaN\n > y = base.digamma( -1.0 )\n NaN\n\n See Also\n --------\n base.trigamma, base.gamma\n",
"base.diracDelta": "\nbase.diracDelta( x )\n Evaluates the Dirac delta function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.diracDelta( 3.14 )\n 0.0\n > y = base.diracDelta( 0.0 )\n Infinity\n\n See Also\n --------\n base.kroneckerDelta\n",
"base.dists.arcsine.Arcsine": "\nbase.dists.arcsine.Arcsine( [a, b] )\n Returns an arcsine distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be less than `b`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a`. Default: `1.0`.\n\n Returns\n -------\n arcsine: Object\n Distribution instance.\n\n arcsine.a: number\n Minimum support. If set, the value must be less than `b`.\n\n arcsine.b: number\n Maximum support. If set, the value must be greater than `a`.\n\n arcsine.entropy: number\n Read-only property which returns the differential entropy.\n\n arcsine.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n arcsine.mean: number\n Read-only property which returns the expected value.\n\n arcsine.median: number\n Read-only property which returns the median.\n\n arcsine.mode: number\n Read-only property which returns the mode.\n\n arcsine.skewness: number\n Read-only property which returns the skewness.\n\n arcsine.stdev: number\n Read-only property which returns the standard deviation.\n\n arcsine.variance: number\n Read-only property which returns the variance.\n\n arcsine.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n arcsine.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n arcsine.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n arcsine.pdf: Function\n Evaluates the probability density function (PDF).\n\n arcsine.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var arcsine = base.dists.arcsine.Arcsine( 0.0, 1.0 );\n > arcsine.a\n 0.0\n > arcsine.b\n 1.0\n > arcsine.entropy\n ~-0.242\n > arcsine.kurtosis\n -1.5\n > arcsine.mean\n 0.5\n > arcsine.median\n 0.5\n > arcsine.mode\n 0.0\n > arcsine.skewness\n 0.0\n > arcsine.stdev\n ~0.354\n > arcsine.variance\n 0.125\n > arcsine.cdf( 0.8 )\n ~0.705\n > arcsine.logcdf( 0.8 )\n ~-0.35\n > arcsine.logpdf( 0.4 )\n ~-0.431\n > arcsine.pdf( 0.8 )\n ~0.796\n > arcsine.quantile( 0.8 )\n ~0.905\n\n",
"base.dists.arcsine.cdf": "\nbase.dists.arcsine.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for an arcsine\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.cdf( 9.0, 0.0, 10.0 )\n ~0.795\n > y = base.dists.arcsine.cdf( 0.5, 0.0, 2.0 )\n ~0.333\n > y = base.dists.arcsine.cdf( PINF, 2.0, 4.0 )\n 1.0\n > y = base.dists.arcsine.cdf( NINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.cdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.arcsine.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an arcsine distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.arcsine.cdf.factory( 0.0, 10.0 );\n > var y = mycdf( 0.5 )\n ~0.144\n > y = mycdf( 8.0 )\n ~0.705\n\n",
"base.dists.arcsine.entropy": "\nbase.dists.arcsine.entropy( a, b )\n Returns the differential entropy of an arcsine distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.arcsine.entropy( 0.0, 1.0 )\n ~-0.242\n > v = base.dists.arcsine.entropy( 4.0, 12.0 )\n ~1.838\n > v = base.dists.arcsine.entropy( 2.0, 8.0 )\n ~1.55\n\n",
"base.dists.arcsine.kurtosis": "\nbase.dists.arcsine.kurtosis( a, b )\n Returns the excess kurtosis of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.arcsine.kurtosis( 0.0, 1.0 )\n -1.5\n > v = base.dists.arcsine.kurtosis( 4.0, 12.0 )\n -1.5\n > v = base.dists.arcsine.kurtosis( 2.0, 8.0 )\n -1.5\n\n",
"base.dists.arcsine.logcdf": "\nbase.dists.arcsine.logcdf( x, a, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for an\n arcsine distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.logcdf( 9.0, 0.0, 10.0 )\n ~-0.229\n > y = base.dists.arcsine.logcdf( 0.5, 0.0, 2.0 )\n ~-1.1\n > y = base.dists.arcsine.logcdf( PINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.logcdf( NINF, 2.0, 4.0 )\n -Infinity\n > y = base.dists.arcsine.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.logcdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.arcsine.logcdf.factory( a, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of an arcsine distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.arcsine.logcdf.factory( 0.0, 10.0 );\n > var y = mylogcdf( 0.5 )\n ~-1.941\n > y = mylogcdf( 8.0 )\n ~-0.35\n\n",
"base.dists.arcsine.logpdf": "\nbase.dists.arcsine.logpdf( x, a, b )\n Evaluates the logarithm of the probability density function (PDF) for an\n arcsine distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.logpdf( 2.0, 0.0, 4.0 )\n ~-1.838\n > y = base.dists.arcsine.logpdf( 5.0, 0.0, 4.0 )\n -Infinity\n > y = base.dists.arcsine.logpdf( 0.25, 0.0, 1.0 )\n ~-0.308\n > y = base.dists.arcsine.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.logpdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.logpdf.factory( a, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of an arcsine distribution with minimum support `a` and\n maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.arcsine.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 7.0 )\n Infinity\n > y = mylogPDF( 5.0 )\n -Infinity\n\n",
"base.dists.arcsine.mean": "\nbase.dists.arcsine.mean( a, b )\n Returns the expected value of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.arcsine.mean( 0.0, 1.0 )\n 0.5\n > v = base.dists.arcsine.mean( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.mean( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.arcsine.median": "\nbase.dists.arcsine.median( a, b )\n Returns the median of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.arcsine.median( 0.0, 1.0 )\n 0.5\n > v = base.dists.arcsine.median( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.median( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.arcsine.mode": "\nbase.dists.arcsine.mode( a, b )\n Returns the mode of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.arcsine.mode( 0.0, 1.0 )\n 0.0\n > v = base.dists.arcsine.mode( 4.0, 12.0 )\n 4.0\n > v = base.dists.arcsine.mode( 2.0, 8.0 )\n 2.0\n\n",
"base.dists.arcsine.pdf": "\nbase.dists.arcsine.pdf( x, a, b )\n Evaluates the probability density function (PDF) for an arcsine distribution\n with minimum support `a` and maximum support `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.arcsine.pdf( 2.0, 0.0, 4.0 )\n ~0.159\n > y = base.dists.arcsine.pdf( 5.0, 0.0, 4.0 )\n 0.0\n > y = base.dists.arcsine.pdf( 0.25, 0.0, 1.0 )\n ~0.735\n > y = base.dists.arcsine.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.arcsine.pdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF) of\n an arcsine distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.arcsine.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n Infinity\n > y = myPDF( 5.0 )\n 0.0\n\n",
"base.dists.arcsine.quantile": "\nbase.dists.arcsine.quantile( p, a, b )\n Evaluates the quantile function for an arcsine distribution with minimum\n support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.arcsine.quantile( 0.8, 0.0, 1.0 )\n ~0.905\n > y = base.dists.arcsine.quantile( 0.5, 0.0, 10.0 )\n ~5.0\n\n > y = base.dists.arcsine.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.arcsine.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.arcsine.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.arcsine.quantile( 0.5, 2.0, 1.0 )\n NaN\n\n\nbase.dists.arcsine.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of an arcsine\n distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.arcsine.quantile.factory( 0.0, 4.0 );\n > var y = myQuantile( 0.8 )\n ~3.618\n\n",
"base.dists.arcsine.skewness": "\nbase.dists.arcsine.skewness( a, b )\n Returns the skewness of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.arcsine.skewness( 0.0, 1.0 )\n 0.0\n > v = base.dists.arcsine.skewness( 4.0, 12.0 )\n 0.0\n > v = base.dists.arcsine.skewness( 2.0, 8.0 )\n 0.0\n\n",
"base.dists.arcsine.stdev": "\nbase.dists.arcsine.stdev( a, b )\n Returns the standard deviation of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.arcsine.stdev( 0.0, 1.0 )\n ~0.354\n > v = base.dists.arcsine.stdev( 4.0, 12.0 )\n ~2.828\n > v = base.dists.arcsine.stdev( 2.0, 8.0 )\n ~2.121\n\n",
"base.dists.arcsine.variance": "\nbase.dists.arcsine.variance( a, b )\n Returns the variance of an arcsine distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.arcsine.variance( 0.0, 1.0 )\n ~0.125\n > v = base.dists.arcsine.variance( 4.0, 12.0 )\n 8.0\n > v = base.dists.arcsine.variance( 2.0, 8.0 )\n ~4.5\n\n",
"base.dists.bernoulli.Bernoulli": "\nbase.dists.bernoulli.Bernoulli( [p] )\n Returns a Bernoulli distribution object.\n\n Parameters\n ----------\n p: number (optional)\n Success probability. Must be between `0` and `1`. Default: `0.5`.\n\n Returns\n -------\n bernoulli: Object\n Distribution instance.\n\n bernoulli.p: number\n Success probability. If set, the value must be between `0` and `1`.\n\n bernoulli.entropy: number\n Read-only property which returns the differential entropy.\n\n bernoulli.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n bernoulli.mean: number\n Read-only property which returns the expected value.\n\n bernoulli.median: number\n Read-only property which returns the median.\n\n bernoulli.skewness: number\n Read-only property which returns the skewness.\n\n bernoulli.stdev: number\n Read-only property which returns the standard deviation.\n\n bernoulli.variance: number\n Read-only property which returns the variance.\n\n bernoulli.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n bernoulli.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n bernoulli.pmf: Function\n Evaluates the probability mass function (PMF).\n\n bernoulli.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var bernoulli = base.dists.bernoulli.Bernoulli( 0.6 );\n > bernoulli.p\n 0.6\n > bernoulli.entropy\n ~0.673\n > bernoulli.kurtosis\n ~-1.833\n > bernoulli.mean\n 0.6\n > bernoulli.median\n 1.0\n > bernoulli.skewness\n ~-0.408\n > bernoulli.stdev\n ~0.49\n > bernoulli.variance\n ~0.24\n > bernoulli.cdf( 0.5 )\n 0.4\n > bernoulli.mgf( 3.0 )\n ~12.451\n > bernoulli.pmf( 0.0 )\n 0.4\n > bernoulli.quantile( 0.7 )\n 1.0\n\n",
"base.dists.bernoulli.cdf": "\nbase.dists.bernoulli.cdf( x, p )\n Evaluates the cumulative distribution function (CDF) for a Bernoulli\n distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.cdf( 0.5, 0.5 )\n 0.5\n > y = base.dists.bernoulli.cdf( 0.8, 0.1 )\n 0.9\n > y = base.dists.bernoulli.cdf( -1.0, 0.4 )\n 0.0\n > y = base.dists.bernoulli.cdf( 1.5, 0.4 )\n 1.0\n > y = base.dists.bernoulli.cdf( NaN, 0.5 )\n NaN\n > y = base.dists.bernoulli.cdf( 0.0, NaN )\n NaN\n // Invalid probability:\n > y = base.dists.bernoulli.cdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.bernoulli.cdf.factory( p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.bernoulli.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n 1.0\n > y = mycdf( 0.7 )\n 0.5\n\n",
"base.dists.bernoulli.entropy": "\nbase.dists.bernoulli.entropy( p )\n Returns the entropy of a Bernoulli distribution with success probability\n `p` (in nats).\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.bernoulli.entropy( 0.1 )\n ~0.325\n > v = base.dists.bernoulli.entropy( 0.5 )\n ~0.693\n\n",
"base.dists.bernoulli.kurtosis": "\nbase.dists.bernoulli.kurtosis( p )\n Returns the excess kurtosis of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.bernoulli.kurtosis( 0.1 )\n ~5.111\n > v = base.dists.bernoulli.kurtosis( 0.5 )\n -2.0\n\n",
"base.dists.bernoulli.mean": "\nbase.dists.bernoulli.mean( p )\n Returns the expected value of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.bernoulli.mean( 0.1 )\n 0.1\n > v = base.dists.bernoulli.mean( 0.5 )\n 0.5\n\n",
"base.dists.bernoulli.median": "\nbase.dists.bernoulli.median( p )\n Returns the median of a Bernoulli distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.bernoulli.median( 0.1 )\n 0\n > v = base.dists.bernoulli.median( 0.8 )\n 1\n\n",
"base.dists.bernoulli.mgf": "\nbase.dists.bernoulli.mgf( t, p )\n Evaluates the moment-generating function (MGF) for a Bernoulli\n distribution with success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.mgf( 0.2, 0.5 )\n ~1.111\n > y = base.dists.bernoulli.mgf( 0.4, 0.5 )\n ~1.246\n > y = base.dists.bernoulli.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.bernoulli.mgf( 0.0, NaN )\n NaN\n > y = base.dists.bernoulli.mgf( -2.0, -1.0 )\n NaN\n > y = base.dists.bernoulli.mgf( 0.2, 2.0 )\n NaN\n\n\nbase.dists.bernoulli.mgf.factory( p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.bernoulli.mgf.factory( 0.8 );\n > var y = mymgf( -0.2 )\n ~0.855\n\n",
"base.dists.bernoulli.mode": "\nbase.dists.bernoulli.mode( p )\n Returns the mode of a Bernoulli distribution with success probability `p`.\n\n For `p = 0.5`, the mode is either `0` or `1`. This implementation returns\n `0` for `p = 0.5`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.bernoulli.mode( 0.1 )\n 0\n > v = base.dists.bernoulli.mode( 0.8 )\n 1\n\n",
"base.dists.bernoulli.pmf": "\nbase.dists.bernoulli.pmf( x, p )\n Evaluates the probability mass function (PMF) for a Bernoulli distribution\n with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.bernoulli.pmf( 1.0, 0.3 )\n 0.3\n > y = base.dists.bernoulli.pmf( 0.0, 0.7 )\n 0.3\n > y = base.dists.bernoulli.pmf( -1.0, 0.5 )\n 0.0\n > y = base.dists.bernoulli.pmf( 0.0, NaN )\n NaN\n > y = base.dists.bernoulli.pmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.bernoulli.pmf( 0.0, 1.5 )\n NaN\n\n\nbase.dists.bernoulli.pmf.factory( p )\n Returns a function for evaluating the probability mass function (PMF) of a\n Bernoulli distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.bernoulli.pmf.factory( 0.5 );\n > var y = mypmf( 1.0 )\n 0.5\n > y = mypmf( 0.0 )\n 0.5\n\n",
"base.dists.bernoulli.quantile": "\nbase.dists.bernoulli.quantile( r, p )\n Evaluates the quantile function for a Bernoulli distribution with success\n probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.bernoulli.quantile( 0.8, 0.4 )\n 1\n > y = base.dists.bernoulli.quantile( 0.5, 0.4 )\n 0\n > y = base.dists.bernoulli.quantile( 0.9, 0.1 )\n 0\n\n > y = base.dists.bernoulli.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.bernoulli.quantile( NaN, 0.8 )\n NaN\n > y = base.dists.bernoulli.quantile( 0.4, NaN )\n NaN\n\n > y = base.dists.bernoulli.quantile( 0.5, -1.0 )\n NaN\n > y = base.dists.bernoulli.quantile( 0.5, 1.5 )\n NaN\n\n\nbase.dists.bernoulli.quantile.factory( p )\n Returns a function for evaluating the quantile function of a Bernoulli\n distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.bernoulli.quantile.factory( 0.4 );\n > var y = myquantile( 0.4 )\n 0\n > y = myquantile( 0.8 )\n 1\n > y = myquantile( 1.0 )\n 1\n\n",
"base.dists.bernoulli.skewness": "\nbase.dists.bernoulli.skewness( p )\n Returns the skewness of a Bernoulli distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.bernoulli.skewness( 0.1 )\n ~2.667\n > v = base.dists.bernoulli.skewness( 0.5 )\n 0.0\n\n",
"base.dists.bernoulli.stdev": "\nbase.dists.bernoulli.stdev( p )\n Returns the standard deviation of a Bernoulli distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.bernoulli.stdev( 0.1 )\n ~0.3\n > v = base.dists.bernoulli.stdev( 0.5 )\n 0.5\n\n",
"base.dists.bernoulli.variance": "\nbase.dists.bernoulli.variance( p )\n Returns the variance of a Bernoulli distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.bernoulli.variance( 0.1 )\n ~0.09\n > v = base.dists.bernoulli.variance( 0.5 )\n 0.25\n\n",
"base.dists.beta.Beta": "\nbase.dists.beta.Beta( [α, β] )\n Returns a beta distribution object.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n beta: Object\n Distribution instance.\n\n beta.alpha: number\n First shape parameter. If set, the value must be greater than `0`.\n\n beta.beta: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n beta.entropy: number\n Read-only property which returns the differential entropy.\n\n beta.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n beta.mean: number\n Read-only property which returns the expected value.\n\n beta.median: number\n Read-only property which returns the median.\n\n beta.mode: number\n Read-only property which returns the mode.\n\n beta.skewness: number\n Read-only property which returns the skewness.\n\n beta.stdev: number\n Read-only property which returns the standard deviation.\n\n beta.variance: number\n Read-only property which returns the variance.\n\n beta.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n beta.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n beta.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n beta.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n beta.pdf: Function\n Evaluates the probability density function (PDF).\n\n beta.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var beta = base.dists.beta.Beta( 1.0, 1.0 );\n > beta.alpha\n 1.0\n > beta.beta\n 1.0\n > beta.entropy\n 0.0\n > beta.kurtosis\n -1.2\n > beta.mean\n 0.5\n > beta.median\n 0.5\n > beta.mode\n NaN\n > beta.skewness\n 0.0\n > beta.stdev\n ~0.289\n > beta.variance\n ~0.0833\n > beta.cdf( 0.8 )\n 0.8\n > beta.logcdf( 0.8 )\n ~-0.223\n > beta.logpdf( 1.0 )\n 0.0\n > beta.mgf( 3.14 )\n ~7.0394\n > beta.pdf( 1.0 )\n 1.0\n > beta.quantile( 0.8 )\n 0.8\n\n",
"base.dists.beta.cdf": "\nbase.dists.beta.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a beta distribution\n with first shape parameter `α` and second shape parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.beta.cdf( 0.5, 1.0, 1.0 )\n 0.5\n > y = base.dists.beta.cdf( 0.5, 2.0, 4.0 )\n ~0.813\n > y = base.dists.beta.cdf( 0.2, 2.0, 2.0 )\n ~0.104\n > y = base.dists.beta.cdf( 0.8, 4.0, 4.0 )\n ~0.967\n > y = base.dists.beta.cdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.beta.cdf( 1.5, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.beta.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a beta distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.beta.cdf.factory( 0.5, 0.5 );\n > var y = mycdf( 0.8 )\n ~0.705\n > y = mycdf( 0.3 )\n ~0.369\n\n",
"base.dists.beta.entropy": "\nbase.dists.beta.entropy( α, β )\n Returns the differential entropy of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.beta.entropy( 1.0, 1.0 )\n 0.0\n > v = base.dists.beta.entropy( 4.0, 12.0 )\n ~-0.869\n > v = base.dists.beta.entropy( 8.0, 2.0 )\n ~-0.795\n\n > v = base.dists.beta.entropy( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.entropy( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.entropy( 2.0, NaN )\n NaN\n > v = base.dists.beta.entropy( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.kurtosis": "\nbase.dists.beta.kurtosis( α, β )\n Returns the excess kurtosis of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.beta.kurtosis( 1.0, 1.0 )\n -1.2\n > v = base.dists.beta.kurtosis( 4.0, 12.0 )\n ~0.082\n > v = base.dists.beta.kurtosis( 8.0, 2.0 )\n ~0.490\n\n > v = base.dists.beta.kurtosis( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.kurtosis( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.kurtosis( 2.0, NaN )\n NaN\n > v = base.dists.beta.kurtosis( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.logcdf": "\nbase.dists.beta.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a beta distribution with first shape parameter `α` and second\n shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.beta.logcdf( 0.5, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.beta.logcdf( 0.5, 2.0, 4.0 )\n ~-0.208\n > y = base.dists.beta.logcdf( 0.2, 2.0, 2.0 )\n ~-2.263\n > y = base.dists.beta.logcdf( 0.8, 4.0, 4.0 )\n ~-0.034\n > y = base.dists.beta.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.beta.logcdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.beta.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a beta distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.beta.logcdf.factory( 0.5, 0.5 );\n > var y = mylogcdf( 0.8 )\n ~-0.35\n > y = mylogcdf( 0.3 )\n ~-0.997\n\n",
"base.dists.beta.logpdf": "\nbase.dists.beta.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a beta distribution with first shape parameter `α` and second shape\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.beta.logpdf( 0.5, 1.0, 1.0 )\n 0.0\n > y = base.dists.beta.logpdf( 0.5, 2.0, 4.0 )\n ~0.223\n > y = base.dists.beta.logpdf( 0.2, 2.0, 2.0 )\n ~-0.041\n > y = base.dists.beta.logpdf( 0.8, 4.0, 4.0 )\n ~-0.556\n > y = base.dists.beta.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.beta.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.beta.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a beta distribution with first shape parameter `α`\n and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n fcn: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogpdf = base.dists.beta.logpdf.factory( 0.5, 0.5 );\n > var y = mylogpdf( 0.8 )\n ~-0.228\n > y = mylogpdf( 0.3 )\n ~-0.364\n\n",
"base.dists.beta.mean": "\nbase.dists.beta.mean( α, β )\n Returns the expected value of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.beta.mean( 1.0, 1.0 )\n 0.5\n > v = base.dists.beta.mean( 4.0, 12.0 )\n 0.25\n > v = base.dists.beta.mean( 8.0, 2.0 )\n 0.8\n\n",
"base.dists.beta.median": "\nbase.dists.beta.median( α, β )\n Returns the median of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.beta.median( 1.0, 1.0 )\n 0.5\n > v = base.dists.beta.median( 4.0, 12.0 )\n ~0.239\n > v = base.dists.beta.median( 8.0, 2.0 )\n ~0.820\n\n > v = base.dists.beta.median( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.median( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.median( 2.0, NaN )\n NaN\n > v = base.dists.beta.median( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.mgf": "\nbase.dists.beta.mgf( t, α, β )\n Evaluates the moment-generating function (MGF) for a beta distribution with\n first shape parameter `α` and second shape parameter `β` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.beta.mgf( 0.5, 1.0, 1.0 )\n ~1.297\n > y = base.dists.beta.mgf( 0.5, 2.0, 4.0 )\n ~1.186\n > y = base.dists.beta.mgf( 3.0, 2.0, 2.0 )\n ~5.575\n > y = base.dists.beta.mgf( -0.8, 4.0, 4.0 )\n ~0.676\n\n > y = base.dists.beta.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.beta.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.beta.mgf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.mgf( 2.0, 0.0, 0.5 )\n NaN\n\n > y = base.dists.beta.mgf( 2.0, 0.5, -1.0 )\n NaN\n > y = base.dists.beta.mgf( 2.0, 0.5, 0.0 )\n NaN\n\n\nbase.dists.beta.mgf.factory( α, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n beta distribution with first shape parameter `α` and second shape parameter\n `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.beta.mgf.factory( 0.5, 0.5 );\n > var y = myMGF( 0.8 )\n ~1.552\n > y = myMGF( 0.3 )\n ~1.168\n\n",
"base.dists.beta.mode": "\nbase.dists.beta.mode( α, β )\n Returns the mode of a beta distribution.\n\n If `α <= 1` or `β <= 1`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.beta.mode( 4.0, 12.0 )\n ~0.214\n > v = base.dists.beta.mode( 8.0, 2.0 )\n ~0.875\n > v = base.dists.beta.mode( 1.0, 1.0 )\n NaN\n\n",
"base.dists.beta.pdf": "\nbase.dists.beta.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a beta distribution\n with first shape parameter `α` and second shape parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.beta.pdf( 0.5, 1.0, 1.0 )\n 1.0\n > y = base.dists.beta.pdf( 0.5, 2.0, 4.0 )\n 1.25\n > y = base.dists.beta.pdf( 0.2, 2.0, 2.0 )\n ~0.96\n > y = base.dists.beta.pdf( 0.8, 4.0, 4.0 )\n ~0.573\n > y = base.dists.beta.pdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.beta.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.beta.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.beta.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.beta.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.beta.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a beta distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.beta.pdf.factory( 0.5, 0.5 );\n > var y = mypdf( 0.8 )\n ~0.796\n > y = mypdf( 0.3 )\n ~0.695\n\n",
"base.dists.beta.quantile": "\nbase.dists.beta.quantile( p, α, β )\n Evaluates the quantile function for a beta distribution with first shape\n parameter `α` and second shape parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value (probability).\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.beta.quantile( 0.8, 2.0, 1.0 )\n ~0.894\n > y = base.dists.beta.quantile( 0.5, 4.0, 2.0 )\n ~0.686\n > y = base.dists.beta.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.beta.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.beta.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.beta.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.beta.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a beta\n distribution with first shape parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.beta.quantile.factory( 2.0, 2.0 );\n > y = myquantile( 0.8 )\n ~0.713\n > y = myquantile( 0.4 )\n ~0.433\n\n",
"base.dists.beta.skewness": "\nbase.dists.beta.skewness( α, β )\n Returns the skewness of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.beta.skewness( 1.0, 1.0 )\n 0.0\n > v = base.dists.beta.skewness( 4.0, 12.0 )\n ~0.529\n > v = base.dists.beta.skewness( 8.0, 2.0 )\n ~-0.829\n\n > v = base.dists.beta.skewness( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.skewness( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.skewness( 2.0, NaN )\n NaN\n > v = base.dists.beta.skewness( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.stdev": "\nbase.dists.beta.stdev( α, β )\n Returns the standard deviation of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.beta.stdev( 1.0, 1.0 )\n ~0.289\n > v = base.dists.beta.stdev( 4.0, 12.0 )\n ~0.105\n > v = base.dists.beta.stdev( 8.0, 2.0 )\n ~0.121\n\n > v = base.dists.beta.stdev( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.stdev( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.stdev( 2.0, NaN )\n NaN\n > v = base.dists.beta.stdev( NaN, 2.0 )\n NaN\n\n",
"base.dists.beta.variance": "\nbase.dists.beta.variance( α, β )\n Returns the variance of a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.beta.variance( 1.0, 1.0 )\n ~0.083\n > v = base.dists.beta.variance( 4.0, 12.0 )\n ~0.011\n > v = base.dists.beta.variance( 8.0, 2.0 )\n ~0.015\n\n > v = base.dists.beta.variance( 1.0, -0.1 )\n NaN\n > v = base.dists.beta.variance( -0.1, 1.0 )\n NaN\n\n > v = base.dists.beta.variance( 2.0, NaN )\n NaN\n > v = base.dists.beta.variance( NaN, 2.0 )\n NaN\n\n",
"base.dists.betaprime.BetaPrime": "\nbase.dists.betaprime.BetaPrime( [α, β] )\n Returns a beta prime distribution object.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n betaprime: Object\n Distribution instance.\n\n betaprime.alpha: number\n First shape parameter. If set, the value must be greater than `0`.\n\n betaprime.beta: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n betaprime.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n betaprime.mean: number\n Read-only property which returns the expected value.\n\n betaprime.mode: number\n Read-only property which returns the mode.\n\n betaprime.skewness: number\n Read-only property which returns the skewness.\n\n betaprime.stdev: number\n Read-only property which returns the standard deviation.\n\n betaprime.variance: number\n Read-only property which returns the variance.\n\n betaprime.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n betaprime.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n betaprime.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n betaprime.pdf: Function\n Evaluates the probability density function (PDF).\n\n betaprime.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var betaprime = base.dists.betaprime.BetaPrime( 6.0, 5.0 );\n > betaprime.alpha\n 6.0\n > betaprime.beta\n 5.0\n > betaprime.kurtosis\n 44.4\n > betaprime.mean\n 1.5\n > betaprime.mode\n ~0.833\n > betaprime.skewness\n ~3.578\n > betaprime.stdev\n ~1.118\n > betaprime.variance\n 1.25\n > betaprime.cdf( 0.8 )\n ~0.25\n > betaprime.logcdf( 0.8 )\n ~-1.387\n > betaprime.logpdf( 1.0 )\n ~-0.486\n > betaprime.pdf( 1.0 )\n ~0.615\n > betaprime.quantile( 0.8 )\n ~2.06\n\n",
"base.dists.betaprime.cdf": "\nbase.dists.betaprime.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.cdf( 0.5, 1.0, 1.0 )\n ~0.333\n > y = base.dists.betaprime.cdf( 0.5, 2.0, 4.0 )\n ~0.539\n > y = base.dists.betaprime.cdf( 0.2, 2.0, 2.0 )\n ~0.074\n > y = base.dists.betaprime.cdf( 0.8, 4.0, 4.0 )\n ~0.38\n > y = base.dists.betaprime.cdf( -0.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.betaprime.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a beta prime distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.betaprime.cdf.factory( 0.5, 0.5 );\n > var y = mycdf( 0.8 )\n ~0.465\n > y = mycdf( 0.3 )\n ~0.319\n\n",
"base.dists.betaprime.kurtosis": "\nbase.dists.betaprime.kurtosis( α, β )\n Returns the excess kurtosis of a beta prime distribution.\n\n If `α <= 0` or `β <= 4`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var v = base.dists.betaprime.kurtosis( 2.0, 6.0 )\n ~26.143\n > v = base.dists.betaprime.kurtosis( 4.0, 12.0 )\n ~5.764\n > v = base.dists.betaprime.kurtosis( 8.0, 6.0 )\n ~19.962\n\n > v = base.dists.betaprime.kurtosis( 1.0, 2.8 )\n NaN\n > v = base.dists.betaprime.kurtosis( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.kurtosis( -0.1, 5.0 )\n NaN\n\n > v = base.dists.betaprime.kurtosis( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.kurtosis( NaN, 6.0 )\n NaN\n\n",
"base.dists.betaprime.logcdf": "\nbase.dists.betaprime.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a beta prime distribution with first shape parameter `α` and\n second shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.logcdf( 0.5, 1.0, 1.0 )\n ~-1.099\n > y = base.dists.betaprime.logcdf( 0.5, 2.0, 4.0 )\n ~-0.618\n > y = base.dists.betaprime.logcdf( 0.2, 2.0, 2.0 )\n ~-2.603\n > y = base.dists.betaprime.logcdf( 0.8, 4.0, 4.0 )\n ~-0.968\n > y = base.dists.betaprime.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.betaprime.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a beta prime distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.betaprime.logcdf.factory( 0.5, 0.5 );\n > var y = mylogcdf( 0.8 )\n ~-0.767\n > y = mylogcdf( 0.3 )\n ~-1.143\n\n",
"base.dists.betaprime.logpdf": "\nbase.dists.betaprime.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a beta prime distribution with first shape parameter `α` and second\n shape parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.logpdf( 0.5, 1.0, 1.0 )\n ~-0.811\n > y = base.dists.betaprime.logpdf( 0.5, 2.0, 4.0 )\n ~-0.13\n > y = base.dists.betaprime.logpdf( 0.2, 2.0, 2.0 )\n ~-0.547\n > y = base.dists.betaprime.logpdf( 0.8, 4.0, 4.0 )\n ~-0.43\n > y = base.dists.betaprime.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.betaprime.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a beta prime distribution with first shape\n parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n fcn: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogpdf = base.dists.betaprime.logpdf.factory( 0.5, 0.5 );\n > var y = mylogpdf( 0.8 )\n ~-1.62\n > y = mylogpdf( 0.3 )\n ~-0.805\n\n",
"base.dists.betaprime.mean": "\nbase.dists.betaprime.mean( α, β )\n Returns the expected value of a beta prime distribution.\n\n If `α <= 0` or `β <= 1`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.betaprime.mean( 1.0, 2.0 )\n 1.0\n > v = base.dists.betaprime.mean( 4.0, 12.0 )\n ~0.364\n > v = base.dists.betaprime.mean( 8.0, 2.0 )\n 8.0\n\n",
"base.dists.betaprime.mode": "\nbase.dists.betaprime.mode( α, β )\n Returns the mode of a beta prime distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.betaprime.mode( 1.0, 2.0 )\n 0.0\n > v = base.dists.betaprime.mode( 4.0, 12.0 )\n ~0.231\n > v = base.dists.betaprime.mode( 8.0, 2.0 )\n ~2.333\n\n",
"base.dists.betaprime.pdf": "\nbase.dists.betaprime.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.betaprime.pdf( 0.5, 1.0, 1.0 )\n ~0.444\n > y = base.dists.betaprime.pdf( 0.5, 2.0, 4.0 )\n ~0.878\n > y = base.dists.betaprime.pdf( 0.2, 2.0, 2.0 )\n ~0.579\n > y = base.dists.betaprime.pdf( 0.8, 4.0, 4.0 )\n ~0.65\n > y = base.dists.betaprime.pdf( -0.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.betaprime.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.betaprime.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.betaprime.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a beta prime distribution with first shape parameter `α` and second shape\n parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.betaprime.pdf.factory( 0.5, 0.5 );\n > var y = mypdf( 0.8 )\n ~0.198\n > y = mypdf( 0.3 )\n ~0.447\n\n",
"base.dists.betaprime.quantile": "\nbase.dists.betaprime.quantile( p, α, β )\n Evaluates the quantile function for a beta prime distribution with first\n shape parameter `α` and second shape parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value (probability).\n\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.betaprime.quantile( 0.8, 2.0, 1.0 )\n ~8.472\n > y = base.dists.betaprime.quantile( 0.5, 4.0, 2.0 )\n ~2.187\n > y = base.dists.betaprime.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.betaprime.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.betaprime.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.betaprime.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.betaprime.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a beta prime\n distribution with first shape parameter `α` and second shape parameter `β`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.betaprime.quantile.factory( 2.0, 2.0 );\n > y = myQuantile( 0.8 )\n ~2.483\n > y = myQuantile( 0.4 )\n ~0.763\n\n",
"base.dists.betaprime.skewness": "\nbase.dists.betaprime.skewness( α, β )\n Returns the skewness of a beta prime distribution.\n\n If `α <= 0` or `β <= 3`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.betaprime.skewness( 2.0, 4.0 )\n ~6.261\n > v = base.dists.betaprime.skewness( 4.0, 12.0 )\n ~1.724\n > v = base.dists.betaprime.skewness( 8.0, 4.0 )\n ~5.729\n\n > v = base.dists.betaprime.skewness( 1.0, 2.8 )\n NaN\n > v = base.dists.betaprime.skewness( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.skewness( -0.1, 4.0 )\n NaN\n\n > v = base.dists.betaprime.skewness( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.skewness( NaN, 4.0 )\n NaN\n\n",
"base.dists.betaprime.stdev": "\nbase.dists.betaprime.stdev( α, β )\n Returns the standard deviation of a beta prime distribution.\n\n If `α <= 0` or `β <= 2`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.betaprime.stdev( 1.0, 2.5 )\n ~1.491\n > v = base.dists.betaprime.stdev( 4.0, 12.0 )\n ~0.223\n > v = base.dists.betaprime.stdev( 8.0, 2.5 )\n ~8.219\n\n > v = base.dists.betaprime.stdev( 8.0, 1.0 )\n NaN\n > v = base.dists.betaprime.stdev( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.stdev( -0.1, 3.0 )\n NaN\n\n > v = base.dists.betaprime.stdev( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.stdev( NaN, 3.0 )\n NaN\n\n",
"base.dists.betaprime.variance": "\nbase.dists.betaprime.variance( α, β )\n Returns the variance of a beta prime distribution.\n\n If `α <= 0` or `β <= 2`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.betaprime.variance( 1.0, 2.5 )\n ~2.222\n > v = base.dists.betaprime.variance( 4.0, 12.0 )\n ~0.05\n > v = base.dists.betaprime.variance( 8.0, 2.5 )\n ~67.556\n\n > v = base.dists.betaprime.variance( 8.0, 1.0 )\n NaN\n > v = base.dists.betaprime.variance( 1.0, -0.1 )\n NaN\n > v = base.dists.betaprime.variance( -0.1, 3.0 )\n NaN\n\n > v = base.dists.betaprime.variance( 2.0, NaN )\n NaN\n > v = base.dists.betaprime.variance( NaN, 3.0 )\n NaN\n\n",
"base.dists.binomial.Binomial": "\nbase.dists.binomial.Binomial( [n, p] )\n Returns a binomial distribution object.\n\n Parameters\n ----------\n n: integer (optional)\n Number of trials. Must be a positive integer. Default: `1`.\n\n p: number (optional)\n Success probability. Must be a number between `0` and `1`. Default:\n `0.5`.\n\n Returns\n -------\n binomial: Object\n Distribution instance.\n\n binomial.n: number\n Number of trials. If set, the value must be a positive integer.\n\n binomial.p: number\n Success probability. If set, the value must be a number between `0` and\n `1`.\n\n binomial.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n binomial.mean: number\n Read-only property which returns the expected value.\n\n binomial.median: number\n Read-only property which returns the median.\n\n binomial.mode: number\n Read-only property which returns the mode.\n\n binomial.skewness: number\n Read-only property which returns the skewness.\n\n binomial.stdev: number\n Read-only property which returns the standard deviation.\n\n binomial.variance: number\n Read-only property which returns the variance.\n\n binomial.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n binomial.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n binomial.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n binomial.pmf: Function\n Evaluates the probability mass function (PMF).\n\n binomial.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var binomial = base.dists.binomial.Binomial( 8, 0.5 );\n > binomial.n\n 8.0\n > binomial.p\n 0.5\n > binomial.kurtosis\n -0.25\n > binomial.mean\n 4.0\n > binomial.median\n 4.0\n > binomial.mode\n 4.0\n > binomial.skewness\n 0.0\n > binomial.stdev\n ~1.414\n > binomial.variance\n 2.0\n > binomial.cdf( 2.9 )\n ~0.145\n > binomial.logpmf( 3.0 )\n ~-1.52\n > binomial.mgf( 0.2 )\n ~2.316\n > binomial.pmf( 3.0 )\n ~0.219\n > binomial.quantile( 0.8 )\n 5.0\n\n",
"base.dists.binomial.cdf": "\nbase.dists.binomial.cdf( x, n, p )\n Evaluates the cumulative distribution function (CDF) for a binomial\n distribution with number of trials `n` and success probability `p` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.binomial.cdf( 3.0, 20, 0.2 )\n ~0.411\n > y = base.dists.binomial.cdf( 21.0, 20, 0.2 )\n 1.0\n > y = base.dists.binomial.cdf( 5.0, 10, 0.4 )\n ~0.834\n > y = base.dists.binomial.cdf( 0.0, 10, 0.4 )\n ~0.006\n > y = base.dists.binomial.cdf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.cdf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.cdf.factory( n, p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a binomial distribution with number of trials `n` and success probability\n `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.binomial.cdf.factory( 10, 0.5 );\n > var y = mycdf( 3.0 )\n ~0.172\n > y = mycdf( 1.0 )\n ~0.011\n\n",
"base.dists.binomial.entropy": "\nbase.dists.binomial.entropy( n, p )\n Returns the entropy of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.binomial.entropy( 100, 0.1 )\n ~2.511\n > v = base.dists.binomial.entropy( 20, 0.5 )\n ~2.223\n > v = base.dists.binomial.entropy( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.entropy( 20, 1.1 )\n NaN\n > v = base.dists.binomial.entropy( 20, NaN )\n NaN\n\n",
"base.dists.binomial.kurtosis": "\nbase.dists.binomial.kurtosis( n, p )\n Returns the excess kurtosis of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.binomial.kurtosis( 100, 0.1 )\n ~0.051\n > v = base.dists.binomial.kurtosis( 20, 0.5 )\n ~-0.1\n > v = base.dists.binomial.kurtosis( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.kurtosis( 20, 1.1 )\n NaN\n > v = base.dists.binomial.kurtosis( 20, NaN )\n NaN\n\n",
"base.dists.binomial.logpmf": "\nbase.dists.binomial.logpmf( x, n, p )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n binomial distribution with number of trials `n` and success probability `p`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.binomial.logpmf( 3.0, 20, 0.2 )\n ~-1.583\n > y = base.dists.binomial.logpmf( 21.0, 20, 0.2 )\n -Infinity\n > y = base.dists.binomial.logpmf( 5.0, 10, 0.4 )\n ~-1.606\n > y = base.dists.binomial.logpmf( 0.0, 10, 0.4 )\n ~-5.108\n > y = base.dists.binomial.logpmf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.logpmf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.logpmf.factory( n, p )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a binomial distribution with number of trials `n` and\n success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.binomial.logpmf.factory( 10, 0.5 );\n > var y = mylogpmf( 3.0 )\n ~-2.144\n > y = mylogpmf( 5.0 )\n ~-1.402\n\n",
"base.dists.binomial.mean": "\nbase.dists.binomial.mean( n, p )\n Returns the expected value of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.binomial.mean( 100, 0.1 )\n 10.0\n > v = base.dists.binomial.mean( 20, 0.5 )\n 10.0\n > v = base.dists.binomial.mean( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.mean( 20, 1.1 )\n NaN\n > v = base.dists.binomial.mean( 20, NaN )\n NaN\n\n",
"base.dists.binomial.median": "\nbase.dists.binomial.median( n, p )\n Returns the median of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.binomial.median( 100, 0.1 )\n 10\n > v = base.dists.binomial.median( 20, 0.5 )\n 10\n > v = base.dists.binomial.median( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.median( 20, 1.1 )\n NaN\n > v = base.dists.binomial.median( 20, NaN )\n NaN\n\n",
"base.dists.binomial.mgf": "\nbase.dists.binomial.mgf( t, n, p )\n Evaluates the moment-generating function (MGF) for a binomial distribution\n with number of trials `n` and success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.binomial.mgf( 0.5, 20, 0.2 )\n ~11.471\n > y = base.dists.binomial.mgf( 5.0, 20, 0.2 )\n ~4.798e+29\n > y = base.dists.binomial.mgf( 0.9, 10, 0.4 )\n ~99.338\n > y = base.dists.binomial.mgf( 0.0, 10, 0.4 )\n 1.0\n\n > y = base.dists.binomial.mgf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 0.0, 20, NaN )\n NaN\n\n > y = base.dists.binomial.mgf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.mgf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.mgf.factory( n, p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n binomial distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.binomial.mgf.factory( 10, 0.5 );\n > var y = myMGF( 0.3 )\n ~5.013\n\n",
"base.dists.binomial.mode": "\nbase.dists.binomial.mode( n, p )\n Returns the mode of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.binomial.mode( 100, 0.1 )\n 10\n > v = base.dists.binomial.mode( 20, 0.5 )\n 10\n > v = base.dists.binomial.mode( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.mode( 20, 1.1 )\n NaN\n > v = base.dists.binomial.mode( 20, NaN )\n NaN\n\n",
"base.dists.binomial.pmf": "\nbase.dists.binomial.pmf( x, n, p )\n Evaluates the probability mass function (PMF) for a binomial distribution\n with number of trials `n` and success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.binomial.pmf( 3.0, 20, 0.2 )\n ~0.205\n > y = base.dists.binomial.pmf( 21.0, 20, 0.2 )\n 0.0\n > y = base.dists.binomial.pmf( 5.0, 10, 0.4 )\n ~0.201\n > y = base.dists.binomial.pmf( 0.0, 10, 0.4 )\n ~0.006\n > y = base.dists.binomial.pmf( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 0.0, 20, NaN )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.binomial.pmf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.pmf.factory( n, p )\n Returns a function for evaluating the probability mass function (PMF) of a\n binomial distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.binomial.pmf.factory( 10, 0.5 );\n > var y = mypmf( 3.0 )\n ~0.117\n > y = mypmf( 5.0 )\n ~0.246\n\n",
"base.dists.binomial.quantile": "\nbase.dists.binomial.quantile( r, n, p )\n Evaluates the quantile function for a binomial distribution with number of\n trials `n` and success probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.binomial.quantile( 0.4, 20, 0.2 )\n 3\n > y = base.dists.binomial.quantile( 0.8, 20, 0.2 )\n 5\n > y = base.dists.binomial.quantile( 0.5, 10, 0.4 )\n 4\n > y = base.dists.binomial.quantile( 0.0, 10, 0.4 )\n 0\n > y = base.dists.binomial.quantile( 1.0, 10, 0.4 )\n 10\n\n > y = base.dists.binomial.quantile( NaN, 20, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.2, NaN, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.2, 20, NaN )\n NaN\n\n > y = base.dists.binomial.quantile( 0.5, 1.5, 0.5 )\n NaN\n > y = base.dists.binomial.quantile( 0.5, -2.0, 0.5 )\n NaN\n\n > y = base.dists.binomial.quantile( 0.5, 20, -1.0 )\n NaN\n > y = base.dists.binomial.quantile( 0.5, 20, 1.5 )\n NaN\n\n\nbase.dists.binomial.quantile.factory( n, p )\n Returns a function for evaluating the quantile function of a binomial\n distribution with number of trials `n` and success probability `p`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.binomial.quantile.factory( 10, 0.5 );\n > var y = myquantile( 0.1 )\n 3\n > y = myquantile( 0.9 )\n 7\n\n",
"base.dists.binomial.skewness": "\nbase.dists.binomial.skewness( n, p )\n Returns the skewness of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.binomial.skewness( 100, 0.1 )\n ~0.267\n > v = base.dists.binomial.skewness( 20, 0.5 )\n 0.0\n > v = base.dists.binomial.skewness( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.skewness( 20, 1.1 )\n NaN\n > v = base.dists.binomial.skewness( 20, NaN )\n NaN\n\n",
"base.dists.binomial.stdev": "\nbase.dists.binomial.stdev( n, p )\n Returns the standard deviation of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.binomial.stdev( 100, 0.1 )\n 3.0\n > v = base.dists.binomial.stdev( 20, 0.5 )\n ~2.236\n > v = base.dists.binomial.stdev( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.stdev( 20, 1.1 )\n NaN\n > v = base.dists.binomial.stdev( 20, NaN )\n NaN\n\n",
"base.dists.binomial.variance": "\nbase.dists.binomial.variance( n, p )\n Returns the variance of a binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a number of trials `n` which is not a nonnegative integer, the\n function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.binomial.variance( 100, 0.1 )\n 9\n > v = base.dists.binomial.variance( 20, 0.5 )\n 5\n > v = base.dists.binomial.variance( 10.3, 0.5 )\n NaN\n > v = base.dists.binomial.variance( 20, 1.1 )\n NaN\n > v = base.dists.binomial.variance( 20, NaN )\n NaN\n\n",
"base.dists.cauchy.Cauchy": "\nbase.dists.cauchy.Cauchy( [x0, Ɣ] )\n Returns a Cauchy distribution object.\n\n Parameters\n ----------\n x0: number (optional)\n Location parameter. Default: `0.0`.\n\n Ɣ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n cauchy: Object\n Distribution instance.\n\n cauchy.x0: number\n Location parameter.\n\n cauchy.gamma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n cauchy.entropy: number\n Read-only property which returns the differential entropy.\n\n cauchy.median: number\n Read-only property which returns the median.\n\n cauchy.mode: number\n Read-only property which returns the mode.\n\n cauchy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n cauchy.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n cauchy.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n cauchy.pdf: Function\n Evaluates the probability density function (PDF).\n\n cauchy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var cauchy = base.dists.cauchy.Cauchy( 0.0, 1.0 );\n > cauchy.x0\n 0.0\n > cauchy.gamma\n 1.0\n > cauchy.entropy\n ~2.531\n > cauchy.median\n 0.0\n > cauchy.mode\n 0.0\n > cauchy.cdf( 0.8 )\n ~0.715\n > cauchy.logcdf( 1.0 )\n ~-0.288\n > cauchy.logpdf( 1.0 )\n ~-1.838\n > cauchy.pdf( 1.0 )\n ~0.159\n > cauchy.quantile( 0.8 )\n ~1.376\n\n",
"base.dists.cauchy.cdf": "\nbase.dists.cauchy.cdf( x, x0, Ɣ )\n Evaluates the cumulative distribution function (CDF) for a Cauchy\n distribution with location parameter `x0` and scale parameter `Ɣ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.cdf( 4.0, 0.0, 2.0 )\n ~0.852\n > y = base.dists.cauchy.cdf( 1.0, 0.0, 2.0 )\n ~0.648\n > y = base.dists.cauchy.cdf( 1.0, 3.0, 2.0 )\n 0.25\n > y = base.dists.cauchy.cdf( NaN, 0.0, 2.0 )\n NaN\n > y = base.dists.cauchy.cdf( 1.0, 2.0, NaN )\n NaN\n > y = base.dists.cauchy.cdf( 1.0, NaN, 3.0 )\n NaN\n\n\nbase.dists.cauchy.cdf.factory( x0, Ɣ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Cauchy distribution with location parameter `x0` and scale parameter\n `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.cauchy.cdf.factory( 1.5, 3.0 );\n > var y = myCDF( 1.0 )\n ~0.447\n\n",
"base.dists.cauchy.entropy": "\nbase.dists.cauchy.entropy( x0, Ɣ )\n Returns the differential entropy of a Cauchy distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.cauchy.entropy( 10.0, 7.0 )\n ~4.477\n > v = base.dists.cauchy.entropy( 22.0, 0.5 )\n ~1.838\n > v = base.dists.cauchy.entropy( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.logcdf": "\nbase.dists.cauchy.logcdf( x, x0, Ɣ )\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF) for a Cauchy distribution with location parameter `x0` and scale\n parameter `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of the CDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.logcdf( 4.0, 0.0, 2.0 )\n ~-0.16\n > y = base.dists.cauchy.logcdf( 1.0, 0.0, 2.0 )\n ~-0.435\n > y = base.dists.cauchy.logcdf( 1.0, 3.0, 2.0 )\n ~-1.386\n > y = base.dists.cauchy.logcdf( NaN, 0.0, 2.0 )\n NaN\n > y = base.dists.cauchy.logcdf( 1.0, 2.0, NaN )\n NaN\n > y = base.dists.cauchy.logcdf( 1.0, NaN, 3.0 )\n NaN\n\n\nbase.dists.cauchy.logcdf.factory( x0, Ɣ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (logCDF) of a Cauchy distribution with location\n parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Function to evaluate the natural logarithm of CDF.\n\n Examples\n --------\n > var mylogCDF = base.dists.cauchy.logcdf.factory( 1.5, 3.0 );\n > var y = mylogCDF( 1.0 )\n ~-0.804\n\n",
"base.dists.cauchy.logpdf": "\nbase.dists.cauchy.logpdf( x, x0, Ɣ )\n Evaluates the natural logarithm of the probability density function (logPDF)\n for a Cauchy distribution with location parameter `x0` and scale parameter\n `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Natural logarithm of PDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.logpdf( 2.0, 1.0, 1.0 )\n ~-1.838\n > y = base.dists.cauchy.logpdf( 4.0, 3.0, 0.1 )\n ~-3.457\n > y = base.dists.cauchy.logpdf( 4.0, 3.0, 3.0 )\n ~-2.349\n > y = base.dists.cauchy.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.cauchy.logpdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.logpdf( 2.0, 1.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.cauchy.logpdf( 2.0, 1.0, -2.0 )\n NaN\n\n\nbase.dists.cauchy.logpdf.factory( x0, Ɣ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (logPDF) of a Cauchy distribution with location parameter\n `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogPDF = base.dists.cauchy.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-1.838\n\n",
"base.dists.cauchy.median": "\nbase.dists.cauchy.median( x0, Ɣ )\n Returns the median of a Cauchy distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.cauchy.median( 10.0, 5.0 )\n 10.0\n > v = base.dists.cauchy.median( 7.0, 0.5 )\n 7.0\n > v = base.dists.cauchy.median( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.mode": "\nbase.dists.cauchy.mode( x0, Ɣ )\n Returns the mode of a Cauchy distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.cauchy.mode( 10.0, 5.0 )\n 10.0\n > v = base.dists.cauchy.mode( 7.0, 0.5 )\n 7.0\n > v = base.dists.cauchy.mode( 10.3, -0.5 )\n NaN\n\n",
"base.dists.cauchy.pdf": "\nbase.dists.cauchy.pdf( x, x0, Ɣ )\n Evaluates the probability density function (PDF) for a Cauchy distribution\n with location parameter `x0` and scale parameter `Ɣ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.cauchy.pdf( 2.0, 1.0, 1.0 )\n ~0.159\n > y = base.dists.cauchy.pdf( 4.0, 3.0, 0.1 )\n ~0.0315\n > y = base.dists.cauchy.pdf( 4.0, 3.0, 3.0 )\n ~0.095\n > y = base.dists.cauchy.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.cauchy.pdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.pdf( 2.0, 1.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cauchy.pdf( 2.0, 1.0, -2.0 )\n NaN\n\n\nbase.dists.cauchy.pdf.factory( x0, Ɣ )\n Returns a function for evaluating the probability density function (PDF) of\n a Cauchy distribution with location parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.cauchy.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.159\n\n",
"base.dists.cauchy.quantile": "\nbase.dists.cauchy.quantile( p, x0, Ɣ )\n Evaluates the quantile function for a Cauchy distribution with location\n parameter `x0` and scale parameter `Ɣ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.cauchy.quantile( 0.3, 2.0, 2.0 )\n ~0.547\n > y = base.dists.cauchy.quantile( 0.8, 10, 2.0 )\n ~12.753\n > y = base.dists.cauchy.quantile( 0.1, 10.0, 2.0 )\n ~3.845\n\n > y = base.dists.cauchy.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.cauchy.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cauchy.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cauchy.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.cauchy.quantile.factory( x0, Ɣ )\n Returns a function for evaluating the quantile function of a Cauchy\n distribution with location parameter `x0` and scale parameter `Ɣ`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.cauchy.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.chi.cdf": "\nbase.dists.chi.cdf( x, k )\n Evaluates the cumulative distribution function (CDF) for a chi distribution\n with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.chi.cdf( 2.0, 3.0 )\n ~0.739\n > y = base.dists.chi.cdf( 1.0, 0.5 )\n ~0.846\n > y = base.dists.chi.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.chi.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.chi.cdf( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.cdf( 2.0, 0.0 )\n 1.0\n > y = base.dists.chi.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.chi.cdf( 0.0, 0.0 )\n 0.0\n\nbase.dists.chi.cdf.factory( k )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.chi.cdf.factory( 1.0 );\n > var y = mycdf( 2.0 )\n ~0.954\n > y = mycdf( 1.2 )\n ~0.77\n\n",
"base.dists.chi.Chi": "\nbase.dists.chi.Chi( [k] )\n Returns a chi distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n chi: Object\n Distribution instance.\n\n chi.k: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n chi.entropy: number\n Read-only property which returns the differential entropy.\n\n chi.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n chi.mean: number\n Read-only property which returns the expected value.\n\n chi.mode: number\n Read-only property which returns the mode.\n\n chi.skewness: number\n Read-only property which returns the skewness.\n\n chi.stdev: number\n Read-only property which returns the standard deviation.\n\n chi.variance: number\n Read-only property which returns the variance.\n\n chi.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n chi.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n chi.pdf: Function\n Evaluates the probability density function (PDF).\n\n chi.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var chi = base.dists.chi.Chi( 6.0 );\n > chi.k\n 6.0\n > chi.entropy\n ~1.04\n > chi.kurtosis\n ~0.025\n > chi.mean\n ~2.35\n > chi.mode\n ~2.236\n > chi.skewness\n ~0.318\n > chi.stdev\n ~0.691\n > chi.variance\n ~0.478\n > chi.cdf( 1.0 )\n ~0.014\n > chi.logpdf( 1.5 )\n ~-1.177\n > chi.pdf( 1.5 )\n ~0.308\n > chi.quantile( 0.5 )\n ~2.313\n\n",
"base.dists.chi.entropy": "\nbase.dists.chi.entropy( k )\n Returns the differential entropy of a chi distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.chi.entropy( 11.0 )\n ~1.056\n > v = base.dists.chi.entropy( 1.5 )\n ~0.878\n\n",
"base.dists.chi.kurtosis": "\nbase.dists.chi.kurtosis( k )\n Returns the excess kurtosis of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.chi.kurtosis( 9.0 )\n ~0.011\n > v = base.dists.chi.kurtosis( 1.5 )\n ~0.424\n\n",
"base.dists.chi.logpdf": "\nbase.dists.chi.logpdf( x, k )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a chi distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.chi.logpdf( 0.3, 4.0 )\n ~-4.35\n > y = base.dists.chi.logpdf( 0.7, 0.7 )\n ~-0.622\n > y = base.dists.chi.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.chi.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.chi.logpdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.logpdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.chi.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chi.logpdf.factory( k )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.chi.logpdf.factory( 6.0 );\n > var y = mylogPDF( 3.0 )\n ~-1.086\n\n",
"base.dists.chi.mean": "\nbase.dists.chi.mean( k )\n Returns the expected value of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.chi.mean( 11.0 )\n ~3.242\n > v = base.dists.chi.mean( 4.5 )\n ~2.008\n\n",
"base.dists.chi.mode": "\nbase.dists.chi.mode( k )\n Returns the mode of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 1`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.chi.mode( 11.0 )\n ~3.162\n > v = base.dists.chi.mode( 1.5 )\n ~0.707\n\n",
"base.dists.chi.pdf": "\nbase.dists.chi.pdf( x, k )\n Evaluates the probability density function (PDF) for a chi distribution with\n degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.chi.pdf( 0.3, 4.0 )\n ~0.013\n > y = base.dists.chi.pdf( 0.7, 0.7 )\n ~0.537\n > y = base.dists.chi.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.chi.pdf( 0.0, NaN )\n NaN\n > y = base.dists.chi.pdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.chi.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chi.pdf.factory( k )\n Returns a function for evaluating the probability density function (PDF) of\n a chi distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.chi.pdf.factory( 6.0 );\n > var y = myPDF( 3.0 )\n ~0.337\n\n",
"base.dists.chi.quantile": "\nbase.dists.chi.quantile( p, k )\n Evaluates the quantile function for a chi distribution with degrees of\n freedom `k` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.chi.quantile( 0.8, 1.0 )\n ~1.282\n > y = base.dists.chi.quantile( 0.5, 4.0 )\n ~1.832\n > y = base.dists.chi.quantile( 0.8, 0.1 )\n ~0.116\n > y = base.dists.chi.quantile( -0.2, 0.5 )\n NaN\n > y = base.dists.chi.quantile( 1.1, 0.5 )\n NaN\n > y = base.dists.chi.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.chi.quantile( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chi.quantile( 0.5, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chi.quantile( 0.3, 0.0 )\n 0.0\n > y = base.dists.chi.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.chi.quantile.factory( k )\n Returns a function for evaluating the quantile function of a chi\n distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.chi.quantile.factory( 2.0 );\n > var y = myquantile( 0.3 )\n ~0.845\n > y = myquantile( 0.7 )\n ~1.552\n\n",
"base.dists.chi.skewness": "\nbase.dists.chi.skewness( k )\n Returns the skewness of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.chi.skewness( 11.0 )\n ~0.225\n > v = base.dists.chi.skewness( 1.5 )\n ~0.763\n\n",
"base.dists.chi.stdev": "\nbase.dists.chi.stdev( k )\n Returns the standard deviation of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.chi.stdev( 11.0 )\n ~0.699\n > v = base.dists.chi.stdev( 1.5 )\n ~0.637\n\n",
"base.dists.chi.variance": "\nbase.dists.chi.variance( k )\n Returns the variance of a chi distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.chi.variance( 11.0 )\n ~0.488\n > v = base.dists.chi.variance( 1.5 )\n ~0.406\n\n",
"base.dists.chisquare.cdf": "\nbase.dists.chisquare.cdf( x, k )\n Evaluates the cumulative distribution function (CDF) for a chi-squared\n distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.cdf( 2.0, 3.0 )\n ~0.428\n > y = base.dists.chisquare.cdf( 1.0, 0.5 )\n ~0.846\n > y = base.dists.chisquare.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.chisquare.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.chisquare.cdf( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.cdf( 2.0, 0.0 )\n 1.0\n > y = base.dists.chisquare.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.chisquare.cdf( 0.0, 0.0 )\n 0.0\n\nbase.dists.chisquare.cdf.factory( k )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a chi-squared distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.chisquare.cdf.factory( 1.0 );\n > var y = mycdf( 2.0 )\n ~0.843\n > y = mycdf( 1.2 )\n ~0.727\n\n",
"base.dists.chisquare.ChiSquare": "\nbase.dists.chisquare.ChiSquare( [k] )\n Returns a chi-squared distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n chisquare: Object\n Distribution instance.\n\n chisquare.k: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n chisquare.entropy: number\n Read-only property which returns the differential entropy.\n\n chisquare.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n chisquare.mean: number\n Read-only property which returns the expected value.\n\n chisquare.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n chisquare.mode: number\n Read-only property which returns the mode.\n\n chisquare.skewness: number\n Read-only property which returns the skewness.\n\n chisquare.stdev: number\n Read-only property which returns the standard deviation.\n\n chisquare.variance: number\n Read-only property which returns the variance.\n\n chisquare.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n chisquare.pdf: Function\n Evaluates the probability density function (PDF).\n\n chisquare.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var chisquare = base.dists.chisquare.ChiSquare( 6.0 );\n > chisquare.k\n 6.0\n > chisquare.entropy\n ~2.541\n > chisquare.kurtosis\n 2.0\n > chisquare.mean\n 6.0\n > chisquare.mode\n 4.0\n > chisquare.skewness\n ~1.155\n > chisquare.stdev\n ~3.464\n > chisquare.variance\n 12.0\n > chisquare.cdf( 3.0 )\n ~0.191\n > chisquare.mgf( 0.2 )\n ~4.63\n > chisquare.pdf( 1.5 )\n ~0.066\n > chisquare.quantile( 0.5 )\n ~5.348\n\n",
"base.dists.chisquare.entropy": "\nbase.dists.chisquare.entropy( k )\n Returns the differential entropy of a chi-squared distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.chisquare.entropy( 11.0 )\n ~2.901\n > v = base.dists.chisquare.entropy( 1.5 )\n ~1.375\n\n",
"base.dists.chisquare.kurtosis": "\nbase.dists.chisquare.kurtosis( k )\n Returns the excess kurtosis of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.chisquare.kurtosis( 9.0 )\n ~1.333\n > v = base.dists.chisquare.kurtosis( 1.5 )\n 8.0\n\n",
"base.dists.chisquare.logpdf": "\nbase.dists.chisquare.logpdf( x, k )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a chi-squared distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.logpdf( 0.3, 4.0 )\n ~-2.74\n > y = base.dists.chisquare.logpdf( 0.7, 0.7 )\n ~-1.295\n > y = base.dists.chisquare.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.chisquare.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.chisquare.logpdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.logpdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.chisquare.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chisquare.logpdf.factory( k )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a chi-squared distribution with degrees of freedom\n `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.chisquare.logpdf.factory( 6.0 );\n > var y = myLogPDF( 3.0 )\n ~-2.075\n\n",
"base.dists.chisquare.mean": "\nbase.dists.chisquare.mean( k )\n Returns the expected value of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.chisquare.mean( 11.0 )\n 11.0\n > v = base.dists.chisquare.mean( 4.5 )\n 4.5\n\n",
"base.dists.chisquare.mode": "\nbase.dists.chisquare.mode( k )\n Returns the mode of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.chisquare.mode( 11.0 )\n 9.0\n > v = base.dists.chisquare.mode( 1.5 )\n 0.0\n\n",
"base.dists.chisquare.pdf": "\nbase.dists.chisquare.pdf( x, k )\n Evaluates the probability density function (PDF) for a chi-squared\n distribution with degrees of freedom `k` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.chisquare.pdf( 0.3, 4.0 )\n ~0.065\n > y = base.dists.chisquare.pdf( 0.7, 0.7 )\n ~0.274\n > y = base.dists.chisquare.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.chisquare.pdf( 0.0, NaN )\n NaN\n > y = base.dists.chisquare.pdf( NaN, 2.0 )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.chisquare.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.chisquare.pdf.factory( k )\n Returns a function for evaluating the probability density function (PDF) of\n a chi-squared distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.chisquare.pdf.factory( 6.0 );\n > var y = myPDF( 3.0 )\n ~0.126\n\n",
"base.dists.chisquare.quantile": "\nbase.dists.chisquare.quantile( p, k )\n Evaluates the quantile function for a chi-squared distribution with degrees\n of freedom `k` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.chisquare.quantile( 0.8, 1.0 )\n ~1.642\n > y = base.dists.chisquare.quantile( 0.5, 4.0 )\n ~3.357\n > y = base.dists.chisquare.quantile( 0.8, 0.1 )\n ~0.014\n > y = base.dists.chisquare.quantile( -0.2, 0.5 )\n NaN\n > y = base.dists.chisquare.quantile( 1.1, 0.5 )\n NaN\n > y = base.dists.chisquare.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.chisquare.quantile( 0.0, NaN )\n NaN\n\n // Negative degrees of freedom:\n > y = base.dists.chisquare.quantile( 0.5, -1.0 )\n NaN\n\n // Degenerate distribution when `k = 0`:\n > y = base.dists.chisquare.quantile( 0.3, 0.0 )\n 0.0\n > y = base.dists.chisquare.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.chisquare.quantile.factory( k )\n Returns a function for evaluating the quantile function of a chi-squared\n distribution with degrees of freedom `k`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.chisquare.quantile.factory( 2.0 );\n > var y = myquantile( 0.3 )\n ~0.713\n > y = myquantile( 0.7 )\n ~2.408\n\n",
"base.dists.chisquare.skewness": "\nbase.dists.chisquare.skewness( k )\n Returns the skewness of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.chisquare.skewness( 11.0 )\n ~0.853\n > v = base.dists.chisquare.skewness( 1.5 )\n ~2.309\n\n",
"base.dists.chisquare.stdev": "\nbase.dists.chisquare.stdev( k )\n Returns the standard deviation of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.chisquare.stdev( 11.0 )\n ~4.69\n > v = base.dists.chisquare.stdev( 1.5 )\n ~1.732\n\n",
"base.dists.chisquare.variance": "\nbase.dists.chisquare.variance( k )\n Returns the variance of a chi-squared distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `k < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.chisquare.variance( 11.0 )\n 22.0\n > v = base.dists.chisquare.variance( 1.5 )\n 3.0\n\n",
"base.dists.cosine.cdf": "\nbase.dists.cosine.cdf( x, μ, s )\n Evaluates the cumulative distribution function (CDF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.cosine.cdf( 2.0, 0.0, 3.0 )\n ~0.971\n > y = base.dists.cosine.cdf( 9.0, 10.0, 3.0 )\n ~0.196\n\n > y = base.dists.cosine.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.cosine.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.cosine.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.cosine.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.cosine.cdf.factory( μ, s )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a raised cosine distribution with location parameter `μ` and scale\n parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.cosine.cdf.factory( 3.0, 1.5 );\n > var y = mycdf( 1.9 )\n ~0.015\n\n",
"base.dists.cosine.Cosine": "\nbase.dists.cosine.Cosine( [μ, s] )\n Returns a raised cosine distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n cosine: Object\n Distribution instance.\n\n cosine.mu: number\n Location parameter.\n\n cosine.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n cosine.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n cosine.mean: number\n Read-only property which returns the expected value.\n\n cosine.median: number\n Read-only property which returns the median.\n\n cosine.mode: number\n Read-only property which returns the mode.\n\n cosine.skewness: number\n Read-only property which returns the skewness.\n\n cosine.stdev: number\n Read-only property which returns the standard deviation.\n\n cosine.variance: number\n Read-only property which returns the variance.\n\n cosine.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n cosine.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n cosine.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n cosine.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n cosine.pdf: Function\n Evaluates the probability density function (PDF).\n\n cosine.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var cosine = base.dists.cosine.Cosine( -2.0, 3.0 );\n > cosine.mu\n -2.0\n > cosine.s\n 3.0\n > cosine.kurtosis\n ~-0.594\n > cosine.mean\n -2.0\n > cosine.median\n -2.0\n > cosine.mode\n -2.0\n > cosine.skewness\n 0.0\n > cosine.stdev\n ~1.085\n > cosine.variance\n ~1.176\n > cosine.cdf( 0.5 )\n ~0.996\n > cosine.logcdf( 0.5 )\n ~-0.004\n > cosine.logpdf( -1.0 )\n ~-1.386\n > cosine.mgf( 0.2 )\n ~0.686\n > cosine.pdf( -2.0 )\n ~0.333\n > cosine.quantile( 0.9 )\n ~-0.553\n\n",
"base.dists.cosine.kurtosis": "\nbase.dists.cosine.kurtosis( μ, s )\n Returns the excess kurtosis of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.cosine.kurtosis( 0.0, 1.0 )\n ~-0.594\n > y = base.dists.cosine.kurtosis( 4.0, 2.0 )\n ~-0.594\n > y = base.dists.cosine.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.cosine.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.logcdf": "\nbase.dists.cosine.logcdf( x, μ, s )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a raised cosine distribution with location parameter `μ` and scale\n parameter `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.cosine.logcdf( 2.0, 0.0, 3.0 )\n ~-0.029\n > y = base.dists.cosine.logcdf( 9.0, 10.0, 3.0 )\n ~-1.632\n\n > y = base.dists.cosine.logcdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.cosine.logcdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.logcdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.cosine.logcdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.cosine.logcdf( 8.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.logcdf( 10.0, 8.0, 0.0 )\n 0.0\n\n\nbase.dists.cosine.logcdf.factory( μ, s )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.cosine.logcdf.factory( 3.0, 1.5 );\n > var y = mylogcdf( 1.9 )\n ~-4.2\n\n",
"base.dists.cosine.logpdf": "\nbase.dists.cosine.logpdf( x, μ, s )\n Evaluates the logarithm of the probability density function (PDF) for a\n raised cosine distribution with location parameter `μ` and scale parameter\n `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.cosine.logpdf( 2.0, 0.0, 3.0 )\n ~-2.485\n > y = base.dists.cosine.logpdf( -1.0, 2.0, 4.0 )\n ~-3.307\n > y = base.dists.cosine.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cosine.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution at `s = 0.0`:\n > y = base.dists.cosine.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.cosine.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.cosine.logpdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a raised cosine distribution with location parameter `μ`\n and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.cosine.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-0.693\n\n",
"base.dists.cosine.mean": "\nbase.dists.cosine.mean( μ, s )\n Returns the expected value of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.cosine.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.mean( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mean( 0.0, NaN )\n NaN\n > y = base.dists.cosine.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.median": "\nbase.dists.cosine.median( μ, s )\n Returns the median of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.cosine.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.median( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.median( 0.0, NaN )\n NaN\n > y = base.dists.cosine.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.mgf": "\nbase.dists.cosine.mgf( t, μ, s )\n Evaluates the moment-generating function (MGF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.cosine.mgf( 2.0, 0.0, 3.0 )\n ~7.234\n > y = base.dists.cosine.mgf( 9.0, 10.0, 3.0 )\n ~1.606e+47\n\n > y = base.dists.cosine.mgf( 0.5, 0.0, NaN )\n NaN\n > y = base.dists.cosine.mgf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mgf( NaN, 0.0, 1.0 )\n NaN\n\n\nbase.dists.cosine.mgf.factory( μ, s )\n Returns a function for evaluating the moment-generating function (MGF) of a\n raised cosine distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.cosine.mgf.factory( 3.0, 1.5 );\n > var y = mymgf( 1.9 )\n ~495.57\n\n",
"base.dists.cosine.mode": "\nbase.dists.cosine.mode( μ, s )\n Returns the mode of a raised cosine distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.cosine.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.cosine.mode( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.mode( 0.0, NaN )\n NaN\n > y = base.dists.cosine.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.pdf": "\nbase.dists.cosine.pdf( x, μ, s )\n Evaluates the probability density function (PDF) for a raised cosine\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.cosine.pdf( 2.0, 0.0, 3.0 )\n ~0.083\n > y = base.dists.cosine.pdf( 2.4, 4.0, 2.0 )\n ~0.048\n > y = base.dists.cosine.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.cosine.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.cosine.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.cosine.pdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.cosine.pdf.factory( μ, s )\n Returns a function for evaluating the probability density function (PDF) of\n a raised cosine distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.cosine.pdf.factory( 0.0, 3.0 );\n > var y = myPDF( 2.0 )\n ~0.083\n\n",
"base.dists.cosine.quantile": "\nbase.dists.cosine.quantile( p, μ, s )\n Evaluates the quantile function for a raised cosine distribution with\n location parameter `μ` and scale parameter `s` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.cosine.quantile( 0.8, 0.0, 1.0 )\n ~0.327\n > y = base.dists.cosine.quantile( 0.5, 4.0, 2.0 )\n ~4.0\n\n > y = base.dists.cosine.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.cosine.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.cosine.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.cosine.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.cosine.quantile.factory( μ, s )\n Returns a function for evaluating the quantile function of a raised cosine\n distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.cosine.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.3 )\n ~9.586\n\n",
"base.dists.cosine.skewness": "\nbase.dists.cosine.skewness( μ, s )\n Returns the skewness of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.cosine.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.cosine.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.cosine.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.skewness( 0.0, NaN )\n NaN\n > y = base.dists.cosine.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.stdev": "\nbase.dists.cosine.stdev( μ, s )\n Returns the standard deviation of a raised cosine distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.cosine.stdev( 0.0, 1.0 )\n ~0.362\n > y = base.dists.cosine.stdev( 4.0, 2.0 )\n ~0.723\n > y = base.dists.cosine.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.stdev( 0.0, NaN )\n NaN\n > y = base.dists.cosine.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.cosine.variance": "\nbase.dists.cosine.variance( μ, s )\n Returns the variance of a raised cosine distribution with location parameter\n `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.cosine.variance( 0.0, 1.0 )\n ~0.131\n > y = base.dists.cosine.variance( 4.0, 2.0 )\n ~0.523\n > y = base.dists.cosine.variance( NaN, 1.0 )\n NaN\n > y = base.dists.cosine.variance( 0.0, NaN )\n NaN\n > y = base.dists.cosine.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.degenerate.cdf": "\nbase.dists.degenerate.cdf( x, μ )\n Evaluates the cumulative distribution function (CDF) for a degenerate\n distribution with mean value `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.cdf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.cdf( 4.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.cdf( 3.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.cdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.cdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.cdf.factory( μ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a degenerate distribution centered at a provided mean value.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.degenerate.cdf.factory( 5.0 );\n > var y = myCDF( 3.0 )\n 0.0\n > y = myCDF( 6.0 )\n 1.0\n\n",
"base.dists.degenerate.Degenerate": "\nbase.dists.degenerate.Degenerate( [μ] )\n Returns a degenerate distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Constant value of distribution.\n\n Returns\n -------\n degenerate: Object\n Distribution instance.\n\n degenerate.mu: number\n Constant value of distribution.\n\n degenerate.entropy: number\n Read-only property which returns the differential entropy.\n\n degenerate.mean: number\n Read-only property which returns the expected value.\n\n degenerate.median: number\n Read-only property which returns the median.\n\n degenerate.stdev: number\n Read-only property which returns the standard deviation.\n\n degenerate.variance: number\n Read-only property which returns the variance.\n\n degenerate.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n degenerate.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n degenerate.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n degenerate.logpmf: Function\n Evaluates the natural logarithm of the probability mass function\n (PMF).\n\n degenerate.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n degenerate.pmf: Function\n Evaluates the probability mass function (PMF).\n\n degenerate.pdf: Function\n Evaluates the probability density function (PDF).\n\n degenerate.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var degenerate = base.dists.degenerate.Degenerate( 2.0 );\n > degenerate.mu\n 2.0\n > degenerate.entropy\n 0.0\n > degenerate.mean\n 2.0\n > degenerate.mode\n 2.0\n > degenerate.median\n 2.0\n > degenerate.stdev\n 0.0\n > degenerate.variance\n 0.0\n > degenerate.cdf( 0.5 )\n 0.0\n > degenerate.logcdf( 2.5 )\n 0.0\n > degenerate.logpdf( 0.5 )\n -Infinity\n > degenerate.logpmf( 2.5 )\n -Infinity\n > degenerate.mgf( 0.2 )\n ~1.492\n > degenerate.pdf( 2.0 )\n +Infinity\n > degenerate.pmf( 2.0 )\n 1.0\n > degenerate.quantile( 0.7 )\n 2.0\n\n",
"base.dists.degenerate.entropy": "\nbase.dists.degenerate.entropy( μ )\n Returns the entropy of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.degenerate.entropy( 20.0 )\n 0.0\n > v = base.dists.degenerate.entropy( -10.0 )\n 0.0\n\n",
"base.dists.degenerate.logcdf": "\nbase.dists.degenerate.logcdf( x, μ )\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF) for a degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Natural logarithm of the CDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logcdf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logcdf( 4.0, 3.0 )\n 0\n > y = base.dists.degenerate.logcdf( 3.0, 3.0 )\n 0\n > y = base.dists.degenerate.logcdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logcdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logcdf.factory( μ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (logCDF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logcdf: Function\n Function to evaluate the natural logarithm of cumulative distribution\n function (logCDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.degenerate.logcdf.factory( 5.0 );\n > var y = mylogcdf( 3.0 )\n -Infinity\n > y = mylogcdf( 6.0 )\n 0\n\n",
"base.dists.degenerate.logpdf": "\nbase.dists.degenerate.logpdf( x, μ )\n Evaluates the natural logarithm of the probability density function (logPDF)\n for a degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Natural logarithm of the PDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logpdf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logpdf( 3.0, 3.0 )\n Infinity\n > y = base.dists.degenerate.logpdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logpdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logpdf.factory( μ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (logPDF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logpdf: Function\n Function to evaluate the natural logarithm of the PDF.\n\n Examples\n --------\n > var mylogPDF = base.dists.degenerate.logpdf.factory( 10.0 );\n > var y = mylogPDF( 10.0 )\n Infinity\n\n",
"base.dists.degenerate.logpmf": "\nbase.dists.degenerate.logpmf( x, μ )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n degenerate distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.degenerate.logpmf( 2.0, 3.0 )\n -Infinity\n > y = base.dists.degenerate.logpmf( 3.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.logpmf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.logpmf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.logpmf.factory( μ )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.degenerate.logpmf.factory( 10.0 );\n > var y = mylogPMF( 10.0 )\n 0.0\n\n",
"base.dists.degenerate.mean": "\nbase.dists.degenerate.mean( μ )\n Returns the expected value of a degenerate distribution with constant value\n `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.degenerate.mean( 20.0 )\n 20.0\n > v = base.dists.degenerate.mean( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.median": "\nbase.dists.degenerate.median( μ )\n Returns the median of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.degenerate.median( 20.0 )\n 20.0\n > v = base.dists.degenerate.median( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.mgf": "\nbase.dists.degenerate.mgf( x, μ )\n Evaluates the moment-generating function (MGF) for a degenerate distribution\n with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.degenerate.mgf( 1.0, 1.0 )\n ~2.718\n > y = base.dists.degenerate.mgf( 2.0, 3.0 )\n ~403.429\n > y = base.dists.degenerate.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.mgf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.mgf.factory( μ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.degenerate.mgf.factory( 10.0 );\n > var y = myMGF( 0.1 )\n ~2.718\n\n",
"base.dists.degenerate.mode": "\nbase.dists.degenerate.mode( μ )\n Returns the mode of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.degenerate.mode( 20.0 )\n 20.0\n > v = base.dists.degenerate.mode( -10.0 )\n -10.0\n\n",
"base.dists.degenerate.pdf": "\nbase.dists.degenerate.pdf( x, μ )\n Evaluates the probability density function (PDF) for a degenerate\n distribution with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.degenerate.pdf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.pdf( 3.0, 3.0 )\n Infinity\n > y = base.dists.degenerate.pdf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.pdf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.pdf.factory( μ )\n Returns a function for evaluating the probability density function (PDF) of\n a degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.degenerate.pdf.factory( 10.0 );\n > var y = myPDF( 10.0 )\n Infinity\n\n",
"base.dists.degenerate.pmf": "\nbase.dists.degenerate.pmf( x, μ )\n Evaluates the probability mass function (PMF) for a degenerate distribution\n with mean `μ`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.degenerate.pmf( 2.0, 3.0 )\n 0.0\n > y = base.dists.degenerate.pmf( 3.0, 3.0 )\n 1.0\n > y = base.dists.degenerate.pmf( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.pmf( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.pmf.factory( μ )\n Returns a function for evaluating the probability mass function (PMF) of a\n degenerate distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.degenerate.pmf.factory( 10.0 );\n > var y = myPMF( 10.0 )\n 1.0\n\n",
"base.dists.degenerate.quantile": "\nbase.dists.degenerate.quantile( p, μ )\n Evaluates the quantile function for a degenerate distribution with mean `μ`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.degenerate.quantile( 0.5, 2.0 )\n 2.0\n > y = base.dists.degenerate.quantile( 0.9, 4.0 )\n 4.0\n > y = base.dists.degenerate.quantile( 1.1, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( -0.2, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( NaN, 0.0 )\n NaN\n > y = base.dists.degenerate.quantile( 0.0, NaN )\n NaN\n\n\nbase.dists.degenerate.quantile.factory( μ )\n Returns a function for evaluating the quantile function of a degenerate\n distribution with mean `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.degenerate.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.degenerate.stdev": "\nbase.dists.degenerate.stdev( μ )\n Returns the standard deviation of a degenerate distribution with constant\n value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.degenerate.stdev( 20.0 )\n 0.0\n > v = base.dists.degenerate.stdev( -10.0 )\n 0.0\n\n",
"base.dists.degenerate.variance": "\nbase.dists.degenerate.variance( μ )\n Returns the variance of a degenerate distribution with constant value `μ`.\n\n Parameters\n ----------\n μ: number\n Constant value of distribution.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.degenerate.variance( 20.0 )\n 0.0\n > v = base.dists.degenerate.variance( -10.0 )\n 0.0\n\n",
"base.dists.discreteUniform.cdf": "\nbase.dists.discreteUniform.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.cdf( 9.0, 0, 10 )\n ~0.909\n > y = base.dists.discreteUniform.cdf( 0.5, 0, 2 )\n ~0.333\n > y = base.dists.discreteUniform.cdf( PINF, 2, 4 )\n 1.0\n > y = base.dists.discreteUniform.cdf( NINF, 2, 4 )\n 0.0\n > y = base.dists.discreteUniform.cdf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.cdf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.cdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.cdf( 2.0, 1, 0 )\n NaN\n\n\nbase.dists.discreteUniform.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a discrete uniform distribution with minimum support `a` and maximum\n support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.discreteUniform.cdf.factory( 0, 10 );\n > var y = mycdf( 0.5 )\n ~0.091\n > y = mycdf( 8.0 )\n ~0.818\n\n",
"base.dists.discreteUniform.DiscreteUniform": "\nbase.dists.discreteUniform.DiscreteUniform( [a, b] )\n Returns a discrete uniform distribution object.\n\n Parameters\n ----------\n a: integer (optional)\n Minimum support. Must be an integer smaller than `b`. Default: `0`.\n\n b: integer (optional)\n Maximum support. Must be an integer greater than `a`. Default: `1`.\n\n Returns\n -------\n discreteUniform: Object\n Distribution instance.\n\n discreteUniform.a: integer\n Minimum support. If set, the value must be an integer smaller than or\n equal to `b`.\n\n discreteUniform.b: integer\n Maximum support. If set, the value must be an integer greater than or\n equal to `a`.\n\n discreteUniform.entropy: number\n Read-only property which returns the entropy.\n\n discreteUniform.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n discreteUniform.mean: number\n Read-only property which returns the expected value.\n\n discreteUniform.median: number\n Read-only property which returns the median.\n\n discreteUniform.skewness: number\n Read-only property which returns the skewness.\n\n discreteUniform.stdev: number\n Read-only property which returns the standard deviation.\n\n discreteUniform.variance: number\n Read-only property which returns the variance.\n\n discreteUniform.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n discreteUniform.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n discreteUniform.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n discreteUniform.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n discreteUniform.pmf: Function\n Evaluates the probability mass function (PMF).\n\n discreteUniform.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var discreteUniform = base.dists.discreteUniform.DiscreteUniform( -2, 2 );\n > discreteUniform.a\n -2\n > discreteUniform.b\n 2\n > discreteUniform.entropy\n ~1.609\n > discreteUniform.kurtosis\n -1.3\n > discreteUniform.mean\n 0.0\n > discreteUniform.median\n 0.0\n > discreteUniform.skewness\n 0.0\n > discreteUniform.stdev\n ~1.414\n > discreteUniform.variance\n 2.0\n > discreteUniform.cdf( 0.8 )\n 0.6\n > discreteUniform.logcdf( 0.5 )\n ~-0.511\n > discreteUniform.logpmf( 1.0 )\n ~-1.609\n > discreteUniform.mgf( 0.8 )\n ~1.766\n > discreteUniform.pmf( 0.0 )\n 0.2\n > discreteUniform.quantile( 0.8 )\n 2.0\n\n",
"base.dists.discreteUniform.kurtosis": "\nbase.dists.discreteUniform.kurtosis( a, b )\n Returns the excess kurtosis of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.kurtosis( 0, 1 )\n -2.0\n > v = base.dists.discreteUniform.kurtosis( 4, 12 )\n ~-1.23\n > v = base.dists.discreteUniform.kurtosis( -4, 8 )\n ~-1.214\n\n",
"base.dists.discreteUniform.logcdf": "\nbase.dists.discreteUniform.logcdf( x, a, b )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a discrete uniform distribution with minimum support `a` and\n maximum support `b` at a value `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.logcdf( 9.0, 0, 10 )\n ~-0.095\n > y = base.dists.discreteUniform.logcdf( 0.5, 0, 2 )\n ~-1.099\n > y = base.dists.discreteUniform.logcdf( PINF, 2, 4 )\n 0.0\n > y = base.dists.discreteUniform.logcdf( NINF, 2, 4 )\n -Infinity\n > y = base.dists.discreteUniform.logcdf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.logcdf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.logcdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.logcdf( 2.0, 1, 0 )\n NaN\n\n\nbase.dists.discreteUniform.logcdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a discrete uniform distribution with minimum\n support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var myLogCDF = base.dists.discreteUniform.logcdf.factory( 0, 10 );\n > var y = myLogCDF( 0.5 )\n ~-2.398\n > y = myLogCDF( 8.0 )\n ~-0.201\n\n",
"base.dists.discreteUniform.logpmf": "\nbase.dists.discreteUniform.logpmf( x, a, b )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n discrete uniform distribution with minimum support `a` and maximum support\n `b` at a value `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.logpmf( 2.0, 0, 4 )\n ~-1.609\n > y = base.dists.discreteUniform.logpmf( 5.0, 0, 4 )\n -Infinity\n > y = base.dists.discreteUniform.logpmf( 3.0, -4, 4 )\n ~-2.197\n > y = base.dists.discreteUniform.logpmf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.logpmf( 2.0, 3, 1 )\n NaN\n > y = base.dists.discreteUniform.logpmf( 2.0, 1, 2.4 )\n NaN\n\n\nbase.dists.discreteUniform.logpmf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a discrete uniform distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var myLogPMF = base.dists.discreteUniform.logpmf.factory( 6, 7 );\n > var y = myLogPMF( 7.0 )\n ~-0.693\n > y = myLogPMF( 5.0 )\n -Infinity\n\n",
"base.dists.discreteUniform.mean": "\nbase.dists.discreteUniform.mean( a, b )\n Returns the expected value of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.mean( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.mean( 4, 12 )\n 8.0\n > v = base.dists.discreteUniform.mean( 2, 8 )\n 5.0\n\n",
"base.dists.discreteUniform.median": "\nbase.dists.discreteUniform.median( a, b )\n Returns the median of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.median( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.median( 4, 12 )\n 8.0\n > v = base.dists.discreteUniform.median( 2, 8 )\n 5.0\n\n",
"base.dists.discreteUniform.mgf": "\nbase.dists.discreteUniform.mgf( t, a, b )\n Evaluates the moment-generating function (MGF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `t`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.mgf( 2.0, 0, 4 )\n ~689.475\n > y = base.dists.discreteUniform.mgf( -0.2, 0, 4 )\n ~0.697\n > y = base.dists.discreteUniform.mgf( 2.0, 0, 1 )\n ~4.195\n > y = base.dists.discreteUniform.mgf( 0.5, 3, 2 )\n NaN\n > y = base.dists.discreteUniform.mgf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.mgf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.mgf( 0.0, 0, NaN )\n NaN\n\n\nbase.dists.discreteUniform.mgf.factory( a, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a discrete uniform distribution with minimum support `a` and maximum\n support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.discreteUniform.mgf.factory( 6, 7 );\n > var y = mymgf( 0.1 )\n ~1.918\n > y = mymgf( 1.1 )\n ~1471.722\n\n",
"base.dists.discreteUniform.pmf": "\nbase.dists.discreteUniform.pmf( x, a, b )\n Evaluates the probability mass function (PMF) for a discrete uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.pmf( 2.0, 0, 4 )\n ~0.2\n > y = base.dists.discreteUniform.pmf( 5.0, 0, 4 )\n 0.0\n > y = base.dists.discreteUniform.pmf( 3.0, -4, 4 )\n ~0.111\n > y = base.dists.discreteUniform.pmf( NaN, 0, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 0.0, NaN, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 0.0, 0, NaN )\n NaN\n > y = base.dists.discreteUniform.pmf( 2.0, 3, 1 )\n NaN\n > y = base.dists.discreteUniform.pmf( 2.0, 1, 2.4 )\n NaN\n\n\nbase.dists.discreteUniform.pmf.factory( a, b )\n Returns a function for evaluating the probability mass function (PMF) of\n a discrete uniform distribution with minimum support `a` and maximum support\n `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.discreteUniform.pmf.factory( 6, 7 );\n > var y = myPMF( 7.0 )\n 0.5\n > y = myPMF( 5.0 )\n 0.0\n\n",
"base.dists.discreteUniform.quantile": "\nbase.dists.discreteUniform.quantile( p, a, b )\n Evaluates the quantile function for a discrete uniform distribution with\n minimum support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n If provided `a > b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.discreteUniform.quantile( 0.8, 0, 1 )\n 1\n > y = base.dists.discreteUniform.quantile( 0.5, 0.0, 10.0 )\n 5\n\n > y = base.dists.discreteUniform.quantile( 1.1, 0, 4 )\n NaN\n > y = base.dists.discreteUniform.quantile( -0.2, 0, 4 )\n NaN\n\n > y = base.dists.discreteUniform.quantile( NaN, -2, 2 )\n NaN\n > y = base.dists.discreteUniform.quantile( 0.1, NaN, 2 )\n NaN\n > y = base.dists.discreteUniform.quantile( 0.1, -2, NaN )\n NaN\n\n > y = base.dists.discreteUniform.quantile( 0.5, 2, 1 )\n NaN\n\n\nbase.dists.discreteUniform.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a discrete\n uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.discreteUniform.quantile.factory( 0, 4 );\n > var y = myQuantile( 0.8 )\n 4\n\n",
"base.dists.discreteUniform.skewness": "\nbase.dists.discreteUniform.skewness( a, b )\n Returns the skewness of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.skewness( -2, 2 )\n 0.0\n > v = base.dists.discreteUniform.skewness( 4, 12 )\n 0.0\n > v = base.dists.discreteUniform.skewness( 2, 8 )\n 0.0\n\n",
"base.dists.discreteUniform.stdev": "\nbase.dists.discreteUniform.stdev( a, b )\n Returns the standard deviation of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.stdev( 0, 1 )\n ~0.5\n > v = base.dists.discreteUniform.stdev( 4, 12 )\n ~2.582\n > v = base.dists.discreteUniform.stdev( 2, 8 )\n 2.0\n\n",
"base.dists.discreteUniform.variance": "\nbase.dists.discreteUniform.variance( a, b )\n Returns the variance of a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.discreteUniform.variance( 0, 1 )\n ~0.25\n > v = base.dists.discreteUniform.variance( 4, 12 )\n ~6.667\n > v = base.dists.discreteUniform.variance( 2, 8 )\n 4.0\n\n",
"base.dists.erlang.cdf": "\nbase.dists.erlang.cdf( x, k, λ )\n Evaluates the cumulative distribution function (CDF) for an Erlang\n distribution with shape parameter `k` and rate parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.erlang.cdf( 2.0, 1, 1.0 )\n ~0.865\n > y = base.dists.erlang.cdf( 2.0, 3, 1.0 )\n ~0.323\n > y = base.dists.erlang.cdf( 2.0, 2.5, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( -1.0, 2, 2.0 )\n 0.0\n > y = base.dists.erlang.cdf( PINF, 4, 2.0 )\n 1.0\n > y = base.dists.erlang.cdf( NINF, 4, 2.0 )\n 0.0\n > y = base.dists.erlang.cdf( NaN, 0, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 0.0, 0, NaN )\n NaN\n > y = base.dists.erlang.cdf( 2.0, -1, 1.0 )\n NaN\n > y = base.dists.erlang.cdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.cdf.factory( k, λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.erlang.cdf.factory( 2, 0.5 );\n > var y = mycdf( 6.0 )\n ~0.801\n > y = mycdf( 2.0 )\n ~0.264\n\n",
"base.dists.erlang.entropy": "\nbase.dists.erlang.entropy( k, λ )\n Returns the differential entropy of an Erlang distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.erlang.entropy( 1, 1.0 )\n ~1.0\n > v = base.dists.erlang.entropy( 4, 12.0 )\n ~-0.462\n > v = base.dists.erlang.entropy( 8, 2.0 )\n ~1.723\n\n",
"base.dists.erlang.Erlang": "\nbase.dists.erlang.Erlang( [k, λ] )\n Returns an Erlang distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Shape parameter. Must be a positive integer. Default: `1.0`.\n\n λ: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n erlang: Object\n Distribution instance.\n\n erlang.k: number\n Shape parameter. If set, the value must be a positive integer.\n\n erlang.lambda: number\n Rate parameter. If set, the value must be greater than `0`.\n\n erlang.entropy: number\n Read-only property which returns the differential entropy.\n\n erlang.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n erlang.mean: number\n Read-only property which returns the expected value.\n\n erlang.mode: number\n Read-only property which returns the mode.\n\n erlang.skewness: number\n Read-only property which returns the skewness.\n\n erlang.stdev: number\n Read-only property which returns the standard deviation.\n\n erlang.variance: number\n Read-only property which returns the variance.\n\n erlang.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n erlang.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n erlang.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n erlang.pdf: Function\n Evaluates the probability density function (PDF).\n\n erlang.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var erlang = base.dists.erlang.Erlang( 6, 5.0 );\n > erlang.k\n 6\n > erlang.lambda\n 5.0\n > erlang.entropy\n ~0.647\n > erlang.kurtosis\n 1.0\n > erlang.mean\n 1.2\n > erlang.mode\n 1.0\n > erlang.skewness\n ~0.816\n > erlang.stdev\n ~0.49\n > erlang.variance\n 0.24\n > erlang.cdf( 3.0 )\n ~0.997\n > erlang.logpdf( 3.0 )\n ~-4.638\n > erlang.mgf( -0.5 )\n ~0.564\n > erlang.pdf( 3.0 )\n ~0.01\n > erlang.quantile( 0.8 )\n ~1.581\n\n",
"base.dists.erlang.kurtosis": "\nbase.dists.erlang.kurtosis( k, λ )\n Returns the excess kurtosis of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.erlang.kurtosis( 1, 1.0 )\n 6.0\n > v = base.dists.erlang.kurtosis( 4, 12.0 )\n 1.5\n > v = base.dists.erlang.kurtosis( 8, 2.0 )\n 0.75\n\n",
"base.dists.erlang.logpdf": "\nbase.dists.erlang.logpdf( x, k, λ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an Erlang distribution with shape parameter `k` and rate parameter `λ`\n at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.erlang.logpdf( 0.1, 1, 1.0 )\n ~-0.1\n > y = base.dists.erlang.logpdf( 0.5, 2, 2.5 )\n ~-0.111\n > y = base.dists.erlang.logpdf( -1.0, 4, 2.0 )\n -Infinity\n > y = base.dists.erlang.logpdf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.logpdf( 0.0, 1, NaN )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, -2, 0.5 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 0.5, 0.5 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.erlang.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n > y = base.dists.erlang.logpdf( 2.0, 1, 0.0 )\n NaN\n > y = base.dists.erlang.logpdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.logpdf.factory( k, λ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of an Erlang distribution with shape parameter `k`\n and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.erlang.logpdf.factory( 6.0, 7.0 );\n > y = myLogPDF( 7.0 )\n ~-32.382\n\n\n",
"base.dists.erlang.mean": "\nbase.dists.erlang.mean( k, λ )\n Returns the expected value of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.erlang.mean( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.mean( 4, 12.0 )\n ~0.333\n > v = base.dists.erlang.mean( 8, 2.0 )\n 4.0\n\n",
"base.dists.erlang.mgf": "\nbase.dists.erlang.mgf( t, k, λ )\n Evaluates the moment-generating function (MGF) for an Erlang distribution\n with shape parameter `k` and rate parameter `λ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.erlang.mgf( 0.3, 1, 1.0 )\n ~1.429\n > y = base.dists.erlang.mgf( 2.0, 2, 3.0 )\n ~9.0\n > y = base.dists.erlang.mgf( -1.0, 2, 2.0 )\n ~0.444\n\n > y = base.dists.erlang.mgf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.0, 1, NaN )\n NaN\n\n > y = base.dists.erlang.mgf( 0.2, -2, 0.5 )\n NaN\n > y = base.dists.erlang.mgf( 0.2, 0.5, 0.5 )\n NaN\n\n > y = base.dists.erlang.mgf( 0.2, 1, 0.0 )\n NaN\n > y = base.dists.erlang.mgf( 0.2, 1, -5.0 )\n NaN\n\n\nbase.dists.erlang.mgf.factory( k, λ )\n Returns a function for evaluating the moment-generating function (MGF) of an\n Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.erlang.mgf.factory( 2, 0.5 );\n > var y = myMGF( 0.2 )\n ~2.778\n > y = myMGF( -0.5 )\n 0.25\n\n",
"base.dists.erlang.mode": "\nbase.dists.erlang.mode( k, λ )\n Returns the mode of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.erlang.mode( 1, 1.0 )\n 0.0\n > v = base.dists.erlang.mode( 4, 12.0 )\n 0.25\n > v = base.dists.erlang.mode( 8, 2.0 )\n 3.5\n\n",
"base.dists.erlang.pdf": "\nbase.dists.erlang.pdf( x, k, λ )\n Evaluates the probability density function (PDF) for an Erlang distribution\n with shape parameter `k` and rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.erlang.pdf( 0.1, 1, 1.0 )\n ~0.905\n > y = base.dists.erlang.pdf( 0.5, 2, 2.5 )\n ~0.895\n > y = base.dists.erlang.pdf( -1.0, 4, 2.0 )\n 0.0\n > y = base.dists.erlang.pdf( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.pdf( 0.0, 1, NaN )\n NaN\n > y = base.dists.erlang.pdf( 2.0, -2, 0.5 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 0.5, 0.5 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.erlang.pdf( 0.0, 0.0, 2.0 )\n Infinity\n > y = base.dists.erlang.pdf( 2.0, 1, 0.0 )\n NaN\n > y = base.dists.erlang.pdf( 2.0, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.pdf.factory( k, λ )\n Returns a function for evaluating the probability density function (PDF)\n of an Erlang distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.erlang.pdf.factory( 6.0, 7.0 );\n > y = myPDF( 7.0 )\n ~8.639e-15\n\n\n",
"base.dists.erlang.quantile": "\nbase.dists.erlang.quantile( p, k, λ )\n Evaluates the quantile function for an Erlang distribution with shape\n parameter `k` and rate parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a nonnegative integer for `k`, the function returns `NaN`.\n\n If provided a non-positive number for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.erlang.quantile( 0.8, 2, 1.0 )\n ~2.994\n > y = base.dists.erlang.quantile( 0.5, 4, 2.0 )\n ~1.836\n\n > y = base.dists.erlang.quantile( 1.1, 1, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( -0.2, 1, 1.0 )\n NaN\n\n > y = base.dists.erlang.quantile( NaN, 1, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.erlang.quantile( 0.0, 1, NaN )\n NaN\n\n // Non-integer shape parameter:\n > y = base.dists.erlang.quantile( 0.5, 0.5, 1.0 )\n NaN\n // Non-positive shape parameter:\n > y = base.dists.erlang.quantile( 0.5, -1, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.erlang.quantile( 0.5, 1, -1.0 )\n NaN\n\n\nbase.dists.erlang.quantile.factory( k, λ )\n Returns a function for evaluating the quantile function of an Erlang\n distribution with shape parameter `k` and rate parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.erlang.quantile.factory( 10, 2.0 );\n > var y = myQuantile( 0.4 )\n ~4.452\n\n",
"base.dists.erlang.skewness": "\nbase.dists.erlang.skewness( k, λ )\n Returns the skewness of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.erlang.skewness( 1, 1.0 )\n 2.0\n > v = base.dists.erlang.skewness( 4, 12.0 )\n 1.0\n > v = base.dists.erlang.skewness( 8, 2.0 )\n ~0.707\n\n",
"base.dists.erlang.stdev": "\nbase.dists.erlang.stdev( k, λ )\n Returns the standard deviation of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.erlang.stdev( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.stdev( 4, 12.0 )\n ~0.167\n > v = base.dists.erlang.stdev( 8, 2.0 )\n ~1.414\n\n",
"base.dists.erlang.variance": "\nbase.dists.erlang.variance( k, λ )\n Returns the variance of an Erlang distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If not provided a positive integer for `k`, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.erlang.variance( 1, 1.0 )\n 1.0\n > v = base.dists.erlang.variance( 4, 12.0 )\n ~0.028\n > v = base.dists.erlang.variance( 8, 2.0 )\n 2.0\n\n",
"base.dists.exponential.cdf": "\nbase.dists.exponential.cdf( x, λ )\n Evaluates the cumulative distribution function (CDF) for an exponential\n distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.exponential.cdf( 2.0, 0.1 )\n ~0.181\n > y = base.dists.exponential.cdf( 1.0, 2.0 )\n ~0.865\n > y = base.dists.exponential.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.exponential.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.cdf( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.cdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.cdf.factory( λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n for an exponential distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.exponential.cdf.factory( 0.5 );\n > var y = myCDF( 3.0 )\n ~0.777\n\n",
"base.dists.exponential.entropy": "\nbase.dists.exponential.entropy( λ )\n Returns the differential entropy of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.exponential.entropy( 11.0 )\n ~-1.398\n > v = base.dists.exponential.entropy( 4.5 )\n ~-0.504\n\n",
"base.dists.exponential.Exponential": "\nbase.dists.exponential.Exponential( [λ] )\n Returns an exponential distribution object.\n\n Parameters\n ----------\n λ: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n exponential: Object\n Distribution instance.\n\n exponential.lambda: number\n Rate parameter. If set, the value must be greater than `0`.\n\n exponential.entropy: number\n Read-only property which returns the differential entropy.\n\n exponential.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n exponential.mean: number\n Read-only property which returns the expected value.\n\n exponential.median: number\n Read-only property which returns the median.\n\n exponential.mode: number\n Read-only property which returns the mode.\n\n exponential.skewness: number\n Read-only property which returns the skewness.\n\n exponential.stdev: number\n Read-only property which returns the standard deviation.\n\n exponential.variance: number\n Read-only property which returns the variance.\n\n exponential.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n exponential.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n exponential.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n exponential.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n exponential.pdf: Function\n Evaluates the probability density function (PDF).\n\n exponential.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var exponential = base.dists.exponential.Exponential( 6.0 );\n > exponential.lambda\n 6.0\n > exponential.entropy\n ~-0.792\n > exponential.kurtosis\n 6.0\n > exponential.mean\n ~0.167\n > exponential.median\n ~0.116\n > exponential.mode\n 0.0\n > exponential.skewness\n 2.0\n > exponential.stdev\n ~0.167\n > exponential.variance\n ~0.028\n > exponential.cdf( 1.0 )\n ~0.998\n > exponential.logcdf( 1.0 )\n ~-0.002\n > exponential.logpdf( 1.5 )\n ~-7.208\n > exponential.mgf( -0.5 )\n ~0.923\n > exponential.pdf( 1.5 )\n ~0.001\n > exponential.quantile( 0.5 )\n ~0.116\n\n",
"base.dists.exponential.kurtosis": "\nbase.dists.exponential.kurtosis( λ )\n Returns the excess kurtosis of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.exponential.kurtosis( 11.0 )\n 6.0\n > v = base.dists.exponential.kurtosis( 4.5 )\n 6.0\n\n",
"base.dists.exponential.logcdf": "\nbase.dists.exponential.logcdf( x, λ )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for an exponential distribution with rate parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.exponential.logcdf( 2.0, 0.1 )\n ~-1.708\n > y = base.dists.exponential.logcdf( 1.0, 2.0 )\n ~-0.145\n > y = base.dists.exponential.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.exponential.logcdf( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.logcdf( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.logcdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.logcdf.factory( λ )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) for an exponential distribution with rate\n parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogCDF = base.dists.exponential.logcdf.factory( 0.5 );\n > var y = mylogCDF( 3.0 )\n ~-0.252\n\n",
"base.dists.exponential.logpdf": "\nbase.dists.exponential.logpdf( x, λ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an exponential distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.exponential.logpdf( 0.3, 4.0 )\n ~0.186\n > y = base.dists.exponential.logpdf( 2.0, 0.7 )\n ~-1.757\n > y = base.dists.exponential.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.exponential.logpdf( 0, NaN )\n NaN\n > y = base.dists.exponential.logpdf( NaN, 2.0 )\n NaN\n\n // Negative rate:\n > y = base.dists.exponential.logpdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.logpdf.factory( λ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) for an exponential distribution with rate parameter\n `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.exponential.logpdf.factory( 0.5 );\n > var y = mylogpdf( 3.0 )\n ~-2.193\n\n",
"base.dists.exponential.mean": "\nbase.dists.exponential.mean( λ )\n Returns the expected value of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.exponential.mean( 11.0 )\n ~0.091\n > v = base.dists.exponential.mean( 4.5 )\n ~0.222\n\n",
"base.dists.exponential.median": "\nbase.dists.exponential.median( λ )\n Returns the median of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.exponential.median( 11.0 )\n ~0.063\n > v = base.dists.exponential.median( 4.5 )\n ~0.154\n\n",
"base.dists.exponential.mode": "\nbase.dists.exponential.mode( λ )\n Returns the mode of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.exponential.mode( 11.0 )\n 0.0\n > v = base.dists.exponential.mode( 4.5 )\n 0.0\n\n",
"base.dists.exponential.pdf": "\nbase.dists.exponential.pdf( x, λ )\n Evaluates the probability density function (PDF) for an exponential\n distribution with rate parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.exponential.pdf( 0.3, 4.0 )\n ~1.205\n > y = base.dists.exponential.pdf( 2.0, 0.7 )\n ~0.173\n > y = base.dists.exponential.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.exponential.pdf( 0, NaN )\n NaN\n > y = base.dists.exponential.pdf( NaN, 2.0 )\n NaN\n\n // Negative rate:\n > y = base.dists.exponential.pdf( 2.0, -1.0 )\n NaN\n\nbase.dists.exponential.pdf.factory( λ )\n Returns a function for evaluating the probability density function (PDF)\n for an exponential distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.exponential.pdf.factory( 0.5 );\n > var y = myPDF( 3.0 )\n ~0.112\n\n",
"base.dists.exponential.quantile": "\nbase.dists.exponential.quantile( p, λ )\n Evaluates the quantile function for an exponential distribution with rate\n parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.exponential.quantile( 0.8, 1.0 )\n ~1.609\n > y = base.dists.exponential.quantile( 0.5, 4.0 )\n ~0.173\n > y = base.dists.exponential.quantile( 0.5, 0.1 )\n ~6.931\n\n > y = base.dists.exponential.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.exponential.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.exponential.quantile( 0.0, NaN )\n NaN\n\n // Negative rate parameter:\n > y = base.dists.exponential.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.exponential.quantile.factory( λ )\n Returns a function for evaluating the quantile function for an exponential\n distribution with rate parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.exponential.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n ~1.277\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.exponential.skewness": "\nbase.dists.exponential.skewness( λ )\n Returns the skewness of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.exponential.skewness( 11.0 )\n 2.0\n > v = base.dists.exponential.skewness( 4.5 )\n 2.0\n\n",
"base.dists.exponential.stdev": "\nbase.dists.exponential.stdev( λ )\n Returns the standard deviation of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.exponential.stdev( 9.0 )\n ~0.11\n > v = base.dists.exponential.stdev( 1.0 )\n 1.0\n\n",
"base.dists.exponential.variance": "\nbase.dists.exponential.variance( λ )\n Returns the variance of an exponential distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.exponential.variance( 9.0 )\n ~0.012\n > v = base.dists.exponential.variance( 1.0 )\n 1.0\n\n",
"base.dists.f.cdf": "\nbase.dists.f.cdf( x, d1, d2 )\n Evaluates the cumulative distribution function (CDF) for a F distribution\n with numerator degrees of freedom `d1` and denominator degrees of freedom\n `d2` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.f.cdf( 2.0, 1.0, 1.0 )\n ~0.608\n > var y = base.dists.f.cdf( 2.0, 8.0, 4.0 )\n ~0.737\n > var y = base.dists.f.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > var y = base.dists.f.cdf( PINF, 4.0, 2.0 )\n 1.0\n > var y = base.dists.f.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > var y = base.dists.f.cdf( NaN, 1.0, 1.0 )\n NaN\n > var y = base.dists.f.cdf( 0.0, NaN, 1.0 )\n NaN\n > var y = base.dists.f.cdf( 0.0, 1.0, NaN )\n NaN\n\n > var y = base.dists.f.cdf( 2.0, 1.0, -1.0 )\n NaN\n > var y = base.dists.f.cdf( 2.0, -1.0, 1.0 )\n NaN\n\n\nbase.dists.f.cdf.factory( d1, d2 )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a F distribution with numerator degrees of freedom `d1` and denominator\n degrees of freedom `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.f.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 10.0 )\n ~0.906\n > y = myCDF( 8.0 )\n ~0.884\n\n",
"base.dists.f.entropy": "\nbase.dists.f.entropy( d1, d2 )\n Returns the differential entropy of a F distribution (in nats).\n\n If `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.f.entropy( 3.0, 7.0 )\n ~1.298\n > v = base.dists.f.entropy( 4.0, 12.0 )\n ~1.12\n > v = base.dists.f.entropy( 8.0, 2.0 )\n ~2.144\n\n",
"base.dists.f.F": "\nbase.dists.f.F( [d1, d2] )\n Returns a F distribution object.\n\n Parameters\n ----------\n d1: number (optional)\n Numerator degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n d2: number (optional)\n Denominator degrees of freedom. Must be greater than `0`.\n Default: `1.0`.\n\n Returns\n -------\n f: Object\n Distribution instance.\n\n f.d1: number\n Numerator degrees of freedom. If set, the value must be greater than\n `0`.\n\n f.d2: number\n Denominator degrees of freedom. If set, the value must be greater than\n `0`.\n\n f.entropy: number\n Read-only property which returns the differential entropy.\n\n f.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n f.mean: number\n Read-only property which returns the expected value.\n\n f.mode: number\n Read-only property which returns the mode.\n\n f.skewness: number\n Read-only property which returns the skewness.\n\n f.stdev: number\n Read-only property which returns the standard deviation.\n\n f.variance: number\n Read-only property which returns the variance.\n\n f.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n f.pdf: Function\n Evaluates the probability density function (PDF).\n\n f.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var f = base.dists.f.F( 6.0, 9.0 );\n > f.d1\n 6.0\n > f.d2\n 9.0\n > f.entropy\n ~1.134\n > f.kurtosis\n ~104.564\n > f.mean\n ~1.286\n > f.mode\n ~0.545\n > f.skewness\n ~4.535\n > f.stdev\n ~1.197\n > f.variance\n ~1.433\n > f.cdf( 3.0 )\n ~0.932\n > f.pdf( 2.5 )\n ~0.095\n > f.quantile( 0.8 )\n ~1.826\n\n",
"base.dists.f.kurtosis": "\nbase.dists.f.kurtosis( d1, d2 )\n Returns the excess kurtosis of a F distribution.\n\n If `d1 <= 0` or `d2 <= 8`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.f.kurtosis( 3.0, 9.0 )\n ~124.667\n > v = base.dists.f.kurtosis( 4.0, 12.0 )\n ~26.143\n > v = base.dists.f.kurtosis( 8.0, 9.0 )\n ~100.167\n\n",
"base.dists.f.mean": "\nbase.dists.f.mean( d1, d2 )\n Returns the expected value of a F distribution.\n\n If `d1 <= 0` or `d2 <= 2`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.f.mean( 3.0, 5.0 )\n ~1.667\n > v = base.dists.f.mean( 4.0, 12.0 )\n ~1.2\n > v = base.dists.f.mean( 8.0, 4.0 )\n 2.0\n\n",
"base.dists.f.mode": "\nbase.dists.f.mode( d1, d2 )\n Returns the mode of a F distribution.\n\n If `d1 <= 2` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.f.mode( 3.0, 5.0 )\n ~0.238\n > v = base.dists.f.mode( 4.0, 12.0 )\n ~0.429\n > v = base.dists.f.mode( 8.0, 4.0 )\n 0.5\n\n",
"base.dists.f.pdf": "\nbase.dists.f.pdf( x, d1, d2 )\n Evaluates the probability density function (PDF) for a F distribution with\n numerator degrees of freedom `d1` and denominator degrees of freedom `d2` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.f.pdf( 2.0, 0.5, 1.0 )\n ~0.057\n > y = base.dists.f.pdf( 0.1, 1.0, 1.0 )\n ~0.915\n > y = base.dists.f.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.f.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.f.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.f.pdf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.f.pdf( 2.0, 1.0, -1.0 )\n NaN\n > y = base.dists.f.pdf( 2.0, -1.0, 1.0 )\n NaN\n\n\nbase.dists.f.pdf.factory( d1, d2 )\n Returns a function for evaluating the probability density function (PDF) of\n a F distribution with numerator degrees of freedom `d1` and denominator\n degrees of freedom `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.f.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n ~0.004\n > y = myPDF( 2.0 )\n ~0.166\n\n",
"base.dists.f.quantile": "\nbase.dists.f.quantile( p, d1, d2 )\n Evaluates the quantile function for a F distribution with numerator degrees\n of freedom `d1` and denominator degrees of freedom `d2` at a probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.f.quantile( 0.8, 1.0, 1.0 )\n ~9.472\n > y = base.dists.f.quantile( 0.5, 4.0, 2.0 )\n ~1.207\n\n > y = base.dists.f.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.f.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.f.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.f.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.f.quantile.factory( d1, d2 )\n Returns a function for evaluating the quantile function of a F distribution\n with numerator degrees of freedom `d1` and denominator degrees of freedom\n `d2`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.f.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.2 )\n ~0.527\n > y = myQuantile( 0.8 )\n ~4.382\n\n",
"base.dists.f.skewness": "\nbase.dists.f.skewness( d1, d2 )\n Returns the skewness of a F distribution.\n\n If `d1 <= 0` or `d2 <= 6`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.f.skewness( 3.0, 7.0 )\n 11.0\n > v = base.dists.f.skewness( 4.0, 12.0 )\n ~3.207\n > v = base.dists.f.skewness( 8.0, 7.0 )\n ~10.088\n\n",
"base.dists.f.stdev": "\nbase.dists.f.stdev( d1, d2 )\n Returns the standard deviation of a F distribution.\n\n If `d1 <= 0` or `d2 <= 4`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.f.stdev( 3.0, 5.0 )\n ~3.333\n > v = base.dists.f.stdev( 4.0, 12.0 )\n ~1.122\n > v = base.dists.f.stdev( 8.0, 5.0 )\n ~2.764\n\n",
"base.dists.f.variance": "\nbase.dists.f.variance( d1, d2 )\n Returns the variance of a F distribution.\n\n If `d1 <= 0` or `d2 <= 4`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Numerator degrees of freedom.\n\n d2: number\n Denominator degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.f.variance( 3.0, 5.0 )\n ~11.111\n > v = base.dists.f.variance( 4.0, 12.0 )\n ~1.26\n > v = base.dists.f.variance( 8.0, 5.0 )\n ~7.639\n\n",
"base.dists.frechet.cdf": "\nbase.dists.frechet.cdf( x, α, s, m )\n Evaluates the cumulative distribution function (CDF) for a Fréchet\n distribution with shape parameter `α`, scale parameter `s`, and location\n `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.frechet.cdf( 10.0, 2.0, 3.0, 0.0 )\n ~0.914\n > y = base.dists.frechet.cdf( -1.0, 2.0, 3.0, -3.0 )\n ~0.105\n > y = base.dists.frechet.cdf( 2.5, 2.0, 1.0, 2.0 )\n ~0.018\n > y = base.dists.frechet.cdf( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.cdf( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.cdf( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.cdf.factory( α, s, m )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.frechet.cdf.factory( 3.0, 3.0, 5.0 );\n > var y = myCDF( 10.0 )\n ~0.806\n > y = myCDF( 7.0 )\n ~0.034\n\n",
"base.dists.frechet.entropy": "\nbase.dists.frechet.entropy( α, s, m )\n Returns the differential entropy of a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.frechet.entropy( 1.0, 1.0, 1.0 )\n ~2.154\n > y = base.dists.frechet.entropy( 4.0, 2.0, 1.0 )\n ~1.028\n > y = base.dists.frechet.entropy( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.entropy( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.entropy( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.Frechet": "\nbase.dists.frechet.Frechet( [α, s, m] )\n Returns a Fréchet distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n m: number (optional)\n Location parameter. Default: `0.0`.\n\n Returns\n -------\n frechet: Object\n Distribution instance.\n\n frechet.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n frechet.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n frechet.m: number\n Location parameter.\n\n frechet.entropy: number\n Read-only property which returns the differential entropy.\n\n frechet.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n frechet.mean: number\n Read-only property which returns the expected value.\n\n frechet.median: number\n Read-only property which returns the median.\n\n frechet.mode: number\n Read-only property which returns the mode.\n\n frechet.skewness: number\n Read-only property which returns the skewness.\n\n frechet.stdev: number\n Read-only property which returns the standard deviation.\n\n frechet.variance: number\n Read-only property which returns the variance.\n\n frechet.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n frechet.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n frechet.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n frechet.pdf: Function\n Evaluates the probability density function (PDF).\n\n frechet.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var frechet = base.dists.frechet.Frechet( 1.0, 1.0, 0.0 );\n > frechet.alpha\n 1.0\n > frechet.s\n 1.0\n > frechet.m\n 0.0\n > frechet.entropy\n ~2.154\n > frechet.kurtosis\n Infinity\n > frechet.mean\n Infinity\n > frechet.median\n ~1.443\n > frechet.mode\n 0.5\n > frechet.skewness\n Infinity\n > frechet.stdev\n Infinity\n > frechet.variance\n Infinity\n > frechet.cdf( 0.8 )\n ~0.287\n > frechet.logcdf( 0.8 )\n -1.25\n > frechet.logpdf( 0.8 )\n ~-0.804\n > frechet.pdf( 0.8 )\n ~0.448\n > frechet.quantile( 0.8 )\n ~4.481\n\n",
"base.dists.frechet.kurtosis": "\nbase.dists.frechet.kurtosis( α, s, m )\n Returns the excess kurtosis of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 4` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.frechet.kurtosis( 5.0, 2.0, 1.0 )\n ~45.092\n > var y = base.dists.frechet.kurtosis( 5.0, 10.0, -3.0 )\n ~45.092\n > y = base.dists.frechet.kurtosis( 3.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.kurtosis( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.kurtosis( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.kurtosis( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.logcdf": "\nbase.dists.frechet.logcdf( x, α, s, m )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a Fréchet distribution with shape parameter `α`, scale parameter\n `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.frechet.logcdf( 10.0, 2.0, 3.0, 0.0 )\n ~-0.09\n > y = base.dists.frechet.logcdf( -1.0, 2.0, 3.0, -3.0 )\n ~-2.25\n > y = base.dists.frechet.logcdf( 2.5, 2.0, 1.0, 2.0 )\n -4.0\n > y = base.dists.frechet.logcdf( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.logcdf( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.logcdf.factory( α, s, m )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.frechet.logcdf.factory( 3.0, 3.0, 5.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.216\n > y = mylogcdf( 7.0 )\n ~-3.375\n\n",
"base.dists.frechet.logpdf": "\nbase.dists.frechet.logpdf( x, α, s, m )\n Evaluates the logarithm of the probability density function (PDF) for a\n Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.frechet.logpdf( 10.0, 1.0, 3.0, 5.0 )\n ~-2.72\n > y = base.dists.frechet.logpdf( -2.0, 1.0, 3.0, -3.0 )\n ~-1.901\n > y = base.dists.frechet.logpdf( 0.0, 2.0, 1.0, -1.0 )\n ~-0.307\n > y = base.dists.frechet.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.frechet.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.frechet.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.frechet.logpdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.frechet.logpdf.factory( α, s, m )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Fréchet distribution with shape parameter `α`, scale\n parameter `s`, and location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.frechet.logpdf.factory( 2.0, 3.0, 1.0 );\n > var y = mylogPDF( 10.0 )\n ~-3.812\n > y = mylogPDF( 2.0 )\n ~-6.11\n\n",
"base.dists.frechet.mean": "\nbase.dists.frechet.mean( α, s, m )\n Returns the expected value of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 1` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Mean.\n\n Examples\n --------\n > var y = base.dists.frechet.mean( 4.0, 2.0, 1.0 )\n ~3.451\n > y = base.dists.frechet.mean( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.mean( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.mean( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.mean( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.median": "\nbase.dists.frechet.median( α, s, m )\n Returns the median of a Fréchet distribution with shape parameter\n `α`, scale parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.frechet.median( 4.0, 2.0, 1.0 )\n ~3.192\n > var y = base.dists.frechet.median( 4.0, 2.0, -3.0 )\n ~-0.808\n > y = base.dists.frechet.median( 0.5, 2.0, 1.0 )\n ~5.163\n > y = base.dists.frechet.median( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.median( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.median( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.mode": "\nbase.dists.frechet.mode( α, s, m )\n Returns the mode of a Fréchet distribution with shape parameter `α`, scale\n parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.frechet.mode( 4.0, 2.0, 1.0 )\n ~2.891\n > var y = base.dists.frechet.mode( 4.0, 2.0, -3.0 )\n ~-1.109\n > y = base.dists.frechet.mode( 0.5, 2.0, 1.0 )\n ~1.222\n > y = base.dists.frechet.mode( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.mode( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.mode( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.pdf": "\nbase.dists.frechet.pdf( x, α, s, m )\n Evaluates the probability density function (PDF) for a Fréchet distribution\n with shape parameter `α`, scale parameter `s`, and location `m`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.frechet.pdf( 10.0, 0.0, 3.0 )\n ~0.965\n > y = base.dists.frechet.pdf( -2.0, 0.0, 3.0 )\n ~0.143\n > y = base.dists.frechet.pdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.frechet.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.frechet.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.frechet.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.frechet.pdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.frechet.pdf.factory( α, s, m )\n Returns a function for evaluating the probability density function (PDF) of\n a Fréchet distribution with shape parameter `α`, scale parameter `s`, and\n location `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.frechet.pdf.factory( 2.0, 3.0 );\n > var y = myPDF( 10.0 )\n ~0.933\n > y = myPDF( 2.0 )\n ~0.368\n\n",
"base.dists.frechet.quantile": "\nbase.dists.frechet.quantile( p, α, s, m )\n Evaluates the quantile function for a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.frechet.quantile( 0.3, 10.0, 2.0, 3.0 )\n ~4.963\n > y = base.dists.frechet.quantile( 0.2, 3.0, 3.0, 3.0 )\n ~5.56\n > y = base.dists.frechet.quantile( 0.9, 1.0, 1.0, -3.0 )\n ~6.491\n > y = base.dists.frechet.quantile( NaN, 1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, NaN, 1.0, 0.0)\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, 1.0, NaN )\n NaN\n > y = base.dists.frechet.quantile( 0.0, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.quantile( 0.0, 1.0, -1.0, 0.0 )\n NaN\n\n\nbase.dists.frechet.quantile.factory( α, s, m )\n Returns a function for evaluating the quantile function of a Fréchet\n distribution with shape parameter `α`, scale parameter `s`, and location\n `m`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.frechet.quantile.factory( 2.0, 2.0, 3.0 );\n > var y = myQuantile( 0.5 )\n ~5.402\n > y = myQuantile( 0.2 )\n ~4.576\n\n",
"base.dists.frechet.skewness": "\nbase.dists.frechet.skewness( α, s, m )\n Returns the skewness of a Fréchet distribution with shape parameter `α`,\n scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 3` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.frechet.skewness( 4.0, 2.0, 1.0 )\n ~5.605\n > var y = base.dists.frechet.skewness( 4.0, 2.0, -3.0 )\n ~5.605\n > y = base.dists.frechet.skewness( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.skewness( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.skewness( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.skewness( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.stdev": "\nbase.dists.frechet.stdev( α, s, m )\n Returns the standard deviation of a Fréchet distribution with shape\n parameter `α`, scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 2` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.frechet.stdev( 4.0, 2.0, 1.0 )\n ~1.041\n > var y = base.dists.frechet.stdev( 4.0, 2.0, -3.0 )\n ~1.041\n > y = base.dists.frechet.stdev( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.stdev( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.stdev( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.stdev( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.frechet.variance": "\nbase.dists.frechet.variance( α, s, m )\n Returns the variance of a Fréchet distribution with shape parameter `α`,\n scale parameter `s`, and location `m`.\n\n If provided `0 < α <= 2` and `s > 0`, the function returns positive\n infinity.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.frechet.variance( 4.0, 2.0, 1.0 )\n ~1.083\n > var y = base.dists.frechet.variance( 4.0, 2.0, -3.0 )\n ~1.083\n > y = base.dists.frechet.variance( 0.5, 2.0, 1.0 )\n Infinity\n > y = base.dists.frechet.variance( NaN, 1.0, 0.0 )\n NaN\n > y = base.dists.frechet.variance( 1.0, NaN, 0.0 )\n NaN\n > y = base.dists.frechet.variance( 1.0, 1.0, NaN )\n NaN\n\n",
"base.dists.gamma.cdf": "\nbase.dists.gamma.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a gamma\n distribution with shape parameter `α` and rate parameter `β` at a value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.gamma.cdf( 2.0, 1.0, 1.0 )\n ~0.865\n > y = base.dists.gamma.cdf( 2.0, 3.0, 1.0 )\n ~0.323\n > y = base.dists.gamma.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.gamma.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.gamma.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.gamma.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.gamma.cdf( 2.0, -1.0, 1.0 )\n NaN\n > y = base.dists.gamma.cdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0` when `α = 0.0`:\n > y = base.dists.gamma.cdf( 2.0, 0.0, 2.0 )\n 1.0\n > y = base.dists.gamma.cdf( -2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.cdf( 0.0, 0.0, 2.0 )\n 0.0\n\n\nbase.dists.gamma.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.gamma.cdf.factory( 2.0, 0.5 );\n > var y = myCDF( 6.0 )\n ~0.801\n > y = myCDF( 2.0 )\n ~0.264\n\n",
"base.dists.gamma.entropy": "\nbase.dists.gamma.entropy( α, β )\n Returns the differential entropy of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.gamma.entropy( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.entropy( 4.0, 12.0 )\n ~-0.462\n > v = base.dists.gamma.entropy( 8.0, 2.0 )\n ~1.723\n\n",
"base.dists.gamma.Gamma": "\nbase.dists.gamma.Gamma( [α, β] )\n Returns a gamma distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Rate parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n gamma: Object\n Distribution instance.\n\n gamma.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n gamma.beta: number\n Rate parameter. If set, the value must be greater than `0`.\n\n gamma.entropy: number\n Read-only property which returns the differential entropy.\n\n gamma.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n gamma.mean: number\n Read-only property which returns the expected value.\n\n gamma.mode: number\n Read-only property which returns the mode.\n\n gamma.skewness: number\n Read-only property which returns the skewness.\n\n gamma.stdev: number\n Read-only property which returns the standard deviation.\n\n gamma.variance: number\n Read-only property which returns the variance.\n\n gamma.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n gamma.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n gamma.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n gamma.pdf: Function\n Evaluates the probability density function (PDF).\n\n gamma.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var gamma = base.dists.gamma.Gamma( 6.0, 5.0 );\n > gamma.alpha\n 6.0\n > gamma.beta\n 5.0\n > gamma.entropy\n ~0.647\n > gamma.kurtosis\n 1.0\n > gamma.mean\n 1.2\n > gamma.mode\n 1.0\n > gamma.skewness\n ~0.816\n > gamma.stdev\n ~0.49\n > gamma.variance\n 0.24\n > gamma.cdf( 0.8 )\n ~0.215\n > gamma.logpdf( 1.0 )\n ~-0.131\n > gamma.mgf( -0.5 )\n ~0.564\n > gamma.pdf( 1.0 )\n ~0.877\n > gamma.quantile( 0.8 )\n ~1.581\n\n",
"base.dists.gamma.kurtosis": "\nbase.dists.gamma.kurtosis( α, β )\n Returns the excess kurtosis of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.gamma.kurtosis( 1.0, 1.0 )\n 6.0\n > v = base.dists.gamma.kurtosis( 4.0, 12.0 )\n 1.5\n > v = base.dists.gamma.kurtosis( 8.0, 2.0 )\n 0.75\n\n",
"base.dists.gamma.logpdf": "\nbase.dists.gamma.logpdf( x, α, β )\n Evaluates the logarithm of the probability density function (PDF) for a\n gamma distribution with shape parameter `α` and rate parameter `β` at a\n value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.gamma.logpdf( 2.0, 0.5, 1.0 )\n ~-2.919\n > y = base.dists.gamma.logpdf( 0.1, 1.0, 1.0 )\n ~-0.1\n > y = base.dists.gamma.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.gamma.logpdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.gamma.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.logpdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.gamma.logpdf( 2.0, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.logpdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.logpdf( 2.0, 0.0, 2.0 )\n -Infinity\n > y = base.dists.gamma.logpdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.gamma.logpdf.factory( α, β )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a gamma distribution with shape parameter `α` and rate\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.gamma.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 2.0 )\n ~-3.646\n\n",
"base.dists.gamma.mean": "\nbase.dists.gamma.mean( α, β )\n Returns the expected value of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.gamma.mean( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.mean( 4.0, 12.0 )\n ~0.333\n > v = base.dists.gamma.mean( 8.0, 2.0 )\n 4.0\n\n",
"base.dists.gamma.mgf": "\nbase.dists.gamma.mgf( t, α, β )\n Evaluates the moment-generating function (MGF) for a gamma distribution with\n shape parameter `α` and rate parameter `β` at a value `t`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.gamma.mgf( 0.5, 0.5, 1.0 )\n ~1.414\n > y = base.dists.gamma.mgf( 0.1, 1.0, 1.0 )\n ~1.111\n > y = base.dists.gamma.mgf( -1.0, 4.0, 2.0 )\n ~0.198\n\n > y = base.dists.gamma.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.gamma.mgf( 2.0, 4.0, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, -0.5, 1.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, 1.0, 0.0 )\n NaN\n > y = base.dists.gamma.mgf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.gamma.mgf.factory( α, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.gamma.mgf.factory( 3.0, 1.5 );\n > var y = myMGF( 1.0 )\n ~27.0\n > y = myMGF( 0.5 )\n ~3.375\n\n",
"base.dists.gamma.mode": "\nbase.dists.gamma.mode( α, β )\n Returns the mode of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.gamma.mode( 1.0, 1.0 )\n 0.0\n > v = base.dists.gamma.mode( 4.0, 12.0 )\n 0.25\n > v = base.dists.gamma.mode( 8.0, 2.0 )\n 3.5\n\n",
"base.dists.gamma.pdf": "\nbase.dists.gamma.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a gamma distribution\n with shape parameter `α` and rate parameter `β` at a value `x`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.gamma.pdf( 2.0, 0.5, 1.0 )\n ~0.054\n > y = base.dists.gamma.pdf( 0.1, 1.0, 1.0 )\n ~0.905\n > y = base.dists.gamma.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.gamma.pdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.gamma.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.pdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.gamma.pdf( 2.0, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.pdf( 2.0, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.pdf( 2.0, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.pdf( 0.0, 0.0, 2.0 )\n Infinity\n\n\nbase.dists.gamma.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a gamma distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.gamma.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 2.0 )\n ~0.026\n\n",
"base.dists.gamma.quantile": "\nbase.dists.gamma.quantile( p, α, β )\n Evaluates the quantile function for a gamma distribution with shape\n parameter `α` and rate parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `α < 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.gamma.quantile( 0.8, 2.0, 1.0 )\n ~2.994\n > y = base.dists.gamma.quantile( 0.5, 4.0, 2.0 )\n ~1.836\n\n > y = base.dists.gamma.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.gamma.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gamma.quantile( 0.0, 1.0, NaN )\n NaN\n\n // Non-positive shape parameter:\n > y = base.dists.gamma.quantile( 0.5, -1.0, 1.0 )\n NaN\n // Non-positive rate parameter:\n > y = base.dists.gamma.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `0.0` when `α = 0.0`:\n > y = base.dists.gamma.quantile( 0.3, 0.0, 2.0 )\n 0.0\n > y = base.dists.gamma.quantile( 0.9, 0.0, 2.0 )\n 0.0\n\n\nbase.dists.gamma.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a gamma\n distribution with shape parameter `α` and rate parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.gamma.quantile.factory( 2.0, 2.0 );\n > var y = myQuantile( 0.8 )\n ~1.497\n > y = myQuantile( 0.4 )\n ~0.688\n\n",
"base.dists.gamma.skewness": "\nbase.dists.gamma.skewness( α, β )\n Returns the skewness of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.gamma.skewness( 1.0, 1.0 )\n 2.0\n > v = base.dists.gamma.skewness( 4.0, 12.0 )\n 1.0\n > v = base.dists.gamma.skewness( 8.0, 2.0 )\n ~0.707\n\n",
"base.dists.gamma.stdev": "\nbase.dists.gamma.stdev( α, β )\n Returns the standard deviation of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.gamma.stdev( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.stdev( 4.0, 12.0 )\n ~0.167\n > v = base.dists.gamma.stdev( 8.0, 2.0 )\n ~1.414\n\n",
"base.dists.gamma.variance": "\nbase.dists.gamma.variance( α, β )\n Returns the variance of a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.gamma.variance( 1.0, 1.0 )\n 1.0\n > v = base.dists.gamma.variance( 4.0, 12.0 )\n ~0.028\n > v = base.dists.gamma.variance( 8.0, 2.0 )\n 2.0\n\n",
"base.dists.geometric.cdf": "\nbase.dists.geometric.cdf( x, p )\n Evaluates the cumulative distribution function (CDF) for a geometric\n distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.geometric.cdf( 2.0, 0.5 )\n 0.875\n > y = base.dists.geometric.cdf( 2.0, 0.1 )\n ~0.271\n > y = base.dists.geometric.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.geometric.cdf( NaN, 0.5 )\n NaN\n > y = base.dists.geometric.cdf( 0.0, NaN )\n NaN\n // Invalid probability\n > y = base.dists.geometric.cdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.geometric.cdf.factory( p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.geometric.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n 0.9375\n > y = mycdf( 1.0 )\n 0.75\n\n",
"base.dists.geometric.entropy": "\nbase.dists.geometric.entropy( p )\n Returns the entropy of a geometric distribution with success probability\n `p` (in nats).\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.geometric.entropy( 0.1 )\n ~3.251\n > v = base.dists.geometric.entropy( 0.5 )\n ~1.386\n\n",
"base.dists.geometric.Geometric": "\nbase.dists.geometric.Geometric( [p] )\n Returns a geometric distribution object.\n\n Parameters\n ----------\n p: number (optional)\n Success probability. Must be between `0` and `1`. Default: `0.5`.\n\n Returns\n -------\n geometric: Object\n Distribution instance.\n\n geometric.p: number\n Success probability. If set, the value must be between `0` and `1`.\n\n geometric.entropy: number\n Read-only property which returns the differential entropy.\n\n geometric.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n geometric.mean: number\n Read-only property which returns the expected value.\n\n geometric.median: number\n Read-only property which returns the median.\n\n geometric.mode: number\n Read-only property which returns the mode.\n\n geometric.skewness: number\n Read-only property which returns the skewness.\n\n geometric.stdev: number\n Read-only property which returns the standard deviation.\n\n geometric.variance: number\n Read-only property which returns the variance.\n\n geometric.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n geometric.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n geometric.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n geometric.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n geometric.pmf: Function\n Evaluates the probability mass function (PMF).\n\n geometric.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var geometric = base.dists.geometric.Geometric( 0.6 );\n > geometric.p\n 0.6\n > geometric.entropy\n ~1.122\n > geometric.kurtosis\n ~6.9\n > geometric.mean\n ~0.667\n > geometric.median\n 0.0\n > geometric.mode\n 0.0\n > geometric.skewness\n ~2.214\n > geometric.stdev\n ~1.054\n > geometric.variance\n ~1.111\n > geometric.cdf( 3.0 )\n ~0.974\n > geometric.logcdf( 3.0 )\n ~-0.026\n > geometric.logpmf( 4.0 )\n ~-4.176\n > geometric.mgf( 0.5 )\n ~2.905\n > geometric.pmf( 2.0 )\n ~0.096\n > geometric.quantile( 0.7 )\n 1.0\n\n",
"base.dists.geometric.kurtosis": "\nbase.dists.geometric.kurtosis( p )\n Returns the excess kurtosis of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.geometric.kurtosis( 0.1 )\n ~6.011\n > v = base.dists.geometric.kurtosis( 0.5 )\n 6.5\n\n",
"base.dists.geometric.logcdf": "\nbase.dists.geometric.logcdf( x, p )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n geometric distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.geometric.logcdf( 2.0, 0.5 )\n ~-0.134\n > y = base.dists.geometric.logcdf( 2.0, 0.1 )\n ~-1.306\n > y = base.dists.geometric.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.geometric.logcdf( NaN, 0.5 )\n NaN\n > y = base.dists.geometric.logcdf( 0.0, NaN )\n NaN\n // Invalid probability\n > y = base.dists.geometric.logcdf( 2.0, 1.4 )\n NaN\n\n\nbase.dists.geometric.logcdf.factory( p )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a geometric distribution with success\n probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.geometric.logcdf.factory( 0.5 );\n > var y = mylogcdf( 3.0 )\n ~-0.065\n > y = mylogcdf( 1.0 )\n ~-0.288\n\n",
"base.dists.geometric.logpmf": "\nbase.dists.geometric.logpmf( x, p )\n Evaluates the logarithm of the probability mass function (PMF) for a\n geometric distribution with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.geometric.logpmf( 4.0, 0.3 )\n ~-2.631\n > y = base.dists.geometric.logpmf( 2.0, 0.7 )\n ~-2.765\n > y = base.dists.geometric.logpmf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.geometric.logpmf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.logpmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.geometric.logpmf( 2.0, 1.5 )\n NaN\n\n\nbase.dists.geometric.logpmf.factory( p )\n Returns a function for evaluating the logarithm of the probability mass\n function (PMF) of a geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.geometric.logpmf.factory( 0.5 );\n > var y = mylogpmf( 3.0 )\n ~-2.773\n > y = mylogpmf( 1.0 )\n ~-1.386\n\n",
"base.dists.geometric.mean": "\nbase.dists.geometric.mean( p )\n Returns the expected value of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.geometric.mean( 0.1 )\n 9.0\n > v = base.dists.geometric.mean( 0.5 )\n 1.0\n\n",
"base.dists.geometric.median": "\nbase.dists.geometric.median( p )\n Returns the median of a geometric distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.geometric.median( 0.1 )\n 6\n > v = base.dists.geometric.median( 0.5 )\n 0\n\n",
"base.dists.geometric.mgf": "\nbase.dists.geometric.mgf( t, p )\n Evaluates the moment-generating function (MGF) for a geometric\n distribution with success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `t >= -ln(1-p)`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.geometric.mgf( 0.2, 0.5 )\n ~1.569\n > y = base.dists.geometric.mgf( 0.4, 0.5 )\n ~2.936\n // Case: t >= -ln(1-p)\n > y = base.dists.geometric.mgf( 0.8, 0.5 )\n NaN\n > y = base.dists.geometric.mgf( NaN, 0.0 )\n NaN\n > y = base.dists.geometric.mgf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.mgf( -2.0, -1.0 )\n NaN\n > y = base.dists.geometric.mgf( 0.2, 2.0 )\n NaN\n\n\nbase.dists.geometric.mgf.factory( p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.geometric.mgf.factory( 0.8 );\n > var y = mymgf( -0.2 )\n ~0.783\n\n",
"base.dists.geometric.mode": "\nbase.dists.geometric.mode( p )\n Returns the mode of a geometric distribution with success probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.geometric.mode( 0.1 )\n 0\n > v = base.dists.geometric.mode( 0.5 )\n 0\n\n",
"base.dists.geometric.pmf": "\nbase.dists.geometric.pmf( x, p )\n Evaluates the probability mass function (PMF) for a geometric distribution\n with success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.geometric.pmf( 4.0, 0.3 )\n ~0.072\n > y = base.dists.geometric.pmf( 2.0, 0.7 )\n ~0.063\n > y = base.dists.geometric.pmf( -1.0, 0.5 )\n 0.0\n > y = base.dists.geometric.pmf( 0.0, NaN )\n NaN\n > y = base.dists.geometric.pmf( NaN, 0.5 )\n NaN\n // Invalid success probability:\n > y = base.dists.geometric.pmf( 2.0, 1.5 )\n NaN\n\n\nbase.dists.geometric.pmf.factory( p )\n Returns a function for evaluating the probability mass function (PMF) of a\n geometric distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.geometric.pmf.factory( 0.5 );\n > var y = mypmf( 3.0 )\n 0.0625\n > y = mypmf( 1.0 )\n 0.25\n\n",
"base.dists.geometric.quantile": "\nbase.dists.geometric.quantile( r, p )\n Evaluates the quantile function for a geometric distribution with success\n probability `p` at a probability `r`.\n\n If `r < 0` or `r > 1`, the function returns `NaN`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Input probability.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.geometric.quantile( 0.8, 0.4 )\n 3\n > y = base.dists.geometric.quantile( 0.5, 0.4 )\n 1\n > y = base.dists.geometric.quantile( 0.9, 0.1 )\n 21\n\n > y = base.dists.geometric.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.geometric.quantile( NaN, 0.8 )\n NaN\n > y = base.dists.geometric.quantile( 0.4, NaN )\n NaN\n\n > y = base.dists.geometric.quantile( 0.5, -1.0 )\n NaN\n > y = base.dists.geometric.quantile( 0.5, 1.5 )\n NaN\n\n\nbase.dists.geometric.quantile.factory( p )\n Returns a function for evaluating the quantile function of a geometric\n distribution with success probability `p`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.geometric.quantile.factory( 0.4 );\n > var y = myquantile( 0.4 )\n 0\n > y = myquantile( 0.8 )\n 3\n > y = myquantile( 1.0 )\n Infinity\n\n",
"base.dists.geometric.skewness": "\nbase.dists.geometric.skewness( p )\n Returns the skewness of a geometric distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.geometric.skewness( 0.1 )\n ~2.003\n > v = base.dists.geometric.skewness( 0.5 )\n ~2.121\n\n",
"base.dists.geometric.stdev": "\nbase.dists.geometric.stdev( p )\n Returns the standard deviation of a geometric distribution with success\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.geometric.stdev( 0.1 )\n ~9.487\n > v = base.dists.geometric.stdev( 0.5 )\n ~1.414\n\n",
"base.dists.geometric.variance": "\nbase.dists.geometric.variance( p )\n Returns the variance of a geometric distribution with success probability\n `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.geometric.variance( 0.1 )\n ~90.0\n > v = base.dists.geometric.variance( 0.5 )\n 2.0\n\n",
"base.dists.gumbel.cdf": "\nbase.dists.gumbel.cdf( x, μ, β )\n Evaluates the cumulative distribution function (CDF) for a Gumbel\n distribution with location parameter `μ` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.cdf( 10.0, 0.0, 3.0 )\n ~0.965\n > y = base.dists.gumbel.cdf( -2.0, 0.0, 3.0 )\n ~0.143\n > y = base.dists.gumbel.cdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.gumbel.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.cdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.cdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.cdf.factory( μ, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Gumbel distribution with location parameter `μ` and scale parameter\n `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.gumbel.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.933\n > y = myCDF( 2.0 )\n ~0.368\n\n",
"base.dists.gumbel.entropy": "\nbase.dists.gumbel.entropy( μ, β )\n Returns the differential entropy of a Gumbel distribution with location\n parameter `μ` and scale parameter `β` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.gumbel.entropy( 0.0, 1.0 )\n ~1.577\n > y = base.dists.gumbel.entropy( 4.0, 2.0 )\n ~2.27\n > y = base.dists.gumbel.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.entropy( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.Gumbel": "\nbase.dists.gumbel.Gumbel( [μ, β] )\n Returns a Gumbel distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n gumbel: Object\n Distribution instance.\n\n gumbel.mu: number\n Location parameter.\n\n gumbel.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n gumbel.entropy: number\n Read-only property which returns the differential entropy.\n\n gumbel.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n gumbel.mean: number\n Read-only property which returns the expected value.\n\n gumbel.median: number\n Read-only property which returns the median.\n\n gumbel.mode: number\n Read-only property which returns the mode.\n\n gumbel.skewness: number\n Read-only property which returns the skewness.\n\n gumbel.stdev: number\n Read-only property which returns the standard deviation.\n\n gumbel.variance: number\n Read-only property which returns the variance.\n\n gumbel.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n gumbel.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n gumbel.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n gumbel.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n gumbel.pdf: Function\n Evaluates the probability density function (PDF).\n\n gumbel.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var gumbel = base.dists.gumbel.Gumbel( -2.0, 3.0 );\n > gumbel.mu\n -2.0\n > gumbel.beta\n 3.0\n > gumbel.entropy\n ~2.676\n > gumbel.kurtosis\n 2.4\n > gumbel.mean\n ~-0.268\n > gumbel.median\n ~-0.9\n > gumbel.mode\n -2.0\n > gumbel.skewness\n ~1.14\n > gumbel.stdev\n ~3.848\n > gumbel.variance\n ~14.804\n > gumbel.cdf( 0.8 )\n ~0.675\n > gumbel.logcdf( 0.8 )\n ~-0.393\n > gumbel.logpdf( 1.0 )\n ~-2.466\n > gumbel.mgf( 0.2 )\n ~1.487\n > gumbel.pdf( 1.0 )\n ~0.085\n > gumbel.quantile( 0.8 )\n ~2.5\n\n",
"base.dists.gumbel.kurtosis": "\nbase.dists.gumbel.kurtosis( μ, β )\n Returns the excess kurtosis of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.gumbel.kurtosis( 0.0, 1.0 )\n 2.4\n > y = base.dists.gumbel.kurtosis( 4.0, 2.0 )\n 2.4\n > y = base.dists.gumbel.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.logcdf": "\nbase.dists.gumbel.logcdf( x, μ, β )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Gumbel distribution with location parameter `μ` and scale parameter `β` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.logcdf( 10.0, 0.0, 3.0 )\n ~-0.036\n > y = base.dists.gumbel.logcdf( -2.0, 0.0, 3.0 )\n ~-1.948\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, 1.0 )\n ~-1.0\n > y = base.dists.gumbel.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.logcdf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.logcdf.factory( μ, β )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var myLCDF = base.dists.gumbel.logcdf.factory( 2.0, 3.0 );\n > var y = myLCDF( 10.0 )\n ~-0.069\n > y = myLCDF( 2.0 )\n ~-1.0\n\n",
"base.dists.gumbel.logpdf": "\nbase.dists.gumbel.logpdf( x, μ, β )\n Evaluates the logarithm of the probability density function (PDF) for a\n Gumbel distribution with location parameter `μ` and scale parameter `β` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.logpdf( 0.0, 0.0, 2.0 )\n ~-1.693\n > y = base.dists.gumbel.logpdf( 0.0, 0.0, 1.0 )\n ~-1\n > y = base.dists.gumbel.logpdf( 1.0, 3.0, 2.0 )\n ~-2.411\n > y = base.dists.gumbel.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.logpdf.factory( μ, β )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.gumbel.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-1.693\n > y = mylogpdf( 12.0 )\n ~-2.061\n\n",
"base.dists.gumbel.mean": "\nbase.dists.gumbel.mean( μ, β )\n Returns the expected value of a Gumbel distribution with location parameter\n `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.gumbel.mean( 0.0, 1.0 )\n ~0.577\n > y = base.dists.gumbel.mean( 4.0, 2.0 )\n ~5.154\n > y = base.dists.gumbel.mean( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mean( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.median": "\nbase.dists.gumbel.median( μ, β )\n Returns the median of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.gumbel.median( 0.0, 1.0 )\n ~0.367\n > y = base.dists.gumbel.median( 4.0, 2.0 )\n ~4.733\n > y = base.dists.gumbel.median( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.median( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.mgf": "\nbase.dists.gumbel.mgf( t, μ, β )\n Evaluates the moment-generating function (MGF) for a Gumbel distribution\n with location parameter `μ` and scale parameter `β` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.gumbel.mgf( -1.0, 0.0, 3.0 )\n 6.0\n > y = base.dists.gumbel.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.gumbel.mgf( 0.1, 0.0, 3.0 )\n ~1.298\n\n > y = base.dists.gumbel.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mgf( 0.0, 0.0, NaN )\n NaN\n\n // Case: `t >= 1/beta`\n > y = base.dists.gumbel.mgf( 0.8, 0.0, 2.0 )\n NaN\n\n // Non-positive scale parameter:\n > y = base.dists.gumbel.mgf( 0.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.mgf.factory( μ, β )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Gumbel distribution with location parameter `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.gumbel.mgf.factory( 0.0, 3.0 );\n > var y = myMGF( -1.5 )\n ~52.343\n > y = myMGF( -1.0 )\n 6.0\n\n",
"base.dists.gumbel.mode": "\nbase.dists.gumbel.mode( μ, β )\n Returns the mode of a Gumbel distribution with location parameter `μ` and\n scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.gumbel.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.gumbel.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.gumbel.mode( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.mode( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.pdf": "\nbase.dists.gumbel.pdf( x, μ, β )\n Evaluates the probability density function (PDF) for a Gumbel distribution\n with location parameter `μ` and scale parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.gumbel.pdf( 0.0, 0.0, 2.0 )\n ~0.184\n > y = base.dists.gumbel.pdf( 0.0, 0.0, 1.0 )\n ~0.368\n > y = base.dists.gumbel.pdf( 1.0, 3.0, 2.0 )\n ~0.09\n > y = base.dists.gumbel.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.gumbel.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.pdf.factory( μ, β )\n Returns a function for evaluating the probability density function (PDF)\n of a Gumbel distribution with location parameter `μ` and scale parameter\n `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.gumbel.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.184\n > y = myPDF( 12.0 )\n ~0.127\n\n",
"base.dists.gumbel.quantile": "\nbase.dists.gumbel.quantile( p, μ, β )\n Evaluates the quantile function for a Gumbel distribution with location\n parameter `μ` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.gumbel.quantile( 0.8, 0.0, 1.0 )\n ~1.5\n > y = base.dists.gumbel.quantile( 0.5, 4.0, 2.0 )\n ~4.733\n > y = base.dists.gumbel.quantile( 0.5, 4.0, 4.0 )\n ~5.466\n\n > y = base.dists.gumbel.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.gumbel.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.gumbel.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.gumbel.quantile.factory( μ, β )\n Returns a function for evaluating the quantile function of a Gumbel\n distribution with location parameter `μ` and scale parameter `β`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.gumbel.quantile.factory( 8.0, 2.0 );\n > var y = myQuantile( 0.5 )\n ~8.733\n > y = myQuantile( 0.7 )\n ~10.062\n\n",
"base.dists.gumbel.skewness": "\nbase.dists.gumbel.skewness( μ, β )\n Returns the skewness of a Gumbel distribution with location parameter `μ`\n and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.gumbel.skewness( 0.0, 1.0 )\n ~1.14\n > y = base.dists.gumbel.skewness( 4.0, 2.0 )\n ~1.14\n > y = base.dists.gumbel.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.skewness( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.stdev": "\nbase.dists.gumbel.stdev( μ, β )\n Returns the standard deviation of a Gumbel distribution with location\n parameter `μ` and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.gumbel.stdev( 0.0, 1.0 )\n ~1.283\n > y = base.dists.gumbel.stdev( 4.0, 2.0 )\n ~2.565\n > y = base.dists.gumbel.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.stdev( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.gumbel.variance": "\nbase.dists.gumbel.variance( μ, β )\n Returns the variance of a Gumbel distribution with location parameter `μ`\n and scale parameter `β`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.gumbel.variance( 0.0, 1.0 )\n ~1.645\n > y = base.dists.gumbel.variance( 4.0, 2.0 )\n ~6.58\n > y = base.dists.gumbel.variance( NaN, 1.0 )\n NaN\n > y = base.dists.gumbel.variance( 0.0, NaN )\n NaN\n > y = base.dists.gumbel.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.hypergeometric.cdf": "\nbase.dists.hypergeometric.cdf( x, N, K, n )\n Evaluates the cumulative distribution function (CDF) for a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or subpopulation size `K` exceeds population size\n `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.cdf( 1.0, 8, 4, 2 )\n ~0.786\n > y = base.dists.hypergeometric.cdf( 1.5, 8, 4, 2 )\n ~0.786\n > y = base.dists.hypergeometric.cdf( 2.0, 8, 4, 2 )\n 1.0\n > y = base.dists.hypergeometric.cdf( 0, 8, 4, 2)\n ~0.214\n\n > y = base.dists.hypergeometric.cdf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.cdf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.cdf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.cdf.factory( N, K, n )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a hypergeometric distribution with population size `N`, subpopulation\n size `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.hypergeometric.cdf.factory( 30, 20, 5 );\n > var y = myCDF( 4.0 )\n ~0.891\n > y = myCDF( 1.0 )\n ~0.031\n\n",
"base.dists.hypergeometric.Hypergeometric": "\nbase.dists.hypergeometric.Hypergeometric( [N, K, n] )\n Returns a hypergeometric distribution object.\n\n Parameters\n ----------\n N: integer (optional)\n Population size. Must be a non-negative integer larger than or equal to\n `K` and `n`.\n\n K: integer (optional)\n Subpopulation size. Must be a non-negative integer smaller than or equal\n to `N`.\n\n n: integer (optional)\n Number of draws. Must be a non-negative integer smaller than or equal to\n `N`.\n\n Returns\n -------\n hypergeometric: Object\n Distribution instance.\n\n hypergeometric.N: number\n Population size. If set, the value must be a non-negative integer larger\n than or equal to `K` and `n`.\n\n hypergeometric.K: number\n Subpopulation size. If set, the value must be a non-negative integer\n smaller than or equal to `N`.\n\n hypergeometric.n: number\n Number of draws. If set, the value must be a non-negative integer\n smaller than or equal to `N`.\n\n hypergeometric.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n hypergeometric.mean: number\n Read-only property which returns the expected value.\n\n hypergeometric.mode: number\n Read-only property which returns the mode.\n\n hypergeometric.skewness: number\n Read-only property which returns the skewness.\n\n hypergeometric.stdev: number\n Read-only property which returns the standard deviation.\n\n hypergeometric.variance: number\n Read-only property which returns the variance.\n\n hypergeometric.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n hypergeometric.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n hypergeometric.pmf: Function\n Evaluates the probability mass function (PMF).\n\n hypergeometric.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var hypergeometric = base.dists.hypergeometric.Hypergeometric( 100, 70, 20 );\n > hypergeometric.N\n 100.0\n > hypergeometric.K\n 70.0\n > hypergeometric.n\n 20.0\n > hypergeometric.kurtosis\n ~-0.063\n > hypergeometric.mean\n 14.0\n > hypergeometric.mode\n 14.0\n > hypergeometric.skewness\n ~-0.133\n > hypergeometric.stdev\n ~1.842\n > hypergeometric.variance\n ~3.394\n > hypergeometric.cdf( 2.9 )\n ~0.0\n > hypergeometric.logpmf( 10 )\n ~-3.806\n > hypergeometric.pmf( 10 )\n ~0.022\n > hypergeometric.quantile( 0.8 )\n 16.0\n\n",
"base.dists.hypergeometric.kurtosis": "\nbase.dists.hypergeometric.kurtosis( N, K, n )\n Returns the excess kurtosis of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or subpopulation size `K` exceed population size\n `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.kurtosis( 16, 11, 4 )\n ~-0.326\n > v = base.dists.hypergeometric.kurtosis( 4, 2, 2 )\n 0.0\n\n > v = base.dists.hypergeometric.kurtosis( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.kurtosis( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.kurtosis( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.logpmf": "\nbase.dists.hypergeometric.logpmf( x, N, K, n )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n hypergeometric distribution with population size `N`, subpopulation size\n `K`, and number of draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K`, or draws `n`\n which is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.logpmf( 1.0, 8, 4, 2 )\n ~-0.56\n > y = base.dists.hypergeometric.logpmf( 2.0, 8, 4, 2 )\n ~-1.54\n > y = base.dists.hypergeometric.logpmf( 0.0, 8, 4, 2 )\n ~-1.54\n > y = base.dists.hypergeometric.logpmf( 1.5, 8, 4, 2 )\n -Infinity\n\n > y = base.dists.hypergeometric.logpmf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.logpmf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 5, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.logpmf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.logpmf.factory( N, K, n )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a hypergeometric distribution with population size\n `N`, subpopulation size `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.hypergeometric.logpmf.factory( 30, 20, 5 );\n > var y = mylogPMF( 4.0 )\n ~-1.079\n > y = mylogPMF( 1.0 )\n ~-3.524\n\n",
"base.dists.hypergeometric.mean": "\nbase.dists.hypergeometric.mean( N, K, n )\n Returns the expected value of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.mean( 16, 11, 4 )\n 2.75\n > v = base.dists.hypergeometric.mean( 2, 1, 1 )\n 0.5\n\n > v = base.dists.hypergeometric.mean( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.mean( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.mean( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.mean( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.mode": "\nbase.dists.hypergeometric.mode( N, K, n )\n Returns the mode of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.mode( 16, 11, 4 )\n 3\n > v = base.dists.hypergeometric.mode( 2, 1, 1 )\n 1\n\n > v = base.dists.hypergeometric.mode( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.mode( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.mode( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.mode( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.pmf": "\nbase.dists.hypergeometric.pmf( x, N, K, n )\n Evaluates the probability mass function (PMF) for a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.pmf( 1.0, 8, 4, 2 )\n ~0.571\n > y = base.dists.hypergeometric.pmf( 2.0, 8, 4, 2 )\n ~0.214\n > y = base.dists.hypergeometric.pmf( 0.0, 8, 4, 2 )\n ~0.214\n > y = base.dists.hypergeometric.pmf( 1.5, 8, 4, 2 )\n 0.0\n\n > y = base.dists.hypergeometric.pmf( NaN, 10, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, NaN, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, 10, NaN, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 0.0, 10, 5, NaN )\n NaN\n\n > y = base.dists.hypergeometric.pmf( 2.0, 10.5, 5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 5, 1.5, 2 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 10, 5, -2.0 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 10, 5, 12 )\n NaN\n > y = base.dists.hypergeometric.pmf( 2.0, 8, 3, 9 )\n NaN\n\n\nbase.dists.hypergeometric.pmf.factory( N, K, n )\n Returns a function for evaluating the probability mass function (PMF) of a\n hypergeometric distribution with population size `N`, subpopulation size\n `K`, and number of draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.hypergeometric.pmf.factory( 30, 20, 5 );\n > var y = myPMF( 4.0 )\n ~0.34\n > y = myPMF( 1.0 )\n ~0.029\n\n",
"base.dists.hypergeometric.quantile": "\nbase.dists.hypergeometric.quantile( p, N, K, n )\n Evaluates the quantile function for a hypergeometric distribution with\n population size `N`, subpopulation size `K`, and number of draws `n` at a\n probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.hypergeometric.quantile( 0.4, 40, 20, 10 )\n 5\n > y = base.dists.hypergeometric.quantile( 0.8, 60, 40, 20 )\n 15\n > y = base.dists.hypergeometric.quantile( 0.5, 100, 10, 10 )\n 1\n > y = base.dists.hypergeometric.quantile( 0.0, 100, 40, 20 )\n 0\n > y = base.dists.hypergeometric.quantile( 1.0, 100, 40, 20 )\n 20\n\n > y = base.dists.hypergeometric.quantile( NaN, 40, 20, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, NaN, 20, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, 40, NaN, 10 )\n NaN\n > y = base.dists.hypergeometric.quantile( 0.2, 40, 20, NaN )\n NaN\n\n\nbase.dists.hypergeometric.quantile.factory( N, K, n )\n Returns a function for evaluating the quantile function of a hypergeometric\n distribution with population size `N`, subpopulation size `K`, and number of\n draws `n`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.hypergeometric.quantile.factory( 100, 20, 10 );\n > var y = myQuantile( 0.2 )\n 1\n > y = myQuantile( 0.9 )\n 4\n\n",
"base.dists.hypergeometric.skewness": "\nbase.dists.hypergeometric.skewness( N, K, n )\n Returns the skewness of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.skewness( 16, 11, 4 )\n ~-0.258\n > v = base.dists.hypergeometric.skewness( 4, 2, 2 )\n 0.0\n\n > v = base.dists.hypergeometric.skewness( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.skewness( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.skewness( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.stdev": "\nbase.dists.hypergeometric.stdev( N, K, n )\n Returns the standard deviation of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.stdev( 16, 11, 4 )\n ~0.829\n > v = base.dists.hypergeometric.stdev( 2, 1, 1 )\n 0.5\n\n > v = base.dists.hypergeometric.stdev( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.stdev( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.stdev( 20, 10, NaN )\n NaN\n\n",
"base.dists.hypergeometric.variance": "\nbase.dists.hypergeometric.variance( N, K, n )\n Returns the variance of a hypergeometric distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a population size `N`, subpopulation size `K` or draws `n` which\n is not a nonnegative integer, the function returns `NaN`.\n\n If the number of draws `n` or the subpopulation size `K` exceed population\n size `N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.hypergeometric.variance( 16, 11, 4 )\n ~0.688\n > v = base.dists.hypergeometric.variance( 2, 1, 1 )\n 0.25\n\n > v = base.dists.hypergeometric.variance( 10, 5, 12 )\n NaN\n > v = base.dists.hypergeometric.variance( 10.3, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 10, 5.5, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 10, 5, 4.5 )\n NaN\n\n > v = base.dists.hypergeometric.variance( NaN, 10, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 20, NaN, 4 )\n NaN\n > v = base.dists.hypergeometric.variance( 20, 10, NaN )\n NaN\n\n",
"base.dists.invgamma.cdf": "\nbase.dists.invgamma.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for an inverse gamma\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.cdf( 2.0, 1.0, 1.0 )\n ~0.607\n > y = base.dists.invgamma.cdf( 2.0, 3.0, 1.0 )\n ~0.986\n > y = base.dists.invgamma.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.invgamma.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.invgamma.cdf( NINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.invgamma.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.invgamma.cdf( 2.0, -1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.cdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of an inverse gamma distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.invgamma.cdf.factory( 2.0, 0.5 );\n > var y = myCDF( 0.5 )\n ~0.736\n > y = myCDF( 2.0 )\n ~0.974\n\n",
"base.dists.invgamma.entropy": "\nbase.dists.invgamma.entropy( α, β )\n Returns the differential entropy of an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.invgamma.entropy( 1.0, 1.0 )\n ~2.154\n > v = base.dists.invgamma.entropy( 4.0, 12.0 )\n ~1.996\n > v = base.dists.invgamma.entropy( 8.0, 2.0 )\n ~-0.922\n\n",
"base.dists.invgamma.InvGamma": "\nbase.dists.invgamma.InvGamma( [α, β] )\n Returns an inverse gamma distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n invgamma: Object\n Distribution instance.\n\n invgamma.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n invgamma.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n invgamma.entropy: number\n Read-only property which returns the differential entropy.\n\n invgamma.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n invgamma.mean: number\n Read-only property which returns the expected value.\n\n invgamma.mode: number\n Read-only property which returns the mode.\n\n invgamma.skewness: number\n Read-only property which returns the skewness.\n\n invgamma.stdev: number\n Read-only property which returns the standard deviation.\n\n invgamma.variance: number\n Read-only property which returns the variance.\n\n invgamma.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n invgamma.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n invgamma.pdf: Function\n Evaluates the probability density function (PDF).\n\n invgamma.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var invgamma = base.dists.invgamma.InvGamma( 6.0, 5.0 );\n > invgamma.alpha\n 6.0\n > invgamma.beta\n 5.0\n > invgamma.entropy\n ~0.454\n > invgamma.kurtosis\n 19.0\n > invgamma.mean\n 1.0\n > invgamma.mode\n ~0.714\n > invgamma.skewness\n ~2.667\n > invgamma.stdev\n 0.5\n > invgamma.variance\n 0.25\n > invgamma.cdf( 0.8 )\n ~0.406\n > invgamma.pdf( 1.0 )\n ~0.877\n > invgamma.logpdf( 1.0 )\n ~-0.131\n > invgamma.quantile( 0.8 )\n ~1.281\n\n",
"base.dists.invgamma.kurtosis": "\nbase.dists.invgamma.kurtosis( α, β )\n Returns the excess kurtosis of an inverse gamma distribution.\n\n If `α <= 4` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.invgamma.kurtosis( 7.0, 5.0 )\n 12.0\n > v = base.dists.invgamma.kurtosis( 6.0, 12.0 )\n 19.0\n > v = base.dists.invgamma.kurtosis( 8.0, 2.0 )\n ~8.7\n\n",
"base.dists.invgamma.logpdf": "\nbase.dists.invgamma.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for an inverse gamma distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.logpdf( 2.0, 0.5, 1.0 )\n ~-2.112\n > y = base.dists.invgamma.logpdf( 0.2, 1.0, 1.0 )\n ~-1.781\n > y = base.dists.invgamma.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.invgamma.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.logpdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.invgamma.logpdf( 2.0, -1.0, 1.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.invgamma.logpdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) for an inverse gamma distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.invgamma.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 2.0 )\n ~-1.464\n\n",
"base.dists.invgamma.mean": "\nbase.dists.invgamma.mean( α, β )\n Returns the expected value of an inverse gamma distribution.\n\n If `α <= 1` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.invgamma.mean( 4.0, 12.0 )\n 4.0\n > v = base.dists.invgamma.mean( 8.0, 2.0 )\n ~0.286\n\n",
"base.dists.invgamma.mode": "\nbase.dists.invgamma.mode( α, β )\n Returns the mode of an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.invgamma.mode( 1.0, 1.0 )\n 0.5\n > v = base.dists.invgamma.mode( 4.0, 12.0 )\n 2.4\n > v = base.dists.invgamma.mode( 8.0, 2.0 )\n ~0.222\n\n",
"base.dists.invgamma.pdf": "\nbase.dists.invgamma.pdf( x, α, β )\n Evaluates the probability density function (PDF) for an inverse gamma\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.invgamma.pdf( 2.0, 0.5, 1.0 )\n ~0.121\n > y = base.dists.invgamma.pdf( 0.2, 1.0, 1.0 )\n ~0.168\n > y = base.dists.invgamma.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.invgamma.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.pdf( 0.0, 1.0, NaN )\n NaN\n\n // Negative shape parameter:\n > y = base.dists.invgamma.pdf( 2.0, -1.0, 1.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.invgamma.pdf( 2.0, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF)\n of an inverse gamma distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.invgamma.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 2.0 )\n ~0.231\n\n",
"base.dists.invgamma.quantile": "\nbase.dists.invgamma.quantile( p, α, β )\n Evaluates the quantile function for an inverse gamma distribution with shape\n parameter `α` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.invgamma.quantile( 0.8, 2.0, 1.0 )\n ~1.213\n > y = base.dists.invgamma.quantile( 0.5, 4.0, 2.0 )\n ~0.545\n > y = base.dists.invgamma.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.invgamma.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.invgamma.quantile( 0.0, 1.0, NaN )\n NaN\n\n // Non-positive shape parameter:\n > y = base.dists.invgamma.quantile( 0.5, -1.0, 1.0 )\n NaN\n\n // Non-positive rate parameter:\n > y = base.dists.invgamma.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.invgamma.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of an inverse gamma\n distribution with shape parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.invgamma.quantile.factory( 2.0, 2.0 );\n > var y = myQuantile( 0.8 )\n ~2.426\n > y = myQuantile( 0.4 )\n ~0.989\n\n",
"base.dists.invgamma.skewness": "\nbase.dists.invgamma.skewness( α, β )\n Returns the skewness of an inverse gamma distribution.\n\n If `α <= 3` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.invgamma.skewness( 4.0, 12.0 )\n ~5.657\n > v = base.dists.invgamma.skewness( 8.0, 2.0 )\n ~1.96\n\n",
"base.dists.invgamma.stdev": "\nbase.dists.invgamma.stdev( α, β )\n Returns the standard deviation of an inverse gamma distribution.\n\n If `α <= 2` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.invgamma.stdev( 5.0, 7.0 )\n ~1.01\n > v = base.dists.invgamma.stdev( 4.0, 12.0 )\n ~2.828\n > v = base.dists.invgamma.stdev( 8.0, 2.0 )\n ~0.117\n\n",
"base.dists.invgamma.variance": "\nbase.dists.invgamma.variance( α, β )\n Returns the variance of an inverse gamma distribution.\n\n If `α <= 2` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.invgamma.variance( 5.0, 7.0 )\n ~1.021\n > v = base.dists.invgamma.variance( 4.0, 12.0 )\n 8.0\n > v = base.dists.invgamma.variance( 8.0, 2.0 )\n ~0.014\n\n",
"base.dists.kumaraswamy.cdf": "\nbase.dists.kumaraswamy.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for Kumaraswamy's\n double bounded distribution with first shape parameter `a` and second shape\n parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.cdf( 0.5, 1.0, 1.0 )\n ~0.5\n > y = base.dists.kumaraswamy.cdf( 0.5, 2.0, 4.0 )\n ~0.684\n > y = base.dists.kumaraswamy.cdf( 0.2, 2.0, 2.0 )\n ~0.078\n > y = base.dists.kumaraswamy.cdf( 0.8, 4.0, 4.0 )\n ~0.878\n > y = base.dists.kumaraswamy.cdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.kumaraswamy.cdf( 1.5, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.kumaraswamy.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Kumaraswamy's double bounded distribution with first shape parameter\n `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.kumaraswamy.cdf.factory( 0.5, 1.0 );\n > var y = mycdf( 0.8 )\n ~0.894\n > y = mycdf( 0.3 )\n ~0.548\n\n",
"base.dists.kumaraswamy.Kumaraswamy": "\nbase.dists.kumaraswamy.Kumaraswamy( [a, b] )\n Returns a Kumaraswamy's double bounded distribution object.\n\n Parameters\n ----------\n a: number (optional)\n First shape parameter. Must be greater than `0`. Default: `1.0`.\n\n b: number (optional)\n Second shape parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n kumaraswamy: Object\n Distribution instance.\n\n kumaraswamy.a: number\n First shape parameter. If set, the value must be greater than `0`.\n\n kumaraswamy.b: number\n Second shape parameter. If set, the value must be greater than `0`.\n\n kumaraswamy.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n kumaraswamy.mean: number\n Read-only property which returns the expected value.\n\n kumaraswamy.mode: number\n Read-only property which returns the mode.\n\n kumaraswamy.skewness: number\n Read-only property which returns the skewness.\n\n kumaraswamy.stdev: number\n Read-only property which returns the standard deviation.\n\n kumaraswamy.variance: number\n Read-only property which returns the variance.\n\n kumaraswamy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n kumaraswamy.pdf: Function\n Evaluates the probability density function (PDF).\n\n kumaraswamy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var kumaraswamy = base.dists.kumaraswamy.Kumaraswamy( 6.0, 5.0 );\n > kumaraswamy.a\n 6.0\n > kumaraswamy.b\n 5.0\n > kumaraswamy.kurtosis\n ~3.194\n > kumaraswamy.mean\n ~0.696\n > kumaraswamy.mode\n ~0.746\n > kumaraswamy.skewness\n ~-0.605\n > kumaraswamy.stdev\n ~0.126\n > kumaraswamy.variance\n ~0.016\n > kumaraswamy.cdf( 0.8 )\n ~0.781\n > kumaraswamy.pdf( 1.0 )\n ~0.0\n > kumaraswamy.quantile( 0.8 )\n ~0.807\n\n",
"base.dists.kumaraswamy.kurtosis": "\nbase.dists.kumaraswamy.kurtosis( a, b )\n Returns the excess kurtosis of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.kurtosis( 1.0, 1.0 )\n ~1.8\n > v = base.dists.kumaraswamy.kurtosis( 4.0, 12.0 )\n ~2.704\n > v = base.dists.kumaraswamy.kurtosis( 16.0, 8.0 )\n ~4.311\n\n",
"base.dists.kumaraswamy.logcdf": "\nbase.dists.kumaraswamy.logcdf( x, a, b )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for Kumaraswamy's double bounded distribution with first shape\n parameter `a` and second shape parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.logcdf( 0.5, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.kumaraswamy.logcdf( 0.5, 2.0, 4.0 )\n ~-0.38\n > y = base.dists.kumaraswamy.logcdf( 0.2, 2.0, 2.0 )\n ~-2.546\n > y = base.dists.kumaraswamy.logcdf( 0.8, 4.0, 4.0 )\n ~-0.13\n > y = base.dists.kumaraswamy.logcdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.kumaraswamy.logcdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.kumaraswamy.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.logcdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Kumaraswamy's double bounded distribution\n with first shape parameter `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.kumaraswamy.logcdf.factory( 0.5, 1.0 );\n > var y = mylogcdf( 0.8 )\n ~-0.112\n > y = mylogcdf( 0.3 )\n ~-0.602\n\n",
"base.dists.kumaraswamy.logpdf": "\nbase.dists.kumaraswamy.logpdf( x, a, b )\n Evaluates the natural logarithm of the probability density function (PDF)\n for Kumaraswamy's double bounded distribution with first shape parameter `a`\n and second shape parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.logpdf( 0.5, 1.0, 1.0 )\n 0.0\n > y = base.dists.kumaraswamy.logpdf( 0.5, 2.0, 4.0 )\n ~0.523\n > y = base.dists.kumaraswamy.logpdf( 0.2, 2.0, 2.0 )\n ~-0.264\n > y = base.dists.kumaraswamy.logpdf( 0.8, 4.0, 4.0 )\n ~0.522\n > y = base.dists.kumaraswamy.logpdf( -0.5, 4.0, 2.0 )\n -Infinity\n > y = base.dists.kumaraswamy.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.kumaraswamy.logpdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.logpdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.logpdf.factory( a, b )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a Kumaraswamy's double bounded distribution with\n first shape parameter `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.kumaraswamy.logpdf.factory( 0.5, 1.0 );\n > var y = mylogpdf( 0.8 )\n ~-0.582\n > y = mylogpdf( 0.3 )\n ~-0.091\n\n",
"base.dists.kumaraswamy.mean": "\nbase.dists.kumaraswamy.mean( a, b )\n Returns the mean of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mean.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.mean( 1.5, 1.5 )\n ~0.512\n > v = base.dists.kumaraswamy.mean( 4.0, 12.0 )\n ~0.481\n > v = base.dists.kumaraswamy.mean( 16.0, 8.0 )\n ~0.846\n\n",
"base.dists.kumaraswamy.median": "\nbase.dists.kumaraswamy.median( a, b )\n Returns the median of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.median( 1.0, 1.0 )\n 0.5\n > v = base.dists.kumaraswamy.median( 4.0, 12.0 )\n ~0.487\n > v = base.dists.kumaraswamy.median( 16.0, 8.0 )\n ~0.856\n\n",
"base.dists.kumaraswamy.mode": "\nbase.dists.kumaraswamy.mode( a, b )\n Returns the mode of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a < 1`, `b < 1`, or `a = b = 1`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.mode( 1.5, 1.5 )\n ~0.543\n > v = base.dists.kumaraswamy.mode( 4.0, 12.0 )\n ~0.503\n > v = base.dists.kumaraswamy.mode( 16.0, 8.0 )\n ~0.875\n\n",
"base.dists.kumaraswamy.pdf": "\nbase.dists.kumaraswamy.pdf( x, a, b )\n Evaluates the probability density function (PDF) for Kumaraswamy's double\n bounded distribution with first shape parameter `a` and second shape\n parameter `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.pdf( 0.5, 1.0, 1.0 )\n 1.0\n > y = base.dists.kumaraswamy.pdf( 0.5, 2.0, 4.0 )\n ~1.688\n > y = base.dists.kumaraswamy.pdf( 0.2, 2.0, 2.0 )\n ~0.768\n > y = base.dists.kumaraswamy.pdf( 0.8, 4.0, 4.0 )\n ~1.686\n > y = base.dists.kumaraswamy.pdf( -0.5, 4.0, 2.0 )\n 0.0\n > y = base.dists.kumaraswamy.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.kumaraswamy.pdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.pdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF)\n of a Kumaraswamy's double bounded distribution with first shape parameter\n `a` and second shape parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.kumaraswamy.pdf.factory( 0.5, 1.0 );\n > var y = mypdf( 0.8 )\n ~0.559\n > y = mypdf( 0.3 )\n ~0.913\n\n",
"base.dists.kumaraswamy.quantile": "\nbase.dists.kumaraswamy.quantile( p, a, b )\n Evaluates the quantile function for a Kumaraswamy's double bounded\n distribution with first shape parameter `a` and second shape parameter `b`\n at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.kumaraswamy.quantile( 0.5, 1.0, 1.0 )\n 0.5\n > y = base.dists.kumaraswamy.quantile( 0.5, 2.0, 4.0 )\n ~0.399\n > y = base.dists.kumaraswamy.quantile( 0.2, 2.0, 2.0 )\n ~0.325\n > y = base.dists.kumaraswamy.quantile( 0.8, 4.0, 4.0 )\n ~0.759\n\n > y = base.dists.kumaraswamy.quantile( -0.5, 4.0, 2.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 1.5, 4.0, 2.0 )\n NaN\n\n > y = base.dists.kumaraswamy.quantile( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.kumaraswamy.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.kumaraswamy.quantile( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.kumaraswamy.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a Kumaraswamy's\n double bounded distribution with first shape parameter `a` and second shape\n parameter `b`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.kumaraswamy.quantile.factory( 0.5, 1.0 );\n > var y = myQuantile( 0.8 )\n ~0.64\n > y = myQuantile( 0.3 )\n ~0.09\n\n",
"base.dists.kumaraswamy.skewness": "\nbase.dists.kumaraswamy.skewness( a, b )\n Returns the skewness of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.skewness( 1.0, 1.0 )\n ~1.154e-15\n > v = base.dists.kumaraswamy.skewness( 4.0, 12.0 )\n ~-0.201\n > v = base.dists.kumaraswamy.skewness( 16.0, 8.0 )\n ~-0.94\n\n",
"base.dists.kumaraswamy.stdev": "\nbase.dists.kumaraswamy.stdev( a, b )\n Returns the standard deviation of a Kumaraswamy's double bounded\n distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.stdev( 1.0, 1.0 )\n ~0.289\n > v = base.dists.kumaraswamy.stdev( 4.0, 12.0 )\n ~0.13\n > v = base.dists.kumaraswamy.stdev( 16.0, 8.0 )\n ~0.062\n\n",
"base.dists.kumaraswamy.variance": "\nbase.dists.kumaraswamy.variance( a, b )\n Returns the variance of a Kumaraswamy's double bounded distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.kumaraswamy.variance( 1.0, 1.0 )\n ~0.083\n > v = base.dists.kumaraswamy.variance( 4.0, 12.0 )\n ~0.017\n > v = base.dists.kumaraswamy.variance( 16.0, 8.0 )\n ~0.004\n\n",
"base.dists.laplace.cdf": "\nbase.dists.laplace.cdf( x, μ, b )\n Evaluates the cumulative distribution function (CDF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.laplace.cdf( 2.0, 0.0, 1.0 )\n ~0.932\n > y = base.dists.laplace.cdf( 5.0, 10.0, 3.0 )\n ~0.094\n > y = base.dists.laplace.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.cdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.cdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.cdf.factory( μ, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.laplace.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.965\n > y = myCDF( 2.0 )\n 0.5\n\n",
"base.dists.laplace.entropy": "\nbase.dists.laplace.entropy( μ, b )\n Returns the differential entropy of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var y = base.dists.laplace.entropy( 0.0, 1.0 )\n ~1.693\n > y = base.dists.laplace.entropy( 4.0, 2.0 )\n ~2.386\n > y = base.dists.laplace.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.entropy( 0.0, NaN )\n NaN\n > y = base.dists.laplace.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.kurtosis": "\nbase.dists.laplace.kurtosis( μ, b )\n Returns the excess kurtosis of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.laplace.kurtosis( 0.0, 1.0 )\n 3.0\n > y = base.dists.laplace.kurtosis( 4.0, 2.0 )\n 3.0\n > y = base.dists.laplace.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.laplace.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.Laplace": "\nbase.dists.laplace.Laplace( [μ, b] )\n Returns a Laplace distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n b: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n laplace: Object\n Distribution instance.\n\n laplace.mu: number\n Location parameter.\n\n laplace.b: number\n Scale parameter. If set, the value must be greater than `0`.\n\n laplace.entropy: number\n Read-only property which returns the differential entropy.\n\n laplace.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n laplace.mean: number\n Read-only property which returns the expected value.\n\n laplace.median: number\n Read-only property which returns the median.\n\n laplace.mode: number\n Read-only property which returns the mode.\n\n laplace.skewness: number\n Read-only property which returns the skewness.\n\n laplace.stdev: number\n Read-only property which returns the standard deviation.\n\n laplace.variance: number\n Read-only property which returns the variance.\n\n laplace.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n laplace.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n laplace.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n laplace.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n laplace.pdf: Function\n Evaluates the probability density function (PDF).\n\n laplace.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var laplace = base.dists.laplace.Laplace( -2.0, 3.0 );\n > laplace.mu\n -2.0\n > laplace.b\n 3.0\n > laplace.entropy\n ~2.792\n > laplace.kurtosis\n 3.0\n > laplace.mean\n -2.0\n > laplace.median\n -2.0\n > laplace.mode\n -2.0\n > laplace.skewness\n 0.0\n > laplace.stdev\n ~4.243\n > laplace.variance\n 18.0\n > laplace.cdf( 0.8 )\n ~0.803\n > laplace.logcdf( 0.8 )\n ~-0.219\n > laplace.logpdf( 1.0 )\n ~-2.792\n > laplace.mgf( 0.2 )\n ~1.047\n > laplace.pdf( 2.0 )\n ~0.044\n > laplace.quantile( 0.9 )\n ~2.828\n\n",
"base.dists.laplace.logcdf": "\nbase.dists.laplace.logcdf( x, μ, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Laplace distribution with scale parameter `b` and location parameter `μ` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.laplace.logcdf( 2.0, 0.0, 1.0 )\n ~-0.07\n > y = base.dists.laplace.logcdf( 5.0, 10.0, 3.0 )\n ~-2.36\n > y = base.dists.laplace.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.logcdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.logcdf.factory( μ, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Laplace distribution with scale parameter\n `b` and location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.laplace.logcdf.factory( 2.0, 3.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.035\n > y = mylogcdf( 2.0 )\n ~-0.693\n\n",
"base.dists.laplace.logpdf": "\nbase.dists.laplace.logpdf( x, μ, b )\n Evaluates the logarithm of the probability density function (PDF) for a\n Laplace distribution with scale parameter `b` and location parameter `μ` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.laplace.logpdf( 2.0, 0.0, 1.0 )\n ~-2.693\n > y = base.dists.laplace.logpdf( -1.0, 2.0, 3.0 )\n ~-2.792\n > y = base.dists.laplace.logpdf( 2.5, 2.0, 3.0 )\n ~-1.958\n > y = base.dists.laplace.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.logpdf.factory( μ, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Laplace distribution with scale parameter `b` and\n location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.laplace.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-1.386\n\n",
"base.dists.laplace.mean": "\nbase.dists.laplace.mean( μ, b )\n Returns the expected value of a Laplace distribution with location parameter\n `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.laplace.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.mean( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mean( 0.0, NaN )\n NaN\n > y = base.dists.laplace.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.median": "\nbase.dists.laplace.median( μ, b )\n Returns the median of a Laplace distribution with location parameter `μ` and\n scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.laplace.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.median( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.median( 0.0, NaN )\n NaN\n > y = base.dists.laplace.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.mgf": "\nbase.dists.laplace.mgf( t, μ, b )\n Evaluates the moment-generating function (MGF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.laplace.mgf( 0.5, 0.0, 1.0 )\n ~1.333\n > y = base.dists.laplace.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.laplace.mgf( -1.0, 4.0, 0.2 )\n ~0.019\n > y = base.dists.laplace.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mgf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.laplace.mgf( 1.0, 0.0, 2.0 )\n NaN\n > y = base.dists.laplace.mgf( -0.5, 0.0, 4.0 )\n NaN\n > y = base.dists.laplace.mgf( 2.0, 0.0, 0.0 )\n NaN\n > y = base.dists.laplace.mgf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.mgf.factory( μ, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.laplace.mgf.factory( 4.0, 2.0 );\n > var y = mymgf( 0.2 )\n ~2.649\n > y = mymgf( 0.4 )\n ~13.758\n\n",
"base.dists.laplace.mode": "\nbase.dists.laplace.mode( μ, b )\n Returns the mode of a Laplace distribution with location parameter `μ` and\n scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.laplace.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.laplace.mode( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.mode( 0.0, NaN )\n NaN\n > y = base.dists.laplace.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.pdf": "\nbase.dists.laplace.pdf( x, μ, b )\n Evaluates the probability density function (PDF) for a Laplace\n distribution with scale parameter `b` and location parameter `μ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.laplace.pdf( 2.0, 0.0, 1.0 )\n ~0.068\n > y = base.dists.laplace.pdf( -1.0, 2.0, 3.0 )\n ~0.061\n > y = base.dists.laplace.pdf( 2.5, 2.0, 3.0 )\n ~0.141\n > y = base.dists.laplace.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.laplace.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.pdf.factory( μ, b )\n Returns a function for evaluating the probability density function (PDF)\n of a Laplace distribution with scale parameter `b` and location parameter\n `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.laplace.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n 0.25\n\n",
"base.dists.laplace.quantile": "\nbase.dists.laplace.quantile( p, μ, b )\n Evaluates the quantile function for a Laplace distribution with scale\n parameter `b` and location parameter `μ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.laplace.quantile( 0.8, 0.0, 1.0 )\n ~0.916\n > y = base.dists.laplace.quantile( 0.5, 4.0, 2.0 )\n 4.0\n\n > y = base.dists.laplace.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.laplace.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.laplace.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.laplace.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.laplace.quantile.factory( μ, b )\n Returns a function for evaluating the quantile function of a Laplace\n distribution with scale parameter `b` and location parameter `μ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.laplace.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n > y = myQuantile( 0.8 )\n ~11.833\n\n",
"base.dists.laplace.skewness": "\nbase.dists.laplace.skewness( μ, b )\n Returns the skewness of a Laplace distribution with location parameter `μ`\n and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.laplace.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.laplace.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.laplace.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.skewness( 0.0, NaN )\n NaN\n > y = base.dists.laplace.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.stdev": "\nbase.dists.laplace.stdev( μ, b )\n Returns the standard deviation of a Laplace distribution with location\n parameter `μ` and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.laplace.stdev( 0.0, 1.0 )\n ~1.414\n > y = base.dists.laplace.stdev( 4.0, 2.0 )\n ~2.828\n > y = base.dists.laplace.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.stdev( 0.0, NaN )\n NaN\n > y = base.dists.laplace.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.laplace.variance": "\nbase.dists.laplace.variance( μ, b )\n Returns the variance of a Laplace distribution with location parameter `μ`\n and scale parameter `b`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.laplace.variance( 0.0, 1.0 )\n 2.0\n > y = base.dists.laplace.variance( 4.0, 2.0 )\n 8.0\n > y = base.dists.laplace.variance( NaN, 1.0 )\n NaN\n > y = base.dists.laplace.variance( 0.0, NaN )\n NaN\n > y = base.dists.laplace.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.cdf": "\nbase.dists.levy.cdf( x, μ, c )\n Evaluates the cumulative distribution function (CDF) for a Lévy distribution\n with location parameter `μ` and scale parameter `c` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.levy.cdf( 2.0, 0.0, 1.0 )\n ~0.48\n > y = base.dists.levy.cdf( 12.0, 10.0, 3.0 )\n ~0.221\n > y = base.dists.levy.cdf( 9.0, 10.0, 3.0 )\n 0.0\n > y = base.dists.levy.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.cdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.levy.cdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.cdf.factory( μ, c )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Lévy distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.levy.cdf.factory( 2.0, 3.0 );\n > var y = myCDF( 10.0 )\n ~0.54\n > y = myCDF( 2.0 )\n 0.0\n\n",
"base.dists.levy.entropy": "\nbase.dists.levy.entropy( μ, c )\n Returns the entropy of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.levy.entropy( 0.0, 1.0 )\n ~3.324\n > y = base.dists.levy.entropy( 4.0, 2.0 )\n ~4.018\n > y = base.dists.levy.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.levy.entropy( 0.0, NaN )\n NaN\n > y = base.dists.levy.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.Levy": "\nbase.dists.levy.Levy( [μ, c] )\n Returns a Lévy distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n c: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n levy: Object\n Distribution instance.\n\n levy.mu: number\n Location parameter.\n\n levy.c: number\n Scale parameter. If set, the value must be greater than `0`.\n\n levy.entropy: number\n Read-only property which returns the differential entropy.\n\n levy.mean: number\n Read-only property which returns the expected value.\n\n levy.median: number\n Read-only property which returns the median.\n\n levy.mode: number\n Read-only property which returns the mode.\n\n levy.stdev: number\n Read-only property which returns the standard deviation.\n\n levy.variance: number\n Read-only property which returns the variance.\n\n levy.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n levy.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n levy.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n levy.pdf: Function\n Evaluates the probability density function (PDF).\n\n levy.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var levy = base.dists.levy.Levy( -2.0, 3.0 );\n > levy.mu\n -2.0\n > levy.c\n 3.0\n > levy.entropy\n ~4.423\n > levy.mean\n Infinity\n > levy.median\n ~4.594\n > levy.mode\n -1.0\n > levy.stdev\n Infinity\n > levy.variance\n Infinity\n > levy.cdf( 0.8 )\n ~0.3\n > levy.logcdf( 0.8 )\n ~-1.2\n > levy.logpdf( 1.0 )\n ~-2.518\n > levy.pdf( 1.0 )\n ~0.081\n > levy.quantile( 0.8 )\n ~44.74\n\n",
"base.dists.levy.logcdf": "\nbase.dists.levy.logcdf( x, μ, c )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Lévy distribution with location parameter `μ` and scale parameter `c` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.levy.logcdf( 2.0, 0.0, 1.0 )\n ~-0.735\n > y = base.dists.levy.logcdf( 12.0, 10.0, 3.0 )\n ~-1.51\n > y = base.dists.levy.logcdf( 9.0, 10.0, 3.0 )\n -Infinity\n > y = base.dists.levy.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.levy.logcdf( 2.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.logcdf.factory( μ, c )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Lévy distribution with location parameter\n `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.levy.logcdf.factory( 2.0, 3.0 );\n > var y = mylogcdf( 10.0 )\n ~-0.616\n > y = mylogcdf( 2.0 )\n -Infinity\n\n",
"base.dists.levy.logpdf": "\nbase.dists.levy.logpdf( x, μ, c )\n Evaluates the logarithm of the probability density function (PDF) for a Lévy\n distribution with location parameter `μ` and scale parameter `c` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.levy.logpdf( 2.0, 0.0, 1.0 )\n ~-2.209\n > y = base.dists.levy.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.levy.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.logpdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.logpdf.factory( μ, c )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Lévy distribution with location parameter `μ` and scale\n parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.levy.logpdf.factory( 10.0, 2.0 );\n > var y = mylogPDF( 11.0 )\n ~-1.572\n\n",
"base.dists.levy.mean": "\nbase.dists.levy.mean( μ, c )\n Returns the expected value of a Lévy distribution with location parameter\n `μ` and scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.levy.mean( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.mean( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.mean( NaN, 1.0 )\n NaN\n > y = base.dists.levy.mean( 0.0, NaN )\n NaN\n > y = base.dists.levy.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.median": "\nbase.dists.levy.median( μ, c )\n Returns the median of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.levy.median( 0.0, 1.0 )\n ~2.198\n > y = base.dists.levy.median( 4.0, 3.0 )\n ~10.594\n > y = base.dists.levy.median( NaN, 1.0 )\n NaN\n > y = base.dists.levy.median( 0.0, NaN )\n NaN\n > y = base.dists.levy.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.mode": "\nbase.dists.levy.mode( μ, c )\n Returns the mode of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.levy.mode( 0.0, 1.0 )\n ~0.333\n > y = base.dists.levy.mode( 4.0, 3.0 )\n 5.0\n > y = base.dists.levy.mode( NaN, 1.0 )\n NaN\n > y = base.dists.levy.mode( 0.0, NaN )\n NaN\n > y = base.dists.levy.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.pdf": "\nbase.dists.levy.pdf( x, μ, c )\n Evaluates the probability density function (PDF) for a Lévy distribution\n with location parameter `μ` and scale parameter `c` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.levy.pdf( 2.0, 0.0, 1.0 )\n ~0.11\n > y = base.dists.levy.pdf( -1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.levy.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.levy.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.pdf.factory( μ, c )\n Returns a function for evaluating the probability density function (PDF) of\n a Lévy distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.levy.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 11.0 )\n ~0.208\n\n",
"base.dists.levy.quantile": "\nbase.dists.levy.quantile( p, μ, c )\n Evaluates the quantile function for a Lévy distribution with location\n parameter `μ` and scale parameter `c` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.levy.quantile( 0.8, 0.0, 1.0 )\n ~15.58\n > y = base.dists.levy.quantile( 0.5, 4.0, 2.0 )\n ~8.396\n\n > y = base.dists.levy.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.levy.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.levy.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.levy.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.levy.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.levy.quantile.factory( μ, c )\n Returns a function for evaluating the quantile function of a Lévy\n distribution with location parameter `μ` and scale parameter `c`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.levy.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n ~14.396\n\n",
"base.dists.levy.stdev": "\nbase.dists.levy.stdev( μ, c )\n Returns the standard deviation of a Lévy distribution with location\n parameter `μ` and scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.levy.stdev( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.stdev( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.levy.stdev( 0.0, NaN )\n NaN\n > y = base.dists.levy.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.levy.variance": "\nbase.dists.levy.variance( μ, c )\n Returns the variance of a Lévy distribution with location parameter `μ` and\n scale parameter `c`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.levy.variance( 0.0, 1.0 )\n Infinity\n > y = base.dists.levy.variance( 4.0, 3.0 )\n Infinity\n > y = base.dists.levy.variance( NaN, 1.0 )\n NaN\n > y = base.dists.levy.variance( 0.0, NaN )\n NaN\n > y = base.dists.levy.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.cdf": "\nbase.dists.logistic.cdf( x, μ, s )\n Evaluates the cumulative distribution function (CDF) for a logistic\n distribution with location parameter `μ` and scale parameter `s` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.logistic.cdf( 2.0, 0.0, 1.0 )\n ~0.881\n > y = base.dists.logistic.cdf( 5.0, 10.0, 3.0 )\n ~0.159\n\n > y = base.dists.logistic.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.logistic.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `s = 0.0`:\n > y = base.dists.logistic.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.logistic.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.logistic.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.logistic.cdf.factory( μ, s )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a logistic distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.logistic.cdf.factory( 3.0, 1.5 );\n > var y = mycdf( 1.0 )\n ~0.209\n\n",
"base.dists.logistic.entropy": "\nbase.dists.logistic.entropy( μ, s )\n Returns the entropy of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.logistic.entropy( 0.0, 1.0 )\n 2.0\n > y = base.dists.logistic.entropy( 4.0, 2.0 )\n ~2.693\n > y = base.dists.logistic.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.entropy( 0.0, NaN )\n NaN\n > y = base.dists.logistic.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.kurtosis": "\nbase.dists.logistic.kurtosis( μ, s )\n Returns the excess kurtosis of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.logistic.kurtosis( 0.0, 1.0 )\n 1.2\n > y = base.dists.logistic.kurtosis( 4.0, 2.0 )\n 1.2\n > y = base.dists.logistic.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.logistic.kurtosis( 0.0, 0.0 )\n NaN\n\n\n",
"base.dists.logistic.logcdf": "\nbase.dists.logistic.logcdf( x, μ, s )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n logistic distribution with location parameter `μ` and scale parameter `s` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.logistic.logcdf( 2.0, 0.0, 1.0 )\n ~-0.127\n > y = base.dists.logistic.logcdf( 5.0, 10.0, 3.0 )\n ~-1.84\n > y = base.dists.logistic.logcdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.logistic.logcdf( 2, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.logcdf( NaN, 0.0, 1.0 )\n NaN\n\n\nbase.dists.logistic.logcdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.logistic.logcdf.factory( 3.0, 1.5 );\n > var y = mylogcdf( 1.0 )\n ~-1.567\n\n",
"base.dists.logistic.Logistic": "\nbase.dists.logistic.Logistic( [μ, s] )\n Returns a logistic distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n s: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n logistic: Object\n Distribution instance.\n\n logistic.mu: number\n Location parameter.\n\n logistic.s: number\n Scale parameter. If set, the value must be greater than `0`.\n\n logistic.entropy: number\n Read-only property which returns the differential entropy.\n\n logistic.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n logistic.mean: number\n Read-only property which returns the expected value.\n\n logistic.median: number\n Read-only property which returns the median.\n\n logistic.mode: number\n Read-only property which returns the mode.\n\n logistic.skewness: number\n Read-only property which returns the skewness.\n\n logistic.stdev: number\n Read-only property which returns the standard deviation.\n\n logistic.variance: number\n Read-only property which returns the variance.\n\n logistic.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n logistic.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n logistic.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n logistic.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n logistic.pdf: Function\n Evaluates the probability density function (PDF).\n\n logistic.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var logistic = base.dists.logistic.Logistic( -2.0, 3.0 );\n > logistic.mu\n -2.0\n > logistic.s\n 3.0\n > logistic.entropy\n ~3.1\n > logistic.kurtosis\n 1.2\n > logistic.mean\n -2.0\n > logistic.median\n -2.0\n > logistic.mode\n -2.0\n > logistic.skewness\n 0.0\n > logistic.stdev\n ~5.441\n > logistic.variance\n ~29.609\n > logistic.cdf( 0.8 )\n ~0.718\n > logistic.logcdf( 0.8 )\n ~-0.332\n > logistic.logpdf( 2.0 )\n ~-2.9\n > logistic.mgf( 0.2 )\n ~1.329\n > logistic.pdf( 2.0 )\n ~0.055\n > logistic.quantile( 0.9 )\n ~4.592\n\n",
"base.dists.logistic.logpdf": "\nbase.dists.logistic.logpdf( x, μ, s )\n Evaluates the logarithm of the probability density function (PDF) for a\n logistic distribution with location parameter `μ` and scale parameter `s` at\n a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.logistic.logpdf( 2.0, 0.0, 1.0 )\n ~-2.254\n > y = base.dists.logistic.logpdf( -1.0, 4.0, 2.0 )\n ~-3.351\n > y = base.dists.logistic.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.logistic.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution at `s = 0.0`:\n > y = base.dists.logistic.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.logistic.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.logistic.logpdf.factory( μ, s )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Logistic distribution with location parameter `μ` and\n scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.logistic.logpdf.factory( 10.0, 2.0 );\n > var y = mylogpdf( 10.0 )\n ~-2.079\n\n",
"base.dists.logistic.mean": "\nbase.dists.logistic.mean( μ, s )\n Returns the expected value of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.logistic.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.mean( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mean( 0.0, NaN )\n NaN\n > y = base.dists.logistic.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.median": "\nbase.dists.logistic.median( μ, s )\n Returns the median of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.logistic.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.median( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.median( 0.0, NaN )\n NaN\n > y = base.dists.logistic.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.mgf": "\nbase.dists.logistic.mgf( t, μ, s )\n Evaluates the moment-generating function (MGF) for a logistic distribution\n with location parameter `μ` and scale parameter `s` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.logistic.mgf( 0.9, 0.0, 1.0 )\n ~9.15\n > y = base.dists.logistic.mgf( 0.1, 4.0, 4.0 )\n ~1.971\n > y = base.dists.logistic.mgf( -0.2, 4.0, 4.0 )\n ~1.921\n > y = base.dists.logistic.mgf( 0.5, 0.0, -1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.5, 0.0, 4.0 )\n Infinity\n > y = base.dists.logistic.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mgf( 0.0, 0.0, NaN )\n NaN\n\n\nbase.dists.logistic.mgf.factory( μ, s )\n Returns a function for evaluating the moment-generating function (MGF)\n of a Logistic distribution with location parameter `μ` and scale parameter\n `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.logistic.mgf.factory( 10.0, 0.5 );\n > var y = mymgf( 0.5 )\n ~164.846\n > y = mymgf( 2.0 )\n Infinity\n\n",
"base.dists.logistic.mode": "\nbase.dists.logistic.mode( μ, s )\n Returns the mode of a logistic distribution with location parameter `μ` and\n scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.logistic.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.logistic.mode( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.mode( 0.0, NaN )\n NaN\n > y = base.dists.logistic.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.pdf": "\nbase.dists.logistic.pdf( x, μ, s )\n Evaluates the probability density function (PDF) for a logistic distribution\n with location parameter `μ` and scale parameter `s` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.logistic.pdf( 2.0, 0.0, 1.0 )\n ~0.105\n > y = base.dists.logistic.pdf( -1.0, 4.0, 2.0 )\n ~0.035\n > y = base.dists.logistic.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.pdf( 0.0, 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.logistic.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.logistic.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.logistic.pdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.logistic.pdf.factory( μ, s )\n Returns a function for evaluating the probability density function (PDF) of\n a Logistic distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.logistic.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n 0.125\n\n",
"base.dists.logistic.quantile": "\nbase.dists.logistic.quantile( p, μ, s )\n Evaluates the quantile function for a logistic distribution with location\n parameter `μ` and scale parameter `s` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.logistic.quantile( 0.8, 0.0, 1.0 )\n ~1.386\n > y = base.dists.logistic.quantile( 0.5, 4.0, 2.0 )\n 4\n\n > y = base.dists.logistic.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.logistic.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.logistic.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.logistic.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n\nbase.dists.logistic.quantile.factory( μ, s )\n Returns a function for evaluating the quantile function of a logistic\n distribution with location parameter `μ` and scale parameter `s`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.logistic.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.logistic.skewness": "\nbase.dists.logistic.skewness( μ, s )\n Returns the skewness of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.logistic.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.logistic.skewness( 4.0, 2.0 )\n 0.0\n > y = base.dists.logistic.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.skewness( 0.0, NaN )\n NaN\n > y = base.dists.logistic.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.stdev": "\nbase.dists.logistic.stdev( μ, s )\n Returns the standard deviation of a logistic distribution with location\n parameter `μ` and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.logistic.stdev( 0.0, 1.0 )\n ~1.814\n > y = base.dists.logistic.stdev( 4.0, 2.0 )\n ~3.628\n > y = base.dists.logistic.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.stdev( 0.0, NaN )\n NaN\n > y = base.dists.logistic.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.logistic.variance": "\nbase.dists.logistic.variance( μ, s )\n Returns the variance of a logistic distribution with location parameter `μ`\n and scale parameter `s`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.logistic.variance( 0.0, 1.0 )\n ~3.29\n > y = base.dists.logistic.variance( 4.0, 2.0 )\n ~13.159\n > y = base.dists.logistic.variance( NaN, 1.0 )\n NaN\n > y = base.dists.logistic.variance( 0.0, NaN )\n NaN\n > y = base.dists.logistic.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.cdf": "\nbase.dists.lognormal.cdf( x, μ, σ )\n Evaluates the cumulative distribution function (CDF) for a lognormal\n distribution with location parameter `μ` and scale parameter `σ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.cdf( 2.0, 0.0, 1.0 )\n ~0.756\n > y = base.dists.lognormal.cdf( 5.0, 10.0, 3.0 )\n ~0.003\n\n > y = base.dists.lognormal.cdf( 2.0, 0.0, NaN )\n NaN\n > y = base.dists.lognormal.cdf( 2.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.cdf( NaN, 0.0, 1.0 )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.cdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.cdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.cdf.factory( μ, σ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a lognormal distribution with location parameter `μ` and scale parameter\n `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.lognormal.cdf.factory( 3.0, 1.5 );\n > var y = myCDF( 1.0 )\n ~0.023\n > y = myCDF( 4.0 )\n ~0.141\n\n",
"base.dists.lognormal.entropy": "\nbase.dists.lognormal.entropy( μ, σ )\n Returns the differential entropy of a lognormal distribution with location\n `μ` and scale `σ` (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.lognormal.entropy( 0.0, 1.0 )\n ~1.419\n > y = base.dists.lognormal.entropy( 5.0, 2.0 )\n ~7.112\n > y = base.dists.lognormal.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.entropy( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.kurtosis": "\nbase.dists.lognormal.kurtosis( μ, σ )\n Returns the excess kurtosis of a lognormal distribution with location `μ`\n and scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var y = base.dists.lognormal.kurtosis( 0.0, 1.0 )\n ~110.936\n > y = base.dists.lognormal.kurtosis( 5.0, 2.0 )\n ~9220556.977\n > y = base.dists.lognormal.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.LogNormal": "\nbase.dists.lognormal.LogNormal( [μ, σ] )\n Returns a lognormal distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter. Default: `0.0`.\n\n σ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n lognormal: Object\n Distribution instance.\n\n lognormal.mu: number\n Location parameter.\n\n lognormal.sigma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n lognormal.entropy: number\n Read-only property which returns the differential entropy.\n\n lognormal.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n lognormal.mean: number\n Read-only property which returns the expected value.\n\n lognormal.median: number\n Read-only property which returns the median.\n\n lognormal.mode: number\n Read-only property which returns the mode.\n\n lognormal.skewness: number\n Read-only property which returns the skewness.\n\n lognormal.stdev: number\n Read-only property which returns the standard deviation.\n\n lognormal.variance: number\n Read-only property which returns the variance.\n\n lognormal.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n lognormal.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n lognormal.pdf: Function\n Evaluates the probability density function (PDF).\n\n lognormal.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var lognormal = base.dists.lognormal.LogNormal( -2.0, 3.0 );\n > lognormal.mu\n -2.0\n > lognormal.sigma\n 3.0\n > lognormal.entropy\n ~0.518\n > lognormal.kurtosis\n 4312295840576300\n > lognormal.mean\n ~12.182\n > lognormal.median\n ~0.135\n > lognormal.mode\n ~0.0\n > lognormal.skewness\n ~729551.383\n > lognormal.stdev\n ~1096.565\n > lognormal.variance\n ~1202455.871\n > lognormal.cdf( 0.8 )\n ~0.723\n > lognormal.logpdf( 2.0 )\n ~-3.114\n > lognormal.pdf( 2.0 )\n ~0.044\n > lognormal.quantile( 0.9 )\n ~6.326\n\n",
"base.dists.lognormal.logpdf": "\nbase.dists.lognormal.logpdf( x, μ, σ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a lognormal distribution with location parameter `μ` and scale parameter\n `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.logpdf( 2.0, 0.0, 1.0 )\n ~-1.852\n > y = base.dists.lognormal.logpdf( 1.0, 0.0, 1.0 )\n ~-0.919\n > y = base.dists.lognormal.logpdf( 1.0, 3.0, 1.0 )\n ~-5.419\n > y = base.dists.lognormal.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.lognormal.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.logpdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.logpdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.logpdf.factory( μ, σ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a lognormal distribution with location parameter\n `μ` and scale parameter `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.lognormal.logpdf.factory( 4.0, 2.0 );\n > var y = mylogPDF( 10.0 )\n ~-4.275\n > y = mylogPDF( 2.0 )\n ~-3.672\n\n",
"base.dists.lognormal.mean": "\nbase.dists.lognormal.mean( μ, σ )\n Returns the expected value of a lognormal distribution with location `μ` and\n scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.lognormal.mean( 0.0, 1.0 )\n ~1.649\n > y = base.dists.lognormal.mean( 4.0, 2.0 )\n ~403.429\n > y = base.dists.lognormal.mean( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.mean( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.median": "\nbase.dists.lognormal.median( μ, σ )\n Returns the median of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.lognormal.median( 0.0, 1.0 )\n 1.0\n > y = base.dists.lognormal.median( 5.0, 2.0 )\n ~148.413\n > y = base.dists.lognormal.median( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.median( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.mode": "\nbase.dists.lognormal.mode( μ, σ )\n Returns the mode of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.lognormal.mode( 0.0, 1.0 )\n ~0.368\n > y = base.dists.lognormal.mode( 5.0, 2.0 )\n ~2.718\n > y = base.dists.lognormal.mode( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.mode( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.pdf": "\nbase.dists.lognormal.pdf( x, μ, σ )\n Evaluates the probability density function (PDF) for a lognormal\n distribution with location parameter `μ` and scale parameter `σ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.lognormal.pdf( 2.0, 0.0, 1.0 )\n ~0.157\n > y = base.dists.lognormal.pdf( 1.0, 0.0, 1.0 )\n ~0.399\n > y = base.dists.lognormal.pdf( 1.0, 3.0, 1.0 )\n ~0.004\n > y = base.dists.lognormal.pdf( -1.0, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.lognormal.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.pdf( 2.0, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.pdf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.pdf.factory( μ, σ )\n Returns a function for evaluating the probability density function (PDF) of\n a lognormal distribution with location parameter `μ` and scale parameter\n `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.lognormal.pdf.factory( 4.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.014\n > y = myPDF( 2.0 )\n ~0.025\n\n",
"base.dists.lognormal.quantile": "\nbase.dists.lognormal.quantile( p, μ, σ )\n Evaluates the quantile function for a lognormal distribution with location\n parameter `μ` and scale parameter `σ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.lognormal.quantile( 0.8, 0.0, 1.0 )\n ~2.32\n > y = base.dists.lognormal.quantile( 0.5, 4.0, 2.0 )\n ~54.598\n > y = base.dists.lognormal.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.lognormal.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Non-positive scale parameter `σ`:\n > y = base.dists.lognormal.quantile( 0.5, 0.0, -1.0 )\n NaN\n > y = base.dists.lognormal.quantile( 0.5, 0.0, 0.0 )\n NaN\n\n\nbase.dists.lognormal.quantile.factory( μ, σ )\n Returns a function for evaluating the quantile function of a lognormal\n distribution with location parameter `μ` and scale parameter `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.lognormal.quantile.factory( 4.0, 2.0 );\n > var y = myQuantile( 0.2 )\n ~10.143\n > y = myQuantile( 0.8 )\n ~293.901\n\n",
"base.dists.lognormal.skewness": "\nbase.dists.lognormal.skewness( μ, σ )\n Returns the skewness of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.lognormal.skewness( 0.0, 1.0 )\n ~6.185\n > y = base.dists.lognormal.skewness( 5.0, 2.0 )\n ~414.359\n > y = base.dists.lognormal.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.skewness( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.stdev": "\nbase.dists.lognormal.stdev( μ, σ )\n Returns the standard deviation of a lognormal distribution with location `μ`\n and scale `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.lognormal.stdev( 0.0, 1.0 )\n ~2.161\n > y = base.dists.lognormal.stdev( 4.0, 2.0 )\n ~2953.533\n > y = base.dists.lognormal.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.stdev( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.lognormal.variance": "\nbase.dists.lognormal.variance( μ, σ )\n Returns the variance of a lognormal distribution with location `μ` and scale\n `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.lognormal.variance( 0.0, 1.0 )\n ~4.671\n > y = base.dists.lognormal.variance( 4.0, 2.0 )\n ~8723355.729\n > y = base.dists.lognormal.variance( NaN, 1.0 )\n NaN\n > y = base.dists.lognormal.variance( 0.0, NaN )\n NaN\n > y = base.dists.lognormal.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.negativeBinomial.cdf": "\nbase.dists.negativeBinomial.cdf( x, r, p )\n Evaluates the cumulative distribution function (CDF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.cdf( 5.0, 20.0, 0.8 )\n ~0.617\n > y = base.dists.negativeBinomial.cdf( 21.0, 20.0, 0.5 )\n ~0.622\n > y = base.dists.negativeBinomial.cdf( 5.0, 10.0, 0.4 )\n ~0.034\n > y = base.dists.negativeBinomial.cdf( 0.0, 10.0, 0.9 )\n ~0.349\n > y = base.dists.negativeBinomial.cdf( 21.0, 15.5, 0.5 )\n ~0.859\n > y = base.dists.negativeBinomial.cdf( 5.0, 7.4, 0.4 )\n ~0.131\n\n > y = base.dists.negativeBinomial.cdf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 2.0, -2.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.cdf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 0.0, 20.0, NaN )\n NaN\n\n > y = base.dists.negativeBinomial.cdf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.cdf( 2.0, 20, 1.5 )\n NaN\n\n\nbase.dists.negativeBinomial.cdf.factory( r, p )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a negative binomial distribution with number of successes until\n experiment is stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.negativeBinomial.cdf.factory( 10, 0.5 );\n > var y = myCDF( 3.0 )\n ~0.046\n > y = myCDF( 11.0 )\n ~0.668\n\n",
"base.dists.negativeBinomial.kurtosis": "\nbase.dists.negativeBinomial.kurtosis( r, p )\n Returns the excess kurtosis of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Kurtosis.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.kurtosis( 100, 0.2 )\n ~0.061\n > v = base.dists.negativeBinomial.kurtosis( 20, 0.5 )\n ~0.325\n\n",
"base.dists.negativeBinomial.logpmf": "\nbase.dists.negativeBinomial.logpmf( x, r, p )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.logpmf( 5.0, 20.0, 0.8 )\n ~-1.853\n > y = base.dists.negativeBinomial.logpmf( 21.0, 20.0, 0.5 )\n ~-2.818\n > y = base.dists.negativeBinomial.logpmf( 5.0, 10.0, 0.4 )\n ~-4.115\n > y = base.dists.negativeBinomial.logpmf( 0.0, 10.0, 0.9 )\n ~-1.054\n > y = base.dists.negativeBinomial.logpmf( 21.0, 15.5, 0.5 )\n ~-3.292\n > y = base.dists.negativeBinomial.logpmf( 5.0, 7.4, 0.4 )\n ~-2.976\n\n > y = base.dists.negativeBinomial.logpmf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 2.0, 20, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.logpmf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.logpmf( 0.0, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.logpmf.factory( r, p )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a negative binomial distribution with number of\n successes until experiment is stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogPMF = base.dists.negativeBinomial.logpmf.factory( 10, 0.5 );\n > var y = mylogPMF( 3.0 )\n ~-3.617\n > y = mylogPMF( 5.0 )\n ~-2.795\n\n",
"base.dists.negativeBinomial.mean": "\nbase.dists.negativeBinomial.mean( r, p )\n Returns the expected value of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.mean( 100, 0.2 )\n 400\n > v = base.dists.negativeBinomial.mean( 20, 0.5 )\n 20\n\n",
"base.dists.negativeBinomial.mgf": "\nbase.dists.negativeBinomial.mgf( x, r, p )\n Evaluates the moment-generating function (MGF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.mgf( 0.05, 20.0, 0.8 )\n ~267.839\n > y = base.dists.negativeBinomial.mgf( 0.1, 20.0, 0.1 )\n ~9.347\n > y = base.dists.negativeBinomial.mgf( 0.5, 10.0, 0.4 )\n ~42822.023\n\n > y = base.dists.negativeBinomial.mgf( 0.1, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.1, -2.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.mgf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.0, 20.0, NaN )\n NaN\n\n > y = base.dists.negativeBinomial.mgf( 0.2, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.mgf( 0.2, 20, 1.5 )\n NaN\n\n\nbase.dists.negativeBinomial.mgf.factory( r, p )\n Returns a function for evaluating the moment-generating function (MGF) of a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.negativeBinomial.mgf.factory( 4.3, 0.4 );\n > var y = myMGF( 0.2 )\n ~4.696\n > y = myMGF( 0.4 )\n ~30.83\n\n",
"base.dists.negativeBinomial.mode": "\nbase.dists.negativeBinomial.mode( r, p )\n Returns the mode of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.mode( 100, 0.2 )\n 396\n > v = base.dists.negativeBinomial.mode( 20, 0.5 )\n 19\n\n",
"base.dists.negativeBinomial.NegativeBinomial": "\nbase.dists.negativeBinomial.NegativeBinomial( [r, p] )\n Returns a negative binomial distribution object.\n\n Parameters\n ----------\n r: number (optional)\n Number of successes until experiment is stopped. Must be a positive\n number. Default: `1`.\n\n p: number (optional)\n Success probability. Must be a number between `0` and `1`. Default:\n `0.5`.\n\n Returns\n -------\n nbinomial: Object\n Distribution instance.\n\n nbinomial.r: number\n Number of trials. If set, the value must be a positive number.\n\n nbinomial.p: number\n Success probability. If set, the value must be a number between `0` and\n `1`.\n\n nbinomial.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n nbinomial.mean: number\n Read-only property which returns the expected value.\n\n nbinomial.mode: number\n Read-only property which returns the mode.\n\n nbinomial.skewness: number\n Read-only property which returns the skewness.\n\n nbinomial.stdev: number\n Read-only property which returns the standard deviation.\n\n nbinomial.variance: number\n Read-only property which returns the variance.\n\n nbinomial.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n nbinomial.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n nbinomial.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n nbinomial.pmf: Function\n Evaluates the probability mass function (PMF).\n\n nbinomial.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var nbinomial = base.dists.negativeBinomial.NegativeBinomial( 8.0, 0.5 );\n > nbinomial.r\n 8.0\n > nbinomial.p\n 0.5\n > nbinomial.kurtosis\n 0.8125\n > nbinomial.mean\n 8.0\n > nbinomial.mode\n 7.0\n > nbinomial.skewness\n 0.75\n > nbinomial.stdev\n 4.0\n > nbinomial.variance\n 16.0\n > nbinomial.cdf( 2.9 )\n ~0.055\n > nbinomial.logpmf( 3.0 )\n ~-2.837\n > nbinomial.mgf( 0.2 )\n ~36.675\n > nbinomial.pmf( 3.0 )\n ~0.059\n > nbinomial.quantile( 0.8 )\n 11.0\n\n",
"base.dists.negativeBinomial.pmf": "\nbase.dists.negativeBinomial.pmf( x, r, p )\n Evaluates the probability mass function (PMF) for a negative binomial\n distribution with number of successes until experiment is stopped `r` and\n success probability `p` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.pmf( 5.0, 20.0, 0.8 )\n ~0.157\n > y = base.dists.negativeBinomial.pmf( 21.0, 20.0, 0.5 )\n ~0.06\n > y = base.dists.negativeBinomial.pmf( 5.0, 10.0, 0.4 )\n ~0.016\n > y = base.dists.negativeBinomial.pmf( 0.0, 10.0, 0.9 )\n ~0.349\n > y = base.dists.negativeBinomial.pmf( 21.0, 15.5, 0.5 )\n ~0.037\n > y = base.dists.negativeBinomial.pmf( 5.0, 7.4, 0.4 )\n ~0.051\n\n > y = base.dists.negativeBinomial.pmf( 2.0, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, 20, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 2.0, 20, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.pmf( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.pmf( 0.0, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.pmf.factory( r, p )\n Returns a function for evaluating the probability mass function (PMF) of a\n negative binomial distribution with number of successes until experiment is\n stopped `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var myPMF = base.dists.negativeBinomial.pmf.factory( 10, 0.5 );\n > var y = myPMF( 3.0 )\n ~0.027\n > y = myPMF( 5.0 )\n ~0.061\n\n",
"base.dists.negativeBinomial.quantile": "\nbase.dists.negativeBinomial.quantile( k, r, p )\n Evaluates the quantile function for a negative binomial distribution with\n number of successes until experiment is stopped `r` and success probability\n `p` at a probability `k`.\n\n If provided a `k` outside of `[0,1]`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n k: number\n Input probability.\n\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.negativeBinomial.quantile( 0.9, 20.0, 0.2 )\n 106\n > y = base.dists.negativeBinomial.quantile( 0.9, 20.0, 0.8 )\n 8\n > y = base.dists.negativeBinomial.quantile( 0.5, 10.0, 0.4 )\n 14\n > y = base.dists.negativeBinomial.quantile( 0.0, 10.0, 0.9 )\n 0\n\n > y = base.dists.negativeBinomial.quantile( 1.1, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( -0.1, 20.0, 0.5 )\n NaN\n\n > y = base.dists.negativeBinomial.quantile( 21.0, 15.5, 0.5 )\n 12\n > y = base.dists.negativeBinomial.quantile( 5.0, 7.4, 0.4 )\n 10\n\n > y = base.dists.negativeBinomial.quantile( 0.5, 0.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.5, -2.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, -1.0 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, 1.5 )\n NaN\n\n > y = base.dists.negativeBinomial.quantile( NaN, 20.0, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, NaN, 0.5 )\n NaN\n > y = base.dists.negativeBinomial.quantile( 0.3, 20.0, NaN )\n NaN\n\n\nbase.dists.negativeBinomial.quantile.factory( r, p )\n Returns a function for evaluating the quantile function of a negative\n binomial distribution with number of successes until experiment is stopped\n `r` and success probability `p`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.negativeBinomial.quantile.factory( 10.0, 0.5 );\n > var y = myQuantile( 0.1 )\n 5\n > y = myQuantile( 0.9 )\n 16\n\n",
"base.dists.negativeBinomial.skewness": "\nbase.dists.negativeBinomial.skewness( r, p )\n Returns the skewness of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.skewness( 100, 0.2 )\n ~0.201\n > v = base.dists.negativeBinomial.skewness( 20, 0.5 )\n ~0.474\n\n",
"base.dists.negativeBinomial.stdev": "\nbase.dists.negativeBinomial.stdev( r, p )\n Returns the standard deviation of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.stdev( 100, 0.2 )\n ~44.721\n > v = base.dists.negativeBinomial.stdev( 20, 0.5 )\n ~6.325\n\n",
"base.dists.negativeBinomial.variance": "\nbase.dists.negativeBinomial.variance( r, p )\n Returns the variance of a negative binomial distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a `r` which is not a positive number, the function returns\n `NaN`.\n\n If provided a success probability `p` outside of `[0,1]`, the function\n returns `NaN`.\n\n Parameters\n ----------\n r: integer\n Number of failures until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.negativeBinomial.variance( 100, 0.2 )\n 2000.0\n > v = base.dists.negativeBinomial.variance( 20, 0.5 )\n 40.0\n\n",
"base.dists.normal.cdf": "\nbase.dists.normal.cdf( x, μ, σ )\n Evaluates the cumulative distribution function (CDF) for a normal\n distribution with mean `μ` and standard deviation `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.normal.cdf( 2.0, 0.0, 1.0 )\n ~0.977\n > y = base.dists.normal.cdf( -1.0, -1.0, 2.0 )\n 0.5\n > y = base.dists.normal.cdf( -1.0, 4.0, 2.0 )\n ~0.006\n > y = base.dists.normal.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.cdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.cdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.normal.cdf( 8.0, 8.0, 0.0 )\n 1.0\n > y = base.dists.normal.cdf( 10.0, 8.0, 0.0 )\n 1.0\n\n\nbase.dists.normal.cdf.factory( μ, σ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.normal.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 10.0 )\n 0.5\n\n",
"base.dists.normal.entropy": "\nbase.dists.normal.entropy( μ, σ )\n Returns the differential entropy of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var y = base.dists.normal.entropy( 0.0, 1.0 )\n ~1.419\n > y = base.dists.normal.entropy( 4.0, 3.0 )\n ~2.518\n > y = base.dists.normal.entropy( NaN, 1.0 )\n NaN\n > y = base.dists.normal.entropy( 0.0, NaN )\n NaN\n > y = base.dists.normal.entropy( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.kurtosis": "\nbase.dists.normal.kurtosis( μ, σ )\n Returns the excess kurtosis of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var y = base.dists.normal.kurtosis( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.kurtosis( 4.0, 3.0 )\n 0.0\n > y = base.dists.normal.kurtosis( NaN, 1.0 )\n NaN\n > y = base.dists.normal.kurtosis( 0.0, NaN )\n NaN\n > y = base.dists.normal.kurtosis( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.logpdf": "\nbase.dists.normal.logpdf( x, μ, σ )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a normal distribution with mean `μ` and standard deviation `σ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.normal.logpdf( 2.0, 0.0, 1.0 )\n ~-2.919\n > y = base.dists.normal.logpdf( -1.0, 4.0, 2.0 )\n ~-4.737\n > y = base.dists.normal.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.logpdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.logpdf( 2.0, 8.0, 0.0 )\n -Infinity\n > y = base.dists.normal.logpdf( 8.0, 8.0, 0.0 )\n Infinity\n\n\nbase.dists.normal.logpdf.factory( μ, σ )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var myLogPDF = base.dists.normal.logpdf.factory( 10.0, 2.0 );\n > var y = myLogPDF( 10.0 )\n ~-1.612\n\n",
"base.dists.normal.mean": "\nbase.dists.normal.mean( μ, σ )\n Returns the expected value of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var y = base.dists.normal.mean( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.mean( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.mean( NaN, 1.0 )\n NaN\n > y = base.dists.normal.mean( 0.0, NaN )\n NaN\n > y = base.dists.normal.mean( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.median": "\nbase.dists.normal.median( μ, σ )\n Returns the median of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var y = base.dists.normal.median( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.median( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.median( NaN, 1.0 )\n NaN\n > y = base.dists.normal.median( 0.0, NaN )\n NaN\n > y = base.dists.normal.median( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.mgf": "\nbase.dists.normal.mgf( x, μ, σ )\n Evaluates the moment-generating function (MGF) for a normal distribution\n with mean `μ` and standard deviation `σ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.normal.mgf( 2.0, 0.0, 1.0 )\n ~7.389\n > y = base.dists.normal.mgf( 0.0, 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.mgf( -1.0, 4.0, 2.0 )\n ~0.1353\n > y = base.dists.normal.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.mgf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.normal.mgf( 2.0, 0.0, 0.0 )\n NaN\n\n\nbase.dists.normal.mgf.factory( μ, σ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.normal.mgf.factory( 4.0, 2.0 );\n > var y = myMGF( 1.0 )\n ~403.429\n > y = myMGF( 0.5 )\n ~12.182\n\n",
"base.dists.normal.mode": "\nbase.dists.normal.mode( μ, σ )\n Returns the mode of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var y = base.dists.normal.mode( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.mode( 4.0, 2.0 )\n 4.0\n > y = base.dists.normal.mode( NaN, 1.0 )\n NaN\n > y = base.dists.normal.mode( 0.0, NaN )\n NaN\n > y = base.dists.normal.mode( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.Normal": "\nbase.dists.normal.Normal( [μ, σ] )\n Returns a normal distribution object.\n\n Parameters\n ----------\n μ: number (optional)\n Mean parameter. Default: `0.0`.\n\n σ: number (optional)\n Standard deviation. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n normal: Object\n Distribution instance.\n\n normal.mu: number\n Mean parameter.\n\n normal.sigma: number\n Standard deviation. If set, the value must be greater than `0`.\n\n normal.entropy: number\n Read-only property which returns the differential entropy.\n\n normal.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n normal.mean: number\n Read-only property which returns the expected value.\n\n normal.median: number\n Read-only property which returns the median.\n\n normal.mode: number\n Read-only property which returns the mode.\n\n normal.skewness: number\n Read-only property which returns the skewness.\n\n normal.stdev: number\n Read-only property which returns the standard deviation.\n\n normal.variance: number\n Read-only property which returns the variance.\n\n normal.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n normal.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n normal.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n normal.pdf: Function\n Evaluates the probability density function (PDF).\n\n normal.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var normal = base.dists.normal.Normal( -2.0, 3.0 );\n > normal.mu\n -2.0\n > normal.sigma\n 3.0\n > normal.entropy\n ~2.518\n > normal.kurtosis\n 0.0\n > normal.mean\n -2.0\n > normal.median\n -2.0\n > normal.mode\n -2.0\n > normal.skewness\n 0.0\n > normal.stdev\n 3.0\n > normal.variance\n 9.0\n > normal.cdf( 0.8 )\n ~0.825\n > normal.logpdf( 2.0 )\n ~-2.9\n > normal.mgf( 0.2 )\n ~0.803\n > normal.pdf( 2.0 )\n ~0.055\n > normal.quantile( 0.9 )\n ~1.845\n\n",
"base.dists.normal.pdf": "\nbase.dists.normal.pdf( x, μ, σ )\n Evaluates the probability density function (PDF) for a normal distribution\n with mean `μ` and standard deviation `σ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.normal.pdf( 2.0, 0.0, 1.0 )\n ~0.054\n > y = base.dists.normal.pdf( -1.0, 4.0, 2.0 )\n ~0.009\n > y = base.dists.normal.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.pdf( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.pdf( 2.0, 8.0, 0.0 )\n 0.0\n > y = base.dists.normal.pdf( 8.0, 8.0, 0.0 )\n infinity\n\n\nbase.dists.normal.pdf.factory( μ, σ )\n Returns a function for evaluating the probability density function (PDF) of\n a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.normal.pdf.factory( 10.0, 2.0 );\n > var y = myPDF( 10.0 )\n ~0.199\n\n",
"base.dists.normal.quantile": "\nbase.dists.normal.quantile( p, μ, σ )\n Evaluates the quantile function for a normal distribution with mean `μ` and\n standard deviation `σ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.normal.quantile( 0.8, 0.0, 1.0 )\n ~0.842\n > y = base.dists.normal.quantile( 0.5, 4.0, 2.0 )\n 4\n\n > y = base.dists.normal.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.normal.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.normal.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.normal.quantile( 0.0, 0.0, NaN )\n NaN\n\n // Negative standard deviation:\n > y = base.dists.normal.quantile( 0.5, 0.0, -1.0 )\n NaN\n\n // Degenerate distribution centered at `μ` when `σ = 0.0`:\n > y = base.dists.normal.quantile( 0.3, 8.0, 0.0 )\n 8.0\n > y = base.dists.normal.quantile( 0.9, 8.0, 0.0 )\n 8.0\n\n\nbase.dists.normal.quantile.factory( μ, σ )\n Returns a function for evaluating the quantile function\n of a normal distribution with mean `μ` and standard deviation `σ`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.normal.quantile.factory( 10.0, 2.0 );\n > var y = myQuantile( 0.5 )\n 10.0\n\n",
"base.dists.normal.skewness": "\nbase.dists.normal.skewness( μ, σ )\n Returns the skewness of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var y = base.dists.normal.skewness( 0.0, 1.0 )\n 0.0\n > y = base.dists.normal.skewness( 4.0, 3.0 )\n 0.0\n > y = base.dists.normal.skewness( NaN, 1.0 )\n NaN\n > y = base.dists.normal.skewness( 0.0, NaN )\n NaN\n > y = base.dists.normal.skewness( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.stdev": "\nbase.dists.normal.stdev( μ, σ )\n Returns the standard deviation of a normal distribution with mean `μ` and\n standard deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var y = base.dists.normal.stdev( 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.stdev( 4.0, 3.0 )\n 3.0\n > y = base.dists.normal.stdev( NaN, 1.0 )\n NaN\n > y = base.dists.normal.stdev( 0.0, NaN )\n NaN\n > y = base.dists.normal.stdev( 0.0, 0.0 )\n NaN\n\n",
"base.dists.normal.variance": "\nbase.dists.normal.variance( μ, σ )\n Returns the variance of a normal distribution with mean `μ` and standard\n deviation `σ`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var y = base.dists.normal.variance( 0.0, 1.0 )\n 1.0\n > y = base.dists.normal.variance( 4.0, 3.0 )\n 9.0\n > y = base.dists.normal.variance( NaN, 1.0 )\n NaN\n > y = base.dists.normal.variance( 0.0, NaN )\n NaN\n > y = base.dists.normal.variance( 0.0, 0.0 )\n NaN\n\n",
"base.dists.pareto1.cdf": "\nbase.dists.pareto1.cdf( x, α, β )\n Evaluates the cumulative distribution function (CDF) for a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.cdf( 2.0, 1.0, 1.0 )\n 0.5\n > y = base.dists.pareto1.cdf( 5.0, 2.0, 4.0 )\n ~0.36\n > y = base.dists.pareto1.cdf( 4.0, 2.0, 2.0 )\n 0.75\n > y = base.dists.pareto1.cdf( 1.9, 2.0, 2.0 )\n 0.0\n > y = base.dists.pareto1.cdf( PINF, 4.0, 2.0 )\n 1.0\n\n > y = base.dists.pareto1.cdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.cdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.cdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.cdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.cdf.factory( α, β )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.pareto1.cdf.factory( 10.0, 2.0 );\n > var y = myCDF( 3.0 )\n ~0.983\n > y = myCDF( 2.5 )\n ~0.893\n\n",
"base.dists.pareto1.entropy": "\nbase.dists.pareto1.entropy( α, β )\n Returns the differential entropy of a Pareto (Type I) distribution\n (in nats).\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.pareto1.entropy( 0.8, 1.0 )\n ~2.473\n > v = base.dists.pareto1.entropy( 4.0, 12.0 )\n ~2.349\n > v = base.dists.pareto1.entropy( 8.0, 2.0 )\n ~-0.261\n\n",
"base.dists.pareto1.kurtosis": "\nbase.dists.pareto1.kurtosis( α, β )\n Returns the excess kurtosis of a Pareto (Type I) distribution.\n\n If `α <= 4` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.pareto1.kurtosis( 5.0, 1.0 )\n ~70.8\n > v = base.dists.pareto1.kurtosis( 4.5, 12.0 )\n ~146.444\n > v = base.dists.pareto1.kurtosis( 8.0, 2.0 )\n ~19.725\n\n",
"base.dists.pareto1.logcdf": "\nbase.dists.pareto1.logcdf( x, α, β )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.logcdf( 2.0, 1.0, 1.0 )\n ~-0.693\n > y = base.dists.pareto1.logcdf( 5.0, 2.0, 4.0 )\n ~-1.022\n > y = base.dists.pareto1.logcdf( 4.0, 2.0, 2.0 )\n ~-0.288\n > y = base.dists.pareto1.logcdf( 1.9, 2.0, 2.0 )\n -Infinity\n > y = base.dists.pareto1.logcdf( PINF, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.pareto1.logcdf( 2.0, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.logcdf( 2.0, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.logcdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.logcdf( 0.0, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.logcdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a Pareto (Type I) distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogCDF = base.dists.pareto1.logcdf.factory( 10.0, 2.0 );\n > var y = mylogCDF( 3.0 )\n ~-0.017\n > y = mylogCDF( 2.5 )\n ~-0.114\n\n",
"base.dists.pareto1.logpdf": "\nbase.dists.pareto1.logpdf( x, α, β )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a Pareto (Type I) distribution with shape parameter `α` and scale\n parameter `β` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.logpdf( 4.0, 1.0, 1.0 )\n ~-2.773\n > y = base.dists.pareto1.logpdf( 20.0, 1.0, 10.0 )\n ~-3.689\n > y = base.dists.pareto1.logpdf( 7.0, 2.0, 6.0 )\n ~-1.561\n > y = base.dists.pareto1.logpdf( 7.0, 6.0, 3.0 )\n ~-5.238\n > y = base.dists.pareto1.logpdf( 1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.pareto1.logpdf( 1.5, 4.0, 2.0 )\n -Infinity\n\n > y = base.dists.pareto1.logpdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.logpdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.logpdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.logpdf.factory( α, β )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a Pareto (Type I) distribution with shape\n parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.pareto1.logpdf.factory( 0.5, 0.5 );\n > var y = mylogPDF( 0.8 )\n ~-0.705\n > y = mylogPDF( 2.0 )\n ~-2.079\n\n",
"base.dists.pareto1.mean": "\nbase.dists.pareto1.mean( α, β )\n Returns the expected value of a Pareto (Type I) distribution.\n\n If `0 < α <= 1`, the function returns `Infinity`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.pareto1.mean( 0.8, 1.0 )\n Infinity\n > v = base.dists.pareto1.mean( 4.0, 12.0 )\n 16.0\n > v = base.dists.pareto1.mean( 8.0, 2.0 )\n ~2.286\n\n",
"base.dists.pareto1.median": "\nbase.dists.pareto1.median( α, β )\n Returns the median of a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.pareto1.median( 0.8, 1.0 )\n ~2.378\n > v = base.dists.pareto1.median( 4.0, 12.0 )\n ~14.27\n > v = base.dists.pareto1.median( 8.0, 2.0 )\n ~2.181\n\n",
"base.dists.pareto1.mode": "\nbase.dists.pareto1.mode( α, β )\n Returns the mode of a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.pareto1.mode( 0.8, 1.0 )\n 1.0\n > v = base.dists.pareto1.mode( 4.0, 12.0 )\n 12.0\n > v = base.dists.pareto1.mode( 8.0, 2.0 )\n 2.0\n\n",
"base.dists.pareto1.Pareto1": "\nbase.dists.pareto1.Pareto1( [α, β] )\n Returns a Pareto (Type I) distribution object.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n β: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n pareto1: Object\n Distribution instance.\n\n pareto1.alpha: number\n Shape parameter. If set, the value must be greater than `0`.\n\n pareto1.beta: number\n Scale parameter. If set, the value must be greater than `0`.\n\n pareto1.entropy: number\n Read-only property which returns the differential entropy.\n\n pareto1.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n pareto1.mean: number\n Read-only property which returns the expected value.\n\n pareto1.median: number\n Read-only property which returns the median.\n\n pareto1.mode: number\n Read-only property which returns the mode.\n\n pareto1.skewness: number\n Read-only property which returns the skewness.\n\n pareto1.variance: number\n Read-only property which returns the variance.\n\n pareto1.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n pareto1.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (logCDF).\n\n pareto1.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (logPDF).\n\n pareto1.pdf: Function\n Evaluates the probability density function (PDF).\n\n pareto1.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var pareto1 = base.dists.pareto1.Pareto1( 6.0, 5.0 );\n > pareto1.alpha\n 6.0\n > pareto1.beta\n 5.0\n > pareto1.entropy\n ~0.984\n > pareto1.kurtosis\n ~35.667\n > pareto1.mean\n 6.0\n > pareto1.median\n ~5.612\n > pareto1.mode\n 5.0\n > pareto1.skewness\n ~3.81\n > pareto1.variance\n 1.5\n > pareto1.cdf( 7.0 )\n ~0.867\n > pareto1.logcdf( 7.0 )\n ~-0.142\n > pareto1.logpdf( 5.0 )\n ~0.182\n > pareto1.pdf( 5.0 )\n 1.2\n > pareto1.quantile( 0.8 )\n ~6.538\n\n",
"base.dists.pareto1.pdf": "\nbase.dists.pareto1.pdf( x, α, β )\n Evaluates the probability density function (PDF) for a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.pareto1.pdf( 4.0, 1.0, 1.0 )\n ~0.063\n > y = base.dists.pareto1.pdf( 20.0, 1.0, 10.0 )\n 0.025\n > y = base.dists.pareto1.pdf( 7.0, 2.0, 6.0 )\n ~0.21\n > y = base.dists.pareto1.pdf( 7.0, 6.0, 3.0 )\n ~0.005\n > y = base.dists.pareto1.pdf( 1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.pareto1.pdf( 1.5, 4.0, 2.0 )\n 0.0\n\n > y = base.dists.pareto1.pdf( 0.5, -1.0, 0.5 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, 0.5, -1.0 )\n NaN\n\n > y = base.dists.pareto1.pdf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.pdf( 0.5, 1.0, NaN )\n NaN\n\n\nbase.dists.pareto1.pdf.factory( α, β )\n Returns a function for evaluating the probability density function (PDF) of\n a Pareto (Type I) distribution with shape parameter `α` and scale parameter\n `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.pareto1.pdf.factory( 0.5, 0.5 );\n > var y = myPDF( 0.8 )\n ~0.494\n > y = myPDF( 2.0 )\n ~0.125\n\n",
"base.dists.pareto1.quantile": "\nbase.dists.pareto1.quantile( p, α, β )\n Evaluates the quantile function for a Pareto (Type I) distribution with\n shape parameter `α` and scale parameter `β` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.pareto1.quantile( 0.8, 2.0, 1.0 )\n ~2.236\n > y = base.dists.pareto1.quantile( 0.8, 1.0, 10.0 )\n ~50.0\n > y = base.dists.pareto1.quantile( 0.1, 1.0, 10.0 )\n ~11.111\n\n > y = base.dists.pareto1.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.pareto1.quantile( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, NaN, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, 1.0, NaN )\n NaN\n\n > y = base.dists.pareto1.quantile( 0.5, -1.0, 1.0 )\n NaN\n > y = base.dists.pareto1.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.pareto1.quantile.factory( α, β )\n Returns a function for evaluating the quantile function of a Pareto (Type I)\n distribution with shape parameter `α` and scale parameter `β`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.pareto1.quantile.factory( 2.5, 0.5 );\n > var y = myQuantile( 0.5 )\n ~0.66\n > y = myQuantile( 0.8 )\n ~0.952\n\n",
"base.dists.pareto1.skewness": "\nbase.dists.pareto1.skewness( α, β )\n Returns the skewness of a Pareto (Type I) distribution.\n\n If `α <= 3` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.pareto1.skewness( 3.5, 1.0 )\n ~11.784\n > v = base.dists.pareto1.skewness( 4.0, 12.0 )\n ~7.071\n > v = base.dists.pareto1.skewness( 8.0, 2.0 )\n ~3.118\n\n",
"base.dists.pareto1.variance": "\nbase.dists.pareto1.variance( α, β )\n Returns the variance of a Pareto (Type I) distribution.\n\n If `0 < α <= 2` and `β > 0`, the function returns positive infinity.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.pareto1.variance( 0.8, 1.0 )\n Infinity\n > v = base.dists.pareto1.variance( 4.0, 12.0 )\n 32.0\n > v = base.dists.pareto1.variance( 8.0, 2.0 )\n ~0.109\n\n",
"base.dists.poisson.cdf": "\nbase.dists.poisson.cdf( x, λ )\n Evaluates the cumulative distribution function (CDF) for a Poisson\n distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.poisson.cdf( 2.0, 0.5 )\n ~0.986\n > y = base.dists.poisson.cdf( 2.0, 10.0 )\n ~0.003\n > y = base.dists.poisson.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.poisson.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.poisson.cdf( 0.0, NaN )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.poisson.cdf( 0.0, 0.0 )\n 1.0\n > y = base.dists.poisson.cdf( 10.0, 0.0 )\n 1.0\n\n\nbase.dists.poisson.cdf.factory( λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.poisson.cdf.factory( 5.0 );\n > var y = mycdf( 3.0 )\n ~0.265\n > y = mycdf( 8.0 )\n ~0.932\n\n",
"base.dists.poisson.entropy": "\nbase.dists.poisson.entropy( λ )\n Returns the entropy of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.poisson.entropy( 11.0 )\n ~2.61\n > v = base.dists.poisson.entropy( 4.5 )\n ~2.149\n\n",
"base.dists.poisson.kurtosis": "\nbase.dists.poisson.kurtosis( λ )\n Returns the excess kurtosis of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.poisson.kurtosis( 11.0 )\n ~0.091\n > v = base.dists.poisson.kurtosis( 4.5 )\n ~0.222\n\n",
"base.dists.poisson.logpmf": "\nbase.dists.poisson.logpmf( x, λ )\n Evaluates the natural logarithm of the probability mass function (PMF) for a\n Poisson distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated logPMF.\n\n Examples\n --------\n > var y = base.dists.poisson.logpmf( 4.0, 3.0 )\n ~-1.784\n > y = base.dists.poisson.logpmf( 1.0, 3.0 )\n ~-1.901\n > y = base.dists.poisson.logpmf( -1.0, 2.0 )\n -Infinity\n > y = base.dists.poisson.logpmf( 0.0, NaN )\n NaN\n > y = base.dists.poisson.logpmf( NaN, 0.5 )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.logpmf( 2.0, -0.5 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.logpmf( 2.0, 0.0 )\n -Infinity\n > y = base.dists.poisson.logpmf( 0.0, 0.0 )\n 0.0\n\n\nbase.dists.poisson.logpmf.factory( λ )\n Returns a function for evaluating the natural logarithm of the probability\n mass function (PMF) of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n logpmf: Function\n Logarithm of probability mass function (PMF).\n\n Examples\n --------\n > var mylogpmf = base.dists.poisson.logpmf.factory( 1.0 );\n > var y = mylogpmf( 3.0 )\n ~-2.792\n > y = mylogpmf( 1.0 )\n ~-1.0\n\n",
"base.dists.poisson.mean": "\nbase.dists.poisson.mean( λ )\n Returns the expected value of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.poisson.mean( 11.0 )\n 11.0\n > v = base.dists.poisson.mean( 4.5 )\n 4.5\n\n",
"base.dists.poisson.median": "\nbase.dists.poisson.median( λ )\n Returns the median of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: integer\n Median.\n\n Examples\n --------\n > var v = base.dists.poisson.median( 11.0 )\n 11\n > v = base.dists.poisson.median( 4.5 )\n 4\n\n",
"base.dists.poisson.mode": "\nbase.dists.poisson.mode( λ )\n Returns the mode of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: integer\n Mode.\n\n Examples\n --------\n > var v = base.dists.poisson.mode( 11.0 )\n 11\n > v = base.dists.poisson.mode( 4.5 )\n 4\n\n",
"base.dists.poisson.pmf": "\nbase.dists.poisson.pmf( x, λ )\n Evaluates the probability mass function (PMF) for a Poisson\n distribution with mean parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated PMF.\n\n Examples\n --------\n > var y = base.dists.poisson.pmf( 4.0, 3.0 )\n ~0.168\n > y = base.dists.poisson.pmf( 1.0, 3.0 )\n ~0.149\n > y = base.dists.poisson.pmf( -1.0, 2.0 )\n 0.0\n > y = base.dists.poisson.pmf( 0.0, NaN )\n NaN\n > y = base.dists.poisson.pmf( NaN, 0.5 )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.pmf( 2.0, -0.5 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.pmf( 2.0, 0.0 )\n 0.0\n > y = base.dists.poisson.pmf( 0.0, 0.0 )\n 1.0\n\n\nbase.dists.poisson.pmf.factory( λ )\n Returns a function for evaluating the probability mass function (PMF)\n of a Poisson distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n pmf: Function\n Probability mass function (PMF).\n\n Examples\n --------\n > var mypmf = base.dists.poisson.pmf.factory( 1.0 );\n > var y = mypmf( 3.0 )\n ~0.061\n > y = mypmf( 1.0 )\n ~0.368\n\n",
"base.dists.poisson.Poisson": "\nbase.dists.poisson.Poisson( [λ] )\n Returns a Poisson distribution object.\n\n Parameters\n ----------\n λ: number (optional)\n Mean parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n poisson: Object\n Distribution instance.\n\n poisson.lambda: number\n Mean parameter. If set, the value must be greater than `0`.\n\n poisson.entropy: number\n Read-only property which returns the differential entropy.\n\n poisson.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n poisson.mean: number\n Read-only property which returns the expected value.\n\n poisson.median: number\n Read-only property which returns the median.\n\n poisson.mode: number\n Read-only property which returns the mode.\n\n poisson.skewness: number\n Read-only property which returns the skewness.\n\n poisson.stdev: number\n Read-only property which returns the standard deviation.\n\n poisson.variance: number\n Read-only property which returns the variance.\n\n poisson.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n poisson.logpmf: Function\n Evaluates the natural logarithm of the probability mass function (PMF).\n\n poisson.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n poisson.pmf: Function\n Evaluates the probability mass function (PMF).\n\n poisson.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var poisson = base.dists.poisson.Poisson( 6.0 );\n > poisson.lambda\n 6.0\n > poisson.entropy\n ~2.3\n > poisson.kurtosis\n ~0.167\n > poisson.mean\n 6.0\n > poisson.median\n 6.0\n > poisson.mode\n 6.0\n > poisson.skewness\n ~0.408\n > poisson.stdev\n ~2.449\n > poisson.variance\n 6.0\n > poisson.cdf( 4.0 )\n ~0.285\n > poisson.logpmf( 2.0 )\n ~-3.11\n > poisson.mgf( 0.5 )\n ~49.025\n > poisson.pmf( 2.0 )\n ~0.045\n > poisson.quantile( 0.5 )\n 6.0\n\n",
"base.dists.poisson.quantile": "\nbase.dists.poisson.quantile( p, λ )\n Evaluates the quantile function for a Poisson distribution with mean\n parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.poisson.quantile( 0.5, 2.0 )\n 2\n > y = base.dists.poisson.quantile( 0.9, 4.0 )\n 7\n > y = base.dists.poisson.quantile( 0.1, 200.0 )\n 182\n\n > y = base.dists.poisson.quantile( 1.1, 0.0 )\n NaN\n > y = base.dists.poisson.quantile( -0.2, 0.0 )\n NaN\n\n > y = base.dists.poisson.quantile( NaN, 0.5 )\n NaN\n > y = base.dists.poisson.quantile( 0.0, NaN )\n NaN\n\n // Negative mean parameter:\n > y = base.dists.poisson.quantile( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution at `λ = 0`:\n > y = base.dists.poisson.quantile( 0.1, 0.0 )\n 0.0\n > y = base.dists.poisson.quantile( 0.9, 0.0 )\n 0.0\n\n\nbase.dists.poisson.quantile.factory( λ )\n Returns a function for evaluating the quantile function of a Poisson\n distribution with mean parameter `λ`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.poisson.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n 0.0\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.poisson.skewness": "\nbase.dists.poisson.skewness( λ )\n Returns the skewness of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.poisson.skewness( 11.0 )\n ~0.302\n > v = base.dists.poisson.skewness( 4.5 )\n ~0.471\n\n",
"base.dists.poisson.stdev": "\nbase.dists.poisson.stdev( λ )\n Returns the standard deviation of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.poisson.stdev( 11.0 )\n ~3.317\n > v = base.dists.poisson.stdev( 4.5 )\n ~2.121\n\n",
"base.dists.poisson.variance": "\nbase.dists.poisson.variance( λ )\n Returns the variance of a Poisson distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.poisson.variance( 11.0 )\n 11.0\n > v = base.dists.poisson.variance( 4.5 )\n 4.5\n\n",
"base.dists.rayleigh.cdf": "\nbase.dists.rayleigh.cdf( x, sigma )\n Evaluates the cumulative distribution function (CDF) for a Rayleigh\n distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.cdf( 2.0, 3.0 )\n ~0.199\n > y = base.dists.rayleigh.cdf( 1.0, 2.0 )\n ~0.118\n > y = base.dists.rayleigh.cdf( -1.0, 4.0 )\n 0.0\n > y = base.dists.rayleigh.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.cdf( 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.cdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `sigma = 0.0`:\n > y = base.dists.rayleigh.cdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.rayleigh.cdf( 0.0, 0.0 )\n 1.0\n > y = base.dists.rayleigh.cdf( 2.0, 0.0 )\n 1.0\n\n\nbase.dists.rayleigh.cdf.factory( sigma )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.rayleigh.cdf.factory( 0.5 );\n > var y = myCDF( 1.0 )\n ~0.865\n > y = myCDF( 0.5 )\n ~0.393\n\n",
"base.dists.rayleigh.entropy": "\nbase.dists.rayleigh.entropy( σ )\n Returns the differential entropy of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.rayleigh.entropy( 11.0 )\n ~3.34\n > v = base.dists.rayleigh.entropy( 4.5 )\n ~2.446\n\n",
"base.dists.rayleigh.kurtosis": "\nbase.dists.rayleigh.kurtosis( σ )\n Returns the excess kurtosis of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.rayleigh.kurtosis( 11.0 )\n ~0.245\n > v = base.dists.rayleigh.kurtosis( 4.5 )\n ~0.245\n\n",
"base.dists.rayleigh.logcdf": "\nbase.dists.rayleigh.logcdf( x, sigma )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Rayleigh distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.logcdf( 2.0, 3.0 )\n ~-1.613\n > y = base.dists.rayleigh.logcdf( 1.0, 2.0 )\n ~-2.141\n > y = base.dists.rayleigh.logcdf( -1.0, 4.0 )\n -Infinity\n > y = base.dists.rayleigh.logcdf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.logcdf( 0.0, NaN )\n NaN\n // Negative scale parameter:\n > y = base.dists.rayleigh.logcdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.logcdf.factory( sigma )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Rayleigh distribution with scale parameter\n `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.rayleigh.logcdf.factory( 0.5 );\n > var y = mylogcdf( 1.0 )\n ~-0.145\n > y = mylogcdf( 0.5 )\n ~-0.933\n\n",
"base.dists.rayleigh.logpdf": "\nbase.dists.rayleigh.logpdf( x, sigma )\n Evaluates the logarithm of the probability density function (PDF) for a\n Rayleigh distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.logpdf( 0.3, 1.0 )\n ~-1.249\n > y = base.dists.rayleigh.logpdf( 2.0, 0.8 )\n ~-1.986\n > y = base.dists.rayleigh.logpdf( -1.0, 0.5 )\n -Infinity\n > y = base.dists.rayleigh.logpdf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.logpdf( NaN, 2.0 )\n NaN\n // Negative scale parameter:\n > y = base.dists.rayleigh.logpdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.logpdf.factory( sigma )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.rayleigh.logpdf.factory( 4.0 );\n > var y = mylogpdf( 6.0 )\n ~-2.106\n > y = mylogpdf( 4.0 )\n ~-1.886\n\n",
"base.dists.rayleigh.mean": "\nbase.dists.rayleigh.mean( σ )\n Returns the expected value of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.rayleigh.mean( 11.0 )\n ~13.786\n > v = base.dists.rayleigh.mean( 4.5 )\n ~5.64\n\n",
"base.dists.rayleigh.median": "\nbase.dists.rayleigh.median( σ )\n Returns the median of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.rayleigh.median( 11.0 )\n ~12.952\n > v = base.dists.rayleigh.median( 4.5 )\n ~5.298\n\n",
"base.dists.rayleigh.mgf": "\nbase.dists.rayleigh.mgf( t, sigma )\n Evaluates the moment-generating function (MGF) for a Rayleigh distribution\n with scale parameter `sigma` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.mgf( 1.0, 3.0 )\n ~678.508\n > y = base.dists.rayleigh.mgf( 1.0, 2.0 )\n ~38.65\n > y = base.dists.rayleigh.mgf( -1.0, 4.0 )\n ~-0.947\n > y = base.dists.rayleigh.mgf( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.mgf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.mgf( 0.5, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.mgf.factory( sigma )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.rayleigh.mgf.factory( 0.5 );\n > var y = myMGF( 1.0 )\n ~2.715\n > y = myMGF( 0.5 )\n ~1.888\n\n",
"base.dists.rayleigh.mode": "\nbase.dists.rayleigh.mode( σ )\n Returns the mode of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.rayleigh.mode( 11.0 )\n 11.0\n > v = base.dists.rayleigh.mode( 4.5 )\n 4.5\n\n",
"base.dists.rayleigh.pdf": "\nbase.dists.rayleigh.pdf( x, sigma )\n Evaluates the probability density function (PDF) for a Rayleigh\n distribution with scale parameter `sigma` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative value for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.rayleigh.pdf( 0.3, 1.0 )\n ~0.287\n > y = base.dists.rayleigh.pdf( 2.0, 0.8 )\n ~0.137\n > y = base.dists.rayleigh.pdf( -1.0, 0.5 )\n 0.0\n > y = base.dists.rayleigh.pdf( 0.0, NaN )\n NaN\n > y = base.dists.rayleigh.pdf( NaN, 2.0 )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.pdf( 2.0, -1.0 )\n NaN\n\n // Degenerate distribution when `sigma = 0.0`:\n > y = base.dists.rayleigh.pdf( -2.0, 0.0 )\n 0.0\n > y = base.dists.rayleigh.pdf( 0.0, 0.0 )\n Infinity\n > y = base.dists.rayleigh.pdf( 2.0, 0.0 )\n 0.0\n\n\nbase.dists.rayleigh.pdf.factory( sigma )\n Returns a function for evaluating the probability density function (PDF) of\n a Rayleigh distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.rayleigh.pdf.factory( 4.0 );\n > var y = myPDF( 6.0 )\n ~0.122\n > y = myPDF( 4.0 )\n ~0.152\n\n",
"base.dists.rayleigh.quantile": "\nbase.dists.rayleigh.quantile( p, sigma )\n Evaluates the quantile function for a Rayleigh distribution with scale\n parameter `sigma` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a negative probability for `sigma`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n sigma: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.rayleigh.quantile( 0.8, 1.0 )\n ~1.794\n > y = base.dists.rayleigh.quantile( 0.5, 4.0 )\n ~4.71\n\n > y = base.dists.rayleigh.quantile( 1.1, 1.0 )\n NaN\n > y = base.dists.rayleigh.quantile( -0.2, 1.0 )\n NaN\n\n > y = base.dists.rayleigh.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.rayleigh.quantile( 0.0, NaN )\n NaN\n\n // Negative scale parameter:\n > y = base.dists.rayleigh.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.rayleigh.quantile.factory( sigma )\n Returns a function for evaluating the quantile function of a Rayleigh\n distribution with scale parameter `sigma`.\n\n Parameters\n ----------\n sigma: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.rayleigh.quantile.factory( 0.4 );\n > var y = myQuantile( 0.4 )\n ~0.404\n > y = myQuantile( 1.0 )\n Infinity\n\n",
"base.dists.rayleigh.Rayleigh": "\nbase.dists.rayleigh.Rayleigh( [σ] )\n Returns a Rayleigh distribution object.\n\n Parameters\n ----------\n σ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n rayleigh: Object\n Distribution instance.\n\n rayleigh.sigma: number\n Scale parameter. If set, the value must be greater than `0`.\n\n rayleigh.entropy: number\n Read-only property which returns the differential entropy.\n\n rayleigh.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n rayleigh.mean: number\n Read-only property which returns the expected value.\n\n rayleigh.median: number\n Read-only property which returns the median.\n\n rayleigh.mode: number\n Read-only property which returns the mode.\n\n rayleigh.skewness: number\n Read-only property which returns the skewness.\n\n rayleigh.stdev: number\n Read-only property which returns the standard deviation.\n\n rayleigh.variance: number\n Read-only property which returns the variance.\n\n rayleigh.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n rayleigh.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n rayleigh.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n rayleigh.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n rayleigh.pdf: Function\n Evaluates the probability density function (PDF).\n\n rayleigh.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var rayleigh = base.dists.rayleigh.Rayleigh( 6.0 );\n > rayleigh.sigma\n 6.0\n > rayleigh.entropy\n ~2.734\n > rayleigh.kurtosis\n ~0.245\n > rayleigh.mean\n ~7.52\n > rayleigh.median\n ~7.064\n > rayleigh.mode\n 6.0\n > rayleigh.skewness\n ~0.631\n > rayleigh.stdev\n ~3.931\n > rayleigh.variance\n ~15.451\n > rayleigh.cdf( 1.0 )\n ~0.014\n > rayleigh.logcdf( 1.0 )\n ~-4.284\n > rayleigh.logpdf( 1.5 )\n ~-3.209\n > rayleigh.mgf( -0.5 )\n ~-0.91\n > rayleigh.pdf( 1.5 )\n ~0.04\n > rayleigh.quantile( 0.5 )\n ~7.064\n\n",
"base.dists.rayleigh.skewness": "\nbase.dists.rayleigh.skewness( σ )\n Returns the skewness of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.rayleigh.skewness( 11.0 )\n ~0.631\n > v = base.dists.rayleigh.skewness( 4.5 )\n ~0.631\n\n",
"base.dists.rayleigh.stdev": "\nbase.dists.rayleigh.stdev( σ )\n Returns the standard deviation of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.rayleigh.stdev( 9.0 )\n ~5.896\n > v = base.dists.rayleigh.stdev( 4.5 )\n ~2.948\n\n",
"base.dists.rayleigh.variance": "\nbase.dists.rayleigh.variance( σ )\n Returns the variance of a Rayleigh distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `σ < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.rayleigh.variance( 9.0 )\n ~34.765\n > v = base.dists.rayleigh.variance( 4.5 )\n ~8.691\n\n",
"base.dists.t.cdf": "\nbase.dists.t.cdf( x, v )\n Evaluates the cumulative distribution function (CDF) for a Student's t\n distribution with degrees of freedom `v` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.t.cdf( 2.0, 0.1 )\n ~0.611\n > y = base.dists.t.cdf( 1.0, 2.0 )\n ~0.789\n > y = base.dists.t.cdf( -1.0, 4.0 )\n ~0.187\n > y = base.dists.t.cdf( NaN, 1.0 )\n NaN\n > y = base.dists.t.cdf( 0.0, NaN )\n NaN\n > y = base.dists.t.cdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.t.cdf.factory( v )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Student's t distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.t.cdf.factory( 0.5 );\n > var y = mycdf( 3.0 )\n ~0.816\n > y = mycdf( 1.0 )\n ~0.699\n\n",
"base.dists.t.entropy": "\nbase.dists.t.entropy( v )\n Returns the differential entropy of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.t.entropy( 11.0 )\n ~1.512\n > v = base.dists.t.entropy( 4.5 )\n ~1.652\n\n",
"base.dists.t.kurtosis": "\nbase.dists.t.kurtosis( v )\n Returns the excess kurtosis of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 2`, the function returns `NaN`.\n\n If provided `2 < v <= 4`, the function returns positive infinity.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.t.kurtosis( 11.0 )\n ~0.857\n > v = base.dists.t.kurtosis( 4.5 )\n 12.0\n\n",
"base.dists.t.mean": "\nbase.dists.t.mean( v )\n Returns the expected value of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.t.mean( 11.0 )\n 0.0\n > v = base.dists.t.mean( 4.5 )\n 0.0\n\n",
"base.dists.t.median": "\nbase.dists.t.median( v )\n Returns the median of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.t.median( 11.0 )\n 0.0\n > v = base.dists.t.median( 4.5 )\n 0.0\n\n",
"base.dists.t.mode": "\nbase.dists.t.mode( v )\n Returns the mode of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v < 0`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.t.mode( 11.0 )\n 0.0\n > v = base.dists.t.mode( 4.5 )\n 0.0\n\n",
"base.dists.t.pdf": "\nbase.dists.t.pdf( x, v )\n Evaluates the probability density function (PDF) for a Student's t\n distribution with degrees of freedom `v` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.t.pdf( 0.3, 4.0 )\n ~0.355\n > y = base.dists.t.pdf( 2.0, 0.7 )\n ~0.058\n > y = base.dists.t.pdf( -1.0, 0.5 )\n ~0.118\n > y = base.dists.t.pdf( 0.0, NaN )\n NaN\n > y = base.dists.t.pdf( NaN, 2.0 )\n NaN\n > y = base.dists.t.pdf( 2.0, -1.0 )\n NaN\n\n\nbase.dists.t.pdf.factory( v )\n Returns a function for evaluating the probability density function (PDF)\n of a Student's t distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.t.pdf.factory( 3.0 );\n > var y = myPDF( 1.0 )\n ~0.207\n\n",
"base.dists.t.quantile": "\nbase.dists.t.quantile( p, v )\n Evaluates the quantile function for a Student's t distribution with degrees\n of freedom `v` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `v`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.t.quantile( 0.8, 1.0 )\n ~1.376\n > y = base.dists.t.quantile( 0.1, 1.0 )\n ~-3.078\n > y = base.dists.t.quantile( 0.5, 0.1 )\n 0.0\n\n > y = base.dists.t.quantile( -0.2, 0.1 )\n NaN\n\n > y = base.dists.t.quantile( NaN, 1.0 )\n NaN\n > y = base.dists.t.quantile( 0.0, NaN )\n NaN\n\n > y = base.dists.t.quantile( 0.5, -1.0 )\n NaN\n\n\nbase.dists.t.quantile.factory( v )\n Returns a function for evaluating the quantile function of a Student's t\n distribution with degrees of freedom `v`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.t.quantile.factory( 4.0 );\n > var y = myQuantile( 0.2 )\n ~-0.941\n > y = myQuantile( 0.9 )\n ~1.533\n\n",
"base.dists.t.skewness": "\nbase.dists.t.skewness( v )\n Returns the skewness of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `v <= 3`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.t.skewness( 11.0 )\n 0.0\n > v = base.dists.t.skewness( 4.5 )\n 0.0\n\n",
"base.dists.t.stdev": "\nbase.dists.t.stdev( v )\n Returns the standard deviation of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `1 < v <= 2`, the function returns positive infinity.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.t.stdev( 9.0 )\n ~1.134\n > v = base.dists.t.stdev( 4.5 )\n ~1.342\n\n",
"base.dists.t.T": "\nbase.dists.t.T( [v] )\n Returns a Student's t distribution object.\n\n Parameters\n ----------\n v: number (optional)\n Degrees of freedom. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n t: Object\n Distribution instance.\n\n t.v: number\n Degrees of freedom. If set, the value must be greater than `0`.\n\n t.entropy: number\n Read-only property which returns the differential entropy.\n\n t.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n t.mean: number\n Read-only property which returns the expected value.\n\n t.median: number\n Read-only property which returns the median.\n\n t.mode: number\n Read-only property which returns the mode.\n\n t.skewness: number\n Read-only property which returns the skewness.\n\n t.stdev: number\n Read-only property which returns the standard deviation.\n\n t.variance: number\n Read-only property which returns the variance.\n\n t.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n t.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n t.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n t.pdf: Function\n Evaluates the probability density function (PDF).\n\n t.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var t = base.dists.t.T( 6.0 );\n > t.v\n 6.0\n > t.entropy\n ~1.592\n > t.kurtosis\n 3.0\n > t.mean\n 0.0\n > t.median\n 0.0\n > t.mode\n 0.0\n > t.skewness\n 0.0\n > t.stdev\n ~1.225\n > t.variance\n 1.5\n > t.cdf( 1.0 )\n ~0.822\n > t.logcdf( 1.0 )\n ~-0.196\n > t.logpdf( 1.5 )\n ~-2.075\n > t.pdf( 1.5 )\n ~0.126\n > t.quantile( 0.8 )\n ~0.906\n\n",
"base.dists.t.variance": "\nbase.dists.t.variance( v )\n Returns the variance of a Student's t distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `1 < v <= 2`, the function returns positive infinity.\n\n If provided `v <= 1`, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.t.variance( 9.0 )\n ~1.286\n > v = base.dists.t.variance( 4.5 )\n ~1.8\n\n",
"base.dists.triangular.cdf": "\nbase.dists.triangular.cdf( x, a, b, c )\n Evaluates the cumulative distribution function (CDF) for a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c` at\n a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.triangular.cdf( 0.5, -1.0, 1.0, 0.0 )\n 0.875\n > y = base.dists.triangular.cdf( 0.5, -1.0, 1.0, 0.5 )\n 0.75\n > y = base.dists.triangular.cdf( -10.0, -20.0, 0.0, -2.0 )\n ~0.278\n > y = base.dists.triangular.cdf( -2.0, -1.0, 1.0, 0.0 )\n 0.0\n > y = base.dists.triangular.cdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.cdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.cdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.cdf.factory( a, b, c )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a triangular distribution with minimum support `a`, maximum support `b`,\n and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.triangular.cdf.factory( 0.0, 10.0, 2.0 );\n > var y = mycdf( 0.5 )\n 0.0125\n > y = mycdf( 8.0 )\n 0.95\n\n\n",
"base.dists.triangular.entropy": "\nbase.dists.triangular.entropy( a, b, c )\n Returns the differential entropy of a triangular distribution (in nats).\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.triangular.entropy( 0.0, 1.0, 0.8 )\n ~-0.193\n > v = base.dists.triangular.entropy( 4.0, 12.0, 5.0 )\n ~1.886\n > v = base.dists.triangular.entropy( 2.0, 8.0, 5.0 )\n ~1.599\n\n",
"base.dists.triangular.kurtosis": "\nbase.dists.triangular.kurtosis( a, b, c )\n Returns the excess kurtosis of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.triangular.kurtosis( 0.0, 1.0, 0.8 )\n -0.6\n > v = base.dists.triangular.kurtosis( 4.0, 12.0, 5.0 )\n -0.6\n > v = base.dists.triangular.kurtosis( 2.0, 8.0, 5.0 )\n -0.6\n\n",
"base.dists.triangular.logcdf": "\nbase.dists.triangular.logcdf( x, a, b, c )\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF) for a triangular distribution with minimum support `a`, maximum\n support `b`, and mode `c` at a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.triangular.logcdf( 0.5, -1.0, 1.0, 0.0 )\n ~-0.134\n > y = base.dists.triangular.logcdf( 0.5, -1.0, 1.0, 0.5 )\n ~-0.288\n > y = base.dists.triangular.logcdf( -10.0, -20.0, 0.0, -2.0 )\n ~-1.281\n > y = base.dists.triangular.logcdf( -2.0, -1.0, 1.0, 0.0 )\n -Infinity\n > y = base.dists.triangular.logcdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.logcdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.logcdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.logcdf.factory( a, b, c )\n Returns a function for evaluating the natural logarithm of the cumulative\n distribution function (CDF) of a triangular distribution with minimum\n support `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n cdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.triangular.logcdf.factory( 0.0, 10.0, 2.0 );\n > var y = mylogcdf( 0.5 )\n ~-4.382\n > y = mylogcdf( 8.0 )\n ~-0.051\n\n\n",
"base.dists.triangular.logpdf": "\nbase.dists.triangular.logpdf( x, a, b, c )\n Evaluates the natural logarithm of the probability density function (PDF)\n for a triangular distribution with minimum support `a`, maximum support `b`,\n and mode `c` at a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.triangular.logpdf( 0.5, -1.0, 1.0, 0.0 )\n ~-0.693\n > y = base.dists.triangular.logpdf( 0.5, -1.0, 1.0, 0.5 )\n 0.0\n > y = base.dists.triangular.logpdf( -10.0, -20.0, 0.0, -2.0 )\n ~-2.89\n > y = base.dists.triangular.logpdf( -2.0, -1.0, 1.0, 0.0 )\n -Infinity\n > y = base.dists.triangular.logpdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.logpdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.logpdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.logpdf.factory( a, b, c )\n Returns a function for evaluating the natural logarithm of the probability\n density function (PDF) of a triangular distribution with minimum support\n `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogpdf = base.dists.triangular.logpdf.factory( 0.0, 10.0, 5.0 );\n > var y = mylogpdf( 2.0 )\n ~-2.526\n > y = mylogpdf( 12.0 )\n -Infinity\n\n\n",
"base.dists.triangular.mean": "\nbase.dists.triangular.mean( a, b, c )\n Returns the expected value of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.triangular.mean( 0.0, 1.0, 0.8 )\n ~0.6\n > v = base.dists.triangular.mean( 4.0, 12.0, 5.0 )\n 7.0\n > v = base.dists.triangular.mean( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.median": "\nbase.dists.triangular.median( a, b, c )\n Returns the median of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.triangular.median( 0.0, 1.0, 0.8 )\n ~0.632\n > v = base.dists.triangular.median( 4.0, 12.0, 5.0 )\n ~6.708\n > v = base.dists.triangular.median( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.mgf": "\nbase.dists.triangular.mgf( t, a, b, c )\n Evaluates the moment-generating function (MGF) for a triangular distribution\n with minimum support `a`, maximum support `b`, and mode `c` at a value `t`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.triangular.mgf( 0.5, -1.0, 1.0, 0.0 )\n ~1.021\n > y = base.dists.triangular.mgf( 0.5, -1.0, 1.0, 0.5 )\n ~1.111\n > y = base.dists.triangular.mgf( -0.3, -20.0, 0.0, -2.0 )\n ~24.334\n > y = base.dists.triangular.mgf( -2.0, -1.0, 1.0, 0.0 )\n ~1.381\n > y = base.dists.triangular.mgf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.mgf( 0.5, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.mgf( 0.5, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.mgf.factory( a, b, c )\n Returns a function for evaluating the moment-generating function (MGF) of a\n triangular distribution with minimum support `a`, maximum support `b`, and\n mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.triangular.mgf.factory( 0.0, 2.0, 1.0 );\n > var y = mymgf( -1.0 )\n ~0.3996\n > y = mymgf( 2.0 )\n ~10.205\n\n\n",
"base.dists.triangular.mode": "\nbase.dists.triangular.mode( a, b, c )\n Returns the mode of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.triangular.mode( 0.0, 1.0, 0.8 )\n 0.8\n > v = base.dists.triangular.mode( 4.0, 12.0, 5.0 )\n 5.0\n > v = base.dists.triangular.mode( 2.0, 8.0, 5.0 )\n 5.0\n\n",
"base.dists.triangular.pdf": "\nbase.dists.triangular.pdf( x, a, b, c )\n Evaluates the probability density function (PDF) for a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c` at\n a value `x`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.triangular.pdf( 0.5, -1.0, 1.0, 0.0 )\n 0.5\n > y = base.dists.triangular.pdf( 0.5, -1.0, 1.0, 0.5 )\n 1.0\n > y = base.dists.triangular.pdf( -10.0, -20.0, 0.0, -2.0 )\n ~0.056\n > y = base.dists.triangular.pdf( -2.0, -1.0, 1.0, 0.0 )\n 0.0\n > y = base.dists.triangular.pdf( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 0.0, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 0.0, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.pdf( 2.0, 1.0, 0.0, NaN )\n NaN\n > y = base.dists.triangular.pdf( 2.0, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.pdf.factory( a, b, c )\n Returns a function for evaluating the probability density function (PDF) of\n a triangular distribution with minimum support `a`, maximum support `b`, and\n mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var mypdf = base.dists.triangular.pdf.factory( 0.0, 10.0, 5.0 );\n > var y = mypdf( 2.0 )\n 0.08\n > y = mypdf( 12.0 )\n 0.0\n\n\n",
"base.dists.triangular.quantile": "\nbase.dists.triangular.quantile( p, a, b, c )\n Evaluates the quantile function for a triangular distribution with minimum\n support `a`, maximum support `b`, and mode `c` at a value `x`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.triangular.quantile( 0.9, -1.0, 1.0, 0.0 )\n ~0.553\n > y = base.dists.triangular.quantile( 0.1, -1.0, 1.0, 0.5 )\n ~-0.452\n > y = base.dists.triangular.quantile( 0.1, -20.0, 0.0, -2.0 )\n -14.0\n > y = base.dists.triangular.quantile( 0.8, 0.0, 20.0, 0.0 )\n ~11.056\n\n > y = base.dists.triangular.quantile( 1.1, -1.0, 1.0, 0.0 )\n NaN\n > y = base.dists.triangular.quantile( -0.1, -1.0, 1.0, 0.0 )\n NaN\n\n > y = base.dists.triangular.quantile( NaN, 0.0, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, NaN, 1.0, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, 0.0, NaN, 0.5 )\n NaN\n > y = base.dists.triangular.quantile( 0.3, 1.0, 0.0, NaN )\n NaN\n\n > y = base.dists.triangular.quantile( 0.3, 1.0, 0.0, 1.5 )\n NaN\n\n\nbase.dists.triangular.quantile.factory( a, b, c )\n Returns a function for evaluating the quantile function of a triangular\n distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myquantile = base.dists.triangular.quantile.factory( 2.0, 4.0, 2.5 );\n > var y = myquantile( 0.4 )\n ~2.658\n > y = myquantile( 0.8 )\n ~3.225\n\n\n",
"base.dists.triangular.skewness": "\nbase.dists.triangular.skewness( a, b, c )\n Returns the skewness of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.triangular.skewness( 0.0, 1.0, 0.8 )\n ~-0.476\n > v = base.dists.triangular.skewness( 4.0, 12.0, 5.0 )\n ~0.532\n > v = base.dists.triangular.skewness( 2.0, 8.0, 5.0 )\n 0.0\n\n",
"base.dists.triangular.stdev": "\nbase.dists.triangular.stdev( a, b, c )\n Returns the standard deviation of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.triangular.stdev( 0.0, 1.0, 0.8 )\n ~0.216\n > v = base.dists.triangular.stdev( 4.0, 12.0, 5.0 )\n ~1.78\n > v = base.dists.triangular.stdev( 2.0, 8.0, 5.0 )\n ~1.225\n\n",
"base.dists.triangular.Triangular": "\nbase.dists.triangular.Triangular( [a, b, c] )\n Returns a triangular distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be smaller than `b` and `c`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a` and `c`. Default: `1.0`.\n\n c: number (optional)\n Mode. Must be greater than `a` and smaller than `b`. Default: `0.5`.\n\n Returns\n -------\n triangular: Object\n Distribution instance.\n\n triangular.a: number\n Minimum support. If set, the value must be smaller or equal to `b` and\n `c`.\n\n triangular.b: number\n Maximum support. If set, the value must be greater than or equal to `a`\n and `c`.\n\n triangular.c: number\n Mode. If set, the value must be greater than or equal to `a` and smaller\n than or equal to `b`.\n\n triangular.entropy: number\n Read-only property which returns the differential entropy.\n\n triangular.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n triangular.mean: number\n Read-only property which returns the expected value.\n\n triangular.median: number\n Read-only property which returns the median.\n\n triangular.mode: number\n Read-only property which returns the mode.\n\n triangular.skewness: number\n Read-only property which returns the skewness.\n\n triangular.stdev: number\n Read-only property which returns the standard deviation.\n\n triangular.variance: number\n Read-only property which returns the variance.\n\n triangular.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n triangular.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n triangular.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n triangular.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n triangular.pdf: Function\n Evaluates the probability density function (PDF).\n\n triangular.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var triangular = base.dists.triangular.Triangular( 0.0, 1.0, 0.5 );\n > triangular.a\n 0.0\n > triangular.b\n 1.0\n > triangular.c\n 0.5\n > triangular.entropy\n ~-0.193\n > triangular.kurtosis\n -0.6\n > triangular.mean\n 0.5\n > triangular.median\n 0.5\n > triangular.mode\n 0.5\n > triangular.skewness\n 0.0\n > triangular.stdev\n ~0.204\n > triangular.variance\n ~0.042\n > triangular.cdf( 0.8 )\n 0.92\n > triangular.logcdf( 0.8 )\n ~-0.083\n > triangular.logpdf( 0.8 )\n ~-0.223\n > triangular.mgf( 0.8 )\n ~1.512\n > triangular.pdf( 0.8 )\n ~0.8\n > triangular.quantile( 0.8 )\n ~0.684\n\n",
"base.dists.triangular.variance": "\nbase.dists.triangular.variance( a, b, c )\n Returns the variance of a triangular distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.triangular.variance( 0.0, 1.0, 0.8 )\n ~0.047\n > v = base.dists.triangular.variance( 4.0, 12.0, 5.0 )\n ~3.167\n > v = base.dists.triangular.variance( 2.0, 8.0, 5.0 )\n ~1.5\n\n",
"base.dists.uniform.cdf": "\nbase.dists.uniform.cdf( x, a, b )\n Evaluates the cumulative distribution function (CDF) for a uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.uniform.cdf( 9.0, 0.0, 10.0 )\n 0.9\n > y = base.dists.uniform.cdf( 0.5, 0.0, 2.0 )\n 0.25\n > y = base.dists.uniform.cdf( PINF, 2.0, 4.0 )\n 1.0\n > y = base.dists.uniform.cdf( NINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.uniform.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.cdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.uniform.cdf.factory( a, b )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mycdf = base.dists.uniform.cdf.factory( 0.0, 10.0 );\n > var y = mycdf( 0.5 )\n 0.05\n > y = mycdf( 8.0 )\n 0.8\n\n",
"base.dists.uniform.entropy": "\nbase.dists.uniform.entropy( a, b )\n Returns the differential entropy of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Differential entropy.\n\n Examples\n --------\n > var v = base.dists.uniform.entropy( 0.0, 1.0 )\n 0.0\n > v = base.dists.uniform.entropy( 4.0, 12.0 )\n ~2.079\n > v = base.dists.uniform.entropy( 2.0, 8.0 )\n ~1.792\n\n",
"base.dists.uniform.kurtosis": "\nbase.dists.uniform.kurtosis( a, b )\n Returns the excess kurtosis of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.uniform.kurtosis( 0.0, 1.0 )\n -1.2\n > v = base.dists.uniform.kurtosis( 4.0, 12.0 )\n -1.2\n > v = base.dists.uniform.kurtosis( 2.0, 8.0 )\n -1.2\n\n",
"base.dists.uniform.logcdf": "\nbase.dists.uniform.logcdf( x, a, b )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n uniform distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.uniform.logcdf( 9.0, 0.0, 10.0 )\n ~-0.105\n > y = base.dists.uniform.logcdf( 0.5, 0.0, 2.0 )\n ~-1.386\n > y = base.dists.uniform.logcdf( PINF, 2.0, 4.0 )\n 0.0\n > y = base.dists.uniform.logcdf( NINF, 2.0, 4.0 )\n -Infinity\n > y = base.dists.uniform.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.logcdf( 2.0, 1.0, 0.0 )\n NaN\n\n\nbase.dists.uniform.logcdf.factory( a, b )\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a uniform distribution with minimum support\n `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logcdf: Function\n Logarithm of Cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.uniform.logcdf.factory( 0.0, 10.0 );\n > var y = mylogcdf( 0.5 )\n ~-2.996\n > y = mylogcdf( 8.0 )\n ~-0.223\n\n",
"base.dists.uniform.logpdf": "\nbase.dists.uniform.logpdf( x, a, b )\n Evaluates the logarithm of the probability density function (PDF) for a\n uniform distribution with minimum support `a` and maximum support `b` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.uniform.logpdf( 2.0, 0.0, 4.0 )\n ~-1.386\n > y = base.dists.uniform.logpdf( 5.0, 0.0, 4.0 )\n -infinity\n > y = base.dists.uniform.logpdf( 0.25, 0.0, 1.0 )\n 0.0\n > y = base.dists.uniform.logpdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.logpdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.logpdf.factory( a, b )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a uniform distribution with minimum support `a` and\n maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylogPDF = base.dists.uniform.logpdf.factory( 6.0, 7.0 );\n > var y = mylogPDF( 7.0 )\n 0.0\n > y = mylogPDF( 5.0 )\n -infinity\n\n",
"base.dists.uniform.mean": "\nbase.dists.uniform.mean( a, b )\n Returns the expected value of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.uniform.mean( 0.0, 1.0 )\n 0.5\n > v = base.dists.uniform.mean( 4.0, 12.0 )\n 8.0\n > v = base.dists.uniform.mean( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.uniform.median": "\nbase.dists.uniform.median( a, b )\n Returns the median of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.uniform.median( 0.0, 1.0 )\n 0.5\n > v = base.dists.uniform.median( 4.0, 12.0 )\n 8.0\n > v = base.dists.uniform.median( 2.0, 8.0 )\n 5.0\n\n",
"base.dists.uniform.mgf": "\nbase.dists.uniform.mgf( t, a, b )\n Evaluates the moment-generating function (MGF) for a uniform\n distribution with minimum support `a` and maximum support `b` at a value\n `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n t: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.uniform.mgf( 2.0, 0.0, 4.0 )\n ~372.495\n > y = base.dists.uniform.mgf( -0.2, 0.0, 4.0 )\n ~0.688\n > y = base.dists.uniform.mgf( 2.0, 0.0, 1.0 )\n ~3.195\n > y = base.dists.uniform.mgf( 0.5, 3.0, 2.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.5, 3.0, 3.0 )\n NaN\n > y = base.dists.uniform.mgf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.mgf( 0.0, 0.0, NaN )\n NaN\n\n\nbase.dists.uniform.mgf.factory( a, b )\n Returns a function for evaluating the moment-generating function (MGF)\n of a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var mymgf = base.dists.uniform.mgf.factory( 6.0, 7.0 );\n > var y = mymgf( 0.1 )\n ~1.916\n > y = mymgf( 1.1 )\n ~1339.321\n\n",
"base.dists.uniform.pdf": "\nbase.dists.uniform.pdf( x, a, b )\n Evaluates the probability density function (PDF) for a uniform distribution\n with minimum support `a` and maximum support `b` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.uniform.pdf( 2.0, 0.0, 4.0 )\n 0.25\n > y = base.dists.uniform.pdf( 5.0, 0.0, 4.0 )\n 0.0\n > y = base.dists.uniform.pdf( 0.25, 0.0, 1.0 )\n 1.0\n > y = base.dists.uniform.pdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.uniform.pdf( 2.0, 3.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.pdf.factory( a, b )\n Returns a function for evaluating the probability density function (PDF) of\n a uniform distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.uniform.pdf.factory( 6.0, 7.0 );\n > var y = myPDF( 7.0 )\n 1.0\n > y = myPDF( 5.0 )\n 0.0\n\n",
"base.dists.uniform.quantile": "\nbase.dists.uniform.quantile( p, a, b )\n Evaluates the quantile function for a uniform distribution with minimum\n support `a` and maximum support `b` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.uniform.quantile( 0.8, 0.0, 1.0 )\n 0.8\n > y = base.dists.uniform.quantile( 0.5, 0.0, 10.0 )\n 5.0\n\n > y = base.dists.uniform.quantile( 1.1, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( -0.2, 0.0, 1.0 )\n NaN\n\n > y = base.dists.uniform.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.uniform.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.uniform.quantile( 0.5, 2.0, 1.0 )\n NaN\n\n\nbase.dists.uniform.quantile.factory( a, b )\n Returns a function for evaluating the quantile function of a uniform\n distribution with minimum support `a` and maximum support `b`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.uniform.quantile.factory( 0.0, 4.0 );\n > var y = myQuantile( 0.8 )\n 3.2\n\n",
"base.dists.uniform.skewness": "\nbase.dists.uniform.skewness( a, b )\n Returns the skewness of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.uniform.skewness( 0.0, 1.0 )\n 0.0\n > v = base.dists.uniform.skewness( 4.0, 12.0 )\n 0.0\n > v = base.dists.uniform.skewness( 2.0, 8.0 )\n 0.0\n\n",
"base.dists.uniform.stdev": "\nbase.dists.uniform.stdev( a, b )\n Returns the standard deviation of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.uniform.stdev( 0.0, 1.0 )\n ~0.289\n > v = base.dists.uniform.stdev( 4.0, 12.0 )\n ~2.309\n > v = base.dists.uniform.stdev( 2.0, 8.0 )\n ~1.732\n\n",
"base.dists.uniform.Uniform": "\nbase.dists.uniform.Uniform( [a, b] )\n Returns a uniform distribution object.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support. Must be smaller than `b`. Default: `0.0`.\n\n b: number (optional)\n Maximum support. Must be greater than `a`. Default: `1.0`.\n\n Returns\n -------\n uniform: Object\n Distribution instance.\n\n uniform.a: number\n Minimum support. If set, the value must be smaller than `b`.\n\n uniform.b: number\n Maximum support. If set, the value must be greater than `a`.\n\n uniform.entropy: number\n Read-only property which returns the differential entropy.\n\n uniform.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n uniform.mean: number\n Read-only property which returns the expected value.\n\n uniform.median: number\n Read-only property which returns the median.\n\n uniform.skewness: number\n Read-only property which returns the skewness.\n\n uniform.stdev: number\n Read-only property which returns the standard deviation.\n\n uniform.variance: number\n Read-only property which returns the variance.\n\n uniform.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n uniform.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n uniform.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n uniform.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n uniform.pdf: Function\n Evaluates the probability density function (PDF).\n\n uniform.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var uniform = base.dists.uniform.Uniform( 0.0, 1.0 );\n > uniform.a\n 0.0\n > uniform.b\n 1.0\n > uniform.entropy\n 0.0\n > uniform.kurtosis\n -1.2\n > uniform.mean\n 0.5\n > uniform.median\n 0.5\n > uniform.skewness\n 0.0\n > uniform.stdev\n ~0.289\n > uniform.variance\n ~0.083\n > uniform.cdf( 0.8 )\n 0.8\n > uniform.logcdf( 0.5 )\n ~-0.693\n > uniform.logpdf( 1.0 )\n ~-0.0\n > uniform.mgf( 0.8 )\n ~1.532\n > uniform.pdf( 0.8 )\n 1.0\n > uniform.quantile( 0.8 )\n 0.8\n\n",
"base.dists.uniform.variance": "\nbase.dists.uniform.variance( a, b )\n Returns the variance of a uniform distribution.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `a >= b`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.uniform.variance( 0.0, 1.0 )\n ~0.083\n > v = base.dists.uniform.variance( 4.0, 12.0 )\n ~5.333\n > v = base.dists.uniform.variance( 2.0, 8.0 )\n 3.0\n\n",
"base.dists.weibull.cdf": "\nbase.dists.weibull.cdf( x, k, λ )\n Evaluates the cumulative distribution function (CDF) for a Weibull\n distribution with shape parameter `k` and scale parameter `λ` at a value\n `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated CDF.\n\n Examples\n --------\n > var y = base.dists.weibull.cdf( 2.0, 1.0, 1.0 )\n ~0.865\n > y = base.dists.weibull.cdf( -1.0, 2.0, 2.0 )\n 0.0\n > y = base.dists.weibull.cdf( PINF, 4.0, 2.0 )\n 1.0\n > y = base.dists.weibull.cdf( NINF, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.cdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.cdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.cdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.cdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.cdf.factory( k, λ )\n Returns a function for evaluating the cumulative distribution function (CDF)\n of a Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n cdf: Function\n Cumulative distribution function (CDF).\n\n Examples\n --------\n > var myCDF = base.dists.weibull.cdf.factory( 2.0, 10.0 );\n > var y = myCDF( 12.0 )\n ~0.763\n\n",
"base.dists.weibull.entropy": "\nbase.dists.weibull.entropy( k, λ )\n Returns the differential entropy of a Weibull distribution (in nats).\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Entropy.\n\n Examples\n --------\n > var v = base.dists.weibull.entropy( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.entropy( 4.0, 12.0 )\n ~2.532\n > v = base.dists.weibull.entropy( 8.0, 2.0 )\n ~0.119\n\n",
"base.dists.weibull.kurtosis": "\nbase.dists.weibull.kurtosis( k, λ )\n Returns the excess kurtosis of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Excess kurtosis.\n\n Examples\n --------\n > var v = base.dists.weibull.kurtosis( 1.0, 1.0 )\n 6.0\n > v = base.dists.weibull.kurtosis( 4.0, 12.0 )\n ~-0.252\n > v = base.dists.weibull.kurtosis( 8.0, 2.0 )\n ~0.328\n\n",
"base.dists.weibull.logcdf": "\nbase.dists.weibull.logcdf( x, k, λ )\n Evaluates the logarithm of the cumulative distribution function (CDF) for a\n Weibull distribution with shape parameter `k` and scale parameter `λ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logCDF.\n\n Examples\n --------\n > var y = base.dists.weibull.logcdf( 2.0, 1.0, 1.0 )\n ~-0.145\n > y = base.dists.weibull.logcdf( -1.0, 2.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logcdf( PINF, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.logcdf( NINF, 4.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logcdf( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.logcdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.logcdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.logcdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.logcdf.factory( k, λ)\n Returns a function for evaluating the logarithm of the cumulative\n distribution function (CDF) of a Weibull distribution with scale parameter\n `λ` and shape parameter `k`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n logcdf: Function\n Logarithm of cumulative distribution function (CDF).\n\n Examples\n --------\n > var mylogcdf = base.dists.weibull.logcdf.factory( 2.0, 10.0 );\n > var y = mylogcdf( 12.0 )\n ~-0.27\n\n",
"base.dists.weibull.logpdf": "\nbase.dists.weibull.logpdf( x, k, λ )\n Evaluates the logarithm of the probability density function (PDF) for a\n Weibull distribution with shape parameter `k` and scale parameter `λ` at a\n value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated logPDF.\n\n Examples\n --------\n > var y = base.dists.weibull.logpdf( 2.0, 1.0, 0.5 )\n ~-3.307\n > y = base.dists.weibull.logpdf( 0.1, 1.0, 1.0 )\n ~-0.1\n > y = base.dists.weibull.logpdf( -1.0, 4.0, 2.0 )\n -Infinity\n > y = base.dists.weibull.logpdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.weibull.logpdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.logpdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.logpdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.logpdf.factory( k, λ )\n Returns a function for evaluating the logarithm of the probability density\n function (PDF) of a Weibull distribution with shape parameter `k` and scale\n parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n logpdf: Function\n Logarithm of probability density function (PDF).\n\n Examples\n --------\n > var mylofpdf = base.dists.weibull.logpdf.factory( 7.0, 6.0 );\n > y = mylofpdf( 7.0 )\n ~-1.863\n\n",
"base.dists.weibull.mean": "\nbase.dists.weibull.mean( k, λ )\n Returns the expected value of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Expected value.\n\n Examples\n --------\n > var v = base.dists.weibull.mean( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.mean( 4.0, 12.0 )\n ~10.877\n > v = base.dists.weibull.mean( 8.0, 2.0 )\n ~1.883\n\n",
"base.dists.weibull.median": "\nbase.dists.weibull.median( k, λ )\n Returns the median of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Median.\n\n Examples\n --------\n > var v = base.dists.weibull.median( 1.0, 1.0 )\n ~0.693\n > v = base.dists.weibull.median( 4.0, 12.0 )\n ~10.949\n > v = base.dists.weibull.median( 8.0, 2.0 )\n ~1.91\n\n",
"base.dists.weibull.mgf": "\nbase.dists.weibull.mgf( x, k, λ )\n Evaluates the moment-generating function (MGF) for a Weibull distribution\n with shape parameter `k` and scale parameter `λ` at a value `t`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a non-positive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated MGF.\n\n Examples\n --------\n > var y = base.dists.weibull.mgf( 1.0, 1.0, 0.5 )\n ~2.0\n > y = base.dists.weibull.mgf( -1.0, 4.0, 4.0 )\n ~0.019\n\n > y = base.dists.weibull.mgf( NaN, 1.0, 1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.0, 1.0, NaN )\n NaN\n\n > y = base.dists.weibull.mgf( 0.2, -1.0, 0.5 )\n NaN\n > y = base.dists.weibull.mgf( 0.2, 0.0, 0.5 )\n NaN\n\n > y = base.dists.weibull.mgf( 0.2, 0.5, -1.0 )\n NaN\n > y = base.dists.weibull.mgf( 0.2, 0.5, 0.0 )\n NaN\n\n\nbase.dists.weibull.mgf.factory( k, λ )\n Returns a function for evaluating the moment-generating function (MGF) of a\n Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n mgf: Function\n Moment-generating function (MGF).\n\n Examples\n --------\n > var myMGF = base.dists.weibull.mgf.factory( 8.0, 10.0 );\n > var y = myMGF( 0.8 )\n ~3150.149\n > y = myMGF( 0.08 )\n ~2.137\n\n",
"base.dists.weibull.mode": "\nbase.dists.weibull.mode( k, λ )\n Returns the mode of a Weibull distribution.\n\n If `0 < k <= 1`, the function returns `0.0`.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Mode.\n\n Examples\n --------\n > var v = base.dists.weibull.mode( 1.0, 1.0 )\n 0.0\n > v = base.dists.weibull.mode( 4.0, 12.0 )\n ~11.167\n > v = base.dists.weibull.mode( 8.0, 2.0 )\n ~1.967\n\n",
"base.dists.weibull.pdf": "\nbase.dists.weibull.pdf( x, k, λ )\n Evaluates the probability density function (PDF) for a Weibull distribution\n with shape parameter `k` and scale parameter `λ` at a value `x`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated PDF.\n\n Examples\n --------\n > var y = base.dists.weibull.pdf( 2.0, 1.0, 0.5 )\n ~0.037\n > y = base.dists.weibull.pdf( 0.1, 1.0, 1.0 )\n ~0.905\n > y = base.dists.weibull.pdf( -1.0, 4.0, 2.0 )\n 0.0\n > y = base.dists.weibull.pdf( NaN, 0.6, 1.0 )\n NaN\n > y = base.dists.weibull.pdf( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.pdf( 0.0, 0.0, NaN )\n NaN\n > y = base.dists.weibull.pdf( 2.0, 0.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.pdf.factory( k, λ )\n Returns a function for evaluating the probability density function (PDF) of\n a Weibull distribution with shape parameter `k` and scale parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n pdf: Function\n Probability density function (PDF).\n\n Examples\n --------\n > var myPDF = base.dists.weibull.pdf.factory( 7.0, 6.0 );\n > var y = myPDF( 7.0 )\n ~0.155\n\n",
"base.dists.weibull.quantile": "\nbase.dists.weibull.quantile( p, k, λ )\n Evaluates the quantile function for a Weibull distribution with scale\n parameter `k` and shape parameter `λ` at a probability `p`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided a nonpositive value for `λ` or `k`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input probability.\n\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Evaluated quantile function.\n\n Examples\n --------\n > var y = base.dists.weibull.quantile( 0.8, 1.0, 1.0 )\n ~1.609\n > y = base.dists.weibull.quantile( 0.5, 2.0, 4.0 )\n ~3.33\n\n > y = base.dists.weibull.quantile( 1.1, 1.0, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( -0.2, 1.0, 1.0 )\n NaN\n\n > y = base.dists.weibull.quantile( NaN, 0.0, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( 0.0, NaN, 1.0 )\n NaN\n > y = base.dists.weibull.quantile( 0.0, 0.0, NaN )\n NaN\n\n > y = base.dists.weibull.quantile( 0.5, 1.0, -1.0 )\n NaN\n\n\nbase.dists.weibull.quantile.factory( k, λ )\n Returns a function for evaluating the quantile function of a Weibull\n distribution with scale parameter `k` and shape parameter `λ`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n quantile: Function\n Quantile function.\n\n Examples\n --------\n > var myQuantile = base.dists.weibull.quantile.factory( 2.0, 10.0 );\n > var y = myQuantile( 0.4 )\n ~7.147\n\n",
"base.dists.weibull.skewness": "\nbase.dists.weibull.skewness( k, λ )\n Returns the skewness of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Skewness.\n\n Examples\n --------\n > var v = base.dists.weibull.skewness( 1.0, 1.0 )\n 2.0\n > v = base.dists.weibull.skewness( 4.0, 12.0 )\n ~-0.087\n > v = base.dists.weibull.skewness( 8.0, 2.0 )\n ~-0.534\n\n",
"base.dists.weibull.stdev": "\nbase.dists.weibull.stdev( k, λ )\n Returns the standard deviation of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Standard deviation.\n\n Examples\n --------\n > var v = base.dists.weibull.stdev( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.stdev( 4.0, 12.0 )\n ~3.051\n > v = base.dists.weibull.stdev( 8.0, 2.0 )\n ~0.279\n\n",
"base.dists.weibull.variance": "\nbase.dists.weibull.variance( k, λ )\n Returns the variance of a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Shape parameter.\n\n λ: number\n Scale parameter.\n\n Returns\n -------\n out: number\n Variance.\n\n Examples\n --------\n > var v = base.dists.weibull.variance( 1.0, 1.0 )\n 1.0\n > v = base.dists.weibull.variance( 4.0, 12.0 )\n ~9.311\n > v = base.dists.weibull.variance( 8.0, 2.0 )\n ~0.078\n\n",
"base.dists.weibull.Weibull": "\nbase.dists.weibull.Weibull( [k, λ] )\n Returns a Weibull distribution object.\n\n Parameters\n ----------\n k: number (optional)\n Shape parameter. Must be greater than `0`. Default: `1.0`.\n\n λ: number (optional)\n Scale parameter. Must be greater than `0`. Default: `1.0`.\n\n Returns\n -------\n weibull: Object\n Distribution instance.\n\n weibull.k: number\n Shape parameter. If set, the value must be greater than `0`.\n\n weibull.lambda: number\n Scale parameter. If set, the value must be greater than `0`.\n\n weibull.entropy: number\n Read-only property which returns the differential entropy.\n\n weibull.kurtosis: number\n Read-only property which returns the excess kurtosis.\n\n weibull.mean: number\n Read-only property which returns the expected value.\n\n weibull.median: number\n Read-only property which returns the median.\n\n weibull.mode: number\n Read-only property which returns the mode.\n\n weibull.skewness: number\n Read-only property which returns the skewness.\n\n weibull.stdev: number\n Read-only property which returns the standard deviation.\n\n weibull.variance: number\n Read-only property which returns the variance.\n\n weibull.cdf: Function\n Evaluates the cumulative distribution function (CDF).\n\n weibull.logcdf: Function\n Evaluates the natural logarithm of the cumulative distribution function\n (CDF).\n\n weibull.logpdf: Function\n Evaluates the natural logarithm of the probability density function\n (PDF).\n\n weibull.mgf: Function\n Evaluates the moment-generating function (MGF).\n\n weibull.pdf: Function\n Evaluates the probability density function (PDF).\n\n weibull.quantile: Function\n Evaluates the quantile function at probability `p`.\n\n Examples\n --------\n > var weibull = base.dists.weibull.Weibull( 6.0, 5.0 );\n > weibull.k\n 6.0\n > weibull.lambda\n 5.0\n > weibull.entropy\n ~1.299\n > weibull.kurtosis\n ~0.035\n > weibull.mean\n ~4.639\n > weibull.median\n ~4.704\n > weibull.mode\n ~4.85\n > weibull.skewness\n ~-0.373\n > weibull.stdev\n ~0.899\n > weibull.variance\n ~0.808\n > weibull.cdf( 3.0 )\n ~0.046\n > weibull.logcdf( 3.0 )\n ~-3.088\n > weibull.logpdf( 1.0 )\n ~-7.865\n > weibull.mgf( -0.5 )\n ~0.075\n > weibull.pdf( 3.0 )\n ~0.089\n > weibull.quantile( 0.8 )\n ~5.413\n\n",
"base.epsdiff": "\nbase.epsdiff( x, y[, scale] )\n Computes the relative difference of two real numbers in units of double-\n precision floating-point epsilon.\n\n By default, the function scales the absolute difference by dividing the\n absolute difference by the maximum absolute value of `x` and `y`. To scale\n by a different function, specify a scale function name.\n\n The following `scale` functions are supported:\n\n - 'max-abs': maximum absolute value of `x` and `y` (default).\n - 'max': maximum value of `x` and `y`.\n - 'min-abs': minimum absolute value of `x` and `y`.\n - 'min': minimum value of `x` and `y`.\n - 'mean-abs': arithmetic mean of the absolute values of `x` and `y`.\n - 'mean': arithmetic mean of `x` and `y`.\n - 'x': `x` (*noncommutative*).\n - 'y': `y` (*noncommutative*).\n\n To use a custom scale function, provide a function which accepts two numeric\n arguments `x` and `y`.\n\n If computing the relative difference in units of epsilon will result in\n overflow, the function returns the maximum double-precision floating-point\n number.\n\n If the absolute difference of `x` and `y` is `0`, the relative difference is\n always `0`.\n\n If `|x| = |y| = infinity`, the function returns `NaN`.\n\n If `|x| = |-y| = infinity`, the relative difference is `+infinity`.\n\n If a `scale` function returns `0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n scale: string|Function (optional)\n Scale function. Default: `'max-abs'`.\n\n Returns\n -------\n out: number\n Relative difference in units of double-precision floating-point epsilon.\n\n Examples\n --------\n > var d = base.epsdiff( 12.15, 12.149999999999999 )\n ~0.658\n > d = base.epsdiff( 2.4341309458983933, 2.4341309458633909, 'mean-abs' )\n ~64761.512\n\n // Custom scale function:\n > function scale( x, y ) { return ( x > y ) ? y : x; };\n > d = base.epsdiff( 1.0000000000000002, 1.0000000000000100, scale )\n ~44\n\n See Also\n --------\n base.absdiff, base.reldiff\n",
"base.erf": "\nbase.erf( x )\n Evaluates the error function.\n\n If provided `NaN`, the function returns `NaN`.\n\n As the error function is an odd function (i.e., `erf(-x) == -erf(x)`), if\n provided `-0`, the function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erf( 2.0 )\n ~0.9953\n > y = base.erf( -1.0 )\n ~-0.8427\n > y = base.erf( -0.0 )\n -0.0\n > y = base.erf( NaN )\n NaN\n\n See Also\n --------\n base.erfc, base.erfinv, base.erfcinv\n",
"base.erfc": "\nbase.erfc( x )\n Evaluates the complementary error function.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfc( 2.0 )\n ~0.0047\n > y = base.erfc( -1.0 )\n ~1.8427\n > y = base.erfc( 0.0 )\n 1.0\n > y = base.erfc( PINF )\n 0.0\n > y = base.erfc( NINF )\n 2.0\n > y = base.erfc( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfinv, base.erfcinv\n",
"base.erfcinv": "\nbase.erfcinv( x )\n Evaluates the inverse complementary error function.\n\n The domain of `x` is restricted to `[0,2]`. If `x` is outside this interval,\n the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfcinv( 0.5 )\n ~0.4769\n > y = base.erfcinv( 0.8 )\n ~0.1791\n > y = base.erfcinv( 0.0 )\n Infinity\n > y = base.erfcinv( 2.0 )\n -Infinity\n > y = base.erfcinv( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfc, base.erfinv\n",
"base.erfinv": "\nbase.erfinv( x )\n Evaluates the inverse error function.\n\n If `|x| > 1`, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n As the inverse error function is an odd function (i.e., `erfinv(-x) ==\n -erfinv(x)`), if provided `-0`, the function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.erfinv( 0.5 )\n ~0.4769\n > y = base.erfinv( 0.8 )\n ~0.9062\n > y = base.erfinv( 0.0 )\n 0.0\n > y = base.erfinv( -0.0 )\n -0.0\n > y = base.erfinv( -1.0 )\n -Infinity\n > y = base.erfinv( 1.0 )\n Infinity\n > y = base.erfinv( NaN )\n NaN\n\n See Also\n --------\n base.erf, base.erfc, base.erfcinv\n",
"base.eta": "\nbase.eta( s )\n Evaluates the Dirichlet eta function as a function of a real variable `s`.\n\n Parameters\n ----------\n s: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.eta( 0.0 )\n 0.5\n > y = base.eta( -1.0 )\n 0.25\n > y = base.eta( 1.0 )\n ~0.6931\n > y = base.eta( 3.14 )\n ~0.9096\n > y = base.eta( NaN )\n NaN\n\n",
"base.evalpoly": "\nbase.evalpoly( c, x )\n Evaluates a polynomial.\n\n Parameters\n ----------\n c: Array<number>\n Polynomial coefficients sorted in ascending degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n out: number\n Evaluated polynomial.\n\n Examples\n --------\n > var arr = [ 3.0, 2.0, 1.0 ];\n\n // 3*10^0 + 2*10^1 + 1*10^2\n > var v = base.evalpoly( arr, 10.0 )\n 123.0\n\n\nbase.evalpoly.factory( c )\n Returns a function for evaluating a polynomial.\n\n Parameters\n ----------\n c: Array<number>\n Polynomial coefficients sorted in ascending degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a polynomial.\n\n Examples\n --------\n > var polyval = base.evalpoly.factory( [ 3.0, 2.0, 1.0 ] );\n\n // 3*10^0 + 2*10^1 + 1*10^2\n > var v = polyval( 10.0 )\n 123.0\n\n // 3*5^0 + 2*5^1 + 1*5^2\n > v = polyval( 5.0 )\n 38.0\n\n See Also\n --------\n base.evalrational\n",
"base.evalrational": "\nbase.evalrational( P, Q, x )\n Evaluates a rational function.\n\n A rational function `f(x)` is defined as\n\n P(x)\n f(x) = ----\n Q(x)\n\n where both `P(x)` and `Q(x)` are polynomials in `x`.\n\n The coefficients for both `P` and `Q` should be sorted in ascending degree.\n\n For polynomials of different degree, the coefficient array for the lower\n degree polynomial should be padded with zeros.\n\n Parameters\n ----------\n P: Array<number>\n Numerator polynomial coefficients sorted in ascending degree.\n\n Q: Array<number>\n Denominator polynomial coefficients sorted in ascending degree.\n\n x: number\n Value at which to evaluate the rational function.\n\n Returns\n -------\n out: number\n Evaluated rational function.\n\n Examples\n --------\n // 2x^3 + 4x^2 - 5x^1 - 6x^0\n > var P = [ -6.0, -5.0, 4.0, 2.0 ];\n\n // 0.5x^1 + 3x^0\n > var Q = [ 3.0, 0.5, 0.0, 0.0 ]; // zero-padded\n\n // Evaluate the rational function:\n > var v = base.evalrational( P, Q, 6.0 )\n 90.0\n\n\nbase.evalrational.factory( P, Q )\n Returns a function for evaluating a rational function.\n\n Parameters\n ----------\n P: Array<number>\n Numerator polynomial coefficients sorted in ascending degree.\n\n Q: Array<number>\n Denominator polynomial coefficients sorted in ascending degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a rational function.\n\n Examples\n --------\n > var P = [ 20.0, 8.0, 3.0 ];\n > var Q = [ 10.0, 9.0, 1.0 ];\n > var rational = base.evalrational.factory( P, Q );\n\n // (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2):\n > var v = rational( 10.0 )\n 2.0\n\n // (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2):\n > v = rational( 2.0 )\n 1.5\n\n See Also\n --------\n base.evalpoly\n",
"base.exp": "\nbase.exp( x )\n Evaluates the natural exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp( 4.0 )\n ~54.5982\n > y = base.exp( -9.0 )\n ~1.234e-4\n > y = base.exp( 0.0 )\n 1.0\n > y = base.exp( NaN )\n NaN\n\n See Also\n --------\n base.exp10, base.exp2, base.expm1, base.ln\n",
"base.exp2": "\nbase.exp2( x )\n Evaluates the base 2 exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp2( 3.0 )\n 8.0\n > y = base.exp2( -9.0 )\n ~0.002\n > y = base.exp2( 0.0 )\n 1.0\n > y = base.exp2( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.exp10\n",
"base.exp10": "\nbase.exp10( x )\n Evaluates the base 10 exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.exp10( 3.0 )\n 1000\n > y = base.exp10( -9.0 )\n 1.0e-9\n > y = base.exp10( 0.0 )\n 1.0\n > y = base.exp10( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.exp2\n",
"base.expm1": "\nbase.expm1( x )\n Computes `exp(x)-1`, where `exp(x)` is the natural exponential function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.expm1( 0.2 )\n ~0.221\n > y = base.expm1( -9.0 )\n ~-1.0\n > y = base.expm1( 0.0 )\n 0.0\n > y = base.expm1( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.expm1rel\n",
"base.expm1rel": "\nbase.expm1rel( x )\n Relative error exponential.\n\n When `x` is near zero,\n\n e^x - 1\n\n can suffer catastrophic cancellation (i.e., significant loss of precision).\n This function avoids the loss of precision when `x` is near zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.expm1rel( 0.0 )\n 1.0\n > y = base.expm1rel( 1.0 )\n ~1.718\n > y = base.expm1rel( -1.0 )\n ~0.632\n > y = base.expm1rel( NaN )\n NaN\n\t\n See Also\n --------\n base.exp, base.expm1\n",
"base.exponent": "\nbase.exponent( x )\n Returns an integer corresponding to the unbiased exponent of a double-\n precision floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unbiased exponent.\n\n Examples\n --------\n > var exponent = base.exponent( 3.14e-307 )\n -1019\n > exponent = base.exponent( -3.14 )\n 1\n > exponent = base.exponent( 0.0 )\n -1023\n > exponent = base.exponent( NaN )\n 1024\n\n See Also\n --------\n base.exponentf\n",
"base.exponentf": "\nbase.exponentf( x )\n Returns an integer corresponding to the unbiased exponent of a single-\n precision floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unbiased exponent.\n\n Examples\n --------\n > var exponent = base.exponentf( base.float64ToFloat32( 3.14e34 ) )\n 114\n > exponent = base.exponentf( base.float64ToFloat32( 3.14e-34 ) )\n -112\n > exponent = base.exponentf( base.float64ToFloat32( -3.14 ) )\n 1\n > exponent = base.exponentf( 0.0 )\n -127\n > exponent = base.exponentf( NaN )\n 128\n\n See Also\n --------\n base.exponent\n",
"base.factorial": "\nbase.factorial( x )\n Evaluates the factorial of `x`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Factorial.\n\n Examples\n --------\n > var y = base.factorial( 3.0 )\n 6.0\n > y = base.factorial( -1.5 )\n ~-3.545\n > y = base.factorial( -0.5 )\n ~1.772\n > y = base.factorial( 0.5 )\n ~0.886\n > y = base.factorial( -10.0 )\n NaN\n > y = base.factorial( 171.0 )\n Infinity\n > y = base.factorial( NaN )\n NaN\n\n See Also\n --------\n base.factorialln\n",
"base.factorialln": "\nbase.factorialln( x )\n Evaluates the natural logarithm of the factorial of `x`.\n\n For input values other than negative integers, the function returns\n\n ln( x! ) = ln( Γ(x+1) )\n\n where `Γ` is the Gamma function. For negative integers, the function returns\n `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Natural logarithm of the factorial of `x`.\n\n Examples\n --------\n > var y = base.factorialln( 3.0 )\n ~1.792\n > y = base.factorialln( 2.4 )\n ~1.092\n > y = base.factorialln( -1.0 )\n NaN\n > y = base.factorialln( -1.5 )\n ~1.266\n > y = base.factorialln( NaN )\n NaN\n\n See Also\n --------\n base.factorial\n",
"base.fallingFactorial": "\nbase.fallingFactorial( x, n )\n Computes the falling factorial of `x` and `n`.\n\n If not provided a non-negative integer for `n`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n n: integer\n Second function parameter.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.fallingFactorial( 0.9, 5 )\n ~0.644\n > v = base.fallingFactorial( -9.0, 3 )\n -990.0\n > v = base.fallingFactorial( 0.0, 2 )\n 0.0\n > v = base.fallingFactorial( 3.0, -2 )\n NaN\n\n See Also\n --------\n base.risingFactorial\n",
"base.fibonacci": "\nbase.fibonacci( n )\n Computes the nth Fibonacci number.\n\n Fibonacci numbers follow the recurrence relation\n\n F_n = F_{n-1} + F_{n-2}\n\n with seed values F_0 = 0 and F_1 = 1.\n\n If `n` is greater than `78`, the function returns `NaN`, as larger Fibonacci\n numbers cannot be accurately represented due to limitations of double-\n precision floating-point format.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n Fibonacci number.\n\n Examples\n --------\n > var y = base.fibonacci( 0 )\n 0\n > y = base.fibonacci( 1 )\n 1\n > y = base.fibonacci( 2 )\n 1\n > y = base.fibonacci( 3 )\n 2\n > y = base.fibonacci( 4 )\n 3\n > y = base.fibonacci( 79 )\n NaN\n > y = base.fibonacci( NaN )\n NaN\n\n See Also\n --------\n base.binet, base.fibonacciIndex, base.lucas, base.negafibonacci\n",
"base.fibonacciIndex": "\nbase.fibonacciIndex( F )\n Computes the Fibonacci number index.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `F <= 1` or `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n F: integer\n Fibonacci number.\n\n Returns\n -------\n n: number\n Fibonacci number index.\n\n Examples\n --------\n > var n = base.fibonacciIndex( 2 )\n 3\n > n = base.fibonacciIndex( 3 )\n 4\n > n = base.fibonacciIndex( 5 )\n 5\n > n = base.fibonacciIndex( NaN )\n NaN\n > n = base.fibonacciIndex( 1 )\n NaN\n\n See Also\n --------\n base.fibonacci\n",
"base.fibpoly": "\nbase.fibpoly( n, x )\n Evaluates a Fibonacci polynomial.\n\n Parameters\n ----------\n n: integer\n Fibonacci polynomial to evaluate.\n\n x: number\n Value at which to evaluate the Fibonacci polynomial.\n\n Returns\n -------\n out: number\n Evaluated Fibonacci polynomial.\n\n Examples\n --------\n // 2^4 + 3*2^2 + 1\n > var v = base.fibpoly( 5, 2.0 )\n 29.0\n\n\nbase.fibpoly.factory( n )\n Returns a function for evaluating a Fibonacci polynomial.\n\n Parameters\n ----------\n n: integer\n Fibonacci polynomial to evaluate.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a Fibonacci polynomial.\n\n Examples\n --------\n > var polyval = base.fibpoly.factory( 5 );\n\n // 1^4 + 3*1^2 + 1\n > var v = polyval( 1.0 )\n 5.0\n\n // 2^4 + 3*2^2 + 1\n > v = polyval( 2.0 )\n 29.0\n\n See Also\n --------\n base.evalpoly, base.lucaspoly\n",
"base.flipsign": "\nbase.flipsign( x, y )\n Returns a double-precision floating-point number with the magnitude of `x`\n and the sign of `x*y`.\n\n The function only returns `-x` when `y` is a negative number.\n\n According to the IEEE 754 standard, a `NaN` has a biased exponent equal to\n `2047`, a significand greater than `0`, and a sign bit equal to either `1`\n or `0`. In which case, `NaN` may not correspond to just one but many binary\n representations. Accordingly, care should be taken to ensure that `y` is not\n `NaN`, else behavior may be indeterminate.\n\n Parameters\n ----------\n x: number\n Number from which to derive a magnitude.\n\n y: number\n Number from which to derive a sign.\n\n Returns\n -------\n z: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var z = base.flipsign( -3.14, 10.0 )\n -3.14\n > z = base.flipsign( -3.14, -1.0 )\n 3.14\n > z = base.flipsign( 1.0, -0.0 )\n -1.0\n > z = base.flipsign( -3.14, -0.0 )\n 3.14\n > z = base.flipsign( -0.0, 1.0 )\n -0.0\n > z = base.flipsign( 0.0, -1.0 )\n -0.0\n\n See Also\n --------\n base.copysign\n",
"base.float32ToInt32": "\nbase.float32ToInt32( x )\n Converts a single-precision floating-point number to a signed 32-bit\n integer.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.float32ToInt32( base.float64ToFloat32( 4294967295.0 ) )\n -1\n > y = base.float32ToInt32( base.float64ToFloat32( 3.14 ) )\n 3\n > y = base.float32ToInt32( base.float64ToFloat32( -3.14 ) )\n -3\n > y = base.float32ToInt32( base.float64ToFloat32( NaN ) )\n 0\n > y = base.float32ToInt32( FLOAT32_PINF )\n 0\n > y = base.float32ToInt32( FLOAT32_NINF )\n 0\n\n See Also\n --------\n base.float32ToUint32",
"base.float32ToUint32": "\nbase.float32ToUint32( x )\n Converts a single-precision floating-point number to a unsigned 32-bit\n integer.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.float32ToUint32( base.float64ToFloat32( 4294967297.0 ) )\n 1\n > y = base.float32ToUint32( base.float64ToFloat32( 3.14 ) )\n 3\n > y = base.float32ToUint32( base.float64ToFloat32( -3.14 ) )\n 4294967293\n > y = base.float32ToUint32( base.float64ToFloat32( NaN ) )\n 0\n > y = base.float32ToUint32( FLOAT32_PINF )\n 0\n > y = base.float32ToUint32( FLOAT32_NINF )\n 0\n\n See Also\n --------\n base.float32ToInt32",
"base.float64ToFloat32": "\nbase.float64ToFloat32( x )\n Converts a double-precision floating-point number to the nearest single-\n precision floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: float\n Nearest single-precision floating-point number.\n\n Examples\n --------\n > var y = base.float64ToFloat32( 1.337 )\n 1.3370000123977661\n",
"base.float64ToInt32": "\nbase.float64ToInt32( x )\n Converts a double-precision floating-point number to a signed 32-bit\n integer.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.float64ToInt32( 4294967295.0 )\n -1\n > y = base.float64ToInt32( 3.14 )\n 3\n > y = base.float64ToInt32( -3.14 )\n -3\n > y = base.float64ToInt32( NaN )\n 0\n > y = base.float64ToInt32( PINF )\n 0\n > y = base.float64ToInt32( NINF )\n 0\n\n See Also\n --------\n base.float64ToUint32",
"base.float64ToUint32": "\nbase.float64ToUint32( x )\n Converts a double-precision floating-point number to a unsigned 32-bit\n integer.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.float64ToUint32( 4294967297.0 )\n 1\n > y = base.float64ToUint32( 3.14 )\n 3\n > y = base.float64ToUint32( -3.14 )\n 4294967293\n > y = base.float64ToUint32( NaN )\n 0\n > y = base.float64ToUint32( PINF )\n 0\n > y = base.float64ToUint32( NINF )\n 0\n\n See Also\n --------\n base.float64ToInt32",
"base.floor": "\nbase.floor( x )\n Rounds a numeric value toward negative infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor( 3.14 )\n 3.0\n > y = base.floor( -4.2 )\n -5.0\n > y = base.floor( -4.6 )\n -5.0\n > y = base.floor( 9.5 )\n 9.0\n > y = base.floor( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.round\n",
"base.floor2": "\nbase.floor2( x )\n Rounds a numeric value to the nearest power of two toward negative infinity.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor2( 3.14 )\n 2.0\n > y = base.floor2( -4.2 )\n -8.0\n > y = base.floor2( -4.6 )\n -8.0\n > y = base.floor2( 9.5 )\n 8.0\n > y = base.floor2( 13.0 )\n 8.0\n > y = base.floor2( -13.0 )\n -16.0\n > y = base.floor2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor, base.floor10, base.round2\n",
"base.floor10": "\nbase.floor10( x )\n Rounds a numeric value to the nearest power of ten toward negative infinity.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floor10( 3.14 )\n 1.0\n > y = base.floor10( -4.2 )\n -10.0\n > y = base.floor10( -4.6 )\n -10.0\n > y = base.floor10( 9.5 )\n 1.0\n > y = base.floor10( 13.0 )\n 10.0\n > y = base.floor10( -13.0 )\n -100.0\n > y = base.floor10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor, base.floor2, base.round10\n",
"base.floorb": "\nbase.floorb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward negative\n infinity.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.floorb( 3.14159, -4, 10 )\n 3.1415\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.floorb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two toward negative infinity:\n > y = base.floorb( 5.0, 1, 2 )\n 4.0\n\n See Also\n --------\n base.ceilb, base.floor, base.floorn, base.roundb\n",
"base.floorn": "\nbase.floorn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward negative\n infinity.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.floorn( 3.14159, -4 )\n 3.1415\n\n // If `n = 0`, standard round toward negative infinity behavior:\n > y = base.floorn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.floorn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floor, base.floorb, base.roundn\n",
"base.floorsd": "\nbase.floorsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward negative infinity with\n `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.floorsd( 3.14159, 5 )\n 3.1415\n > y = base.floorsd( 3.14159, 1 )\n 3.0\n > y = base.floorsd( 12368.0, 2 )\n 12000.0\n > y = base.floorsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floor, base.roundsd, base.truncsd\n",
"base.fresnel": "\nbase.fresnel( [out,] x )\n Computes the Fresnel integrals S(x) and C(x).\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value.\n\n Returns\n -------\n y: Array|TypedArray|Object\n S(x) and C(x).\n\n Examples\n --------\n > var y = base.fresnel( 0.0 )\n [ ~0.0, ~0.0 ]\n > y = base.fresnel( 1.0 )\n [ ~0.438, ~0.780 ]\n > y = base.fresnel( PINF )\n [ ~0.5, ~0.5 ]\n > y = base.fresnel( NINF )\n [ ~-0.5, ~-0.5 ]\n > y = base.fresnel( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.fresnel( out, 0.0 )\n <Float64Array>[ ~0.0, ~0.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.fresnelc, base.fresnels\n",
"base.fresnelc": "\nbase.fresnelc( x )\n Computes the Fresnel integral C(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n C(x).\n\n Examples\n --------\n > var y = base.fresnelc( 0.0 )\n ~0.0\n > y = base.fresnelc( 1.0 )\n ~0.780\n > y = base.fresnelc( PINF )\n ~0.5\n > y = base.fresnelc( NINF )\n ~-0.5\n > y = base.fresnelc( NaN )\n NaN\n\n See Also\n --------\n base.fresnel, base.fresnels\n",
"base.fresnels": "\nbase.fresnels( x )\n Computes the Fresnel integral S(x).\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n S(x).\n\n Examples\n --------\n > var y = base.fresnels( 0.0 )\n ~0.0\n > y = base.fresnels( 1.0 )\n ~0.438\n > y = base.fresnels( PINF )\n ~0.5\n > y = base.fresnels( NINF )\n ~-0.5\n > y = base.fresnels( NaN )\n NaN\n\n See Also\n --------\n base.fresnel, base.fresnelc\n",
"base.frexp": "\nbase.frexp( [out,] x )\n Splits a double-precision floating-point number into a normalized fraction\n and an integer power of two.\n\n The first element of the returned array is the normalized fraction and the\n second is the exponent. The normalized fraction and exponent satisfy the\n relation\n\n x = frac * 2^exp\n\n If provided positive or negative zero, `NaN`, or positive or negative\n infinity, the function returns a two-element array containing the input\n value and an exponent equal to zero.\n\n For all other numeric input values, the absolute value of the normalized\n fraction resides on the interval [0.5,1).\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n out: Array|TypedArray|Object\n A normalized fraction and an exponent.\n\n Examples\n --------\n > var out = base.frexp( 4.0 )\n [ 0.5, 3 ]\n > out = base.frexp( 0.0 )\n [ 0.0, 0 ]\n > out = base.frexp( -0.0 )\n [ -0.0, 0 ]\n > out = base.frexp( NaN )\n [ NaN, 0 ]\n > out = base.frexp( PINF )\n [ Infinity, 0 ]\n > out = base.frexp( NINF )\n [ -Infinity, 0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var y = base.frexp( out, 4.0 )\n <Float64Array>[ 0.5, 3 ]\n > var bool = ( y === out )\n true\n\n See Also\n --------\n base.ldexp\n",
"base.fromBinaryString": "\nbase.fromBinaryString( bstr )\n Creates a double-precision floating-point number from a literal bit\n representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var bstr;\n > bstr = '0100000000010000000000000000000000000000000000000000000000000000';\n > var val = base.fromBinaryString( bstr )\n 4.0\n > bstr = '0100000000001001001000011111101101010100010001000010110100011000';\n > val = base.fromBinaryString( bstr )\n 3.141592653589793\n > bstr = '1111111111100001110011001111001110000101111010111100100010100000';\n > val = base.fromBinaryString( bstr )\n -1.0e308\n\n // The function handles subnormals:\n > bstr = '1000000000000000000000000000000000000000000000000001100011010011';\n > val = base.fromBinaryString( bstr )\n -3.14e-320\n > bstr = '0000000000000000000000000000000000000000000000000000000000000001';\n > val = base.fromBinaryString( bstr )\n 5.0e-324\n\n // The function handles special values:\n > bstr = '0000000000000000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n 0.0\n > bstr = '1000000000000000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n -0.0\n > bstr = '0111111111111000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n NaN\n > bstr = '0111111111110000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n Infinity\n > bstr = '1111111111110000000000000000000000000000000000000000000000000000';\n > val = base.fromBinaryString( bstr )\n -Infinity\n\n See Also\n --------\n base.fromBinaryStringf, base.toBinaryString\n",
"base.fromBinaryStringf": "\nbase.fromBinaryStringf( bstr )\n Creates a single-precision floating-point number from an IEEE 754 literal\n bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: float\n Single-precision floating-point number.\n\n Examples\n --------\n > var bstr = '01000000100000000000000000000000';\n > var val = base.fromBinaryStringf( bstr )\n 4.0\n > bstr = '01000000010010010000111111011011';\n > val = base.fromBinaryStringf( bstr )\n ~3.14\n > bstr = '11111111011011000011101000110011';\n > val = base.fromBinaryStringf( bstr )\n ~-3.14e+38\n\n // The function handles subnormals:\n > bstr = '10000000000000000000000000010110';\n > val = base.fromBinaryStringf( bstr )\n ~-3.08e-44\n > bstr = '00000000000000000000000000000001';\n > val = base.fromBinaryStringf( bstr )\n ~1.40e-45\n\n // The function handles special values:\n > bstr = '00000000000000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n 0.0\n > bstr = '10000000000000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n -0.0\n > bstr = '01111111110000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n NaN\n > bstr = '01111111100000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n Infinity\n > bstr = '11111111100000000000000000000000';\n > val = base.fromBinaryStringf( bstr )\n -Infinity\n\n See Also\n --------\n base.toBinaryStringf, base.fromBinaryString\n",
"base.fromBinaryStringUint8": "\nbase.fromBinaryStringUint8( bstr )\n Creates an unsigned 8-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 8-bit integer.\n\n Examples\n --------\n > var bstr = '01010101';\n > var val = base.fromBinaryStringUint8( bstr )\n 85\n > bstr = '00000000';\n > val = base.fromBinaryStringUint8( bstr )\n 0\n > bstr = '00000010';\n > val = base.fromBinaryStringUint8( bstr )\n 2\n > bstr = '11111111';\n > val = base.fromBinaryStringUint8( bstr )\n 255\n\n See Also\n --------\n base.fromBinaryStringUint16, base.fromBinaryStringUint32, base.toBinaryStringUint8\n",
"base.fromBinaryStringUint16": "\nbase.fromBinaryStringUint16( bstr )\n Creates an unsigned 16-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 16-bit integer.\n\n Examples\n --------\n > var bstr = '0101010101010101';\n > var val = base.fromBinaryStringUint16( bstr )\n 21845\n > bstr = '0000000000000000';\n > val = base.fromBinaryStringUint16( bstr )\n 0\n > bstr = '0000000000000010';\n > val = base.fromBinaryStringUint16( bstr )\n 2\n > bstr = '1111111111111111';\n > val = base.fromBinaryStringUint16( bstr )\n 65535\n\n See Also\n --------\n base.toBinaryStringUint16, base.fromBinaryStringUint32, base.fromBinaryStringUint8\n",
"base.fromBinaryStringUint32": "\nbase.fromBinaryStringUint32( bstr )\n Creates an unsigned 32-bit integer from a literal bit representation.\n\n Parameters\n ----------\n bstr: string\n Literal bit representation.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var bstr = '01010101010101010101010101010101';\n > var val = base.fromBinaryStringUint32( bstr )\n 1431655765\n > bstr = '00000000000000000000000000000000';\n > val = base.fromBinaryStringUint32( bstr )\n 0\n > bstr = '00000000000000000000000000000010';\n > val = base.fromBinaryStringUint32( bstr )\n 2\n > bstr = '11111111111111111111111111111111';\n > val = base.fromBinaryStringUint32( bstr )\n 4294967295\n\n See Also\n --------\n base.fromBinaryStringUint16, base.toBinaryStringUint32, base.fromBinaryStringUint8\n",
"base.fromWordf": "\nbase.fromWordf( x )\n Creates a single-precision floating-point number from an unsigned integer\n corresponding to an IEEE 754 binary representation.\n\n Parameters\n ----------\n x: integer\n Unsigned integer.\n\n Returns\n -------\n out: float\n Single-precision floating-point number.\n\n Examples\n --------\n > var word = 1068180177; // => 0 01111111 01010110010001011010001\n > var f32 = base.fromWordf( word ) // when printed, promoted to float64\n 1.3370000123977661\n\n See Also\n --------\n base.fromWords\n",
"base.fromWords": "\nbase.fromWords( high, low )\n Creates a double-precision floating-point number from a higher order word\n (unsigned 32-bit integer) and a lower order word (unsigned 32-bit integer).\n\n Parameters\n ----------\n high: integer\n Higher order word (unsigned 32-bit integer).\n\n low: integer\n Lower order word (unsigned 32-bit integer).\n\n Returns\n -------\n out: number\n Double-precision floating-point number.\n\n Examples\n --------\n > var v = base.fromWords( 1774486211, 2479577218 )\n 3.14e201\n > v = base.fromWords( 3221823995, 1413754136 )\n -3.141592653589793\n > v = base.fromWords( 0, 0 )\n 0.0\n > v = base.fromWords( 2147483648, 0 )\n -0.0\n > v = base.fromWords( 2146959360, 0 )\n NaN\n > v = base.fromWords( 2146435072, 0 )\n Infinity\n > v = base.fromWords( 4293918720, 0 )\n -Infinity\n\n See Also\n --------\n base.fromWordf\n",
"base.gamma": "\nbase.gamma( x )\n Evaluates the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gamma( 4.0 )\n 6.0\n > y = base.gamma( -1.5 )\n ~2.363\n > y = base.gamma( -0.5 )\n ~-3.545\n > y = base.gamma( 0.5 )\n ~1.772\n > y = base.gamma( 0.0 )\n Infinity\n > y = base.gamma( -0.0 )\n -Infinity\n > y = base.gamma( NaN )\n NaN\n\n See Also\n --------\n base.gamma1pm1, base.gammainc, base.gammaincinv, base.gammaln\n",
"base.gamma1pm1": "\nbase.gamma1pm1( x )\n Computes `gamma(x+1) - 1` without cancellation errors, where `gamma(x)` is\n the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gamma1pm1( 0.2 )\n ~-0.082\n > y = base.gamma1pm1( -6.7 )\n ~-0.991\n > y = base.gamma1pm1( 0.0 )\n 0.0\n > y = base.gamma1pm1( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammainc, base.gammaincinv, base.gammaln\n",
"base.gammaDeltaRatio": "\nbase.gammaDeltaRatio( z, delta )\n Computes the ratio of two gamma functions.\n\n The ratio is defined as: Γ(z) / Γ(z+Δ).\n\n Parameters\n ----------\n z: number\n First gamma parameter.\n\n delta: number\n Difference.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammaDeltaRatio( 2.0, 3.0 )\n ~0.042\n > y = base.gammaDeltaRatio( 4.0, 0.5 )\n ~0.516\n > y = base.gammaDeltaRatio( 100.0, 0.0 )\n 1.0\n > y = base.gammaDeltaRatio( NaN, 3.0 )\n NaN\n > y = base.gammaDeltaRatio( 5.0, NaN )\n NaN\n > y = base.gammaDeltaRatio( NaN, NaN )\n NaN\n\n See Also\n --------\n base.gamma\n",
"base.gammainc": "\nbase.gammainc( x, s[, regularized[, upper]] )\n Computes the regularized incomplete gamma function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete gamma functions, respectively.\n\n If provided `x < 0` or `s <= 0`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n s: number\n Second function parameter.\n\n regularized: boolean (optional)\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete gamma function. Default: `true`.\n\n upper: boolean (optional)\n Boolean indicating whether the function should return the upper tail of\n the incomplete gamma function. Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammainc( 6.0, 2.0 )\n ~0.9826\n > y = base.gammainc( 1.0, 2.0, true, true )\n ~0.7358\n > y = base.gammainc( 7.0, 5.0 )\n ~0.8270\n > y = base.gammainc( 7.0, 5.0, false )\n ~19.8482\n > y = base.gammainc( NaN, 2.0 )\n NaN\n > y = base.gammainc( 6.0, NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gamma1pm1, base.gammaincinv, base.gammaln\n",
"base.gammaincinv": "\nbase.gammaincinv( p, a[, upper] )\n Computes the inverse of the lower incomplete gamma function.\n\n In contrast to a more commonly used definition, the first argument is the\n probability `p` and the second argument is the scale factor `a`.\n\n By default, the function inverts the lower regularized incomplete gamma\n function, `P(x,a)`. To invert the upper function `Q(x,a)`, set the `upper`\n argument to `true`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n If provided `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Probability.\n\n a: number\n Scale parameter.\n\n upper: boolean (optional)\n Boolean indicating if the function should invert the upper tail of the\n incomplete gamma function; i.e., compute `xr` such that `Q(a,xr) = p`.\n Default: `false`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.gammaincinv( 0.5, 2.0 )\n ~1.678\n > y = base.gammaincinv( 0.1, 10.0 )\n ~6.221\n > y = base.gammaincinv( 0.75, 3.0 )\n ~3.92\n > y = base.gammaincinv( 0.75, 3.0, true )\n ~1.727\n > y = base.gammaincinv( 0.75, NaN )\n NaN\n > y = base.gammaincinv( NaN, 3.0 )\n NaN\n\n See Also\n --------\n base.gamma, base.gamma1pm1, base.gammainc, base.gammaln\n",
"base.gammaLanczosSum": "\nbase.gammaLanczosSum( x )\n Calculates the Lanczos sum for the approximation of the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Lanczos sum.\n\n Examples\n --------\n > var y = base.gammaLanczosSum( 4.0 )\n ~950.366\n > y = base.gammaLanczosSum( -1.5 )\n ~1373366.245\n > y = base.gammaLanczosSum( -0.5 )\n ~-699841.735\n > y = base.gammaLanczosSum( 0.5 )\n ~96074.186\n > y = base.gammaLanczosSum( 0.0 )\n Infinity\n > y = base.gammaLanczosSum( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammaLanczosSumExpGScaled\n",
"base.gammaLanczosSumExpGScaled": "\nbase.gammaLanczosSumExpGScaled( x )\n Calculates the scaled Lanczos sum for the approximation of the gamma\n function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Scaled Lanczos sum.\n\n Examples\n --------\n > var y = base.gammaLanczosSumExpGScaled( 4.0 )\n ~0.018\n > y = base.gammaLanczosSumExpGScaled( -1.5 )\n ~25.337\n > y = base.gammaLanczosSumExpGScaled( -0.5 )\n ~-12.911\n > y = base.gammaLanczosSumExpGScaled( 0.5 )\n ~1.772\n > y = base.gammaLanczosSumExpGScaled( 0.0 )\n Infinity\n > y = base.gammaLanczosSumExpGScaled( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammaLanczosSum\n",
"base.gammaln": "\nbase.gammaln( x )\n Evaluates the natural logarithm of the gamma function.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Natural logarithm of the gamma function.\n\n Examples\n --------\n > var y = base.gammaln( 1.0 )\n 0.0\n > y = base.gammaln( 2.0 )\n 0.0\n > y = base.gammaln( 4.0 )\n ~1.792\n > y = base.gammaln( -0.5 )\n ~1.266\n > y = base.gammaln( 0.5 )\n ~0.572\n > y = base.gammaln( 0.0 )\n Infinity\n > y = base.gammaln( NaN )\n NaN\n\n See Also\n --------\n base.gamma, base.gammainc, base.gammaincinv\n",
"base.gasum": "\nbase.gasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Array<number>|TypedArray\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n > var sum = base.gasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.gasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float64Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.gasum( N, x1, stride )\n 12.0\n\n\nbase.gasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Array<number>|TypedArray\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: number\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n > var sum = base.gasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n > sum = base.gasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n See Also\n --------\n base.dasum, base.sasum\n",
"base.gaxpy": "\nbase.gaxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n > var alpha = 5.0;\n > base.gaxpy( x.length, alpha, x, 1, y, 1 )\n [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > base.gaxpy( N, alpha, x, 2, y, -1 )\n [ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.gaxpy( N, 5.0, x1, -2, y1, 1 )\n [ 40.0, 33.0, 22.0 ]\n > y0\n [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.gaxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 1.0, 1.0, 1.0, 1.0, 1.0 ];\n > var alpha = 5.0;\n > base.gaxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n [ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gaxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n [ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n See Also\n --------\n base.daxpy, base.saxpy\n",
"base.gcd": "\nbase.gcd( a, b )\n Computes the greatest common divisor (gcd).\n\n If both `a` and `b` are `0`, the function returns `0`.\n\n Both `a` and `b` must have integer values; otherwise, the function returns\n `NaN`.\n\n Parameters\n ----------\n a: integer\n First integer.\n\n b: integer\n Second integer.\n\n Returns\n -------\n out: integer\n Greatest common divisor.\n\n Examples\n --------\n > var v = base.gcd( 48, 18 )\n 6\n\n See Also\n --------\n base.lcm\n",
"base.gcopy": "\nbase.gcopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n > base.gcopy( x.length, x, 1, y, 1 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gcopy( N, x, -2, y, 1 )\n [ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.gcopy( N, x1, -2, y1, 1 )\n <Float64Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float64Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.gcopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Array|TypedArray\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Array|TypedArray\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Array|TypedArray\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n > base.gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n > y = [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ];\n > var N = base.floor( x.length / 2 );\n > base.gcopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n [ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dcopy\n",
"base.getHighWord": "\nbase.getHighWord( x )\n Returns an unsigned 32-bit integer corresponding to the more significant 32\n bits of a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: integer\n Higher order word (unsigned 32-bit integer).\n\n Examples\n --------\n > var w = base.getHighWord( 3.14e201 )\n 1774486211\n\n See Also\n --------\n base.getLowWord, base.setHighWord\n",
"base.getLowWord": "\nbase.getLowWord( x )\n Returns an unsigned 32-bit integer corresponding to the less significant 32\n bits of a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: integer\n Lower order word (unsigned 32-bit integer).\n\n Examples\n --------\n > var w = base.getLowWord( 3.14e201 )\n 2479577218\n\n See Also\n --------\n base.getHighWord, base.setHighWord\n",
"base.hacovercos": "\nbase.hacovercos( x )\n Computes the half-value coversed cosine.\n\n The half-value coversed cosine is defined as `(1 + sin(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value coversed cosine.\n\n Examples\n --------\n > var y = base.hacovercos( 3.14 )\n ~0.5008\n > y = base.hacovercos( -4.2 )\n ~0.9358\n > y = base.hacovercos( -4.6 )\n ~0.9968\n > y = base.hacovercos( 9.5 )\n ~0.4624\n > y = base.hacovercos( -0.0 )\n 0.5\n\n See Also\n --------\n base.hacoversin, base.havercos\n",
"base.hacoversin": "\nbase.hacoversin( x )\n Computes the half-value coversed sine.\n\n The half-value coversed sine is defined as `(1 - sin(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value coversed sine.\n\n Examples\n --------\n > var y = base.hacoversin( 3.14 )\n ~0.4992\n > y = base.hacoversin( -4.2 )\n ~0.0642\n > y = base.hacoversin( -4.6 )\n ~0.0032\n > y = base.hacoversin( 9.5 )\n ~0.538\n > y = base.hacoversin( -0.0 )\n 0.5\n\n See Also\n --------\n base.hacovercos, base.haversin\n",
"base.havercos": "\nbase.havercos( x )\n Computes the half-value versed cosine.\n\n The half-value versed cosine is defined as `(1 + cos(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value versed cosine.\n\n Examples\n --------\n > var y = base.havercos( 3.14 )\n ~0.0\n > y = base.havercos( -4.2 )\n ~0.2549\n > y = base.havercos( -4.6 )\n ~0.4439\n > y = base.havercos( 9.5 )\n ~0.0014\n > y = base.havercos( -0.0 )\n 1.0\n\n See Also\n --------\n base.haversin, base.vercos\n",
"base.haversin": "\nbase.haversin( x )\n Computes the half-value versed sine.\n\n The half-value versed sine is defined as `(1 - cos(x)) / 2`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Half-value versed sine.\n\n Examples\n --------\n > var y = base.haversin( 3.14 )\n ~1.0\n > y = base.haversin( -4.2 )\n ~0.7451\n > y = base.haversin( -4.6 )\n ~0.5561\n > y = base.haversin( 9.5 )\n ~0.9986\n > y = base.haversin( -0.0 )\n 0.0\n\n See Also\n --------\n base.havercos, base.versin\n",
"base.heaviside": "\nbase.heaviside( x[, continuity] )\n Evaluates the Heaviside function.\n\n The `continuity` parameter may be one of the following:\n\n - 'half-maximum': if `x == 0`, the function returns `0.5`.\n - 'left-continuous': if `x == 0`, the function returns `0`.\n - 'right-continuous': if `x == 0`, the function returns `1`.\n\n By default, if `x == 0`, the function returns `NaN` (i.e., the function is\n discontinuous).\n\n Parameters\n ----------\n x: number\n Input value.\n\n continuity: string (optional)\n Specifies how to handle `x == 0`. By default, if `x == 0`, the function\n returns `NaN`.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.heaviside( 3.14 )\n 1.0\n > y = base.heaviside( -3.14 )\n 0.0\n > y = base.heaviside( 0.0 )\n NaN\n > y = base.heaviside( 0.0, 'half-maximum' )\n 0.5\n > y = base.heaviside( 0.0, 'left-continuous' )\n 0.0\n > y = base.heaviside( 0.0, 'right-continuous' )\n 1.0\n\n See Also\n --------\n base.ramp\n",
"base.hermitepoly": "\nbase.hermitepoly( n, x )\n Evaluates a physicist's Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.hermitepoly( 1, 0.5 )\n 1.0\n > y = base.hermitepoly( -1, 0.5 )\n NaN\n > y = base.hermitepoly( 0, 0.5 )\n 1.0\n > y = base.hermitepoly( 2, 0.5 )\n -1.0\n\n\nbase.hermitepoly.factory( n )\n Returns a function for evaluating a physicist's Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a physicist's Hermite polynomial.\n\n Examples\n --------\n > var polyval = base.hermitepoly.factory( 2 );\n > var v = polyval( 0.5 )\n -1.0\n\n See Also\n --------\n base.evalpoly, base.normhermitepoly\n",
"base.hypot": "\nbase.hypot( x, y )\n Computes the hypotenuse avoiding overflow and underflow.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = base.hypot( -5.0, 12.0 )\n 13.0\n > h = base.hypot( NaN, 12.0 )\n NaN\n > h = base.hypot( -0.0, -0.0 )\n 0.0\n\n",
"base.imul": "\nbase.imul( a, b )\n Performs C-like multiplication of two signed 32-bit integers.\n\n Parameters\n ----------\n a: integer\n Signed 32-bit integer.\n\n b: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Product.\n\n Examples\n --------\n > var v = base.imul( -10|0, 4|0 )\n -40\n\n See Also\n --------\n base.imuldw, base.uimul\n",
"base.imuldw": "\nbase.imuldw( [out,] a, b )\n Multiplies two signed 32-bit integers and returns an array of two signed 32-\n bit integers which represents the signed 64-bit integer product.\n\n When computing the product of 32-bit integer values in double-precision\n floating-point format (the default JavaScript numeric data type), computing\n the double word product is necessary in order to avoid exceeding the maximum\n safe double-precision floating-point integer value.\n\n Parameters\n ----------\n out: ArrayLikeObject (optional)\n The output array.\n\n a: integer\n Signed 32-bit integer.\n\n b: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: ArrayLikeObject\n Double word product (in big endian order; i.e., the first element\n corresponds to the most significant bits and the second element to the\n least significant bits).\n\n Examples\n --------\n > var v = base.imuldw( 1, 10 )\n [ 0, 10 ]\n\n See Also\n --------\n base.imul, base.uimuldw\n",
"base.int32ToUint32": "\nbase.int32ToUint32( x )\n Converts a signed 32-bit integer to an unsigned 32-bit integer.\n\n Parameters\n ----------\n x: integer\n Signed 32-bit integer.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var y = base.int32ToUint32( base.float64ToInt32( -32 ) )\n 4294967264\n > y = base.int32ToUint32( base.float64ToInt32( 3 ) )\n 3\n\n See Also\n --------\n base.uint32ToInt32\n",
"base.inv": "\nbase.inv( x )\n Computes the multiplicative inverse of `x`.\n\n The multiplicative inverse is defined as `1/x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Multiplicative inverse.\n\n Examples\n --------\n > var y = base.inv( -1.0 )\n -1.0\n > y = base.inv( 2.0 )\n 0.5\n > y = base.inv( 0.0 )\n Infinity\n > y = base.inv( -0.0 )\n -Infinity\n > y = base.inv( NaN )\n NaN\n\n See Also\n --------\n base.pow\n",
"base.isEven": "\nbase.isEven( x )\n Tests if a finite numeric value is an even number.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an even number.\n\n Examples\n --------\n > var bool = base.isEven( 5.0 )\n false\n > bool = base.isEven( -2.0 )\n true\n > bool = base.isEven( 0.0 )\n true\n > bool = base.isEven( NaN )\n false\n\n See Also\n --------\n base.isOdd\n",
"base.isEvenInt32": "\nbase.isEvenInt32( x )\n Tests if a 32-bit integer is even.\n\n Parameters\n ----------\n x: integer\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an even number.\n\n Examples\n --------\n > var bool = base.isEvenInt32( 5 )\n false\n > bool = base.isEvenInt32( -2 )\n true\n > bool = base.isEvenInt32( 0 )\n true\n\n See Also\n --------\n base.isEven, base.isOddInt32\n",
"base.isFinite": "\nbase.isFinite( x )\n Tests if a numeric value is finite.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is finite.\n\n Examples\n --------\n > var bool = base.isFinite( 5.0 )\n true\n > bool = base.isFinite( -2.0e64 )\n true\n > bool = base.isFinite( PINF )\n false\n > bool = base.isFinite( NINF )\n false\n\n See Also\n --------\n base.isInfinite\n",
"base.isInfinite": "\nbase.isInfinite( x )\n Tests if a numeric value is infinite.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is infinite.\n\n Examples\n --------\n > var bool = base.isInfinite( PINF )\n true\n > bool = base.isInfinite( NINF )\n true\n > bool = base.isInfinite( 5.0 )\n false\n > bool = base.isInfinite( NaN )\n false\n\n See Also\n --------\n base.isFinite\n",
"base.isInteger": "\nbase.isInteger( x )\n Tests if a finite double-precision floating-point number is an integer.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an integer.\n\n Examples\n --------\n > var bool = base.isInteger( 1.0 )\n true\n > bool = base.isInteger( 3.14 )\n false\n\n",
"base.isnan": "\nbase.isnan( x )\n Tests if a numeric value is `NaN`.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is `NaN`.\n\n Examples\n --------\n > var bool = base.isnan( NaN )\n true\n > bool = base.isnan( 7.0 )\n false\n\n",
"base.isNegativeInteger": "\nbase.isNegativeInteger( x )\n Tests if a finite double-precision floating-point number is a negative\n integer.\n\n The function assumes a finite number. If provided negative infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a negative integer.\n\n Examples\n --------\n > var bool = base.isNegativeInteger( -1.0 )\n true\n > bool = base.isNegativeInteger( 0.0 )\n false\n > bool = base.isNegativeInteger( 10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNonNegativeInteger, base.isNonPositiveInteger, base.isPositiveInteger\n",
"base.isNegativeZero": "\nbase.isNegativeZero( x )\n Tests if a numeric value is negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is negative zero.\n\n Examples\n --------\n > var bool = base.isNegativeZero( -0.0 )\n true\n > bool = base.isNegativeZero( 0.0 )\n false\n\n See Also\n --------\n base.isPositiveZero\n",
"base.isNonNegativeInteger": "\nbase.isNonNegativeInteger( x )\n Tests if a finite double-precision floating-point number is a nonnegative\n integer.\n\n The function assumes a finite number. If provided positive infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n The function does not distinguish between positive and negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a nonnegative integer.\n\n Examples\n --------\n > var bool = base.isNonNegativeInteger( 1.0 )\n true\n > bool = base.isNonNegativeInteger( 0.0 )\n true\n > bool = base.isNonNegativeInteger( -10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonPositiveInteger, base.isPositiveInteger\n",
"base.isNonPositiveInteger": "\nbase.isNonPositiveInteger( x )\n Tests if a finite double-precision floating-point number is a nonpositive\n integer.\n\n The function assumes a finite number. If provided negative infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n The function does not distinguish between positive and negative zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a nonpositive integer.\n\n Examples\n --------\n > var bool = base.isNonPositiveInteger( -1.0 )\n true\n > bool = base.isNonPositiveInteger( 0.0 )\n true\n > bool = base.isNonPositiveInteger( 10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonNegativeInteger, base.isPositiveInteger\n",
"base.isOdd": "\nbase.isOdd( x )\n Tests if a finite numeric value is an odd number.\n\n The function assumes a finite number. If provided positive or negative\n infinity, the function will return `true`, when, in fact, the result is\n undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an odd number.\n\n Examples\n --------\n > var bool = base.isOdd( 5.0 )\n true\n > bool = base.isOdd( -2.0 )\n false\n > bool = base.isOdd( 0.0 )\n false\n > bool = base.isOdd( NaN )\n false\n\n See Also\n --------\n base.isEven\n",
"base.isOddInt32": "\nbase.isOddInt32( x )\n Tests if a 32-bit integer is odd.\n\n Parameters\n ----------\n x: integer\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is an odd number.\n\n Examples\n --------\n > var bool = base.isOddInt32( 5 )\n true\n > bool = base.isOddInt32( -2 )\n false\n > bool = base.isOddInt32( 0 )\n false\n\n See Also\n --------\n base.isEvenInt32, base.isOdd\n",
"base.isPositiveInteger": "\nbase.isPositiveInteger( x )\n Tests if a finite double-precision floating-point number is a positive\n integer.\n\n The function assumes a finite number. If provided positive infinity, the\n function will return `true`, when, in fact, the result is undefined.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a positive integer.\n\n Examples\n --------\n > var bool = base.isPositiveInteger( 1.0 )\n true\n > bool = base.isPositiveInteger( 0.0 )\n false\n > bool = base.isPositiveInteger( -10.0 )\n false\n\n See Also\n --------\n base.isInteger, base.isNegativeInteger, base.isNonNegativeInteger, base.isNonPositiveInteger\n",
"base.isPositiveZero": "\nbase.isPositiveZero( x )\n Tests if a numeric value is positive zero.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is positive zero.\n\n Examples\n --------\n > var bool = base.isPositiveZero( 0.0 )\n true\n > bool = base.isPositiveZero( -0.0 )\n false\n\n See Also\n --------\n base.isNegativeZero\n",
"base.isPow2Uint32": "\nbase.isPow2Uint32( x )\n Tests whether an unsigned integer is a power of 2.\n\n Parameters\n ----------\n x: integer\n Unsigned integer.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a power of 2.\n\n Examples\n --------\n > var bool = base.isPow2Uint32( 2 )\n true\n > bool = base.isPow2Uint32( 5 )\n false\n\n",
"base.isProbability": "\nbase.isProbability( x )\n Tests if a numeric value is a probability.\n\n A probability is defined as a numeric value on the closed interval `[0,1]`.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a probability.\n\n Examples\n --------\n > var bool = base.isProbability( 0.5 )\n true\n > bool = base.isProbability( 3.14 )\n false\n > bool = base.isProbability( NaN )\n false\n\n",
"base.isSafeInteger": "\nbase.isSafeInteger( x )\n Tests if a finite double-precision floating-point number is a safe integer.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n x: number\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the value is a safe integer.\n\n Examples\n --------\n > var bool = base.isSafeInteger( 1.0 )\n true\n > bool = base.isSafeInteger( 2.0e200 )\n false\n > bool = base.isSafeInteger( 3.14 )\n false\n\n",
"base.kernelBetainc": "\nbase.kernelBetainc( [out,] x, a, b, regularized, upper )\n Computes the kernel function for the regularized incomplete beta function.\n\n The `regularized` and `upper` parameters specify whether to evaluate the\n non-regularized and/or upper incomplete beta functions, respectively.\n\n If provided `x < 0` or `x > 1`, the function returns `[ NaN, NaN ]`.\n\n If provided `a < 0` or `b < 0`, the function returns `[ NaN, NaN ]`.\n\n If provided `NaN` for `x`, `a`, or `b`, the function returns `[ NaN, NaN ]`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n First function parameter.\n\n a: number\n Second function parameter.\n\n b: number\n Third function parameter.\n\n regularized: boolean\n Boolean indicating whether the function should evaluate the regularized\n or non-regularized incomplete beta function.\n\n upper: boolean\n Boolean indicating whether the function should return the upper tail of\n the incomplete beta function.\n\n Returns\n -------\n y: Array|TypedArray|Object\n Function value and first derivative.\n\n Examples\n --------\n > var out = base.kernelBetainc( 0.8, 1.0, 0.3, false, false )\n [ ~1.277, ~0.926 ]\n > out = base.kernelBetainc( 0.2, 1.0, 2.0, true, false )\n [ 0.32, 1.6 ]\n\n > out = new Array( 2 );\n > var v = base.kernelBetainc( out, 0.2, 1.0, 2.0, true, true )\n [ 0.64, 1.6 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.betainc\n",
"base.kernelBetaincinv": "\nbase.kernelBetaincinv( a, b, p, q )\n Computes the inverse of the lower incomplete beta function.\n\n Probabilities `p` and `q` must satisfy `p = 1 - q`.\n\n Parameters\n ----------\n a: number\n First function parameter (a positive number).\n\n b: number\n Second function parameter (a positive number).\n\n p: number\n Probability.\n\n q: number\n Probability equal to `1-p`.\n\n Returns\n -------\n out: Array\n Two-element array holding function value `y` and `1-y`.\n\n Examples\n --------\n > var y = base.kernelBetaincinv( 3.0, 3.0, 0.2, 0.8 )\n [ ~0.327, ~0.673 ]\n > y = base.kernelBetaincinv( 3.0, 3.0, 0.4, 0.6 )\n [ ~0.446, ~0.554 ]\n > y = base.kernelBetaincinv( 1.0, 6.0, 0.4, 0.6 )\n [ ~0.082, ~0.918 ]\n > y = base.kernelBetaincinv( 1.0, 6.0, 0.8, 0.2 )\n [ ~0.235, ~0.765 ]\n\n See Also\n --------\n base.betaincinv\n",
"base.kernelCos": "\nbase.kernelCos( x, y )\n Computes the cosine of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the cosine should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The two numbers must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n Returns\n -------\n out: number\n Cosine.\n\n Examples\n --------\n > var out = base.kernelCos( 0.0, 0.0 )\n ~1.0\n > out = base.kernelCos( PI/6.0, 0.0 )\n ~0.866\n > out = base.kernelCos( 0.785, -1.144e-17 )\n ~0.707\n > out = base.kernelCos( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.kernelSin, base.kernelTan\n",
"base.kernelSin": "\nbase.kernelSin( x, y )\n Computes the sine of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the cosine should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The two numbers must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either argument is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n Returns\n -------\n out: number\n Sine.\n\n Examples\n --------\n > var y = base.kernelSin( 0.0, 0.0 )\n ~0.0\n > y = base.kernelSin( PI/6.0, 0.0 )\n ~0.5\n > y = base.kernelSin( 0.619, 9.279e-18 )\n ~0.58\n\n > y = base.kernelSin( NaN, 0.0 )\n NaN\n > y = base.kernelSin( 2.0, NaN )\n NaN\n > y = base.kernelSin( NaN, NaN )\n NaN\n\n See Also\n --------\n base.kernelCos, base.kernelTan, base.sin\n",
"base.kernelTan": "\nbase.kernelTan( x, y, k )\n Computes the tangent of a number on `[-π/4, π/4]`.\n\n For increased accuracy, the number for which the tangent should be evaluated\n can be supplied as a double-double number (i.e., a non-evaluated sum of two\n double-precision floating-point numbers `x` and `y`).\n\n The numbers `x` and `y` must satisfy `|y| < 0.5 * ulp( x )`.\n\n If either `x` or `y` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n y: number\n Tail of `x`.\n\n k: integer\n If `k=1`, the function returns `tan(x+y)`. If `k=-1`, the function\n returns the negative inverse `-1/tan(x+y)`.\n\n Returns\n -------\n out: number\n Tangent.\n\n Examples\n --------\n > var out = base.kernelTan( PI/4.0, 0.0, 1 )\n ~1.0\n > out = base.kernelTan( PI/4.0, 0.0, -1 )\n ~-1.0\n > out = base.kernelTan( PI/6.0, 0.0, 1 )\n ~0.577\n > out = base.kernelTan( 0.664, 5.288e-17, 1 )\n ~0.783\n\n > out = base.kernelTan( NaN, 0.0, 1 )\n NaN\n > out = base.kernelTan( 3.0, NaN, 1 )\n NaN\n > out = base.kernelTan( 3.0, 0.0, NaN )\n NaN\n\n See Also\n --------\n base.kernelCos, base.kernelSin, base.tan\n",
"base.kroneckerDelta": "\nbase.kroneckerDelta( i, j )\n Evaluates the Kronecker delta.\n\n If `i == j`, the function returns `1`; otherwise, the function returns zero.\n\n Parameters\n ----------\n i: number\n Input value.\n\n j: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.kroneckerDelta( 3.14, 0.0 )\n 0.0\n > y = base.kroneckerDelta( 3.14, 3.14 )\n 1.0\n\n See Also\n --------\n base.diracDelta\n",
"base.lcm": "\nbase.lcm( a, b )\n Computes the least common multiple (lcm).\n\n If either `a` or `b` is `0`, the function returns `0`.\n\n Both `a` and `b` must have integer values; otherwise, the function returns\n `NaN`.\n\n Parameters\n ----------\n a: integer\n First integer.\n\n b: integer\n Second integer.\n\n Returns\n -------\n out: integer\n Least common multiple.\n\n Examples\n --------\n > var v = base.lcm( 21, 6 )\n 42\n\n See Also\n --------\n base.gcd\n",
"base.ldexp": "\nbase.ldexp( frac, exp )\n Multiplies a double-precision floating-point number by an integer power of\n two; i.e., `x = frac * 2^exp`.\n\n If `frac` equals positive or negative `zero`, `NaN`, or positive or negative\n infinity, the function returns a value equal to `frac`.\n\n Parameters\n ----------\n frac: number\n Fraction.\n\n exp: number\n Exponent.\n\n Returns\n -------\n out: number\n Double-precision floating-point number equal to `frac * 2^exp`.\n\n Examples\n --------\n > var x = base.ldexp( 0.5, 3 )\n 4.0\n > x = base.ldexp( 4.0, -2 )\n 1.0\n > x = base.ldexp( 0.0, 20 )\n 0.0\n > x = base.ldexp( -0.0, 39 )\n -0.0\n > x = base.ldexp( NaN, -101 )\n NaN\n > x = base.ldexp( PINF, 11 )\n Infinity\n > x = base.ldexp( NINF, -118 )\n -Infinity\n\n See Also\n --------\n base.frexp\n",
"base.ln": "\nbase.ln( x )\n Evaluates the natural logarithm.\n\n For negative numbers, the natural logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.ln( 4.0 )\n ~1.386\n > y = base.ln( 0.0 )\n -Infinity\n > y = base.ln( PINF )\n Infinity\n > y = base.ln( NaN )\n NaN\n > y = base.ln( -4.0 )\n NaN\n\n See Also\n --------\n base.exp, base.log10, base.log1p, base.log2\n",
"base.log": "\nbase.log( x, b )\n Computes the base `b` logarithm of `x`.\n\n For negative `b` or `x`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n b: number\n Base.\n\n Returns\n -------\n y: number\n Logarithm (base `b`).\n\n Examples\n --------\n > var y = base.log( 100.0, 10.0 )\n 2.0\n > y = base.log( 16.0, 2.0 )\n 4.0\n > y = base.log( 5.0, 1.0 )\n Infinity\n > y = base.log( NaN, 2.0 )\n NaN\n > y = base.log( 1.0, NaN )\n NaN\n > y = base.log( -4.0, 2.0 )\n NaN\n > y = base.log( 4.0, -2.0 )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log10, base.log1p, base.log2\n",
"base.log1mexp": "\nbase.log1mexp( x )\n Evaluates the natural logarithm of `1-exp(-|x|)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1mexp( -10.0 )\n ~-0.00005\n > y = base.log1mexp( 0.0 )\n -Infinity\n > y = base.log1mexp( 5.0 )\n ~-0.00676\n > y = base.log1mexp( 10.0 )\n ~-0.00005\n > y = base.log1mexp( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log1p, base.log1pexp",
"base.log1p": "\nbase.log1p( x )\n Evaluates the natural logarithm of `1+x`.\n\n For `x < -1`, the function returns `NaN`, as the natural logarithm is not\n defined for negative numbers.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1p( 4.0 )\n ~1.609\n > y = base.log1p( -1.0 )\n -Infinity\n > y = base.log1p( 0.0 )\n 0.0\n > y = base.log1p( -0.0 )\n -0.0\n > y = base.log1p( -2.0 )\n NaN\n > y = base.log1p( NaN )\n NaN\n\n See Also\n --------\n base.ln, base.log\n",
"base.log1pexp": "\nbase.log1pexp( x )\n Evaluates the natural logarithm of `1+exp(x)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log1pexp( -10.0 )\n ~0.000045\n > y = base.log1pexp( 0.0 )\n ~0.693147\n > y = base.log1pexp( 5.0 )\n ~5.006715\n > y = base.log1pexp( 34.0 )\n 34.0\n > y = base.log1pexp( NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln, base.log1mexp, base.log1p",
"base.log2": "\nbase.log2( x )\n Evaluates the binary logarithm (base two).\n\n For negative numbers, the binary logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log2( 4.0 )\n 2.0\n > y = base.log2( 8.0 )\n 3.0\n > y = base.log2( 0.0 )\n -Infinity\n > y = base.log2( PINF )\n Infinity\n > y = base.log2( NaN )\n NaN\n > y = base.log2( -4.0 )\n NaN\n\n See Also\n --------\n base.exp2, base.ln, base.log\n",
"base.log10": "\nbase.log10( x )\n Evaluates the common logarithm (base 10).\n\n For negative numbers, the common logarithm is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.log10( 100.0 )\n 2.0\n > y = base.log10( 8.0 )\n ~0.903\n > y = base.log10( 0.0 )\n -Infinity\n > y = base.log10( PINF )\n Infinity\n > y = base.log10( NaN )\n NaN\n > y = base.log10( -4.0 )\n NaN\n\n See Also\n --------\n base.exp10, base.ln, base.log\n",
"base.logaddexp": "\nbase.logaddexp( x, y )\n Computes the natural logarithm of `exp(x) + exp(y)`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n v: number\n Function value.\n\n Examples\n --------\n > var v = base.logaddexp( 90.0, 90.0 )\n ~90.6931\n > v = base.logaddexp( -20.0, 90.0 )\n 90.0\n > v = base.logaddexp( 0.0, -100.0 )\n ~3.7201e-44\n > v = base.logaddexp( NaN, NaN )\n NaN\n\n See Also\n --------\n base.exp, base.ln\n",
"base.logit": "\nbase.logit( p )\n Evaluates the logit function.\n\n Let `p` be the probability of some event. The logit function is defined as\n the logarithm of the odds `p / (1-p)`.\n\n If `p < 0` or `p > 1`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.logit( 0.2 )\n ~-1.386\n > y = base.logit( 0.9 )\n ~2.197\n > y = base.logit( -4.0 )\n NaN\n > y = base.logit( 1.5 )\n NaN\n > y = base.logit( NaN )\n NaN\n\n",
"base.lucas": "\nbase.lucas( n )\n Computes the nth Lucas number.\n\n Lucas numbers follow the recurrence relation\n\n L_n = L_{n-1} + L_{n-2}\n\n with seed values L_0 = 2 and L_1 = 1.\n\n If `n` is greater than `76`, the function returns `NaN`, as larger Lucas\n numbers cannot be accurately represented due to limitations of double-\n precision floating-point format.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n Lucas number.\n\n Examples\n --------\n > var y = base.lucas( 0 )\n 2\n > y = base.lucas( 1 )\n 1\n > y = base.lucas( 2 )\n 3\n > y = base.lucas( 3 )\n 4\n > y = base.lucas( 4 )\n 7\n > y = base.lucas( 77 )\n NaN\n > y = base.lucas( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negalucas\n",
"base.lucaspoly": "\nbase.lucaspoly( n, x )\n Evaluates a Lucas polynomial.\n\n Parameters\n ----------\n n: integer\n Lucas polynomial to evaluate.\n\n x: number\n Value at which to evaluate the Lucas polynomial.\n\n Returns\n -------\n out: number\n Evaluated Lucas polynomial.\n\n Examples\n --------\n // 2^5 + 5*2^3 + 5*2\n > var v = base.lucaspoly( 5, 2.0 )\n 82.0\n\n\nbase.lucaspoly.factory( n )\n Returns a function for evaluating a Lucas polynomial.\n\n Parameters\n ----------\n n: integer\n Lucas polynomial to evaluate.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a Lucas polynomial.\n\n Examples\n --------\n > var polyval = base.lucaspoly.factory( 5 );\n\n // 1^5 + 5*1^2 + 5\n > var v = polyval( 1.0 )\n 11.0\n\n // 2^5 + 5*2^3 + 5*2\n > v = polyval( 2.0 )\n 82.0\n\n See Also\n --------\n base.evalpoly, base.fibpoly\n",
"base.max": "\nbase.max( [x[, y[, ...args]]] )\n Returns the maximum value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), negative infinity is the\n least upper bound. Similar to zero being the identity element for the sum of\n an empty set and to one being the identity element for the product of an\n empty set, negative infinity is the identity element for the maximum, and\n thus, if not provided any arguments, the function returns negative infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var v = base.max( 3.14, 4.2 )\n 4.2\n > v = base.max( 5.9, 3.14, 4.2 )\n 5.9\n > v = base.max( 3.14, NaN )\n NaN\n > v = base.max( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.maxabs, base.min\n",
"base.maxabs": "\nbase.maxabs( [x[, y[, ...args]]] )\n Returns the maximum absolute value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), negative infinity is the\n least upper bound. Similar to zero being the identity element for the sum of\n an empty set and to one being the identity element for the product of an\n empty set, negative infinity is the identity element for the maximum, and\n thus, if not provided any arguments, the function returns `+infinity` (i.e.,\n the absolute value of `-infinity`).\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Maximum absolute value.\n\n Examples\n --------\n > var v = base.maxabs( 3.14, -4.2 )\n 4.2\n > v = base.maxabs( 5.9, 3.14, 4.2 )\n 5.9\n > v = base.maxabs( 3.14, NaN )\n NaN\n > v = base.maxabs( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.max, base.minabs\n",
"base.min": "\nbase.min( [x[, y[, ...args]]] )\n Returns the minimum value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), positive infinity is the\n greatest lower bound. Similar to zero being the identity element for the sum\n of an empty set and to one being the identity element for the product of an\n empty set, positive infinity is the identity element for the minimum, and\n thus, if not provided any arguments, the function returns positive infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var v = base.min( 3.14, 4.2 )\n 3.14\n > v = base.min( 5.9, 3.14, 4.2 )\n 3.14\n > v = base.min( 3.14, NaN )\n NaN\n > v = base.min( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.max, base.minabs\n",
"base.minabs": "\nbase.minabs( [x[, y[, ...args]]] )\n Returns the minimum absolute value.\n\n If any argument is `NaN`, the function returns `NaN`.\n\n When an empty set is considered a subset of the extended reals (all real\n numbers, including positive and negative infinity), positive infinity is the\n greatest upper bound. Similar to zero being the identity element for the sum\n of an empty set and to one being the identity element for the product of an\n empty set, positive infinity is the identity element for the minimum, and\n thus, if not provided any arguments, the function returns positive infinity.\n\n Parameters\n ----------\n x: number (optional)\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: number\n Minimum absolute value.\n\n Examples\n --------\n > var v = base.minabs( 3.14, -4.2 )\n 3.14\n > v = base.minabs( 5.9, 3.14, 4.2 )\n 3.14\n > v = base.minabs( 3.14, NaN )\n NaN\n > v = base.minabs( +0.0, -0.0 )\n +0.0\n\n See Also\n --------\n base.maxabs, base.min\n",
"base.minmax": "\nbase.minmax( [out,] x[, y[, ...args]] )\n Returns the minimum and maximum values.\n\n If any argument is `NaN`, the function returns `NaN` for both the minimum\n and maximum values.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output object.\n\n x: number\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Minimum and maximum values.\n\n Examples\n --------\n > var v = base.minmax( 3.14, 4.2 )\n [ 3.14, 4.2 ]\n > v = base.minmax( 5.9, 3.14, 4.2 )\n [ 3.14, 5.9 ]\n > v = base.minmax( 3.14, NaN )\n [ NaN, NaN ]\n > v = base.minmax( +0.0, -0.0 )\n [ -0.0, +0.0 ]\n > v = base.minmax( 3.14 )\n [ 3.14, 3.14 ]\n > var out = new Array( 2 );\n > v = base.minmax( out, 3.14 )\n [ 3.14, 3.14 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.max, base.min, base.minmaxabs\n",
"base.minmaxabs": "\nbase.minmaxabs( [out,] x[, y[, ...args]] )\n Returns the minimum and maximum absolute values.\n\n If any argument is `NaN`, the function returns `NaN` for both the minimum\n and maximum absolute values.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output object.\n\n x: number\n First number.\n\n y: number (optional)\n Second number.\n\n args: ...number (optional)\n Numbers.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Minimum and maximum absolute values.\n\n Examples\n --------\n > var v = base.minmaxabs( 3.14, 4.2 )\n [ 3.14, 4.2 ]\n > v = base.minmaxabs( -5.9, 3.14, 4.2 )\n [ 3.14, 5.9 ]\n > v = base.minmaxabs( 3.14, NaN )\n [ NaN, NaN ]\n > v = base.minmaxabs( +0.0, -0.0 )\n [ 0.0, 0.0 ]\n > v = base.minmaxabs( 3.14 )\n [ 3.14, 3.14 ]\n > var out = new Array( 2 );\n > v = base.minmaxabs( out, 3.14 )\n [ 3.14, 3.14 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.maxabs, base.minabs, base.minmax\n",
"base.modf": "\nbase.modf( [out,] x )\n Decomposes a double-precision floating-point number into integral and\n fractional parts, each having the same type and sign as the input value.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n parts: Array|TypedArray|Object\n Integral and fractional parts.\n\n Examples\n --------\n > var parts = base.modf( 3.14 )\n [ 3.0, 0.14000000000000012 ]\n > parts = base.modf( 3.14 )\n [ 3.0, 0.14000000000000012 ]\n > parts = base.modf( +0.0 )\n [ +0.0, +0.0 ]\n > parts = base.modf( -0.0 )\n [ -0.0, -0.0 ]\n > parts = base.modf( PINF )\n [ Infinity, +0.0 ]\n > parts = base.modf( NINF )\n [ -Infinity, -0.0 ]\n > parts = base.modf( NaN )\n [ NaN, NaN ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > parts = base.modf( out, 3.14 )\n <Float64Array>[ 3.0, 0.14000000000000012 ]\n > var bool = ( parts === out )\n true\n\n",
"base.ndarray": "\nbase.ndarray( dtype, ndims[, options] )\n Returns an ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n Returns\n -------\n ctor: Function\n ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = base.ndarray( 'float64', 3 )\n <Function>\n\n // To create a new instance...\n > var b = [ 1, 2, 3, 4 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40 );\n > arr.get( 1, 1 )\n 40\n\n // Set an element using a linear index:\n > arr.iset( 3, 99 );\n > arr.get( 1, 1 )\n 99\n\n See Also\n --------\n array, ndarray\n",
"base.ndarrayMemoized": "\nbase.ndarrayMemoized( dtype, ndims[, options] )\n Returns a memoized ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n Returns\n -------\n ctor: Function\n Memoized ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = base.ndarrayMemoized( 'float64', 3 )\n <Function>\n > var f = base.ndarrayMemoized( 'float64', 3 )\n <Function>\n > var bool = ( f === ctor )\n true\n\n // To create a new instance...\n > var b = [ 1, 2, 3, 4 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40 );\n > arr.get( 1, 1 )\n 40\n\n // Set an element using a linear index:\n > arr.iset( 3, 99 );\n > arr.get( 1, 1 )\n 99\n\n See Also\n --------\n array, base.ndarray, ndarray, ndarrayMemoized\n",
"base.negafibonacci": "\nbase.negafibonacci( n )\n Computes the nth negaFibonacci number.\n\n The negaFibonacci numbers follow the recurrence relation\n\n F_{n-2} = F_{n} - F_{n-1}\n\n with seed values F_0 = 0 and F_{-1} = 1.\n\n If `|n|` is greater than `78`, the function returns `NaN` as larger\n negaFibonacci numbers cannot be accurately represented due to limitations of\n double-precision floating-point format.\n\n If not provided a non-positive integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n NegaFibonacci number.\n\n Examples\n --------\n > var y = base.negafibonacci( 0 )\n 0\n > y = base.negafibonacci( -1 )\n 1\n > y = base.negafibonacci( -2 )\n -1\n > y = base.negafibonacci( -3 )\n 2\n > y = base.negafibonacci( -4 )\n -3\n > y = base.negafibonacci( -79 )\n NaN\n > y = base.negafibonacci( -80 )\n NaN\n > y = base.negafibonacci( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.negalucas\n",
"base.negalucas": "\nbase.negalucas( n )\n Computes the nth negaLucas number.\n\n The negaLucas numbers follow the recurrence relation\n\n L_{n-2} = L_{n} - L_{n-1}\n\n with seed values L_0 = 2 and L_{-1} = -1.\n\n If `|n|` is greater than `76`, the function returns `NaN` as larger\n negaLucas numbers cannot be accurately represented due to limitations of\n double-precision floating-point format.\n\n If not provided a non-positive integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: integer\n NegaLucas number.\n\n Examples\n --------\n > var y = base.negalucas( 0 )\n 2\n > y = base.negalucas( -1 )\n -1\n > y = base.negalucas( -2 )\n 3\n > y = base.negalucas( -3 )\n -4\n > y = base.negalucas( -4 )\n 7\n > y = base.negalucas( -77 )\n NaN\n > y = base.negalucas( -78 )\n NaN\n > y = base.negalucas( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci, base.lucas, base.negafibonacci\n",
"base.nonfibonacci": "\nbase.nonfibonacci( n )\n Computes the nth non-Fibonacci number.\n\n If not provided a non-negative integer value, the function returns `NaN`.\n\n If provided `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Input value.\n\n Returns\n -------\n y: number\n Non-Fibonacci number.\n\n Examples\n --------\n > var v = base.nonfibonacci( 1 )\n 4\n > v = base.nonfibonacci( 2 )\n 6\n > v = base.nonfibonacci( 3 )\n 7\n > v = base.nonfibonacci( NaN )\n NaN\n\n See Also\n --------\n base.fibonacci\n",
"base.normalize": "\nbase.normalize( [out,] x )\n Returns a normal number and exponent satisfying `x = y * 2^exp` as an array.\n\n The first element of the returned array corresponds to `y` and the second to\n `exp`.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n An array containing `y` and `exp`.\n\n Examples\n --------\n > var out = base.normalize( 3.14e-319 )\n [ 1.4141234400356668e-303, -52 ]\n > var y = out[ 0 ];\n > var exponent = out[ 1 ];\n > var bool = ( y*base.pow(2.0, exponent) === 3.14e-319 )\n true\n\n // Special cases:\n > out = base.normalize( 0.0 )\n [ 0.0, 0 ];\n > out = base.normalize( PINF )\n [ Infinity, 0 ]\n > out = base.normalize( NINF )\n [ -Infinity, 0 ]\n > out = base.normalize( NaN )\n [ NaN, 0 ]\n\n // Provide an output array:\n > out = new Float64Array( 2 );\n > var v = base.normalize( out, 3.14e-319 )\n <Float64Array>[ 1.4141234400356668e-303, -52 ]\n > bool = ( v === out )\n true\n\n See Also\n --------\n base.normalizef\n",
"base.normalizef": "\nbase.normalizef( [out,] x )\n Returns a normal number `y` and exponent `exp` satisfying `x = y * 2^exp` as\n an array.\n\n The first element of the returned array corresponds to `y` and the second to\n `exp`.\n\n While the function accepts higher precision floating-point numbers, beware\n that providing such numbers can be a source of subtle bugs as the relation\n `x = y * 2^exp` may not hold.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n An array containing `y` and `exp`.\n\n Examples\n --------\n > var out = base.normalizef( base.float64ToFloat32( 1.401e-45 ) )\n [ 1.1754943508222875e-38, -23 ]\n > var y = out[ 0 ];\n > var exp = out[ 1 ];\n > var bool = ( y*base.pow(2,exp) === base.float64ToFloat32(1.401e-45) )\n true\n\n // Special cases:\n > out = base.normalizef( FLOAT32_PINF )\n [ Infinity, 0 ]\n > out = base.normalizef( FLOAT32_NINF )\n [ -Infinity, 0 ]\n > out = base.normalizef( NaN )\n [ NaN, 0 ]\n\n // Provide an output array:\n > out = new Float32Array( 2 );\n > var v = base.normalizef( out, base.float64ToFloat32( 1.401e-45 ) )\n <Float32Array>[ 1.1754943508222875e-38, -23.0 ]\n > bool = ( v === out )\n true\n\n See Also\n --------\n base.normalize\n",
"base.normhermitepoly": "\nbase.normhermitepoly( n, x )\n Evaluates a normalized Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n x: number\n Value at which to evaluate the polynomial.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.normhermitepoly( 1, 0.5 )\n 0.5\n > y = base.normhermitepoly( -1, 0.5 )\n NaN\n > y = base.normhermitepoly( 0, 0.5 )\n 1.0\n > y = base.normhermitepoly( 2, 0.5 )\n -0.75\n\n\nbase.normhermitepoly.factory( n )\n Returns a function for evaluating a normalized Hermite polynomial.\n\n Parameters\n ----------\n n: integer\n Non-negative polynomial degree.\n\n Returns\n -------\n fcn: Function\n Function for evaluating a normalized Hermite polynomial.\n\n Examples\n --------\n > var polyval = base.normhermitepoly.factory( 2 );\n > var v = polyval( 0.5 )\n -0.75\n\n See Also\n --------\n base.evalpoly, base.hermitepoly\n",
"base.pdiff": "\nbase.pdiff( x, y )\n Returns the positive difference between `x` and `y` if `x > y`; otherwise,\n returns `0`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Positive difference.\n\n Examples\n --------\n > var v = base.pdiff( 5.9, 3.14 )\n 2.76\n > v = base.pdiff( 3.14, 4.2 )\n 0.0\n > v = base.pdiff( 3.14, NaN )\n NaN\n > v = base.pdiff( -0.0, +0.0 )\n +0.0\n\n",
"base.polygamma": "\nbase.polygamma( n, x )\n Evaluates the polygamma function of order `n`; i.e., the (n+1)th derivative\n of the natural logarithm of the gamma function.\n\n If `n` is not a non-negative integer, the function returns `NaN`.\n\n If `x` is zero or a negative integer, the function returns `NaN`.\n\n If provided `NaN` as either parameter, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Derivative order.\n\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.polygamma( 3, 1.2 )\n ~3.245\n > v = base.polygamma( 5, 1.2 )\n ~41.39\n > v = base.polygamma( 3, -4.9 )\n ~60014.239\n > v = base.polygamma( -1, 5.3 )\n NaN\n > v = base.polygamma( 2, -1.0 )\n Infinity\n\n See Also\n --------\n base.trigamma, base.digamma, base.gamma\n",
"base.pow": "\nbase.pow( b, x )\n Evaluates the exponential function `bˣ`.\n\n Parameters\n ----------\n b: number\n Base.\n\n x: number\n Exponent.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.pow( 2.0, 3.0 )\n 8.0\n > y = base.pow( 4.0, 0.5 )\n 2.0\n > y = base.pow( 100.0, 0.0 )\n 1.0\n > y = base.pow( PI, 5.0 )\n ~306.0197\n > y = base.pow( PI, -0.2 )\n ~0.7954\n > y = base.pow( NaN, 3.0 )\n NaN\n > y = base.pow( 5.0, NaN )\n NaN\n > y = base.pow( NaN, NaN )\n NaN\n\n See Also\n --------\n base.exp, base.powm1\n",
"base.powm1": "\nbase.powm1( b, x )\n Evaluates `bˣ - 1`.\n\n When `b` is close to `1` and/or `x` is small, this function is more accurate\n than naively computing `bˣ` and subtracting `1`.\n\n Parameters\n ----------\n b: number\n Base.\n\n x: number\n Exponent.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.powm1( 2.0, 3.0 )\n 7.0\n > y = base.powm1( 4.0, 0.5 )\n 1.0\n > y = base.powm1( 0.0, 100.0 )\n -1.0\n > y = base.powm1( 100.0, 0.0 )\n 0.0\n > y = base.powm1( 0.0, 0.0 )\n 0.0\n > y = base.powm1( PI, 5.0 )\n ~305.0197\n > y = base.powm1( NaN, 3.0 )\n NaN\n > y = base.powm1( 5.0, NaN )\n NaN\n\n See Also\n --------\n base.pow\n",
"base.rad2deg": "\nbase.rad2deg( x )\n Converts an angle from radians to degrees.\n\n Parameters\n ----------\n x: number\n Angle in radians.\n\n Returns\n -------\n d: number\n Angle in degrees.\n\n Examples\n --------\n > var d = base.rad2deg( PI/2.0 )\n 90.0\n > d = base.rad2deg( -PI/4.0 )\n -45.0\n > d = base.rad2deg( NaN )\n NaN\n\n // Due to finite precision, canonical values may not be returned:\n > d = base.rad2deg( PI/6.0 )\n 29.999999999999996\n\n See Also\n --------\n base.deg2rad\n",
"base.ramp": "\nbase.ramp( x )\n Evaluates the ramp function.\n\n If `x >= 0`, the function returns `x`; otherwise, the function returns zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.ramp( 3.14 )\n 3.14\n > y = base.ramp( -3.14 )\n 0.0\n\n See Also\n --------\n base.heaviside\n",
"base.random.arcsine": "\nbase.random.arcsine( a, b )\n Returns a pseudorandom number drawn from an arcsine distribution.\n\n If `a >= b`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.arcsine( 2.0, 5.0 )\n <number>\n\n\nbase.random.arcsine.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an arcsine distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.arcsine.factory();\n > var r = rand( 0.0, 1.0 )\n <number>\n > r = rand( -2.0, 2.0 )\n <number>\n\n // Provide `a` and `b`:\n > rand = base.random.arcsine.factory( 0.0, 1.0 );\n > r = rand()\n <number>\n > r = rand()\n <number>\n\n\nbase.random.arcsine.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.arcsine.NAME\n 'arcsine'\n\n\nbase.random.arcsine.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.arcsine.PRNG;\n\n\nbase.random.arcsine.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.arcsine.seed;\n\n\nbase.random.arcsine.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.arcsine.seedLength;\n\n\nbase.random.arcsine.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.arcsine.state\n <Uint32Array>\n\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n // Set the state:\n > base.random.arcsine.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n > r = base.random.arcsine( 2.0, 4.0 )\n <number>\n\n\nbase.random.arcsine.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.arcsine.stateLength;\n\n\nbase.random.arcsine.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.arcsine.byteLength;\n\n\nbase.random.arcsine.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.arcsine.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.beta\n",
"base.random.bernoulli": "\nbase.random.bernoulli( p )\n Returns a pseudorandom number drawn from a Bernoulli distribution.\n\n If `p < 0` or `p > 1` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.bernoulli( 0.8 );\n\n\nbase.random.bernoulli.factory( [p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Bernoulli distribution.\n\n If provided `p`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `p`, the returned PRNG requires that `p` be provided at each\n invocation.\n\n Parameters\n ----------\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.bernoulli.factory();\n > var r = rand( 0.3 );\n > r = rand( 0.59 );\n\n // Provide `p`:\n > rand = base.random.bernoulli.factory( 0.3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.bernoulli.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.bernoulli.NAME\n 'bernoulli'\n\n\nbase.random.bernoulli.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.bernoulli.PRNG;\n\n\nbase.random.bernoulli.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.bernoulli.seed;\n\n\nbase.random.bernoulli.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.bernoulli.seedLength;\n\n\nbase.random.bernoulli.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.bernoulli.state\n <Uint32Array>\n\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n // Set the state:\n > base.random.bernoulli.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.bernoulli( 0.3 )\n <number>\n > r = base.random.bernoulli( 0.3 )\n <number>\n\n\nbase.random.bernoulli.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.bernoulli.stateLength;\n\n\nbase.random.bernoulli.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.bernoulli.byteLength;\n\n\nbase.random.bernoulli.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.bernoulli.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.binomial\n",
"base.random.beta": "\nbase.random.beta( α, β )\n Returns a pseudorandom number drawn from a beta distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.beta( 2.0, 5.0 );\n\n\nbase.random.beta.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a beta distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter.\n\n β: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.beta.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.beta.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.beta.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.beta.NAME\n 'beta'\n\n\nbase.random.beta.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.beta.PRNG;\n\n\nbase.random.beta.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.beta.seed;\n\n\nbase.random.beta.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.beta.seedLength;\n\n\nbase.random.beta.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.beta.state\n <Uint32Array>\n\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.beta.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n > r = base.random.beta( 2.0, 5.0 )\n <number>\n\n\nbase.random.beta.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.beta.stateLength;\n\n\nbase.random.beta.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.beta.byteLength;\n\n\nbase.random.beta.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.beta.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.betaprime": "\nbase.random.betaprime( α, β )\n Returns a pseudorandom number drawn from a beta prime distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.betaprime( 2.0, 5.0 );\n\n\nbase.random.betaprime.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a beta prime distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n First shape parameter.\n\n β: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.betaprime.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.betaprime.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.betaprime.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.betaprime.NAME\n 'betaprime'\n\n\nbase.random.betaprime.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.betaprime.PRNG;\n\n\nbase.random.betaprime.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.betaprime.seed;\n\n\nbase.random.betaprime.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.betaprime.seedLength;\n\n\nbase.random.betaprime.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.betaprime.state\n <Uint32Array>\n\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.betaprime.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n > r = base.random.betaprime( 2.0, 5.0 )\n <number>\n\n\nbase.random.betaprime.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.betaprime.stateLength;\n\n\nbase.random.betaprime.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.betaprime.byteLength;\n\n\nbase.random.betaprime.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.betaprime.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.binomial": "\nbase.random.binomial( n, p )\n Returns a pseudorandom number drawn from a binomial distribution.\n\n If `n` is not a positive integer or `p` is not a probability, the function\n returns `NaN`.\n\n If `n` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.binomial( 20, 0.8 );\n\n\nbase.random.binomial.factory( [n, p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a binomial distribution.\n\n If provided `n` and `p`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `n` and `p`, the returned PRNG requires that both `n` and\n `p` be provided at each invocation.\n\n Parameters\n ----------\n n: integer (optional)\n Number of trials.\n\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.binomial.factory();\n > var r = rand( 20, 0.3 );\n > r = rand( 10, 0.77 );\n\n // Provide `n` and `p`:\n > rand = base.random.binomial.factory( 10, 0.8 );\n > r = rand();\n > r = rand();\n\n\nbase.random.binomial.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.binomial.NAME\n 'binomial'\n\n\nbase.random.binomial.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.binomial.PRNG;\n\n\nbase.random.binomial.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.binomial.seed;\n\n\nbase.random.binomial.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.binomial.seedLength;\n\n\nbase.random.binomial.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.binomial.state\n <Uint32Array>\n\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n // Set the state:\n > base.random.binomial.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.binomial( 20, 0.8 )\n <number>\n > r = base.random.binomial( 20, 0.8 )\n <number>\n\n\nbase.random.binomial.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.binomial.stateLength;\n\n\nbase.random.binomial.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.binomial.byteLength;\n\n\nbase.random.binomial.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.binomial.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.boxMuller": "\nbase.random.boxMuller()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.boxMuller();\n\n\nbase.random.boxMuller.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.boxMuller.factory();\n > r = rand();\n > r = rand();\n\n\nbase.random.boxMuller.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.boxMuller.NAME\n 'box-muller'\n\n\nbase.random.boxMuller.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.boxMuller.PRNG;\n\n\nbase.random.boxMuller.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.boxMuller.seed;\n\n\nbase.random.boxMuller.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.boxMuller.seedLength;\n\n\nbase.random.boxMuller.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.boxMuller.state\n <Uint32Array>\n\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n // Set the state:\n > base.random.boxMuller.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.boxMuller()\n <number>\n > r = base.random.boxMuller()\n <number>\n\n\nbase.random.boxMuller.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.boxMuller.stateLength;\n\n\nbase.random.boxMuller.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.boxMuller.byteLength;\n\n\nbase.random.boxMuller.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.boxMuller.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.cauchy": "\nbase.random.cauchy( x0, Ɣ )\n Returns a pseudorandom number drawn from a Cauchy distribution.\n\n If `x0` or `Ɣ` is `NaN` or `Ɣ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.cauchy( 2.0, 5.0 );\n\n\nbase.random.cauchy.factory( [x0, Ɣ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Cauchy distribution.\n\n If provided `x0` and `Ɣ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `x0` and `Ɣ`, the returned PRNG requires that both `x0` and\n `Ɣ` be provided at each invocation.\n\n Parameters\n ----------\n x0: number (optional)\n Location parameter.\n\n Ɣ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.cauchy.factory();\n > var r = rand( 0.0, 1.5 );\n > r = rand( -2.0, 2.0 );\n\n // Provide `x0` and `Ɣ`:\n > rand = base.random.cauchy.factory( 0.0, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.cauchy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.cauchy.NAME\n 'cauchy'\n\n\nbase.random.cauchy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.cauchy.PRNG;\n\n\nbase.random.cauchy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.cauchy.seed;\n\n\nbase.random.cauchy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.cauchy.seedLength;\n\n\nbase.random.cauchy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.cauchy.state\n <Uint32Array>\n\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.cauchy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n > r = base.random.cauchy( 2.0, 5.0 )\n <number>\n\n\nbase.random.cauchy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.cauchy.stateLength;\n\n\nbase.random.cauchy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.cauchy.byteLength;\n\n\nbase.random.cauchy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.cauchy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.chi": "\nbase.random.chi( k )\n Returns a pseudorandom number drawn from a chi distribution.\n\n If `k <= 0` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.chi( 2 );\n\n\nbase.random.chi.factory( [k, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a chi distribution.\n\n If provided `k`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `k`, the returned PRNG requires that `k` be provided at each\n invocation.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.chi.factory();\n > var r = rand( 5 );\n > r = rand( 3.14 );\n\n // Provide `k`:\n > rand = base.random.chi.factory( 3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.chi.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.chi.NAME\n 'chi'\n\n\nbase.random.chi.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.chi.PRNG;\n\n\nbase.random.chi.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.chi.seed;\n\n\nbase.random.chi.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.chi.seedLength;\n\n\nbase.random.chi.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.chi.state\n <Uint32Array>\n\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n // Set the state:\n > base.random.chi.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.chi( 2 )\n <number>\n > r = base.random.chi( 2 )\n <number>\n\n\nbase.random.chi.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.chi.stateLength;\n\n\nbase.random.chi.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.chi.byteLength;\n\n\nbase.random.chi.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.chi.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.chisquare": "\nbase.random.chisquare( k )\n Returns a pseudorandom number drawn from a chi-square distribution.\n\n If `k <= 0` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.chisquare( 2 );\n\n\nbase.random.chisquare.factory( [k, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a chi-square distribution.\n\n If provided `k`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `k`, the returned PRNG requires that `k` be provided at each\n invocation.\n\n Parameters\n ----------\n k: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.chisquare.factory();\n > var r = rand( 5 );\n > r = rand( 3.14 );\n\n // Provide `k`:\n > rand = base.random.chisquare.factory( 3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.chisquare.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.chisquare.NAME\n 'chisquare'\n\n\nbase.random.chisquare.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.chisquare.PRNG;\n\n\nbase.random.chisquare.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.chisquare.seed;\n\n\nbase.random.chisquare.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.chisquare.seedLength;\n\n\nbase.random.chisquare.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.chisquare.state\n <Uint32Array>\n\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n // Set the state:\n > base.random.chisquare.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.chisquare( 2 )\n <number>\n > r = base.random.chisquare( 2 )\n <number>\n\n\nbase.random.chisquare.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.chisquare.stateLength;\n\n\nbase.random.chisquare.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.chisquare.byteLength;\n\n\nbase.random.chisquare.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.chisquare.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.cosine": "\nbase.random.cosine( μ, s )\n Returns a pseudorandom number drawn from a raised cosine distribution.\n\n If `μ` or `s` is `NaN` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.cosine( 2.0, 5.0 );\n\n\nbase.random.cosine.factory( [μ, s, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a raised cosine distribution.\n\n If provided `μ` and `s`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `s`, the returned PRNG requires that both `μ` and\n `s` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter.\n\n s: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.cosine.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `s`:\n > rand = base.random.cosine.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.cosine.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.cosine.NAME\n 'cosine'\n\n\nbase.random.cosine.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.cosine.PRNG;\n\n\nbase.random.cosine.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.cosine.seed;\n\n\nbase.random.cosine.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.cosine.seedLength;\n\n\nbase.random.cosine.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.cosine.state\n <Uint32Array>\n\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.cosine.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n > r = base.random.cosine( 2.0, 5.0 )\n <number>\n\n\nbase.random.cosine.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.cosine.stateLength;\n\n\nbase.random.cosine.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.cosine.byteLength;\n\n\nbase.random.cosine.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.cosine.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.discreteUniform": "\nbase.random.discreteUniform( a, b )\n Returns a pseudorandom number drawn from a discrete uniform distribution.\n\n If `a > b`, the function returns `NaN`.\n\n If `a` or `b` is not an integer value, the function returns `NaN`.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.discreteUniform( 2, 50 );\n\n\nbase.random.discreteUniform.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a discrete uniform distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: integer (optional)\n Minimum support.\n\n b: integer (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom integers. If provided, the `state` and `seed`\n options are ignored. In order to seed the returned pseudorandom number\n generator, one must seed the provided `prng` (assuming the provided\n `prng` is seedable). The provided PRNG must have `MIN` and `MAX`\n properties specifying the minimum and maximum possible pseudorandom\n integers.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.discreteUniform.factory();\n > var r = rand( 0, 10 );\n > r = rand( -20, 20 );\n\n // Provide `a` and `b`:\n > rand = base.random.discreteUniform.factory( 0, 10 );\n > r = rand();\n > r = rand();\n\n\nbase.random.discreteUniform.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.discreteUniform.NAME\n 'discrete-uniform'\n\n\nbase.random.discreteUniform.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.discreteUniform.PRNG;\n\n\nbase.random.discreteUniform.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.discreteUniform.seed;\n\n\nbase.random.discreteUniform.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.discreteUniform.seedLength;\n\n\nbase.random.discreteUniform.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.discreteUniform.state\n <Uint32Array>\n\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n // Set the state:\n > base.random.discreteUniform.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n > r = base.random.discreteUniform( 2, 50 )\n <number>\n\n\nbase.random.discreteUniform.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.discreteUniform.stateLength;\n\n\nbase.random.discreteUniform.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.discreteUniform.byteLength;\n\n\nbase.random.discreteUniform.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.discreteUniform.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.erlang": "\nbase.random.erlang( k, λ )\n Returns a pseudorandom number drawn from an Erlang distribution.\n\n If `k` is not a positive integer or `λ <= 0`, the function returns `NaN`.\n\n If `k` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.erlang( 2, 5.0 );\n\n\nbase.random.erlang.factory( [k, λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an Erlang distribution.\n\n If provided `k` and `λ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `k` and `λ`, the returned PRNG requires that both `k` and\n `λ` be provided at each invocation.\n\n Parameters\n ----------\n k: integer (optional)\n Shape parameter.\n\n λ: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.erlang.factory();\n > var r = rand( 2, 1.0 );\n > r = rand( 4, 3.14 );\n\n // Provide `k` and `λ`:\n > rand = base.random.erlang.factory( 2, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.erlang.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.erlang.NAME\n 'erlang'\n\n\nbase.random.erlang.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.erlang.PRNG;\n\n\nbase.random.erlang.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.erlang.seed;\n\n\nbase.random.erlang.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.erlang.seedLength;\n\n\nbase.random.erlang.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.erlang.state\n <Uint32Array>\n\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n // Set the state:\n > base.random.erlang.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.erlang( 2, 5.0 )\n <number>\n > r = base.random.erlang( 2, 5.0 )\n <number>\n\n\nbase.random.erlang.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.erlang.stateLength;\n\n\nbase.random.erlang.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.erlang.byteLength;\n\n\nbase.random.erlang.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.erlang.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.exponential": "\nbase.random.exponential( λ )\n Returns a pseudorandom number drawn from an exponential distribution.\n\n If `λ <= 0` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.exponential( 7.9 );\n\n\nbase.random.exponential.factory( [λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an exponential distribution.\n\n If provided `λ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `λ`, the returned PRNG requires that `λ` be provided at each\n invocation.\n\n Parameters\n ----------\n λ: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.exponential.factory();\n > var r = rand( 5.0 );\n > r = rand( 3.14 );\n\n // Provide `λ`:\n > rand = base.random.exponential.factory( 10.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.exponential.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.exponential.NAME\n 'exponential'\n\n\nbase.random.exponential.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.exponential.PRNG;\n\n\nbase.random.exponential.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.exponential.seed;\n\n\nbase.random.exponential.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.exponential.seedLength;\n\n\nbase.random.exponential.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.exponential.state\n <Uint32Array>\n\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n // Set the state:\n > base.random.exponential.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.exponential( 7.9 )\n <number>\n > r = base.random.exponential( 7.9 )\n <number>\n\n\nbase.random.exponential.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.exponential.stateLength;\n\n\nbase.random.exponential.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.exponential.byteLength;\n\n\nbase.random.exponential.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.exponential.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.f": "\nbase.random.f( d1, d2 )\n Returns a pseudorandom number drawn from an F distribution.\n\n If `d1 <= 0` or `d2 <= 0`, the function returns `NaN`.\n\n If `d1` or `d2` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n d1: number\n Degrees of freedom.\n\n d2: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.f( 2.0, 5.0 );\n\n\nbase.random.f.factory( [d1, d2, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an F distribution.\n\n If provided `d1` and `d2`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `d1` and `d2`, the returned PRNG requires that both `d1` and\n `d2` be provided at each invocation.\n\n Parameters\n ----------\n d1: number (optional)\n Degrees of freedom.\n\n d2: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.f.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.0, 3.14 );\n\n // Provide `d1` and `d2`:\n > rand = base.random.f.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.f.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.f.NAME\n 'f'\n\n\nbase.random.f.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.f.PRNG;\n\n\nbase.random.f.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.f.seed;\n\n\nbase.random.f.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.f.seedLength;\n\n\nbase.random.f.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.f.state\n <Uint32Array>\n\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n // Set the state:\n > base.random.f.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.f( 1.5, 1.5 )\n <number>\n > r = base.random.f( 1.5, 1.5 )\n <number>\n\n\nbase.random.f.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.f.stateLength;\n\n\nbase.random.f.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.f.byteLength;\n\n\nbase.random.f.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.f.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.frechet": "\nbase.random.frechet( α, s, m )\n Returns a pseudorandom number drawn from a Fréchet distribution.\n\n If provided `α <= 0` or `s <= 0`, the function returns `NaN`.\n\n If either `α`, `s`, or `m` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.frechet( 2.0, 5.0, 3.33 );\n\n\nbase.random.frechet.factory( [α, s, m, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a triangular distribution.\n\n If provided `α`, `s`, and `m`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `α`, `s`, and `m`, the returned PRNG requires that `α`, `s`,\n and `m` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n s: number (optional)\n Scale parameter.\n\n m: number (optional)\n Location parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.frechet.factory();\n > var r = rand( 1.0, 1.0, 0.5 );\n > r = rand( 2.0, 2.0, 1.0 );\n\n // Provide `α`, `s`, and `m`:\n > rand = base.random.frechet.factory( 1.0, 1.0, 0.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.frechet.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.frechet.NAME\n 'frechet'\n\n\nbase.random.frechet.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.frechet.PRNG;\n\n\nbase.random.frechet.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.frechet.seed;\n\n\nbase.random.frechet.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.frechet.seedLength;\n\n\nbase.random.frechet.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.frechet.state\n <Uint32Array>\n\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n // Set the state:\n > base.random.frechet.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n > r = base.random.frechet( 1.0, 1.0, 0.5 )\n <number>\n\n\nbase.random.frechet.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.frechet.stateLength;\n\n\nbase.random.frechet.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.frechet.byteLength;\n\n\nbase.random.frechet.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.frechet.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.gamma": "\nbase.random.gamma( α, β )\n Returns a pseudorandom number drawn from a gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.gamma( 2.0, 5.0 );\n\n\nbase.random.gamma.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a gamma distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.gamma.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.14, 2.25 );\n\n // Provide `α` and `β`:\n > rand = base.random.gamma.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.gamma.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.gamma.NAME\n 'gamma'\n\n\nbase.random.gamma.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.gamma.PRNG;\n\n\nbase.random.gamma.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.gamma.seed;\n\n\nbase.random.gamma.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.gamma.seedLength;\n\n\nbase.random.gamma.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.gamma.state\n <Uint32Array>\n\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.gamma.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n > r = base.random.gamma( 2.0, 5.0 )\n <number>\n\n\nbase.random.gamma.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.gamma.stateLength;\n\n\nbase.random.gamma.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.gamma.byteLength;\n\n\nbase.random.gamma.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.gamma.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.geometric": "\nbase.random.geometric( p )\n Returns a pseudorandom number drawn from a geometric distribution.\n\n If `p < 0` or `p > 1` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.geometric( 0.8 );\n\n\nbase.random.geometric.factory( [p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a geometric distribution.\n\n If provided `p`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `p`, the returned PRNG requires that `p` be provided at each\n invocation.\n\n Parameters\n ----------\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.geometric.factory();\n > var r = rand( 0.3 );\n > r = rand( 0.59 );\n\n // Provide `p`:\n > rand = base.random.geometric.factory( 0.3 );\n > r = rand();\n > r = rand();\n\n\nbase.random.geometric.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.geometric.NAME\n 'geometric'\n\n\nbase.random.geometric.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.geometric.PRNG;\n\n\nbase.random.geometric.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.geometric.seed;\n\n\nbase.random.geometric.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.geometric.seedLength;\n\n\nbase.random.geometric.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.geometric.state\n <Uint32Array>\n\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n // Set the state:\n > base.random.geometric.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.geometric( 0.3 )\n <number>\n > r = base.random.geometric( 0.3 )\n <number>\n\n\nbase.random.geometric.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.geometric.stateLength;\n\n\nbase.random.geometric.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.geometric.byteLength;\n\n\nbase.random.geometric.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.geometric.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.gumbel": "\nbase.random.gumbel( μ, β )\n Returns a pseudorandom number drawn from a Gumbel distribution.\n\n If `μ` or `β` is `NaN` or `β <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.gumbel( 2.0, 5.0 );\n\n\nbase.random.gumbel.factory( [μ, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Gumbel distribution.\n\n If provided `μ` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `β`, the returned PRNG requires that both `μ` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.gumbel.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `β`:\n > rand = base.random.gumbel.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.gumbel.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.gumbel.NAME\n 'gumbel'\n\n\nbase.random.gumbel.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.gumbel.PRNG;\n\n\nbase.random.gumbel.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.gumbel.seed;\n\n\nbase.random.gumbel.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.gumbel.seedLength;\n\n\nbase.random.gumbel.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.gumbel.state\n <Uint32Array>\n\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.gumbel.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n > r = base.random.gumbel( 2.0, 5.0 )\n <number>\n\n\nbase.random.gumbel.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.gumbel.stateLength;\n\n\nbase.random.gumbel.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.gumbel.byteLength;\n\n\nbase.random.gumbel.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.gumbel.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.hypergeometric": "\nbase.random.hypergeometric( N, K, n )\n Returns a pseudorandom number drawn from a hypergeometric distribution.\n\n `N`, `K`, and `n` must all be nonnegative integers; otherwise, the function\n returns `NaN`.\n\n If `n > N` or `K > N`, the function returns `NaN`.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.hypergeometric( 20, 10, 7 );\n\n\nbase.random.hypergeometric.factory( [N, K, n, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a hypergeometric distribution.\n\n If provided `N`, `K`, and `n`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `N`, `K`, and `n`, the returned PRNG requires that `N`, `K`,\n and `n` be provided at each invocation.\n\n Parameters\n ----------\n N: integer (optional)\n Population size.\n\n K: integer (optional)\n Subpopulation size.\n\n n: integer (optional)\n Number of draws.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.hypergeometric.factory();\n > var r = rand( 20, 10, 15 );\n > r = rand( 20, 10, 7 );\n\n // Provide `N`, `K`, and `n`:\n > rand = base.random.hypergeometric.factory( 20, 10, 15 );\n > r = rand();\n > r = rand();\n\n\nbase.random.hypergeometric.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.hypergeometric.NAME\n 'hypergeometric'\n\n\nbase.random.hypergeometric.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.hypergeometric.PRNG;\n\n\nbase.random.hypergeometric.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.hypergeometric.seed;\n\n\nbase.random.hypergeometric.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.hypergeometric.seedLength;\n\n\nbase.random.hypergeometric.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.hypergeometric.state\n <Uint32Array>\n\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n // Set the state:\n > base.random.hypergeometric.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n > r = base.random.hypergeometric( 20, 10, 15 )\n <number>\n\n\nbase.random.hypergeometric.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.hypergeometric.stateLength;\n\n\nbase.random.hypergeometric.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.hypergeometric.byteLength;\n\n\nbase.random.hypergeometric.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.hypergeometric.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.improvedZiggurat": "\nbase.random.improvedZiggurat()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.improvedZiggurat();\n\n\nbase.random.improvedZiggurat.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.improvedZiggurat.factory();\n > r = rand();\n > r = rand();\n\n\nbase.random.improvedZiggurat.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.improvedZiggurat.NAME\n 'improved-ziggurat'\n\n\nbase.random.improvedZiggurat.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.improvedZiggurat.PRNG;\n\n\nbase.random.improvedZiggurat.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.improvedZiggurat.seed;\n\n\nbase.random.improvedZiggurat.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.improvedZiggurat.seedLength;\n\n\nbase.random.improvedZiggurat.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.improvedZiggurat.state\n <Uint32Array>\n\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n // Set the state:\n > base.random.improvedZiggurat.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.improvedZiggurat()\n <number>\n > r = base.random.improvedZiggurat()\n <number>\n\n\nbase.random.improvedZiggurat.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.improvedZiggurat.stateLength;\n\n\nbase.random.improvedZiggurat.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.improvedZiggurat.byteLength;\n\n\nbase.random.improvedZiggurat.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.improvedZiggurat.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.invgamma": "\nbase.random.invgamma( α, β )\n Returns a pseudorandom number drawn from an inverse gamma distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.invgamma( 2.0, 5.0 );\n\n\nbase.random.invgamma.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from an inverse gamma distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.invgamma.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 3.14, 2.25 );\n\n // Provide `α` and `β`:\n > rand = base.random.invgamma.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.invgamma.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.invgamma.NAME\n 'invgamma'\n\n\nbase.random.invgamma.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.invgamma.PRNG;\n\n\nbase.random.invgamma.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.invgamma.seed;\n\n\nbase.random.invgamma.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.invgamma.seedLength;\n\n\nbase.random.invgamma.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.invgamma.state\n <Uint32Array>\n\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.invgamma.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n > r = base.random.invgamma( 2.0, 5.0 )\n <number>\n\n\nbase.random.invgamma.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.invgamma.stateLength;\n\n\nbase.random.invgamma.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.invgamma.byteLength;\n\n\nbase.random.invgamma.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.invgamma.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.kumaraswamy": "\nbase.random.kumaraswamy( a, b )\n Returns a pseudorandom number drawn from Kumaraswamy's double bounded\n distribution.\n\n If `a <= 0` or `b <= 0`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.kumaraswamy( 2.0, 5.0 );\n\n\nbase.random.kumaraswamy.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from Kumaraswamy's double bounded distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n First shape parameter.\n\n b: number (optional)\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.kumaraswamy.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `a` and `b`:\n > rand = base.random.kumaraswamy.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.kumaraswamy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.kumaraswamy.NAME\n 'kumaraswamy'\n\n\nbase.random.kumaraswamy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.kumaraswamy.PRNG;\n\n\nbase.random.kumaraswamy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.kumaraswamy.seed;\n\n\nbase.random.kumaraswamy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.kumaraswamy.seedLength;\n\n\nbase.random.kumaraswamy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.kumaraswamy.state\n <Uint32Array>\n\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n // Set the state:\n > base.random.kumaraswamy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n > r = base.random.kumaraswamy( 1.5, 1.5 )\n <number>\n\n\nbase.random.kumaraswamy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.kumaraswamy.stateLength;\n\n\nbase.random.kumaraswamy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.kumaraswamy.byteLength;\n\n\nbase.random.kumaraswamy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.kumaraswamy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.laplace": "\nbase.random.laplace( μ, b )\n Returns a pseudorandom number drawn from a Laplace distribution.\n\n If `μ` or `b` is `NaN` or `b <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n b: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.laplace( 2.0, 5.0 );\n\n\nbase.random.laplace.factory( [μ, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Laplace distribution.\n\n If provided `μ` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `b`, the returned PRNG requires that both `μ` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n b: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.laplace.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `b`:\n > rand = base.random.laplace.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.laplace.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.laplace.NAME\n 'laplace'\n\n\nbase.random.laplace.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.laplace.PRNG;\n\n\nbase.random.laplace.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.laplace.seed;\n\n\nbase.random.laplace.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.laplace.seedLength;\n\n\nbase.random.laplace.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.laplace.state\n <Uint32Array>\n\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.laplace.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n > r = base.random.laplace( 2.0, 5.0 )\n <number>\n\n\nbase.random.laplace.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.laplace.stateLength;\n\n\nbase.random.laplace.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.laplace.byteLength;\n\n\nbase.random.laplace.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.laplace.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.levy": "\nbase.random.levy( μ, c )\n Returns a pseudorandom number drawn from a Lévy distribution.\n\n If `μ` or `c` is `NaN` or `c <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n c: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.levy( 2.0, 5.0 );\n\n\nbase.random.levy.factory( [μ, c, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Lévy distribution.\n\n If provided `μ` and `c`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `c`, the returned PRNG requires that both `μ` and\n `c` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n c: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.levy.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `b`:\n > rand = base.random.levy.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.levy.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.levy.NAME\n 'levy'\n\n\nbase.random.levy.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.levy.PRNG;\n\n\nbase.random.levy.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.levy.seed;\n\n\nbase.random.levy.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.levy.seedLength;\n\n\nbase.random.levy.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.levy.state\n <Uint32Array>\n\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.levy.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n > r = base.random.levy( 2.0, 5.0 )\n <number>\n\n\nbase.random.levy.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.levy.stateLength;\n\n\nbase.random.levy.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.levy.byteLength;\n\n\nbase.random.levy.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.levy.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.logistic": "\nbase.random.logistic( μ, s )\n Returns a pseudorandom number drawn from a logistic distribution.\n\n If `μ` or `s` is `NaN` or `s <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n s: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.logistic( 2.0, 5.0 );\n\n\nbase.random.logistic.factory( [μ, s, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a logistic distribution.\n\n If provided `μ` and `s`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `s`, the returned PRNG requires that both `μ` and\n `s` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n s: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.logistic.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `s`:\n > rand = base.random.logistic.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.logistic.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.logistic.NAME\n 'logistic'\n\n\nbase.random.logistic.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.logistic.PRNG;\n\n\nbase.random.logistic.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.logistic.seed;\n\n\nbase.random.logistic.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.logistic.seedLength;\n\n\nbase.random.logistic.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.logistic.state\n <Uint32Array>\n\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.logistic.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n > r = base.random.logistic( 2.0, 5.0 )\n <number>\n\n\nbase.random.logistic.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.logistic.stateLength;\n\n\nbase.random.logistic.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.logistic.byteLength;\n\n\nbase.random.logistic.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.logistic.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.lognormal": "\nbase.random.lognormal( μ, σ )\n Returns a pseudorandom number drawn from a lognormal distribution.\n\n If `μ` or `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.lognormal( 2.0, 5.0 );\n\n\nbase.random.lognormal.factory( [μ, σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a lognormal distribution.\n\n If provided `μ` and `σ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `σ`, the returned PRNG requires that both `μ` and\n `σ` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Location parameter.\n\n σ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.lognormal.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `σ`:\n > rand = base.random.lognormal.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.lognormal.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.lognormal.NAME\n 'lognormal'\n\n\nbase.random.lognormal.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.lognormal.PRNG;\n\n\nbase.random.lognormal.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.lognormal.seed;\n\n\nbase.random.lognormal.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.lognormal.seedLength;\n\n\nbase.random.lognormal.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.lognormal.state\n <Uint32Array>\n\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.lognormal.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n > r = base.random.lognormal( 2.0, 5.0 )\n <number>\n\n\nbase.random.lognormal.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.lognormal.stateLength;\n\n\nbase.random.lognormal.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.lognormal.byteLength;\n\n\nbase.random.lognormal.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.lognormal.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.minstd": "\nbase.random.minstd()\n Returns a pseudorandom integer on the interval `[1, 2147483646]`.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) based on Park and Miller.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. More\n importantly, the \"randomness quality\" of the generator's output is lacking.\n These defects make the generator unsuitable, for example, in Monte Carlo\n simulations and in cryptographic applications.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstd();\n\n\nbase.random.minstd.normalized()\n Returns a pseudorandom number on the interval `[0,1)`.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstd.normalized();\n\n\nbase.random.minstd.factory( [options] )\n Returns a linear congruential pseudorandom number generator (LCG).\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer on the interval `[1, 2147483646]` or, for\n arbitrary length seeds, an array-like object containing signed 32-bit\n integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.minstd.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.minstd.factory( { 'seed': 1234 } );\n > r = rand()\n 20739838\n\n\nbase.random.minstd.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.minstd.NAME\n 'minstd'\n\n\nbase.random.minstd.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.minstd.MIN\n 1\n\n\nbase.random.minstd.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.minstd.MAX\n 2147483646\n\n\nbase.random.minstd.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.minstd.seed;\n\n\nbase.random.minstd.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.minstd.seedLength;\n\n\nbase.random.minstd.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n // Get the current state:\n > var state = base.random.minstd.state\n <Int32Array>\n\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n // Set the state:\n > base.random.minstd.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.minstd()\n <number>\n > r = base.random.minstd()\n <number>\n\n\nbase.random.minstd.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.minstd.stateLength;\n\n\nbase.random.minstd.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.minstd.byteLength;\n\n\nbase.random.minstd.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.minstd.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstdShuffle, base.random.mt19937, base.random.randi\n",
"base.random.minstdShuffle": "\nbase.random.minstdShuffle()\n Returns a pseudorandom integer on the interval `[1, 2147483646]`.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) whose output is shuffled using the Bays-\n Durham algorithm. The shuffle step considerably strengthens the \"randomness\n quality\" of a simple LCG's output.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. In\n general, this generator is unsuitable for Monte Carlo simulations and\n cryptographic applications.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstdShuffle();\n\n\nbase.random.minstdShuffle.normalized()\n Returns a pseudorandom number on the interval `[0,1)`.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.minstdShuffle.normalized();\n\n\nbase.random.minstdShuffle.factory( [options] )\n Returns a linear congruential pseudorandom number generator (LCG) whose\n output is shuffled.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer on the interval `[1, 2147483646]` or, for\n arbitrary length seeds, an array-like object containing signed 32-bit\n integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.minstdShuffle.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.minstdShuffle.factory( { 'seed': 1234 } );\n > r = rand()\n 1421600654\n\n\nbase.random.minstdShuffle.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.minstdShuffle.NAME\n 'minstd-shuffle'\n\n\nbase.random.minstdShuffle.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.minstdShuffle.MIN\n 1\n\n\nbase.random.minstdShuffle.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.minstdShuffle.MAX\n 2147483646\n\n\nbase.random.minstdShuffle.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.minstdShuffle.seed;\n\n\nbase.random.minstdShuffle.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.minstdShuffle.seedLength;\n\n\nbase.random.minstdShuffle.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.minstdShuffle.state\n <Int32Array>\n\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n // Set the state:\n > base.random.minstdShuffle.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.minstdShuffle()\n <number>\n > r = base.random.minstdShuffle()\n <number>\n\n\nbase.random.minstdShuffle.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.minstdShuffle.stateLength;\n\n\nbase.random.minstdShuffle.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.minstdShuffle.byteLength;\n\n\nbase.random.minstdShuffle.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.minstdShuffle.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.mt19937, base.random.randi\n",
"base.random.mt19937": "\nbase.random.mt19937()\n Returns a pseudorandom integer on the interval `[1, 4294967295]`.\n\n This pseudorandom number generator (PRNG) is a 32-bit Mersenne Twister\n pseudorandom number generator.\n\n The PRNG is *not* a cryptographically secure PRNG.\n\n The PRNG has a period of 2^19937 - 1.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.mt19937();\n\n\nbase.random.mt19937.normalized()\n Returns a pseudorandom number on the interval `[0,1)` with 53-bit precision.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.mt19937.normalized();\n\n\nbase.random.mt19937.factory( [options] )\n Returns a 32-bit Mersenne Twister pseudorandom number generator.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.mt19937.factory();\n > r = rand();\n > r = rand();\n\n // Provide a seed:\n > rand = base.random.mt19937.factory( { 'seed': 1234 } );\n > r = rand()\n 822569775\n\n\nbase.random.mt19937.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.mt19937.NAME\n 'mt19937'\n\n\nbase.random.mt19937.MIN\n Minimum possible value.\n\n Examples\n --------\n > var v = base.random.mt19937.MIN\n 1\n\n\nbase.random.mt19937.MAX\n Maximum possible value.\n\n Examples\n --------\n > var v = base.random.mt19937.MAX\n 4294967295\n\n\nbase.random.mt19937.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.mt19937.seed;\n\n\nbase.random.mt19937.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.mt19937.seedLength;\n\n\nbase.random.mt19937.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.mt19937.state\n <Uint32Array>\n\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n // Set the state:\n > base.random.mt19937.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.mt19937()\n <number>\n > r = base.random.mt19937()\n <number>\n\n\nbase.random.mt19937.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.mt19937.stateLength;\n\n\nbase.random.mt19937.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.mt19937.byteLength;\n\n\nbase.random.mt19937.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.mt19937.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.randi\n",
"base.random.negativeBinomial": "\nbase.random.negativeBinomial( r, p )\n Returns a pseudorandom number drawn from a negative binomial distribution.\n\n If `p` is not in the interval `(0,1)`, the function returns `NaN`.\n\n If `r` or `p` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.negativeBinomial( 20, 0.8 );\n\n\nbase.random.negativeBinomial.factory( [r, p, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a negative binomial distribution.\n\n If provided `r` and `p`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `r` and `p`, the returned PRNG requires that both `r` and\n `p` be provided at each invocation.\n\n Parameters\n ----------\n r: number (optional)\n Number of successes until experiment is stopped.\n\n p: number (optional)\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.negativeBinomial.factory();\n > var r = rand( 20, 0.3 );\n > r = rand( 10, 0.77 );\n\n // Provide `r` and `p`:\n > rand = base.random.negativeBinomial.factory( 10, 0.8 );\n > r = rand();\n > r = rand();\n\n\nbase.random.negativeBinomial.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.negativeBinomial.NAME\n 'negative-binomial'\n\n\nbase.random.negativeBinomial.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.negativeBinomial.PRNG;\n\n\nbase.random.negativeBinomial.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.negativeBinomial.seed;\n\n\nbase.random.negativeBinomial.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.negativeBinomial.seedLength;\n\n\nbase.random.negativeBinomial.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.negativeBinomial.state\n <Uint32Array>\n\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n // Set the state:\n > base.random.negativeBinomial.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n > r = base.random.negativeBinomial( 20, 0.3 )\n <number>\n\n\nbase.random.negativeBinomial.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.negativeBinomial.stateLength;\n\n\nbase.random.negativeBinomial.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.negativeBinomial.byteLength;\n\n\nbase.random.negativeBinomial.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.negativeBinomial.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.normal": "\nbase.random.normal( μ, σ )\n Returns a pseudorandom number drawn from a normal distribution.\n\n If `μ` or `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n σ: number\n Standard deviation.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.normal( 2.0, 5.0 );\n\n\nbase.random.normal.factory( [μ, σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a normal distribution.\n\n If provided `μ` and `σ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `μ` and `σ`, the returned PRNG requires that both `μ` and\n `σ` be provided at each invocation.\n\n Parameters\n ----------\n μ: number (optional)\n Mean.\n\n σ: number (optional)\n Standard deviation.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.normal.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `μ` and `σ`:\n > rand = base.random.normal.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.normal.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.normal.NAME\n 'normal'\n\n\nbase.random.normal.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.normal.PRNG;\n\n\nbase.random.normal.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.normal.seed;\n\n\nbase.random.normal.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.normal.seedLength;\n\n\nbase.random.normal.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.normal.state\n <Uint32Array>\n\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.normal.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n > r = base.random.normal( 2.0, 5.0 )\n <number>\n\n\nbase.random.normal.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.normal.stateLength;\n\n\nbase.random.normal.byteLength\n Size of generator state.\n\n Examples\n --------\n > var sz = base.random.normal.byteLength;\n\n\nbase.random.normal.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.normal.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.pareto1": "\nbase.random.pareto1( α, β )\n Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\n If `α <= 0` or `β <= 0`, the function returns `NaN`.\n\n If `α` or `β` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.pareto1( 2.0, 5.0 );\n\n\nbase.random.pareto1.factory( [α, β, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Pareto (Type I) distribution.\n\n If provided `α` and `β`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `α` and `β`, the returned PRNG requires that both `α` and\n `β` be provided at each invocation.\n\n Parameters\n ----------\n α: number (optional)\n Shape parameter.\n\n β: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.pareto1.factory();\n > var r = rand( 1.5, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `α` and `β`:\n > rand = base.random.pareto1.factory( 1.5, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.pareto1.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.pareto1.NAME\n 'pareto-type1'\n\n\nbase.random.pareto1.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.pareto1.PRNG;\n\n\nbase.random.pareto1.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.pareto1.seed;\n\n\nbase.random.pareto1.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.pareto1.seedLength;\n\n\nbase.random.pareto1.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.pareto1.state\n <Uint32Array>\n\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.pareto1.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n > r = base.random.pareto1( 2.0, 5.0 )\n <number>\n\n\nbase.random.pareto1.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.pareto1.stateLength;\n\n\nbase.random.pareto1.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.pareto1.byteLength;\n\n\nbase.random.pareto1.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.pareto1.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.poisson": "\nbase.random.poisson( λ )\n Returns a pseudorandom number drawn from a Poisson distribution.\n\n If `λ <= 0` or `λ` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n λ: number\n Mean.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.poisson( 7.9 );\n\n\nbase.random.poisson.factory( [λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Poisson distribution.\n\n If provided `λ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `λ`, the returned PRNG requires that `λ` be provided at each\n invocation.\n\n Parameters\n ----------\n λ: number (optional)\n Mean.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.poisson.factory();\n > var r = rand( 4.0 );\n > r = rand( 3.14 );\n\n // Provide `λ`:\n > rand = base.random.poisson.factory( 10.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.poisson.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.poisson.NAME\n 'poisson'\n\n\nbase.random.poisson.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.poisson.PRNG;\n\n\nbase.random.poisson.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.poisson.seed;\n\n\nbase.random.poisson.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.poisson.seedLength;\n\n\nbase.random.poisson.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.poisson.state\n <Uint32Array>\n\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n // Set the state:\n > base.random.poisson.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.poisson( 10.0 )\n <number>\n > r = base.random.poisson( 10.0 )\n <number>\n\n\nbase.random.poisson.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.poisson.stateLength;\n\n\nbase.random.poisson.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.poisson.byteLength;\n\n\nbase.random.poisson.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.poisson.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.randi": "\nbase.random.randi()\n Returns a pseudorandom number having an integer value.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.randi();\n\n\nbase.random.randi.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers having integer values.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG). The\n following PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: 'mt19937'.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var randi = base.random.randi.factory();\n > var r = randi();\n > r = randi();\n\n // Specify alternative PRNG:\n > randi = base.random.randi.factory({ 'name': 'minstd' });\n > r = randi();\n > r = randi();\n\n\nbase.random.randi.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randi.NAME\n 'randi'\n\n\nbase.random.randi.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randi.PRNG;\n\n\nbase.random.randi.MIN\n Minimum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randi.MIN;\n\n\nbase.random.randi.MAX\n Maximum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randi.MAX;\n\n\nbase.random.randi.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randi.seed;\n\n\nbase.random.randi.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randi.seedLength;\n\n\nbase.random.randi.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randi.state;\n\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n // Set the state:\n > base.random.randi.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randi()\n <number>\n > r = base.random.randi()\n <number>\n\n\nbase.random.randi.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randi.stateLength;\n\n\nbase.random.randi.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randi.byteLength;\n\n\nbase.random.randi.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randi.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.minstd, base.random.minstdShuffle, base.random.mt19937\n",
"base.random.randn": "\nbase.random.randn()\n Returns a pseudorandom number drawn from a standard normal distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.randn();\n\n\nbase.random.randn.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a standard normal distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG) that samples\n from a standard normal distribution. The following PRNGs are supported:\n\n - improved-ziggurat: improved ziggurat method.\n - box-muller: Box-Muller transform.\n\n Default: 'improved-ziggurat'.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.randn.factory();\n > var r = rand();\n > r = rand();\n\n // Specify alternative PRNG:\n > var rand = base.random.randn.factory({ 'name': 'box-muller' });\n > r = rand();\n > r = rand();\n\n\nbase.random.randn.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randn.NAME\n 'randn'\n\n\nbase.random.randn.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randn.PRNG;\n\n\nbase.random.randn.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randn.seed;\n\n\nbase.random.randn.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randn.seedLength;\n\n\nbase.random.randn.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randn.state;\n\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n // Set the state:\n > base.random.randn.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randn()\n <number>\n > r = base.random.randn()\n <number>\n\n\nbase.random.randn.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randn.stateLength;\n\n\nbase.random.randn.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randn.byteLength;\n\n\nbase.random.randn.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randn.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.improvedZiggurat, base.random.randu\n",
"base.random.randu": "\nbase.random.randu()\n Returns a pseudorandom number drawn from a uniform distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either use the `factory`\n method to explicitly specify a PRNG via the `name` option or use an\n underlying PRNG directly.\n\n Returns\n -------\n r: number\n Pseudorandom number on the interval `[0,1)`.\n\n Examples\n --------\n > var r = base.random.randu();\n\n\nbase.random.randu.factory( [options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a uniform distribution.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of the underlying pseudorandom number generator (PRNG). The\n following PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: 'mt19937'.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.randu.factory();\n > var r = rand();\n > r = rand();\n\n // Specify alternative PRNG:\n > var rand = base.random.randu.factory({ 'name': 'minstd' });\n > r = rand();\n > r = rand();\n\n\nbase.random.randu.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.randu.NAME\n 'randu'\n\n\nbase.random.randu.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.randu.PRNG;\n\n\nbase.random.randu.MIN\n Minimum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randu.MIN;\n\n\nbase.random.randu.MAX\n Maximum possible value (specific to underlying PRNG).\n\n Examples\n --------\n > var v = base.random.randu.MAX;\n\n\nbase.random.randu.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.randu.seed;\n\n\nbase.random.randu.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.randu.seedLength;\n\n\nbase.random.randu.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.randu.state;\n\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n // Set the state:\n > base.random.randu.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.randu()\n <number>\n > r = base.random.randu()\n <number>\n\n\nbase.random.randu.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.randu.stateLength;\n\n\nbase.random.randu.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.randu.byteLength;\n\n\nbase.random.randu.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.randu.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.discreteUniform, base.random.randn\n",
"base.random.rayleigh": "\nbase.random.rayleigh( σ )\n Returns a pseudorandom number drawn from a Rayleigh distribution.\n\n If `σ` is `NaN` or `σ <= 0`, the function returns `NaN`.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.rayleigh( 2.5 );\n\n\nbase.random.rayleigh.factory( [σ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Rayleigh distribution.\n\n If provided `σ`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `σ`, the returned PRNG requires that `σ` be provided at each\n invocation.\n\n Parameters\n ----------\n σ: number (optional)\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.rayleigh.factory();\n > var r = rand( 5.0 );\n > r = rand( 10.0 );\n\n // Provide `σ`:\n > rand = base.random.rayleigh.factory( 5.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.rayleigh.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.rayleigh.NAME\n 'rayleigh'\n\n\nbase.random.rayleigh.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.rayleigh.PRNG;\n\n\nbase.random.rayleigh.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.rayleigh.seed;\n\n\nbase.random.rayleigh.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.rayleigh.seedLength;\n\n\nbase.random.rayleigh.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.rayleigh.state\n <Uint32Array>\n\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n // Set the state:\n > base.random.rayleigh.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.rayleigh( 5.0 )\n <number>\n > r = base.random.rayleigh( 5.0 )\n <number>\n\n\nbase.random.rayleigh.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.rayleigh.stateLength;\n\n\nbase.random.rayleigh.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.rayleigh.byteLength;\n\n\nbase.random.rayleigh.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.rayleigh.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.t": "\nbase.random.t( v )\n Returns a pseudorandom number drawn from a Student's t distribution.\n\n If `v <= 0` or `v` is `NaN`, the function\n returns `NaN`.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.t( 2.0 );\n\n\nbase.random.t.factory( [v, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Student's t distribution.\n\n If provided `v`, the returned PRNG returns random variates drawn from the\n specified distribution.\n\n If not provided `v`, the returned PRNG requires that `v` be provided at each\n invocation.\n\n Parameters\n ----------\n v: number (optional)\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.t.factory();\n > var r = rand( 5.0 );\n > r = rand( 3.14 );\n\n // Provide `v`:\n > rand = base.random.t.factory( 5.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.t.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.t.NAME\n 't'\n\n\nbase.random.t.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.t.PRNG;\n\n\nbase.random.t.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.t.seed;\n\n\nbase.random.t.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.t.seedLength;\n\n\nbase.random.t.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.t.state\n <Uint32Array>\n\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n // Set the state:\n > base.random.t.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.t( 10.0 )\n <number>\n > r = base.random.t( 10.0 )\n <number>\n\n\nbase.random.t.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.t.stateLength;\n\n\nbase.random.t.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.t.byteLength;\n\n\nbase.random.t.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.t.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.triangular": "\nbase.random.triangular( a, b, c )\n Returns a pseudorandom number drawn from a triangular distribution.\n\n If the condition `a <= c <= b` is not satisfied, the function returns `NaN`.\n\n If either `a`, `b`, or `c` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n Returns\n -------\n r: integer\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.triangular( 2.0, 5.0, 3.33 );\n\n\nbase.random.triangular.factory( [a, b, c, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a triangular distribution.\n\n If provided `a`, `b`, and `c`, the returned PRNG returns random variates\n drawn from the specified distribution.\n\n If not provided `a`, `b`, and `c`, the returned PRNG requires that `a`, `b`,\n and `c` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n c: number (optional)\n Mode.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.triangular.factory();\n > var r = rand( 0.0, 1.0, 0.5 );\n > r = rand( -2.0, 2.0, 1.0 );\n\n // Provide `a`, `b`, and `c`:\n > rand = base.random.triangular.factory( 0.0, 1.0, 0.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.triangular.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.triangular.NAME\n 'triangular'\n\n\nbase.random.triangular.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.triangular.PRNG;\n\n\nbase.random.triangular.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.triangular.seed;\n\n\nbase.random.triangular.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.triangular.seedLength;\n\n\nbase.random.triangular.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.triangular.state\n <Uint32Array>\n\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n // Set the state:\n > base.random.triangular.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n > r = base.random.triangular( 0.0, 1.0, 0.5 )\n <number>\n\n\nbase.random.triangular.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.triangular.stateLength;\n\n\nbase.random.triangular.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.triangular.byteLength;\n\n\nbase.random.triangular.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.triangular.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.random.uniform": "\nbase.random.uniform( a, b )\n Returns a pseudorandom number drawn from a continuous uniform distribution.\n\n If `a >= b`, the function returns `NaN`.\n\n If `a` or `b` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n a: number\n Minimum support (inclusive).\n\n b: number\n Maximum support (exclusive).\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.uniform( 2.0, 5.0 );\n\n\nbase.random.uniform.factory( [a, b, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a continuous uniform distribution.\n\n If provided `a` and `b`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `a` and `b`, the returned PRNG requires that both `a` and\n `b` be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support (inclusive).\n\n b: number (optional)\n Maximum support (exclusive).\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.uniform.factory();\n > var r = rand( 0.0, 1.0 );\n > r = rand( -2.0, 2.0 );\n\n // Provide `a` and `b`:\n > rand = base.random.uniform.factory( 0.0, 1.0 );\n > r = rand();\n > r = rand();\n\n\nbase.random.uniform.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.uniform.NAME\n 'uniform'\n\n\nbase.random.uniform.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.uniform.PRNG;\n\n\nbase.random.uniform.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.uniform.seed;\n\n\nbase.random.uniform.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.uniform.seedLength;\n\n\nbase.random.uniform.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.uniform.state\n <Uint32Array>\n\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.uniform.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n > r = base.random.uniform( 2.0, 5.0 )\n <number>\n\n\nbase.random.uniform.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.uniform.stateLength;\n\n\nbase.random.uniform.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.uniform.byteLength;\n\n\nbase.random.uniform.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.uniform.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n See Also\n --------\n base.random.discreteUniform, base.random.randu\n",
"base.random.weibull": "\nbase.random.weibull( k, λ )\n Returns a pseudorandom number drawn from a Weibull distribution.\n\n If `k <= 0` or `λ <= 0`, the function returns `NaN`.\n\n If either `λ` or `k` is `NaN`, the function returns `NaN`.\n\n Parameters\n ----------\n k: number\n Scale parameter.\n\n λ: number\n Shape parameter.\n\n Returns\n -------\n r: number\n Pseudorandom number.\n\n Examples\n --------\n > var r = base.random.weibull( 2.0, 5.0 );\n\n\nbase.random.weibull.factory( [k, λ, ][options] )\n Returns a pseudorandom number generator (PRNG) for generating pseudorandom\n numbers drawn from a Weibull distribution.\n\n If provided `k` and `λ`, the returned PRNG returns random variates drawn\n from the specified distribution.\n\n If not provided `k` and `λ`, the returned PRNG requires that both\n `k` and `λ` be provided at each invocation.\n\n Parameters\n ----------\n k: number (optional)\n Scale parameter.\n\n λ: number (optional)\n Shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned pseudorandom number generator, one must seed the provided\n `prng` (assuming the provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n Returns\n -------\n rand: Function\n Pseudorandom number generator (PRNG).\n\n Examples\n --------\n // Basic usage:\n > var rand = base.random.weibull.factory();\n > var r = rand( 0.1, 1.5 );\n > r = rand( 2.0, 3.14 );\n\n // Provide `λ` and `k`:\n > rand = base.random.weibull.factory( 0.1, 1.5 );\n > r = rand();\n > r = rand();\n\n\nbase.random.weibull.NAME\n Generator name.\n\n Examples\n --------\n > var str = base.random.weibull.NAME\n 'weibull'\n\n\nbase.random.weibull.PRNG\n Underlying pseudorandom number generator.\n\n Examples\n --------\n > var prng = base.random.weibull.PRNG;\n\n\nbase.random.weibull.seed\n Pseudorandom number generator seed.\n\n Examples\n --------\n > var seed = base.random.weibull.seed;\n\n\nbase.random.weibull.seedLength\n Length of generator seed.\n\n Examples\n --------\n > var len = base.random.weibull.seedLength;\n\n\nbase.random.weibull.state\n Generator state.\n\n Examples\n --------\n > var r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n // Get a copy of the current state:\n > var state = base.random.weibull.state\n <Uint32Array>\n\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n // Set the state:\n > base.random.weibull.state = state;\n\n // Replay the last two pseudorandom numbers:\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n > r = base.random.weibull( 2.0, 5.0 )\n <number>\n\n\nbase.random.weibull.stateLength\n Length of generator state.\n\n Examples\n --------\n > var len = base.random.weibull.stateLength;\n\n\nbase.random.weibull.byteLength\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var sz = base.random.weibull.byteLength;\n\n\nbase.random.weibull.toJSON()\n Serializes the pseudorandom number generator as a JSON object.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var o = base.random.weibull.toJSON()\n { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }\n\n",
"base.reldiff": "\nbase.reldiff( x, y[, scale] )\n Computes the relative difference of two real numbers.\n\n By default, the function scales the absolute difference by dividing the\n absolute difference by the maximum absolute value of `x` and `y`. To scale\n by a different function, specify a scale function name.\n\n The following `scale` functions are supported:\n\n - 'max-abs': maximum absolute value of `x` and `y` (default).\n - 'max': maximum value of `x` and `y`.\n - 'min-abs': minimum absolute value of `x` and `y`.\n - 'min': minimum value of `x` and `y`.\n - 'mean-abs': arithmetic mean of the absolute values of `x` and `y`.\n - 'mean': arithmetic mean of `x` and `y`.\n - 'x': `x` (*noncommutative*).\n - 'y': `y` (*noncommutative*).\n\n To use a custom scale function, provide a function which accepts two numeric\n arguments `x` and `y`.\n\n If the absolute difference of `x` and `y` is `0`, the relative difference is\n always `0`.\n\n If `|x| = |y| = infinity`, the function returns `NaN`.\n\n If `|x| = |-y| = infinity`, the relative difference is `+infinity`.\n\n If a `scale` function returns `0`, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n scale: string|Function (optional)\n Scale function. Default: `'max-abs'`.\n\n Returns\n -------\n out: number\n Relative difference.\n\n Examples\n --------\n > var d = base.reldiff( 2.0, 5.0 )\n 0.6\n > d = base.reldiff( -1.0, 3.14 )\n ~1.318\n > d = base.reldiff( -2.0, 5.0, 'max-abs' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'max' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'min-abs' )\n 3.5\n > d = base.reldiff( -2.0, 5.0, 'min' )\n 3.5\n > d = base.reldiff( -2.0, 5.0, 'mean-abs' )\n 2.0\n > d = base.reldiff( -2.0, 5.0, 'mean' )\n ~4.667\n > d = base.reldiff( -2.0, 5.0, 'x' )\n 3.5\n > d = base.reldiff( 5.0, -2.0, 'x' )\n 1.4\n > d = base.reldiff( -2.0, 5.0, 'y' )\n 1.4\n > d = base.reldiff( 5.0, -2.0, 'y' )\n 3.5\n\n // Custom scale function:\n > function scale( x, y ) {\n ... var s;\n ...\n ... x = base.abs( x );\n ... y = base.abs( y );\n ...\n ... // Maximum absolute value:\n ... s = (x < y ) ? y : x;\n ...\n ... // Scale in units of epsilon:\n ... return s * EPS;\n ... };\n > d = base.reldiff( 12.15, 12.149999999999999, scale )\n ~0.658\n\n See Also\n --------\n base.absdiff, base.epsdiff\n",
"base.rempio2": "\nbase.rempio2( x, y )\n Computes `x - nπ/2 = r`.\n\n The function returns `n` and stores the remainder `r` as the two numbers\n `y[0]` and `y[1]`, such that `y[0] + y[1] = r`.\n\n For input values larger than `2^20 * π/2` in magnitude, the function only\n returns the last three binary digits of `n` and not the full result.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: Array|TypedArray|Object\n Remainder elements.\n\n Returns\n -------\n n: integer\n Factor of `π/2`.\n\n Examples\n --------\n > var y = new Array( 2 );\n > var n = base.rempio2( 128.0, y )\n 81\n > var y1 = y[ 0 ]\n ~0.765\n > var y2 = y[ 1 ]\n ~3.618e-17\n\n\n",
"base.risingFactorial": "\nbase.risingFactorial( x, n )\n Computes the rising factorial of `x` and `n`.\n\n If provided a non-integer for `n`, the function returns `NaN`.\n\n If provided `NaN` as any argument, the function returns `NaN`.\n\n Parameters\n ----------\n x: number\n First function parameter.\n\n n: integer\n Second function parameter.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var v = base.risingFactorial( 0.9, 5 )\n ~94.766\n > v = base.risingFactorial( -9.0, 3 )\n -504.0\n > v = base.risingFactorial( 0.0, 2 )\n 0.0\n > v = base.risingFactorial( 3.0, -2 )\n 0.5\n\n See Also\n --------\n base.fallingFactorial\n",
"base.rotl32": "\nbase.rotl32( x, shift )\n Performs a bitwise rotation to the left.\n\n If `shift = 0`, the function returns `x`.\n\n If `shift >= 32`, the function only considers the five least significant\n bits of `shift` (i.e., `shift % 32`).\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n shift: integer\n Number of bits to shift.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var x = 2147483649;\n > var bStr = base.toBinaryStringUint32( x )\n '10000000000000000000000000000001'\n > var y = base.rotl32( x, 10 )\n 1536\n > bstr = base.toBinaryStringUint32( y )\n '00000000000000000000011000000000'\n\n See Also\n --------\n base.rotr32\n",
"base.rotr32": "\nbase.rotr32( x, shift )\n Performs a bitwise rotation to the right.\n\n If `shift = 0`, the function returns `x`.\n\n If `shift >= 32`, the function only considers the five least significant\n bits of `shift` (i.e., `shift % 32`).\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n shift: integer\n Number of bits to shift.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var x = 1;\n > var bStr = base.toBinaryStringUint32( x )\n '00000000000000000000000000000001'\n > var y = base.rotr32( x, 10 )\n 4194304\n > bstr = base.toBinaryStringUint32( y )\n '00000000010000000000000000000000'\n\n See Also\n --------\n base.rotl32\n",
"base.round": "\nbase.round( x )\n Rounds a numeric value to the nearest integer.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round( 3.14 )\n 3.0\n > y = base.round( -4.2 )\n -4.0\n > y = base.round( -4.6 )\n -5.0\n > y = base.round( 9.5 )\n 10.0\n > y = base.round( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.floor, base.roundn, base.trunc\n",
"base.round2": "\nbase.round2( x )\n Rounds a numeric value to the nearest power of two on a linear scale.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round2( 3.14 )\n 4.0\n > y = base.round2( -4.2 )\n -4.0\n > y = base.round2( -4.6 )\n -4.0\n > y = base.round2( 9.5 )\n 8.0\n > y = base.round2( 13.0 )\n 16.0\n > y = base.round2( -13.0 )\n -16.0\n > y = base.round2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor2, base.round, base.round10\n",
"base.round10": "\nbase.round10( x )\n Rounds a numeric value to the nearest power of ten on a linear scale.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.round10( 3.14 )\n 1.0\n > y = base.round10( -4.2 )\n -1.0\n > y = base.round10( -4.6 )\n -1.0\n > y = base.round10( 9.5 )\n 10.0\n > y = base.round10( 13.0 )\n 10.0\n > y = base.round10( -13.0 )\n -10.0\n > y = base.round10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor10, base.round, base.round2\n",
"base.roundb": "\nbase.roundb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` on a linear scale.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.roundb( 3.14159, -2, 10 )\n 3.14\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.roundb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two:\n > y = base.roundb( 5.0, 1, 2 )\n 6.0\n\n See Also\n --------\n base.ceilb, base.floorb, base.round, base.roundn\n",
"base.roundn": "\nbase.roundn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n`.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 2 decimal places:\n > var y = base.roundn( 3.14159, -2 )\n 3.14\n\n // If `n = 0`, standard round behavior:\n > y = base.roundn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.roundn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floorn, base.round, base.roundb\n",
"base.roundsd": "\nbase.roundsd( x, n[, b] )\n Rounds a numeric value to the nearest number with `n` significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.roundsd( 3.14159, 3 )\n 3.14\n > y = base.roundsd( 3.14159, 1 )\n 3.0\n > y = base.roundsd( 12368.0, 2 )\n 12000.0\n > y = base.roundsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floorsd, base.round, base.truncsd\n",
"base.sasum": "\nbase.sasum( N, x, stride )\n Computes the sum of the absolute values.\n\n The sum of absolute values corresponds to the *L1* norm.\n\n The `N` and `stride` parameters determine which elements in `x` are used to\n compute the sum.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` or `stride` is less than or equal to `0`, the function returns `0`.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float32Array\n Input array.\n\n stride: integer\n Index increment.\n\n Returns\n -------\n sum: float\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.sasum( x.length, x, 1 )\n 19.0\n\n // Sum every other value:\n > var N = base.floor( x.length / 2 );\n > var stride = 2;\n > sum = base.sasum( N, x, stride )\n 10.0\n\n // Use view offset; e.g., starting at 2nd element:\n > var x0 = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > N = base.floor( x0.length / 2 );\n > sum = base.sasum( N, x1, stride )\n 12.0\n\n\nbase.sasum.ndarray( N, x, stride, offset )\n Computes the sum of absolute values using alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameter supports indexing semantics based on a\n starting index.\n\n Parameters\n ----------\n N: integer\n Number of elements to sum.\n\n x: Float32Array\n Input array.\n\n stride: integer\n Index increment.\n\n offset: integer\n Starting index.\n\n Returns\n -------\n sum: float\n Sum of absolute values.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n > var sum = base.sasum.ndarray( x.length, x, 1, 0 )\n 19.0\n\n // Sum the last three elements:\n > x = new Float32Array( [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ] );\n > sum = base.sasum.ndarray( 3, x, -1, x.length-1 )\n 15.0\n\n See Also\n --------\n base.dasum\n",
"base.saxpy": "\nbase.saxpy( N, alpha, x, strideX, y, strideY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`.\n\n The `N` and `stride` parameters determine which elements in `x` and `y` are\n accessed at runtime.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N <= 0` or `alpha == 0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.saxpy( x.length, alpha, x, 1, y, 1 )\n <Float32Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Using `N` and `stride` parameters:\n > var N = base.floor( x.length / 2 );\n > base.saxpy( N, alpha, x, 2, y, -1 )\n <Float32Array>[ 26.0, 16.0, 6.0, 1.0, 1.0, 1.0 ]\n\n // Using view offsets:\n > var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.saxpy( N, 5.0, x1, -2, y1, 1 )\n <Float32Array>[ 40.0, 33.0, 22.0 ]\n > y0\n <Float32Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n\nbase.saxpy.ndarray( N, alpha, x, strideX, offsetX, y, strideY, offsetY )\n Multiplies `x` by a constant `alpha` and adds the result to `y`, with\n alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offsetX` and `offsetY` parameters support indexing semantics\n based on starting indices.\n\n Parameters\n ----------\n N: integer\n Number of indexed elements.\n\n alpha: number\n Constant.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );\n > var alpha = 5.0;\n > base.saxpy.ndarray( x.length, alpha, x, 1, 0, y, 1, 0 )\n <Float32Array>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.saxpy.ndarray( N, alpha, x, 2, 1, y, -1, y.length-1 )\n <Float32Array>[ 7.0, 8.0, 9.0, 40.0, 31.0, 22.0 ]\n\n See Also\n --------\n base.daxpy\n",
"base.scopy": "\nbase.scopy( N, x, strideX, y, strideY )\n Copies values from `x` into `y`.\n\n The `N` and `stride` parameters determine how values from `x` are copied\n into `y`.\n\n Indexing is relative to the first index. To introduce an offset, use typed\n array views.\n\n If `N` is less than or equal to `0`, the function returns `y` unchanged.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.scopy( x.length, x, 1, y, 1 )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.scopy( N, x, -2, y, 1 )\n <Float32Array>[ 5.0, 3.0, 1.0, 10.0, 11.0, 12.0 ]\n\n // Using typed array views:\n > var x0 = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > var y0 = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 );\n > var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 );\n > N = base.floor( x0.length / 2 );\n > base.scopy( N, x1, -2, y1, 1 )\n <Float32Array>[ 6.0, 4.0, 2.0 ]\n > y0\n <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n\nbase.scopy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )\n Copies values from `x` into `y`, with alternative indexing semantics.\n\n While typed array views mandate a view offset based on the underlying\n buffer, the `offset` parameters support indexing semantics based on starting\n indices.\n\n Parameters\n ----------\n N: integer\n Number of values to copy.\n\n x: Float32Array\n Input array.\n\n strideX: integer\n Index increment for `x`.\n\n offsetX: integer\n Starting index for `x`.\n\n y: Float32Array\n Destination array.\n\n strideY: integer\n Index increment for `y`.\n\n offsetY: integer\n Starting index for `y`.\n\n Returns\n -------\n y: Float32Array\n Input array `y`.\n\n Examples\n --------\n // Standard usage:\n > var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );\n > var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] );\n > base.scopy.ndarray( x.length, x, 1, 0, y, 1, 0 )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Advanced indexing:\n > x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );\n > y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );\n > var N = base.floor( x.length / 2 );\n > base.scopy.ndarray( N, x, 2, 1, y, -1, y.length-1 )\n <Float32Array>[ 7.0, 8.0, 9.0, 6.0, 4.0, 2.0 ]\n\n See Also\n --------\n base.dcopy\n",
"base.setHighWord": "\nbase.setHighWord( x, high )\n Sets the more significant 32 bits of a double-precision floating-point\n number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n high: integer\n Unsigned 32-bit integer to replace the higher order word of `x`.\n\n Returns\n -------\n out: number\n Double having the same lower order word as `x`.\n\n Examples\n --------\n // Set the higher order bits of `+infinity` to return `1`:\n > var high = 1072693248 >>> 0;\n > var y = base.setHighWord( PINF, high )\n 1.0\n\n See Also\n --------\n base.getHighWord, base.setLowWord\n",
"base.setLowWord": "\nbase.setLowWord( x, low )\n Sets the less significant 32 bits of a double-precision floating-point\n number.\n\n Setting the lower order bits of `NaN` or positive or negative infinity will\n return `NaN`, as `NaN` is defined as a double whose exponent bit sequence is\n all ones and whose fraction can be any bit sequence except all zeros.\n Positive and negative infinity are defined as doubles with an exponent bit\n sequence equal to all ones and a fraction equal to all zeros. Hence,\n changing the less significant bits of positive and negative infinity\n converts each value to `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n low: integer\n Unsigned 32-bit integer to replace the lower order word of `x`.\n\n Returns\n -------\n out: number\n Double having the same higher order word as `x`.\n\n Examples\n --------\n > var low = 5 >>> 0;\n > var x = 3.14e201;\n > var y = base.setLowWord( x, low )\n 3.139998651394392e+201\n\n // Special cases:\n > var low = 12345678;\n > var y = base.setLowWord( PINF, low )\n NaN\n > y = base.setLowWord( NINF, low )\n NaN\n > y = base.setLowWord( NaN, low )\n NaN\n\n See Also\n --------\n base.getLowWord, base.setHighWord\n",
"base.sici": "\nbase.sici( [out,] x )\n Computes the sine and cosine integrals.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Input value.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Sine and cosine integrals.\n\n Examples\n --------\n > var y = base.sici( 3.0 )\n [ ~1.849, ~0.12 ]\n > y = base.sici( 0.0 )\n [ 0.0, -Infinity ]\n > y = base.sici( -9.0 )\n [ ~-1.665, ~0.055 ]\n > y = base.sici( NaN )\n [ NaN, NaN ]\n\n // Provide an output array:\n > var out = new Float64Array( 2 );\n > y = base.sici( out, 3.0 )\n <Float64Array>[ ~1.849, ~0.12 ]\n > var bool = ( y === out )\n true\n\n",
"base.signbit": "\nbase.signbit( x )\n Returns a boolean indicating if the sign bit is on (true) or off (false).\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if sign bit is on or off.\n\n Examples\n --------\n > var bool = base.signbit( 4.0 )\n false\n > bool = base.signbit( -9.14e-34 )\n true\n > bool = base.signbit( 0.0 )\n false\n > bool = base.signbit( -0.0 )\n true\n\n See Also\n --------\n base.signbitf\n",
"base.signbitf": "\nbase.signbitf( x )\n Returns a boolean indicating if the sign bit is on (true) or off (false).\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if sign bit is on or off.\n\n Examples\n --------\n > var bool = base.signbitf( base.float64ToFloat32( 4.0 ) )\n false\n > bool = base.signbitf( base.float64ToFloat32( -9.14e-34 ) )\n true\n > bool = base.signbitf( 0.0 )\n false\n > bool = base.signbitf( -0.0 )\n true\n\n See Also\n --------\n base.signbit\n",
"base.significandf": "\nbase.significandf( x )\n Returns an integer corresponding to the significand of a single-precision\n floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Significand.\n\n Examples\n --------\n > var s = base.significandf( base.float64ToFloat32( 3.14e34 ) )\n 4293751\n > s = base.significandf( base.float64ToFloat32( 3.14e-34 ) )\n 5288021\n > s = base.significandf( base.float64ToFloat32( -3.14 ) )\n 4781507\n > s = base.significandf( 0.0 )\n 0\n > s = base.significandf( NaN )\n 4194304\n\n",
"base.signum": "\nbase.signum( x )\n Evaluates the signum function.\n\n Value | Sign\n ----- | -----\n x > 0 | +1\n x < 0 | -1\n 0 | 0\n -0 | -0\n NaN | NaN\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n sign: number\n Function value.\n\n Examples\n --------\n > var sign = base.signum( -5.0 )\n -1.0\n > sign = base.signum( 5.0 )\n 1.0\n > sign = base.signum( -0.0 )\n -0.0\n > sign = base.signum( 0.0 )\n 0.0\n > sign = base.signum( NaN )\n NaN\n\n",
"base.sin": "\nbase.sin( x )\n Computes the sine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Sine.\n\n Examples\n --------\n > var y = base.sin( 0.0 )\n ~0.0\n > y = base.sin( PI/2.0 )\n ~1.0\n > y = base.sin( -PI/6.0 )\n ~-0.5\n > y = base.sin( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sinpi, base.tan\n",
"base.sinc": "\nbase.sinc( x )\n Computes the normalized cardinal sine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Cardinal sine.\n\n Examples\n --------\n > var y = base.sinc( 0.5 )\n ~0.637\n > y = base.sinc( -1.2 )\n ~-0.156\n > y = base.sinc( 0.0 )\n 1.0\n > y = base.sinc( NaN )\n NaN\n\n See Also\n --------\n base.sin\n",
"base.sincos": "\nbase.sincos( [out,] x )\n Simultaneously computes the sine and cosine of a number.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: Array|TypedArray|Object\n Sine and cosine.\n\n Examples\n --------\n > var y = base.sincos( 0.0 )\n [ ~0.0, ~1.0 ]\n > y = base.sincos( PI/2.0 )\n [ ~1.0, ~0.0 ]\n > y = base.sincos( -PI/6.0 )\n [ ~-0.5, ~0.866 ]\n > y = base.sincos( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.sincos( out, 0.0 )\n <Float64Array>[ ~0.0, ~1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cos, base.sin, base.sincospi\n",
"base.sincospi": "\nbase.sincospi( [out,] x )\n Simultaneously computes the sine and cosine of a number times π.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Destination array.\n\n x: number\n Input value.\n\n Returns\n -------\n y: Array|TypedArray|Object\n Two-element array containing sin(πx) and cos(πx).\n\n Examples\n --------\n > var y = base.sincospi( 0.0 )\n [ 0.0, 1.0 ]\n > y = base.sincospi( 0.5 )\n [ 1.0, 0.0 ]\n > y = base.sincospi( 0.1 )\n [ ~0.309, ~0.951 ]\n > y = base.sincospi( NaN )\n [ NaN, NaN ]\n\n > var out = new Float64Array( 2 );\n > var v = base.sincospi( out, 0.0 )\n <Float64Array>[ 0.0, 1.0 ]\n > var bool = ( v === out )\n true\n\n See Also\n --------\n base.cospi, base.sincos, base.sinpi\n",
"base.sinh": "\nbase.sinh( x )\n Computes the hyperbolic sine of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic sine.\n\n Examples\n --------\n > var y = base.sinh( 0.0 )\n 0.0\n > y = base.sinh( 2.0 )\n ~3.627\n > y = base.sinh( -2.0 )\n ~-3.627\n > y = base.sinh( NaN )\n NaN\n\n See Also\n --------\n base.cosh, base.sin, base.tanh\n",
"base.sinpi": "\nbase.sinpi( x )\n Computes the value of `sin(πx)`.\n\n The function computes `sin(πx)` more accurately than the obvious approach,\n especially for large `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.sinpi( 0.0 )\n 0.0\n > y = base.sinpi( 0.5 )\n 1.0\n > y = base.sinpi( 0.9 )\n ~0.309\n > y = base.sinpi( NaN )\n NaN\n\n See Also\n --------\n base.sin\n",
"base.spence": "\nbase.spence( x )\n Evaluates Spence’s function, which is also known as the dilogarithm.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.spence( 3.0 )\n ~-1.437\n > y = base.spence( 0.0 )\n ~1.645\n > y = base.spence( -9.0 )\n NaN\n > y = base.spence( NaN )\n NaN\n\n",
"base.sqrt": "\nbase.sqrt( x )\n Computes the principal square root.\n\n For `x < 0`, the principal square root is not defined.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Principal square root.\n\n Examples\n --------\n > var y = base.sqrt( 4.0 )\n 2.0\n > y = base.sqrt( 9.0 )\n 3.0\n > y = base.sqrt( 0.0 )\n 0.0\n > y = base.sqrt( -4.0 )\n NaN\n > y = base.sqrt( NaN )\n NaN\n\n",
"base.sqrt1pm1": "\nbase.sqrt1pm1( x )\n Computes the principal square root of `1+x` minus one.\n\n This function is more accurate than the obvious approach for small `x`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Square root of `1+x` minus one.\n\n Examples\n --------\n > var y = base.sqrt1pm1( 3.0 )\n 1.0\n > y = base.sqrt1pm1( 0.5 )\n ~0.225\n > y = base.sqrt1pm1( 0.02 )\n ~0.01\n > y = base.sqrt1pm1( -0.5 )\n ~-0.293\n > y = base.sqrt1pm1( -1.1 )\n NaN\n > y = base.sqrt1pm1( NaN )\n NaN\n\n See Also\n --------\n base.sqrt\n",
"base.sumSeries": "\nbase.sumSeries( generator[, options] )\n Sum the elements of the series given by the supplied function.\n\n Parameters\n ----------\n generator: Function\n Series function.\n\n options: Object (optional)\n Options.\n\n options.maxTerms: integer (optional)\n Maximum number of terms to be added. Default: `1000000`.\n\n options.tolerance: number (optional)\n Further terms are only added as long as the next term is greater than\n the current term times the tolerance. Default: `2.22e-16`.\n\n options.initialValue: number (optional)\n Initial value of the resulting sum. Default: `0`.\n\n Returns\n -------\n out: number\n Sum of series terms.\n\n Examples\n --------\n // Using an ES6 generator function:\n > function* geometricSeriesGenerator( x ) {\n ... var exponent = 0;\n ... while ( true ) {\n ... yield Math.pow( x, exponent );\n ... exponent += 1;\n ... }\n ... };\n > var gen = geometricSeriesGenerator( 0.9 );\n > var out = base.sumSeries( gen )\n 10\n\n // Using a closure:\n > function geometricSeriesClosure( x ) {\n ... var exponent = -1;\n ... return function() {\n ... exponent += 1;\n ... return Math.pow( x, exponent );\n ... };\n ... };\n > gen = geometricSeriesClosure( 0.9 );\n > out = base.sumSeries( gen )\n 10\n\n // Setting an initial value for the sum:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'initialValue': 1 } )\n 3\n // Changing the maximum number of terms to be summed:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'maxTerms': 10 } )\n ~1.998 // Infinite sum is 2\n\n // Adjusting the used tolerance:\n > out = base.sumSeries( geometricSeriesGenerator( 0.5 ), { 'tolerance': 1e-3 } )\n ~1.998\n\n",
"base.tan": "\nbase.tan( x )\n Computes the tangent of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Tangent.\n\n Examples\n --------\n > var y = base.tan( 0.0 )\n ~0.0\n > y = base.tan( -PI/4.0 )\n ~-1.0\n > y = base.tan( PI/4.0 )\n ~1.0\n > y = base.tan( NaN )\n NaN\n\n See Also\n --------\n base.cos, base.sin\n",
"base.tanh": "\nbase.tanh( x )\n Computes the hyperbolic tangent of a number.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Hyperbolic tangent.\n\n Examples\n --------\n > var y = base.tanh( 0.0 )\n 0.0\n > var y = base.tanh( -0.0 )\n -0.0\n > y = base.tanh( 2.0 )\n ~0.964\n > y = base.tanh( -2.0 )\n ~-0.964\n > y = base.tanh( NaN )\n NaN\n\n See Also\n --------\n base.cosh, base.sinh, base.tan\n",
"base.toBinaryString": "\nbase.toBinaryString( x )\n Returns a string giving the literal bit representation of a double-precision\n floating-point number.\n\n Parameters\n ----------\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n bstr: string\n Bit representation.\n\n Examples\n --------\n > var str = base.toBinaryString( 4.0 )\n '0100000000010000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( PI )\n '0100000000001001001000011111101101010100010001000010110100011000'\n > str = base.toBinaryString( -1.0e308 )\n '1111111111100001110011001111001110000101111010111100100010100000'\n > str = base.toBinaryString( -3.14e-320 )\n '1000000000000000000000000000000000000000000000000001100011010011'\n > str = base.toBinaryString( 5.0e-324 )\n '0000000000000000000000000000000000000000000000000000000000000001'\n > str = base.toBinaryString( 0.0 )\n '0000000000000000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( -0.0 )\n '1000000000000000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( NaN )\n '0111111111111000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( PINF )\n '0111111111110000000000000000000000000000000000000000000000000000'\n > str = base.toBinaryString( NINF )\n '1111111111110000000000000000000000000000000000000000000000000000'\n\n See Also\n --------\n base.fromBinaryString, base.toBinaryStringf\n",
"base.toBinaryStringf": "\nbase.toBinaryStringf( x )\n Returns a string giving the literal bit representation of a single-precision\n floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var str = base.toBinaryStringf( base.float64ToFloat32( 4.0 ) )\n '01000000100000000000000000000000'\n > str = base.toBinaryStringf( base.float64ToFloat32( PI ) )\n '01000000010010010000111111011011'\n > str = base.toBinaryStringf( base.float64ToFloat32( -1.0e38 ) )\n '11111110100101100111011010011001'\n > str = base.toBinaryStringf( base.float64ToFloat32( -3.14e-39 ) )\n '10000000001000100011000100001011'\n > str = base.toBinaryStringf( base.float64ToFloat32( 1.4e-45 ) )\n '00000000000000000000000000000001'\n > str = base.toBinaryStringf( 0.0 )\n '00000000000000000000000000000000'\n > str = base.toBinaryStringf( -0.0 )\n '10000000000000000000000000000000'\n > str = base.toBinaryStringf( NaN )\n '01111111110000000000000000000000'\n > str = base.toBinaryStringf( FLOAT32_PINF )\n '01111111100000000000000000000000'\n > str = base.toBinaryStringf( FLOAT32_NINF )\n '11111111100000000000000000000000'\n\n See Also\n --------\n base.fromBinaryStringf, base.toBinaryString\n",
"base.toBinaryStringUint8": "\nbase.toBinaryStringUint8( x )\n Returns a string giving the literal bit representation of an unsigned 8-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 8-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 8-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned 8-bit\n integers. Accordingly, care should be taken to ensure that only nonnegative\n integer values less than `256` (`2^8`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint8Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint8( a[ 0 ] )\n '00000001'\n > str = base.toBinaryStringUint8( a[ 1 ] )\n '00000100'\n > str = base.toBinaryStringUint8( a[ 2 ] )\n '00001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toBinaryStringUint16": "\nbase.toBinaryStringUint16( x )\n Returns a string giving the literal bit representation of an unsigned 16-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 16-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 16-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned\n 16-bit integers. Accordingly, care should be taken to ensure that only\n nonnegative integer values less than `65536` (`2^16`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint16Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint16( a[ 0 ] )\n '0000000000000001'\n > str = base.toBinaryStringUint16( a[ 1 ] )\n '0000000000000100'\n > str = base.toBinaryStringUint16( a[ 2 ] )\n '0000000000001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toBinaryStringUint32": "\nbase.toBinaryStringUint32( x )\n Returns a string giving the literal bit representation of an unsigned 32-bit\n integer.\n\n Except for typed arrays, JavaScript does not provide native user support for\n unsigned 32-bit integers. According to the ECMAScript standard, `number`\n values correspond to double-precision floating-point numbers. While this\n function is intended for unsigned 32-bit integers, the function will accept\n floating-point values and represent the values as if they are unsigned\n 32-bit integers. Accordingly, care should be taken to ensure that only\n nonnegative integer values less than `4,294,967,296` (`2^32`) are provided.\n\n Parameters\n ----------\n x: integer\n Input value.\n\n Returns\n -------\n str: string\n Bit representation.\n\n Examples\n --------\n > var a = new Uint32Array( [ 1, 4, 9 ] );\n > var str = base.toBinaryStringUint32( a[ 0 ] )\n '00000000000000000000000000000001'\n > str = base.toBinaryStringUint32( a[ 1 ] )\n '00000000000000000000000000000100'\n > str = base.toBinaryStringUint32( a[ 2 ] )\n '00000000000000000000000000001001'\n\n See Also\n --------\n base.toBinaryString\n",
"base.toWordf": "\nbase.toWordf( x )\n Returns an unsigned 32-bit integer corresponding to the IEEE 754 binary\n representation of a single-precision floating-point number.\n\n Parameters\n ----------\n x: float\n Single-precision floating-point number.\n\n Returns\n -------\n out: integer\n Unsigned 32-bit integer.\n\n Examples\n --------\n > var f32 = base.float64ToFloat32( 1.337 )\n 1.3370000123977661\n > var w = base.toWordf( f32 )\n 1068180177\n\n See Also\n --------\n base.fromWordf, base.toWords\n",
"base.toWords": "\nbase.toWords( [out,] x )\n Splits a floating-point number into a higher order word (unsigned 32-bit\n integer) and a lower order word (unsigned 32-bit integer).\n\n When provided a destination object, the function returns an array with two\n elements: a higher order word and a lower order word, respectively. The\n lower order word contains the less significant bits, while the higher order\n word contains the more significant bits and includes the exponent and sign.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n x: number\n Double-precision floating-point number.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Higher and lower order words.\n\n Examples\n --------\n > var w = base.toWords( 3.14e201 )\n [ 1774486211, 2479577218 ]\n\n // Provide an output array:\n > var out = new Uint32Array( 2 );\n > w = base.toWords( out, 3.14e201 )\n <Uint32Array>[ 1774486211, 2479577218 ]\n > var bool = ( w === out )\n true\n\n See Also\n --------\n base.fromWords, base.toWordf",
"base.trigamma": "\nbase.trigamma( x )\n Evaluates the trigamma function.\n\n If `x` is `0` or a negative `integer`, the `function` returns `NaN`.\n\n If provided `NaN`, the `function` returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.trigamma( -2.5 )\n ~9.539\n > y = base.trigamma( 1.0 )\n ~1.645\n > y = base.trigamma( 10.0 )\n ~0.105\n > y = base.trigamma( NaN )\n NaN\n > y = base.trigamma( -1.0 )\n NaN\n\n See Also\n --------\n base.digamma, base.gamma\n",
"base.trunc": "\nbase.trunc( x )\n Rounds a numeric value toward zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc( 3.14 )\n 3.0\n > y = base.trunc( -4.2 )\n -4.0\n > y = base.trunc( -4.6 )\n -4.0\n > y = base.trunc( 9.5 )\n 9.0\n > y = base.trunc( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil, base.floor, base.round\n",
"base.trunc2": "\nbase.trunc2( x )\n Rounds a numeric value to the nearest power of two toward zero.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc2( 3.14 )\n 2.0\n > y = base.trunc2( -4.2 )\n -4.0\n > y = base.trunc2( -4.6 )\n -4.0\n > y = base.trunc2( 9.5 )\n 8.0\n > y = base.trunc2( 13.0 )\n 8.0\n > y = base.trunc2( -13.0 )\n -8.0\n > y = base.trunc2( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil2, base.floor2, base.round2, base.trunc, base.trunc10\n",
"base.trunc10": "\nbase.trunc10( x )\n Rounds a numeric value to the nearest power of ten toward zero.\n\n The function may not return accurate results for subnormals due to a general\n loss in precision.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.trunc10( 3.14 )\n 1.0\n > y = base.trunc10( -4.2 )\n -1.0\n > y = base.trunc10( -4.6 )\n -1.0\n > y = base.trunc10( 9.5 )\n 1.0\n > y = base.trunc10( 13.0 )\n 10.0\n > y = base.trunc10( -13.0 )\n -10.0\n > y = base.trunc10( -0.0 )\n -0.0\n\n See Also\n --------\n base.ceil10, base.floor10, base.round10, base.trunc, base.trunc2\n",
"base.truncb": "\nbase.truncb( x, n, b )\n Rounds a numeric value to the nearest multiple of `b^n` toward zero.\n\n Due to floating-point rounding error, rounding may not be exact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power.\n\n b: integer\n Base.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.truncb( 3.14159, -4, 10 )\n 3.1415\n\n // If `n = 0` or `b = 1`, standard round behavior:\n > y = base.truncb( 3.14159, 0, 2 )\n 3.0\n\n // Round to nearest multiple of two toward zero:\n > y = base.truncb( 5.0, 1, 2 )\n 4.0\n\n See Also\n --------\n base.ceilb, base.floorb, base.roundb, base.trunc, base.truncn\n",
"base.truncn": "\nbase.truncn( x, n )\n Rounds a numeric value to the nearest multiple of `10^n` toward zero.\n\n When operating on floating-point numbers in bases other than `2`, rounding\n to specified digits can be inexact.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Integer power of 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n // Round to 4 decimal places:\n > var y = base.truncn( 3.14159, -4 )\n 3.1415\n\n // If `n = 0`, standard round behavior:\n > y = base.truncn( 3.14159, 0 )\n 3.0\n\n // Round to nearest thousand:\n > y = base.truncn( 12368.0, 3 )\n 12000.0\n\n\n See Also\n --------\n base.ceiln, base.floorn, base.roundn, base.trunc, base.truncb\n",
"base.truncsd": "\nbase.truncsd( x, n[, b] )\n Rounds a numeric value to the nearest number toward zero with `n`\n significant figures.\n\n Parameters\n ----------\n x: number\n Input value.\n\n n: integer\n Number of significant figures. Must be greater than 0.\n\n b: integer (optional)\n Base. Must be greater than 0. Default: 10.\n\n Returns\n -------\n y: number\n Rounded value.\n\n Examples\n --------\n > var y = base.truncsd( 3.14159, 5 )\n 3.1415\n > y = base.truncsd( 3.14159, 1 )\n 3.0\n > y = base.truncsd( 12368.0, 2 )\n 12000.0\n > y = base.truncsd( 0.0313, 2, 2 )\n 0.03125\n\n See Also\n --------\n base.ceilsd, base.floorsd, base.roundsd, base.trunc\n",
"base.uimul": "\nbase.uimul( a, b )\n Performs C-like multiplication of two unsigned 32-bit integers.\n\n Parameters\n ----------\n a: integer\n Unsigned 32-bit integer.\n\n b: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: integer\n Product.\n\n Examples\n --------\n > var v = base.uimul( 10>>>0, 4>>>0 )\n 40\n\n See Also\n --------\n base.imul\n",
"base.uimuldw": "\nbase.uimuldw( [out,] a, b )\n Multiplies two unsigned 32-bit integers and returns an array of two unsigned\n 32-bit integers which represents the unsigned 64-bit integer product.\n\n When computing the product of 32-bit integer values in double-precision\n floating-point format (the default JavaScript numeric data type), computing\n the double word product is necessary in order to avoid exceeding the maximum\n safe double-precision floating-point integer value.\n\n Parameters\n ----------\n out: ArrayLikeObject (optional)\n The output array.\n\n a: integer\n Unsigned 32-bit integer.\n\n b: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: ArrayLikeObject\n Double word product (in big endian order; i.e., the first element\n corresponds to the most significant bits and the second element to the\n least significant bits).\n\n Examples\n --------\n > var v = base.uimuldw( 1, 10 )\n [ 0, 10 ]\n\n See Also\n --------\n base.imuldw, base.uimul\n",
"base.uint32ToInt32": "\nbase.uint32ToInt32( x )\n Converts an unsigned 32-bit integer to a signed 32-bit integer.\n\n Parameters\n ----------\n x: integer\n Unsigned 32-bit integer.\n\n Returns\n -------\n out: integer\n Signed 32-bit integer.\n\n Examples\n --------\n > var y = base.uint32ToInt32( base.float64ToUint32( 4294967295 ) )\n -1\n > y = base.uint32ToInt32( base.float64ToUint32( 3 ) )\n 3\n\n",
"base.vercos": "\nbase.vercos( x )\n Computes the versed cosine.\n\n The versed cosine is defined as `1 + cos(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Versed cosine.\n\n Examples\n --------\n > var y = base.vercos( 3.14 )\n ~0.0\n > y = base.vercos( -4.2 )\n ~0.5097\n > y = base.vercos( -4.6 )\n ~0.8878\n > y = base.vercos( 9.5 )\n ~0.0028\n > y = base.vercos( -0.0 )\n 2.0\n\n See Also\n --------\n base.cos, base.versin\n",
"base.versin": "\nbase.versin( x )\n Computes the versed sine.\n\n The versed sine is defined as `1 - cos(x)`.\n\n Parameters\n ----------\n x: number\n Input value (in radians).\n\n Returns\n -------\n y: number\n Versed sine.\n\n Examples\n --------\n > var y = base.versin( 3.14 )\n ~2.0\n > y = base.versin( -4.2 )\n ~1.490\n > y = base.versin( -4.6 )\n ~1.112\n > y = base.versin( 9.5 )\n ~1.997\n > y = base.versin( -0.0 )\n 0.0\n\n See Also\n --------\n base.cos, base.sin, base.vercos\n",
"base.wrap": "\nbase.wrap( v, min, max )\n Wraps a value on the half-open interval `[min,max)`.\n\n The function does not distinguish between positive and negative zero. Where\n appropriate, the function returns positive zero.\n\n If provided `NaN` for any argument, the function returns `NaN`.\n\n Parameters\n ----------\n v: number\n Value to wrap.\n\n min: number\n Minimum value.\n\n max: number\n Maximum value.\n\n Returns\n -------\n y: number\n Wrapped value.\n\n Examples\n --------\n > var y = base.wrap( 3.14, 0.0, 5.0 )\n 3.14\n > y = base.wrap( -3.14, 0.0, 5.0 )\n ~1.86\n > y = base.wrap( 3.14, 0.0, 3.0 )\n ~0.14\n > y = base.wrap( -0.0, 0.0, 5.0 )\n 0.0\n > y = base.wrap( 0.0, -3.14, -0.0 )\n -3.14\n > y = base.wrap( NaN, 0.0, 5.0 )\n NaN\n\n See Also\n --------\n base.clamp\n",
"base.xlog1py": "\nbase.xlog1py( x, y )\n Computes `x * ln(y+1)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlog1py( 3.0, 2.0 )\n ~3.296\n > out = base.xlog1py( 1.5, 5.9 )\n ~2.897\n > out = base.xlog1py( 0.9, 1.0 )\n ~0.624\n > out = base.xlog1py( 1.0, 0.0 )\n 0.0\n > out = base.xlog1py( 0.0, -2.0 )\n 0.0\n > out = base.xlog1py( 1.5, NaN )\n NaN\n > out = base.xlog1py( 0.0, NaN )\n NaN\n > out = base.xlog1py( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.log1p, base.xlogy\n",
"base.xlogy": "\nbase.xlogy( x, y )\n Computes `x * ln(y)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlogy( 3.0, 2.0 )\n ~2.079\n > out = base.xlogy( 1.5, 5.9 )\n ~2.662\n > out = base.xlogy( 0.9, 1.0 )\n 0.0\n > out = base.xlogy( 0.0, -2.0 )\n 0.0\n > out = base.xlogy( 1.5, NaN )\n NaN\n > out = base.xlogy( 0.0, NaN )\n NaN\n > out = base.xlogy( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.ln, base.xlog1py\n",
"base.zeta": "\nbase.zeta( s )\n Evaluates the Riemann zeta function as a function of a real variable `s`.\n\n Parameters\n ----------\n s: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.zeta( 1.1 )\n ~10.584\n > y = base.zeta( -4.0 )\n 0.0\n > y = base.zeta( 70.0 )\n 1.0\n > y = base.zeta( 0.5 )\n ~-1.46\n > y = base.zeta( NaN )\n NaN\n\n // Evaluate at a pole:\n > y = base.zeta( 1.0 )\n NaN\n\n",
"BERNDT_CPS_WAGES_1985": "\nBERNDT_CPS_WAGES_1985()\n Returns a random sample of 534 workers from the Current Population Survey\n (CPS) from 1985, including their wages and and other characteristics.\n\n Each array element has the following eleven fields:\n\n - education: number of years of education.\n - south: indicator variable for southern region (1 if person lives in the\n South; 0 if person does not live in the South).\n - gender: indicator for the gender of the person (1 if female; 0 if male).\n - experience: number of years of work experience.\n - union: indicator variable for union membership (1 if union member; 0 if\n not a union member).\n - wage: wage (in dollars per hour).\n - age: age (in years).\n - race: ethnicity/race ('white', 'hispanic', and 'other').\n - occupation: occupational category ('management', 'sales', 'clerical',\n 'service', 'professional', and 'other').\n - sector: sector ('Other', 'Manufacturing', or 'Construction').\n - married: marital status (0 if unmarried; 1 if married).\n\n Based on residual plots, wages were log-transformed to stabilize the\n variance.\n\n Returns\n -------\n out: Array<Object>\n CPS data.\n\n Examples\n --------\n > var data = BERNDT_CPS_WAGES_1985()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Berndt, Ernst R. 1991. _The Practice of Econometrics_. Addison Wesley\n Longman Publishing Co.\n\n",
"bifurcate": "\nbifurcate( collection, [options,] filter )\n Splits values into two groups.\n\n If an element in `filter` is truthy, then the corresponding element in the\n input collection belongs to the first group; otherwise, the collection\n element belongs to the second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n filter: Array|TypedArray|Object\n A collection indicating which group an element in the input collection\n belongs to. If an element in `filter` is truthy, the corresponding\n element in `collection` belongs to the first group; otherwise, the\n collection element belongs to the second group. If provided an object,\n the object must be array-like (excluding strings and functions).\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var f = [ true, true, false, true ];\n > var out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n > f = [ 1, 1, 0, 1 ];\n > out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > f = [ true, true, false, true ];\n > var opts = { 'returns': 'indices' };\n > out = bifurcate( collection, opts, f )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-element pairs:\n > opts = { 'returns': '*' };\n > out = bifurcate( collection, opts, f )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo'] ] ]\n\n See Also\n --------\n bifurcateBy, bifurcateOwn, group\n",
"bifurcateBy": "\nbifurcateBy( collection, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If a predicate function returns a truthy value, a collection value is\n placed in the first group; otherwise, a collection value is placed in the\n second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = bifurcateBy( collection, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, groupBy\n",
"bifurcateByAsync": "\nbifurcateByAsync( collection, [options,] predicate, done )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an predicate function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If a predicate function calls the `next` callback with a truthy group value,\n a collection value is placed in the first group; otherwise, a collection\n value is placed in the second group.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty array as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n [ [ 1000, 3000 ], [ 2500 ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ 2, 0 ], [ 1 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ [ 2, 1000 ], [ 0, 3000 ] ], [ [ 1, 2500 ] ] ]\n\n // Limit number of concurrent invocations:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n // Process sequentially:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n\nbifurcateByAsync.factory( [options,] predicate )\n Returns a function which splits values into two groups according to an\n predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A function which splits values into two groups.\n\n Examples\n --------\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = bifurcateByAsync.factory( opts, predicate );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n [ [ 2000, 1000 ], [ 1500 ] ]\n\n See Also\n --------\n bifurcateBy, groupByAsync\n",
"bifurcateIn": "\nbifurcateIn( obj, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n If a predicate function returns a truthy value, a value is placed in the\n first group; otherwise, a value is placed in the second group.\n\n If provided an empty object with no prototype, the function returns an empty\n array.\n\n The function iterates over an object's own and inherited properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function Foo() { this.a = 'beep'; this.b = 'boop'; return this; };\n > Foo.prototype = Object.create( null );\n > Foo.prototype.c = 'foo';\n > Foo.prototype.d = 'bar';\n > var obj = new Foo();\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var out = bifurcateIn( obj, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = bifurcateIn( obj, opts, predicate )\n [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateIn( obj, opts, predicate )\n [ [ ['a', 'beep'], ['b', 'boop'], ['d', 'bar'] ], [ ['c', 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, bifurcateBy, bifurcateOwn, groupIn\n",
"bifurcateOwn": "\nbifurcateOwn( obj, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n If a predicate function returns a truthy value, a value is placed in the\n first group; otherwise, a value is placed in the second group.\n\n If provided an empty object, the function returns an empty array.\n\n The function iterates over an object's own properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' };\n > var out = bifurcateOwn( obj, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = bifurcateOwn( obj, opts, predicate )\n [ [ 'a', 'b', 'd' ], [ 'c' ] ]\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateOwn( obj, opts, predicate )\n [ [ ['a', 'beep'], ['b', 'boop'], ['d', 'bar'] ], [ ['c', 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, bifurcateBy, bifurcateIn, groupOwn\n",
"binomialTest": "\nbinomialTest( x[, n][, options] )\n Computes an exact test for the success probability in a Bernoulli\n experiment.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: (number|Array<number>)\n Number of successes or two-element array with successes and failures.\n\n n: Array<number> (optional)\n Total number of observations.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.p: number (optional)\n Hypothesized probability under the null hypothesis. Default: `0.5`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Sample proportion.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the success probability.\n\n out.nullValue: number\n Assumed success probability under H0.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var out = binomialTest( 682, 925 )\n {\n 'pValue': ~3.544e-49,\n 'statistic': ~0.737\n // ...\n }\n\n > out = binomialTest( [ 682, 925 - 682 ] )\n {\n 'pValue': ~3.544e-49,\n 'statistic': ~0.737\n // ...\n }\n\n > out = binomialTest( 21, 40, {\n ... 'p': 0.4,\n ... 'alternative': 'greater'\n ... })\n {\n 'pValue': ~0.074,\n 'statistic': 0.525\n // ...\n }\n\n",
"Buffer": "\nBuffer\n Buffer constructor.\n\n\nBuffer( size )\n Allocates a buffer having a specified number of bytes.\n\n Parameters\n ----------\n size: integer\n Number of bytes to allocate.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( 4 )\n <Buffer>\n\n\nBuffer( buffer )\n Copies buffer data to a new Buffer instance.\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to copy from.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b1 = new Buffer( [ 1, 2, 3, 4 ] );\n > var b2 = new Buffer( b1 )\n <Buffer>[ 1, 2, 3, 4 ]\n\n\nBuffer( array )\n Allocates a buffer using an array of octets.\n\n Parameters\n ----------\n array: Array\n Array of octets.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( [ 1, 2, 3, 4 ] )\n <Buffer>[ 1, 2, 3, 4 ]\n\n\nBuffer( str[, encoding] )\n Allocates a buffer containing a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n encoding: string (optional)\n Character encoding. Default: 'utf8'.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = new Buffer( 'beep boop' )\n <Buffer>\n\n\nTODO: add methods and properties\n\n\n See Also\n --------\n ArrayBuffer\n",
"buffer2json": "\nbuffer2json( buffer )\n Returns a JSON representation of a buffer.\n\n The returned JSON object has the following properties:\n\n - type: value type\n - data: buffer data as a generic array\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var buf = new allocUnsafe( 2 );\n > buf[ 0 ] = 1;\n > buf[ 1 ] = 2;\n > var json = buffer2json( buf )\n { 'type': 'Buffer', 'data': [ 1, 2 ] }\n\n See Also\n --------\n typedarray2json, reviveBuffer\n",
"capitalize": "\ncapitalize( str )\n Capitalizes the first character in a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Capitalized string.\n\n Examples\n --------\n > var out = capitalize( 'beep' )\n 'Beep'\n > out = capitalize( 'Boop' )\n 'Boop'\n\n See Also\n --------\n uncapitalize, uppercase\n",
"capitalizeKeys": "\ncapitalizeKeys( obj )\n Converts the first letter of each object key to uppercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'aa': 1, 'bb': 2 };\n > var out = capitalizeKeys( obj )\n { 'Aa': 1, 'Bb': 2 }\n\n See Also\n --------\n uncapitalizeKeys, uppercaseKeys\n",
"CATALAN": "\nCATALAN\n Catalan's constant.\n\n Examples\n --------\n > CATALAN\n 0.915965594177219\n\n",
"CBRT_EPS": "\nCBRT_EPS\n Cube root of double-precision floating-point epsilon.\n\n Examples\n --------\n > CBRT_EPS\n 0.0000060554544523933395\n\n See Also\n --------\n EPS, SQRT_EPS\n",
"chdir": "\nchdir( path )\n Changes the current working directory.\n\n If unable to set the current working directory (e.g., due to a non-existent\n path), the function returns an error; otherwise, the function returns\n `null`.\n\n Parameters\n ----------\n path: string\n Desired working directory.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = chdir( '/path/to/current/working/directory' )\n\n See Also\n --------\n cwd\n",
"chi2gof": "\nchi2gof( x, y[, ...args][, options] )\n Performs a chi-square goodness-of-fit test.\n\n A chi-square goodness-of-fit test is computed for the null hypothesis that\n the values of `x` come from the discrete probability distribution specified\n by `y`.\n\n The second argument can be expected frequencies, population probabilities\n summing to one, or a discrete probability distribution name to test against.\n\n When providing a discrete probability distribution name, distribution\n parameters *must* be supplied as additional arguments.\n\n The function returns an object containing the test statistic, p-value, and\n decision.\n\n By default, the p-value is computed using a chi-square distribution with\n `k-1` degrees of freedom, where `k` is the length of `x`.\n\n If provided distribution arguments are estimated (e.g., via maximum\n likelihood estimation), the degrees of freedom should be corrected. Set the\n `ddof` option to use `k-1-n` degrees of freedom, where `n` is the degrees of\n freedom adjustment.\n\n The chi-square approximation may be incorrect if the observed or expected\n frequencies in each category are too small. Common practice is to require\n frequencies greater than five.\n\n Instead of relying on chi-square approximation to calculate the p-value, one\n can use Monte Carlo simulation. When the `simulate` option is `true`, the\n simulation is performed by re-sampling from the discrete probability\n distribution specified by `y`.\n\n Parameters\n ----------\n x: Array<number>\n Observation frequencies.\n\n y: Array<number>|string\n Expected frequencies (or probabilities) or a discrete probability\n distribution name.\n\n args: ...number (optional)\n Distribution parameters. Distribution parameters will be passed to a\n probability mass function (PMF) as arguments.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Significance level of the hypothesis test. Must be on the interval\n [0,1]. Default: 0.05.\n\n options.ddof: number (optional)\n Delta degrees of freedom adjustment. Default: 0.\n\n options.simulate: boolean (optional)\n Boolean indicating whether to calculate p-values by Monte Carlo\n simulation. The simulation is performed by re-sampling from the discrete\n distribution specified by `y`. Default: false.\n\n options.iterations: number (optional)\n Number of Monte Carlo iterations. Default: 500.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n Test p-value.\n\n out.statistic: number\n Test statistic.\n\n out.df: number\n Degrees of freedom.\n\n out.method: string\n Test name.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Provide expected probabilities...\n > var x = [ 89, 37, 30, 28, 2 ];\n > var p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > var out = chi2gof( x, p )\n { 'pValue': ~0.0406, 'statistic': ~9.9901, ... }\n > out.print()\n\n // Set significance level...\n > var opts = { 'alpha': 0.01 };\n > out = chi2gof( x, p, opts );\n > out.print()\n\n // Calculate the test p-value via Monte Carlo simulation...\n > x = [ 89, 37, 30, 28, 2 ];\n > p = [ 0.40, 0.20, 0.20, 0.15, 0.05 ];\n > opts = { 'simulate': true, 'iterations': 1000 };\n > out = chi2gof( x, p, opts )\n {...}\n\n // Verify that data comes from Poisson distribution...\n > var lambda = 3.0;\n > var rpois = base.random.poisson.factory( lambda );\n > var len = 400;\n > x = [];\n > for ( var i = 0; i < len; i++ ) { x.push( rpois() ); };\n\n // Generate a frequency table...\n > var freqs = new Int32Array( len );\n > for ( i = 0; i < len; i++ ) { freqs[ x[ i ] ] += 1; };\n > out = chi2gof( freqs, 'poisson', lambda )\n {...}\n\n",
"CircularBuffer": "\nCircularBuffer( buffer )\n Circular buffer constructor.\n\n Parameters\n ----------\n buffer: integer|ArrayLike\n Buffer size or an array-like object to use as the underlying buffer.\n\n Returns\n -------\n buf: Object\n Circular buffer data structure.\n\n buf.clear: Function\n Clears the buffer.\n\n buf.count: integer\n Number of elements currently in the buffer.\n\n buf.full: boolean\n Boolean indicating whether the buffer is full.\n\n buf.iterator: Function\n Returns an iterator for iterating over a buffer. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that a\n returned iterator does **not** iterate over partially full buffers.\n\n buf.length: integer\n Buffer length (capacity).\n\n buf.push: Function\n Adds a value to the buffer. If the buffer is full, the method returns\n the removed value; otherwise, the method returns `undefined`.\n\n buf.toArray: Function\n Returns an array of buffer values.\n\n buf.toJSON: Function\n Serializes a circular buffer as JSON.\n\n Examples\n --------\n > var b = CircularBuffer( 3 );\n > b.push( 'foo' );\n > b.push( 'bar' );\n > b.push( 'beep' );\n > b.length\n 3\n > b.count\n 3\n > b.push( 'boop' )\n 'foo'\n\n See Also\n --------\n FIFO, Stack\n",
"CMUDICT": "\nCMUDICT( [options] )\n Returns datasets from the Carnegie Mellon Pronouncing Dictionary (CMUdict).\n\n Data includes the following:\n\n - dict: the main pronouncing dictionary\n - phones: manners of articulation for each sound\n - symbols: complete list of ARPABET symbols used by the dictionary\n - vp: verbal pronunciations of punctuation marks\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.data: string (optional)\n Dataset name.\n\n Returns\n -------\n out: Object|Array\n CMUdict dataset.\n\n Examples\n --------\n > var data = CMUDICT();\n > var dict = data.dict\n {...}\n > var phones = data.phones\n {...}\n > var symbols = data.symbols\n [...]\n > var vp = data.vp\n {...}\n\n",
"complex": "\ncomplex( real, imag[, dtype] )\n Creates a complex number.\n\n The function supports the following data types:\n\n - float64\n - float32\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n z: Complex\n Complex number.\n\n Examples\n --------\n > var z = complex( 5.0, 3.0, 'float64' )\n <Complex128>\n > z = complex( 5.0, 3.0, 'float32' )\n <Complex64>\n\n See Also\n --------\n Complex128, Complex64\n",
"Complex64": "\nComplex64( real, imag )\n 64-bit complex number constructor.\n\n Both the real and imaginary components are stored as single-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex64\n 64-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 4.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 8.\n\n Examples\n --------\n > var z = new Complex64( 5.0, 3.0 )\n <Complex64>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n complex, Complex128\n",
"COMPLEX64_NUM_BYTES": "\nCOMPLEX64_NUM_BYTES\n Size (in bytes) of a 64-bit complex number.\n\n Examples\n --------\n > COMPLEX64_NUM_BYTES\n 8\n\n See Also\n --------\n COMPLEX128_NUM_BYTES, FLOAT32_NUM_BYTES\n",
"Complex128": "\nComplex128( real, imag )\n 128-bit complex number constructor.\n\n Both the real and imaginary components are stored as double-precision\n floating-point numbers.\n\n Parameters\n ----------\n real: number\n Real component.\n\n imag: number\n Imaginary component.\n\n Returns\n -------\n z: Complex128\n 128-bit complex number.\n\n z.re: number\n Read-only property returning the real component.\n\n z.im: number\n Read-only property returning the imaginary component.\n\n z.BYTES_PER_ELEMENT\n Size (in bytes) of each component. Value: 8.\n\n z.byteLength\n Length (in bytes) of a complex number. Value: 16.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 )\n <Complex128>\n > z.re\n 5.0\n > z.im\n 3.0\n\n See Also\n --------\n complex, Complex64\n",
"COMPLEX128_NUM_BYTES": "\nCOMPLEX128_NUM_BYTES\n Size (in bytes) of a 128-bit complex number.\n\n Examples\n --------\n > COMPLEX128_NUM_BYTES\n 16\n\n See Also\n --------\n COMPLEX64_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"compose": "\ncompose( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as an argument\n to the next function. The result of the leftmost function is the result\n of the whole.\n\n Notes:\n\n - Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as unary functions.\n - The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x ) {\n ... return 2 * x;\n ... }\n > function b( x ) {\n ... return x + 3;\n ... }\n > function c( x ) {\n ... return x / 5;\n ... }\n > var f = compose( c, b, a );\n > var z = f( 6 )\n 3\n\n See Also\n --------\n composeAsync\n",
"composeAsync": "\ncomposeAsync( ...f )\n Function composition.\n\n Returns a composite function. Starting from the right, the composite\n function evaluates each function and passes the result as the first argument\n of the next function. The result of the leftmost function is the result\n of the whole.\n\n The last argument for each provided function is a `next` callback which\n should be invoked upon function completion. The callback accepts two\n arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a composed function calls the `next` callback with a truthy `error`\n argument, the composite function suspends execution and immediately calls\n the `done` callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Only the rightmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as binary functions.\n\n The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n f: ...Function\n Functions to compose.\n\n Returns\n -------\n out: Function\n Composite function.\n\n Examples\n --------\n > function a( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, 2*x );\n ... }\n ... };\n > function b( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x+3 );\n ... }\n ... };\n > function c( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x/5 );\n ... }\n ... };\n > var f = composeAsync( c, b, a );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > f( 6, done )\n 3\n\n See Also\n --------\n compose\n",
"configdir": "\nconfigdir( [p] )\n Returns a directory for user-specific configuration files.\n\n On Windows platforms, the function first checks for a `LOCALAPPDATA`\n environment variable before checking for an `APPDATA` environment variable.\n This means that machine specific user configuration files have precedence\n over roaming user configuration files.\n\n On non-Windows platforms, if the function is unable to locate the current\n user's `home` directory, the function returns `null`. Similarly, on Windows\n platforms, if the function is unable to locate an application data\n directory, the function also returns `null`.\n\n Parameters\n ----------\n p: string (optional)\n Path to append to a base directory.\n\n Returns\n -------\n out: string|null\n Directory.\n\n Examples\n --------\n > var dir = configdir()\n e.g., '/Users/<username>/Library/Preferences'\n > dir = configdir( 'appname/config' )\n e.g., '/Users/<username>/Library/Preferences/appname/config'\n\n See Also\n --------\n homedir, tmpdir\n",
"conj": "\nconj( z )\n Returns the complex conjugate of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n out: Complex\n Complex conjugate.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > z.toString()\n '5 + 3i'\n > var v = conj( z );\n > v.toString()\n '5 - 3i'\n\n See Also\n --------\n imag, real, reim\n",
"constantFunction": "\nconstantFunction( val )\n Creates a function which always returns the same value.\n\n Notes:\n\n - When provided an object reference, the returned `function` always returns\n the same reference.\n\n Parameters\n ----------\n val: any\n Value to always return.\n\n Returns\n -------\n out: Function\n Constant function.\n\n Examples\n --------\n > var fcn = constantFunction( 3.14 );\n > var v = fcn()\n 3.14\n > v = fcn()\n 3.14\n > v = fcn()\n 3.14\n\n See Also\n --------\n argumentFunction, identity\n",
"constructorName": "\nconstructorName( val )\n Determines the name of a value's constructor.\n\n Parameters\n ----------\n val: any\n Input value.\n\n Returns\n -------\n out: string\n Name of a value's constructor.\n\n Examples\n --------\n > var v = constructorName( 'a' )\n 'String'\n > v = constructorName( {} )\n 'Object'\n > v = constructorName( true )\n 'Boolean'\n\n See Also\n --------\n functionName\n",
"contains": "\ncontains( val, searchValue[, position] )\n Tests if an array-like value contains a search value.\n\n When `val` is a string, the function checks whether the characters of the\n search string are found in the input string. The search is case-sensitive.\n\n When `val` is an array-like object, the function checks whether the input\n array contains an element strictly equal to the specified search value.\n\n For strings, this function is modeled after `String.prototype.includes`,\n part of the ECMAScript 6 specification. This function is different from a\n call to `String.prototype.includes.call` insofar as type-checking is\n performed for all arguments.\n\n The function does not distinguish between positive and negative zero.\n\n If `position < 0`, the search is performed for the entire input array or\n string.\n\n\n Parameters\n ----------\n val: ArrayLike\n Input value.\n\n searchValue: any\n Value to search for.\n\n position: integer (optional)\n Position at which to start searching for `searchValue`. Default: `0`.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an input value contains another value.\n\n Examples\n --------\n > var bool = contains( 'Hello World', 'World' )\n true\n > bool = contains( 'Hello World', 'world' )\n false\n > bool = contains( [ 1, 2, 3, 4 ], 2 )\n true\n > bool = contains( [ NaN, 2, 3, 4 ], NaN )\n true\n\n // Supply a position:\n > bool = contains( 'Hello World', 'Hello', 6 )\n false\n > bool = contains( [ true, NaN, false ], true, 1 )\n false\n\n",
"convertArray": "\nconvertArray( arr, dtype )\n Converts an input array to an array of a different data type.\n\n The function supports the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n arr: Array|TypedArray\n Array to convert.\n\n dtype: string\n Output data type.\n\n Returns\n -------\n out: Array|TypedArray\n Output array.\n\n Examples\n --------\n > var arr = [ 1.0, 2.0, 3.0, 4.0 ];\n > var out = convertArray( arr, 'float32' )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n See Also\n --------\n convertArraySame\n",
"convertArraySame": "\nconvertArraySame( x, y )\n Converts an input array to the same data type as a second input array.\n\n The function supports input arrays having the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n x: Array|TypedArray\n Array to convert.\n\n y: Array|TypedArray\n Array having desired output data type.\n\n Returns\n -------\n out: Array|TypedArray\n Output array.\n\n Examples\n --------\n > var x = [ 1.0, 2.0, 3.0, 4.0 ];\n > var y = new Float32Array( 0 );\n > var out = convertArraySame( x, y )\n <Float32Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n See Also\n --------\n convertArray\n",
"convertPath": "\nconvertPath( from, to )\n Converts between POSIX and Windows paths.\n\n Parameters\n ----------\n from: string\n Input path.\n\n to: string\n Output path convention: 'win32', 'mixed', or 'posix'.\n\n Returns\n -------\n out: string\n Converted path.\n\n Examples\n --------\n > var out = convertPath( '/c/foo/bar/beep.c', 'win32' )\n 'c:\\\\foo\\\\bar\\\\beep.c'\n > out = convertPath( '/c/foo/bar/beep.c', 'mixed' )\n 'c:/foo/bar/beep.c'\n > out = convertPath( '/c/foo/bar/beep.c', 'posix' )\n '/c/foo/bar/beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'win32' )\n 'C:\\\\\\\\foo\\\\bar\\\\beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'mixed' )\n 'C:/foo/bar/beep.c'\n > out = convertPath( 'C:\\\\\\\\foo\\\\bar\\\\beep.c', 'posix' )\n '/c/foo/bar/beep.c'\n\n",
"copy": "\ncopy( value[, level] )\n Copy or deep clone a value to an arbitrary depth.\n\n The implementation can handle circular references.\n\n If a `Number`, `String`, or `Boolean` object is encountered, the value is\n cloned as a primitive. This behavior is intentional.\n\n For objects, the implementation only copies enumerable keys and their\n associated property descriptors.\n\n The implementation only checks whether basic `Objects`, `Arrays`, and class\n instances are extensible, sealed, and/or frozen.\n\n Functions are not cloned; their reference is copied.\n\n The implementation supports custom error types which are `Error` instances\n (e.g., ES2015 subclasses).\n\n Support for copying class instances is inherently fragile. Any instances\n with privileged access to variables (e.g., within closures) cannot be\n cloned. This stated, basic copying of class instances is supported. Provided\n an environment which supports ES5, the implementation is greedy and performs\n a deep clone of any arbitrary class instance and its properties. The\n implementation assumes that the concept of `level` applies only to the class\n instance reference, but not to its internal state.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n level: integer (optional)\n Copy depth. Default: Infinity.\n\n Returns\n -------\n out: any\n Value copy.\n\n Examples\n --------\n > var value = [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ];\n > var out = copy( value )\n [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ]\n > var bool = ( value[ 0 ].c === out[ 0 ].c )\n false\n\n // Set the `level` option to limit the copy depth:\n > value = [ { 'a': 1, 'b': true, 'c': [ 1, 2, 3 ] } ];\n > out = copy( value, 1 );\n > bool = ( value[ 0 ] === out[ 0 ] )\n true\n > bool = ( value[ 0 ].c === out[ 0 ].c )\n true\n\n\n See Also\n --------\n merge\n",
"copyBuffer": "\ncopyBuffer( buffer )\n Copies buffer data to a new Buffer instance.\n\n Parameters\n ----------\n buffer: Buffer\n Buffer to copy from.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b1 = array2buffer( [ 1, 2, 3, 4 ] );\n > var b2 = copyBuffer( b1 )\n <Buffer>[ 1, 2, 3, 4 ]\n\n See Also\n --------\n allocUnsafe, Buffer\n",
"countBy": "\ncountBy( collection, [options,] indicator )\n Groups values according to an indicator function and returns group counts.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = countBy( collection, indicator )\n { 'b': 3, 'other': 1 }\n\n See Also\n --------\n group, groupBy\n",
"countByAsync": "\ncountByAsync( collection, [options,] indicator, done )\n Groups values according to an indicator function and returns group counts.\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty object as the second argument.\n\n The `group` returned by an indicator function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even': 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, indicator, done )\n 1000\n 2500\n 3000\n { \"even\": 2, \"odd\": 1 }\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n { \"even\": 2, \"odd\": 1 }\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > countByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n { \"even\": 2, \"odd\": 1 }\n\n\ncountByAsync.factory( [options,] indicator )\n Returns a function which groups values according to an indicator function\n and returns group counts.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A function which groups values and returns group counts.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = countByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n { \"even\": 2, \"odd\": 1 }\n > arr = [ 2000, 1500, 1000, 500 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n 500\n { \"even\": 2, \"odd\": 2 }\n\n See Also\n --------\n countBy, groupByAsync, tabulateByAsync\n",
"curry": "\ncurry( fcn[, arity][, thisArg] )\n Transforms a function into a sequence of functions each accepting a single\n argument.\n\n Until return value resolution, each invocation returns a new partially\n applied curry function.\n\n Parameters\n ----------\n fcn: Function\n Function to curry.\n\n arity: integer (optional)\n Number of parameters. Default: `fcn.length`.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Curry function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var f = curry( add );\n > var sum = f( 2 )( 3 )\n 5\n\n // Supply arity:\n > function add() { return arguments[ 0 ] + arguments[ 1 ]; };\n > f = curry( add, 2 );\n > sum = f( 2 )( 3 )\n 5\n\n // Provide function context:\n > var obj = {\n ... 'name': 'Ada',\n ... 'greet': function greet( word1, word2 ) {\n ... return word1 + ' ' + word2 + ', ' + this.name + '!'\n ... }\n ... };\n > f = curry( obj.greet, obj );\n > var str = f( 'Hello' )( 'there' )\n 'Hello there, Ada!'\n\n See Also\n --------\n curryRight, uncurry, uncurryRight\n",
"curryRight": "\ncurryRight( fcn[, arity][, thisArg] )\n Transforms a function into a sequence of functions each accepting a single\n argument.\n\n Until return value resolution, each invocation returns a new partially\n applied curry function.\n\n This function applies arguments starting from the right.\n\n Parameters\n ----------\n fcn: Function\n Function to curry.\n\n arity: integer (optional)\n Number of parameters. Default: `fcn.length`.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Curry function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var f = curryRight( add );\n > var sum = f( 2 )( 3 )\n 5\n\n // Supply arity:\n > function add() { return arguments[ 0 ] + arguments[ 1 ]; };\n > f = curryRight( add, 2 );\n > sum = f( 2 )( 3 )\n 5\n\n // Provide function context:\n > var obj = {\n ... 'name': 'Ada',\n ... 'greet': function greet( word1, word2 ) {\n ... return word1 + ' ' + word2 + ', ' + this.name + '!'\n ... }\n ... };\n > f = curryRight( obj.greet, obj );\n > var str = f( 'there' )( 'Hello' )\n 'Hello there, Ada!'\n\n See Also\n --------\n curry, uncurry, uncurryRight\n",
"cwd": "\ncwd()\n Returns the current working directory.\n\n Returns\n -------\n path: string\n Current working directory of the process.\n\n Examples\n --------\n > var dir = cwd()\n '/path/to/current/working/directory'\n\n See Also\n --------\n chdir\n",
"DALE_CHALL_NEW": "\nDALE_CHALL_NEW()\n Returns a list of familiar English words.\n\n Returns\n -------\n out: Array<string>\n List of familiar English words.\n\n Examples\n --------\n > var list = DALE_CHALL_NEW()\n [ 'a', 'able', 'aboard', 'about', 'above', ... ]\n\n References\n ----------\n - Chall, Jeanne Sternlicht, and Edgar Dale. 1995. *Readability revisited:\n the new Dale-Chall readability formula*. Brookline Books.\n <https://books.google.com/books?id=2nbuAAAAMAAJ>.\n\n",
"datasets": "\ndatasets( name[, options] )\n Returns a dataset.\n\n The function forwards provided options to the dataset interface specified\n by `name`.\n\n Parameters\n ----------\n name: string\n Dataset name.\n\n options: Object (optional)\n Function options.\n\n Returns\n -------\n out: any\n Dataset.\n\n Examples\n --------\n > var out = datasets( 'MONTH_NAMES_EN' )\n [ 'January', 'February', ... ]\n > var opts = { 'data': 'cities' };\n > out = datasets( 'MINARD_NAPOLEONS_MARCH', opts )\n [ {...}, {...}, ... ]\n\n",
"dayOfQuarter": "\ndayOfQuarter( [month[, day, year]] )\n Returns the day of the quarter.\n\n By default, the function returns the day of the quarter for the current date\n (according to local time). To determine the day of the quarter for a\n particular day, provide `month`, `day`, and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function also accepts a `Date` object.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n day: integer (optional)\n Day.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Day of the quarter.\n\n Examples\n --------\n > var day = dayOfQuarter()\n <number>\n > day = dayOfQuarter( new Date() )\n <number>\n > day = dayOfQuarter( 12, 31, 2017 )\n 92\n\n // Other ways to supply month:\n > day = dayOfQuarter( 'dec', 31, 2017 )\n 92\n > day = dayOfQuarter( 'december', 31, 2017 )\n 92\n\n See Also\n --------\n dayOfYear\n",
"dayOfYear": "\ndayOfYear( [month[, day, year]] )\n Returns the day of the year.\n\n By default, the function returns the day of the year for the current date\n (according to local time). To determine the day of the year for a particular\n day, provide `month`, `day`, and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function also accepts a `Date` object.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n day: integer (optional)\n Day.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Day of the year.\n\n Examples\n --------\n > var day = dayOfYear()\n <number>\n > day = dayOfYear( new Date() )\n <number>\n > day = dayOfYear( 12, 31, 2016 )\n 366\n\n // Other ways to supply month:\n > day = dayOfYear( 'dec', 31, 2016 )\n 366\n > day = dayOfYear( 'december', 31, 2016 )\n 366\n\n See Also\n --------\n dayOfQuarter\n",
"daysInMonth": "\ndaysInMonth( [month[, year]] )\n Returns the number of days in a month.\n\n By default, the function returns the number of days in the current month\n of the current year (according to local time). To determine the number of\n days for a particular month and year, provide `month` and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|integer|Date (optional)\n Month (or `Date`).\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Days in a month.\n\n Examples\n --------\n > var num = daysInMonth()\n <number>\n > num = daysInMonth( 2 )\n <number>\n > num = daysInMonth( 2, 2016 )\n 29\n > num = daysInMonth( 2, 2017 )\n 28\n\n // Other ways to supply month:\n > num = daysInMonth( 'feb', 2016 )\n 29\n > num = daysInMonth( 'february', 2016 )\n 29\n\n See Also\n --------\n daysInYear\n",
"daysInYear": "\ndaysInYear( [value] )\n Returns the number of days in a year according to the Gregorian calendar.\n\n By default, the function returns the number of days in the current year\n (according to local time). To determine the number of days for a particular\n year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of days in a year.\n\n Examples\n --------\n > var num = daysInYear()\n <number>\n > num = daysInYear( 2016 )\n 366\n > num = daysInYear( 2017 )\n 365\n\n See Also\n --------\n daysInMonth\n",
"debugStream": "\ndebugStream( [options,] [clbk] )\n Returns a transform stream for debugging stream pipelines.\n\n If the `DEBUG` environment variable is not set, no data is logged.\n\n Providing a `name` option is *strongly* encouraged, as the `DEBUG`\n environment variable can be used to filter debuggers.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Debug namespace.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function (optional)\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = debugStream( { 'name': 'foo' } );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ndebugStream.factory( [options] )\n Returns a function for creating transform streams for debugging stream\n pipelines.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream( name[, clbk] ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = debugStream.factory( opts );\n\n\ndebugStream.objectMode( [options,] [clbk] )\n Returns an \"objectMode\" transform stream for debugging stream pipelines.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Debug namespace.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function (optional)\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = debugStream.objectMode( { 'name': 'foo' } );\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n inspectStream\n",
"deepEqual": "\ndeepEqual( a, b )\n Tests for deep equality between two values.\n\n Parameters\n ----------\n a: any\n First comparison value.\n\n b: any\n Second comparison value.\n\n Returns\n -------\n out: bool\n Boolean indicating if `a` is deep equal to `b`.\n\n Examples\n --------\n > var bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, 3 ] )\n true\n\n > bool = deepEqual( [ 1, 2, 3 ], [ 1, 2, '3' ] )\n false\n\n > bool = deepEqual( { 'a': 2 }, { 'a': [ 2 ] } )\n false\n\n See Also\n --------\n isStrictEqual, isSameValue\n",
"deepGet": "\ndeepGet( obj, path[, options] )\n Returns a nested property value.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: any\n Nested property value.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = deepGet( obj, 'a.b.c' )\n 'd'\n\n // Specify a custom separator via the `sep` option:\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = deepGet( obj, 'a/b/c', { 'sep': '/' } )\n 'd'\n\ndeepGet.factory( path[, options] )\n Creates a reusable deep get function.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Deep get factory.\n\n Examples\n --------\n > var dget = deepGet.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var val = dget( obj )\n 'd'\n\n See Also\n --------\n deepPluck, deepSet\n",
"deepHasOwnProp": "\ndeepHasOwnProp( value, path[, options] )\n Returns a boolean indicating whether an object contains a nested key path.\n\n The function tests for \"own\" properties and will return `false` for\n inherited properties.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Key path array elements are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified path.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = deepHasOwnProp( obj, 'a.b.c' )\n true\n\n // Specify a custom separator via the `sep` option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > bool = deepHasOwnProp( obj, 'a/b/c', { 'sep': '/' } )\n true\n\ndeepHasOwnProp.factory( path[, options] )\n Returns a function which tests whether an object contains a nested key path.\n\n The returned function tests for \"own\" properties and will return `false` for\n inherited properties.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Function which tests whether an object contains a nested key path.\n\n Examples\n --------\n > var has = deepHasOwnProp.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = has( obj )\n true\n\n See Also\n --------\n deepHasProp, hasOwnProp, deepGet, deepPluck, deepSet\n",
"deepHasProp": "\ndeepHasProp( value, path[, options] )\n Returns a boolean indicating whether an object contains a nested key path,\n either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Key path array elements are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified path.\n\n Examples\n --------\n > function Foo() { return this; };\n > Foo.prototype.b = { 'c': 'd' };\n > var obj = { 'a': new Foo() };\n > var bool = deepHasProp( obj, 'a.b.c' )\n true\n\n // Specify a custom separator via the `sep` option:\n > bool = deepHasProp( obj, 'a/b/c', { 'sep': '/' } )\n true\n\ndeepHasProp.factory( path[, options] )\n Returns a function which tests whether an object contains a nested key path,\n either own or inherited.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Function which tests whether an object contains a nested key path.\n\n Examples\n --------\n > function Foo() { return this; };\n > Foo.prototype.b = { 'c': 'd' };\n > var has = deepHasProp.factory( 'a/b/c', { 'sep': '/' } );\n > var obj = { 'a': new Foo() };\n > var bool = has( obj )\n true\n\n See Also\n --------\n deepHasOwnProp, hasOwnProp, deepGet, deepPluck, deepSet\n",
"deepPluck": "\ndeepPluck( arr, path[, options] )\n Extracts a nested property value from each element of an object array.\n\n If a key path does not exist, the function sets the plucked value as\n `undefined`.\n\n Extracted values are not cloned.\n\n Parameters\n ----------\n arr: Array\n Source array.\n\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to return a new data structure. Default:\n true.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Array\n Destination array.\n\n Examples\n --------\n > var arr = [\n ... { 'a': { 'b': { 'c': 1 } } },\n ... { 'a': { 'b': { 'c': 2 } } }\n ... ];\n > var out = deepPluck( arr, 'a.b.c' )\n [ 1, 2 ]\n > arr = [\n ... { 'a': [ 0, 1, 2 ] },\n ... { 'a': [ 3, 4, 5 ] }\n ... ];\n > out = deepPluck( arr, [ 'a', 1 ] )\n [ 1, 4 ]\n\n See Also\n --------\n deepGet, deepSet\n",
"deepSet": "\ndeepSet( obj, path, value[, options] )\n Sets a nested property value.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n path: string|Array\n Key path.\n\n value: any\n Value to set.\n\n options: Object (optional)\n Options.\n\n options.create: boolean (optional)\n Boolean indicating whether to create a path if the key path does not\n already exist. Default: false.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if the property was successfully set.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = deepSet( obj, 'a.b.c', 'beep' )\n true\n\n // Specify an alternative separator via the sep option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > bool = deepSet( obj, 'a/b/c', 'beep', { 'sep': '/' } );\n > obj\n { 'a': { 'b': { 'c': 'beep' } } }\n\n // To create a key path which does not exist, set the create option to true:\n > bool = deepSet( obj, 'a.e.c', 'boop', { 'create': true } );\n > obj\n { 'a': { 'b': { 'c': 'beep' }, 'e': { 'c': 'boop' } } }\n\n\ndeepSet.factory( path[, options] )\n Creates a reusable deep set function.\n\n Parameters\n ----------\n path: string|Array\n Key path.\n\n options: Object (optional)\n Options.\n\n options.create: boolean (optional)\n Boolean indicating whether to create a path if the key path does not\n already exist. Default: false.\n\n options.sep: string (optional)\n Key path separator. Default: '.'.\n\n Returns\n -------\n out: Function\n Deep get function.\n\n Examples\n --------\n > var dset = deepSet.factory( 'a/b/c', {\n ... 'create': true,\n ... 'sep': '/'\n ... });\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var bool = dset( obj, 'beep' )\n true\n > obj\n { 'a': { 'b': { 'c': 'beep' } } }\n\n See Also\n --------\n deepGet, deepPluck\n",
"defineProperties": "\ndefineProperties( obj, properties )\n Defines (and/or modifies) object properties.\n\n The second argument is an object whose own enumerable property values are\n descriptors for the properties to be defined or modified.\n\n Property descriptors come in two flavors: data descriptors and accessor\n descriptors. A data descriptor is a property that has a value, which may or\n may not be writable. An accessor descriptor is a property described by a\n getter-setter function pair. A descriptor must be one of these two flavors\n and cannot be both.\n\n A property descriptor has the following optional properties:\n\n - configurable: boolean indicating if property descriptor can be changed and\n if the property can be deleted from the provided object. Default: false.\n\n - enumerable: boolean indicating if the property shows up when enumerating\n object properties. Default: false.\n\n - writable: boolean indicating if the value associated with the property can\n be changed with an assignment operator. Default: false.\n\n - value: property value.\n\n - get: function which serves as a getter for the property, or, if no getter,\n undefined. When the property is accessed, a getter function is called\n without arguments and with the `this` context set to the object through\n which the property is accessed (which may not be the object on which the\n property is defined due to inheritance). The return value will be used as\n the property value. Default: undefined.\n\n - set: function which serves as a setter for the property, or, if no setter,\n undefined. When assigning a property value, a setter function is called with\n one argument (the value being assigned to the property) and with the `this`\n context set to the object through which the property is assigned. Default: undefined.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the properties.\n\n properties: Object\n Object with property descriptors.\n\n Returns\n -------\n obj: Object\n Object on which properties were defined (and/or modified).\n\n Examples\n --------\n > var obj = {};\n > defineProperties( obj, {\n ... 'foo': {\n ... 'value': 'bar',\n ... 'writable': false,\n ... 'configurable': false,\n ... 'enumerable': true\n ... },\n ... 'baz': {\n ... 'value': 13\n ... }\n ... });\n > obj.foo\n 'bar'\n > obj.baz\n 13\n\n See Also\n --------\n defineProperty, setReadOnly\n",
"defineProperty": "\ndefineProperty( obj, prop, descriptor )\n Defines (or modifies) an object property.\n\n Property descriptors come in two flavors: data descriptors and accessor\n descriptors. A data descriptor is a property that has a value, which may or\n may not be writable. An accessor descriptor is a property described by a\n getter-setter function pair. A descriptor must be one of these two flavors\n and cannot be both.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n descriptor: Object\n Property descriptor.\n\n descriptor.configurable: boolean (optional)\n Boolean indicating if property descriptor can be changed and if the\n property can be deleted from the provided object. Default: false.\n\n descriptor.enumerable: boolean (optional)\n Boolean indicating if the property shows up when enumerating object\n properties. Default: false.\n\n descriptor.writable: boolean (optional)\n Boolean indicating if the value associated with the property can be\n changed with an assignment operator. Default: false.\n\n descriptor.value: any (optional)\n Property value.\n\n descriptor.get: Function|void (optional)\n Function which serves as a getter for the property, or, if no getter,\n undefined. When the property is accessed, a getter function is called\n without arguments and with the `this` context set to the object through\n which the property is accessed (which may not be the object on which the\n property is defined due to inheritance). The return value will be used\n as the property value. Default: undefined.\n\n descriptor.set: Function|void (optional)\n Function which serves as a setter for the property, or, if no setter,\n undefined. When assigning a property value, a setter function is called\n with one argument (the value being assigned to the property) and with\n the `this` context set to the object through which the property is\n assigned. Default: undefined.\n\n Returns\n -------\n obj: Object\n Object on which the property was defined (or modified).\n\n Examples\n --------\n > var obj = {};\n > defineProperty( obj, 'foo', {\n ... 'value': 'bar',\n ... 'enumerable': true,\n ... 'writable': false\n ... });\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n defineProperties, setReadOnly\n",
"dirname": "\ndirname( path )\n Returns a directory name.\n\n Parameters\n ----------\n path: string\n Path.\n\n Returns\n -------\n out: string\n Directory name.\n\n Examples\n --------\n > var dir = dirname( './foo/bar/index.js' )\n './foo/bar'\n\n See Also\n --------\n extname\n",
"DoublyLinkedList": "\nDoublyLinkedList()\n Doubly linked list constructor.\n\n Returns\n -------\n list: Object\n Doubly linked list.\n\n list.clear: Function\n Clears the list.\n\n list.first: Function\n Returns the first list node. If the list is empty, the returned value is\n `undefined`.\n\n list.insert: Function\n Inserts a value after a provided list node. For its third argument, the\n method accepts a location: 'before' or 'after'. Default: 'after'.\n\n list.iterator: Function\n Returns an iterator for iterating over a list. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from list mutation during\n iteration, a returned iterator **always** iterates over a list\n \"snapshot\", which is defined as the list of list elements at the time\n of the method's invocation. For its sole argument, the method accepts a\n direction: 'forward' or 'reverse'. Default: 'forward'.\n\n list.last: Function\n Returns the last list node. If the list is empty, the returned value is\n `undefined`.\n\n list.length: integer\n List length.\n\n list.pop: Function\n Removes and returns the last list value. If the list is empty, the\n returned value is `undefined`.\n\n list.push: Function\n Adds a value to the end of the list.\n\n list.remove: Function\n Removes a list node from the list.\n\n list.shift: Function\n Removes and returns the first list value. If the list is empty, the\n returned value is `undefined`.\n\n list.toArray: Function\n Returns an array of list values.\n\n list.toJSON: Function\n Serializes a list as JSON.\n\n list.unshift: Function\n Adds a value to the beginning of the list.\n\n Examples\n --------\n > var list = DoublyLinkedList();\n > list.push( 'foo' ).push( 'bar' );\n > list.length\n 2\n > list.pop()\n 'bar'\n > list.length\n 1\n > list.pop()\n 'foo'\n > list.length\n 0\n\n See Also\n --------\n LinkedList, Stack\n",
"doUntil": "\ndoUntil( fcn, predicate[, thisArg] )\n Invokes a function until a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to stop invoking a\n function.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i >= 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > doUntil( beep, predicate )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntilAsync, doUntilEach, doWhile, until, whilst\n",
"doUntilAsync": "\ndoUntilAsync( fcn, predicate, done[, thisArg] )\n Invokes a function until a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from one)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is falsy, the function continues invoking `fcn`;\n otherwise, the function invokes the `done` callback.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function predicate( i, clbk ) { clbk( null, i >= 5 ); };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > doUntilAsync( fcn, predicate, done )\n boop: 4\n\n See Also\n --------\n doUntil, doWhileAsync, untilAsync, whileAsync\n",
"doUntilEach": "\ndoUntilEach( collection, fcn, predicate[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > doUntilEach( arr, logger, predicate )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n 4: NaN\n\n See Also\n --------\n doUntilEachRight, doWhileEach, untilEach\n",
"doUntilEachRight": "\ndoUntilEachRight( collection, fcn, predicate[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > doUntilEachRight( arr, logger, predicate )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n 1: NaN\n\n See Also\n --------\n doUntilEach, doWhileEachRight, untilEachRight\n",
"doWhile": "\ndoWhile( fcn, predicate[, thisArg] )\n Invokes a function while a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i < 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > doWhile( beep, predicate )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhileAsync, doWhileEach, until, whilst\n",
"doWhileAsync": "\ndoWhileAsync( fcn, predicate, done[, thisArg] )\n Invokes a function while a test condition is true.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from one)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is truthy, the function continues invoking `fcn`;\n otherwise, the function invokes the `done` callback.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n The function to invoke.\n\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function predicate( i, clbk ) { clbk( null, i < 5 ); };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > doWhileAsync( fcn, predicate, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhile, untilAsync, whileAsync\n",
"doWhileEach": "\ndoWhileEach( collection, fcn, predicate[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > doWhileEach( arr, logger, predicate )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n 4: NaN\n\n See Also\n --------\n doUntilEach, doWhileEachRight, whileEach\n",
"doWhileEachRight": "\ndoWhileEachRight( collection, fcn, predicate[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n The condition is evaluated *after* executing the provided function; thus,\n `fcn` *always* executes at least once.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, both `value` and `index` are `undefined`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > doWhileEachRight( arr, logger, predicate )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n 1: NaN\n\n See Also\n --------\n doUntilEachRight, doWhileEach, whileEachRight\n",
"E": "\nE\n Euler's number.\n\n Examples\n --------\n > E\n 2.718281828459045\n\n",
"endsWith": "\nendsWith( str, search[, len] )\n Tests if a `string` ends with the characters of another `string`.\n\n If provided an empty `search` string, the function always returns `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string\n Search string.\n\n len: integer (optional)\n Substring length. Restricts the search to a substring within the input\n string beginning from the leftmost character. If provided a negative\n value, `len` indicates to ignore the last `len` characters, returning\n the same output as `str.length + len`. Default: `str.length`.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a `string` ends with the characters of\n another `string`.\n\n Examples\n --------\n > var bool = endsWith( 'beep', 'ep' )\n true\n > bool = endsWith( 'Beep', 'op' )\n false\n > bool = endsWith( 'Beep', 'ee', 3 )\n true\n > bool = endsWith( 'Beep', 'ee', -1 )\n true\n > bool = endsWith( 'beep', '' )\n true\n\n See Also\n --------\n startsWith\n",
"enumerableProperties": "\nenumerableProperties( value )\n Returns an array of an object's own enumerable property names and symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own enumerable properties.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var props = enumerableProperties( obj )\n [ 'beep' ]\n\n See Also\n --------\n enumerablePropertiesIn, enumerablePropertySymbols, inheritedEnumerableProperties, objectKeys, nonEnumerableProperties, properties\n",
"enumerablePropertiesIn": "\nenumerablePropertiesIn( value )\n Returns an array of an object's own and inherited enumerable property names\n and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited enumerable property names and\n symbols.\n\n Examples\n --------\n > var props = enumerablePropertiesIn( [] )\n\n See Also\n --------\n enumerableProperties, enumerablePropertySymbolsIn, inheritedEnumerableProperties, keysIn, nonEnumerablePropertiesIn, propertiesIn\n",
"enumerablePropertySymbols": "\nenumerablePropertySymbols( value )\n Returns an array of an object's own enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = enumerablePropertySymbols( obj )\n\n See Also\n --------\n enumerablePropertySymbolsIn, inheritedEnumerablePropertySymbols, objectKeys, nonEnumerablePropertySymbols, propertySymbols\n",
"enumerablePropertySymbolsIn": "\nenumerablePropertySymbolsIn( value )\n Returns an array of an object's own and inherited enumerable symbol\n properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = enumerablePropertySymbolsIn( obj )\n\n See Also\n --------\n enumerablePropertySymbols, inheritedEnumerablePropertySymbols, keysIn, nonEnumerablePropertySymbolsIn, propertySymbolsIn\n",
"ENV": "\nENV\n An object containing the user environment.\n\n Examples\n --------\n > var user = ENV.USER\n <string>\n\n See Also\n --------\n ARGV\n",
"EPS": "\nEPS\n Difference between one and the smallest value greater than one that can be\n represented as a double-precision floating-point number.\n\n Examples\n --------\n > EPS\n 2.220446049250313e-16\n\n See Also\n --------\n FLOAT32_EPS\n",
"error2json": "\nerror2json( error )\n Returns a JSON representation of an error object.\n\n The following built-in error types are supported:\n\n - Error\n - URIError\n - ReferenceError\n - SyntaxError\n - RangeError\n - EvalError\n - TypeError\n\n The JSON object is guaranteed to have the following properties:\n\n - type: error type.\n - message: error message.\n\n The only standardized cross-platform property is `message`. Depending on the\n platform, the following properties *may* be present:\n\n - name: error name.\n - stack: stack trace.\n - code: error code (Node.js system errors).\n - errno: error code string (Node.js system errors).\n - syscall: string representing the failed system call (Node.js system\n errors).\n\n The function also serializes all enumerable properties.\n\n The implementation supports custom error types and sets the `type` field to\n the closest built-in error type.\n\n Parameters\n ----------\n error: Error\n Error to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var err = new Error( 'beep' );\n > var json = error2json( err )\n <Object>\n\n See Also\n --------\n reviveError\n",
"EULERGAMMA": "\nEULERGAMMA\n The Euler-Mascheroni constant.\n\n Examples\n --------\n > EULERGAMMA\n 0.5772156649015329\n\n",
"every": "\nevery( collection )\n Tests whether all elements in a collection are truthy.\n\n The function immediately returns upon encountering a falsy value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if all elements are truthy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 1, 1, 1, 1, 1 ];\n > var bool = every( arr )\n true\n\n See Also\n --------\n any, everyBy, forEach, none, some\n",
"everyBy": "\neveryBy( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a non-truthy return\n value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a truthy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = everyBy( arr, positive )\n true\n\n See Also\n --------\n anyBy, everyByRight, forEach, noneBy, someBy\n",
"everyByAsync": "\neveryByAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-truthy `result`\n value and calls the `done` callback with `null` as the first argument and\n `false` as the second argument.\n\n If all elements succeed, the function calls the `done` callback with `null`\n as the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > everyByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\neveryByAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection pass a\n test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = everyByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByAsync, everyBy, everyByRightAsync, forEachAsync, noneByAsync, someByAsync\n",
"everyByRight": "\neveryByRight( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a non-truthy return\n value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a truthy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = everyByRight( arr, positive )\n true\n\n See Also\n --------\n anyBy, every, everyBy, forEachRight, noneByRight, someByRight\n",
"everyByRightAsync": "\neveryByRightAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection pass a test implemented by a\n predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a non-truthy `result`\n value and calls the `done` callback with `null` as the first argument and\n `false` as the second argument.\n\n If all elements succeed, the function calls the `done` callback with `null`\n as the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > everyByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\neveryByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection pass a\n test implemented by a predicate function, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, true );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = everyByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByRightAsync, everyByAsync, everyByRight, forEachRightAsync, noneByRightAsync, someByRightAsync\n",
"evil": "\nevil( str )\n Alias for `eval` global.\n\n A reference to `eval` is treated differently by the compiler. For example,\n when evaluating code containing block-scoped declarations (e.g., `let`,\n `const`, `function`, `class`), the compiler may throw an `error` complaining\n that block-scoped declarations are not yet supported outside of\n `strict mode`. One possible workaround is to include `\"use strict\";` in the\n evaluated code.\n\n Parameters\n ----------\n str: string\n Code to evaluate.\n\n Returns\n -------\n out: any\n Returned value if applicable.\n\n Examples\n --------\n > var v = evil( '5*4*3*2*1' )\n 120\n\n",
"exists": "\nexists( path, clbk )\n Asynchronously tests whether a path exists on the filesystem.\n\n Parameters\n ----------\n path: string|Buffer\n Path to test.\n\n clbk: Function\n Callback to invoke after testing for path existence. A callback may\n accept a single argument, a boolean indicating whether a path exists, or\n two arguments, an error argument and a boolean, matching the error-first\n callback convention used in most asynchronous Node.js APIs.\n\n Examples\n --------\n > function done( error, bool ) { console.log( bool ); };\n > exists( './beep/boop', done );\n\n\nexists.sync( path )\n Synchronously tests whether a path exists on the filesystem.\n\n Parameters\n ----------\n path: string|Buffer\n Path to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether the path exists.\n\n Examples\n --------\n > var bool = exists.sync( './beep/boop' )\n <boolean>\n\n See Also\n --------\n readFile, readDir\n",
"expandContractions": "\nexpandContractions( str )\n Expands all contractions to their formal equivalents.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with expanded contractions.\n\n Examples\n --------\n > var str = 'I won\\'t be able to get y\\'all out of this one.';\n > var out = expandContractions( str )\n 'I will not be able to get you all out of this one.'\n\n > str = 'It oughtn\\'t to be my fault, because, you know, I didn\\'t know';\n > out = expandContractions( str )\n 'It ought not to be my fault, because, you know, I did not know'\n\n",
"extname": "\nextname( filename )\n Returns a filename extension.\n\n Parameters\n ----------\n filename: string\n Filename.\n\n Returns\n -------\n ext: string\n Filename extension.\n\n Examples\n --------\n > var ext = extname( 'index.js' )\n '.js'\n\n See Also\n --------\n dirname\n",
"fastmath.abs": "\nfastmath.abs( x )\n Computes an absolute value.\n\n This implementation is not IEEE 754 compliant. If provided `-0`, the\n function returns `-0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Absolute value.\n\n Examples\n --------\n > var v = fastmath.abs( -1.0 )\n 1.0\n > v = fastmath.abs( 2.0 )\n 2.0\n > v = fastmath.abs( 0.0 )\n 0.0\n > v = fastmath.abs( -0.0 )\n -0.0\n > v = fastmath.abs( NaN )\n NaN\n\n See Also\n --------\n base.abs\n",
"fastmath.acosh": "\nfastmath.acosh( x )\n Computes the hyperbolic arccosine of a number.\n\n The domain of `x` is restricted to `[1,+infinity)`. If `x < 1`, the function\n will return `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arccosine (in radians).\n\n Examples\n --------\n > var v = fastmath.acosh( 1.0 )\n 0.0\n > v = fastmath.acosh( 2.0 )\n ~1.317\n > v = fastmath.acosh( NaN )\n NaN\n\n // The function overflows for large `x`:\n > v = fastmath.acosh( 1.0e308 )\n Infinity\n\n See Also\n --------\n base.acosh\n",
"fastmath.ampbm": "\nfastmath.ampbm( x, y )\n Computes the hypotenuse using the alpha max plus beta min algorithm.\n\n The algorithm computes only an approximation.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = fastmath.ampbm( 5.0, 12.0 )\n ~13.514\n\n\nfastmath.ampbm.factory( alpha, beta, [nonnegative[, ints]] )\n Returns a function to compute a hypotenuse using the alpha max plus beta min\n algorithm.\n\n Parameters\n ----------\n alpha: number\n Alpha.\n\n beta: number\n Beta.\n\n nonnegative: boolean (optional)\n Boolean indicating whether input values are always nonnegative.\n\n ints: boolean (optional)\n Boolean indicating whether input values are always 32-bit integers.\n\n Returns\n -------\n fcn: Function\n Function to compute a hypotenuse.\n\n Examples\n --------\n > var hypot = fastmath.ampbm.factory( 1.0, 0.5 )\n <Function>\n\n See Also\n --------\n base.hypot\n",
"fastmath.asinh": "\nfastmath.asinh( x )\n Computes the hyperbolic arcsine of a number.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arcsine (in radians).\n\n Examples\n --------\n > var v = fastmath.asinh( 0.0 )\n 0.0\n > v = fastmath.asinh( 2.0 )\n ~1.444\n > v = fastmath.asinh( -2.0 )\n ~-1.444\n > v = fastmath.asinh( NaN )\n NaN\n\n // The function overflows for large `x`:\n > v = fastmath.asinh( 1.0e200 )\n Infinity\n\n // The function underflows for small `x`:\n > v = fastmath.asinh( 1.0e-50 )\n 0.0\n\n See Also\n --------\n base.asinh\n",
"fastmath.atanh": "\nfastmath.atanh( x )\n Computes the hyperbolic arctangent of a number.\n\n The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function\n returns `NaN`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n Returns\n -------\n out: number\n Hyperbolic arctangent (in radians).\n\n Examples\n --------\n > var v = fastmath.atanh( 0.0 )\n 0.0\n > v = fastmath.atanh( 0.9 )\n ~1.472\n > v = fastmath.atanh( 1.0 )\n Infinity\n > v = fastmath.atanh( -1.0 )\n -Infinity\n > v = fastmath.atanh( NaN )\n NaN\n\n // The function underflows for small `x`:\n > v = fastmath.atanh( 1.0e-17 )\n 0.0\n\n See Also\n --------\n base.atanh\n",
"fastmath.hypot": "\nfastmath.hypot( x, y )\n Computes the hypotenuse.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Hypotenuse.\n\n Examples\n --------\n > var h = fastmath.hypot( -5.0, 12.0 )\n 13.0\n\n // For a sufficiently large `x` and/or `y`, the function overflows:\n > h = fastmath.hypot( 1.0e154, 1.0e154 )\n Infinity\n\n // For sufficiently small `x` and/or `y`, the function underflows:\n > h = fastmath.hypot( 1e-200, 1.0e-200 )\n 0.0\n\n See Also\n --------\n base.hypot\n",
"fastmath.log2Uint32": "\nfastmath.log2Uint32( x )\n Returns an approximate binary logarithm (base two) of an unsigned 32-bit\n integer `x`.\n\n This function provides a performance boost when requiring only approximate\n computations for integer arguments.\n\n For high-precision applications, this function is never suitable.\n\n Parameters\n ----------\n x: uinteger\n Input value.\n\n Returns\n -------\n out: uinteger\n Integer binary logarithm (base two).\n\n Examples\n --------\n > var v = fastmath.log2Uint32( 4 >>> 0 )\n 2\n > v = fastmath.log2Uint32( 8 >>> 0 )\n 3\n > v = fastmath.log2Uint32( 9 >>> 0 )\n 3\n\n See Also\n --------\n base.log2\n",
"fastmath.max": "\nfastmath.max( x, y )\n Returns the maximum value.\n\n The function ignores the sign of `0` and does not check for `NaN` arguments.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var v = fastmath.max( 3.14, 4.2 )\n 4.2\n > v = fastmath.max( 3.14, NaN )\n NaN\n > v = fastmath.max( NaN, 3.14 )\n 3.14\n > v = fastmath.max( -0.0, +0.0 )\n +0.0\n > v = fastmath.max( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.max\n",
"fastmath.min": "\nfastmath.min( x, y )\n Returns the minimum value.\n\n The function ignores the sign of `0` and does not check for `NaN` arguments.\n\n Parameters\n ----------\n x: number\n First number.\n\n y: number\n Second number.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var v = fastmath.min( 3.14, 4.2 )\n 3.14\n > v = fastmath.min( 3.14, NaN )\n NaN\n > v = fastmath.min( NaN, 3.14 )\n 3.14\n > v = fastmath.min( -0.0, +0.0 )\n +0.0\n > v = fastmath.min( +0.0, -0.0 )\n -0.0\n\n See Also\n --------\n base.min\n",
"fastmath.powint": "\nfastmath.powint( x, y )\n Evaluates the exponential function given a signed 32-bit integer exponent.\n\n This function is not recommended for high-precision applications due to\n error accumulation.\n\n If provided a negative exponent, the function first computes the reciprocal\n of the base and then evaluates the exponential function. This can introduce\n significant error.\n\n Parameters\n ----------\n x: number\n Base.\n\n y: integer\n Signed 32-bit integer exponent.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var v = fastmath.powint( 2.0, 3 )\n 8.0\n > v = fastmath.powint( 3.14, 0 )\n 1.0\n > v = fastmath.powint( 2.0, -2 )\n 0.25\n > v = fastmath.powint( 0.0, 0 )\n 1.0\n > v = fastmath.powint( -3.14, 1 )\n -3.14\n > v = fastmath.powint( NaN, 0 )\n NaN\n\n See Also\n --------\n base.pow\n",
"fastmath.sqrtUint32": "\nfastmath.sqrtUint32( x )\n Returns an approximate square root of an unsigned 32-bit integer `x`.\n\n Prefer hardware `sqrt` over a software implementation.\n\n When using a software `sqrt`, this function provides a performance boost\n when an application requires only approximate computations for integer\n arguments.\n\n For applications requiring high-precision, this function is never suitable.\n\n Parameters\n ----------\n x: uinteger\n Input value.\n\n Returns\n -------\n out: uinteger\n Integer square root.\n\n Examples\n --------\n > var v = fastmath.sqrtUint32( 9 >>> 0 )\n 3\n > v = fastmath.sqrtUint32( 2 >>> 0 )\n 1\n > v = fastmath.sqrtUint32( 3 >>> 0 )\n 1\n > v = fastmath.sqrtUint32( 0 >>> 0 )\n 0\n\n See Also\n --------\n base.sqrt\n",
"FEMALE_FIRST_NAMES_EN": "\nFEMALE_FIRST_NAMES_EN()\n Returns a list of common female first names in English speaking countries.\n\n Returns\n -------\n out: Array<string>\n List of common female first names.\n\n Examples\n --------\n > var list = FEMALE_FIRST_NAMES_EN()\n [ 'Aaren', 'Aarika', 'Abagael', 'Abagail', ... ]\n\n References\n ----------\n - Ward, Grady. 2002. \"Moby Word II.\" <http://www.gutenberg.org/files/3201/\n 3201.txt>.\n\n See Also\n --------\n MALE_FIRST_NAMES_EN\n",
"FIFO": "\nFIFO()\n First-in-first-out (FIFO) queue constructor.\n\n Returns\n -------\n queue: Object\n First-in-first-out queue.\n\n queue.clear: Function\n Clears the queue.\n\n queue.first: Function\n Returns the \"oldest\" queue value (i.e., the value which is \"first-out\").\n If the queue is empty, the returned value is `undefined`.\n\n queue.iterator: Function\n Returns an iterator for iterating over a queue. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from queue mutation during\n iteration, a returned iterator **always** iterates over a queue\n \"snapshot\", which is defined as the list of queue elements at the time\n of the method's invocation.\n\n queue.last: Function\n Returns the \"newest\" queue value (i.e., the value which is \"last-out\").\n If the queue is empty, the returned value is `undefined`.\n\n queue.length: integer\n Queue length.\n\n queue.pop: Function\n Removes and returns the current \"first-out\" value from the queue. If the\n queue is empty, the returned value is `undefined`.\n\n queue.push: Function\n Adds a value to the queue.\n\n queue.toArray: Function\n Returns an array of queue values.\n\n queue.toJSON: Function\n Serializes a queue as JSON.\n\n Examples\n --------\n > var q = FIFO();\n > q.push( 'foo' ).push( 'bar' );\n > q.length\n 2\n > q.pop()\n 'foo'\n > q.length\n 1\n > q.pop()\n 'bar'\n > q.length\n 0\n\n See Also\n --------\n Stack\n",
"find": "\nfind( arr, [options,] clbk )\n Finds elements in an array-like object that satisfy a test condition.\n\n Parameters\n ----------\n arr: Array|TypedArray|string\n Object from which elements will be tested.\n\n options: Object (optional)\n Options.\n\n options.k: integer (optional)\n Limits the number of returned elements. The sign determines the\n direction in which to search. If set to a negative integer, the function\n searches from last element to first element. Default: arr.length.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'indices'.\n\n clbk: Function\n Function invoked for each array element. If the return value is truthy,\n the value is considered to have satisfied the test condition.\n\n Returns\n -------\n out: Array\n Array of indices, element values, or arrays of index-value pairs.\n\n Examples\n --------\n > var data = [ 30, 20, 50, 60, 10 ];\n > function condition( val ) { return val > 20; };\n > var vals = find( data, condition )\n [ 0, 2, 3 ]\n\n // Limit number of results:\n > data = [ 30, 20, 50, 60, 10 ];\n > var opts = { 'k': 2, 'returns': 'values' };\n > vals = find( data, opts, condition )\n [ 30, 50 ]\n\n // Return both indices and values as index-value pairs:\n > data = [ 30, 20, 50, 60, 10 ];\n > opts = { 'k': -2, 'returns': '*' };\n > vals = find( data, opts, condition )\n [ [ 3, 60 ], [ 2, 50 ] ]\n\n",
"flattenArray": "\nflattenArray( arr[, options] )\n Flattens an array.\n\n Parameters\n ----------\n arr: Array\n Input array.\n\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy array elements. Default: false.\n\n Returns\n -------\n out: Array\n Flattened array.\n\n Examples\n --------\n > var arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > var out = flattenArray( arr )\n [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Set the maximum depth:\n > arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > out = flattenArray( arr, { 'depth': 2 } )\n [ 1, 2, 3, [ 4, [ 5 ], 6 ], 7, 8, 9 ]\n > var bool = ( arr[ 1 ][ 1 ][ 1 ] === out[ 3 ] )\n true\n\n // Deep copy:\n > arr = [ 1, [ 2, [ 3, [ 4, [ 5 ], 6 ], 7 ], 8 ], 9 ];\n > out = flattenArray( arr, { 'depth': 2, 'copy': true } )\n [ 1, 2, 3, [ 4, [ 5 ], 6 ], 7, 8, 9 ]\n > bool = ( arr[ 1 ][ 1 ][ 1 ] === out[ 3 ] )\n false\n\n\nflattenArray.factory( dims[, options] )\n Returns a function for flattening arrays having specified dimensions.\n\n The returned function does not validate that input arrays actually have the\n specified dimensions.\n\n Parameters\n ----------\n dims: Array<integer>\n Dimensions.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy array elements. Default: false.\n\n Returns\n -------\n fcn: Function\n Flatten function.\n\n Examples\n --------\n > var flatten = flattenArray.factory( [ 2, 2 ], {\n ... 'copy': false\n ... });\n > var out = flatten( [ [ 1, 2 ], [ 3, 4 ] ] )\n [ 1, 2, 3, 4 ]\n > out = flatten( [ [ 5, 6 ], [ 7, 8 ] ] )\n [ 5, 6, 7, 8 ]\n\n See Also\n --------\n flattenObject\n",
"flattenObject": "\nflattenObject( obj[, options] )\n Flattens an object.\n\n Parameters\n ----------\n obj: ObjectLike\n Object to flatten.\n\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy. Default: false.\n\n options.flattenArrays: boolean (optional)\n Boolean indicating whether to flatten arrays. Default: false.\n\n options.delimiter: string (optional)\n Key path delimiter. Default: '.'.\n\n Returns\n -------\n out: ObjectLike\n Flattened object.\n\n Examples\n --------\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var out = flattenObject( obj )\n { 'a.b.c': 'd' }\n\n // Set the `depth` option to flatten to a specified depth:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > out = flattenObject( obj, { 'depth': 1 } )\n { 'a.b': { 'c': 'd' } }\n > var bool = ( obj.a.b === out[ 'a.b' ] )\n true\n\n // Set the `delimiter` option:\n > obj = { 'a': { 'b': { 'c': 'd' } } };\n > out = flattenObject( obj, { 'delimiter': '-|-' } )\n { 'a-|-b-|-c': 'd' }\n\n // Flatten arrays:\n > obj = { 'a': { 'b': [ 1, 2, 3 ] } };\n > out = flattenObject( obj, { 'flattenArrays': true } )\n { 'a.b.0': 1, 'a.b.1': 2, 'a.b.2': 3 }\n\n\nflattenObject.factory( [options] )\n Returns a function to flatten an object.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.depth: integer (optional)\n Maximum depth to flatten.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy. Default: false.\n\n options.flattenArrays: boolean (optional)\n Boolean indicating whether to flatten arrays. Default: false.\n\n options.delimiter: string (optional)\n Key path delimiter. Default: '.'.\n\n Returns\n -------\n fcn: Function\n Flatten function.\n\n Examples\n --------\n > var flatten = flattenObject.factory({\n ... 'depth': 1,\n ... 'copy': true,\n ... 'delimiter': '|'\n ... });\n > var obj = { 'a': { 'b': { 'c': 'd' } } };\n > var out = flatten( obj )\n { 'a|b': { 'c': 'd' } }\n\n See Also\n --------\n flattenArray\n",
"flignerTest": "\nflignerTest( ...x[, options] )\n Computes the Fligner-Killeen test for equal variances.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = flignerTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = flignerTest( arr, { 'groups': groups })\n\n See Also\n --------\n bartlettTest\n",
"FLOAT16_CBRT_EPS": "\nFLOAT16_CBRT_EPS\n Cube root of half-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT16_CBRT_EPS\n 0.09921256574801247\n\n See Also\n --------\n FLOAT16_EPS, FLOAT16_SQRT_EPS, FLOAT32_CBRT_EPS, CBRT_EPS\n",
"FLOAT16_EPS": "\nFLOAT16_EPS\n Difference between one and the smallest value greater than one that can be\n represented as a half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_EPS\n 0.0009765625\n\n See Also\n --------\n FLOAT32_EPS, EPS\n",
"FLOAT16_EXPONENT_BIAS": "\nFLOAT16_EXPONENT_BIAS\n The bias of a half-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT16_EXPONENT_BIAS\n 15\n\n See Also\n --------\n FLOAT32_EXPONENT_BIAS, FLOAT64_EXPONENT_BIAS\n",
"FLOAT16_MAX": "\nFLOAT16_MAX\n Maximum half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_MAX\n 65504.0\n\n See Also\n --------\n FLOAT32_MAX, FLOAT64_MAX\n",
"FLOAT16_MAX_SAFE_INTEGER": "\nFLOAT16_MAX_SAFE_INTEGER\n Maximum safe half-precision floating-point integer.\n\n The maximum safe half-precision floating-point integer is given by\n `2^11 - 1`.\n\n Examples\n --------\n > FLOAT16_MAX_SAFE_INTEGER\n 2047\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT16_MIN_SAFE_INTEGER": "\nFLOAT16_MIN_SAFE_INTEGER\n Minimum safe half-precision floating-point integer.\n\n The minimum safe half-precision floating-point integer is given by\n `-(2^11 - 1)`.\n\n Examples\n --------\n > FLOAT16_MIN_SAFE_INTEGER\n -2047\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT16_NINF": "\nFLOAT16_NINF\n Half-precision floating-point negative infinity.\n\n Examples\n --------\n > FLOAT16_NINF\n -Infinity\n\n See Also\n --------\n FLOAT16_PINF, FLOAT32_NINF, NINF\n",
"FLOAT16_NUM_BYTES": "\nFLOAT16_NUM_BYTES\n Size (in bytes) of a half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_NUM_BYTES\n 2\n\n See Also\n --------\n FLOAT32_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"FLOAT16_PINF": "\nFLOAT16_PINF\n Half-precision floating-point positive infinity.\n\n Examples\n --------\n > FLOAT16_PINF\n Infinity\n\n See Also\n --------\n FLOAT16_NINF, FLOAT32_PINF, PINF\n",
"FLOAT16_PRECISION": "\nFLOAT16_PRECISION\n Effective number of bits in the significand of a half-precision floating-\n point number.\n\n The effective number of bits is `10` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT16_PRECISION\n 11\n\n See Also\n --------\n FLOAT32_PRECISION, FLOAT64_PRECISION\n",
"FLOAT16_SMALLEST_NORMAL": "\nFLOAT16_SMALLEST_NORMAL\n Smallest positive normalized half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_SMALLEST_NORMAL\n 6.103515625e-5\n\n See Also\n --------\n FLOAT16_SMALLEST_SUBNORMAL, FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_NORMAL\n",
"FLOAT16_SMALLEST_SUBNORMAL": "\nFLOAT16_SMALLEST_SUBNORMAL\n Smallest positive denormalized half-precision floating-point number.\n\n Examples\n --------\n > FLOAT16_SMALLEST_SUBNORMAL\n 5.960464477539063e-8\n\n See Also\n --------\n FLOAT16_SMALLEST_NORMAL, FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT16_SQRT_EPS": "\nFLOAT16_SQRT_EPS\n Square root of half-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT16_SQRT_EPS\n 0.03125\n\n See Also\n --------\n FLOAT16_EPS, FLOAT32_SQRT_EPS, SQRT_EPS\n",
"FLOAT32_CBRT_EPS": "\nFLOAT32_CBRT_EPS\n Cube root of single-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT32_CBRT_EPS\n 0.004921566601151848\n\n See Also\n --------\n FLOAT32_EPS, FLOAT32_SQRT_EPS, CBRT_EPS\n",
"FLOAT32_EPS": "\nFLOAT32_EPS\n Difference between one and the smallest value greater than one that can be\n represented as a single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_EPS\n 1.1920928955078125e-7\n\n See Also\n --------\n EPS\n",
"FLOAT32_EXPONENT_BIAS": "\nFLOAT32_EXPONENT_BIAS\n The bias of a single-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT32_EXPONENT_BIAS\n 127\n\n See Also\n --------\n FLOAT16_EXPONENT_BIAS, FLOAT64_EXPONENT_BIAS\n",
"FLOAT32_MAX": "\nFLOAT32_MAX\n Maximum single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_MAX\n 3.4028234663852886e+38\n\n See Also\n --------\n FLOAT16_MAX, FLOAT64_MAX\n",
"FLOAT32_MAX_SAFE_INTEGER": "\nFLOAT32_MAX_SAFE_INTEGER\n Maximum safe single-precision floating-point integer.\n\n The maximum safe single-precision floating-point integer is given by\n `2^24 - 1`.\n\n Examples\n --------\n > FLOAT32_MAX_SAFE_INTEGER\n 16777215\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT32_MIN_SAFE_INTEGER": "\nFLOAT32_MIN_SAFE_INTEGER\n Minimum safe single-precision floating-point integer.\n\n The minimum safe single-precision floating-point integer is given by\n `-(2^24 - 1)`.\n\n Examples\n --------\n > FLOAT32_MIN_SAFE_INTEGER\n -16777215\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT32_NINF": "\nFLOAT32_NINF\n Single-precision floating-point negative infinity.\n\n Examples\n --------\n > FLOAT32_NINF\n -Infinity\n\n See Also\n --------\n FLOAT32_PINF, NINF\n",
"FLOAT32_NUM_BYTES": "\nFLOAT32_NUM_BYTES\n Size (in bytes) of a single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_NUM_BYTES\n 4\n\n See Also\n --------\n FLOAT16_NUM_BYTES, FLOAT64_NUM_BYTES\n",
"FLOAT32_PINF": "\nFLOAT32_PINF\n Single-precision floating-point positive infinity.\n\n Examples\n --------\n > FLOAT32_PINF\n Infinity\n\n See Also\n --------\n FLOAT32_NINF, PINF\n",
"FLOAT32_PRECISION": "\nFLOAT32_PRECISION\n Effective number of bits in the significand of a single-precision floating-\n point number.\n\n The effective number of bits is `23` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT32_PRECISION\n 24\n\n See Also\n --------\n FLOAT16_PRECISION, FLOAT64_PRECISION\n",
"FLOAT32_SMALLEST_NORMAL": "\nFLOAT32_SMALLEST_NORMAL\n Smallest positive normalized single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_SMALLEST_NORMAL\n 1.1754943508222875e-38\n\n See Also\n --------\n FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_NORMAL\n",
"FLOAT32_SMALLEST_SUBNORMAL": "\nFLOAT32_SMALLEST_SUBNORMAL\n Smallest positive denormalized single-precision floating-point number.\n\n Examples\n --------\n > FLOAT32_SMALLEST_SUBNORMAL\n 1.401298464324817e-45\n\n See Also\n --------\n FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT32_SQRT_EPS": "\nFLOAT32_SQRT_EPS\n Square root of single-precision floating-point epsilon.\n\n Examples\n --------\n > FLOAT32_SQRT_EPS\n 0.0003452669770922512\n\n See Also\n --------\n FLOAT32_EPS, SQRT_EPS\n",
"Float32Array": "\nFloat32Array()\n A typed array constructor which returns a typed array representing an array\n of single-precision floating-point numbers in the platform byte order.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float32Array()\n <Float32Array>\n\n\nFloat32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = new Float32Array( arr1 )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = new Float32Array( arr1 )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Float32Array( buf, 0, 4 )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2.0; };\n > var arr = Float32Array.from( [ 1.0, -1.0 ], mapFcn )\n <Float32Array>[ 2.0, -2.0 ]\n\n\nFloat32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr = Float32Array.of( 2.0, -2.0 )\n <Float32Array>[ 2.0, -2.0 ]\n\n\nFloat32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Float32Array.BYTES_PER_ELEMENT\n 4\n\n\nFloat32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Float32Array.name\n 'Float32Array'\n\n\nFloat32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nFloat32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.byteLength\n 20\n\n\nFloat32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.byteOffset\n 0\n\n\nFloat32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nFloat32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Float32Array( 5 );\n > arr.length\n 5\n\n\nFloat32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 2.0\n > arr[ 4 ]\n -2.0\n\n\nFloat32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1.0 ]\n > it.next().value\n [ 1, -1.0 ]\n > it.next().done\n true\n\n\nFloat32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > arr.every( predicate )\n false\n\n\nFloat32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > arr.fill( 2.0 );\n > arr[ 0 ]\n 2.0\n > arr[ 1 ]\n 2.0\n\n\nFloat32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nFloat32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = arr.find( predicate )\n -1.0\n\n\nFloat32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nFloat32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:1 1:0 2:-1 '\n\n\nFloat32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var bool = arr.includes( 2.0 )\n false\n > bool = arr.includes( -1.0 )\n true\n\n\nFloat32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var idx = arr.indexOf( 2.0 )\n -1\n > idx = arr.indexOf( -1.0 )\n 2\n\n\nFloat32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > arr.join( '|' )\n '1|0|-1'\n\n\nFloat32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nFloat32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = arr.lastIndexOf( 2.0 )\n -1\n > idx = arr.lastIndexOf( 0.0 )\n 3\n\n\nFloat32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var arr2 = arr1.map( fcn );\n <Float32Array>[ 2.0, 0.0, -2.0 ]\n\n\nFloat32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0.0 )\n 2.0\n\n\nFloat32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0.0 )\n 2.0\n\n\nFloat32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] )\n <Float32Array>[ 1.0, 0.0, -1.0 ]\n > arr.reverse()\n <Float32Array>[ -1.0, 0.0, 1.0 ]\n\n\nFloat32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > arr.set( [ -2.0, 2.0 ], 1 );\n > arr[ 1 ]\n -2.0\n > arr[ 2 ]\n 2.0\n\n\nFloat32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, 0.0, -1.0 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 0.0\n > arr2[ 1 ]\n -1.0\n\n\nFloat32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > arr.some( predicate )\n true\n\n\nFloat32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Float32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > arr.sort()\n <Float32Array>[ -2.0, -1.0, 0.0, 1.0, 2.0 ]\n\n\nFloat32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr2 = arr1.subarray( 2 )\n <Float32Array>[ 0.0, 2.0, -2.0 ]\n\n\nFloat32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toLocaleString()\n '1,-1,0'\n\n\nFloat32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toString()\n '1,-1,0'\n\n\nFloat32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Float32Array( [ 1.0, -1.0 ] );\n > it = arr.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"FLOAT64_EXPONENT_BIAS": "\nFLOAT64_EXPONENT_BIAS\n The bias of a double-precision floating-point number's exponent.\n\n Examples\n --------\n > FLOAT64_EXPONENT_BIAS\n 1023\n\n See Also\n --------\n FLOAT16_EXPONENT_BIAS, FLOAT32_EXPONENT_BIAS\n",
"FLOAT64_HIGH_WORD_EXPONENT_MASK": "\nFLOAT64_HIGH_WORD_EXPONENT_MASK\n High word mask for the exponent of a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_HIGH_WORD_EXPONENT_MASK\n 2146435072\n > base.toBinaryStringUint32( FLOAT64_HIGH_WORD_EXPONENT_MASK )\n '01111111111100000000000000000000'\n\n See Also\n --------\n FLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n",
"FLOAT64_HIGH_WORD_SIGNIFICAND_MASK": "\nFLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n High word mask for the significand of a double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_HIGH_WORD_SIGNIFICAND_MASK\n 1048575\n > base.toBinaryStringUint32( FLOAT64_HIGH_WORD_SIGNIFICAND_MASK )\n '00000000000011111111111111111111'\n\n See Also\n --------\n FLOAT64_HIGH_WORD_EXPONENT_MASK\n",
"FLOAT64_MAX": "\nFLOAT64_MAX\n Maximum double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX\n 1.7976931348623157e+308\n\n See Also\n --------\n FLOAT16_MAX, FLOAT32_MAX\n",
"FLOAT64_MAX_BASE2_EXPONENT": "\nFLOAT64_MAX_BASE2_EXPONENT\n The maximum biased base 2 exponent for a double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE2_EXPONENT\n 1023\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL": "\nFLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL\n The maximum biased base 2 exponent for a subnormal double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL\n -1023\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MAX_BASE10_EXPONENT": "\nFLOAT64_MAX_BASE10_EXPONENT\n The maximum base 10 exponent for a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE10_EXPONENT\n 308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT\n",
"FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL": "\nFLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL\n The maximum base 10 exponent for a subnormal double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL\n -308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n",
"FLOAT64_MAX_LN": "\nFLOAT64_MAX_LN\n Natural logarithm of the maximum double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_MAX_LN\n 709.782712893384\n\n See Also\n --------\n FLOAT64_MIN_LN\n",
"FLOAT64_MAX_SAFE_FIBONACCI": "\nFLOAT64_MAX_SAFE_FIBONACCI\n Maximum safe Fibonacci number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_FIBONACCI\n 8944394323791464\n\n See Also\n --------\n FLOAT64_MAX_SAFE_NTH_FIBONACCI\n",
"FLOAT64_MAX_SAFE_INTEGER": "\nFLOAT64_MAX_SAFE_INTEGER\n Maximum safe double-precision floating-point integer.\n\n The maximum safe double-precision floating-point integer is given by\n `2^53 - 1`.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_INTEGER\n 9007199254740991\n\n See Also\n --------\n FLOAT16_MAX_SAFE_INTEGER, FLOAT32_MAX_SAFE_INTEGER, FLOAT64_MIN_SAFE_INTEGER\n",
"FLOAT64_MAX_SAFE_LUCAS": "\nFLOAT64_MAX_SAFE_LUCAS\n Maximum safe Lucas number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_LUCAS\n 7639424778862807\n\n See Also\n --------\n FLOAT64_MAX_SAFE_FIBONACCI, FLOAT64_MAX_SAFE_NTH_LUCAS\n",
"FLOAT64_MAX_SAFE_NTH_FIBONACCI": "\nFLOAT64_MAX_SAFE_NTH_FIBONACCI\n Maximum safe nth Fibonacci number when stored in double-precision floating-\n point format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_NTH_FIBONACCI\n 78\n\n See Also\n --------\n FLOAT64_MAX_SAFE_FIBONACCI\n",
"FLOAT64_MAX_SAFE_NTH_LUCAS": "\nFLOAT64_MAX_SAFE_NTH_LUCAS\n Maximum safe nth Lucas number when stored in double-precision floating-point\n format.\n\n Examples\n --------\n > FLOAT64_MAX_SAFE_NTH_LUCAS\n 76\n\n See Also\n --------\n FLOAT64_MAX_SAFE_LUCAS, FLOAT64_MAX_SAFE_NTH_FIBONACCI\n",
"FLOAT64_MIN_BASE2_EXPONENT": "\nFLOAT64_MIN_BASE2_EXPONENT\n The minimum biased base 2 exponent for a normalized double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE2_EXPONENT\n -1022\n\n See Also\n --------\n FLOAT64_MAX_BASE2_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL": "\nFLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n The minimum biased base 2 exponent for a subnormal double-precision\n floating-point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n -1074\n\n See Also\n --------\n FLOAT64_MAX_BASE2_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MIN_BASE10_EXPONENT": "\nFLOAT64_MIN_BASE10_EXPONENT\n The minimum base 10 exponent for a normalized double-precision floating-\n point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE10_EXPONENT\n -308\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT, FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE2_EXPONENT\n",
"FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL": "\nFLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n The minimum base 10 exponent for a subnormal double-precision floating-\n point number.\n\n Examples\n --------\n > FLOAT64_MIN_BASE10_EXPONENT_SUBNORMAL\n -324\n\n See Also\n --------\n FLOAT64_MAX_BASE10_EXPONENT_SUBNORMAL, FLOAT64_MIN_BASE10_EXPONENT, FLOAT64_MIN_BASE2_EXPONENT_SUBNORMAL\n",
"FLOAT64_MIN_LN": "\nFLOAT64_MIN_LN\n Natural logarithm of the smallest normalized double-precision floating-point\n number.\n\n Examples\n --------\n > FLOAT64_MIN_LN\n -708.3964185322641\n\n See Also\n --------\n FLOAT64_MAX_LN\n",
"FLOAT64_MIN_SAFE_INTEGER": "\nFLOAT64_MIN_SAFE_INTEGER\n Minimum safe double-precision floating-point integer.\n\n The minimum safe double-precision floating-point integer is given by\n `-(2^53 - 1)`.\n\n Examples\n --------\n > FLOAT64_MIN_SAFE_INTEGER\n -9007199254740991\n\n See Also\n --------\n FLOAT16_MIN_SAFE_INTEGER, FLOAT32_MIN_SAFE_INTEGER, FLOAT64_MAX_SAFE_INTEGER\n",
"FLOAT64_NUM_BYTES": "\nFLOAT64_NUM_BYTES\n Size (in bytes) of a double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_NUM_BYTES\n 8\n\n See Also\n --------\n FLOAT16_NUM_BYTES, FLOAT32_NUM_BYTES\n",
"FLOAT64_PRECISION": "\nFLOAT64_PRECISION\n Effective number of bits in the significand of a double-precision floating-\n point number.\n\n The effective number of bits is `52` significand bits plus `1` hidden bit.\n\n Examples\n --------\n > FLOAT64_PRECISION\n 53\n\n See Also\n --------\n FLOAT16_PRECISION, FLOAT32_PRECISION\n",
"FLOAT64_SMALLEST_NORMAL": "\nFLOAT64_SMALLEST_NORMAL\n Smallest positive normalized double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_SMALLEST_NORMAL\n 2.2250738585072014e-308\n\n See Also\n --------\n FLOAT32_SMALLEST_NORMAL, FLOAT64_SMALLEST_SUBNORMAL\n",
"FLOAT64_SMALLEST_SUBNORMAL": "\nFLOAT64_SMALLEST_SUBNORMAL\n Smallest positive denormalized double-precision floating-point number.\n\n Examples\n --------\n > FLOAT64_SMALLEST_SUBNORMAL\n 4.940656458412465e-324\n\n See Also\n --------\n FLOAT32_SMALLEST_SUBNORMAL, FLOAT64_SMALLEST_NORMAL\n",
"Float64Array": "\nFloat64Array()\n A typed array constructor which returns a typed array representing an array\n of double-precision floating-point numbers in the platform byte order.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float64Array()\n <Float64Array>\n\n\nFloat64Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat64Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float32Array( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = new Float64Array( arr1 )\n <Float64Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat64Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = new Float64Array( arr1 )\n <Float64Array>[ 0.5, 0.5, 0.5 ]\n\n\nFloat64Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 32 );\n > var arr = new Float64Array( buf, 0, 4 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n\nFloat64Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2.0; };\n > var arr = Float64Array.from( [ 1.0, -1.0 ], mapFcn )\n <Float64Array>[ 2.0, -2.0 ]\n\n\nFloat64Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr = Float64Array.of( 2.0, -2.0 )\n <Float64Array>[ 2.0, -2.0 ]\n\n\nFloat64Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Float64Array.BYTES_PER_ELEMENT\n 8\n\n\nFloat64Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Float64Array.name\n 'Float64Array'\n\n\nFloat64Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nFloat64Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.byteLength\n 40\n\n\nFloat64Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.byteOffset\n 0\n\n\nFloat64Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 8\n\n\nFloat64Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Float64Array( 5 );\n > arr.length\n 5\n\n\nFloat64Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 2.0\n > arr[ 4 ]\n -2.0\n\n\nFloat64Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1.0 ]\n > it.next().value\n [ 1, -1.0 ]\n > it.next().done\n true\n\n\nFloat64Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > arr.every( predicate )\n false\n\n\nFloat64Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > arr.fill( 2.0 );\n > arr[ 0 ]\n 2.0\n > arr[ 1 ]\n 2.0\n\n\nFloat64Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nFloat64Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = arr.find( predicate )\n -1.0\n\n\nFloat64Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nFloat64Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:1 1:0 2:-1 '\n\n\nFloat64Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var bool = arr.includes( 2.0 )\n false\n > bool = arr.includes( -1.0 )\n true\n\n\nFloat64Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var idx = arr.indexOf( 2.0 )\n -1\n > idx = arr.indexOf( -1.0 )\n 2\n\n\nFloat64Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > arr.join( '|' )\n '1|0|-1'\n\n\nFloat64Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nFloat64Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = arr.lastIndexOf( 2.0 )\n -1\n > idx = arr.lastIndexOf( 0.0 )\n 3\n\n\nFloat64Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var arr2 = arr1.map( fcn );\n <Float64Array>[ 2.0, 0.0, -2.0 ]\n\n\nFloat64Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0.0 )\n 2.0\n\n\nFloat64Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0.0 )\n 2.0\n\n\nFloat64Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] )\n <Float64Array>[ 1.0, 0.0, -1.0 ]\n > arr.reverse()\n <Float64Array>[ -1.0, 0.0, 1.0 ]\n\n\nFloat64Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > arr.set( [ -2.0, 2.0 ], 1 );\n > arr[ 1 ]\n -2.0\n > arr[ 2 ]\n 2.0\n\n\nFloat64Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float64Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, 0.0, -1.0 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 0.0\n > arr2[ 1 ]\n -1.0\n\n\nFloat64Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > arr.some( predicate )\n true\n\n\nFloat64Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Float64Array\n Modified array.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > arr.sort()\n <Float64Array>[ -2.0, -1.0, 0.0, 1.0, 2.0 ]\n\n\nFloat64Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Float64Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Float64Array( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr2 = arr1.subarray( 2 )\n <Float64Array>[ 0.0, 2.0, -2.0 ]\n\n\nFloat64Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toLocaleString()\n '1,-1,0'\n\n\nFloat64Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0, 0.0 ] );\n > arr.toString()\n '1,-1,0'\n\n\nFloat64Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Float64Array( [ 1.0, -1.0 ] );\n > it = arr.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"forEach": "\nforEach( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4 ];\n > forEach( arr, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n forEachAsync, forEachRight\n",
"forEachAsync": "\nforEachAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, onDuration, done )\n 1000\n 2500\n 3000\n Done.\n\n // Limit number of concurrent invocations:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, opts, onDuration, done )\n 2500\n 3000\n 1000\n Done.\n\n // Process sequentially:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > forEachAsync( arr, opts, onDuration, done )\n 3000\n 2500\n 1000\n Done.\n\n\nforEachAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = forEachAsync.factory( opts, onDuration );\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n Done.\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n Done.\n\n See Also\n --------\n forEach, forEachRightAsync\n",
"forEachRight": "\nforEachRight( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection, iterating from right to\n left.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4 ];\n > forEachRight( arr, logger )\n 3: 4\n 2: 3\n 1: 2\n 0: 1\n\n See Also\n --------\n forEach, forEachRightAsync\n",
"forEachRightAsync": "\nforEachRightAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection, iterating from\n right to left.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, onDuration, done )\n 1000\n 2500\n 3000\n Done.\n\n // Limit number of concurrent invocations:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, opts, onDuration, done )\n 2500\n 3000\n 1000\n Done.\n\n // Process sequentially:\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > forEachRightAsync( arr, opts, onDuration, done )\n 3000\n 2500\n 1000\n Done.\n\n\nforEachRightAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function onDuration( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next();\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = forEachRightAsync.factory( opts, onDuration );\n > function done( error ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Done.' );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n Done.\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n Done.\n\n See Also\n --------\n forEachAsync, forEachRight\n",
"forIn": "\nforIn( obj, fcn[, thisArg] )\n Invokes a function for each own and inherited enumerable property of an\n object.\n\n When invoked, the function is provided three arguments:\n\n - `value`: object property value\n - `key`: object property\n - `obj`: the input object\n\n To terminate iteration before visiting all properties, the provided function\n must explicitly return `false`.\n\n Property iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Input object, including arrays, typed arrays, and other collections.\n\n fcn: Function\n The function to invoke for each own enumerable property.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Input object.\n\n Examples\n --------\n > function logger( v, k ) { console.log( '%s: %d', k, v ); };\n > function Foo() { return this; };\n > Foo.prototype.beep = 'boop';\n > var obj = new Foo();\n > forIn( obj, logger )\n beep: boop\n\n See Also\n --------\n forEach, forOwn\n",
"forOwn": "\nforOwn( obj, fcn[, thisArg] )\n Invokes a function for each own enumerable property of an object.\n\n When invoked, the function is provided three arguments:\n\n - `value`: object property value\n - `key`: object property\n - `obj`: the input object\n\n To terminate iteration before visiting all properties, the provided function\n must explicitly return `false`.\n\n The function determines the list of own enumerable properties *before*\n invoking the provided function. Hence, any modifications made to the input\n object *after* calling this function (such as adding and removing\n properties) will *not* affect the list of visited properties.\n\n Property iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Input object, including arrays, typed arrays, and other collections.\n\n fcn: Function\n The function to invoke for each own enumerable property.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Input object.\n\n Examples\n --------\n > function logger( v, k ) { console.log( '%s: %d', k, v ); };\n > var obj = { 'a': 1, 'b': 2, 'c': 3, 'd': 4 };\n > forOwn( obj, logger )\n a: 1\n b: 2\n c: 3\n d: 4\n\n See Also\n --------\n forEach, forIn\n",
"FOURTH_PI": "\nFOURTH_PI\n One fourth times the mathematical constant `π`.\n\n Examples\n --------\n > FOURTH_PI\n 7.85398163397448309616e-1\n\n See Also\n --------\n PI\n",
"FOURTH_ROOT_EPS": "\nFOURTH_ROOT_EPS\n Fourth root of double-precision floating-point epsilon.\n\n Examples\n --------\n > FOURTH_ROOT_EPS\n 0.0001220703125\n\n See Also\n --------\n EPS\n",
"FRB_SF_WAGE_RIGIDITY": "\nFRB_SF_WAGE_RIGIDITY()\n Returns wage rates for U.S. workers that have not changed jobs within the\n year.\n\n Each array element has the following fields:\n\n - date: collection date (month/day/year; e.g., 01/01/1980).\n - all_workers: wage rates for hourly and non-hourly workers.\n - hourly_workers: wage rates for hourly workers.\n - non_hourly_workers: wage rates for non-hourly workers.\n - less_than_high_school: wage rates for workers with less than a high school\n education.\n - high_school: wage rates for workers with a high school education.\n - some_college: wage rates for workers with some college education.\n - college: wage rates for workers with a college education.\n - construction: wage rates for workers in the construction industry.\n - finance: wage rates for workers in the finance industry.\n - manufacturing: wage rates for workers in the manufacturing industry.\n\n Returns\n -------\n out: Array<Object>\n Wage rates.\n\n Examples\n --------\n > var data = FRB_SF_WAGE_RIGIDITY()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Federal Reserve Bank of San Francisco. 2017. \"Wage Rigidity.\" <http://www.\n frbsf.org/economic-research/indicators-data/nominal-wage-rigidity/>.\n\n",
"fromCodePoint": "\nfromCodePoint( ...pt )\n Creates a string from a sequence of Unicode code points.\n\n In addition to multiple arguments, the function also supports providing an\n array-like object as a single argument containing a sequence of Unicode code\n points.\n\n Parameters\n ----------\n pt: ...integer\n Sequence of Unicode code points.\n\n Returns\n -------\n out: string\n Output string.\n\n Examples\n --------\n > var out = fromCodePoint( 9731 )\n '☃'\n > out = fromCodePoint( [ 9731 ] )\n '☃'\n > out = fromCodePoint( 97, 98, 99 )\n 'abc'\n > out = fromCodePoint( [ 97, 98, 99 ] )\n 'abc'\n\n",
"functionName": "\nfunctionName( fcn )\n Returns the name of a function.\n\n If provided an anonymous function, the function returns an empty `string` or\n the string `\"anonymous\"`.\n\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n Returns\n -------\n out: string\n Function name.\n\n Examples\n --------\n > var v = functionName( String )\n 'String'\n > v = functionName( function foo(){} )\n 'foo'\n > v = functionName( function(){} )\n '' || 'anonymous'\n\n See Also\n --------\n constructorName\n",
"functionSequence": "\nfunctionSequence( ...fcn )\n Returns a pipeline function.\n\n Starting from the left, the pipeline function evaluates each function and\n passes the result as an argument to the next function. The result of the\n rightmost function is the result of the whole.\n\n Only the leftmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as unary functions.\n\n Parameters\n ----------\n fcn: ...Function\n Functions to evaluate in sequential order.\n\n Returns\n -------\n out: Function\n Pipeline function.\n\n Examples\n --------\n > function a( x ) { return 2 * x; };\n > function b( x ) { return x + 3; };\n > function c( x ) { return x / 5; };\n > var f = functionSequence( a, b, c );\n > var z = f( 6 )\n 3\n\n See Also\n --------\n compose, functionSequenceAsync\n",
"functionSequenceAsync": "\nfunctionSequenceAsync( ...fcn )\n Returns a pipeline function.\n\n Starting from the left, the pipeline function evaluates each function and\n passes the result as the first argument of the next function. The result of\n the rightmost function is the result of the whole.\n\n The last argument for each provided function is a `next` callback which\n should be invoked upon function completion. The callback accepts two\n arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the pipeline function suspends execution and immediately calls the\n `done` callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Only the leftmost function is explicitly permitted to accept multiple\n arguments. All other functions are evaluated as binary functions.\n\n The function will throw if provided fewer than two input arguments.\n\n Parameters\n ----------\n fcn: ...Function\n Functions to evaluate in sequential order.\n\n Returns\n -------\n out: Function\n Pipeline function.\n\n Examples\n --------\n > function a( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, 2*x );\n ... }\n ... };\n > function b( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x+3 );\n ... }\n ... };\n > function c( x, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, x/5 );\n ... }\n ... };\n > var f = functionSequenceAsync( a, b, c );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > f( 6, done )\n 3\n\n See Also\n --------\n composeAsync, functionSequence\n",
"GAMMA_LANCZOS_G": "\nGAMMA_LANCZOS_G\n Arbitrary constant `g` to be used in Lanczos approximation functions.\n\n Examples\n --------\n > GAMMA_LANCZOS_G\n 10.900511\n\n",
"getegid": "\ngetegid()\n Returns the effective numeric group identity of the calling process.\n\n The function only returns an effective group identity on POSIX platforms.\n For all other platforms (e.g., Windows and Android), the function returns\n `null`.\n\n Returns\n -------\n id: integer|null\n Effective numeric group identity.\n\n Examples\n --------\n > var gid = getegid()\n\n See Also\n --------\n geteuid, getgid, getuid\n",
"geteuid": "\ngeteuid()\n Returns the effective numeric user identity of the calling process.\n\n The function only returns an effective user identity on POSIX platforms. For\n all other platforms (e.g., Windows and Android), the function returns\n `null`.\n\n Returns\n -------\n id: integer|null\n Effective numeric user identity.\n\n Examples\n --------\n > var uid = geteuid()\n\n See Also\n --------\n getegid, getgid, getuid\n",
"getgid": "\ngetgid()\n Returns the numeric group identity of the calling process.\n\n The function only returns a group identity on POSIX platforms. For all other\n platforms (e.g., Windows and Android), the function returns `null`.\n\n Returns\n -------\n id: integer|null\n Numeric group identity.\n\n Examples\n --------\n > var gid = getgid()\n\n See Also\n --------\n getegid, geteuid, getuid\n",
"getGlobal": "\ngetGlobal( [codegen] )\n Returns the global object.\n\n Parameters\n ----------\n codegen: boolean (optional)\n Boolean indicating whether to use code generation to resolve the global\n object. Code generation is the *most* reliable means for resolving the\n global object; however, using code generation may violate content\n security policies (CSPs). Default: false.\n\n Returns\n -------\n global: Object\n Global object.\n\n Examples\n --------\n > var g = getGlobal()\n {...}\n\n",
"getPrototypeOf": "\ngetPrototypeOf( value )\n Returns the prototype of a provided object.\n\n In contrast to the native `Object.getPrototypeOf`, this function does not\n throw when provided `null` or `undefined`. Instead, similar to when provided\n any value with *no* inherited properties, the function returns `null`.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: Object|null\n Prototype.\n\n Examples\n --------\n > var proto = getPrototypeOf( {} )\n {}\n\n See Also\n --------\n isPrototypeOf\n",
"getuid": "\ngetuid()\n Returns the numeric user identity of the calling process.\n\n The function only returns a user identity on POSIX platforms. For all other\n platforms (e.g., Windows and Android), the function returns `null`.\n\n Returns\n -------\n id: integer|null\n Numeric user identity.\n\n Examples\n --------\n > var uid = getuid()\n\n See Also\n --------\n getegid, geteuid, getgid\n",
"GLAISHER": "\nGLAISHER\n Glaisher-Kinkelin constant.\n\n Examples\n --------\n > GLAISHER\n 1.2824271291006226\n\n",
"group": "\ngroup( collection, [options,] groups )\n Groups values as arrays associated with distinct keys.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n groups: Array|TypedArray|Object\n A collection defining which group an element in the input collection\n belongs to. Each value in `groups` should resolve to a value which can\n be serialized as an object key. If provided an object, the object must\n be array-like (excluding strings and functions).\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var groups = [ 'b', 'b', 'f', 'b' ];\n > var out = group( collection, groups )\n { 'b': [ 'beep', 'boop', 'bar' ], 'f': [ 'foo' ] }\n > groups = [ 1, 1, 2, 1 ];\n > out = group( collection, groups )\n { '1': [ 'beep', 'boop', 'bar' ], '2': [ 'foo' ] }\n\n // Output group results as indices:\n > groups = [ 'b', 'b', 'f', 'b' ];\n > var opts = { 'returns': 'indices' };\n > out = group( collection, opts, groups )\n { 'b': [ 0, 1, 3 ], 'f': [ 2 ] }\n\n // Output group results as index-element pairs:\n > opts = { 'returns': '*' };\n > out = group( collection, opts, groups )\n { 'b': [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], 'f': [ [2, 'foo'] ] }\n\n See Also\n --------\n bifurcate, countBy, groupBy\n",
"groupBy": "\ngroupBy( collection, [options,] indicator )\n Groups values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty collection, the function returns an empty object.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = groupBy( collection, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > out = groupBy( collection, opts, indicator )\n { 'b': [ 0, 1, 3 ], 'other': [ 2 ] }\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > out = groupBy( collection, opts, indicator )\n { 'b': [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], 'other': [ [2, 'foo' ] ] }\n\n See Also\n --------\n bifurcateBy, countBy, group\n",
"groupByAsync": "\ngroupByAsync( collection, [options,] indicator, done )\n Groups values according to an indicator function.\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty object as the second argument.\n\n The `group` returned by an indicator function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ 1000, 3000 ], \"false\": [ 2500 ] }\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > groupByAsync( arr, opts, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ 2, 0 ], \"false\": [ 1 ] }\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > groupByAsync( arr, opts, indicator, done )\n 1000\n 2500\n 3000\n { \"true\": [ [ 2, 1000 ], [ 0, 3000 ] ], \"false\": [ [ 1, 2500 ] ] }\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > groupByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n\n\ngroupByAsync.factory( [options,] indicator )\n Returns a function which groups values according to an indicator function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A group-by function.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = groupByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n { \"true\": [ 3000, 1000 ], \"false\": [ 2500 ] }\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n { \"true\": [ 2000, 1000 ], \"false\": [ 1500 ] }\n\n See Also\n --------\n bifurcateByAsync, countByAsync, groupBy\n",
"groupIn": "\ngroupIn( obj, [options,] indicator )\n Group values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty object with no prototype, the function returns an empty\n object.\n\n The function iterates over an object's own and inherited properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > function Foo() { this.a = 'beep'; this.b = 'boop'; return this; };\n > Foo.prototype = Object.create( null );\n > Foo.prototype.c = 'foo';\n > Foo.prototype.d = 'bar';\n > var obj = new Foo();\n > var out = groupIn( obj, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = groupIn( obj, opts, indicator )\n { 'b': [ 'a', 'b', 'd' ], 'other': [ 'c' ] }\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = groupIn( obj, opts, indicator )\n { 'b': [['a','beep'], ['b','boop'], ['d','bar']], 'other': [['c','foo' ]] }\n\n See Also\n --------\n bifurcateIn, groupBy, groupOwn\n",
"groupOwn": "\ngroupOwn( obj, [options,] indicator )\n Group values according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: object value\n - `key`: object key\n\n The value returned by an indicator function should be a value which can be\n serialized as an object key.\n\n If provided an empty object, the function returns an empty object.\n\n The function iterates over an object's own properties.\n\n Key iteration order is *not* guaranteed, and, thus, result order is *not*\n guaranteed.\n\n Parameters\n ----------\n obj: Object|Array|TypedArray\n Input object to group.\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `keys`, keys are returned; if `*`,\n both keys and values are returned. Default: 'values'.\n\n indicator: Function\n Indicator function indicating which group a value in the input object\n belongs to.\n\n Returns\n -------\n out: Object\n Group results.\n\n Examples\n --------\n > function indicator( v ) {\n ... if ( v[ 0 ] === 'b' ) {\n ... return 'b';\n ... }\n ... return 'other';\n ... };\n > var obj = { 'a': 'beep', 'b': 'boop', 'c': 'foo', 'd': 'bar' };\n > var out = groupOwn( obj, indicator )\n { 'b': [ 'beep', 'boop', 'bar' ], 'other': [ 'foo' ] }\n\n // Output group results as keys:\n > var opts = { 'returns': 'keys' };\n > out = groupOwn( obj, opts, indicator )\n { 'b': [ 'a', 'b', 'd' ], 'other': [ 'c' ] }\n\n // Output group results as key-value pairs:\n > opts = { 'returns': '*' };\n > out = groupOwn( obj, opts, indicator )\n { 'b': [['a','beep'], ['b','boop'], ['d','bar']], 'other': [['c','foo' ]] }\n\n See Also\n --------\n bifurcateOwn, group, groupBy\n",
"HALF_LN2": "\nHALF_LN2\n One half times the natural logarithm of `2`.\n\n Examples\n --------\n > HALF_LN2\n 3.46573590279972654709e-01\n\n See Also\n --------\n LN2\n",
"HALF_PI": "\nHALF_PI\n One half times the mathematical constant `π`.\n\n Examples\n --------\n > HALF_PI\n 1.5707963267948966\n\n See Also\n --------\n PI\n",
"HARRISON_BOSTON_HOUSE_PRICES": "\nHARRISON_BOSTON_HOUSE_PRICES()\n Returns a dataset derived from information collected by the US Census\n Service concerning housing in Boston, Massachusetts (1978).\n\n The data consists of 14 attributes:\n\n - crim: per capita crime rate by town\n - zn: proportion of residential land zoned for lots over 25,000 square feet\n - indus: proportion of non-retail business acres per town\n - chas: Charles River dummy variable (1 if tract bounds river; 0 otherwise)\n - nox: nitric oxides concentration (parts per 10 million)\n - rm: average number of rooms per dwelling\n - age: proportion of owner-occupied units built prior to 1940\n - dis: weighted distances to five Boston employment centers\n - rad: index of accessibility to radial highways\n - tax: full-value property-tax rate per $10,000\n - ptratio: pupil-teacher ratio by town\n - b: 1000(Bk-0.63)^2 where Bk is the proportion of blacks by town\n - lstat: percent lower status of the population\n - medv: median value of owner-occupied homes in $1000's\n\n The dataset has two prototasks: 1) predict nitrous oxide level and 2)\n predict median home value.\n\n The median home value field seems to be censored at 50.00 (corresponding to\n a median value of $50,000). Censoring is suggested by the fact that the\n highest median value of exactly $50,000 is reported in 16 cases, while 15\n cases have values between $40,000 and $50,000. Values are rounded to the\n nearest hundred. Harrison and Rubinfeld do not, however, mention any\n censoring.\n\n Additionally, as documented by Gilley and Pace (1996), the dataset contains\n eight miscoded median values.\n\n Returns\n -------\n out: Array<Object>\n Boston house prices.\n\n Examples\n --------\n > var data = HARRISON_BOSTON_HOUSE_PRICES()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Harrison, David, and Daniel L Rubinfeld. 1978. \"Hedonic housing prices and\n the demand for clean air.\" _Journal of Environmental Economics and\n Management_ 5 (1): 81–102. doi:10.1016/0095-0696(78)90006-2.\n - Gilley, Otis W., and R.Kelley Pace. 1996. \"On the Harrison and Rubinfeld\n Data.\" _Journal of Environmental Economics and Management_ 31 (3): 403–5.\n doi:10.1006/jeem.1996.0052.\n\n See Also\n --------\n HARRISON_BOSTON_HOUSE_PRICES_CORRECTED\n",
"HARRISON_BOSTON_HOUSE_PRICES_CORRECTED": "\nHARRISON_BOSTON_HOUSE_PRICES_CORRECTED()\n Returns a (corrected) dataset derived from information collected by the US\n Census Service concerning housing in Boston, Massachusetts (1978).\n\n The data consists of 15 attributes:\n\n - crim: per capita crime rate by town\n - zn: proportion of residential land zoned for lots over 25,000 square feet\n - indus: proportion of non-retail business acres per town\n - chas: Charles River dummy variable (1 if tract bounds river; 0 otherwise)\n - nox: nitric oxides concentration (parts per 10 million)\n - rm: average number of rooms per dwelling\n - age: proportion of owner-occupied units built prior to 1940\n - dis: weighted distances to five Boston employment centers\n - rad: index of accessibility to radial highways\n - tax: full-value property-tax rate per $10,000\n - ptratio: pupil-teacher ratio by town\n - b: 1000(Bk-0.63)^2 where Bk is the proportion of blacks by town\n - lstat: percent lower status of the population\n - medv: median value of owner-occupied homes in $1000's\n - cmedv: corrected median value of owner-occupied homes in $1000's\n\n The dataset has two prototasks: 1) predict nitrous oxide level and 2)\n predict median home value.\n\n The median home value field seems to be censored at 50.00 (corresponding to\n a median value of $50,000). Censoring is suggested by the fact that the\n highest median value of exactly $50,000 is reported in 16 cases, while 15\n cases have values between $40,000 and $50,000. Values are rounded to the\n nearest hundred. Harrison and Rubinfeld do not, however, mention any\n censoring.\n\n Returns\n -------\n out: Array<Object>\n Boston house prices.\n\n Examples\n --------\n > var data = HARRISON_BOSTON_HOUSE_PRICES_CORRECTED()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Harrison, David, and Daniel L Rubinfeld. 1978. \"Hedonic housing prices and\n the demand for clean air.\" _Journal of Environmental Economics and\n Management_ 5 (1): 81–102. doi:10.1016/0095-0696(78)90006-2.\n - Gilley, Otis W., and R.Kelley Pace. 1996. \"On the Harrison and Rubinfeld\n Data.\" _Journal of Environmental Economics and Management_ 31 (3): 403–5.\n doi:10.1006/jeem.1996.0052.\n\n See Also\n --------\n HARRISON_BOSTON_HOUSE_PRICES\n",
"hasArrayBufferSupport": "\nhasArrayBufferSupport()\n Tests for native `ArrayBuffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `ArrayBuffer` support.\n\n Examples\n --------\n > var bool = hasArrayBufferSupport()\n <boolean>\n\n See Also\n --------\n hasFloat32ArraySupport, hasFloat64ArraySupport, hasInt16ArraySupport, hasInt32ArraySupport, hasInt8ArraySupport, hasNodeBufferSupport, hasSharedArrayBufferSupport, hasUint16ArraySupport, hasUint32ArraySupport, hasUint8ArraySupport, hasUint8ClampedArraySupport\n",
"hasAsyncAwaitSupport": "\nhasAsyncAwaitSupport()\n Tests for native `async`/`await` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `async`/`await` support.\n\n Examples\n --------\n > var bool = hasAsyncAwaitSupport()\n <boolean>\n\n",
"hasClassSupport": "\nhasClassSupport()\n Tests for native `class` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `class` support.\n\n Examples\n --------\n > var bool = hasClassSupport()\n <boolean>\n\n",
"hasDefinePropertiesSupport": "\nhasDefinePropertiesSupport()\n Tests for `Object.defineProperties` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Object.defineProperties`\n support.\n\n Examples\n --------\n > var bool = hasDefinePropertiesSupport()\n <boolean>\n\n See Also\n --------\n hasDefinePropertySupport\n",
"hasDefinePropertySupport": "\nhasDefinePropertySupport()\n Tests for `Object.defineProperty` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Object.defineProperty`\n support.\n\n Examples\n --------\n > var bool = hasDefinePropertySupport()\n <boolean>\n\n See Also\n --------\n hasDefinePropertiesSupport\n",
"hasFloat32ArraySupport": "\nhasFloat32ArraySupport()\n Tests for native `Float32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Float32Array` support.\n\n Examples\n --------\n > var bool = hasFloat32ArraySupport()\n <boolean>\n\n",
"hasFloat64ArraySupport": "\nhasFloat64ArraySupport()\n Tests for native `Float64Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Float64Array` support.\n\n Examples\n --------\n > var bool = hasFloat64ArraySupport()\n <boolean>\n\n",
"hasFunctionNameSupport": "\nhasFunctionNameSupport()\n Tests for native function `name` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has function `name` support.\n\n Examples\n --------\n > var bool = hasFunctionNameSupport()\n <boolean>\n\n",
"hasGeneratorSupport": "\nhasGeneratorSupport()\n Tests whether an environment supports native generator functions.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment support generator functions.\n\n Examples\n --------\n > var bool = hasGeneratorSupport()\n <boolean>\n\n",
"hasInt8ArraySupport": "\nhasInt8ArraySupport()\n Tests for native `Int8Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int8Array` support.\n\n Examples\n --------\n > var bool = hasInt8ArraySupport()\n <boolean>\n\n",
"hasInt16ArraySupport": "\nhasInt16ArraySupport()\n Tests for native `Int16Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int16Array` support.\n\n Examples\n --------\n > var bool = hasInt16ArraySupport()\n <boolean>\n\n",
"hasInt32ArraySupport": "\nhasInt32ArraySupport()\n Tests for native `Int32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Int32Array` support.\n\n Examples\n --------\n > var bool = hasInt32ArraySupport()\n <boolean>\n\n",
"hasIteratorSymbolSupport": "\nhasIteratorSymbolSupport()\n Tests for native `Symbol.iterator` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Symbol.iterator`\n support.\n\n Examples\n --------\n > var bool = hasIteratorSymbolSupport()\n <boolean>\n\n See Also\n --------\n hasSymbolSupport\n",
"hasMapSupport": "\nhasMapSupport()\n Tests for native `Map` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Map` support.\n\n Examples\n --------\n > var bool = hasMapSupport()\n <boolean>\n\n",
"hasNodeBufferSupport": "\nhasNodeBufferSupport()\n Tests for native `Buffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Buffer` support.\n\n Examples\n --------\n > var bool = hasNodeBufferSupport()\n <boolean>\n\n",
"hasOwnProp": "\nhasOwnProp( value, property )\n Tests if an object has a specified property.\n\n In contrast to the native `Object.prototype.hasOwnProperty`, this function\n does not throw when provided `null` or `undefined`. Instead, the function\n returns `false`.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = hasOwnProp( beep, 'boop' )\n true\n > bool = hasOwnProp( beep, 'bop' )\n false\n\n See Also\n --------\n hasProp\n",
"hasProp": "\nhasProp( value, property )\n Tests if an object has a specified property, either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = hasProp( beep, 'boop' )\n true\n > bool = hasProp( beep, 'toString' )\n true\n > bool = hasProp( beep, 'bop' )\n false\n\n See Also\n --------\n hasOwnProp\n",
"hasProxySupport": "\nhasProxySupport()\n Tests whether an environment has native `Proxy` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Proxy` support.\n\n Examples\n --------\n > var bool = hasProxySupport()\n <boolean>\n\n",
"hasSetSupport": "\nhasSetSupport()\n Tests for native `Set` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Set` support.\n\n Examples\n --------\n > var bool = hasSetSupport()\n <boolean>\n\n",
"hasSharedArrayBufferSupport": "\nhasSharedArrayBufferSupport()\n Tests for native `SharedArrayBuffer` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `SharedArrayBuffer` support.\n\n Examples\n --------\n > var bool = hasSharedArrayBufferSupport()\n <boolean>\n\n See Also\n --------\n hasArrayBufferSupport, hasFloat32ArraySupport, hasFloat64ArraySupport, hasInt16ArraySupport, hasInt32ArraySupport, hasInt8ArraySupport, hasNodeBufferSupport, hasUint16ArraySupport, hasUint32ArraySupport, hasUint8ArraySupport, hasUint8ClampedArraySupport\n",
"hasSymbolSupport": "\nhasSymbolSupport()\n Tests for native `Symbol` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native `Symbol` support.\n\n Examples\n --------\n > var bool = hasSymbolSupport()\n <boolean>\n\n See Also\n --------\n hasIteratorSymbolSupport\n",
"hasToStringTagSupport": "\nhasToStringTagSupport()\n Tests for native `toStringTag` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `toStringTag` support.\n\n Examples\n --------\n > var bool = hasToStringTagSupport()\n <boolean>\n\n",
"hasUint8ArraySupport": "\nhasUint8ArraySupport()\n Tests for native `Uint8Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint8Array` support.\n\n Examples\n --------\n > var bool = hasUint8ArraySupport()\n <boolean>\n\n",
"hasUint8ClampedArraySupport": "\nhasUint8ClampedArraySupport()\n Tests for native `Uint8ClampedArray` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint8ClampedArray` support.\n\n Examples\n --------\n > var bool = hasUint8ClampedArraySupport()\n <boolean>\n\n",
"hasUint16ArraySupport": "\nhasUint16ArraySupport()\n Tests for native `Uint16Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint16Array` support.\n\n Examples\n --------\n > var bool = hasUint16ArraySupport()\n <boolean>\n\n",
"hasUint32ArraySupport": "\nhasUint32ArraySupport()\n Tests for native `Uint32Array` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `Uint32Array` support.\n\n Examples\n --------\n > var bool = hasUint32ArraySupport()\n <boolean>\n\n",
"hasWeakMapSupport": "\nhasWeakMapSupport()\n Tests for native `WeakMap` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `WeakMap` support.\n\n Examples\n --------\n > var bool = hasWeakMapSupport()\n <boolean>\n\n",
"hasWeakSetSupport": "\nhasWeakSetSupport()\n Tests for native `WeakSet` support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has `WeakSet` support.\n\n Examples\n --------\n > var bool = hasWeakSetSupport()\n <boolean>\n\n",
"hasWebAssemblySupport": "\nhasWebAssemblySupport()\n Tests for native WebAssembly support.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an environment has native WebAssembly support.\n\n Examples\n --------\n > var bool = hasWebAssemblySupport()\n <boolean>\n\n",
"HERNDON_VENUS_SEMIDIAMETERS": "\nHERNDON_VENUS_SEMIDIAMETERS()\n Returns fifteen observations of the vertical semidiameter of Venus, made by\n Lieutenant Herndon, with the meridian circle at Washington, in the year\n 1846.\n\n This dataset is a classic dataset commonly used in examples demonstrating\n outlier detection.\n\n Returns\n -------\n out: Array<number>\n Observations.\n\n Examples\n --------\n > var d = HERNDON_VENUS_SEMIDIAMETERS()\n [ -0.30, -0.44, ..., 0.39, 0.10 ]\n\n References\n ----------\n - Chauvenet, William. 1868. _A Manual of Spherical and Practical Astronomy_.\n 5th ed. Vol. 5. London, England: Trübner & Co.\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n - Tietjen, Gary L., and Roger H. Moore. 1972. \"Some Grubbs-Type Statistics\n for the Detection of Several Outliers.\" _Technometrics_ 14 (3). Taylor &\n Francis: 583–97. doi:10.1080/00401706.1972.10488948.\n\n",
"homedir": "\nhomedir()\n Returns the current user's home directory.\n\n If unable to locate a home directory, the function returns `null`.\n\n Returns\n -------\n out: string|null\n Home directory.\n\n Examples\n --------\n > var home = homedir()\n e.g., '/Users/<username>'\n\n See Also\n --------\n configdir, tmpdir\n",
"HOURS_IN_DAY": "\nHOURS_IN_DAY\n Number of hours in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var hrs = days * HOURS_IN_DAY\n 75.36\n\n See Also\n --------\n HOURS_IN_WEEK\n",
"HOURS_IN_WEEK": "\nHOURS_IN_WEEK\n Number of hours in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var hrs = wks * HOURS_IN_WEEK\n 527.52\n\n See Also\n --------\n HOURS_IN_DAY\n",
"hoursInMonth": "\nhoursInMonth( [month[, year]] )\n Returns the number of hours in a month.\n\n By default, the function returns the number of hours in the current month of\n the current year (according to local time). To determine the number of hours\n for a particular month and year, provide `month` and `year` arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Hours in a month.\n\n Examples\n --------\n > var num = hoursInMonth()\n <number>\n > num = hoursInMonth( 2 )\n <number>\n > num = hoursInMonth( 2, 2016 )\n 696\n > num = hoursInMonth( 2, 2017 )\n 672\n\n // Other ways to supply month:\n > num = hoursInMonth( 'feb', 2016 )\n 696\n > num = hoursInMonth( 'february', 2016 )\n 696\n\n See Also\n --------\n hoursInYear\n",
"hoursInYear": "\nhoursInYear( [value] )\n Returns the number of hours in a year according to the Gregorian calendar.\n\n By default, the function returns the number of hours in the current year\n (according to local time). To determine the number of hours for a particular\n year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of hours in a year.\n\n Examples\n --------\n > var num = hoursInYear()\n <number>\n > num = hoursInYear( 2016 )\n 8784\n > num = hoursInYear( 2017 )\n 8760\n\n See Also\n --------\n hoursInMonth\n",
"httpServer": "\nhttpServer( [options,] [requestListener] )\n Returns a function to create an HTTP server.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.port: integer (optional)\n Server port. Default: `0` (i.e., randomly assigned).\n\n options.maxport: integer (optional)\n Max server port when port hunting. Default: `maxport = port`.\n\n options.hostname: string (optional)\n Server hostname.\n\n options.address: string (optional)\n Server address. Default: `'127.0.0.1'`.\n\n requestListener: Function (optional)\n Request callback.\n\n Returns\n -------\n createServer: Function\n Function to create an HTTP server.\n\n Examples\n --------\n // Basic usage:\n > var createServer = httpServer()\n <Function>\n\n // Provide a request callback:\n > function onRequest( request, response ) {\n ... console.log( request.url );\n ... response.end( 'OK' );\n ... };\n > createServer = httpServer( onRequest )\n <Function>\n\n // Specify a specific port:\n > var opts = { 'port': 7331 };\n > createServer = httpServer( opts )\n <Function>\n\n\ncreateServer( done )\n Creates an HTTP server.\n\n Parameters\n ----------\n done: Function\n Callback to invoke after creating a server.\n\n Examples\n --------\n > function done( error, server ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( 'Success!' );\n ... server.close();\n ... };\n > var createServer = httpServer();\n > createServer( done );\n\n",
"identity": "\nidentity( x )\n Identity function.\n\n Parameters\n ----------\n x: any\n Input value.\n\n Returns\n -------\n out: any\n Input value.\n\n Examples\n --------\n > var v = identity( 3.14 )\n 3.14\n\n See Also\n --------\n constantFunction\n",
"ifelse": "\nifelse( bool, x, y )\n If a condition is truthy, returns `x`; otherwise, returns `y`.\n\n Parameters\n ----------\n bool: boolean\n Condition.\n\n x: any\n Value to return if a condition is truthy.\n\n y: any\n Value to return if a condition is falsy.\n\n Returns\n -------\n z: any\n Either `x` or `y`.\n\n Examples\n --------\n > var z = ifelse( true, 1.0, -1.0 )\n 1.0\n > z = ifelse( false, 1.0, -1.0 )\n -1.0\n\n See Also\n --------\n ifelseAsync, ifthen\n",
"ifelseAsync": "\nifelseAsync( predicate, x, y, done )\n If a predicate function returns a truthy value, returns `x`; otherwise,\n returns `y`.\n\n A predicate function is provided a single argument:\n\n - clbk: callback to invoke upon predicate completion\n\n The callback function accepts two arguments:\n\n - error: error object\n - bool: condition used to determine whether to invoke `x` or `y`\n\n The `done` callback is invoked upon function completion and is provided at\n most two arguments:\n\n - error: error object\n - result: either `x` or `y`\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n Predicate function.\n\n x: any\n Value to return if a condition is truthy.\n\n y: any\n Value to return if a condition is falsy.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function predicate( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, true );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > ifelseAsync( predicate, 'beep', 'boop', done )\n 'beep'\n\n See Also\n --------\n ifelse, ifthenAsync\n",
"ifthen": "\nifthen( bool, x, y )\n If a condition is truthy, invoke `x`; otherwise, invoke `y`.\n\n Parameters\n ----------\n bool: boolean\n Condition.\n\n x: Function\n Function to invoke if a condition is truthy.\n\n y: Function\n Function to invoke if a condition is falsy.\n\n Returns\n -------\n z: any\n Return value of either `x` or `y`.\n\n Examples\n --------\n > function x() { return 1.0; };\n > function y() { return -1.0; };\n > var z = ifthen( true, x, y )\n 1.0\n > z = ifthen( false, x, y )\n -1.0\n\n See Also\n --------\n ifelse, ifthenAsync\n",
"ifthenAsync": "\nifthenAsync( predicate, x, y, done )\n If a predicate function returns a truthy value, invokes `x`; otherwise,\n invokes `y`.\n\n The predicate function is provided a single argument:\n\n - clbk: callback to invoke upon predicate function completion\n\n The predicate function callback accepts two arguments:\n\n - error: error object\n - bool: condition used to determine whether to invoke `x` or `y`\n\n Both `x` and `y` are provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the `done` callback is invoked with its\n first argument as `null` and all other provided arguments.\n\n If the error argument is truthy, the `done` callback is invoked with only an\n error argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n Predicate function.\n\n x: Function\n Function to invoke if a condition is truthy.\n\n y: Function\n Function to invoke if a condition is falsy.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function predicate( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, false );\n ... }\n ... };\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'beep' );\n ... }\n ... };\n > function y( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'boop' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > ifthenAsync( predicate, x, y, done )\n 'boop'\n\n See Also\n --------\n ifelseAsync, ifthen\n",
"imag": "\nimag( z )\n Returns the imaginary component of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n im: number\n Imaginary component.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var im = imag( z )\n 3.0\n\n See Also\n --------\n real, reim\n",
"IMG_ACANTHUS_MOLLIS": "\nIMG_ACANTHUS_MOLLIS()\n Returns a `Buffer` containing image data of Karl Blossfeldt's gelatin silver\n print *Acanthus mollis*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_ACANTHUS_MOLLIS()\n <Buffer>\n\n References\n ----------\n - Blossfeldt, Karl. 1928. *Acanthus mollis*. <http://www.getty.edu/art/\n collection/objects/35443/karl-blossfeldt-acanthus-mollis-german-1928/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_ALLIUM_OREOPHILUM\n",
"IMG_AIRPLANE_FROM_ABOVE": "\nIMG_AIRPLANE_FROM_ABOVE()\n Returns a `Buffer` containing image data of Fédèle Azari's gelatin silver\n print of an airplane, viewed from above looking down.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_AIRPLANE_FROM_ABOVE()\n <Buffer>\n\n References\n ----------\n - Azari, Fédèle. 1929. (no title). <http://www.getty.edu/art/collection/\n objects/134512/fedele-azari-airplane-viewed-from-above-looking-down-italian-\n 1914-1929/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_ALLIUM_OREOPHILUM": "\nIMG_ALLIUM_OREOPHILUM()\n Returns a `Buffer` containing image data of Karl Blossfeldt's gelatin silver\n print *Allium ostrowskianum*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_ALLIUM_OREOPHILUM()\n <Buffer>\n\n References\n ----------\n - Blossfeldt, Karl. 1928. *Allium ostrowskianum*. <http://www.getty.edu/art/\n collection/objects/35448/karl-blossfeldt-allium-ostrowskianum-\n knoblauchpflanze-german-1928/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_ACANTHUS_MOLLIS\n",
"IMG_BLACK_CANYON": "\nIMG_BLACK_CANYON()\n Returns a `Buffer` containing image data of Timothy H. O'Sullivan's albumen\n silver print *Black Cañon, Colorado River, From Camp 8, Looking Above*.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_BLACK_CANYON()\n <Buffer>\n\n References\n ----------\n - O'Sullivan, Timothy H. 1871. *Black Cañon, Colorado River, From Camp 8,\n Looking Above*. <http://www.getty.edu/art/collection/objects/40209/timothy-\n h-o'sullivan-black-canon-colorado-river-from-camp-8-looking-above-american-\n 1871/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_DUST_BOWL_HOME": "\nIMG_DUST_BOWL_HOME()\n Returns a `Buffer` containing image data of Dorothea Lange's gelatin silver\n print of an abandoned Dust Bowl home.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_DUST_BOWL_HOME()\n <Buffer>\n\n References\n ----------\n - Lange, Dorothea. 1940. *Abandoned Dust Bowl Home*. <http://www.getty.edu/\n art/collection/objects/128362/dorothea-lange-abandoned-dust-bowl-home-\n american-about-1935-1940/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_FRENCH_ALPINE_LANDSCAPE": "\nIMG_FRENCH_ALPINE_LANDSCAPE()\n Returns a `Buffer` containing image data of Adolphe Braun's carbon print of\n a French alpine landscape.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_FRENCH_ALPINE_LANDSCAPE()\n <Buffer>\n\n References\n ----------\n - Braun, Adolphe. 1870. (no title). <http://www.getty.edu/art/collection/\n objects/54324/adolphe-braun-alpine-landscape-french-1865-1870/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_LOCOMOTION_HOUSE_CAT": "\nIMG_LOCOMOTION_HOUSE_CAT()\n Returns a `Buffer` containing image data of Eadweard J. Muybridge's\n collotype of a house cat (24 views).\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_LOCOMOTION_HOUSE_CAT()\n <Buffer>\n\n References\n ----------\n - Muybridge, Eadweard J. 1887. *Animal Locomotion*. <http://www.getty.edu/\n art/collection/objects/40918/eadweard-j-muybridge-animal-locomotion-american\n -1887/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_LOCOMOTION_NUDE_MALE\n",
"IMG_LOCOMOTION_NUDE_MALE": "\nIMG_LOCOMOTION_NUDE_MALE()\n Returns a `Buffer` containing image data of Eadweard J. Muybridge's\n collotype of a nude male moving in place (48 views).\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_LOCOMOTION_NUDE_MALE()\n <Buffer>\n\n References\n ----------\n - Muybridge, Eadweard J. 1887. *Animal Locomotion*. <http://www.getty.edu/\n art/collection/objects/40918/eadweard-j-muybridge-animal-locomotion-american\n -1887/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n See Also\n --------\n IMG_LOCOMOTION_HOUSE_CAT\n",
"IMG_MARCH_PASTORAL": "\nIMG_MARCH_PASTORAL()\n Returns a `Buffer` containing image data of Peter Henry Emerson's\n photogravure of sheep in a pastoral setting.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_MARCH_PASTORAL()\n <Buffer>\n\n References\n ----------\n - Emerson, Peter Henry. 1888. *A March Pastoral*. <http://www.getty.edu/art/\n collection/objects/141994/peter-henry-emerson-a-march-pastoral-suffolk-\n british-1888/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"IMG_NAGASAKI_BOATS": "\nIMG_NAGASAKI_BOATS()\n Returns a `Buffer` containing image data of Felice Beato's albumen silver\n print of boats in a river in Nagasaki.\n\n Returns\n -------\n out: Buffer\n Image data.\n\n Examples\n --------\n > var img = IMG_NAGASAKI_BOATS()\n <Buffer>\n\n References\n ----------\n - Beato, Felice. 1865. (no title). <http://www.getty.edu/art/collection/\n objects/241797/felice-beato-boats-in-river-nagasaki-british-about-1865/>.\n\n * Digital image courtesy of the Getty's Open Content Program. While there\n are no restrictions or conditions on the use of open content images, the\n Getty would appreciate a gratis copy of any scholarly publications in which\n the images are reproduced in order to maintain the collection bibliography.\n Copies may be sent to the attention of:\n\n Open Content Program\n Registrar's Office\n The J. Paul Getty Museum\n 1200 Getty Center Drive, Suite 1000\n Los Angeles, CA 90049\n\n",
"incrapcorr": "\nincrapcorr( [mx, my] )\n Returns an accumulator function which incrementally computes the absolute\n value of the sample Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated accumulated\n value. If not provided values, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrapcorr();\n > var ar = accumulator()\n null\n > ar = accumulator( 2.0, 1.0 )\n 0.0\n > ar = accumulator( -5.0, 3.14 )\n ~1.0\n > ar = accumulator()\n ~1.0\n\n See Also\n --------\n incrmapcorr, incrpcorr, incrpcorr2\n",
"incrcount": "\nincrcount()\n Returns an accumulator function which incrementally updates a count.\n\n If provided a value, the accumulator function returns an updated count. If\n not provided a value, the accumulator function returns the current count.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcount();\n > var v = accumulator()\n 0\n > v = accumulator( 2.0 )\n 1\n > v = accumulator( -5.0 )\n 2\n > v = accumulator()\n 2\n\n See Also\n --------\n incrmean, incrsum, incrsummary\n",
"incrcovariance": "\nincrcovariance( [mx, my] )\n Returns an accumulator function which incrementally computes an unbiased\n sample covariance.\n\n If provided values, the accumulator function returns an updated unbiased\n sample covariance. If not provided values, the accumulator function returns\n the current unbiased sample covariance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcovariance();\n > var v = accumulator()\n null\n > v = accumulator( 2.0, 1.0 )\n 0.0\n > v = accumulator( -5.0, 3.14 )\n ~-7.49\n > v = accumulator()\n ~-7.49\n\n See Also\n --------\n incrmcovariance, incrpcorr, incrvariance\n",
"incrcovmat": "\nincrcovmat( out[, means] )\n Returns an accumulator function which incrementally computes an unbiased\n sample covariance matrix.\n\n If provided a data vector, the accumulator function returns an updated\n unbiased sample covariance matrix. If not provided a data vector, the\n accumulator function returns the current unbiased sample covariance matrix.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the covariance matrix or a square 2-dimensional ndarray for\n storing the covariance matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcovmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrcovariance, incrpcorrmat\n",
"incrcv": "\nincrcv( [mean] )\n Returns an accumulator function which incrementally computes the coefficient\n of variation (CV).\n\n If provided a value, the accumulator function returns an updated accumulated\n value. If not provided a value, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrcv();\n > var cv = accumulator()\n null\n > cv = accumulator( 2.0 )\n 0.0\n > cv = accumulator( 1.0 )\n ~0.47\n > cv = accumulator()\n ~0.47\n\n See Also\n --------\n incrmean, incrmcv, incrstdev, incrvmr\n",
"increwmean": "\nincrewmean( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted mean, where α is a smoothing factor between 0 and 1.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwmean( 0.5 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( -5.0 )\n -1.5\n > v = accumulator()\n -1.5\n\n See Also\n --------\n increwvariance, incrmean, incrmmean\n",
"increwstdev": "\nincrewstdev( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted standard deviation, where α is a smoothing factor\n between 0 and 1.\n\n If provided a value, the accumulator function returns an updated standard\n deviation. If not provided a value, the accumulator function returns the\n current standard deviation.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwstdev( 0.5 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n 3.5\n > s = accumulator()\n 3.5\n\n See Also\n --------\n increwvariance, incrmstdev, incrstdev\n",
"increwvariance": "\nincrewvariance( α )\n Returns an accumulator function which incrementally computes an\n exponentially weighted variance, where α is a smoothing factor between 0 and\n 1.\n\n If provided a value, the accumulator function returns an updated variance.\n If not provided a value, the accumulator function returns the current\n variance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n α: number\n Smoothing factor (value between 0 and 1).\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = increwvariance( 0.5 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 0.0\n > v = accumulator( -5.0 )\n 12.25\n > v = accumulator()\n 12.25\n\n See Also\n --------\n increwmean, increwstdev, incrvariance, incrmvariance\n",
"incrgmean": "\nincrgmean()\n Returns an accumulator function which incrementally computes a geometric\n mean.\n\n If provided a value, the accumulator function returns an updated geometric\n mean. If not provided a value, the accumulator function returns the current\n geometric mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n If provided a negative value, the accumulated value is `NaN` for all future\n invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrgmean();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~3.16\n > v = accumulator()\n ~3.16\n\n See Also\n --------\n incrhmean, incrmean, incrmgmean, incrsummary\n",
"incrgrubbs": "\nincrgrubbs( [options] )\n Returns an accumulator function which incrementally performs Grubbs' test\n for detecting outliers.\n\n Grubbs' test assumes that data is normally distributed. Accordingly, one\n should first verify that the data can be reasonably approximated by a normal\n distribution before applying the Grubbs' test.\n\n If provided a value, the accumulator function returns updated test results.\n If not provided a value, the accumulator function returns the current test\n results.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the test statistic is `NaN` for all future invocations.\n\n The accumulator must be provided *at least* three data points before\n performing Grubbs' test. Until at least three data points are provided, the\n accumulator returns `null`.\n\n The accumulator function returns an object having the following fields:\n\n - rejected: boolean indicating whether the null hypothesis should be\n rejected.\n - alpha: significance level.\n - criticalValue: critical value.\n - statistic: test statistic.\n - df: degrees of freedom.\n - mean: sample mean.\n - sd: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - alt: alternative hypothesis.\n - method: method name.\n - print: method for pretty-printing test output.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Significance level. Default: 0.05.\n\n options.alternative: string (optional)\n Alternative hypothesis. The option may be one of the following values:\n\n - 'two-sided': test whether the minimum or maximum value is an outlier.\n - 'min': test whether the minimum value is an outlier.\n - 'max': test whether the maximum value is an outlier.\n\n Default: 'two-sided'.\n\n options.init: integer (optional)\n Number of data points the accumulator should use to compute initial\n statistics *before* testing for an outlier. Until the accumulator is\n provided the number of data points specified by this option, the\n accumulator returns `null`. Default: 100.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var acc = incrgrubbs();\n > var res = acc()\n null\n > for ( var i = 0; i < 200; i++ ) {\n ... res = acc( base.random.normal( 10.0, 5.0 ) );\n ... };\n > res.print()\n\n References\n ----------\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n\n See Also\n --------\n incrmgrubbs\n",
"incrhmean": "\nincrhmean()\n Returns an accumulator function which incrementally computes a harmonic\n mean.\n\n If provided a value, the accumulator function returns an updated harmonic\n mean. If not provided a value, the accumulator function returns the current\n harmonic mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrhmean();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~2.86\n > v = accumulator()\n ~2.86\n\n See Also\n --------\n incrgmean, incrmean, incrmhmean, incrsummary\n",
"incrkmeans": "\nincrkmeans( k[, ndims][, options] )\n Returns an accumulator function which incrementally partitions data into `k`\n clusters.\n\n If not provided initial centroids, the accumulator caches data vectors for\n subsequent centroid initialization. Until an accumulator computes initial\n centroids, an accumulator returns `null`.\n\n Once an accumulator has initial centroids (either provided or computed), if\n provided a data vector, the accumulator function returns updated cluster\n results. If not provided a data vector, the accumulator function returns the\n current cluster results.\n\n Cluster results are comprised of the following:\n\n - centroids: a `k x ndims` matrix containing centroid locations. Each\n centroid is the component-wise mean of the data points assigned to a\n centroid's corresponding cluster.\n - stats: a `k x 4` matrix containing cluster statistics.\n\n Cluster statistics consists of the following columns:\n\n - 0: number of data points assigned to a cluster.\n - 1: total within-cluster sum of squared distances.\n - 2: arithmetic mean of squared distances.\n - 3: corrected sample standard deviation of squared distances.\n\n Because an accumulator incrementally partitions data, one should *not*\n expect cluster statistics to match similar statistics had provided data been\n analyzed via a batch algorithm. In an incremental context, data points which\n would not be considered part of a particular cluster when analyzed via a\n batch algorithm may contribute to that cluster's statistics when analyzed\n incrementally.\n\n In general, the more data provided to an accumulator, the more reliable the\n cluster statistics.\n\n Parameters\n ----------\n k: integer|ndarray\n Number of clusters or a `k x ndims` matrix containing initial centroids.\n\n ndims: integer (optional)\n Number of dimensions. This argument must accompany an integer-valued\n first argument.\n\n options: Object (optional)\n Function options.\n\n options.metric: string (optional)\n Distance metric. Must be one of the following: 'euclidean', 'cosine', or\n 'correlation'. Default: 'euclidean'.\n\n options.init: ArrayLike (optional)\n Centroid initialization method and associated (optional) parameters. The\n first array element specifies the initialization method and must be one\n of the following: 'kmeans++', 'sample', or 'forgy'. The second array\n element specifies the number of data points to use when calculating\n initial centroids. When performing kmeans++ initialization, the third\n array element specifies the number of trials to perform when randomly\n selecting candidate centroids. Typically, more trials is correlated with\n initial centroids which lead to better clustering; however, a greater\n number of trials increases computational overhead. Default: ['kmeans++',\n k, 2+⌊ln(k)⌋ ].\n\n options.normalize: boolean (optional)\n Boolean indicating whether to normalize incoming data. This option is\n only relevant for non-Euclidean distance metrics. If set to `true`, an\n accumulator partitioning data based on cosine distance normalizes\n provided data to unit Euclidean length. If set to `true`, an accumulator\n partitioning data based on correlation distance first centers provided\n data and then normalizes data dimensions to have zero mean and unit\n variance. If this option is set to `false` and the metric is either\n cosine or correlation distance, then incoming data *must* already be\n normalized. Default: true.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy incoming data to prevent mutation\n during normalization. Default: true.\n\n options.seed: any (optional)\n PRNG seed. Setting this option is useful when wanting reproducible\n initial centroids.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n acc.predict: Function\n Predicts centroid assignment for each data point in a provided matrix.\n To specify an output vector, provide a 1-dimensional ndarray as the\n first argument. Each element in the returned vector corresponds to a\n predicted cluster index for a respective data point.\n\n Examples\n --------\n > var accumulator = incrkmeans( 5, 2 );\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v );\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v );\n\n",
"incrkurtosis": "\nincrkurtosis()\n Returns an accumulator function which incrementally computes a corrected\n sample excess kurtosis.\n\n If provided a value, the accumulator function returns an updated corrected\n sample excess kurtosis. If not provided a value, the accumulator function\n returns the current corrected sample excess kurtosis.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrkurtosis();\n > var v = accumulator( 2.0 )\n null\n > v = accumulator( 2.0 )\n null\n > v = accumulator( -4.0 )\n null\n > v = accumulator( -4.0 )\n -6.0\n\n See Also\n --------\n incrmean, incrskewness, incrstdev, incrsummary, incrvariance\n",
"incrmaape": "\nincrmaape()\n Returns an accumulator function which incrementally computes the mean\n arctangent absolute percentage error (MAAPE).\n\n If provided input values, the accumulator function returns an updated mean\n arctangent absolute percentage error. If not provided input values, the\n accumulator function returns the current mean arctangent absolute percentage\n error.\n\n Note that, unlike the mean absolute percentage error (MAPE), the mean\n arctangent absolute percentage error is expressed in radians on the interval\n [0,π/2].\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmaape();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~0.3218\n > m = accumulator( 5.0, 2.0 )\n ~0.6523\n > m = accumulator()\n ~0.6523\n\n See Also\n --------\n incrmae, incrmape, incrmean, incrmmaape\n",
"incrmae": "\nincrmae()\n Returns an accumulator function which incrementally computes the mean\n absolute error (MAE).\n\n If provided input values, the accumulator function returns an updated mean\n absolute error. If not provided input values, the accumulator function\n returns the current mean absolute error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmae();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator()\n 4.0\n\n See Also\n --------\n incrmape, incrme, incrmean, incrmmae\n",
"incrmapcorr": "\nincrmapcorr( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample absolute Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample absolute correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n sample absolute correlation coefficient. If not provided values, the\n accumulator function returns the current moving sample absolute correlation\n coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmapcorr( 3 );\n > var ar = accumulator()\n null\n > ar = accumulator( 2.0, 1.0 )\n 0.0\n > ar = accumulator( -5.0, 3.14 )\n ~1.0\n > ar = accumulator( 3.0, -1.0 )\n ~0.925\n > ar = accumulator( 5.0, -9.5 )\n ~0.863\n > ar = accumulator()\n ~0.863\n\n See Also\n --------\n incrapcorr, incrmpcorr, incrmpcorr2\n",
"incrmape": "\nincrmape()\n Returns an accumulator function which incrementally computes the mean\n absolute percentage error (MAPE).\n\n If provided input values, the accumulator function returns an updated mean\n absolute percentage error. If not provided input values, the accumulator\n function returns the current mean absolute percentage error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmape();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~91.67\n > m = accumulator()\n ~91.67\n\n See Also\n --------\n incrmaape, incrmae, incrmean, incrmmape\n",
"incrmax": "\nincrmax()\n Returns an accumulator function which incrementally computes a maximum\n value.\n\n If provided a value, the accumulator function returns an updated maximum\n value. If not provided a value, the accumulator function returns the current\n maximum value.\n\n If provided `NaN`, the maximum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmax();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 3.14\n > m = accumulator( 10.1 )\n 10.1\n > m = accumulator()\n 10.1\n\n See Also\n --------\n incrmidrange, incrmin, incrmmax, incrrange, incrsummary\n",
"incrmaxabs": "\nincrmaxabs()\n Returns an accumulator function which incrementally computes a maximum\n absolute value.\n\n If provided a value, the accumulator function returns an updated maximum\n absolute value. If not provided a value, the accumulator function returns\n the current maximum absolute value.\n\n If provided `NaN`, the maximum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmaxabs();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 5.0\n > m = accumulator( 10.1 )\n 10.1\n > m = accumulator()\n 10.1\n\n See Also\n --------\n incrmax, incrminabs, incrmmaxabs\n",
"incrmcovariance": "\nincrmcovariance( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n unbiased sample covariance.\n\n The `W` parameter defines the number of values over which to compute the\n moving unbiased sample covariance.\n\n If provided values, the accumulator function returns an updated moving\n unbiased sample covariance. If not provided values, the accumulator function\n returns the current moving unbiased sample covariance.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmcovariance( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0, 1.0 )\n 0.0\n > v = accumulator( -5.0, 3.14 )\n ~-7.49\n > v = accumulator( 3.0, -1.0 )\n -8.35\n > v = accumulator( 5.0, -9.5 )\n -29.42\n > v = accumulator()\n -29.42\n\n See Also\n --------\n incrcovariance, incrmpcorr, incrmvariance\n",
"incrmcv": "\nincrmcv( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n coefficient of variation (CV).\n\n The `W` parameter defines the number of values over which to compute the\n moving coefficient of variation.\n\n If provided a value, the accumulator function returns an updated moving\n coefficient of variation. If not provided a value, the accumulator function\n returns the current moving coefficient of variation.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmcv( 3 );\n > var cv = accumulator()\n null\n > cv = accumulator( 2.0 )\n 0.0\n > cv = accumulator( 1.0 )\n ~0.47\n > cv = accumulator( 3.0 )\n 0.5\n > cv = accumulator( 7.0 )\n ~0.83\n > cv = accumulator()\n ~0.83\n\n See Also\n --------\n incrcv, incrmmean, incrmstdev, incrmvmr\n",
"incrmda": "\nincrmda()\n Returns an accumulator function which incrementally computes the mean\n directional accuracy (MDA).\n\n If provided input values, the accumulator function returns an updated mean\n directional accuracy. If not provided input values, the accumulator function\n returns the current mean directional accuracy.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmda();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 4.0 )\n 0.5\n > m = accumulator()\n 0.5\n\n See Also\n --------\n incrmape, incrmmda\n",
"incrme": "\nincrme()\n Returns an accumulator function which incrementally computes the mean error\n (ME).\n\n If provided input values, the accumulator function returns an updated mean\n error. If not provided input values, the accumulator function returns the\n current mean error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrme();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator()\n 4.0\n\n See Also\n --------\n incrmae, incrmean, incrmme\n",
"incrmean": "\nincrmean()\n Returns an accumulator function which incrementally computes an arithmetic\n mean.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmean();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n -1.5\n > mu = accumulator()\n -1.5\n\n See Also\n --------\n incrmidrange, incrmmean, incrstdev, incrsum, incrsummary, incrvariance\n",
"incrmeanabs": "\nincrmeanabs()\n Returns an accumulator function which incrementally computes an arithmetic\n mean of absolute values.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanabs();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n 3.5\n > mu = accumulator()\n 3.5\n\n See Also\n --------\n incrmean, incrmmeanabs, incrsumabs\n",
"incrmeanabs2": "\nincrmeanabs2()\n Returns an accumulator function which incrementally computes an arithmetic\n mean of squared absolute values.\n\n If provided a value, the accumulator function returns an updated mean. If\n not provided a value, the accumulator function returns the current mean.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanabs2();\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 4.0\n > mu = accumulator( -5.0 )\n 14.5\n > mu = accumulator()\n 14.5\n\n See Also\n --------\n incrmean, incrmeanabs, incrmmeanabs2, incrsumabs2\n",
"incrmeanstdev": "\nincrmeanstdev( [out] )\n Returns an accumulator function which incrementally computes an arithmetic\n mean and corrected sample standard deviation.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current accumulated values.\n\n If provided `NaN`, the accumulated values are equal to `NaN` for all future\n invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanstdev();\n > var ms = accumulator()\n null\n > ms = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > ms = accumulator( -5.0 )\n [ -1.5, ~4.95 ]\n > ms = accumulator( 3.0 )\n [ 0.0, ~4.36 ]\n > ms = accumulator( 5.0 )\n [ 1.25, ~4.35 ]\n > ms = accumulator()\n [ 1.25, ~4.35 ]\n\n See Also\n --------\n incrmean, incrmeanvar, incrmmeanstdev, incrstdev\n",
"incrmeanvar": "\nincrmeanvar( [out] )\n Returns an accumulator function which incrementally computes an arithmetic\n mean and unbiased sample variance.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current accumulated values.\n\n If provided `NaN`, the accumulated values are equal to `NaN` for all future\n invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmeanvar();\n > var mv = accumulator()\n null\n > mv = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > mv = accumulator( -5.0 )\n [ -1.5, 24.5 ]\n > mv = accumulator( 3.0 )\n [ 0.0, 19.0 ]\n > mv = accumulator( 5.0 )\n [ 1.25, ~18.92 ]\n > mv = accumulator()\n [ 1.25, ~18.92 ]\n\n See Also\n --------\n incrmean, incrmeanstdev, incrmmeanvar, incrvariance\n",
"incrmgmean": "\nincrmgmean( W )\n Returns an accumulator function which incrementally computes a moving\n geometric mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving geometric mean.\n\n If provided a value, the accumulator function returns an updated moving\n geometric mean. If not provided a value, the accumulator function returns\n the current moving geometric mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmgmean( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~3.16\n > v = accumulator( 3.0 )\n ~3.11\n > v = accumulator( 5.0 )\n ~4.22\n > v = accumulator()\n ~4.22\n\n See Also\n --------\n incrgmean, incrmhmean, incrmmean\n",
"incrmgrubbs": "\nincrmgrubbs( W[, options] )\n Returns an accumulator function which incrementally performs a moving\n Grubbs' test for detecting outliers.\n\n Grubbs' test assumes that data is normally distributed. Accordingly, one\n should first verify that the data can be reasonably approximated by a normal\n distribution before applying the Grubbs' test.\n\n The `W` parameter defines the number of values over which to perform Grubbs'\n test. The minimum window size is 3.\n\n If provided a value, the accumulator function returns updated test results.\n If not provided a value, the accumulator function returns the current test\n results.\n\n Until provided `W` values, the accumulator function returns `null`.\n\n The accumulator function returns an object having the following fields:\n\n - rejected: boolean indicating whether the null hypothesis should be\n rejected.\n - alpha: significance level.\n - criticalValue: critical value.\n - statistic: test statistic.\n - df: degrees of freedom.\n - mean: sample mean.\n - sd: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - alt: alternative hypothesis.\n - method: method name.\n - print: method for pretty-printing test output.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Significance level. Default: 0.05.\n\n options.alternative: string (optional)\n Alternative hypothesis. The option may be one of the following values:\n\n - 'two-sided': test whether the minimum or maximum value is an outlier.\n - 'min': test whether the minimum value is an outlier.\n - 'max': test whether the maximum value is an outlier.\n\n Default: 'two-sided'.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var acc = incrmgrubbs( 20 );\n > var res = acc()\n null\n > for ( var i = 0; i < 200; i++ ) {\n ... res = acc( base.random.normal( 10.0, 5.0 ) );\n ... };\n > res.print()\n\n References\n ----------\n - Grubbs, Frank E. 1950. \"Sample Criteria for Testing Outlying\n Observations.\" _The Annals of Mathematical Statistics_ 21 (1). The Institute\n of Mathematical Statistics: 27–58. doi:10.1214/aoms/1177729885.\n - Grubbs, Frank E. 1969. \"Procedures for Detecting Outlying Observations in\n Samples.\" _Technometrics_ 11 (1). Taylor & Francis: 1–21. doi:10.1080/\n 00401706.1969.10490657.\n\n See Also\n --------\n incrgrubbs\n",
"incrmhmean": "\nincrmhmean( W )\n Returns an accumulator function which incrementally computes a moving\n harmonic mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving harmonic mean.\n\n If provided a value, the accumulator function returns an updated moving\n harmonic mean. If not provided a value, the accumulator function returns the\n current moving harmonic mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmhmean( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( 5.0 )\n ~2.86\n > v = accumulator( 3.0 )\n ~2.90\n > v = accumulator( 5.0 )\n ~4.09\n > v = accumulator()\n ~4.09\n\n See Also\n --------\n incrhmean, incrmgmean, incrmmean\n",
"incrmidrange": "\nincrmidrange()\n Returns an accumulator function which incrementally computes a mid-range.\n\n The mid-range is the arithmetic mean of maximum and minimum values.\n Accordingly, the mid-range is the midpoint of the range and a measure of\n central tendency.\n\n If provided a value, the accumulator function returns an updated mid-range.\n If not provided a value, the accumulator function returns the current mid-\n range.\n\n If provided `NaN`, the mid-range is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmidrange();\n > var v = accumulator()\n null\n > v = accumulator( 3.14 )\n 3.14\n > v = accumulator( -5.0 )\n ~-0.93\n > v = accumulator( 10.1 )\n 2.55\n > v = accumulator()\n 2.55\n\n See Also\n --------\n incrmean, incrmax, incrmin, incrrange, incrsummary\n",
"incrmin": "\nincrmin()\n Returns an accumulator function which incrementally computes a minimum\n value.\n\n If provided a value, the accumulator function returns an updated minimum\n value. If not provided a value, the accumulator function returns the current\n minimum value.\n\n If provided `NaN`, the minimum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmin();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n -5.0\n > m = accumulator( 10.1 )\n -5.0\n > m = accumulator()\n -5.0\n\n See Also\n --------\n incrmax, incrmidrange, incrmmin, incrrange, incrsummary\n",
"incrminabs": "\nincrminabs()\n Returns an accumulator function which incrementally computes a minimum\n absolute value.\n\n If provided a value, the accumulator function returns an updated minimum\n absolute value. If not provided a value, the accumulator function returns\n the current minimum absolute value.\n\n If provided `NaN`, the minimum value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminabs();\n > var m = accumulator()\n null\n > m = accumulator( 3.14 )\n 3.14\n > m = accumulator( -5.0 )\n 3.14\n > m = accumulator( 10.1 )\n 3.14\n > m = accumulator()\n 3.14\n\n See Also\n --------\n incrmaxabs, incrmin, incrmminabs\n",
"incrminmax": "\nincrminmax( [out] )\n Returns an accumulator function which incrementally computes a minimum and\n maximum.\n\n If provided a value, the accumulator function returns an updated minimum and\n maximum. If not provided a value, the accumulator function returns the\n current minimum and maximum.\n\n If provided `NaN`, the minimum and maximum values are equal to `NaN` for all\n future invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminmax();\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ -5.0, 2.0 ]\n > mm = accumulator( 3.0 )\n [ -5.0, 3.0 ]\n > mm = accumulator( 5.0 )\n [ -5.0, 5.0 ]\n > mm = accumulator()\n [ -5.0, 5.0 ]\n\n See Also\n --------\n incrmax, incrmin, incrmminmax, incrrange\n",
"incrminmaxabs": "\nincrminmaxabs( [out] )\n Returns an accumulator function which incrementally computes a minimum and\n maximum absolute value.\n\n If provided a value, the accumulator function returns an updated minimum and\n maximum. If not provided a value, the accumulator function returns the\n current minimum and maximum.\n\n If provided `NaN`, the minimum and maximum values are equal to `NaN` for all\n future invocations.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrminmaxabs();\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 3.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator()\n [ 2.0, 5.0 ]\n\n See Also\n --------\n incrmaxabs, incrminabs, incrminmax, incrmminmaxabs\n",
"incrmmaape": "\nincrmmaape( W )\n Returns an accumulator function which incrementally computes a moving\n mean arctangent absolute percentage error (MAAPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean arctangent absolute percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean arctangent absolute percentage error. If not provided input values, the\n accumulator function returns the current moving mean arctangent absolute\n percentage error.\n\n Note that, unlike the mean absolute percentage error (MAPE), the mean\n arctangent absolute percentage error is expressed in radians on the interval\n [0,π/2].\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmaape( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~0.32\n > m = accumulator( 5.0, 2.0 )\n ~0.65\n > m = accumulator( 3.0, 2.0 )\n ~0.59\n > m = accumulator( 2.0, 5.0 )\n ~0.66\n > m = accumulator()\n ~0.66\n\n See Also\n --------\n incrmaape, incrmmape, incrmmpe, incrmmean\n",
"incrmmae": "\nincrmmae( W )\n Returns an accumulator function which incrementally computes a moving\n mean absolute error (MAE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean absolute error.\n\n If provided a value, the accumulator function returns an updated moving\n mean absolute error. If not provided a value, the accumulator function\n returns the current moving mean absolute error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmae( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator( 3.0, 2.0 )\n 3.0\n > m = accumulator( 5.0, -2.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmae, incrmme, incrmmean\n",
"incrmmape": "\nincrmmape( W )\n Returns an accumulator function which incrementally computes a moving\n mean absolute percentage error (MAPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean absolute percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean absolute percentage error. If not provided input values, the\n accumulator function returns the current moving mean absolute percentage\n error.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmape( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~91.67\n > m = accumulator( 3.0, 2.0 )\n ~77.78\n > m = accumulator( 2.0, 5.0 )\n ~86.67\n > m = accumulator()\n ~86.67\n\n See Also\n --------\n incrmape, incrmmaape, incrmmpe, incrmmean\n",
"incrmmax": "\nincrmmax( W )\n Returns an accumulator function which incrementally computes a moving\n maximum value.\n\n The `W` parameter defines the number of values over which to compute the\n moving maximum.\n\n If provided a value, the accumulator function returns an updated moving\n maximum. If not provided a value, the accumulator function returns the\n current moving maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmax( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 2.0\n > m = accumulator( 3.0 )\n 3.0\n > m = accumulator( 5.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmax, incrmmidrange, incrmmin, incrmrange, incrmsummary\n",
"incrmmaxabs": "\nincrmmaxabs( W )\n Returns an accumulator function which incrementally computes a moving\n maximum absolute value.\n\n The `W` parameter defines the number of values over which to compute the\n moving maximum absolute value.\n\n If provided a value, the accumulator function returns an updated moving\n maximum absolute value. If not provided a value, the accumulator function\n returns the current moving maximum absolute value.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmaxabs( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 5.0\n > m = accumulator( 3.0 )\n 5.0\n > m = accumulator( 5.0 )\n 5.0\n > m = accumulator()\n 5.0\n\n See Also\n --------\n incrmaxabs, incrmmax, incrmminabs\n",
"incrmmda": "\nincrmmda( W )\n Returns an accumulator function which incrementally computes a moving\n mean directional accuracy (MDA).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean directional accuracy.\n\n If provided input values, the accumulator function returns an updated moving\n mean directional accuracy. If not provided input values, the accumulator\n function returns the current moving mean directional accuracy.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmda( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( 5.0, 2.0 )\n 0.5\n > m = accumulator( 3.0, 2.0 )\n ~0.33\n > m = accumulator( 4.0, 5.0 )\n ~0.33\n > m = accumulator()\n ~0.33\n\n See Also\n --------\n incrmda, incrmmape\n",
"incrmme": "\nincrmme( W )\n Returns an accumulator function which incrementally computes a moving\n mean error (ME).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean error.\n\n If provided a value, the accumulator function returns an updated moving\n mean error. If not provided a value, the accumulator function returns the\n current moving mean error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmme( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 4.0\n > m = accumulator( 3.0, 2.0 )\n ~2.33\n > m = accumulator( 5.0, -2.0 )\n ~-0.33\n > m = accumulator()\n ~-0.33\n\n See Also\n --------\n incrme, incrmmae, incrmmean\n",
"incrmmean": "\nincrmmean( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmean( 3 );\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n -1.5\n > mu = accumulator( 3.0 )\n 0.0\n > mu = accumulator( 5.0 )\n 1.0\n > mu = accumulator()\n 1.0\n\n See Also\n --------\n incrmean, incrmsum, incrmstdev, incrmsummary, incrmvariance\n",
"incrmmeanabs": "\nincrmmeanabs( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean of absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanabs( 3 );\n > var mu = accumulator()\n null\n > mu = accumulator( 2.0 )\n 2.0\n > mu = accumulator( -5.0 )\n 3.5\n > mu = accumulator( 3.0 )\n ~3.33\n > mu = accumulator( 5.0 )\n ~4.33\n > mu = accumulator()\n ~4.33\n\n See Also\n --------\n incrmeanabs, incrmmean, incrmsumabs\n",
"incrmmeanabs2": "\nincrmmeanabs2( W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean of squared absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving mean.\n\n If provided a value, the accumulator function returns an updated moving\n mean. If not provided a value, the accumulator function returns the current\n moving mean.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanabs2( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 4.0\n > m = accumulator( -5.0 )\n 14.5\n > m = accumulator( 3.0 )\n ~12.67\n > m = accumulator( 5.0 )\n ~19.67\n > m = accumulator()\n ~19.67\n\n See Also\n --------\n incrmeanabs2, incrmmeanabs, incrmsumabs2\n",
"incrmmeanstdev": "\nincrmmeanstdev( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean and corrected sample standard deviation.\n\n The `W` parameter defines the number of values over which to compute the\n moving arithmetic mean and corrected sample standard deviation.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current moving accumulated values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n accumulated values are calculated from smaller sample sizes. Until the\n window is full, each returned accumulated value is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanstdev( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > v = accumulator( -5.0 )\n [ -1.5, ~4.95 ]\n > v = accumulator( 3.0 )\n [ 0.0, ~4.36 ]\n > v = accumulator( 5.0 )\n [ 1.0, ~5.29 ]\n > v = accumulator()\n [ 1.0, ~5.29 ]\n\n See Also\n --------\n incrmeanstdev, incrmmean, incrmmeanvar, incrmstdev\n",
"incrmmeanvar": "\nincrmmeanvar( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n arithmetic mean and unbiased sample variance.\n\n The `W` parameter defines the number of values over which to compute the\n moving arithmetic mean and unbiased sample variance.\n\n If provided a value, the accumulator function returns updated accumulated\n values. If not provided a value, the accumulator function returns the\n current moving accumulated values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n accumulated values are calculated from smaller sample sizes. Until the\n window is full, each returned accumulated value is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmeanvar( 3 );\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n [ 2.0, 0.0 ]\n > v = accumulator( -5.0 )\n [ -1.5, 24.5 ]\n > v = accumulator( 3.0 )\n [ 0.0, 19.0 ]\n > v = accumulator( 5.0 )\n [ 1.0, 28.0 ]\n > v = accumulator()\n [ 1.0, 28.0 ]\n\n See Also\n --------\n incrmeanvar, incrmmean, incrmmeanstdev, incrmvariance\n",
"incrmmidrange": "\nincrmmidrange( W )\n Returns an accumulator function which incrementally computes a moving mid-\n range.\n\n The mid-range is the arithmetic mean of maximum and minimum values.\n Accordingly, the mid-range is the midpoint of the range and a measure of\n central tendency.\n\n The `W` parameter defines the number of values over which to compute\n the moving mid-range.\n\n If provided a value, the accumulator function returns an updated moving mid-\n range. If not provided a value, the accumulator function returns the current\n moving mid-range.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmidrange( 3 );\n > var mr = accumulator()\n null\n > mr = accumulator( 2.0 )\n 2.0\n > mr = accumulator( -5.0 )\n -1.5\n > mr = accumulator( 3.0 )\n -1.0\n > mr = accumulator( 5.0 )\n 0.0\n > mr = accumulator()\n 0.0\n\n See Also\n --------\n incrmmean, incrmmax, incrmmin, incrmrange\n",
"incrmmin": "\nincrmmin( W )\n Returns an accumulator function which incrementally computes a moving\n minimum value.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum.\n\n If provided a value, the accumulator function returns an updated moving\n minimum. If not provided a value, the accumulator function returns the\n current moving minimum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmin( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n -5.0\n > m = accumulator( 3.0 )\n -5.0\n > m = accumulator( 5.0 )\n -5.0\n > m = accumulator()\n -5.0\n\n See Also\n --------\n incrmin, incrmmax, incrmmidrange, incrmrange, incrmsummary\n",
"incrmminabs": "\nincrmminabs( W )\n Returns an accumulator function which incrementally computes a moving\n minimum absolute value.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum absolute value.\n\n If provided a value, the accumulator function returns an updated moving\n minimum absolute value. If not provided a value, the accumulator function\n returns the current moving minimum absolute value.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminabs( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0 )\n 2.0\n > m = accumulator( -5.0 )\n 2.0\n > m = accumulator( 3.0 )\n 2.0\n > m = accumulator( 5.0 )\n 3.0\n > m = accumulator()\n 3.0\n\n See Also\n --------\n incrminabs, incrmmaxabs, incrmmin\n",
"incrmminmax": "\nincrmminmax( [out,] W )\n Returns an accumulator function which incrementally computes a moving\n minimum and maximum.\n\n The `W` parameter defines the number of values over which to compute the\n moving minimum and maximum.\n\n If provided a value, the accumulator function returns an updated moving\n minimum and maximum. If not provided a value, the accumulator function\n returns the current moving minimum and maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n minimum and maximum values are calculated from smaller sample sizes. Until\n the window is full, each returned minimum and maximum is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminmax( 3 );\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ -5.0, 2.0 ]\n > mm = accumulator( 3.0 )\n [ -5.0, 3.0 ]\n > mm = accumulator( 5.0 )\n [ -5.0, 5.0 ]\n > mm = accumulator()\n [ -5.0, 5.0 ]\n\n See Also\n --------\n incrmax, incrmin, incrmmax, incrminmax, incrmmin, incrmrange\n",
"incrmminmaxabs": "\nincrmminmaxabs( [out,] W )\n Returns an accumulator function which incrementally computes moving minimum\n and maximum absolute values.\n\n The `W` parameter defines the number of values over which to compute moving\n minimum and maximum absolute values.\n\n If provided a value, the accumulator function returns an updated moving\n minimum and maximum. If not provided a value, the accumulator function\n returns the current moving minimum and maximum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n minimum and maximum values are calculated from smaller sample sizes. Until\n the window is full, each returned minimum and maximum is calculated from all\n provided values.\n\n Parameters\n ----------\n out: Array|TypedArray (optional)\n Output array.\n\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmminmaxabs( 3 );\n > var mm = accumulator()\n null\n > mm = accumulator( 2.0 )\n [ 2.0, 2.0 ]\n > mm = accumulator( -5.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 3.0 )\n [ 2.0, 5.0 ]\n > mm = accumulator( 5.0 )\n [ 3.0, 5.0 ]\n > mm = accumulator()\n [ 3.0, 5.0 ]\n\n See Also\n --------\n incrminmaxabs, incrmmax, incrmmaxabs, incrmmin, incrmminabs, incrmminmax\n",
"incrmmpe": "\nincrmmpe( W )\n Returns an accumulator function which incrementally computes a moving\n mean percentage error (MPE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean percentage error.\n\n If provided input values, the accumulator function returns an updated moving\n mean percentage error. If not provided input values, the accumulator\n function returns the current moving mean percentage error.\n\n As `W` (f,a) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmpe( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~-58.33\n > m = accumulator( 3.0, 2.0 )\n ~-55.56\n > m = accumulator( 2.0, 5.0 )\n ~-46.67\n > m = accumulator()\n ~-46.67\n\n See Also\n --------\n incrmmape, incrmme, incrmpe\n",
"incrmmse": "\nincrmmse( W )\n Returns an accumulator function which incrementally computes a moving mean\n squared error (MSE).\n\n The `W` parameter defines the number of values over which to compute the\n moving mean squared error.\n\n If provided a value, the accumulator function returns an updated moving mean\n squared error. If not provided a value, the accumulator function returns the\n current moving mean squared error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmmse( 3 );\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 25.0\n > m = accumulator( 3.0, 2.0 )\n 17.0\n > m = accumulator( 5.0, -2.0 )\n 33.0\n > m = accumulator()\n 33.0\n\n See Also\n --------\n incrmrmse, incrmrss, incrmse\n",
"incrmpcorr": "\nincrmpcorr( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n sample correlation coefficient. If not provided values, the accumulator\n function returns the current moving sample correlation coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorr( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 1.0 )\n 0.0\n > r = accumulator( -5.0, 3.14 )\n ~-1.0\n > r = accumulator( 3.0, -1.0 )\n ~-0.925\n > r = accumulator( 5.0, -9.5 )\n ~-0.863\n > r = accumulator()\n ~-0.863\n\n See Also\n --------\n incrmcovariance, incrmpcorrdist, incrpcorr\n",
"incrmpcorr2": "\nincrmpcorr2( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n squared sample Pearson product-moment correlation coefficient.\n\n The `W` parameter defines the number of values over which to compute the\n moving squared sample correlation coefficient.\n\n If provided values, the accumulator function returns an updated moving\n squared sample correlation coefficient. If not provided values, the\n accumulator function returns the current moving squared sample correlation\n coefficient.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorr2( 3 );\n > var r2 = accumulator()\n null\n > r2 = accumulator( 2.0, 1.0 )\n 0.0\n > r2 = accumulator( -5.0, 3.14 )\n ~1.0\n > r2 = accumulator( 3.0, -1.0 )\n ~0.86\n > r2 = accumulator( 5.0, -9.5 )\n ~0.74\n > r2 = accumulator()\n ~0.74\n\n See Also\n --------\n incrmapcorr, incrmpcorr, incrpcorr2\n",
"incrmpcorrdist": "\nincrmpcorrdist( W[, mx, my] )\n Returns an accumulator function which incrementally computes a moving\n sample Pearson product-moment correlation distance.\n\n The correlation distance is defined as one minus the Pearson product-moment\n correlation coefficient and, thus, resides on the interval [0,2].\n\n However, due to limitations inherent in representing numeric values using\n floating-point format (i.e., the inability to represent numeric values with\n infinite precision), the correlation distance between perfectly correlated\n random variables may *not* be `0` or `2`. In fact, the correlation distance\n is *not* guaranteed to be strictly on the interval [0,2]. Any computed\n distance should, however, be within floating-point roundoff error.\n\n The `W` parameter defines the number of values over which to compute the\n moving sample correlation distance.\n\n If provided values, the accumulator function returns an updated moving\n sample correlation distance. If not provided values, the accumulator\n function returns the current moving sample correlation distance.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpcorrdist( 3 );\n > var d = accumulator()\n null\n > d = accumulator( 2.0, 1.0 )\n 1.0\n > d = accumulator( -5.0, 3.14 )\n ~2.0\n > d = accumulator( 3.0, -1.0 )\n ~1.925\n > d = accumulator( 5.0, -9.5 )\n ~1.863\n > d = accumulator()\n ~1.863\n\n See Also\n --------\n incrmpcorr, incrpcorrdist\n",
"incrmpe": "\nincrmpe()\n Returns an accumulator function which incrementally computes the mean\n percentage error (MPE).\n\n If provided input values, the accumulator function returns an updated mean\n percentage error. If not provided input values, the accumulator function\n returns the current mean percentage error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmpe();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n ~33.33\n > m = accumulator( 5.0, 2.0 )\n ~-58.33\n > m = accumulator()\n ~-58.33\n\n See Also\n --------\n incrmape, incrme, incrmmpe\n",
"incrmprod": "\nincrmprod( W )\n Returns an accumulator function which incrementally computes a moving\n product.\n\n The `W` parameter defines the number of values over which to compute the\n moving product.\n\n If provided a value, the accumulator function returns an updated moving\n product. If not provided a value, the accumulator function returns the\n current moving product.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n For accumulations over large windows or accumulations of large numbers, care\n should be taken to prevent overflow. Note, however, that overflow/underflow\n may be transient, as the accumulator does not use a double-precision\n floating-point number to store an accumulated product. Instead, the\n accumulator splits an accumulated product into a normalized fraction and\n exponent and updates each component separately. Doing so guards against a\n loss in precision.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmprod( 3 );\n > var p = accumulator()\n null\n > p = accumulator( 2.0 )\n 2.0\n > p = accumulator( -5.0 )\n -10.0\n > p = accumulator( 3.0 )\n -30.0\n > p = accumulator( 5.0 )\n -75.0\n > p = accumulator()\n -75.0\n\n See Also\n --------\n incrmsum, incrprod\n",
"incrmrange": "\nincrmrange( W )\n Returns an accumulator function which incrementally computes a moving range.\n\n The `W` parameter defines the number of values over which to compute the\n moving range.\n\n If provided a value, the accumulator function returns an updated moving\n range. If not provided a value, the accumulator function returns the current\n moving range.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrange( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0 )\n 0.0\n > r = accumulator( -5.0 )\n 7.0\n > r = accumulator( 3.0 )\n 8.0\n > r = accumulator( 5.0 )\n 10.0\n > r = accumulator()\n 10.0\n\n See Also\n --------\n incrmmax, incrmmean, incrmmin, incrmsummary, incrrange\n",
"incrmrmse": "\nincrmrmse( W )\n Returns an accumulator function which incrementally computes a moving root\n mean squared error (RMSE).\n\n The `W` parameter defines the number of values over which to compute the\n moving root mean squared error.\n\n If provided a value, the accumulator function returns an updated moving root\n mean squared error. If not provided a value, the accumulator function\n returns the current moving root mean squared error.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrmse( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 5.0\n > r = accumulator( 3.0, 2.0 )\n ~4.12\n > r = accumulator( 5.0, -2.0 )\n ~5.74\n > r = accumulator()\n ~5.74\n\n See Also\n --------\n incrmmse, incrmrss, incrrmse\n",
"incrmrss": "\nincrmrss( W )\n Returns an accumulator function which incrementally computes a moving\n residual sum of squares (RSS).\n\n The `W` parameter defines the number of values over which to compute the\n moving residual sum of squares.\n\n If provided a value, the accumulator function returns an updated moving\n residual sum of squares. If not provided a value, the accumulator function\n returns the current moving residual sum of squares.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmrss( 3 );\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 50.0\n > r = accumulator( 3.0, 2.0 )\n 51.0\n > r = accumulator( 5.0, -2.0 )\n 99.0\n > r = accumulator()\n 99.0\n\n See Also\n --------\n incrrss, incrmmse, incrmrmse\n",
"incrmse": "\nincrmse()\n Returns an accumulator function which incrementally computes the mean\n squared error (MSE).\n\n If provided input values, the accumulator function returns an updated mean\n squared error. If not provided input values, the accumulator function\n returns the current mean squared error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmse();\n > var m = accumulator()\n null\n > m = accumulator( 2.0, 3.0 )\n 1.0\n > m = accumulator( -5.0, 2.0 )\n 25.0\n > m = accumulator()\n 25.0\n\n See Also\n --------\n incrmmse, incrrmse, incrrss\n",
"incrmstdev": "\nincrmstdev( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n corrected sample standard deviation.\n\n The `W` parameter defines the number of values over which to compute the\n moving corrected sample standard deviation.\n\n If provided a value, the accumulator function returns an updated moving\n corrected sample standard deviation. If not provided a value, the\n accumulator function returns the current moving corrected sample standard\n deviation.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmstdev( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n ~4.95\n > s = accumulator( 3.0 )\n ~4.36\n > s = accumulator( 5.0 )\n ~5.29\n > s = accumulator()\n ~5.29\n\n See Also\n --------\n incrmmean, incrmsummary, incrmvariance, incrstdev\n",
"incrmsum": "\nincrmsum( W )\n Returns an accumulator function which incrementally computes a moving sum.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsum( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n -3.0\n > s = accumulator( 3.0 )\n 0.0\n > s = accumulator( 5.0 )\n 3.0\n > s = accumulator()\n 3.0\n\n See Also\n --------\n incrmmean, incrmsummary, incrsum\n",
"incrmsumabs": "\nincrmsumabs( W )\n Returns an accumulator function which incrementally computes a moving sum of\n absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumabs( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n 7.0\n > s = accumulator( 3.0 )\n 10.0\n > s = accumulator( -5.0 )\n 13.0\n > s = accumulator()\n 13.0\n\n See Also\n --------\n incrmmeanabs, incrmsum, incrsum, incrsumabs\n",
"incrmsumabs2": "\nincrmsumabs2( W )\n Returns an accumulator function which incrementally computes a moving sum of\n squared absolute values.\n\n The `W` parameter defines the number of values over which to compute the\n moving sum.\n\n If provided a value, the accumulator function returns an updated moving sum.\n If not provided a value, the accumulator function returns the current moving\n sum.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumabs2( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 4.0\n > s = accumulator( -5.0 )\n 29.0\n > s = accumulator( 3.0 )\n 38.0\n > s = accumulator( -5.0 )\n 59.0\n > s = accumulator()\n 59.0\n\n See Also\n --------\n incrmmeanabs2, incrmsumabs, incrsumabs, incrsumabs2\n",
"incrmsummary": "\nincrmsummary( W )\n Returns an accumulator function which incrementally computes a moving\n statistical summary.\n\n The `W` parameter defines the number of values over which to compute the\n moving statistical summary.\n\n If provided a value, the accumulator function returns an updated moving\n statistical summary. If not provided a value, the accumulator function\n returns the current moving statistical summary.\n\n The returned summary is an object containing the following fields:\n\n - window: window size.\n - sum: sum.\n - mean: arithmetic mean.\n - variance: unbiased sample variance.\n - stdev: corrected sample standard deviation.\n - min: minimum value.\n - max: maximum value.\n - range: range.\n - midrange: arithmetic mean of the minimum and maximum values.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n summaries are calculated from smaller sample sizes. Until the window is\n full, each returned summary is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsummary( 3 );\n > var s = accumulator()\n {}\n > s = accumulator( 2.0 )\n {...}\n > s = accumulator( -5.0 )\n {...}\n > s = accumulator()\n {...}\n\n See Also\n --------\n incrmmean, incrmstdev, incrmsum, incrmvariance, incrsummary\n",
"incrmsumprod": "\nincrmsumprod( W )\n Returns an accumulator function which incrementally computes a moving sum of\n products.\n\n The `W` parameter defines the number of (x,y) pairs over which to compute\n the moving sum of products.\n\n If provided input values, the accumulator function returns an updated moving\n sum. If not provided input values, the accumulator function returns the\n current moving sum.\n\n As `W` (x,y) pairs are needed to fill the window buffer, the first `W-1`\n returned values are calculated from smaller sample sizes. Until the window\n is full, each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmsumprod( 3 );\n > var s = accumulator()\n null\n > s = accumulator( 2.0, 3.0 )\n 6.0\n > s = accumulator( -5.0, 2.0 )\n -4.0\n > s = accumulator( 3.0, -2.0 )\n -10.0\n > s = accumulator( 5.0, 3.0 )\n -1.0\n > s = accumulator()\n -1.0\n\n See Also\n --------\n incrmprod, incrmsum, incrsumprod\n",
"incrmvariance": "\nincrmvariance( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n unbiased sample variance.\n\n The `W` parameter defines the number of values over which to compute the\n moving unbiased sample variance.\n\n If provided a value, the accumulator function returns an updated moving\n unbiased sample variance. If not provided a value, the accumulator function\n returns the current moving unbiased sample variance.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmvariance( 3 );\n > var s2 = accumulator()\n null\n > s2 = accumulator( 2.0 )\n 0.0\n > s2 = accumulator( -5.0 )\n 24.5\n > s2 = accumulator( 3.0 )\n 19.0\n > s2 = accumulator( 5.0 )\n 28.0\n > s2 = accumulator()\n 28.0\n\n See Also\n --------\n incrmmean, incrmstdev, incrmsummary, incrvariance\n",
"incrmvmr": "\nincrmvmr( W[, mean] )\n Returns an accumulator function which incrementally computes a moving\n variance-to-mean (VMR).\n\n The `W` parameter defines the number of values over which to compute the\n moving variance-to-mean ratio.\n\n If provided a value, the accumulator function returns an updated moving\n variance-to-mean ratio. If not provided a value, the accumulator function\n returns the current moving variance-to-mean ratio.\n\n As `W` values are needed to fill the window buffer, the first `W-1` returned\n values are calculated from smaller sample sizes. Until the window is full,\n each returned value is calculated from all provided values.\n\n Parameters\n ----------\n W: integer\n Window size.\n\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrmvmr( 3 );\n > var F = accumulator()\n null\n > F = accumulator( 2.0 )\n 0.0\n > F = accumulator( 1.0 )\n ~0.33\n > F = accumulator( 3.0 )\n 0.5\n > F = accumulator( 7.0 )\n ~2.55\n > F = accumulator()\n ~2.55\n\n See Also\n --------\n incrmmean, incrmvariance, incrvmr\n",
"incrpcorr": "\nincrpcorr( [mx, my] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated sample\n correlation coefficient. If not provided values, the accumulator function\n returns the current sample correlation coefficient.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorr();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 1.0 )\n 0.0\n > r = accumulator( -5.0, 3.14 )\n ~-1.0\n > r = accumulator()\n ~-1.0\n\n See Also\n --------\n incrcovariance, incrmpcorr, incrsummary\n",
"incrpcorr2": "\nincrpcorr2( [mx, my] )\n Returns an accumulator function which incrementally computes the squared\n sample Pearson product-moment correlation coefficient.\n\n If provided values, the accumulator function returns an updated accumulated\n value. If not provided values, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorr2();\n > var r2 = accumulator()\n null\n > r2 = accumulator( 2.0, 1.0 )\n 0.0\n > r2 = accumulator( -5.0, 3.14 )\n ~1.0\n > r2 = accumulator()\n ~1.0\n\n See Also\n --------\n incrapcorr, incrmpcorr2, incrpcorr\n",
"incrpcorrdist": "\nincrpcorrdist( [mx, my] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation distance.\n\n The correlation distance is defined as one minus the Pearson product-moment\n correlation coefficient and, thus, resides on the interval [0,2].\n\n If provided values, the accumulator function returns an updated sample\n correlation distance. If not provided values, the accumulator function\n returns the current sample correlation distance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mx: number (optional)\n Known mean.\n\n my: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrdist();\n > var d = accumulator()\n null\n > d = accumulator( 2.0, 1.0 )\n 1.0\n > d = accumulator( -5.0, 3.14 )\n ~2.0\n > d = accumulator()\n ~2.0\n\n See Also\n --------\n incrcovariance, incrpcorr, incrsummary\n",
"incrpcorrdistmat": "\nincrpcorrdistmat( out[, means] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation distance matrix.\n\n If provided a data vector, the accumulator function returns an updated\n sample correlation distance matrix. If not provided a data vector, the\n accumulator function returns the current sample correlation distance matrix.\n\n Due to limitations inherent in representing numeric values using floating-\n point format (i.e., the inability to represent numeric values with infinite\n precision), the correlation distance between perfectly correlated random\n variables may *not* be `0` or `2`. In fact, the correlation distance is\n *not* guaranteed to be strictly on the interval [0,2]. Any computed distance\n should, however, be within floating-point roundoff error.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the correlation distance matrix or a square 2-dimensional\n ndarray for storing the correlation distance matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrdistmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrpcorrdist, incrpcorrmat\n",
"incrpcorrmat": "\nincrpcorrmat( out[, means] )\n Returns an accumulator function which incrementally computes a sample\n Pearson product-moment correlation matrix.\n\n If provided a data vector, the accumulator function returns an updated\n sample correlation matrix. If not provided a data vector, the accumulator\n function returns the current sample correlation matrix.\n\n Parameters\n ----------\n out: integer|ndarray\n Order of the correlation matrix or a square 2-dimensional ndarray for\n storing the correlation matrix.\n\n means: ndarray (optional)\n Known means.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrpcorrmat( 2 );\n > var out = accumulator()\n <ndarray>\n > var vec = ndarray( 'float64', 1 );\n > var buf = new Float64Array( 2 );\n > var shape = [ 2 ];\n > var strides = [ 1 ];\n > var v = vec( buf, shape, strides, 0, 'row-major' );\n > v.set( 0, 2.0 );\n > v.set( 1, 1.0 );\n > out = accumulator( v )\n <ndarray>\n > v.set( 0, -5.0 );\n > v.set( 1, 3.14 );\n > out = accumulator( v )\n <ndarray>\n > out = accumulator()\n <ndarray>\n\n See Also\n --------\n incrcovmat, incrpcorr, incrpcorrdistmat\n",
"incrprod": "\nincrprod()\n Returns an accumulator function which incrementally computes a product.\n\n If provided a value, the accumulator function returns an updated product. If\n not provided a value, the accumulator function returns the current product.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow. Note, however, that overflow/underflow\n may be transient, as the accumulator does not use a double-precision\n floating-point number to store an accumulated product. Instead, the\n accumulator splits an accumulated product into a normalized fraction and\n exponent and updates each component separately. Doing so guards against a\n loss in precision.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrprod();\n > var v = accumulator()\n null\n > v = accumulator( 2.0 )\n 2.0\n > v = accumulator( -5.0 )\n -10.0\n > v = accumulator()\n -10.0\n\n See Also\n --------\n incrsum, incrsummary\n",
"incrrange": "\nincrrange()\n Returns an accumulator function which incrementally computes a range.\n\n If provided a value, the accumulator function returns an updated range. If\n not provided a value, the accumulator function returns the current range.\n\n If provided `NaN`, the range is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrange();\n > var v = accumulator()\n null\n > v = accumulator( -2.0 )\n 0.0\n > v = accumulator( 1.0 )\n 3.0\n > v = accumulator( 3.0 )\n 5.0\n > v = accumulator()\n 5.0\n\n See Also\n --------\n incrmax, incrmean, incrmin, incrmrange, incrsummary\n",
"incrrmse": "\nincrrmse()\n Returns an accumulator function which incrementally computes the root mean\n squared error (RMSE).\n\n If provided input values, the accumulator function returns an updated root\n mean squared error. If not provided input values, the accumulator function\n returns the current root mean squared error.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrmse();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 5.0\n > r = accumulator()\n 5.0\n\n See Also\n --------\n incrmrmse, incrmse, incrrss\n",
"incrrss": "\nincrrss()\n Returns an accumulator function which incrementally computes the residual\n sum of squares (RSS).\n\n If provided input values, the accumulator function returns an updated\n residual sum of squares. If not provided input values, the accumulator\n function returns the current residual sum of squares.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrrss();\n > var r = accumulator()\n null\n > r = accumulator( 2.0, 3.0 )\n 1.0\n > r = accumulator( -5.0, 2.0 )\n 50.0\n > r = accumulator()\n 50.0\n\n See Also\n --------\n incrmrss, incrmse, incrrmse\n",
"incrskewness": "\nincrskewness()\n Returns an accumulator function which incrementally computes a corrected\n sample skewness.\n\n If provided a value, the accumulator function returns an updated corrected\n sample skewness. If not provided a value, the accumulator function returns\n the current corrected sample skewness.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrskewness();\n > var v = accumulator( 2.0 )\n null\n > v = accumulator( -5.0 )\n null\n > v = accumulator( -10.0 )\n ~0.492\n > v = accumulator()\n ~0.492\n\n See Also\n --------\n incrkurtosis, incrmean, incrstdev, incrsummary, incrvariance\n",
"incrspace": "\nincrspace( start, stop[, increment] )\n Generates a linearly spaced numeric array using a provided increment.\n\n If an `increment` is not provided, the default `increment` is `1`.\n\n The output array is guaranteed to include the `start` value but does not\n include the `stop` value.\n\n Parameters\n ----------\n start: number\n First array value.\n\n stop: number\n Array element bound.\n\n increment: number (optional)\n Increment. Default: `1`.\n\n Returns\n -------\n arr: Array\n Linearly spaced numeric array.\n\n Examples\n --------\n > var arr = incrspace( 0, 11, 2 )\n [ 0, 2, 4, 6, 8, 10 ]\n\n See Also\n --------\n linspace, logspace\n",
"incrstdev": "\nincrstdev( [mean] )\n Returns an accumulator function which incrementally computes a corrected\n sample standard deviation.\n\n If provided a value, the accumulator function returns an updated corrected\n sample standard deviation. If not provided a value, the accumulator function\n returns the current corrected sample standard deviation.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrstdev();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 0.0\n > s = accumulator( -5.0 )\n ~4.95\n > s = accumulator()\n ~4.95\n\n See Also\n --------\n incrkurtosis, incrmean, incrmstdev, incrskewness, incrsummary, incrvariance\n",
"incrsum": "\nincrsum()\n Returns an accumulator function which incrementally computes a sum.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsum();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n -3.0\n > s = accumulator()\n -3.0\n\n See Also\n --------\n incrcount, incrmean, incrmsum, incrprod, incrsummary\n",
"incrsumabs": "\nincrsumabs()\n Returns an accumulator function which incrementally computes a sum of\n absolute values.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumabs();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 2.0\n > s = accumulator( -5.0 )\n 7.0\n > s = accumulator()\n 7.0\n\n See Also\n --------\n incrmeanabs, incrmsumabs, incrsum\n",
"incrsumabs2": "\nincrsumabs2()\n Returns an accumulator function which incrementally computes a sum of\n squared absolute values.\n\n If provided a value, the accumulator function returns an updated sum. If not\n provided a value, the accumulator function returns the current sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumabs2();\n > var s = accumulator()\n null\n > s = accumulator( 2.0 )\n 4.0\n > s = accumulator( -5.0 )\n 29.0\n > s = accumulator()\n 29.0\n\n See Also\n --------\n incrmeanabs2, incrmsumabs2, incrsumabs\n",
"incrsummary": "\nincrsummary()\n Returns an accumulator function which incrementally computes a statistical\n summary.\n\n If provided a value, the accumulator function returns an updated summary. If\n not provided a value, the accumulator function returns the current summary.\n\n The returned summary is an object containing the following fields:\n\n - count: count.\n - max: maximum value.\n - min: minimum value.\n - range: range.\n - midrange: mid-range.\n - sum: sum.\n - mean: arithmetic mean.\n - variance: unbiased sample variance.\n - stdev: corrected sample standard deviation.\n - skewness: corrected sample skewness.\n - kurtosis: corrected sample excess kurtosis.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsummary();\n > var s = accumulator()\n {}\n > s = accumulator( 2.0 )\n {...}\n > s = accumulator( -5.0 )\n {...}\n > s = accumulator()\n {...}\n\n See Also\n --------\n incrcount, incrkurtosis, incrmax, incrmean, incrmidrange, incrmin, incrmsummary, incrrange, incrskewness, incrstdev, incrsum, incrvariance\n",
"incrsumprod": "\nincrsumprod()\n Returns an accumulator function which incrementally computes a sum of\n products.\n\n If provided input values, the accumulator function returns an updated sum.\n If not provided input values, the accumulator function returns the current\n sum.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n For long running accumulations or accumulations of large numbers, care\n should be taken to prevent overflow.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrsumprod();\n > var s = accumulator()\n null\n > s = accumulator( 2.0, 3.0 )\n 6.0\n > s = accumulator( -5.0, 2.0 )\n -4.0\n > s = accumulator()\n -4.0\n\n See Also\n --------\n incrmsumprod, incrprod, incrsum\n",
"incrvariance": "\nincrvariance( [mean] )\n Returns an accumulator function which incrementally computes an unbiased\n sample variance.\n\n If provided a value, the accumulator function returns an updated unbiased\n sample variance. If not provided a value, the accumulator function returns\n the current unbiased sample variance.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrvariance();\n > var s2 = accumulator()\n null\n > s2 = accumulator( 2.0 )\n 0.0\n > s2 = accumulator( -5.0 )\n 24.5\n > s2 = accumulator()\n 24.5\n\n See Also\n --------\n incrkurtosis, incrmean, incrmstdev, incrskewness, incrstdev, incrsummary\n",
"incrvmr": "\nincrvmr( [mean] )\n Returns an accumulator function which incrementally computes a variance-to-\n mean ratio (VMR).\n\n If provided a value, the accumulator function returns an updated accumulated\n value. If not provided a value, the accumulator function returns the current\n accumulated value.\n\n If provided `NaN` or a value which, when used in computations, results in\n `NaN`, the accumulated value is `NaN` for all future invocations.\n\n Parameters\n ----------\n mean: number (optional)\n Known mean.\n\n Returns\n -------\n acc: Function\n Accumulator function.\n\n Examples\n --------\n > var accumulator = incrvmr();\n > var D = accumulator()\n null\n > D = accumulator( 2.0 )\n 0.0\n > D = accumulator( 1.0 )\n ~0.33\n > D = accumulator()\n ~0.33\n\n See Also\n --------\n incrmean, incrmvmr, incrvariance\n",
"ind2sub": "\nind2sub( [out,] shape, idx[, options] )\n Converts a linear index to an array of subscripts.\n\n Parameters\n ----------\n out: Array|TypedArray|Object (optional)\n Output array.\n\n shape: ArrayLike\n Array shape.\n\n idx: integer\n Linear index.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Specifies whether an array is row-major (C-style) or column-major\n (Fortran style). Default: 'row-major'.\n\n options.mode: string (optional)\n Specifies how to handle a linear index which exceeds array dimensions.\n If equal to 'throw', the function throws an error when a linear index\n exceeds array dimensions. If equal to 'wrap', the function wraps around\n a linear index exceeding array dimensions using modulo arithmetic. If\n equal to 'clamp', the function sets a linear index exceeding array\n dimensions to either `0` (minimum linear index) or the maximum linear\n index. Default: 'throw'.\n\n Returns\n -------\n out: Array<integer>\n Subscripts.\n\n Examples\n --------\n > var d = [ 3, 3, 3 ];\n > var s = ind2sub( d, 17 )\n [ 1, 2, 2 ]\n\n // Provide an output array:\n > var out = new Array( d.length );\n > s = ind2sub( out, d, 17 )\n [ 1, 2, 2 ]\n > var bool = ( s === out )\n true\n\n See Also\n --------\n array, ndarray, sub2ind\n",
"indexOf": "\nindexOf( arr, searchElement[, fromIndex] )\n Returns the first index at which a given element can be found.\n\n Search is performed using *strict equality* comparison.\n\n Parameters\n ----------\n arr: ArrayLike\n Array-like object.\n\n searchElement: any\n Element to find.\n\n fromIndex: integer (optional)\n Starting index (if negative, the start index is determined relative to\n last element).\n\n Returns\n -------\n out: integer\n Index or -1.\n\n Examples\n --------\n // Basic usage:\n > var arr = [ 4, 3, 2, 1 ];\n > var idx = indexOf( arr, 3 )\n 1\n > arr = [ 4, 3, 2, 1 ];\n > idx = indexOf( arr, 5 )\n -1\n\n // Using a `fromIndex`:\n > arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n > idx = indexOf( arr, 2, 3 )\n 5\n\n // `fromIndex` which exceeds `array` length:\n > arr = [ 1, 2, 3, 4, 2, 5 ];\n > idx = indexOf( arr, 2, 10 )\n -1\n\n // Negative `fromIndex`:\n > arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n > idx = indexOf( arr, 2, -4 )\n 5\n > idx = indexOf( arr, 2, -1 )\n 7\n\n // Negative `fromIndex` exceeding input `array` length:\n > arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n > idx = indexOf( arr, 2, -10 )\n 1\n\n // Array-like objects:\n > var str = 'bebop';\n > idx = indexOf( str, 'o' )\n 3\n\n",
"inherit": "\ninherit( ctor, superCtor )\n Prototypical inheritance by replacing the prototype of one constructor with\n the prototype of another constructor.\n\n This function is not designed to work with ES2015/ES6 classes. For\n ES2015/ES6 classes, use `class` with `extends`.\n\n Parameters\n ----------\n ctor: Object|Function\n Constructor which will inherit.\n\n superCtor: Object|Function\n Super (parent) constructor.\n\n Returns\n -------\n out: Object|Function\n Child constructor.\n\n Examples\n --------\n // Create a parent constructor:\n > function Foo() { return this; };\n > Foo.prototype.beep = function beep() { return 'boop'; };\n\n // Create a child constructor:\n > function Bar() { Foo.call( this ); return this; };\n\n // Setup inheritance:\n > inherit( Bar, Foo );\n > var bar = new Bar();\n > var v = bar.beep()\n 'boop'\n\n",
"inheritedEnumerableProperties": "\ninheritedEnumerableProperties( value[, level] )\n Returns an array of an object's inherited enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n props: Array\n List of an object's inherited enumerable properties.\n\n Examples\n --------\n > var props = inheritedEnumerableProperties( {} )\n\n See Also\n --------\n enumerableProperties, enumerablePropertiesIn, inheritedEnumerablePropertySymbols, inheritedKeys, inheritedNonEnumerableProperties, inheritedProperties\n",
"inheritedEnumerablePropertySymbols": "\ninheritedEnumerablePropertySymbols( value[, level] )\n Returns an array of an object's inherited enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited enumerable symbol properties.\n\n Examples\n --------\n > var symbols = inheritedEnumerablePropertySymbols( [] )\n\n See Also\n --------\n enumerableProperties, enumerablePropertySymbols, inheritedKeys, nonEnumerablePropertySymbols, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"inheritedKeys": "\ninheritedKeys( value[, level] )\n Returns an array of an object's inherited enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited enumerable property names.\n\n Examples\n --------\n > var keys = inheritedKeys( {} )\n\n See Also\n --------\n objectKeys, keysIn, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedNonEnumerableProperties": "\ninheritedNonEnumerableProperties( value[, level] )\n Returns an array of an object's inherited non-enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n props: Array\n List of an object's inherited non-enumerable properties.\n\n Examples\n --------\n > var props = inheritedNonEnumerableProperties( {} )\n\n See Also\n --------\n inheritedEnumerableProperties, inheritedNonEnumerablePropertyNames, inheritedNonEnumerablePropertySymbols, inheritedKeys, nonEnumerableProperties, nonEnumerablePropertiesIn, properties\n",
"inheritedNonEnumerablePropertyNames": "\ninheritedNonEnumerablePropertyNames( value[, level] )\n Returns an array of an object's inherited non-enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited non-enumerable property names.\n\n Examples\n --------\n > var keys = inheritedNonEnumerablePropertyNames( {} )\n\n See Also\n --------\n inheritedNonEnumerableProperties, inheritedNonEnumerablePropertySymbols, objectKeys, nonEnumerablePropertyNames, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbols, propertyNames\n",
"inheritedNonEnumerablePropertySymbols": "\ninheritedNonEnumerablePropertySymbols( value[, level] )\n Returns an array of an object's inherited non-enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited non-enumerable symbol properties.\n\n Examples\n --------\n > var symbols = inheritedNonEnumerablePropertySymbols( [] )\n\n See Also\n --------\n inheritedNonEnumerableProperties, inheritedNonEnumerablePropertyNames, nonEnumerableProperties, nonEnumerablePropertyNames, nonEnumerablePropertySymbols, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"inheritedProperties": "\ninheritedProperties( value[, level] )\n Returns an array of an object's inherited property names and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited property names and symbols.\n\n Examples\n --------\n > var symbols = inheritedProperties( [] )\n\n See Also\n --------\n properties, propertiesIn, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyDescriptor": "\ninheritedPropertyDescriptor( value, property[, level] )\n Returns a property descriptor for an object's inherited property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var desc = inheritedPropertyDescriptor( {}, 'toString' )\n {...}\n\n See Also\n --------\n propertyDescriptor, propertyDescriptorIn, inheritedKeys, inheritedPropertyDescriptors, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyDescriptors": "\ninheritedPropertyDescriptors( value[, level] )\n Returns an object's inherited property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n desc: Object\n An object's inherited property descriptors.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var desc = inheritedPropertyDescriptors( obj )\n { 'foo': {...}, ... }\n\n See Also\n --------\n propertyDescriptors, propertyDescriptorsIn, inheritedKeys, inheritedPropertyNames, inheritedPropertySymbols\n",
"inheritedPropertyNames": "\ninheritedPropertyNames( value[, level] )\n Returns an array of an object's inherited enumerable and non-enumerable\n property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n keys: Array\n List of an object's inherited enumerable and non-enumerable property\n names.\n\n Examples\n --------\n > var keys = inheritedPropertyNames( [] )\n\n See Also\n --------\n inheritedKeys, inheritedPropertyDescriptors, inheritedPropertySymbols, propertyNames, propertyNamesIn\n",
"inheritedPropertySymbols": "\ninheritedPropertySymbols( value[, level] )\n Returns an array of an object's inherited symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n level: integer (optional)\n Inheritance level.\n\n Returns\n -------\n symbols: Array\n List of an object's inherited symbol properties.\n\n Examples\n --------\n > var symbols = inheritedPropertySymbols( [] )\n\n See Also\n --------\n inheritedKeys, inheritedPropertyDescriptors, inheritedPropertyNames, propertySymbols, propertySymbolsIn\n",
"inmap": "\ninmap( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection and updates the\n collection in-place.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n fcn: Function\n Function to invoke for each element in the input collection. The\n function's return value is used to update the collection in-place.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function foo( v, i ) { return v * i; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = inmap( arr, foo )\n [ 0.0, 2.0, 6.0 ]\n > var bool = ( out === arr )\n true\n\n See Also\n --------\n forEach, inmapRight\n",
"inmapAsync": "\ninmapAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection and updates a\n collection in-place.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: value used to update the collection\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling. Note, however, that the function\n may have mutated an input collection during prior invocations, resulting in\n a partially mutated collection.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, fcn, done )\n 1000\n 2500\n 3000\n true\n [ 0, 2500, 2000 ]\n\n // Limit number of concurrent invocations:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, opts, fcn, done )\n 2500\n 3000\n 1000\n true\n [ 0, 2500, 2000 ]\n\n // Process sequentially:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > inmapAsync( arr, opts, fcn, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 2000 ]\n\n\ninmapAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection and updates a collection in-place.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = inmapAsync.factory( opts, fcn );\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 2000 ]\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n [ 0, 1500, 2000 ]\n\n See Also\n --------\n forEachAsync, inmap, inmapRightAsync\n",
"inmapRight": "\ninmapRight( collection, fcn[, thisArg] )\n Invokes a function for each element in a collection and updates the\n collection in-place, iterating from right to left.\n\n When invoked, the input function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n fcn: Function\n Function to invoke for each element in the input collection. The\n function's return value is used to update the collection in-place.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function foo( v, i ) { console.log( '%s: %d', i, v ); return v * i; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = inmapRight( arr, foo )\n 2: 3.0\n 1: 2.0\n 0: 1.0\n [ 0.0, 2.0, 6.0 ]\n > var bool = ( out === arr )\n true\n\n See Also\n --------\n forEachRight, inmap\n",
"inmapRightAsync": "\ninmapRightAsync( collection, [options,] fcn, done )\n Invokes a function once for each element in a collection and updates a\n collection in-place, iterating from right to left.\n\n When invoked, `fcn` is provided a maximum of four arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If `fcn`\n accepts two arguments, `fcn` is provided:\n\n - `value`\n - `next`\n\n If `fcn` accepts three arguments, `fcn` is provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other `fcn` signature, `fcn` is provided all four arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: value used to update the collection\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling. Note, however, that the function\n may have mutated an input collection during prior invocations, resulting in\n a partially mutated collection.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, fcn, done )\n 1000\n 2500\n 3000\n true\n [ 0, 2500, 6000 ]\n\n // Limit number of concurrent invocations:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, opts, fcn, done )\n 2500\n 3000\n 1000\n true\n [ 0, 2500, 6000 ]\n\n // Process sequentially:\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > inmapRightAsync( arr, opts, fcn, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 6000 ]\n\n\ninmapRightAsync.factory( [options,] fcn )\n Returns a function which invokes a function once for each element in a\n collection and updates a collection in-place, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, value*index );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = inmapRightAsync.factory( opts, fcn );\n > function done( error, collection ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( collection === arr );\n ... console.log( collection );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n [ 0, 2500, 6000 ]\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n [ 0, 1500, 4000 ]\n\n See Also\n --------\n forEachRightAsync, inmapAsync, inmapRight\n",
"inspectStream": "\ninspectStream( [options,] clbk )\n Returns a transform stream for inspecting stream data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = inspectStream( clbk );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ninspectStream.factory( [options] )\n Returns a function for creating transform streams for inspecting stream\n data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream( clbk ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = inspectStream.factory( opts );\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = createStream( clbk );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ninspectStream.objectMode( [options,] clbk )\n Returns an \"objectMode\" transform stream for inspecting stream data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n clbk: Function\n Callback to invoke upon receiving data.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > function clbk( chunk, idx ) { console.log( chunk.toString() ); };\n > var s = inspectStream.objectMode( clbk );\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n debugStream\n",
"instanceOf": "\ninstanceOf( value, constructor )\n Tests whether a value has in its prototype chain a specified constructor as\n a prototype property.\n\n While the prototype of an `object` created using object literal notion is\n `undefined`, the function returns `true` when provided an `object` literal\n and the `Object` constructor. This maintains consistent behavior with the\n `instanceof` operator.\n\n Parameters\n ----------\n value: any\n Input value.\n\n constructor: Function\n Constructor.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an instance of a provided constructor.\n\n Examples\n --------\n > var bool = instanceOf( [], Array )\n true\n > bool = instanceOf( {}, Object )\n true\n > bool = instanceOf( null, Object )\n false\n\n See Also\n --------\n isPrototypeOf, constructorName, inherit, typeOf\n",
"INT8_MAX": "\nINT8_MAX\n Maximum signed 8-bit integer.\n\n The maximum signed 8-bit integer is given by `2^7 - 1`.\n\n Examples\n --------\n > INT8_MAX\n 127\n\n See Also\n --------\n INT8_MIN\n",
"INT8_MIN": "\nINT8_MIN\n Minimum signed 8-bit integer.\n\n The minimum signed 8-bit integer is given by `-(2^7)`.\n\n Examples\n --------\n > INT8_MIN\n -128\n\n See Also\n --------\n INT8_MAX\n",
"INT8_NUM_BYTES": "\nINT8_NUM_BYTES\n Size (in bytes) of an 8-bit signed integer.\n\n Examples\n --------\n > INT8_NUM_BYTES\n 1\n\n See Also\n --------\n INT16_NUM_BYTES, INT32_NUM_BYTES, UINT8_NUM_BYTES\n",
"Int8Array": "\nInt8Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 8-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int8Array()\n <Int8Array>\n\n\nInt8Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 )\n <Int8Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt8Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Int8Array( arr1 )\n <Int8Array>[ 5, 5, 5 ]\n\n\nInt8Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int8Array( arr1 )\n <Int8Array>[ 5, 5, 5 ]\n\n\nInt8Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Int8Array( buf, 0, 4 )\n <Int8Array>[ 0, 0, 0, 0 ]\n\n\nInt8Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int8Array.from( [ 1, 2 ], mapFcn )\n <Int8Array>[ 2, 4 ]\n\n\nInt8Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr = Int8Array.of( 1, 2 )\n <Int8Array>[ 1, 2 ]\n\n\nInt8Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int8Array.BYTES_PER_ELEMENT\n 1\n\n\nInt8Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int8Array.name\n 'Int8Array'\n\n\nInt8Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt8Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.byteLength\n 5\n\n\nInt8Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt8Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nInt8Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int8Array( 5 );\n > arr.length\n 5\n\n\nInt8Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt8Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt8Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt8Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt8Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt8Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt8Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt8Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int8Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt8Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt8Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt8Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt8Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt8Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt8Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int8Array>[ 2, 4, 6 ]\n\n\nInt8Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt8Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt8Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] )\n <Int8Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int8Array>[ 3, 2, 1 ]\n\n\nInt8Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt8Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt8Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt8Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int8Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt8Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int8Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int8Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int8Array>[ 3, 4, 5 ]\n\n\nInt8Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt8Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt8Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int8Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"INT16_MAX": "\nINT16_MAX\n Maximum signed 16-bit integer.\n\n The maximum signed 16-bit integer is given by `2^15 - 1`.\n\n Examples\n --------\n > INT16_MAX\n 32767\n\n See Also\n --------\n INT16_MIN\n",
"INT16_MIN": "\nINT16_MIN\n Minimum signed 16-bit integer.\n\n The minimum signed 16-bit integer is given by `-(2^15)`.\n\n Examples\n --------\n > INT16_MIN\n -32768\n\n See Also\n --------\n INT16_MAX\n",
"INT16_NUM_BYTES": "\nINT16_NUM_BYTES\n Size (in bytes) of a 16-bit signed integer.\n\n Examples\n --------\n > INT16_NUM_BYTES\n 2\n\n See Also\n --------\n INT32_NUM_BYTES, INT8_NUM_BYTES, UINT16_NUM_BYTES\n",
"Int16Array": "\nInt16Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 16-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int16Array()\n <Int16Array>\n\n\nInt16Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 )\n <Int16Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt16Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Int16Array( arr1 )\n <Int16Array>[ 5, 5, 5 ]\n\n\nInt16Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int16Array( arr1 )\n <Int16Array>[ 5, 5, 5 ]\n\n\nInt16Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 8 );\n > var arr = new Int16Array( buf, 0, 4 )\n <Int16Array>[ 0, 0, 0, 0 ]\n\n\nInt16Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int16Array.from( [ 1, 2 ], mapFcn )\n <Int16Array>[ 2, 4 ]\n\n\nInt16Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr = Int16Array.of( 1, 2 )\n <Int16Array>[ 1, 2 ]\n\n\nInt16Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int16Array.BYTES_PER_ELEMENT\n 2\n\n\nInt16Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int16Array.name\n 'Int16Array'\n\n\nInt16Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt16Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.byteLength\n 10\n\n\nInt16Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt16Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 2\n\n\nInt16Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int16Array( 5 );\n > arr.length\n 5\n\n\nInt16Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt16Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt16Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt16Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt16Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt16Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt16Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt16Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int16Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt16Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt16Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt16Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt16Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt16Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt16Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int16Array>[ 2, 4, 6 ]\n\n\nInt16Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt16Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt16Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] )\n <Int16Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int16Array>[ 3, 2, 1 ]\n\n\nInt16Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt16Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt16Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt16Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int16Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt16Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int16Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int16Array>[ 3, 4, 5 ]\n\n\nInt16Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt16Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt16Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int16Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"INT32_MAX": "\nINT32_MAX\n Maximum signed 32-bit integer.\n\n The maximum signed 32-bit integer is given by `2^31 - 1`.\n\n Examples\n --------\n > INT32_MAX\n 2147483647\n\n See Also\n --------\n INT32_MIN\n",
"INT32_MIN": "\nINT32_MIN\n Minimum signed 32-bit integer.\n\n The minimum signed 32-bit integer is given by `-(2^31)`.\n\n Examples\n --------\n > INT32_MIN\n -2147483648\n\n See Also\n --------\n INT32_MAX\n",
"INT32_NUM_BYTES": "\nINT32_NUM_BYTES\n Size (in bytes) of a 32-bit signed integer.\n\n Examples\n --------\n > INT32_NUM_BYTES\n 4\n\n See Also\n --------\n INT16_NUM_BYTES, INT8_NUM_BYTES, UINT32_NUM_BYTES\n",
"Int32Array": "\nInt32Array()\n A typed array constructor which returns a typed array representing an array\n of twos-complement 32-bit signed integers in the platform byte order.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int32Array()\n <Int32Array>\n\n\nInt32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\nInt32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int16Array( [ 5, 5, 5 ] );\n > var arr2 = new Int32Array( arr1 )\n <Int32Array>[ 5, 5, 5 ]\n\n\nInt32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Int32Array( arr1 )\n <Int32Array>[ 5, 5, 5 ]\n\n\nInt32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Int32Array( buf, 0, 4 )\n <Int32Array>[ 0, 0, 0, 0 ]\n\n\nInt32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Int32Array.from( [ 1, 2 ], mapFcn )\n <Int32Array>[ 2, 4 ]\n\n\nInt32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr = Int32Array.of( 1, 2 )\n <Int32Array>[ 1, 2 ]\n\n\nInt32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Int32Array.BYTES_PER_ELEMENT\n 4\n\n\nInt32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Int32Array.name\n 'Int32Array'\n\n\nInt32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nInt32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.byteLength\n 20\n\n\nInt32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.byteOffset\n 0\n\n\nInt32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nInt32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Int32Array( 5 );\n > arr.length\n 5\n\n\nInt32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nInt32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nInt32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nInt32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nInt32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nInt32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nInt32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nInt32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Int32Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nInt32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nInt32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nInt32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nInt32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nInt32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nInt32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Int32Array>[ 2, 4, 6 ]\n\n\nInt32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nInt32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nInt32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] )\n <Int32Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Int32Array>[ 3, 2, 1 ]\n\n\nInt32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nInt32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nInt32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nInt32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Int32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Int32Array>[ 0, 1, 1, 2, 2 ]\n\n\nInt32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Int32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Int32Array>[ 3, 4, 5 ]\n\n\nInt32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nInt32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nInt32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Int32Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"IS_BIG_ENDIAN": "\nIS_BIG_ENDIAN\n Boolean indicating if the environment is big endian.\n\n Examples\n --------\n > IS_BIG_ENDIAN\n <boolean>\n\n See Also\n --------\n IS_LITTLE_ENDIAN\n",
"IS_BROWSER": "\nIS_BROWSER\n Boolean indicating if the runtime is a web browser.\n\n Examples\n --------\n > IS_BROWSER\n <boolean>\n\n",
"IS_DARWIN": "\nIS_DARWIN\n Boolean indicating if the current process is running on Darwin.\n\n Examples\n --------\n > IS_DARWIN\n <boolean>\n\n",
"IS_ELECTRON": "\nIS_ELECTRON\n Boolean indicating if the runtime is Electron.\n\n Examples\n --------\n > IS_ELECTRON\n <boolean>\n\n See Also\n --------\n IS_ELECTRON_MAIN, IS_ELECTRON_RENDERER\n",
"IS_ELECTRON_MAIN": "\nIS_ELECTRON_MAIN\n Boolean indicating if the runtime is the main Electron process.\n\n Examples\n --------\n > IS_ELECTRON_MAIN\n <boolean>\n\n See Also\n --------\n IS_ELECTRON, IS_ELECTRON_RENDERER\n",
"IS_ELECTRON_RENDERER": "\nIS_ELECTRON_RENDERER\n Boolean indicating if the runtime is the Electron renderer process.\n\n Examples\n --------\n > IS_ELECTRON_RENDERER\n <boolean>\n\n See Also\n --------\n IS_ELECTRON, IS_ELECTRON_MAIN\n",
"IS_LITTLE_ENDIAN": "\nIS_LITTLE_ENDIAN\n Boolean indicating if the environment is little endian.\n\n Examples\n --------\n > IS_LITTLE_ENDIAN\n <boolean>\n\n See Also\n --------\n IS_BIG_ENDIAN\n",
"IS_NODE": "\nIS_NODE\n Boolean indicating if the runtime is Node.js.\n\n Examples\n --------\n > IS_NODE\n <boolean>\n\n",
"IS_WEB_WORKER": "\nIS_WEB_WORKER\n Boolean indicating if the runtime is a web worker.\n\n Examples\n --------\n > IS_WEB_WORKER\n <boolean>\n\n",
"IS_WINDOWS": "\nIS_WINDOWS\n Boolean indicating if the current process is running on Windows.\n\n Examples\n --------\n > IS_WINDOWS\n <boolean>\n\n",
"isAbsolutePath": "\nisAbsolutePath( value )\n Tests if a value is an absolute path.\n\n Function behavior is platform-specific. On Windows platforms, the function\n is equal to `.win32()`. On POSIX platforms, the function is equal to\n `.posix()`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an absolute path.\n\n Examples\n --------\n // Windows environment:\n > var bool = isAbsolutePath( 'C:\\\\foo\\\\bar\\\\baz' )\n true\n\n // POSIX environment:\n > bool = isAbsolutePath( '/foo/bar/baz' )\n true\n\n\nisAbsolutePath.posix( value )\n Tests if a value is a POSIX absolute path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a POSIX absolute path.\n\n Examples\n --------\n > var bool = isAbsolutePath.posix( '/foo/bar/baz' )\n true\n > bool = isAbsolutePath.posix( 'foo/bar/baz' )\n false\n\n\nisAbsolutePath.win32( value )\n Tests if a value is a Windows absolute path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a Windows absolute path.\n\n Examples\n --------\n > var bool = isAbsolutePath.win32( 'C:\\\\foo\\\\bar\\\\baz' )\n true\n > bool = isAbsolutePath.win32( 'foo\\\\bar\\\\baz' )\n false\n\n See Also\n --------\n isRelativePath\n",
"isAccessorProperty": "\nisAccessorProperty( value, property )\n Tests if an object's own property has an accessor descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property has an accessor\n descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isAccessorProperty( obj, 'boop' )\n false\n > bool = isAccessorProperty( obj, 'beep' )\n true\n\n See Also\n --------\n hasOwnProp, isAccessorPropertyIn, isDataProperty\n",
"isAccessorPropertyIn": "\nisAccessorPropertyIn( value, property )\n Tests if an object's own or inherited property has an accessor descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property has an\n accessor descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isAccessorPropertyIn( obj, 'boop' )\n false\n > bool = isAccessorPropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n hasProp, isAccessorProperty, isDataPropertyIn\n",
"isAlphagram": "\nisAlphagram( value )\n Tests if a value is an alphagram (i.e., a sequence of characters arranged in\n alphabetical order).\n\n The function first checks that an input value is a string before validating\n that the value is an alphagram. For non-string values, the function returns\n `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an alphagram.\n\n Examples\n --------\n > var out = isAlphagram( 'beep' )\n true\n > out = isAlphagram( 'zba' )\n false\n > out = isAlphagram( '' )\n false\n\n See Also\n --------\n isAnagram\n",
"isAlphaNumeric": "\nisAlphaNumeric( str )\n Tests whether a string contains only alphanumeric characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only alphanumeric\n characters.\n\n Examples\n --------\n > var bool = isAlphaNumeric( 'abc0123456789' )\n true\n > bool = isAlphaNumeric( 'abcdef' )\n true\n > bool = isAlphaNumeric( '0xff' )\n true\n > bool = isAlphaNumeric( '' )\n false\n\n See Also\n --------\n isDigitString\n",
"isAnagram": "\nisAnagram( str, value )\n Tests if a value is an anagram.\n\n Parameters\n ----------\n str: string\n Comparison string.\n\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an anagram.\n\n Examples\n --------\n > var str1 = 'I am a weakish speller';\n > var str2 = 'William Shakespeare';\n > var bool = isAnagram( str1, str2 )\n true\n > bool = isAnagram( 'bat', 'tabba' )\n false\n\n See Also\n --------\n isAlphagram\n",
"isArguments": "\nisArguments( value )\n Tests if a value is an arguments object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an arguments object.\n\n Examples\n --------\n > function foo() { return arguments; };\n > var bool = isArguments( foo() )\n true\n > bool = isArguments( [] )\n false\n\n",
"isArray": "\nisArray( value )\n Tests if a value is an array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array.\n\n Examples\n --------\n > var bool = isArray( [] )\n true\n > bool = isArray( {} )\n false\n\n See Also\n --------\n isArrayLike\n",
"isArrayArray": "\nisArrayArray( value )\n Tests if a value is an array of arrays.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of arrays.\n\n Examples\n --------\n > var bool = isArrayArray( [ [], [] ] )\n true\n > bool = isArrayArray( [ {}, {} ] )\n false\n > bool = isArrayArray( [] )\n false\n\n",
"isArrayBuffer": "\nisArrayBuffer( value )\n Tests if a value is an ArrayBuffer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an ArrayBuffer.\n\n Examples\n --------\n > var bool = isArrayBuffer( new ArrayBuffer( 10 ) )\n true\n > bool = isArrayBuffer( [] )\n false\n\n See Also\n --------\n isSharedArrayBuffer, isTypedArray\n",
"isArrayLength": "\nisArrayLength( value )\n Tests if a value is a valid array length.\n\n A valid length property for an Array instance is any integer value on the\n interval [0, 2^32-1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a valid array length.\n\n Examples\n --------\n > var bool = isArrayLength( 5 )\n true\n > bool = isArrayLength( 2.0e200 )\n false\n > bool = isArrayLength( -3.14 )\n false\n > bool = isArrayLength( null )\n false\n\n See Also\n --------\n isArray\n",
"isArrayLike": "\nisArrayLike( value )\n Tests if a value is array-like.\n\n If provided a string, the function returns `true`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is array-like.\n\n Examples\n --------\n > var bool = isArrayLike( [] )\n true\n > bool = isArrayLike( { 'length': 10 } )\n true\n > bool = isArrayLike( 'beep' )\n true\n > bool = isArrayLike( null )\n false\n\n See Also\n --------\n isArray, isArrayLikeObject\n",
"isArrayLikeObject": "\nisArrayLikeObject( value )\n Tests if a value is an array-like object.\n\n If provided a string, the function returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object.\n\n Examples\n --------\n > var bool = isArrayLikeObject( [] )\n true\n > bool = isArrayLikeObject( { 'length': 10 } )\n true\n > bool = isArrayLikeObject( 'beep' )\n false\n\n See Also\n --------\n isArray, isArrayLike\n",
"isASCII": "\nisASCII( str )\n Tests whether a character belongs to the ASCII character set and whether\n this is true for all characters in a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string has all ASCII characters.\n\n Examples\n --------\n > var str = 'beep boop';\n > var bool = isASCII( str )\n true\n > bool = isASCII( fromCodePoint( 130 ) )\n false\n\n See Also\n --------\n isString\n",
"isBetween": "\nisBetween( value, a, b[, left, right] )\n Tests if a value is between two values.\n\n Parameters\n ----------\n value: any\n Input value.\n\n a: any\n Left comparison value.\n\n b: any\n Right comparison value.\n\n left: string (optional)\n Indicates whether the left comparison value is inclusive. Must be either\n 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n right: string (optional)\n Indicates whether the right comparison value is inclusive. Must be\n either 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is between two values.\n\n Examples\n --------\n > var bool = isBetween( 3.14, 3.0, 4.0 )\n true\n > bool = isBetween( 3.0, 3.0, 4.0 )\n true\n > bool = isBetween( 4.0, 3.0, 4.0 )\n true\n > bool = isBetween( 3.0, 3.14, 4.0 )\n false\n > bool = isBetween( 3.14, 3.14, 4.0, 'open', 'closed' )\n false\n > bool = isBetween( 3.14, 3.0, 3.14, 'closed', 'open' )\n false\n\n See Also\n --------\n isBetweenArray\n",
"isBetweenArray": "\nisBetweenArray( value, a, b[, left, right] )\n Tests if a value is an array-like object where every element is between two\n values.\n\n Parameters\n ----------\n value: any\n Input value.\n\n a: any\n Left comparison value.\n\n b: any\n Right comparison value.\n\n left: string (optional)\n Indicates whether the left comparison value is inclusive. Must be either\n 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n right: string (optional)\n Indicates whether the right comparison value is inclusive. Must be\n either 'closed' or 'open'. Default: 'closed' (i.e., inclusive).\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object where every\n element is between two values.\n\n Examples\n --------\n > var arr = [ 3.0, 3.14, 4.0 ];\n > var bool = isBetweenArray( arr, 3.0, 4.0 )\n true\n > bool = isBetweenArray( arr, 3.14, 4.0 )\n false\n > bool = isBetweenArray( arr, 3.0, 3.14 )\n false\n > bool = isBetweenArray( arr, 3.0, 4.0, 'open', 'closed' )\n false\n > bool = isBetweenArray( arr, 3.0, 4.0, 'closed', 'open' )\n false\n\n See Also\n --------\n isBetween\n",
"isBinaryString": "\nisBinaryString( value )\n Tests if a value is a binary string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a binary string.\n\n Examples\n --------\n > var bool = isBinaryString( '1000101' )\n true\n > bool = isBinaryString( 'beep' )\n false\n > bool = isBinaryString( '' )\n false\n\n See Also\n --------\n isString\n",
"isBoolean": "\nisBoolean( value )\n Tests if a value is a boolean.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean.\n\n Examples\n --------\n > var bool = isBoolean( false )\n true\n > bool = isBoolean( new Boolean( false ) )\n true\n\n\nisBoolean.isPrimitive( value )\n Tests if a value is a boolean primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean primitive.\n\n Examples\n --------\n > var bool = isBoolean.isPrimitive( true )\n true\n > bool = isBoolean.isPrimitive( false )\n true\n > bool = isBoolean.isPrimitive( new Boolean( true ) )\n false\n\n\nisBoolean.isObject( value )\n Tests if a value is a boolean object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a boolean object.\n\n Examples\n --------\n > var bool = isBoolean.isObject( true )\n false\n > bool = isBoolean.isObject( new Boolean( false ) )\n true\n\n",
"isBooleanArray": "\nisBooleanArray( value )\n Tests if a value is an array-like object of booleans.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object of booleans.\n\n Examples\n --------\n > var bool = isBooleanArray( [ true, false, true ] )\n true\n > bool = isBooleanArray( [ true, 'abc', false ] )\n false\n\n\nisBooleanArray.primitives( value )\n Tests if a value is an array-like object containing only boolean primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n boolean primitives.\n\n Examples\n --------\n > var bool = isBooleanArray.primitives( [ true, false ] )\n true\n > bool = isBooleanArray.primitives( [ false, new Boolean( true ) ] )\n false\n\n\nisBooleanArray.objects( value )\n Tests if a value is an array-like object containing only Boolean objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n Boolean objects.\n\n Examples\n --------\n > var bool = isBooleanArray.objects( [ new Boolean( false ), true ] )\n false\n > bool = isBooleanArray.objects( [ new Boolean( false ), new Boolean( true ) ] )\n true\n\n",
"isBoxedPrimitive": "\nisBoxedPrimitive( value )\n Tests if a value is a JavaScript boxed primitive.\n\n Boxed primitive objects can be created with one of the following:\n\n - new Boolean()\n - new Number()\n - new String()\n - Object( Symbol() ) (ES6/ES2015)\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a JavaScript boxed primitive.\n\n Examples\n --------\n > var bool = isBoxedPrimitive( new Boolean( false ) )\n true\n > bool = isBoxedPrimitive( true )\n false\n\n See Also\n --------\n isPrimitive\n",
"isBuffer": "\nisBuffer( value )\n Tests if a value is a Buffer instance.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Buffer instance.\n\n Examples\n --------\n > var bool = isBuffer( new Buffer( 'beep' ) )\n true\n > bool = isBuffer( new Buffer( [ 1, 2, 3, 4 ] ) )\n true\n > bool = isBuffer( {} )\n false\n > bool = isBuffer( [] )\n false\n\n",
"isCapitalized": "\nisCapitalized( value )\n Tests if a value is a string having an uppercase first character.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string with an uppercase first\n character.\n\n Examples\n --------\n > var bool = isCapitalized( 'Hello' )\n true\n > bool = isCapitalized( 'world' )\n false\n\n See Also\n --------\n isString\n",
"isCentrosymmetricMatrix": "\nisCentrosymmetricMatrix( value )\n Tests if a value is a matrix which is symmetric about its center.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a centrosymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 2, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isCentrosymmetricMatrix( M )\n true\n > bool = isCentrosymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isCentrosymmetricMatrix( 3.14 )\n false\n > bool = isCentrosymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isCircular": "\nisCircular( value )\n Tests if an object-like value contains a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an object-like value contains a circular\n reference.\n\n Examples\n --------\n > var obj = { 'beep': 'boop' };\n > obj.self = obj;\n > var bool = isCircular( obj )\n true\n > bool = isCircular( {} )\n false\n > bool = isCircular( null )\n false\n\n See Also\n --------\n isCircularArray, isCircularPlainObject\n",
"isCircularArray": "\nisCircularArray( value )\n Tests if a value is an array containing a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing a\n circular reference.\n\n Examples\n --------\n > var arr = [ 1, 2, 3 ];\n > arr.push( arr );\n > var bool = isCircularArray( arr )\n true\n > bool = isCircularArray( [] )\n false\n > bool = isCircularArray( null )\n false\n\n See Also\n --------\n isCircular, isCircularPlainObject\n",
"isCircularPlainObject": "\nisCircularPlainObject( value )\n Tests if a value is a plain object containing a circular reference.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a plain object containing a\n circular reference.\n\n Examples\n --------\n > var obj = { 'beep': 'boop' };\n > obj.self = obj;\n > var bool = isCircularPlainObject( obj )\n true\n > bool = isCircularPlainObject( {} )\n false\n > bool = isCircularPlainObject( null )\n false\n\n See Also\n --------\n isCircular, isCircularArray\n",
"isCollection": "\nisCollection( value )\n Tests if a value is a collection.\n\n A collection is defined as an array, typed array, or an array-like object\n (excluding strings and functions).\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a collection.\n\n Examples\n --------\n > var bool = isCollection( [] )\n true\n > bool = isCollection( { 'length': 0 } )\n true\n > bool = isCollection( {} )\n false\n\n See Also\n --------\n isArrayLike\n",
"isComplex": "\nisComplex( value )\n Tests if a value is a 64-bit or 128-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 64-bit or 128-bit complex\n number.\n\n Examples\n --------\n > var bool = isComplex( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplex( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplex( 3.14 )\n false\n > bool = isComplex( {} )\n false\n\n See Also\n --------\n isComplex64, isComplex128\n",
"isComplex64": "\nisComplex64( value )\n Tests if a value is a 64-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 64-bit complex number.\n\n Examples\n --------\n > var bool = isComplex64( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplex64( new Complex128( 3.0, 1.0 ) )\n false\n > bool = isComplex64( 3.14 )\n false\n > bool = isComplex64( {} )\n false\n\n See Also\n --------\n isComplex, isComplex128\n",
"isComplex64Array": "\nisComplex64Array( value )\n Tests if a value is a Complex64Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Complex64Array.\n\n Examples\n --------\n > var bool = isComplex64Array( new Complex64Array( 10 ) )\n true\n > bool = isComplex64Array( [] )\n false\n\n See Also\n --------\n isComplex, isComplex64, isComplex128Array, isComplexTypedArray\n",
"isComplex128": "\nisComplex128( value )\n Tests if a value is a 128-bit complex number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 128-bit complex number.\n\n Examples\n --------\n > var bool = isComplex128( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplex128( new Complex64( 2.0, 2.0 ) )\n false\n > bool = isComplex128( 3.14 )\n false\n > bool = isComplex128( {} )\n false\n\n See Also\n --------\n isComplex, isComplex64\n",
"isComplex128Array": "\nisComplex128Array( value )\n Tests if a value is a Complex128Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Complex128Array.\n\n Examples\n --------\n > var bool = isComplex128Array( new Complex128Array( 10 ) )\n true\n > bool = isComplex128Array( [] )\n false\n\n See Also\n --------\n isComplex, isComplex128, isComplex64Array, isComplexTypedArray\n",
"isComplexLike": "\nisComplexLike( value )\n Tests if a value is a complex number-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a complex number-like object.\n\n Examples\n --------\n > var bool = isComplexLike( new Complex64( 2.0, 2.0 ) )\n true\n > bool = isComplexLike( new Complex128( 3.0, 1.0 ) )\n true\n > bool = isComplexLike( 3.14 )\n false\n > bool = isComplexLike( {} )\n false\n\n See Also\n --------\n isComplex, isComplex64, isComplex128\n",
"isComplexTypedArray": "\nisComplexTypedArray( value )\n Tests if a value is a complex typed array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a complex typed array.\n\n Examples\n --------\n > var bool = isComplexTypedArray( new Complex64Array( 10 ) )\n true\n\n See Also\n --------\n isComplex, isComplex64Array, isComplex128Array\n",
"isConfigurableProperty": "\nisConfigurableProperty( value, property )\n Tests if an object's own property is configurable.\n\n A property is configurable if the property may be deleted or its descriptor\n may be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isConfigurableProperty( obj, 'boop' )\n true\n > bool = isConfigurableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isConfigurablePropertyIn": "\nisConfigurablePropertyIn( value, property )\n Tests if an object's own or inherited property is configurable.\n\n A property is configurable if the property may be deleted or its descriptor\n may be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is\n configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isConfigurablePropertyIn( obj, 'boop' )\n true\n > bool = isConfigurablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurableProperty, isEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isDataProperty": "\nisDataProperty( value, property )\n Tests if an object's own property has a data descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property has a data descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isDataProperty( obj, 'boop' )\n true\n > bool = isDataProperty( obj, 'beep' )\n false\n\n See Also\n --------\n hasOwnProp, isAccessorProperty, isDataPropertyIn\n",
"isDataPropertyIn": "\nisDataPropertyIn( value, property )\n Tests if an object's own or inherited property has a data descriptor.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property has a data\n descriptor.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.get = function getter() { return 'beep'; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isDataPropertyIn( obj, 'boop' )\n true\n > bool = isDataPropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n hasProp, isAccessorPropertyIn, isDataProperty\n",
"isDateObject": "\nisDateObject( value )\n Tests if a value is a Date object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Date object.\n\n Examples\n --------\n > var bool = isDateObject( new Date() )\n true\n > bool = isDateObject( '2017-01-01' )\n false\n\n",
"isDigitString": "\nisDigitString( str )\n Tests whether a string contains only numeric digits.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only numeric digits.\n\n Examples\n --------\n > var bool = isDigitString( '0123456789' )\n true\n > bool = isDigitString( 'abcdef' )\n false\n > bool = isDigitString( '0xff' )\n false\n > bool = isDigitString( '' )\n false\n\n See Also\n --------\n isHexString, isString\n",
"isEmailAddress": "\nisEmailAddress( value )\n Tests if a value is an email address.\n\n Validation is not rigorous. *9* RFCs relate to email addresses, and\n accounting for all of them is a fool's errand. The function performs the\n simplest validation; i.e., requiring at least one `@` symbol.\n\n For rigorous validation, send a confirmation email. If the email bounces,\n consider the email invalid.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an email address.\n\n Examples\n --------\n > var bool = isEmailAddress( '[email protected]' )\n true\n > bool = isEmailAddress( 'beep' )\n false\n > bool = isEmailAddress( null )\n false\n\n",
"isEmptyArray": "\nisEmptyArray( value )\n Tests if a value is an empty array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty array.\n\n Examples\n --------\n > var bool = isEmptyArray( [] )\n true\n > bool = isEmptyArray( [ 1, 2, 3 ] )\n false\n > bool = isEmptyArray( {} )\n false\n\n See Also\n --------\n isArray\n",
"isEmptyObject": "\nisEmptyObject( value )\n Tests if a value is an empty object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty object.\n\n Examples\n --------\n > var bool = isEmptyObject( {} )\n true\n > bool = isEmptyObject( { 'beep': 'boop' } )\n false\n > bool = isEmptyObject( [] )\n false\n\n See Also\n --------\n isObject, isPlainObject\n",
"isEmptyString": "\nisEmptyString( value )\n Tests if a value is an empty string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is an empty string.\n\n Examples\n --------\n > var bool = isEmptyString( '' )\n true\n > bool = isEmptyString( new String( '' ) )\n true\n > bool = isEmptyString( 'beep' )\n false\n > bool = isEmptyString( [] )\n false\n\n\nisEmptyString.isPrimitive( value )\n Tests if a value is an empty string primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an empty string primitive.\n\n Examples\n --------\n > var bool = isEmptyString.isPrimitive( '' )\n true\n > bool = isEmptyString.isPrimitive( new String( '' ) )\n false\n\n\nisEmptyString.isObject( value )\n Tests if a value is an empty `String` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an empty `String` object.\n\n Examples\n --------\n > var bool = isEmptyString.isObject( new String( '' ) )\n true\n > bool = isEmptyString.isObject( '' )\n false\n\n See Also\n --------\n isString\n",
"isEnumerableProperty": "\nisEnumerableProperty( value, property )\n Tests if an object's own property is enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is enumerable.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isEnumerableProperty( beep, 'boop' )\n true\n > bool = isEnumerableProperty( beep, 'hasOwnProperty' )\n false\n\n See Also\n --------\n isConfigurableProperty, isEnumerablePropertyIn, isNonEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isEnumerablePropertyIn": "\nisEnumerablePropertyIn( value, property )\n Tests if an object's own or inherited property is enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is\n enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = true;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isEnumerablePropertyIn( obj, 'boop' )\n true\n > bool = isEnumerablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerableProperty, isNonEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isError": "\nisError( value )\n Tests if a value is an Error object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Error object.\n\n Examples\n --------\n > var bool = isError( new Error( 'beep' ) )\n true\n > bool = isError( {} )\n false\n\n",
"isEvalError": "\nisEvalError( value )\n Tests if a value is an EvalError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided an EvalError (or a descendant) object,\n false positives may occur due to the fact that the EvalError constructor\n inherits from Error and has no internal class of its own. Hence, EvalError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an EvalError object.\n\n Examples\n --------\n > var bool = isEvalError( new EvalError( 'beep' ) )\n true\n > bool = isEvalError( {} )\n false\n\n See Also\n --------\n isError\n",
"isEven": "\nisEven( value )\n Tests if a value is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether is an even number.\n\n Examples\n --------\n > var bool = isEven( 4.0 )\n true\n > bool = isEven( new Number( 4.0 ) )\n true\n > bool = isEven( 3.0 )\n false\n > bool = isEven( -3.14 )\n false\n > bool = isEven( null )\n false\n\n\nisEven.isPrimitive( value )\n Tests if a value is a number primitive that is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive that is an even\n number.\n\n Examples\n --------\n > var bool = isEven.isPrimitive( -4.0 )\n true\n > bool = isEven.isPrimitive( new Number( -4.0 ) )\n false\n\n\nisEven.isObject( value )\n Tests if a value is a number object that is an even number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object that is an even\n number.\n\n Examples\n --------\n > var bool = isEven.isObject( 4.0 )\n false\n > bool = isEven.isObject( new Number( 4.0 ) )\n true\n\n See Also\n --------\n isOdd\n",
"isFalsy": "\nisFalsy( value )\n Tests if a value is a value which translates to `false` when evaluated in a\n boolean context.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is falsy.\n\n Examples\n --------\n > var bool = isFalsy( false )\n true\n > bool = isFalsy( '' )\n true\n > bool = isFalsy( 0 )\n true\n > bool = isFalsy( null )\n true\n > bool = isFalsy( void 0 )\n true\n > bool = isFalsy( NaN )\n true\n > bool = isFalsy( {} )\n false\n > bool = isFalsy( [] )\n false\n\n See Also\n --------\n isFalsyArray, isTruthy\n",
"isFalsyArray": "\nisFalsyArray( value )\n Tests if a value is an array-like object containing only falsy values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only falsy values.\n\n Examples\n --------\n > var bool = isFalsyArray( [ null, '' ] )\n true\n > bool = isFalsyArray( [ {}, [] ] )\n false\n > bool = isFalsyArray( [] )\n false\n\n See Also\n --------\n isFalsy, isTruthyArray\n",
"isFinite": "\nisFinite( value )\n Tests if a value is a finite number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a finite number.\n\n Examples\n --------\n > var bool = isFinite( 5.0 )\n true\n > bool = isFinite( new Number( 5.0 ) )\n true\n > bool = isFinite( 1.0/0.0 )\n false\n > bool = isFinite( null )\n false\n\n\nisFinite.isPrimitive( value )\n Tests if a value is a number primitive having a finite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive having a finite\n value.\n\n Examples\n --------\n > var bool = isFinite.isPrimitive( -3.0 )\n true\n > bool = isFinite.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisFinite.isObject( value )\n Tests if a value is a number object having a finite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a finite\n value.\n\n Examples\n --------\n > var bool = isFinite.isObject( 3.0 )\n false\n > bool = isFinite.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isFiniteArray, isInfinite\n",
"isFiniteArray": "\nisFiniteArray( value )\n Tests if a value is an array-like object of finite numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object of finite\n numbers.\n\n Examples\n --------\n > var bool = isFiniteArray( [ -3.0, new Number(0.0), 2.0 ] )\n true\n > bool = isFiniteArray( [ -3.0, 1.0/0.0 ] )\n false\n\n\nisFiniteArray.primitives( value )\n Tests if a value is an array-like object containing only primitive finite\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only primitive finite numbers.\n\n Examples\n --------\n > var bool = isFiniteArray.primitives( [ -1.0, 10.0 ] )\n true\n > bool = isFiniteArray.primitives( [ -1.0, 0.0, 5.0 ] )\n true\n > bool = isFiniteArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisFiniteArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having finite values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only number objects having finite values.\n\n Examples\n --------\n > var bool = isFiniteArray.objects( [ new Number(1.0), new Number(3.0) ] )\n true\n > bool = isFiniteArray.objects( [ -1.0, 0.0, 3.0 ] )\n false\n > bool = isFiniteArray.objects( [ 3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isFinite, isInfinite\n",
"isFloat32Array": "\nisFloat32Array( value )\n Tests if a value is a Float32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Float32Array.\n\n Examples\n --------\n > var bool = isFloat32Array( new Float32Array( 10 ) )\n true\n > bool = isFloat32Array( [] )\n false\n\n See Also\n --------\n isFloat64Array\n",
"isFloat64Array": "\nisFloat64Array( value )\n Tests if a value is a Float64Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Float64Array.\n\n Examples\n --------\n > var bool = isFloat64Array( new Float64Array( 10 ) )\n true\n > bool = isFloat64Array( [] )\n false\n\n See Also\n --------\n isFloat32Array\n",
"isFunction": "\nisFunction( value )\n Tests if a value is a function.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a function.\n\n Examples\n --------\n > function beep() {};\n > var bool = isFunction( beep )\n true\n > bool = isFunction( {} )\n false\n\n",
"isFunctionArray": "\nisFunctionArray( value )\n Tests if a value is an array-like object containing only functions.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n functions.\n\n Examples\n --------\n > function beep() {};\n > function boop() {};\n > var bool = isFunctionArray( [ beep, boop ] )\n true\n > bool = isFunctionArray( [ {}, beep ] )\n false\n > bool = isFunctionArray( [] )\n false\n\n See Also\n --------\n isArray\n",
"isGeneratorObject": "\nisGeneratorObject( value )\n Tests if a value is a generator object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a generator object.\n\n Examples\n --------\n > function* generateID() {\n ... var idx = 0;\n ... while ( idx < idx+1 ) {\n ... yield idx;\n ... idx += 1;\n ... }\n ... };\n > var bool = isGeneratorObject( generateID() )\n true\n > bool = isGeneratorObject( generateID )\n false\n > bool = isGeneratorObject( {} )\n false\n > bool = isGeneratorObject( null )\n false\n\n See Also\n --------\n hasGeneratorSupport, isGeneratorObjectLike\n",
"isGeneratorObjectLike": "\nisGeneratorObjectLike( value )\n Tests if a value is generator object-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is generator object-like.\n\n Examples\n --------\n > var obj = {\n ... 'next': function noop() {},\n ... 'return': function noop() {},\n ... 'throw': function noop() {}\n ... };\n > var bool = isGeneratorObjectLike( obj )\n true\n > bool = isGeneratorObjectLike( {} )\n false\n > bool = isGeneratorObjectLike( null )\n false\n\n See Also\n --------\n hasGeneratorSupport, isGeneratorObject\n",
"isHexString": "\nisHexString( str )\n Tests whether a string contains only hexadecimal digits.\n\n The function does not recognize `x` (as in the standard `0x` prefix).\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only hexadecimal digits.\n\n Examples\n --------\n > var bool = isHexString( '0123456789abcdefABCDEF' )\n true\n > bool = isHexString( '0xffffff' )\n false\n > bool = isHexString( 'x' )\n false\n > bool = isHexString( '' )\n false\n\n See Also\n --------\n isString\n",
"isInfinite": "\nisInfinite( value )\n Tests if a value is an infinite number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an infinite number.\n\n Examples\n --------\n > var bool = isInfinite( 1.0/0.0 )\n true\n > bool = isInfinite( new Number( -1.0/0.0 ) )\n true\n > bool = isInfinite( 5.0 )\n false\n > bool = isInfinite( '1.0/0.0' )\n false\n\n\nisInfinite.isPrimitive( value )\n Tests if a value is a number primitive having an infinite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive having an\n infinite value.\n\n Examples\n --------\n > var bool = isInfinite.isPrimitive( -1.0/0.0 )\n true\n > bool = isInfinite.isPrimitive( new Number( -1.0/0.0 ) )\n false\n\n\nisInfinite.isObject( value )\n Tests if a value is a number object having an infinite value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having an infinite\n value.\n\n Examples\n --------\n > var bool = isInfinite.isObject( 1.0/0.0 )\n false\n > bool = isInfinite.isObject( new Number( 1.0/0.0 ) )\n true\n\n See Also\n --------\n isFinite\n",
"isInheritedProperty": "\nisInheritedProperty( value, property )\n Tests if an object has an inherited property.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has an inherited property.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isInheritedProperty( beep, 'boop' )\n false\n > bool = isInheritedProperty( beep, 'toString' )\n true\n > bool = isInheritedProperty( beep, 'bop' )\n false\n\n See Also\n --------\n hasOwnProp, hasProp\n",
"isInt8Array": "\nisInt8Array( value )\n Tests if a value is an Int8Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int8Array.\n\n Examples\n --------\n > var bool = isInt8Array( new Int8Array( 10 ) )\n true\n > bool = isInt8Array( [] )\n false\n\n See Also\n --------\n isInt16Array, isInt32Array\n",
"isInt16Array": "\nisInt16Array( value )\n Tests if a value is an Int16Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int16Array.\n\n Examples\n --------\n > var bool = isInt16Array( new Int16Array( 10 ) )\n true\n > bool = isInt16Array( [] )\n false\n\n See Also\n --------\n isInt32Array, isInt8Array\n",
"isInt32Array": "\nisInt32Array( value )\n Tests if a value is an Int32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an Int32Array.\n\n Examples\n --------\n > var bool = isInt32Array( new Int32Array( 10 ) )\n true\n > bool = isInt32Array( [] )\n false\n\n See Also\n --------\n isInt16Array, isInt8Array\n",
"isInteger": "\nisInteger( value )\n Tests if a value is an integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an integer.\n\n Examples\n --------\n > var bool = isInteger( 5.0 )\n true\n > bool = isInteger( new Number( 5.0 ) )\n true\n > bool = isInteger( -3.14 )\n false\n > bool = isInteger( null )\n false\n\n\nisInteger.isPrimitive( value )\n Tests if a value is a number primitive having an integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having an integer\n value.\n\n Examples\n --------\n > var bool = isInteger.isPrimitive( -3.0 )\n true\n > bool = isInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisInteger.isObject( value )\n Tests if a value is a number object having an integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having an integer\n value.\n\n Examples\n --------\n > var bool = isInteger.isObject( 3.0 )\n false\n > bool = isInteger.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isNumber\n",
"isIntegerArray": "\nisIntegerArray( value )\n Tests if a value is an array-like object of integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object of integer\n values.\n\n Examples\n --------\n > var bool = isIntegerArray( [ -3.0, new Number(0.0), 2.0 ] )\n true\n > bool = isIntegerArray( [ -3.0, '3.0' ] )\n false\n\n\nisIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only primitive integer\n values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only primitive integer values.\n\n Examples\n --------\n > var bool = isIntegerArray.primitives( [ -1.0, 10.0 ] )\n true\n > bool = isIntegerArray.primitives( [ -1.0, 0.0, 5.0 ] )\n true\n > bool = isIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only number objects having integer values.\n\n Examples\n --------\n > var bool = isIntegerArray.objects( [ new Number(1.0), new Number(3.0) ] )\n true\n > bool = isIntegerArray.objects( [ -1.0, 0.0, 3.0 ] )\n false\n > bool = isIntegerArray.objects( [ 3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isJSON": "\nisJSON( value )\n Tests if a value is a parseable JSON string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a parseable JSON string.\n\n Examples\n --------\n > var bool = isJSON( '{\"a\":5}' )\n true\n > bool = isJSON( '{a\":5}' )\n false\n\n",
"isLeapYear": "\nisLeapYear( value )\n Tests whether a value corresponds to a leap year in the Gregorian calendar.\n\n A leap year is defined as any year which is exactly divisible by 4, except\n for years which are exactly divisible by 100 and not by 400. In this\n definition, 100 corresponds to years marking a new century, and 400\n corresponds to the length of the *leap cycle*.\n\n If not provided any arguments, the function returns a boolean indicating\n if the current year (according to local time) is a leap year.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value corresponds to a leap year.\n\n Examples\n --------\n > var bool = isLeapYear( new Date() )\n <boolean>\n > bool = isLeapYear( 1996 )\n true\n > bool = isLeapYear( 2001 )\n false\n\n",
"isLowercase": "\nisLowercase( value )\n Tests if a value is a lowercase string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a lowercase string.\n\n Examples\n --------\n > var bool = isLowercase( 'hello' )\n true\n > bool = isLowercase( 'World' )\n false\n\n See Also\n --------\n isString, isUppercase\n",
"isMatrixLike": "\nisMatrixLike( value )\n Tests if a value is a 2-dimensional ndarray-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 2-dimensional ndarray-like\n object.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 2;\n > M.shape = [ 2, 2 ];\n > M.strides = [ 2, 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isMatrixLike( M )\n true\n > bool = isMatrixLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isMatrixLike( 3.14 )\n false\n > bool = isMatrixLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isndarrayLike, isTypedArrayLike, isVectorLike\n",
"isMethod": "\nisMethod( value, property )\n Tests if an object has a specified method name.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Property arguments are coerced to strings.\n\n The function only searches own properties.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified method name.\n\n Examples\n --------\n > var beep = { 'boop': function beep() { return 'beep'; } };\n > var bool = isMethod( beep, 'boop' )\n true\n > bool = isMethod( beep, 'toString' )\n false\n\n See Also\n --------\n hasOwnProp, isFunction, isMethodIn\n",
"isMethodIn": "\nisMethodIn( value, property )\n Tests if an object has a specified method name, either own or inherited.\n\n Value arguments other than `null` or `undefined` are coerced to objects.\n\n Non-symbol property arguments are coerced to strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object has a specified method name.\n\n Examples\n --------\n > var beep = { 'boop': true };\n > var bool = isMethodIn( beep, 'toString' )\n true\n > bool = isMethodIn( beep, 'boop' )\n false\n > bool = isMethodIn( beep, 'bop' )\n false\n\n See Also\n --------\n hasProp, isFunction, isMethod\n",
"isNamedTypedTupleLike": "\nisNamedTypedTupleLike( value )\n Tests if a value is named typed tuple-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is named typed tuple-like.\n\n Examples\n --------\n > var Point = namedtypedtuple( [ 'x', 'y' ] );\n > var p = new Point();\n > var bool = isNamedTypedTupleLike( p )\n true\n > bool = isNamedTypedTupleLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isNamedTypedTupleLike( 3.14 )\n false\n > bool = isNamedTypedTupleLike( {} )\n false\n\n See Also\n --------\n namedtypedtuple\n",
"isnan": "\nisnan( value )\n Tests if a value is NaN.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is NaN.\n\n Examples\n --------\n > var bool = isnan( NaN )\n true\n > bool = isnan( new Number( NaN ) )\n true\n > bool = isnan( 3.14 )\n false\n > bool = isnan( null )\n false\n\n\nisnan.isPrimitive( value )\n Tests if a value is a NaN number primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a NaN number primitive.\n\n Examples\n --------\n > var bool = isnan.isPrimitive( NaN )\n true\n > bool = isnan.isPrimitive( 3.14 )\n false\n > bool = isnan.isPrimitive( new Number( NaN ) )\n false\n\n\nisnan.isObject( value )\n Tests if a value is a number object having a value of NaN.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a value of\n NaN.\n\n Examples\n --------\n > var bool = isnan.isObject( NaN )\n false\n > bool = isnan.isObject( new Number( NaN ) )\n true\n\n See Also\n --------\n isNumber\n",
"isNaNArray": "\nisNaNArray( value )\n Tests if a value is an array-like object containing only NaN values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n NaN values.\n\n Examples\n --------\n > var bool = isNaNArray( [ NaN, NaN, NaN ] )\n true\n > bool = isNaNArray( [ NaN, 2 ] )\n false\n\n\nisNaNArray.primitives( value )\n Tests if a value is an array-like object containing only primitive NaN\n values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive NaN values.\n\n Examples\n --------\n > var bool = isNaNArray.primitives( [ NaN, new Number( NaN ) ] )\n false\n > bool = isNaNArray.primitives( [ NaN, NaN, NaN ] )\n true\n\n\nisNaNArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having NaN values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having NaN values.\n\n Examples\n --------\n > var bool = isNaNArray.objects( [ new Number( NaN ), new Number( NaN ) ] )\n true\n > bool = isNaNArray.objects( [ NaN, new Number( NaN ), new Number( NaN ) ] )\n false\n > bool = isNaNArray.objects( [ NaN, NaN, NaN ] )\n false\n\n See Also\n --------\n isnan\n",
"isNativeFunction": "\nisNativeFunction( value )\n Tests if a value is a native function.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a native function.\n\n Examples\n --------\n > var bool = isNativeFunction( Date )\n true\n > function beep() {};\n > bool = isNativeFunction( beep )\n false\n > bool = isNativeFunction( {} )\n false\n\n See Also\n --------\n isFunction\n",
"isndarrayLike": "\nisndarrayLike( value )\n Tests if a value is ndarray-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is ndarray-like.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 2;\n > M.shape = [ 2, 2 ];\n > M.strides = [ 2, 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isndarrayLike( M )\n true\n > bool = isndarrayLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isndarrayLike( 3.14 )\n false\n > bool = isndarrayLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isMatrixLike, isTypedArrayLike, isVectorLike\n",
"isNegativeInteger": "\nisNegativeInteger( value )\n Tests if a value is a negative integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a negative integer.\n\n Examples\n --------\n > var bool = isNegativeInteger( -5.0 )\n true\n > bool = isNegativeInteger( new Number( -5.0 ) )\n true\n > bool = isNegativeInteger( 5.0 )\n false\n > bool = isNegativeInteger( -3.14 )\n false\n > bool = isNegativeInteger( null )\n false\n\n\nisNegativeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a negative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a negative\n integer value.\n\n Examples\n --------\n > var bool = isNegativeInteger.isPrimitive( -3.0 )\n true\n > bool = isNegativeInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNegativeInteger.isObject( value )\n Tests if a value is a number object having a negative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a negative\n integer value.\n\n Examples\n --------\n > var bool = isNegativeInteger.isObject( -3.0 )\n false\n > bool = isNegativeInteger.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNegativeIntegerArray": "\nisNegativeIntegerArray( value )\n Tests if a value is an array-like object containing only negative integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative integers.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNegativeIntegerArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNegativeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only negative primitive\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative primitive integer values.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray.primitives( [ -1.0, -10.0 ] )\n true\n > bool = isNegativeIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNegativeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having negative integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having negative integer values.\n\n Examples\n --------\n > var bool = isNegativeIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNegativeIntegerArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeIntegerArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNegativeNumber": "\nisNegativeNumber( value )\n Tests if a value is a negative number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a negative number.\n\n Examples\n --------\n > var bool = isNegativeNumber( -5.0 )\n true\n > bool = isNegativeNumber( new Number( -5.0 ) )\n true\n > bool = isNegativeNumber( -3.14 )\n true\n > bool = isNegativeNumber( 5.0 )\n false\n > bool = isNegativeNumber( null )\n false\n\n\nisNegativeNumber.isPrimitive( value )\n Tests if a value is a number primitive having a negative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a negative\n value.\n\n Examples\n --------\n > var bool = isNegativeNumber.isPrimitive( -3.0 )\n true\n > bool = isNegativeNumber.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNegativeNumber.isObject( value )\n Tests if a value is a number object having a negative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a negative\n value.\n\n Examples\n --------\n > var bool = isNegativeNumber.isObject( -3.0 )\n false\n > bool = isNegativeNumber.isObject( new Number( -3.0 ) )\n true\n\n See Also\n --------\n isNumber\n",
"isNegativeNumberArray": "\nisNegativeNumberArray( value )\n Tests if a value is an array-like object containing only negative numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n negative numbers.\n\n Examples\n --------\n > var bool = isNegativeNumberArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNegativeNumberArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNegativeNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive negative\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive negative numbers.\n\n Examples\n --------\n > var bool = isNegativeNumberArray.primitives( [ -1.0, -10.0 ] )\n true\n > bool = isNegativeNumberArray.primitives( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeNumberArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNegativeNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having negative number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having negative number values.\n\n Examples\n --------\n > var bool = isNegativeNumberArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNegativeNumberArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNegativeNumberArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNegativeZero": "\nisNegativeZero( value )\n Tests if a value is negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero( -0.0 )\n true\n > bool = isNegativeZero( new Number( -0.0 ) )\n true\n > bool = isNegativeZero( -3.14 )\n false\n > bool = isNegativeZero( 0.0 )\n false\n > bool = isNegativeZero( null )\n false\n\n\nisNegativeZero.isPrimitive( value )\n Tests if a value is a number primitive equal to negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive equal to\n negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero.isPrimitive( -0.0 )\n true\n > bool = isNegativeZero.isPrimitive( new Number( -0.0 ) )\n false\n\n\nisNegativeZero.isObject( value )\n Tests if a value is a number object having a value equal to negative zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a value\n equal to negative zero.\n\n Examples\n --------\n > var bool = isNegativeZero.isObject( -0.0 )\n false\n > bool = isNegativeZero.isObject( new Number( -0.0 ) )\n true\n\n See Also\n --------\n isNumber, isPositiveZero\n",
"isNodeBuiltin": "\nisNodeBuiltin( str )\n Tests whether a string matches a Node.js built-in module name.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string matches a Node.js built-in module\n name.\n\n Examples\n --------\n > var bool = isNodeBuiltin( 'cluster' )\n true\n > bool = isNodeBuiltin( 'crypto' )\n true\n > bool = isNodeBuiltin( 'fs-extra' )\n false\n > bool = isNodeBuiltin( '' )\n false\n\n",
"isNodeDuplexStreamLike": "\nisNodeDuplexStreamLike( value )\n Tests if a value is Node duplex stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node duplex stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Duplex;\n > s = new Stream();\n > var bool = isNodeDuplexStreamLike( s )\n true\n > bool = isNodeDuplexStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeReadableStreamLike": "\nisNodeReadableStreamLike( value )\n Tests if a value is Node readable stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node readable stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Readable;\n > s = new Stream();\n > var bool = isNodeReadableStreamLike( s )\n true\n > bool = isNodeReadableStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeREPL": "\nisNodeREPL()\n Returns a boolean indicating if running in a Node.js REPL environment.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if running in a Node.js REPL environment.\n\n Examples\n --------\n > var bool = isNodeREPL()\n <boolean>\n\n",
"isNodeStreamLike": "\nisNodeStreamLike( value )\n Tests if a value is Node stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Stream;\n > s = new Stream();\n > var bool = isNodeStreamLike( s )\n true\n > bool = isNodeStreamLike( {} )\n false\n\n",
"isNodeTransformStreamLike": "\nisNodeTransformStreamLike( value )\n Tests if a value is Node transform stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node transform stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Transform;\n > s = new Stream();\n > var bool = isNodeTransformStreamLike( s )\n true\n > bool = isNodeTransformStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNodeWritableStreamLike": "\nisNodeWritableStreamLike( value )\n Tests if a value is Node writable stream-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is Node writable stream-like.\n\n Examples\n --------\n > var Stream = require( 'stream' ).Writable;\n > s = new Stream();\n > var bool = isNodeWritableStreamLike( s )\n true\n > bool = isNodeWritableStreamLike( {} )\n false\n\n See Also\n --------\n isNodeStreamLike\n",
"isNonConfigurableProperty": "\nisNonConfigurableProperty( value, property )\n Tests if an object's own property is non-configurable.\n\n A non-configurable property is a property which cannot be deleted and whose\n descriptor cannot be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is non-configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonConfigurableProperty( obj, 'boop' )\n false\n > bool = isNonConfigurableProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurableProperty, isEnumerableProperty, isNonConfigurablePropertyIn, isNonEnumerableProperty, isReadableProperty, isWritableProperty\n",
"isNonConfigurablePropertyIn": "\nisNonConfigurablePropertyIn( value, property )\n Tests if an object's own or inherited property is non-configurable.\n\n A non-configurable property is a property which cannot be deleted and whose\n descriptor cannot be changed.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is non-\n configurable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonConfigurablePropertyIn( obj, 'boop' )\n false\n > bool = isNonConfigurablePropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerablePropertyIn, isNonConfigurableProperty, isNonEnumerablePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isNonEnumerableProperty": "\nisNonEnumerableProperty( value, property )\n Tests if an object's own property is non-enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is non-enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonEnumerableProperty( obj, 'boop' )\n false\n > bool = isNonEnumerableProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurableProperty, isEnumerableProperty, isNonConfigurableProperty, isNonEnumerablePropertyIn, isReadableProperty, isWritableProperty\n",
"isNonEnumerablePropertyIn": "\nisNonEnumerablePropertyIn( value, property )\n Tests if an object's own or inherited property is non-enumerable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is non-\n enumerable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = true;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isNonEnumerablePropertyIn( obj, 'boop' )\n false\n > bool = isNonEnumerablePropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isConfigurablePropertyIn, isEnumerablePropertyIn, isNonConfigurablePropertyIn, isNonEnumerableProperty, isReadablePropertyIn, isWritablePropertyIn\n",
"isNonNegativeInteger": "\nisNonNegativeInteger( value )\n Tests if a value is a nonnegative integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonnegative integer.\n\n Examples\n --------\n > var bool = isNonNegativeInteger( 5.0 )\n true\n > bool = isNonNegativeInteger( new Number( 5.0 ) )\n true\n > bool = isNonNegativeInteger( 3.14 )\n false\n > bool = isNonNegativeInteger( -5.0 )\n false\n > bool = isNonNegativeInteger( null )\n false\n\n\nisNonNegativeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a nonnegative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonnegative integer value.\n\n Examples\n --------\n > var bool = isNonNegativeInteger.isPrimitive( 3.0 )\n true\n > bool = isNonNegativeInteger.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisNonNegativeInteger.isObject( value )\n Tests if a value is a number object having a nonnegative integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonnegative\n integer value.\n\n Examples\n --------\n > var bool = isNonNegativeInteger.isObject( 3.0 )\n false\n > bool = isNonNegativeInteger.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNonNegativeIntegerArray": "\nisNonNegativeIntegerArray( value )\n Tests if a value is an array-like object containing only nonnegative\n integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative integers.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isNonNegativeIntegerArray( [ 3.0, '3.0' ] )\n false\n\n\nisNonNegativeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only nonnegative\n primitive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative primitive integer values.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] )\n true\n > bool = isNonNegativeIntegerArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisNonNegativeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonnegative integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonnegative integer values.\n\n Examples\n --------\n > var bool = isNonNegativeIntegerArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isNonNegativeIntegerArray.objects( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isNonNegativeIntegerArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonNegativeNumber": "\nisNonNegativeNumber( value )\n Tests if a value is a nonnegative number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonnegative number.\n\n Examples\n --------\n > var bool = isNonNegativeNumber( 5.0 )\n true\n > bool = isNonNegativeNumber( new Number( 5.0 ) )\n true\n > bool = isNonNegativeNumber( 3.14 )\n true\n > bool = isNonNegativeNumber( -5.0 )\n false\n > bool = isNonNegativeNumber( null )\n false\n\n\nisNonNegativeNumber.isPrimitive( value )\n Tests if a value is a number primitive having a nonnegative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonnegative value.\n\n Examples\n --------\n > var bool = isNonNegativeNumber.isPrimitive( 3.0 )\n true\n > bool = isNonNegativeNumber.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisNonNegativeNumber.isObject( value )\n Tests if a value is a number object having a nonnegative value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonnegative\n value.\n\n Examples\n --------\n > var bool = isNonNegativeNumber.isObject( 3.0 )\n false\n > bool = isNonNegativeNumber.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isNonNegativeNumberArray": "\nisNonNegativeNumberArray( value )\n Tests if a value is an array-like object containing only nonnegative\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonnegative numbers.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isNonNegativeNumberArray( [ 3.0, '3.0' ] )\n false\n\n\nisNonNegativeNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n nonnegative numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive nonnegative numbers.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray.primitives( [ 1.0, 0.0, 10.0 ] )\n true\n > bool = isNonNegativeNumberArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisNonNegativeNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonnegative number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonnegative number values.\n\n Examples\n --------\n > var bool = isNonNegativeNumberArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isNonNegativeNumberArray.objects( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isNonNegativeNumberArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonPositiveInteger": "\nisNonPositiveInteger( value )\n Tests if a value is a nonpositive integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonpositive integer.\n\n Examples\n --------\n > var bool = isNonPositiveInteger( -5.0 )\n true\n > bool = isNonPositiveInteger( new Number( -5.0 ) )\n true\n > bool = isNonPositiveInteger( 5.0 )\n false\n > bool = isNonPositiveInteger( -3.14 )\n false\n > bool = isNonPositiveInteger( null )\n false\n\n\nisNonPositiveInteger.isPrimitive( value )\n Tests if a value is a number primitive having a nonpositive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonpositive integer value.\n\n Examples\n --------\n > var bool = isNonPositiveInteger.isPrimitive( -3.0 )\n true\n > bool = isNonPositiveInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNonPositiveInteger.isObject( value )\n Tests if a value is a number object having a nonpositive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonpositive\n integer value.\n\n Examples\n --------\n > var bool = isNonPositiveInteger.isObject( -3.0 )\n false\n > bool = isNonPositiveInteger.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isNonPositiveIntegerArray": "\nisNonPositiveIntegerArray( value )\n Tests if a value is an array-like object containing only nonpositive\n integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive integers.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNonPositiveIntegerArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNonPositiveIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only nonpositive\n primitive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive primitive integer values.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray.primitives( [ -1.0, 0.0, -10.0 ] )\n true\n > bool = isNonPositiveIntegerArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNonPositiveIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonpositive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonpositive integer values.\n\n Examples\n --------\n > var bool = isNonPositiveIntegerArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNonPositiveIntegerArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNonPositiveIntegerArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonPositiveNumber": "\nisNonPositiveNumber( value )\n Tests if a value is a nonpositive number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a nonpositive number.\n\n Examples\n --------\n > var bool = isNonPositiveNumber( -5.0 )\n true\n > bool = isNonPositiveNumber( new Number( -5.0 ) )\n true\n > bool = isNonPositiveNumber( -3.14 )\n true\n > bool = isNonPositiveNumber( 5.0 )\n false\n > bool = isNonPositiveNumber( null )\n false\n\n\nisNonPositiveNumber.isPrimitive( value )\n Tests if a value is a number primitive having a nonpositive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n nonpositive value.\n\n Examples\n --------\n > var bool = isNonPositiveNumber.isPrimitive( -3.0 )\n true\n > bool = isNonPositiveNumber.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisNonPositiveNumber.isObject( value )\n Tests if a value is a number object having a nonpositive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a nonpositive\n value.\n\n Examples\n --------\n > var bool = isNonPositiveNumber.isObject( -3.0 )\n false\n > bool = isNonPositiveNumber.isObject( new Number( -3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isNonPositiveNumberArray": "\nisNonPositiveNumberArray( value )\n Tests if a value is an array-like object containing only nonpositive\n numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n nonpositive numbers.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray( [ -3.0, new Number(-3.0) ] )\n true\n > bool = isNonPositiveNumberArray( [ -3.0, '-3.0' ] )\n false\n\n\nisNonPositiveNumberArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n nonpositive numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive nonpositive numbers.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray.primitives( [ -1.0, 0.0, -10.0 ] )\n true\n > bool = isNonPositiveNumberArray.primitives( [ -3.0, new Number(-1.0) ] )\n false\n\n\nisNonPositiveNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having nonpositive number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having nonpositive number values.\n\n Examples\n --------\n > var bool = isNonPositiveNumberArray.objects( [ new Number(-1.0), new Number(-10.0) ] )\n true\n > bool = isNonPositiveNumberArray.objects( [ -1.0, 0.0, -10.0 ] )\n false\n > bool = isNonPositiveNumberArray.objects( [ -3.0, new Number(-1.0) ] )\n false\n\n See Also\n --------\n isArray\n",
"isNonSymmetricMatrix": "\nisNonSymmetricMatrix( value )\n Tests if a value is a non-symmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a non-symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 2, 3, 4 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isNonSymmetricMatrix( M )\n true\n > bool = isNonSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isNonSymmetricMatrix( 3.14 )\n false\n > bool = isNonSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isNull": "\nisNull( value )\n Tests if a value is null.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is null.\n\n Examples\n --------\n > var bool = isNull( null )\n true\n > bool = isNull( true )\n false\n\n See Also\n --------\n isUndefined, isUndefinedOrNull\n",
"isNullArray": "\nisNullArray( value )\n Tests if a value is an array-like object containing only null values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n null values.\n\n Examples\n --------\n > var bool = isNullArray( [ null, null, null ] )\n true\n > bool = isNullArray( [ NaN, 2, null ] )\n false\n\n See Also\n --------\n isArray, isNull\n",
"isNumber": "\nisNumber( value )\n Tests if a value is a number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number.\n\n Examples\n --------\n > var bool = isNumber( 3.14 )\n true\n > bool = isNumber( new Number( 3.14 ) )\n true\n > bool = isNumber( NaN )\n true\n > bool = isNumber( null )\n false\n\n\nisNumber.isPrimitive( value )\n Tests if a value is a number primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive.\n\n Examples\n --------\n > var bool = isNumber.isPrimitive( 3.14 )\n true\n > bool = isNumber.isPrimitive( NaN )\n true\n > bool = isNumber.isPrimitive( new Number( 3.14 ) )\n false\n\n\nisNumber.isObject( value )\n Tests if a value is a `Number` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `Number` object.\n\n Examples\n --------\n > var bool = isNumber.isObject( 3.14 )\n false\n > bool = isNumber.isObject( new Number( 3.14 ) )\n true\n\n",
"isNumberArray": "\nisNumberArray( value )\n Tests if a value is an array-like object containing only numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n numbers.\n\n Examples\n --------\n > var bool = isNumberArray( [ 1, 2, 3 ] )\n true\n > bool = isNumberArray( [ '1', 2, 3 ] )\n false\n\n\nisNumberArray.primitives( value )\n Tests if a value is an array-like object containing only number primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number primitives.\n\n Examples\n --------\n > var arr = [ 1, 2, 3 ];\n > var bool = isNumberArray.primitives( arr )\n true\n > arr = [ 1, new Number( 2 ) ];\n > bool = isNumberArray.primitives( arr )\n false\n\n\nisNumberArray.objects( value )\n Tests if a value is an array-like object containing only `Number` objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n `Number` objects.\n\n Examples\n --------\n > var arr = [ new Number( 1 ), new Number( 2 ) ];\n > var bool = isNumberArray.objects( arr )\n true\n > arr = [ new Number( 1 ), 2 ];\n > bool = isNumberArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isNumber, isNumericArray\n",
"isNumericArray": "\nisNumericArray( value )\n Tests if a value is a numeric array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a value is a numeric array.\n\n Examples\n --------\n > var bool = isNumericArray( new Int8Array( 10 ) )\n true\n > bool = isNumericArray( [ 1, 2, 3 ] )\n true\n > bool = isNumericArray( [ '1', '2', '3' ] )\n false\n\n See Also\n --------\n isArray, isNumberArray, isTypedArray\n\n",
"isObject": "\nisObject( value )\n Tests if a value is an object; e.g., `{}`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an object.\n\n Examples\n --------\n > var bool = isObject( {} )\n true\n > bool = isObject( true )\n false\n\n See Also\n --------\n isObjectLike, isPlainObject\n",
"isObjectArray": "\nisObjectArray( value )\n Tests if a value is an array-like object containing only objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n objects.\n\n Examples\n --------\n > var bool = isObjectArray( [ {}, new Number(3.0) ] )\n true\n > bool = isObjectArray( [ {}, { 'beep': 'boop' } ] )\n true\n > bool = isObjectArray( [ {}, '3.0' ] )\n false\n\n See Also\n --------\n isArray, isObject\n",
"isObjectLike": "\nisObjectLike( value )\n Tests if a value is object-like.\n\n Return values are the same as would be obtained using the built-in `typeof`\n operator except that `null` is not considered an object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is object-like.\n\n Examples\n --------\n > var bool = isObjectLike( {} )\n true\n > bool = isObjectLike( [] )\n true\n > bool = isObjectLike( null )\n false\n\n See Also\n --------\n isObject, isPlainObject\n",
"isOdd": "\nisOdd( value )\n Tests if a value is an odd number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an odd number.\n\n Examples\n --------\n > var bool = isOdd( 5.0 )\n true\n > bool = isOdd( new Number( 5.0 ) )\n true\n > bool = isOdd( 4.0 )\n false\n > bool = isOdd( new Number( 4.0 ) )\n false\n > bool = isOdd( -3.14 )\n false\n > bool = isOdd( null )\n false\n\nisOdd.isPrimitive( value )\n Tests if a value is a number primitive that is an odd number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive that is an odd\n number.\n\n Examples\n --------\n > var bool = isOdd.isPrimitive( -5.0 )\n true\n > bool = isOdd.isPrimitive( new Number( -5.0 ) )\n false\n\n\nisOdd.isObject( value )\n Tests if a value is a number object that has an odd number value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object that has an odd\n number value.\n\n Examples\n --------\n > var bool = isOdd.isObject( 5.0 )\n false\n > bool = isOdd.isObject( new Number( 5.0 ) )\n true\n\n See Also\n --------\n isEven\n",
"isoWeeksInYear": "\nisoWeeksInYear( [year] )\n Returns the number of ISO weeks in a year according to the Gregorian\n calendar.\n\n By default, the function returns the number of ISO weeks in the current year\n (according to local time). To determine the number of ISO weeks for a\n particular year, provide either a year or a `Date` object.\n\n Parameters\n ----------\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Number of ISO weeks in a year.\n\n Examples\n --------\n > var num = isoWeeksInYear()\n <number>\n > num = isoWeeksInYear( 2015 )\n 53\n > num = isoWeeksInYear( 2017 )\n 52\n\n",
"isPersymmetricMatrix": "\nisPersymmetricMatrix( value )\n Tests if a value is a square matrix which is symmetric about its\n antidiagonal.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a persymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 2, 3, 1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isPersymmetricMatrix( M )\n true\n > bool = isPersymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isPersymmetricMatrix( 3.14 )\n false\n > bool = isPersymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSquareMatrix, isSymmetricMatrix\n",
"isPlainObject": "\nisPlainObject( value )\n Tests if a value is a plain object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a plain object.\n\n Examples\n --------\n > var bool = isPlainObject( {} )\n true\n > bool = isPlainObject( null )\n false\n\n See Also\n --------\n isObject\n",
"isPlainObjectArray": "\nisPlainObjectArray( value )\n Tests if a value is an array-like object containing only plain objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n plain objects.\n\n Examples\n --------\n > var bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] )\n true\n > bool = isPlainObjectArray( [ {}, new Number(3.0) ] )\n false\n > bool = isPlainObjectArray( [ {}, '3.0' ] )\n false\n\n See Also\n --------\n isArray, isPlainObject\n",
"isPositiveInteger": "\nisPositiveInteger( value )\n Tests if a value is a positive integer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a positive integer.\n\n Examples\n --------\n > var bool = isPositiveInteger( 5.0 )\n true\n > bool = isPositiveInteger( new Number( 5.0 ) )\n true\n > bool = isPositiveInteger( 3.14 )\n false\n > bool = isPositiveInteger( -5.0 )\n false\n > bool = isPositiveInteger( null )\n false\n\n\nisPositiveInteger.isPrimitive( value )\n Tests if a value is a number primitive having a positive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a\n positive integer value.\n\n Examples\n --------\n > var bool = isPositiveInteger.isPrimitive( 3.0 )\n true\n > bool = isPositiveInteger.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisPositiveInteger.isObject( value )\n Tests if a value is a number object having a positive integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a positive\n integer value.\n\n Examples\n --------\n > var bool = isPositiveInteger.isObject( 3.0 )\n false\n > bool = isPositiveInteger.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isInteger\n",
"isPositiveIntegerArray": "\nisPositiveIntegerArray( value )\n Tests if a value is an array-like object containing only positive integers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive integers.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isPositiveIntegerArray( [ 3.0, '3.0' ] )\n false\n\n\nisPositiveIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only positive primitive\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive primitive integer values.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray.primitives( [ 1.0, 10.0 ] )\n true\n > bool = isPositiveIntegerArray.primitives( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isPositiveIntegerArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisPositiveIntegerArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having positive integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having positive integer values.\n\n Examples\n --------\n > var bool = isPositiveIntegerArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isPositiveIntegerArray.objects( [ 1.0, 2.0, 10.0 ] )\n false\n > bool = isPositiveIntegerArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray, isInteger, isPositiveInteger\n",
"isPositiveNumber": "\nisPositiveNumber( value )\n Tests if a value is a positive number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a positive number.\n\n Examples\n --------\n > var bool = isPositiveNumber( 5.0 )\n true\n > bool = isPositiveNumber( new Number( 5.0 ) )\n true\n > bool = isPositiveNumber( 3.14 )\n true\n > bool = isPositiveNumber( -5.0 )\n false\n > bool = isPositiveNumber( null )\n false\n\n\nisPositiveNumber.isPrimitive( value )\n Tests if a value is a number primitive having a positive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a positive\n value.\n\n Examples\n --------\n > var bool = isPositiveNumber.isPrimitive( 3.0 )\n true\n > bool = isPositiveNumber.isPrimitive( new Number( 3.0 ) )\n false\n\n\nisPositiveNumber.isObject( value )\n Tests if a value is a number object having a positive value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a positive\n value.\n\n Examples\n --------\n > var bool = isPositiveNumber.isObject( 3.0 )\n false\n > bool = isPositiveNumber.isObject( new Number( 3.0 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isPositiveNumberArray": "\nisPositiveNumberArray( value )\n Tests if a value is an array-like object containing only positive numbers.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive numbers.\n\n Examples\n --------\n > var bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] )\n true\n > bool = isPositiveNumberArray( [ 3.0, '3.0' ] )\n false\n\n\nisPositiveNumberArray.primitives( value )\n Tests if a value is an array-like object containing only positive primitive\n number values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n positive primitive number values.\n\n Examples\n --------\n > var bool = isPositiveNumberArray.primitives( [ 1.0, 10.0 ] )\n true\n > bool = isPositiveNumberArray.primitives( [ 1.0, 0.0, 10.0 ] )\n false\n > bool = isPositiveNumberArray.primitives( [ 3.0, new Number(1.0) ] )\n false\n\n\nisPositiveNumberArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having positive values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having positive values.\n\n Examples\n --------\n > var bool = isPositiveNumberArray.objects( [ new Number(1.0), new Number(10.0) ] )\n true\n > bool = isPositiveNumberArray.objects( [ 1.0, 2.0, 10.0 ] )\n false\n > bool = isPositiveNumberArray.objects( [ 3.0, new Number(1.0) ] )\n false\n\n See Also\n --------\n isArray, isNumber, isPositiveNumber\n",
"isPositiveZero": "\nisPositiveZero( value )\n Tests if a value is positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero( 0.0 )\n true\n > bool = isPositiveZero( new Number( 0.0 ) )\n true\n > bool = isPositiveZero( -3.14 )\n false\n > bool = isPositiveZero( -0.0 )\n false\n > bool = isPositiveZero( null )\n false\n\n\nisPositiveZero.isPrimitive( value )\n Tests if a value is a number primitive equal to positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number primitive equal to\n positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero.isPrimitive( 0.0 )\n true\n > bool = isPositiveZero.isPrimitive( new Number( 0.0 ) )\n false\n\n\nisPositiveZero.isObject( value )\n Tests if a value is a number object having a value equal to positive zero.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a number object having a value\n equal to positive zero.\n\n Examples\n --------\n > var bool = isPositiveZero.isObject( 0.0 )\n false\n > bool = isPositiveZero.isObject( new Number( 0.0 ) )\n true\n\n See Also\n --------\n isNumber, isNegativeZero\n",
"isPrimitive": "\nisPrimitive( value )\n Tests if a value is a JavaScript primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a JavaScript primitive.\n\n Examples\n --------\n > var bool = isPrimitive( true )\n true\n > bool = isPrimitive( {} )\n false\n\n See Also\n --------\n isBoxedPrimitive\n",
"isPrimitiveArray": "\nisPrimitiveArray( value )\n Tests if a value is an array-like object containing only JavaScript\n primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n JavaScript primitives.\n\n Examples\n --------\n > var bool = isPrimitiveArray( [ '3', 2, null ] )\n true\n > bool = isPrimitiveArray( [ {}, 2, 1 ] )\n false\n > bool = isPrimitiveArray( [ new String('abc'), '3.0' ] )\n false\n\n See Also\n --------\n isArray, isPrimitive\n",
"isPRNGLike": "\nisPRNGLike( value )\n Tests if a value is PRNG-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is PRNG-like.\n\n Examples\n --------\n > var bool = isPRNGLike( base.random.randu )\n true\n > bool = isPRNGLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isPRNGLike( 3.14 )\n false\n > bool = isPRNGLike( {} )\n false\n\n",
"isProbability": "\nisProbability( value )\n Tests if a value is a probability.\n\n A probability is defined as a numeric value on the interval [0,1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a probability.\n\n Examples\n --------\n > var bool = isProbability( 0.5 )\n true\n > bool = isProbability( new Number( 0.5 ) )\n true\n > bool = isProbability( 3.14 )\n false\n > bool = isProbability( -5.0 )\n false\n > bool = isProbability( null )\n false\n\n\nisProbability.isPrimitive( value )\n Tests if a value is a number primitive which is a probability.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive which is a\n probability.\n\n Examples\n --------\n > var bool = isProbability.isPrimitive( 0.3 )\n true\n > bool = isProbability.isPrimitive( new Number( 0.3 ) )\n false\n\n\nisProbability.isObject( value )\n Tests if a value is a number object having a value which is a probability.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number object having a value which\n is a probability.\n\n Examples\n --------\n > var bool = isProbability.isObject( 0.77 )\n false\n > bool = isProbability.isObject( new Number( 0.77 ) )\n true\n\n\n See Also\n --------\n isNumber\n",
"isProbabilityArray": "\nisProbabilityArray( value )\n Tests if a value is an array-like object containing only probabilities.\n\n A probability is defined as a numeric value on the interval [0,1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n probabilities.\n\n Examples\n --------\n > var bool = isProbabilityArray( [ 0.5, new Number(0.8) ] )\n true\n > bool = isProbabilityArray( [ 0.8, 1.2 ] )\n false\n > bool = isProbabilityArray( [ 0.8, '0.2' ] )\n false\n\n\nisProbabilityArray.primitives( value )\n Tests if a value is an array-like object containing only primitive\n probabilities.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive probabilities.\n\n Examples\n --------\n > var bool = isProbabilityArray.primitives( [ 1.0, 0.0, 0.5 ] )\n true\n > bool = isProbabilityArray.primitives( [ 0.3, new Number(0.4) ] )\n false\n\n\nisProbabilityArray.objects( value )\n Tests if a value is an array-like object containing only number objects\n having probability values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n number objects having probability values.\n\n Examples\n --------\n > var bool = isProbabilityArray.objects( [ new Number(0.7), new Number(1.0) ] )\n true\n > bool = isProbabilityArray.objects( [ 1.0, 0.0, new Number(0.7) ] )\n false\n\n See Also\n --------\n isArray, isProbability\n",
"isPrototypeOf": "\nisPrototypeOf( value, proto )\n Tests if an object's prototype chain contains a provided prototype.\n\n The function returns `false` if provided a primitive value.\n\n This function is generally more robust than the `instanceof` operator (e.g.,\n where inheritance is performed without using constructors).\n\n Parameters\n ----------\n value: any\n Input value.\n\n proto: Object|Function\n Prototype.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if a provided prototype exists in a prototype chain.\n\n Examples\n --------\n > function Foo() { return this; };\n > function Bar() { return this; };\n > inherit( Bar, Foo );\n > var bar = new Bar();\n > var bool = isPrototypeOf( bar, Foo.prototype )\n true\n\n See Also\n --------\n getPrototypeOf\n",
"isRangeError": "\nisRangeError( value )\n Tests if a value is a RangeError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a RangeError (or a descendant) object,\n false positives may occur due to the fact that the RangeError constructor\n inherits from Error and has no internal class of its own. Hence, RangeError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a RangeError object.\n\n Examples\n --------\n > var bool = isRangeError( new RangeError( 'beep' ) )\n true\n > bool = isRangeError( {} )\n false\n\n See Also\n --------\n isError\n",
"isReadableProperty": "\nisReadableProperty( value, property )\n Tests if an object's own property is readable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is readable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadableProperty( obj, 'boop' )\n true\n > bool = isReadableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWriteProperty, isReadablePropertyIn, isWritableProperty\n",
"isReadablePropertyIn": "\nisReadablePropertyIn( value, property )\n Tests if an object's own or inherited property is readable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is readable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadablePropertyIn( obj, 'boop' )\n true\n > bool = isReadablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWritePropertyIn, isReadableProperty, isWritablePropertyIn\n",
"isReadOnlyProperty": "\nisReadOnlyProperty( value, property )\n Tests if an object's own property is read-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is read-only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = false;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadOnlyProperty( obj, 'boop' )\n true\n > bool = isReadOnlyProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWriteProperty, isReadableProperty, isWritableProperty\n",
"isReadOnlyPropertyIn": "\nisReadOnlyPropertyIn( value, property )\n Tests if an object's own or inherited property is read-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is read-\n only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.writable = false;\n > desc.value = true;\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadOnlyPropertyIn( obj, 'boop' )\n true\n > bool = isReadOnlyPropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWritePropertyIn, isReadablePropertyIn, isWritablePropertyIn\n",
"isReadWriteProperty": "\nisReadWriteProperty( value, property )\n Tests if an object's own property is readable and writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is readable and writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadWriteProperty( obj, 'boop' )\n true\n > bool = isReadWriteProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyProperty, isReadWritePropertyIn, isReadableProperty, isWritableProperty\n",
"isReadWritePropertyIn": "\nisReadWritePropertyIn( value, property )\n Tests if an object's own or inherited property is readable and writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is readable\n and writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isReadWritePropertyIn( obj, 'boop' )\n true\n > bool = isReadWritePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWriteProperty, isReadablePropertyIn, isWritablePropertyIn\n",
"isReferenceError": "\nisReferenceError( value )\n Tests if a value is a ReferenceError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a ReferenceError (or a descendant)\n object, false positives may occur due to the fact that the ReferenceError\n constructor inherits from Error and has no internal class of its own.\n Hence, ReferenceError impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a ReferenceError object.\n\n Examples\n --------\n > var bool = isReferenceError( new ReferenceError( 'beep' ) )\n true\n > bool = isReferenceError( {} )\n false\n\n See Also\n --------\n isError\n",
"isRegExp": "\nisRegExp( value )\n Tests if a value is a regular expression.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a regular expression.\n\n Examples\n --------\n > var bool = isRegExp( /\\.+/ )\n true\n > bool = isRegExp( {} )\n false\n\n",
"isRegExpString": "\nisRegExpString( value )\n Tests if a value is a regular expression string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a regular expression string.\n\n Examples\n --------\n > var bool = isRegExpString( '/beep/' )\n true\n > bool = isRegExpString( 'beep' )\n false\n > bool = isRegExpString( '' )\n false\n > bool = isRegExpString( null )\n false\n\n See Also\n --------\n isRegExp\n",
"isRelativePath": "\nisRelativePath( value )\n Tests if a value is a relative path.\n\n Function behavior is platform-specific. On Windows platforms, the function\n is equal to `.win32()`. On POSIX platforms, the function is equal to\n `.posix()`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a relative path.\n\n Examples\n --------\n // Windows environments:\n > var bool = isRelativePath( 'foo\\\\bar\\\\baz' )\n true\n\n // POSIX environments:\n > bool = isRelativePath( './foo/bar/baz' )\n true\n\n\nisRelativePath.posix( value )\n Tests if a value is a POSIX relative path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a POSIX relative path.\n\n Examples\n --------\n > var bool = isRelativePath.posix( './foo/bar/baz' )\n true\n > bool = isRelativePath.posix( '/foo/../bar/baz' )\n false\n\n\nisRelativePath.win32( value )\n Tests if a value is a Windows relative path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Windows relative path.\n\n Examples\n --------\n > var bool = isRelativePath( 'foo\\\\bar\\\\baz' )\n true\n > bool = isRelativePath( 'C:\\\\foo\\\\..\\\\bar\\\\baz' )\n false\n\n See Also\n --------\n isAbsolutePath\n",
"isSafeInteger": "\nisSafeInteger( value )\n Tests if a value is a safe integer.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a safe integer.\n\n Examples\n --------\n > var bool = isSafeInteger( 5.0 )\n true\n > bool = isSafeInteger( new Number( 5.0 ) )\n true\n > bool = isSafeInteger( 2.0e200 )\n false\n > bool = isSafeInteger( -3.14 )\n false\n > bool = isSafeInteger( null )\n false\n\n\nisSafeInteger.isPrimitive( value )\n Tests if a value is a number primitive having a safe integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a number primitive having a safe\n integer value.\n\n Examples\n --------\n > var bool = isSafeInteger.isPrimitive( -3.0 )\n true\n > bool = isSafeInteger.isPrimitive( new Number( -3.0 ) )\n false\n\n\nisSafeInteger.isObject( value )\n Tests if a value is a `Number` object having a safe integer value.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `Number` object having a safe\n integer value.\n\n Examples\n --------\n > var bool = isSafeInteger.isObject( 3.0 )\n false\n > bool = isSafeInteger.isObject( new Number( 3.0 ) )\n true\n\n See Also\n --------\n isInteger, isNumber\n",
"isSafeIntegerArray": "\nisSafeIntegerArray( value )\n Tests if a value is an array-like object containing only safe integers.\n\n An integer valued number is \"safe\" when the number can be exactly\n represented as a double-precision floating-point number.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing\n only safe integers.\n\n Examples\n --------\n > var arr = [ -3.0, new Number(0.0), 2.0 ];\n > var bool = isSafeIntegerArray( arr )\n true\n > arr = [ -3.0, '3.0' ];\n > bool = isSafeIntegerArray( arr )\n false\n\n\nisSafeIntegerArray.primitives( value )\n Tests if a value is an array-like object containing only primitive safe\n integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n primitive safe integer values.\n\n Examples\n --------\n > var arr = [ -1.0, 10.0 ];\n > var bool = isSafeIntegerArray.primitives( arr )\n true\n > arr = [ -1.0, 0.0, 5.0 ];\n > bool = isSafeIntegerArray.primitives( arr )\n true\n > arr = [ -3.0, new Number(-1.0) ];\n > bool = isSafeIntegerArray.primitives( arr )\n false\n\n\nisSafeIntegerArray.objects( value )\n Tests if a value is an array-like object containing only `Number` objects\n having safe integer values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array-like object containing only\n `Number` objects having safe integer values.\n\n Examples\n --------\n > var arr = [ new Number(1.0), new Number(3.0) ];\n > var bool = isSafeIntegerArray.objects( arr )\n true\n > arr = [ -1.0, 0.0, 3.0 ];\n > bool = isSafeIntegerArray.objects( arr )\n false\n > arr = [ 3.0, new Number(-1.0) ];\n > bool = isSafeIntegerArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isSafeInteger\n",
"isSameValue": "\nisSameValue( a, b )\n Tests if two arguments are the same value.\n\n The function differs from the `===` operator in that the function treats\n `-0` and `+0` as distinct and `NaNs` as the same.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are the same value.\n\n Examples\n --------\n > var bool = isSameValue( true, true )\n true\n > bool = isSameValue( {}, {} )\n false\n > bool = isSameValue( -0.0, -0.0 )\n true\n > bool = isSameValue( -0.0, 0.0 )\n false\n > bool = isSameValue( NaN, NaN )\n true\n\n See Also\n --------\n isSameValueZero, isStrictEqual\n",
"isSameValueZero": "\nisSameValueZero( a, b )\n Tests if two arguments are the same value.\n\n The function differs from the `===` operator in that the function treats\n `NaNs` as the same.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are the same value.\n\n Examples\n --------\n > var bool = isSameValueZero( true, true )\n true\n > bool = isSameValueZero( {}, {} )\n false\n > bool = isSameValueZero( -0.0, -0.0 )\n true\n > bool = isSameValueZero( -0.0, 0.0 )\n true\n > bool = isSameValueZero( NaN, NaN )\n true\n\n See Also\n --------\n isSameValue, isStrictEqual\n",
"isSharedArrayBuffer": "\nisSharedArrayBuffer( value )\n Tests if a value is a SharedArrayBuffer.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a SharedArrayBuffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffer...\n > var bool = isSharedArrayBuffer( new SharedArrayBuffer( 10 ) )\n true\n > bool = isSharedArrayBuffer( [] )\n false\n\n See Also\n --------\n isArrayBuffer, isTypedArray\n",
"isSkewCentrosymmetricMatrix": "\nisSkewCentrosymmetricMatrix( value )\n Tests if a value is a skew-centrosymmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-centrosymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 2, 1, -1, -2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewCentrosymmetricMatrix( M )\n true\n > bool = isSkewCentrosymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewCentrosymmetricMatrix( 3.14 )\n false\n > bool = isSkewCentrosymmetricMatrix( {} )\n false\n\n See Also\n --------\n isCentrosymmetricMatrix, isMatrixLike, isSkewSymmetricMatrix\n",
"isSkewPersymmetricMatrix": "\nisSkewPersymmetricMatrix( value )\n Tests if a value is a skew-persymmetric matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-persymmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 1, 0, 0, -1 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewPersymmetricMatrix( M )\n true\n > bool = isSkewPersymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewPersymmetricMatrix( 3.14 )\n false\n > bool = isSkewPersymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isPersymmetricMatrix, isSkewSymmetricMatrix\n",
"isSkewSymmetricMatrix": "\nisSkewSymmetricMatrix( value )\n Tests if a value is a skew-symmetric (or antisymmetric) matrix.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a skew-symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, -1, 1, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSkewSymmetricMatrix( M )\n true\n > bool = isSkewSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSkewSymmetricMatrix( 3.14 )\n false\n > bool = isSkewSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSkewSymmetricMatrix, isSquareMatrix\n",
"isSquareMatrix": "\nisSquareMatrix( value )\n Tests if a value is a 2-dimensional ndarray-like object having equal\n dimensions.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 2-dimensional ndarray-like\n object having equal dimensions.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, 0, 0, 0 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSquareMatrix( M )\n true\n > bool = isSquareMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSquareMatrix( 3.14 )\n false\n > bool = isSquareMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isSymmetricMatrix\n",
"isStrictEqual": "\nisStrictEqual( a, b )\n Tests if two arguments are strictly equal.\n\n The function differs from the `===` operator in that the function treats\n `-0` and `+0` as distinct.\n\n Parameters\n ----------\n a: any\n First input value.\n\n b: any\n Second input value.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether two arguments are strictly equal.\n\n Examples\n --------\n > var bool = isStrictEqual( true, true )\n true\n > bool = isStrictEqual( {}, {} )\n false\n > bool = isStrictEqual( -0.0, -0.0 )\n true\n > bool = isStrictEqual( -0.0, 0.0 )\n false\n > bool = isStrictEqual( NaN, NaN )\n false\n\n See Also\n --------\n isSameValue\n",
"isString": "\nisString( value )\n Tests if a value is a string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string.\n\n Examples\n --------\n > var bool = isString( 'beep' )\n true\n > bool = isString( new String( 'beep' ) )\n true\n > bool = isString( 5 )\n false\n\n\nisString.isPrimitive( value )\n Tests if a value is a string primitive.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a string primitive.\n\n Examples\n --------\n > var bool = isString.isPrimitive( 'beep' )\n true\n > bool = isString.isPrimitive( new String( 'beep' ) )\n false\n\n\nisString.isObject( value )\n Tests if a value is a `String` object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a `String` object.\n\n Examples\n --------\n > var bool = isString.isObject( new String( 'beep' ) )\n true\n > bool = isString.isObject( 'beep' )\n false\n\n",
"isStringArray": "\nisStringArray( value )\n Tests if a value is an array of strings.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of strings.\n\n Examples\n --------\n > var bool = isStringArray( [ 'abc', 'def' ] )\n true\n > bool = isStringArray( [ 'abc', 123 ] )\n false\n\n\nisStringArray.primitives( value )\n Tests if a value is an array containing only string primitives.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing only string\n primitives.\n\n Examples\n --------\n > var arr = [ 'abc', 'def' ];\n > var bool = isStringArray.primitives( arr )\n true\n > arr = [ 'abc', new String( 'def' ) ];\n > bool = isStringArray.primitives( arr )\n false\n\n\nisStringArray.objects( value )\n Tests if a value is an array containing only `String` objects.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array containing only `String`\n objects.\n\n Examples\n --------\n > var arr = [ new String( 'ab' ), new String( 'cd' ) ];\n > var bool = isStringArray.objects( arr )\n true\n > arr = [ new String( 'abc' ), 'def' ];\n > bool = isStringArray.objects( arr )\n false\n\n See Also\n --------\n isArray, isString\n",
"isSymbol": "\nisSymbol( value )\n Tests if a value is a symbol.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a symbol.\n\n Examples\n --------\n > var bool = isSymbol( Symbol( 'beep' ) )\n true\n > bool = isSymbol( Object( Symbol( 'beep' ) ) )\n true\n > bool = isSymbol( {} )\n false\n > bool = isSymbol( null )\n false\n > bool = isSymbol( true )\n false\n\n",
"isSymbolArray": "\nisSymbolArray( value )\n Tests if a value is an array-like object containing only symbols.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only symbols.\n\n Examples\n --------\n > var bool = isSymbolArray( [ Symbol( 'beep' ), Symbol( 'boop' ) ] )\n true\n > bool = isSymbolArray( Symbol( 'beep' ) )\n false\n > bool = isSymbolArray( [] )\n false\n > bool = isSymbolArray( {} )\n false\n > bool = isSymbolArray( null )\n false\n > bool = isSymbolArray( true )\n false\n\n\nisSymbolArray.primitives( value )\n Tests if a value is an array-like object containing only `symbol`\n primitives.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only `symbol` primitives.\n\n Examples\n --------\n > var bool = isSymbolArray.primitives( [ Symbol( 'beep' ) ] )\n true\n > bool = isSymbolArray.primitives( [ Object( Symbol( 'beep' ) ) ] )\n false\n > bool = isSymbolArray.primitives( [] )\n false\n > bool = isSymbolArray.primitives( {} )\n false\n > bool = isSymbolArray.primitives( null )\n false\n > bool = isSymbolArray.primitives( true )\n false\n\n\nisSymbolArray.objects( value )\n Tests if a value is an array-like object containing only `Symbol`\n objects.\n\n In pre-ES2015 environments, the function always returns `false`.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only `Symbol` objects.\n\n Examples\n --------\n > var bool = isSymbolArray.objects( [ Object( Symbol( 'beep' ) ) ] )\n true\n > bool = isSymbolArray.objects( [ Symbol( 'beep' ) ] )\n false\n > bool = isSymbolArray.objects( [] )\n false\n > bool = isSymbolArray.objects( {} )\n false\n > bool = isSymbolArray.objects( null )\n false\n > bool = isSymbolArray.objects( true )\n false\n\n See Also\n --------\n isArray, isSymbol\n",
"isSymmetricMatrix": "\nisSymmetricMatrix( value )\n Tests if a value is a square matrix which equals its transpose.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a symmetric matrix.\n\n Examples\n --------\n > var mat = ndarray( 'generic', 2 );\n > var M = mat( [ 0, 1, 1, 2 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' );\n > var bool = isSymmetricMatrix( M )\n true\n > bool = isSymmetricMatrix( [ 1, 2, 3, 4 ] )\n false\n > bool = isSymmetricMatrix( 3.14 )\n false\n > bool = isSymmetricMatrix( {} )\n false\n\n See Also\n --------\n isMatrixLike, isNonSymmetricMatrix, isSquareMatrix\n",
"isSyntaxError": "\nisSyntaxError( value )\n Tests if a value is a SyntaxError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a SyntaxError (or a descendant) object,\n false positives may occur due to the fact that the SyntaxError constructor\n inherits from Error and has no internal class of its own. Hence, SyntaxError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a SyntaxError object.\n\n Examples\n --------\n > var bool = isSyntaxError( new SyntaxError( 'beep' ) )\n true\n > bool = isSyntaxError( {} )\n false\n\n See Also\n --------\n isError\n",
"isTruthy": "\nisTruthy( value )\n Tests if a value is a value which translates to `true` when evaluated in a\n boolean context.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is truthy.\n\n Examples\n --------\n > var bool = isTruthy( true )\n true\n > bool = isTruthy( {} )\n true\n > bool = isTruthy( [] )\n true\n > bool = isTruthy( false )\n false\n > bool = isTruthy( '' )\n false\n > bool = isTruthy( 0 )\n false\n > bool = isTruthy( null )\n false\n > bool = isTruthy( void 0 )\n false\n > bool = isTruthy( NaN )\n false\n\n See Also\n --------\n isFalsy\n",
"isTruthyArray": "\nisTruthyArray( value )\n Tests if a value is an array-like object containing only truthy values.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is an array-like object containing\n only truthy values.\n\n Examples\n --------\n > var bool = isTruthyArray( [ {}, [] ] )\n true\n > bool = isTruthyArray( [ null, '' ] )\n false\n > bool = isTruthyArray( [] )\n false\n\n See Also\n --------\n isFalsyArray, isTruthy\n",
"isTypedArray": "\nisTypedArray( value )\n Tests if a value is a typed array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a typed array.\n\n Examples\n --------\n > var bool = isTypedArray( new Int8Array( 10 ) )\n true\n\n See Also\n --------\n isArray, isTypedArrayLike\n",
"isTypedArrayLength": "\nisTypedArrayLength( value )\n Tests if a value is a valid typed array length.\n\n A valid length property for a typed array instance is any integer value on\n the interval [0, 2^53-1].\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a valid typed array length.\n\n Examples\n --------\n > var bool = isTypedArrayLength( 5 )\n true\n > bool = isTypedArrayLength( 2.0e200 )\n false\n > bool = isTypedArrayLength( -3.14 )\n false\n > bool = isTypedArrayLength( null )\n false\n\n See Also\n --------\n isArrayLength, isTypedArray\n",
"isTypedArrayLike": "\nisTypedArrayLike( value )\n Tests if a value is typed-array-like.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is typed-array-like.\n\n Examples\n --------\n > var bool = isTypedArrayLike( new Int16Array() )\n true\n > bool = isTypedArrayLike({\n ... 'length': 10,\n ... 'byteOffset': 0,\n ... 'byteLength': 10,\n ... 'BYTES_PER_ELEMENT': 4\n ... })\n true\n\n See Also\n --------\n isTypedArray\n",
"isTypeError": "\nisTypeError( value )\n Tests if a value is a TypeError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a TypeError (or a descendant) object,\n false positives may occur due to the fact that the TypeError constructor\n inherits from Error and has no internal class of its own. Hence, TypeError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a TypeError object.\n\n Examples\n --------\n > var bool = isTypeError( new TypeError( 'beep' ) )\n true\n > bool = isTypeError( {} )\n false\n\n See Also\n --------\n isError\n",
"isUint8Array": "\nisUint8Array( value )\n Tests if a value is a Uint8Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint8Array.\n\n Examples\n --------\n > var bool = isUint8Array( new Uint8Array( 10 ) )\n true\n > bool = isUint8Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint16Array, isUint32Array\n",
"isUint8ClampedArray": "\nisUint8ClampedArray( value )\n Tests if a value is a Uint8ClampedArray.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint8ClampedArray.\n\n Examples\n --------\n > var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) )\n true\n > bool = isUint8ClampedArray( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint8Array\n",
"isUint16Array": "\nisUint16Array( value )\n Tests if a value is a Uint16Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint16Array.\n\n Examples\n --------\n > var bool = isUint16Array( new Uint16Array( 10 ) )\n true\n > bool = isUint16Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint32Array, isUint8Array\n",
"isUint32Array": "\nisUint32Array( value )\n Tests if a value is a Uint32Array.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a Uint32Array.\n\n Examples\n --------\n > var bool = isUint32Array( new Uint32Array( 10 ) )\n true\n > bool = isUint32Array( [] )\n false\n\n See Also\n --------\n isTypedArray, isUint16Array, isUint8Array\n",
"isUNCPath": "\nisUNCPath( value )\n Tests if a value is a UNC path.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a UNC path.\n\n Examples\n --------\n > var bool = isUNCPath( '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz' )\n true\n > bool = isUNCPath( '/foo/bar/baz' )\n false\n\n",
"isUndefined": "\nisUndefined( value )\n Tests if a value is undefined.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is undefined.\n\n Examples\n --------\n > var bool = isUndefined( void 0 )\n true\n > bool = isUndefined( null )\n false\n\n See Also\n --------\n isNull, isUndefinedOrNull\n",
"isUndefinedOrNull": "\nisUndefinedOrNull( value )\n Tests if a value is undefined or null.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is undefined or null.\n\n Examples\n --------\n > var bool = isUndefinedOrNull( void 0 )\n true\n > bool = isUndefinedOrNull( null )\n true\n > bool = isUndefinedOrNull( false )\n false\n\n See Also\n --------\n isNull, isUndefined\n",
"isUnityProbabilityArray": "\nisUnityProbabilityArray( value )\n Tests if a value is an array of probabilities that sum to one.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an array of probabilities that sum\n to one.\n\n Examples\n --------\n > var bool = isUnityProbabilityArray( [ 0.25, 0.5, 0.25 ] )\n true\n > bool = isUnityProbabilityArray( new Uint8Array( [ 0, 1 ] ) )\n true\n > bool = isUnityProbabilityArray( [ 0.4, 0.4, 0.4 ] )\n false\n > bool = isUnityProbabilityArray( [ 3.14, 0.0 ] )\n false\n\n See Also\n --------\n isProbability, isProbabilityArray\n",
"isUppercase": "\nisUppercase( value )\n Tests if a value is an uppercase string.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is an uppercase string.\n\n Examples\n --------\n > var bool = isUppercase( 'HELLO' )\n true\n > bool = isUppercase( 'World' )\n false\n\n See Also\n --------\n isLowercase, isString\n",
"isURI": "\nisURI( value )\n Tests if a value is a URI.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a URI.\n\n Examples\n --------\n > var bool = isURI( 'http://google.com' )\n true\n > bool = isURI( 'http://localhost/' )\n true\n > bool = isURI( 'http://example.w3.org/path%20with%20spaces.html' )\n true\n > bool = isURI( 'ftp://ftp.is.co.za/rfc/rfc1808.txt' )\n true\n\n // No scheme:\n > bool = isURI( '' )\n false\n > bool = isURI( 'foo@bar' )\n false\n > bool = isURI( '://foo/' )\n false\n\n // Illegal characters:\n > bool = isURI( 'http://<foo>' )\n false\n\n // Invalid path:\n > bool = isURI( 'http:////foo.html' )\n false\n\n // Incomplete hex escapes:\n > bool = isURI( 'http://example.w3.org/%a' )\n false\n\n",
"isURIError": "\nisURIError( value )\n Tests if a value is a URIError object.\n\n This function should *not* be considered robust. While the function should\n always return `true` if provided a URIError (or a descendant) object,\n false positives may occur due to the fact that the URIError constructor\n inherits from Error and has no internal class of its own. Hence, URIError\n impersonation is possible.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether value is a URIError object.\n\n Examples\n --------\n > var bool = isURIError( new URIError( 'beep' ) )\n true\n > bool = isURIError( {} )\n false\n\n See Also\n --------\n isError\n",
"isVectorLike": "\nisVectorLike( value )\n Tests if a value is a 1-dimensional ndarray-like object.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a value is a 1-dimensional ndarray-like\n object.\n\n Examples\n --------\n > var M = {};\n > M.data = [ 0, 0, 0, 0 ];\n > M.ndims = 1;\n > M.shape = [ 4 ];\n > M.strides = [ 1 ];\n > M.offset = 0;\n > M.order = 'row-major';\n > M.dtype = 'generic';\n > M.length = 4;\n > M.flags = {};\n > M.get = function get( i, j ) {};\n > M.set = function set( i, j ) {};\n > var bool = isVectorLike( M )\n true\n > bool = isVectorLike( [ 1, 2, 3, 4 ] )\n false\n > bool = isVectorLike( 3.14 )\n false\n > bool = isVectorLike( {} )\n false\n\n See Also\n --------\n isArray, isArrayLike, isMatrixLike, isndarrayLike, isTypedArrayLike\n",
"isWhitespace": "\nisWhitespace( str )\n Tests whether a string contains only white space characters.\n\n A white space character is defined as one of the 25 characters defined as a\n white space (\"WSpace=Y\",\"WS\") character in the Unicode 9.0 character\n database, as well as one related white space character without the Unicode\n character property \"WSpace=Y\" (zero width non-breaking space which was\n deprecated as of Unicode 3.2).\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a string contains only white space\n characters.\n\n Examples\n --------\n > var bool = isWhitespace( ' ' )\n true\n > bool = isWhitespace( 'abcdef' )\n false\n > bool = isWhitespace( '' )\n false\n\n See Also\n --------\n RE_WHITESPACE\n",
"isWritableProperty": "\nisWritableProperty( value, property )\n Tests if an object's own property is writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isWritableProperty( obj, 'boop' )\n true\n > bool = isWritableProperty( obj, 'beep' )\n false\n\n See Also\n --------\n isReadableProperty, isReadWriteProperty, isWritablePropertyIn, isWriteOnlyProperty\n",
"isWritablePropertyIn": "\nisWritablePropertyIn( value, property )\n Tests if an object's own or inherited property is writable.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is writable.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'beep';\n > defineProperty( obj, 'beep', desc );\n > var bool = isWritablePropertyIn( obj, 'boop' )\n true\n > bool = isWritablePropertyIn( obj, 'beep' )\n false\n\n See Also\n --------\n isReadablePropertyIn, isReadWritePropertyIn, isWritableProperty, isWriteOnlyPropertyIn\n",
"isWriteOnlyProperty": "\nisWriteOnlyProperty( value, property )\n Tests if an object's own property is write-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own property is write-only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isWriteOnlyProperty( obj, 'boop' )\n false\n > bool = isWriteOnlyProperty( obj, 'beep' )\n true\n\n See Also\n --------\n isReadOnlyProperty, isReadWriteProperty, isWritableProperty, isWriteOnlyPropertyIn\n",
"isWriteOnlyPropertyIn": "\nisWriteOnlyPropertyIn( value, property )\n Tests if an object's own or inherited property is write-only.\n\n Parameters\n ----------\n value: any\n Value to test.\n\n property: any\n Property to test.\n\n Returns\n -------\n bool: boolean\n Boolean indicating if an object's own or inherited property is write-\n only.\n\n Examples\n --------\n > var obj = { 'boop': true };\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = true;\n > desc.set = function setter( v ) { obj.boop = v; };\n > defineProperty( obj, 'beep', desc );\n > var bool = isWriteOnlyPropertyIn( obj, 'boop' )\n false\n > bool = isWriteOnlyPropertyIn( obj, 'beep' )\n true\n\n See Also\n --------\n isReadOnlyPropertyIn, isReadWritePropertyIn, isWritablePropertyIn, isWriteOnlyProperty\n",
"IteratorSymbol": "\nIteratorSymbol\n Iterator symbol.\n\n This symbol specifies the default iterator for an object.\n\n The symbol is only supported in ES6/ES2015+ environments. For non-supporting\n environments, the value is `null`.\n\n Examples\n --------\n > var s = IteratorSymbol\n\n See Also\n --------\n Symbol\n",
"joinStream": "\njoinStream( [options] )\n Returns a transform stream which joins streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = joinStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\njoinStream.factory( [options] )\n Returns a function for creating transform streams for joined streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream: Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = joinStream.factory( opts );\n > var s = createStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\njoinStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream for joining streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to join streamed data. Default: '\\n'.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.readableObjectMode: boolean (optional)\n Specifies whether the readable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = joinStream.objectMode();\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n See Also\n --------\n splitStream\n",
"kde2d": "",
"keyBy": "\nkeyBy( collection, fcn[, thisArg] )\n Converts a collection to an object whose keys are determined by a provided\n function and whose values are the collection values.\n\n When invoked, the input function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If more than one element in a collection resolves to the same key, the key\n value is the collection element which last resolved to the key.\n\n Object values are shallow copies.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Output object.\n\n Examples\n --------\n > function toKey( v ) { return v.a; };\n > var arr = [ { 'a': 1 }, { 'a': 2 } ];\n > keyBy( arr, toKey )\n { '1': { 'a': 1 }, '2': { 'a': 2 } }\n\n See Also\n --------\n forEach\n",
"keyByRight": "\nkeyByRight( collection, fcn[, thisArg] )\n Converts a collection to an object whose keys are determined by a provided\n function and whose values are the collection values, iterating from right to\n left.\n\n When invoked, the input function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If more than one element in a collection resolves to the same key, the key\n value is the collection element which last resolved to the key.\n\n Object values are shallow copies.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: Object\n Output object.\n\n Examples\n --------\n > function toKey( v ) { return v.a; };\n > var arr = [ { 'a': 1 }, { 'a': 2 } ];\n > keyByRight( arr, toKey )\n { '2': { 'a': 2 }, '1': { 'a': 1 } }\n\n See Also\n --------\n forEachRight, keyBy\n",
"keysIn": "\nkeysIn( obj )\n Returns an array of an object's own and inherited enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: any\n Input value.\n\n Returns\n -------\n keys: Array\n Value array.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = keysIn( obj )\n e.g., [ 'beep', 'foo' ]\n\n See Also\n --------\n objectEntriesIn, objectKeys, objectValuesIn\n",
"kruskalTest": "\nkruskalTest( ...x[, options] )\n Computes the Kruskal-Wallis test for equal medians.\n\n Parameters\n ----------\n x: ...Array\n Measured values.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.groups: Array (optional)\n Array of group indicators.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.method: string\n Name of test.\n\n out.df: Object\n Degrees of freedom.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Data from Hollander & Wolfe (1973), p. 116:\n > var x = [ 2.9, 3.0, 2.5, 2.6, 3.2 ];\n > var y = [ 3.8, 2.7, 4.0, 2.4 ];\n > var z = [ 2.8, 3.4, 3.7, 2.2, 2.0 ];\n\n > var out = kruskalTest( x, y, z )\n\n > var arr = [ 2.9, 3.0, 2.5, 2.6, 3.2,\n ... 3.8, 2.7, 4.0, 2.4,\n ... 2.8, 3.4, 3.7, 2.2, 2.0\n ... ];\n > var groups = [\n ... 'a', 'a', 'a', 'a', 'a',\n ... 'b', 'b', 'b', 'b',\n ... 'c', 'c', 'c', 'c', 'c'\n ... ];\n > out = kruskalTest( arr, { 'groups': groups })\n\n",
"kstest": "\nkstest( x, y[, ...params][, options] )\n Computes a Kolmogorov-Smirnov goodness-of-fit test.\n\n For a numeric array or typed array `x`, a Kolmogorov-Smirnov goodness-of-fit\n is computed for the null hypothesis that the values of `x` come from the\n distribution specified by `y`. `y` can be either a string with the name of\n the distribution to test against, or a function.\n\n In the latter case, `y` is expected to be the cumulative distribution\n function (CDF) of the distribution to test against, with its first parameter\n being the value at which to evaluate the CDF and the remaining parameters\n constituting the parameters of the distribution. The parameters of the\n distribution are passed as additional arguments after `y` from `kstest` to\n the chosen CDF. The function returns an object holding the calculated test\n statistic `statistic` and the `pValue` of the test.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the hypothesis test results.\n\n Parameters\n ----------\n x: Array<number>\n Input array holding numeric values.\n\n y: Function|string\n Either a CDF function or a string denoting the name of a distribution.\n\n params: ...number (optional)\n Distribution parameters passed to reference CDF.\n\n options: Object (optional)\n Function options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.sorted: boolean (optional)\n Boolean indicating if the input array is already in sorted order.\n Default: `false`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that the true distribution of `x` is not equal\n to the reference distribution specified by `y` (`two-sided`), whether it\n is `less` than the reference distribution or `greater` than the\n reference distribution. Default: `'two-sided'`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.alternative: string\n Used test alternative. Either `two-sided`, `less` or `greater`.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Verify that data is drawn from a normal distribution:\n > var rnorm = base.random.normal.factory({ 'seed': 4839 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < 100; i++ ) { x[ i ] = rnorm( 3.0, 1.0 ); }\n\n // Test against N(0,1)\n > var out = kstest( x, 'normal', 0.0, 1.0 )\n { pValue: 0.0, statistic: 0.847, ... }\n\n // Test against N(3,1)\n > out = kstest( x, 'normal', 3.0, 1.0 )\n { pValue: 0.6282, statistic: 0.0733, ... }\n\n // Verify that data is drawn from a uniform distribution:\n > runif = base.random.uniform.factory( 0.0, 1.0, { 'seed': 8798 })\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) { x[ i ] = runif(); }\n > out = kstest( x, 'uniform', 0.0, 1.0 )\n { pValue: ~0.703, statistic: ~0.069, ... }\n\n // Print output:\n > out.print()\n Kolmogorov-Smirnov goodness-of-fit test.\n\n Null hypothesis: the CDF of `x` is equal equal to the reference CDF.\n\n pValue: 0.7039\n statistic: 0.0689\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Set custom significance level:\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alpha': 0.1 })\n { pValue: ~0.7039, statistic: ~0.069, ... }\n\n // Carry out one-sided hypothesis tests:\n > runif = base.random.uniform.factory( 0.0, 1.0, { 'seed': 8798 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) { x[ i ] = runif(); }\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alternative': 'less' })\n { pValue: ~0.358, statistic: ~0.07, ... }\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'alternative': 'greater' })\n { pValue: ~0.907, statistic: ~0.02, ... }\n\n // Set `sorted` option to true when data is in increasing order:\n > x = [ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 ];\n > out = kstest( x, 'uniform', 0.0, 1.0, { 'sorted': true })\n { pValue: ~1, statistic: 0.1, ... }\n\n",
"LinkedList": "\nLinkedList()\n Linked list constructor.\n\n Returns\n -------\n list: Object\n Linked list.\n\n list.clear: Function\n Clears the list.\n\n list.first: Function\n Returns the last node. If the list is empty, the returned value is\n `undefined`.\n\n list.insert: Function\n Inserts a value after a provided list node.\n\n list.iterator: Function\n Returns an iterator for iterating over a list. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from list mutation during\n iteration, a returned iterator **always** iterates over a list\n \"snapshot\", which is defined as the list of list elements at the time\n of the method's invocation.\n\n list.last: Function\n Returns the last list node. If the list is empty, the returned value is\n `undefined`.\n\n list.length: integer\n List length.\n\n list.pop: Function\n Removes and returns the last list value. If the list is empty, the\n returned value is `undefined`.\n\n list.push: Function\n Adds a value to the end of the list.\n\n list.remove: Function\n Removes a list node from the list.\n\n list.shift: Function\n Removes and returns the first list value. If the list is empty, the\n returned value is `undefined`.\n\n list.toArray: Function\n Returns an array of list values.\n\n list.toJSON: Function\n Serializes a list as JSON.\n\n list.unshift: Function\n Adds a value to the beginning of the list.\n\n Examples\n --------\n > var list = LinkedList();\n > list.push( 'foo' ).push( 'bar' );\n > list.length\n 2\n > list.pop()\n 'bar'\n > list.length\n 1\n > list.pop()\n 'foo'\n > list.length\n 0\n\n See Also\n --------\n DoublyLinkedList, Stack\n",
"linspace": "\nlinspace( start, stop[, length] )\n Generates a linearly spaced numeric array.\n\n If a `length` is not provided, the default output array length is `100`.\n\n The output array is guaranteed to include the `start` and `stop` values.\n\n Parameters\n ----------\n start: number\n First array value.\n\n stop: number\n Last array value.\n\n length: integer (optional)\n Length of output array. Default: `100`.\n\n Returns\n -------\n arr: Array\n Linearly spaced numeric array.\n\n Examples\n --------\n > var arr = linspace( 0, 100, 6 )\n [ 0, 20, 40, 60, 80, 100 ]\n\n See Also\n --------\n incrspace, logspace\n",
"LIU_NEGATIVE_OPINION_WORDS_EN": "\nLIU_NEGATIVE_OPINION_WORDS_EN()\n Returns a list of negative opinion words.\n\n A word's appearance in a sentence does *not* necessarily imply a positive or\n negative opinion.\n\n The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n\n Returns\n -------\n out: Array<string>\n List of negative opinion words.\n\n Examples\n --------\n > var list = LIU_NEGATIVE_OPINION_WORDS_EN()\n [ '2-faced', '2-faces', 'abnormal', 'abolish', ... ]\n\n References\n ----------\n - Hu, Minqing, and Bing Liu. 2004. \"Mining and Summarizing Customer\n Reviews.\" In *Proceedings of the Tenth Acm Sigkdd International Conference\n on Knowledge Discovery and Data Mining*, 168–77. KDD '04. New York, NY, USA:\n ACM. doi:10.1145/1014052.1014073.\n - Liu, Bing, Minqing Hu, and Junsheng Cheng. 2005. \"Opinion Observer:\n Analyzing and Comparing Opinions on the Web.\" In *Proceedings of the 14th\n International Conference on World Wide Web*, 342–51. WWW '05. New York, NY,\n USA: ACM. doi:10.1145/1060745.1060797.\n\n * If you use the list for publication or third party consumption, please\n cite one of the listed references.\n\n See Also\n --------\n LIU_POSITIVE_OPINION_WORDS_EN\n",
"LIU_POSITIVE_OPINION_WORDS_EN": "\nLIU_POSITIVE_OPINION_WORDS_EN()\n Returns a list of positive opinion words.\n\n A word's appearance in a sentence does *not* necessarily imply a positive or\n negative opinion.\n\n The list includes misspelled words. Their presence is intentional, as such\n misspellings frequently occur in social media content.\n\n Returns\n -------\n out: Array<string>\n List of positive opinion words.\n\n Examples\n --------\n > var list = LIU_POSITIVE_OPINION_WORDS_EN()\n [ 'a+', 'abound', 'abounds', 'abundance', ... ]\n\n References\n ----------\n - Hu, Minqing, and Bing Liu. 2004. 'Mining and Summarizing Customer\n Reviews.' In *Proceedings of the Tenth Acm Sigkdd International Conference\n on Knowledge Discovery and Data Mining*, 168–77. KDD '04. New York, NY, USA:\n ACM. doi:10.1145/1014052.1014073.\n - Liu, Bing, Minqing Hu, and Junsheng Cheng. 2005. 'Opinion Observer:\n Analyzing and Comparing Opinions on the Web.' In *Proceedings of the 14th\n International Conference on World Wide Web*, 342–51. WWW '05. New York, NY,\n USA: ACM. doi:10.1145/1060745.1060797.\n\n * If you use the list for publication or third party consumption, please\n cite one of the listed references.\n\n See Also\n --------\n LIU_NEGATIVE_OPINION_WORDS_EN\n",
"LN_HALF": "\nLN_HALF\n Natural logarithm of `1/2`.\n\n Examples\n --------\n > LN_HALF\n -0.6931471805599453\n\n",
"LN_PI": "\nLN_PI\n Natural logarithm of the mathematical constant `π`.\n\n Examples\n --------\n > LN_PI\n 1.1447298858494002\n\n See Also\n --------\n PI\n",
"LN_SQRT_TWO_PI": "\nLN_SQRT_TWO_PI\n Natural logarithm of the square root of `2π`.\n\n Examples\n --------\n > LN_SQRT_TWO_PI\n 0.9189385332046728\n\n See Also\n --------\n PI\n",
"LN_TWO_PI": "\nLN_TWO_PI\n Natural logarithm of `2π`.\n\n Examples\n --------\n > LN_TWO_PI\n 1.8378770664093456\n\n See Also\n --------\n TWO_PI\n",
"LN2": "\nLN2\n Natural logarithm of `2`.\n\n Examples\n --------\n > LN2\n 0.6931471805599453\n\n See Also\n --------\n LN10\n",
"LN10": "\nLN10\n Natural logarithm of `10`.\n\n Examples\n --------\n > LN10\n 2.302585092994046\n\n See Also\n --------\n LN2\n",
"LOG2E": "\nLOG2E\n Base 2 logarithm of Euler's number.\n\n Examples\n --------\n > LOG2E\n 1.4426950408889634\n\n See Also\n --------\n E, LOG10E\n",
"LOG10E": "\nLOG10E\n Base 10 logarithm of Euler's number.\n\n Examples\n --------\n > LOG10E\n 0.4342944819032518\n\n See Also\n --------\n E, LOG2E\n",
"logspace": "\nlogspace( a, b[, length] )\n Generates a logarithmically spaced numeric array between `10^a` and `10^b`.\n\n If a `length` is not provided, the default output array length is `10`.\n\n The output array includes the values `10^a` and `10^b`.\n\n Parameters\n ----------\n a: number\n Exponent of start value.\n\n b: number\n Exponent of end value.\n\n length: integer (optional)\n Length of output array. Default: `10`.\n\n Returns\n -------\n arr: Array\n Logarithmically spaced numeric array.\n\n Examples\n --------\n > var arr = logspace( 0, 2, 6 )\n [ 1, ~2.5, ~6.31, ~15.85, ~39.81, 100 ]\n\n See Also\n --------\n incrspace, linspace\n",
"lowercase": "\nlowercase( str )\n Converts a `string` to lowercase.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Lowercase string.\n\n Examples\n --------\n > var out = lowercase( 'bEEp' )\n 'beep'\n\n See Also\n --------\n uncapitalize, uppercase\n",
"lowercaseKeys": "\nlowercaseKeys( obj )\n Converts each object key to lowercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'A': 1, 'B': 2 };\n > var out = lowercaseKeys( obj )\n { 'a': 1, 'b': 2 }\n\n See Also\n --------\n uncapitalizeKeys, uppercaseKeys\n",
"lowess": "\nlowess( x, y[, options] )\n Locally-weighted polynomial regression via the LOWESS algorithm.\n\n Parameters\n ----------\n x: Array<number>\n x-axis values (abscissa values).\n\n y: Array<number>\n Corresponding y-axis values (ordinate values).\n\n options: Object (optional)\n Function options.\n\n options.f: number (optional)\n Positive number specifying the smoothing span, i.e., the proportion of\n points which influence smoothing at each value. Larger values\n correspond to more smoothing. Default: `2/3`.\n\n options.nsteps: number (optional)\n Number of iterations in the robust fit (fewer iterations translates to\n faster function execution). If set to zero, the nonrobust fit is\n returned. Default: `3`.\n\n options.delta: number (optional)\n Nonnegative number which may be used to reduce the number of\n computations. Default: 1/100th of the range of `x`.\n\n options.sorted: boolean (optional)\n Boolean indicating if the input array `x` is sorted. Default: `false`.\n\n Returns\n -------\n out: Object\n Object with ordered x-values and fitted values.\n\n Examples\n --------\n > var x = new Float64Array( 100 );\n > var y = new Float64Array( x.length );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = i;\n ... y[ i ] = ( 0.5*i ) + ( 10.0*base.random.randn() );\n ... }\n > var out = lowess( x, y );\n > var yhat = out.y;\n\n > var h = Plot( [ x, x ], [ y, yhat ] );\n > h.lineStyle = [ 'none', '-' ];\n > h.symbols = [ 'closed-circle', 'none' ];\n\n > h.view( 'window' );\n\n",
"lpad": "\nlpad( str, len[, pad] )\n Left pads a `string` such that the padded `string` has a length of at least\n `len`.\n\n An output string is not guaranteed to have a length of exactly `len`, but to\n have a length of at least `len`. To generate a padded string having a length\n equal to `len`, post-process a padded string by trimming off excess\n characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Minimum string length.\n\n pad: string (optional)\n String used to pad. Default: ' '.\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n > var out = lpad( 'a', 5 )\n ' a'\n > out = lpad( 'beep', 10, 'b' )\n 'bbbbbbbeep'\n > out = lpad( 'boop', 12, 'beep' )\n 'beepbeepboop'\n\n See Also\n --------\n pad, rpad\n",
"ltrim": "\nltrim( str )\n Trims whitespace from the beginning of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = ltrim( ' \\r\\n\\t Beep \\t\\t\\n ' )\n 'Beep \\t\\t\\n '\n\n See Also\n --------\n trim, rtrim\n",
"MALE_FIRST_NAMES_EN": "\nMALE_FIRST_NAMES_EN()\n Returns a list of common male first names in English speaking countries.\n\n Returns\n -------\n out: Array<string>\n List of common male first names.\n\n Examples\n --------\n > var list = MALE_FIRST_NAMES_EN()\n [ 'Aaron', 'Ab', 'Abba', 'Abbe', ... ]\n\n References\n ----------\n - Ward, Grady. 2002. 'Moby Word II.' <http://www.gutenberg.org/files/3201/\n 3201.txt>.\n\n See Also\n --------\n FEMALE_FIRST_NAMES_EN\n",
"mapFun": "\nmapFun( fcn, n[, thisArg] )\n Invokes a function `n` times and returns an array of accumulated function\n return values.\n\n The invoked function is provided a single argument: the invocation index\n (zero-based).\n\n Parameters\n ----------\n fcn: Function\n Function to invoke.\n\n n: integer\n Number of times to invoke a function.\n\n thisArg: any (optional)\n Function execution context.\n\n Returns\n -------\n out: Array\n Array of accumulated function return values.\n\n Examples\n --------\n > function fcn( i ) { return i; };\n > var arr = mapFun( fcn, 5 )\n [ 0, 1, 2, 3, 4 ]\n\n See Also\n --------\n mapFunAsync\n",
"mapFunAsync": "\nmapFunAsync( fcn, n, [options,] done )\n Invokes a function `n` times and returns an array of accumulated function\n return values.\n\n For each iteration, the provided function is invoked with two arguments:\n\n - `index`: invocation index (starting from zero)\n - `next`: callback to be invoked upon function completion\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `result`: function result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcn: Function\n Function to invoke.\n\n n: integer\n Number of times to invoke a function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to allow only one pending invocation at a\n time. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n done: Function\n A callback invoked upon executing a provided function `n` times or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > mapFunAsync( fcn, 10, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Limit number of concurrent invocations:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > var opts = { 'limit': 2 };\n > mapFunAsync( fcn, 10, opts, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n // Sequential invocation:\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > var opts = { 'series': true };\n > mapFunAsync( fcn, 10, opts, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n\nmapFunAsync.factory( [options,] fcn )\n Returns a function which invokes a function `n` times and returns an array\n of accumulated function return values.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to allow only one pending invocation at a\n time. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n Function to invoke.\n\n Returns\n -------\n out: Function\n A function which invokes a function `n` times and returns an array of\n accumulated function return values.\n\n Examples\n --------\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... next( null, i );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapFunAsync.factory( opts, fcn );\n > function done( error, arr ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( arr );\n ... };\n > f( 10, done )\n [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\n See Also\n --------\n mapFun\n",
"mapKeys": "\nmapKeys( obj, transform )\n Maps keys from one object to a new object having the same values.\n\n The transform function is provided three arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n\n The value returned by a transform function should be a value which can be\n serialized as an object key.\n\n The function only maps own properties. Hence, the function does not map\n inherited properties.\n\n The function shallow copies key values.\n\n Key iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n transform: Function\n Transform function. Return values specify the keys of the output object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function transform( key, value ) { return key + value; };\n > var obj = { 'a': 1, 'b': 2 };\n > var out = mapKeys( obj, transform )\n { 'a1': 1, 'b2': 2 }\n\n See Also\n --------\n mapValues\n",
"mapKeysAsync": "\nmapKeysAsync( obj, [options,] transform, done )\n Maps keys from one object to a new object having the same values.\n\n When invoked, `transform` is provided a maximum of four arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n - `next`: a callback to be invoked after processing an object `key`\n\n The actual number of provided arguments depends on function length. If\n `transform` accepts two arguments, `transform` is provided:\n\n - `key`\n - `next`\n\n If `transform` accepts three arguments, `transform` is provided:\n\n - `key`\n - `value`\n - `next`\n\n For every other `transform` signature, `transform` is provided all four\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `key`: transformed key\n\n If a `transform` function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The key returned by a transform function should be a value which can be\n serialized as an object key.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function only maps own properties. Hence, the function does not map\n inherited properties.\n\n The function shallow copies key values.\n\n Key iteration and insertion order are *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Returned values specify the keys of the output\n object.\n\n done: Function\n A callback invoked either upon processing all own properties or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2 };\n > mapKeysAsync( obj, transform, done )\n { 'a:1': 1, 'b:2': 2 }\n\n // Limit number of concurrent invocations:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'limit': 2 };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapKeysAsync( obj, opts, transform, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n\n // Process sequentially:\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'series': true };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapKeysAsync( obj, opts, transform, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n\n\nmapKeysAsync.factory( [options,] transform )\n Returns a function which maps keys from one object to a new object having\n the same values.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Returned values specify the keys of the output\n object.\n\n Returns\n -------\n out: Function\n A function which maps keys from one object to a new object having the\n same values.\n\n Examples\n --------\n > function transform( key, value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapKeysAsync.factory( opts, transform );\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > f( obj, done )\n { 'a:1': 1, 'b:2': 2, 'c:3': 3 }\n > obj = { 'beep': 'boop' };\n > f( obj, done )\n { 'beep:boop': 'beep' }\n\n See Also\n --------\n mapKeys, mapValuesAsync\n",
"mapValues": "\nmapValues( obj, transform )\n Maps values from one object to a new object having the same keys.\n\n The transform function is provided three arguments:\n\n - `value`: object value corresponding to `key`\n - `key`: object key\n - `obj`: the input object\n\n The function only maps values from own properties. Hence, the function does\n not map inherited properties.\n\n The function shallow copies key values.\n\n Key iteration order is *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function transform( value, key ) { return key + value; };\n > var obj = { 'a': 1, 'b': 2 };\n > var out = mapValues( obj, transform )\n { 'a': 'a1', 'b': 'b2' }\n\n See Also\n --------\n mapKeys, omitBy, pickBy\n",
"mapValuesAsync": "\nmapValuesAsync( obj, [options,] transform, done )\n Maps values from one object to a new object having the same keys.\n\n When invoked, `transform` is provided a maximum of four arguments:\n\n - `value`: object value corresponding to `key`\n - `key`: object key\n - `obj`: the input object\n - `next`: a callback to be invoked after processing an object `value`\n\n The actual number of provided arguments depends on function length. If\n `transform` accepts two arguments, `transform` is provided:\n\n - `value`\n - `next`\n\n If `transform` accepts three arguments, `transform` is provided:\n\n - `value`\n - `key`\n - `next`\n\n For every other `transform` signature, `transform` is provided all four\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `value`: transformed value\n\n If a `transform` function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function only maps values from own properties. Hence, the function does\n not map inherited properties.\n\n The function shallow copies key values.\n\n Key iteration and insertion order are *not* guaranteed.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n done: Function\n A callback invoked either upon processing all own properties or upon\n encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2 };\n > mapValuesAsync( obj, transform, done )\n { 'a': 'a:1', 'b': 'b:2' }\n\n // Limit number of concurrent invocations:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'limit': 2 };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapValuesAsync( obj, opts, transform, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n\n // Process sequentially:\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var opts = { 'series': true };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > mapValuesAsync( obj, opts, transform, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n\n\nmapValuesAsync.factory( [options,] transform )\n Returns a function which maps values from one object to a new object having\n the same keys.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each property sequentially.\n Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n transform: Function\n Transform function. Return values are the key values of the output\n object.\n\n Returns\n -------\n out: Function\n A function which maps values from one object to a new object having the\n same keys.\n\n Examples\n --------\n > function transform( value, key, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... next( null, key+':'+value );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = mapValuesAsync.factory( opts, transform );\n > function done( error, out ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( out );\n ... };\n > var obj = { 'a': 1, 'b': 2, 'c': 3 };\n > f( obj, done )\n { 'a': 'a:1', 'b': 'b:2', 'c': 'c:3' }\n > obj = { 'beep': 'boop' };\n > f( obj, done )\n { 'beep': 'beep:boop' }\n\n See Also\n --------\n mapKeysAsync, mapValues\n",
"MAX_ARRAY_LENGTH": "\nMAX_ARRAY_LENGTH\n Maximum length for a generic array.\n\n Examples\n --------\n > MAX_ARRAY_LENGTH\n 4294967295\n\n See Also\n --------\n MAX_TYPED_ARRAY_LENGTH\n",
"MAX_TYPED_ARRAY_LENGTH": "\nMAX_TYPED_ARRAY_LENGTH\n Maximum length for a typed array.\n\n Examples\n --------\n > MAX_TYPED_ARRAY_LENGTH\n 9007199254740991\n\n See Also\n --------\n MAX_ARRAY_LENGTH\n",
"memoize": "\nmemoize( fcn[, hashFunction] )\n Returns a memoized function.\n\n The function does not set the `length` property of the returned function.\n Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n The function serializes provided arguments as a string and stores results\n using the string as an identifier. To use a custom hash function, provide a\n hash function argument.\n\n Parameters\n ----------\n fcn: Function\n Function to memoize.\n\n hashFunction: Function (optional)\n Function to map a set of arguments to a single value identifying that\n set.\n\n Returns\n -------\n out: Function\n Memoized function.\n\n Examples\n --------\n > function factorial( n ) {\n ... var prod;\n ... var i;\n ... prod = 1;\n ... for ( i = n; i > 1; i-- ) {\n ... prod *= i;\n ... }\n ... return prod;\n ... };\n > var memoized = memoize( factorial );\n > var v = memoized( 5 )\n 120\n > v = memoized( 5 )\n 120\n\n",
"merge": "\nmerge( target, ...source )\n Merges objects into a target object.\n\n The target object is mutated.\n\n Only plain objects are merged and extended. Other values/types are either\n deep copied or assigned.\n\n Support for deep merging class instances is inherently fragile.\n\n `Number`, `String`, and `Boolean` objects are merged as primitives.\n\n Functions are not deep copied.\n\n Parameters\n ----------\n target: Object\n Target object.\n\n source: ...Object\n Source objects (i.e., objects to be merged into the target object).\n\n Returns\n -------\n out: Object\n Merged (target) object.\n\n Examples\n --------\n > var target = { 'a': 'beep' };\n > var source = { 'a': 'boop', 'b': 'bap' };\n > var out = merge( target, source )\n { 'a': 'boop', 'b': 'bap' }\n > var bool = ( out === target )\n true\n\n\nmerge.factory( options )\n Returns a function for merging and extending objects.\n\n Parameters\n ----------\n options: Object\n Options.\n\n options.level: integer (optional)\n Merge level. Default: Infinity.\n\n options.copy: boolean (optional)\n Boolean indicating whether to deep copy merged values. Deep copying\n prevents shared references and source object mutation. Default: true.\n\n options.override: boolean|Function (optional)\n Defines the merge strategy. If `true`, source object values will always\n override target object values. If `false`, source values never override\n target values (useful for adding, but not overwriting, properties). To\n define a custom merge strategy, provide a function. Default: true.\n\n options.extend: boolean (optional)\n Boolean indicating whether new properties can be added to the target\n object. If `false`, only shared properties are merged. Default: true.\n\n Returns\n -------\n fcn: Function\n Function which can be used to merge objects.\n\n Examples\n --------\n > var opts = {\n ... 'level': 100,\n ... 'copy': true,\n ... 'override': true,\n ... 'extend': true\n ... };\n > var merge = merge.factory( opts )\n <Function>\n\n // Set the `level` option to limit the merge depth:\n > merge = merge.factory( { 'level': 2 } );\n > var target = {\n ... '1': { 'a': 'beep', '2': { '3': null, 'b': [ 5, 6, 7 ] } }\n ... };\n > var source = {\n ... '1': { 'b': 'boop', '2': { '3': [ 1, 2, 3 ] } }\n ... };\n > var out = merge( target, source )\n { '1': { 'a': 'beep', 'b': 'boop', '2': { '3': [ 1, 2, 3 ] } } }\n\n // Set the `copy` option to `false` to allow shared references:\n > merge = merge.factory( { 'copy': false } );\n > target = {};\n > source = { 'a': [ 1, 2, 3 ] };\n > out = merge( target, source );\n > var bool = ( out.a === source.a )\n true\n\n // Set the `override` option to `false` to preserve existing properties:\n > merge = merge.factory( { 'override': false } );\n > target = { 'a': 'beep', 'b': 'boop' };\n > source = { 'a': null, 'c': 'bop' };\n > out = merge( target, source )\n { 'a': 'beep', 'b': 'boop', 'c': 'bop' }\n\n // Define a custom merge strategy:\n > function strategy( a, b, key ) {\n ... // a => target value\n ... // b => source value\n ... // key => object key\n ... if ( key === 'a' ) {\n ... return b;\n ... }\n ... if ( key === 'b' ) {\n ... return a;\n ... }\n ... return 'bebop';\n ... };\n > merge = merge.factory( { 'override': strategy } );\n > target = { 'a': 'beep', 'b': 'boop', 'c': 1234 };\n > source = { 'a': null, 'b': {}, 'c': 'bop' };\n > out = merge( target, source )\n { 'a': null, 'b': 'boop', 'c': 'bebop' }\n\n // Prevent non-existent properties from being added to the target object:\n > merge = merge.factory( { 'extend': false } );\n > target = { 'a': 'beep', 'b': 'boop' };\n > source = { 'b': 'hello', 'c': 'world' };\n > out = merge( target, source )\n { 'a': 'beep', 'b': 'hello' }\n\n See Also\n --------\n copy\n",
"MILLISECONDS_IN_DAY": "\nMILLISECONDS_IN_DAY\n Number of milliseconds in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var ms = days * MILLISECONDS_IN_DAY\n 271296000\n\n",
"MILLISECONDS_IN_HOUR": "\nMILLISECONDS_IN_HOUR\n Number of milliseconds in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var ms = hrs * MILLISECONDS_IN_HOUR\n 11304000\n\n",
"MILLISECONDS_IN_MINUTE": "\nMILLISECONDS_IN_MINUTE\n Number of milliseconds in a minute.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var mins = 3.14;\n > var ms = mins * MILLISECONDS_IN_MINUTE\n 188400\n\n",
"MILLISECONDS_IN_SECOND": "\nMILLISECONDS_IN_SECOND\n Number of milliseconds in a second.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var secs = 3.14;\n > var ms = secs * MILLISECONDS_IN_SECOND\n 3140\n\n",
"MILLISECONDS_IN_WEEK": "\nMILLISECONDS_IN_WEEK\n Number of milliseconds in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var weeks = 3.14;\n > var ms = weeks * MILLISECONDS_IN_WEEK\n 1899072000\n\n",
"MINARD_NAPOLEONS_MARCH": "\nMINARD_NAPOLEONS_MARCH( [options] )\n Returns data for Charles Joseph Minard's cartographic depiction of\n Napoleon's Russian campaign of 1812.\n\n Data includes the following:\n\n - army: army size\n - cities: cities\n - labels: map labels\n - temperature: temperature during the army's return from Russia\n - rivers: river data\n\n Temperatures are on the Réaumur scale. Multiply each temperature by `1.25`\n to convert to Celsius.\n\n River data is formatted as GeoJSON.\n\n River data is incomplete, with portions of rivers missing.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.data: string (optional)\n Dataset name.\n\n Returns\n -------\n out: Object|Array<Object>\n Minard's data.\n\n Examples\n --------\n > var data = MINARD_NAPOLEONS_MARCH();\n > var army = data.army\n [...]\n > var cities = data.cities\n [...]\n > var labels = data.labels\n [...]\n > var river = data.river\n {...}\n > var t = data.temperature\n [...]\n\n References\n ----------\n - Minard, Charles Joseph. 1869. *Tableaux graphiques et cartes figuratives*.\n Ecole nationale des ponts et chaussées.\n - Wilkinson, Leland. 2005. *The Grammar of Graphics*. Springer-Verlag New\n York. doi:10.1007/0-387-28695-0.\n\n",
"MINUTES_IN_DAY": "\nMINUTES_IN_DAY\n Number of minutes in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var mins = days * MINUTES_IN_DAY\n 4521.6\n\n",
"MINUTES_IN_HOUR": "\nMINUTES_IN_HOUR\n Number of minutes in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var mins = hrs * MINUTES_IN_HOUR\n 188.4\n\n",
"MINUTES_IN_WEEK": "\nMINUTES_IN_WEEK\n Number of minutes in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var mins = wks * MINUTES_IN_WEEK\n 31651.2\n\n",
"minutesInMonth": "\nminutesInMonth( [month[, year]] )\n Returns the number of minutes in a month.\n\n By default, the function returns the number of minutes in the current month\n of the current year (according to local time). To determine the number of\n minutes for a particular month and year, provide `month` and `year`\n arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Minutes in a month.\n\n Examples\n --------\n > var num = minutesInMonth()\n <number>\n > num = minutesInMonth( 2 )\n <number>\n > num = minutesInMonth( 2, 2016 )\n 41760\n > num = minutesInMonth( 2, 2017 )\n 40320\n\n // Other ways to supply month:\n > num = minutesInMonth( 'feb', 2016 )\n 41760\n > num = minutesInMonth( 'february', 2016 )\n 41760\n\n See Also\n --------\n minutesInYear\n",
"minutesInYear": "\nminutesInYear( [value] )\n Returns the number of minutes in a year according to the Gregorian calendar.\n\n By default, the function returns the number of minutes in the current year\n (according to local time). To determine the number of minutes for a\n particular year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of minutes in a year.\n\n Examples\n --------\n > var num = minutesInYear()\n <number>\n > num = minutesInYear( 2016 )\n 527040\n > num = minutesInYear( 2017 )\n 525600\n\n See Also\n --------\n minutesInMonth\n",
"MOBY_DICK": "\nMOBY_DICK()\n Returns the text of Moby Dick by Herman Melville.\n\n Each array element has the following fields:\n\n - chapter: book chapter (number or identifier)\n - title: chapter title (if available; otherwise, empty)\n - text: chapter text\n\n Returns\n -------\n out: Array<Object>\n Book text.\n\n Examples\n --------\n > var data = MOBY_DICK()\n [ {...}, {...}, ... ]\n\n",
"MONTH_NAMES_EN": "\nMONTH_NAMES_EN()\n Returns a list of month names (English).\n\n Returns\n -------\n out: Array<string>\n List of month names.\n\n Examples\n --------\n > var list = MONTH_NAMES_EN()\n [ 'January', 'February', 'March', 'April', ... ]\n\n",
"MONTHS_IN_YEAR": "\nMONTHS_IN_YEAR\n Number of months in a year.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var yrs = 3.14;\n > var mons = yrs * MONTHS_IN_YEAR\n 37.68\n\n",
"moveProperty": "\nmoveProperty( source, prop, target )\n Moves a property from one object to another object.\n\n The property is deleted from the source object and the property's descriptor\n is preserved during transfer.\n\n If a source property is not configurable, the function throws an error, as\n the property cannot be deleted from the source object.\n\n Parameters\n ----------\n source: Object\n Source object.\n\n prop: string\n Property to move.\n\n target: Object\n Target object.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether operation was successful.\n\n Examples\n --------\n > var obj1 = { 'a': 'b' };\n > var obj2 = {};\n > var bool = moveProperty( obj1, 'a', obj2 )\n true\n > bool = moveProperty( obj1, 'c', obj2 )\n false\n\n",
"namedtypedtuple": "\nnamedtypedtuple( fields[, options] )\n Returns a named typed tuple factory.\n\n Named tuples assign a property name, and thus a meaning, to each position in\n a tuple and allow for more readable, self-documenting code.\n\n Named typed tuples can be used wherever typed arrays are used, with the\n added benefit that they allow accessing fields by both field name and\n position index.\n\n Named typed tuples may be one the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n fields: Array<string>\n Field (property) names.\n\n options: Object (optional)\n Function options.\n\n options.dtype: string (optional)\n Default tuple data type. If a data type is not provided to a named typed\n tuple factory, this option specifies the underlying tuple data type.\n Default: 'float64'.\n\n options.name: string (optional)\n Tuple name. Default: 'tuple'.\n\n Returns\n -------\n factory: Function\n Named typed tuple factory.\n\n Examples\n --------\n > var opts = {};\n > opts.name = 'Point';\n > var factory = namedtypedtuple( [ 'x', 'y' ], opts );\n > var tuple = factory();\n\n\nfactory()\n Returns a named typed tuple of the default data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory();\n > p.x\n 0.0\n > p.y\n 0.0\n > p[ 0 ]\n 0.0\n > p[ 1 ]\n 0.0\n\n\nfactory( dtype )\n Returns a named typed tuple of the specified data type.\n\n Parameters\n ----------\n dtype: string\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( 'int32' );\n > p.x\n 0\n > p.y\n 0\n > p[ 0 ]\n 0\n > p[ 1 ]\n 0\n\n\nfactory( typedarray[, dtype] )\n Creates a named typed tuple from a typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate a named typed tuple.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( Float64Array[ 1.0, -1.0 ] );\n > p.x\n 1.0\n > p.y\n -1.0\n > p[ 0 ]\n 1.0\n > p[ 1 ]\n -1.0\n\n\nfactory( obj[, dtype] )\n Creates a named typed tuple from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a named typed\n tuple.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > p = factory( [ 1, -1 ], 'int32' );\n > p.x\n 1\n > p.y\n -1\n > p[ 0 ]\n 1\n > p[ 1 ]\n -1\n\n\nfactory( buffer[, byteOffset][, dtype] )\n Returns a named typed tuple view of an ArrayBuffer.\n\n The view length equals the number of tuple fields.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first tuple element.\n Default: 0.\n\n dtype: string (optional)\n Tuple data type.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var buf = new ArrayBuffer( 16 );\n > var p = factory( buf, 4, 'float32' );\n > p.x\n 0.0\n > p.y\n 0.0\n > p[ 0 ]\n 0.0\n > p[ 1 ]\n 0.0\n\n\nfactory.from( src[, map[, thisArg]] )\n Creates a new named typed tuple from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n - field: tuple field.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of tuple elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > function mapFcn( v ) { return v * 2.0; };\n > var p = factory.from( [ 1.0, -1.0 ], mapFcn );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\nfactory.fromObject( obj[, map[, thisArg]] )\n Creates a new named typed tuple from an object containing tuple fields.\n\n A callback is provided the following arguments:\n\n - value: source object tuple field value.\n - field: source object tuple field name.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n map: Function (optional)\n Callback to invoke for each source object tuple field.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory.fromObject( { 'x': 2.0, 'y': -2.0 } );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\nfactory.of( element0[, element1[, ...[, elementN]]] )\n Creates a new named typed tuple from a variable number of arguments.\n\n The number of arguments *must* equal the number of tuple fields.\n\n Parameters\n ----------\n element: number\n Tuple elements.\n\n Returns\n -------\n tuple: TypedArray\n Named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory.of( 2.0, -2.0 );\n > p.x\n 2.0\n > p.y\n -2.0\n > p[ 0 ]\n 2.0\n > p[ 1 ]\n -2.0\n\n\ntuple.BYTES_PER_ELEMENT\n Size (in bytes) of each tuple element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.BYTES_PER_ELEMENT\n 8\n\n\ntuple.buffer\n Pointer to the underlying data buffer.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.buffer\n <ArrayBuffer>\n\n\ntuple.byteLength\n Length (in bytes) of the tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.byteLength\n 16\n\n\ntuple.byteOffset\n Offset (in bytes) of a tuple from the start of its underlying ArrayBuffer.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.byteOffset\n 0\n\n\ntuple.length\n Tuple length (i.e., number of elements).\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.length\n 2\n\n\ntuple.name\n Tuple name.\n\n Examples\n --------\n > var opts = { 'name': 'Point' };\n > var factory = namedtypedtuple( [ 'x', 'y' ], opts );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.name\n 'Point'\n\n\ntuple.fields\n Returns the list of tuple fields.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.fields\n [ 'x', 'y' ]\n\n\ntuple.orderedFields\n Returns the list of tuple fields in index order.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p[ 0 ]\n 1.0\n > p.sort();\n > p[ 0 ]\n -1.0\n > p.fields\n [ 'x', 'y' ]\n > p.orderedFields\n [ 'y', 'x' ]\n\n\ntuple.copyWithin( target, start[, end] )\n Copies a sequence of elements within the tuple starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 2.0, -2.0, 1.0, -1.0, 1.0 ] );\n > p.copyWithin( 3, 0, 2 );\n > p.w\n 2.0\n > p.v\n -2.0\n\n\ntuple.entries()\n Returns an iterator for iterating over tuple key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple key-value pairs.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.entries();\n > it.next().value\n [ 0, 'x', 1.0 ]\n > it.next().value\n [ 1, 'y', -1.0 ]\n > it.next().done\n true\n\n\ntuple.every( predicate[, thisArg] )\n Tests whether all tuple elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements. If a predicate function\n returns a truthy value, a tuple element passes; otherwise, a tuple\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all tuple elements pass.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > p.every( predicate )\n false\n\n\ntuple.fieldOf( searchElement[, fromIndex] )\n Returns the field of the first tuple element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `undefined`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var f = p.fieldOf( 2.0 )\n undefined\n > f = p.fieldOf( -1.0 )\n 'z'\n\n\ntuple.fill( value[, start[, end]] )\n Fills a tuple from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last tuple element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > p.fill( 2.0 );\n > p.x\n 2.0\n > p.y\n 2.0\n\n\ntuple.filter( predicate[, thisArg] )\n Creates a new tuple which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n The returned tuple has the same data type as the host tuple.\n\n If a predicate function does not return a truthy value for any tuple\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters tuple elements. If a predicate function\n returns a truthy value, a tuple element is included in the output tuple;\n otherwise, a tuple element is not included in the output tuple.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v >= 0.0 ); };\n > var p2 = p1.filter( predicate );\n > p2.fields\n [ 'x', 'y' ]\n\n\ntuple.find( predicate[, thisArg] )\n Returns the first tuple element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Tuple element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var v = p.find( predicate )\n -1.0\n\n\ntuple.findField( predicate[, thisArg] )\n Returns the field of the first tuple element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var f = p.findField( predicate )\n 'z'\n\n\ntuple.findIndex( predicate[, thisArg] )\n Returns the index of the first tuple element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > var idx = p.findIndex( predicate )\n 2\n\n\ntuple.forEach( fcn[, thisArg] )\n Invokes a callback for each tuple element.\n\n A provided function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each tuple element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1, 0, -1 ], 'int32' );\n > var str = ' ';\n > function fcn( v, i, f ) { str += f + '=' + v + ' '; };\n > p.forEach( fcn );\n > str\n ' x=1 y=0 z=-1 '\n\n\ntuple.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether a tuple includes a search element.\n\n The method does not distinguish between signed and unsigned zero.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a tuple includes a search element.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var bool = p.includes( 2.0 )\n false\n > bool = p.includes( -1.0 )\n true\n\n\ntuple.indexOf( searchElement[, fromIndex] )\n Returns the index of the first tuple element strictly equal to a search\n element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > var idx = p.indexOf( 2.0 )\n -1\n > idx = p.indexOf( -1.0 )\n 2\n\n\ntuple.ind2key( ind )\n Converts a tuple index to a field name.\n\n If provided an out-of-bounds index, the method returns `undefined`.\n\n Parameters\n ----------\n ind: integer\n Tuple index. If less than zero, the method resolves the index relative\n to the last tuple element.\n\n Returns\n -------\n field: string|undefined\n Field name.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p.ind2key( 1 )\n 'y'\n > p.ind2key( 100 )\n undefined\n\n\ntuple.join( [separator] )\n Serializes a tuple by joining all tuple elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating tuple elements. Default: ','.\n\n Returns\n -------\n str: string\n Tuple serialized as a string.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1, 0, -1 ], 'int32' );\n > p.join( '|' )\n '1|0|-1'\n\n\ntuple.keys()\n Returns an iterator for iterating over tuple keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple keys.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.keys();\n > it.next().value\n [ 0, 'x' ]\n > it.next().value\n [ 1, 'y' ]\n > it.next().done\n true\n\n\ntuple.key2ind( field )\n Converts a field name to a tuple index.\n\n If provided an unknown field name, the method returns `-1`.\n\n Parameters\n ----------\n field: string\n Tuple field name.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p.key2ind( 'y' )\n 1\n\n\ntuple.lastFieldOf( searchElement[, fromIndex] )\n Returns the field of the last tuple element strictly equal to a search\n element.\n\n The method iterates from the last tuple element to the first tuple element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `undefined`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: -1.\n\n Returns\n -------\n field: string|undefined\n Tuple field.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var f = p.lastFieldOf( 2.0 )\n undefined\n > f = p.lastFieldOf( 0.0 )\n 'w'\n\n\ntuple.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last tuple element strictly equal to a search\n element.\n\n The method iterates from the last tuple element to the first tuple element.\n\n The method does not distinguish between signed and unsigned zero.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Tuple index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last tuple element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n Tuple index.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, 0.0, -1.0, 0.0, 1.0 ] );\n > var idx = p.lastIndexOf( 2.0 )\n -1\n > idx = p.lastIndexOf( 0.0 )\n 3\n\n\ntuple.map( fcn[, thisArg] )\n Maps each tuple element to an element in a new tuple.\n\n A provided function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n The returned tuple has the same data type as the host tuple.\n\n Parameters\n ----------\n fcn: Function\n Function which maps tuple elements to elements in the new tuple.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( v ) { return v * 2.0; };\n > var p2 = p1.map( fcn );\n > p2.x\n 2.0\n > p2.y\n 0.0\n > p2.z\n -2.0\n\n\ntuple.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in a tuple and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current tuple element.\n - index: index of the current tuple element.\n - field: field name corresponding to the current tuple element.\n - tuple: tuple on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first tuple element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first tuple element as the first argument and the second tuple\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = p.reduce( fcn, 0.0 )\n 2.0\n\n\ntuple.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in a tuple and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current tuple element.\n - index: index of the current tuple element.\n - field: field name corresponding to the current tuple element.\n - tuple: tuple on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last tuple element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last tuple element as the first argument and the second-to-last\n tuple element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = p.reduceRight( fcn, 0.0 )\n 2.0\n\n\ntuple.reverse()\n Reverses a tuple *in-place*.\n\n This method mutates the tuple on which the method is invoked.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p[ 0 ]\n 1.0\n > p.x\n 1.0\n > p.reverse();\n > p[ 0 ]\n -1.0\n > p.x\n 1.0\n\n\ntuple.set( arr[, offset] )\n Sets tuple elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing tuple values to set.\n\n offset: integer (optional)\n Tuple index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, 0.0, -1.0 ] );\n > p[ 1 ]\n 0.0\n > p.y\n 0.0\n > p.set( [ -2.0, 2.0 ], 1 );\n > p[ 1 ]\n -2.0\n > p.y\n -2.0\n > p[ 2 ]\n 2.0\n > p.z\n 2.0\n\n\ntuple.slice( [begin[, end]] )\n Copies tuple elements to a new tuple with the same underlying data type as\n the host tuple.\n\n If the method is unable to resolve indices to a non-empty tuple subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p1 = factory( [ 1.0, 0.0, -1.0 ] );\n > p1.fields\n [ 'x', 'y', 'z' ]\n > var p2 = p1.slice( 1 );\n > p2.fields\n [ 'y', 'z' ]\n > p2.y\n 0.0\n > p2.z\n -1.0\n\n\ntuple.some( predicate[, thisArg] )\n Tests whether at least one tuple element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: tuple element.\n - index: tuple index.\n - field: tuple field name.\n - tuple: tuple on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests tuple elements. If a predicate function\n returns a truthy value, a tuple element passes; otherwise, a tuple\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one tuple element passes.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > function predicate( v ) { return ( v < 0.0 ); };\n > p.some( predicate )\n true\n\n\ntuple.sort( [compareFunction] )\n Sorts a tuple *in-place*.\n\n Sorting a tuple does *not* affect field assignments. Accessing a tuple field\n before and after sorting will always return the same tuple element. However,\n this behavior is generally not true when accessing tuple elements according\n to tuple index. In summary, sorting affects index order but not field\n assignments.\n\n The comparison function is provided two tuple elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the tuple on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n tuple: TypedArray\n Modified tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > p.sort();\n > p.orderedFields\n [ 'v', 'y', 'z', 'x', 'w' ]\n > p[ 0 ]\n -2.0\n > p.x\n 1.0\n > p[ 1 ]\n -1.0\n > p.y\n -1.0\n > p.key2ind( 'x' )\n 3\n\n\ntuple.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host tuple.\n\n If the method is unable to resolve indices to a non-empty tuple subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n arr: TypedArray\n A new typed array view.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var arr = p.subarray( 2 )\n <Float64Array>[ 0.0, 2.0, -2.0 ]\n > arr.length\n 3\n\n\ntuple.subtuple( [begin[, end]] )\n Creates a new named typed tuple over the same underlying ArrayBuffer and\n with the same underlying data type as the host tuple.\n\n If the function is unable to resolve indices to a non-empty tuple\n subsequence, the function returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last tuple element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last tuple element. Default: tuple.length.\n\n Returns\n -------\n tuple: TypedArray|null\n A new named typed tuple.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z', 'w', 'v' ] );\n > var p1 = factory( [ 1.0, -1.0, 0.0, 2.0, -2.0 ] );\n > var p2 = p1.subtuple( 2 );\n > p2.fields\n [ 'z', 'w', 'v' ]\n > p2[ 0 ]\n 0.0\n > p2.z\n 0.0\n > p2[ 1 ]\n 2.0\n > p2.w\n 2.0\n > p2[ 2 ]\n -2.0\n > p2.v\n -2.0\n > p2.length\n 3\n\n\ntuple.toJSON()\n Serializes a tuple as JSON.\n\n Returns\n -------\n obj: Object\n A tuple JSON representation.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, -1.0, 0.0 ] );\n > p.toJSON()\n { 'x': 1.0, 'y': -1.0, 'z': 0.0 }\n\n\ntuple.toLocaleString( [locales[, options]] )\n Serializes a tuple as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ] );\n > var p = factory( [ 1.0, -1.0, 0.0 ], 'int32' );\n > p.toLocaleString()\n '1,-1,0'\n\n\ntuple.toString()\n Serializes a tuple as a string.\n\n Returns\n -------\n str: string\n A tuple string representation.\n\n Examples\n --------\n > opts = { 'name': 'Point' };\n > var factory = namedtypedtuple( [ 'x', 'y', 'z' ], opts );\n > var p = factory( [ 1.0, -1.0, 0.0 ] );\n > p.toString()\n 'Point(x=1, y=-1, z=0)'\n\n\ntuple.values()\n Returns an iterator for iterating over tuple elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over tuple elements.\n\n Examples\n --------\n > var factory = namedtypedtuple( [ 'x', 'y' ] );\n > var p = factory( [ 1.0, -1.0 ] );\n > it = p.values();\n > it.next().value\n 1.0\n > it.next().value\n -1.0\n > it.next().done\n true\n\n See Also\n --------\n typedarray\n",
"nativeClass": "\nnativeClass( value )\n Returns a string value indicating a specification defined classification of\n an object.\n\n The function is *not* robust for ES2015+ environments. In ES2015+,\n `Symbol.toStringTag` allows overriding the default description of an object.\n While measures are taken to uncover the default description, such measures\n can be thwarted. While this function remains useful for type-checking, be\n aware that value impersonation is possible. Where possible, prefer functions\n tailored to checking for particular value types, as specialized functions\n are better equipped to address `Symbol.toStringTag`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: string\n String value indicating a specification defined classification of the\n input value.\n\n Examples\n --------\n > var str = nativeClass( 'a' )\n '[object String]'\n > str = nativeClass( 5 )\n '[object Number]'\n > function Beep(){};\n > str = nativeClass( new Beep() )\n '[object Object]'\n\n See Also\n --------\n constructorName, typeOf\n",
"ndarray": "\nndarray( dtype, ndims[, options] )\n Returns an ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n ctor: Function\n ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = ndarray( 'generic', 2 )\n <Function>\n\n // To create a new instance...\n > var b = [ 1.0, 2.0, 3.0, 4.0 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n array\n",
"ndarrayCastingModes": "\nndarrayCastingModes()\n Returns a list of ndarray casting modes.\n\n The output array contains the following modes:\n\n - 'none': only allow casting between identical types\n - 'equiv': allow casting between identical and byte swapped types\n - 'safe': only allow \"safe\" casts\n - 'same-kind': allow \"safe\" casts and casts within the same kind (e.g.,\n between signed integers or between floats)\n - 'unsafe': allow casting between all types (including between integers and\n floats)\n\n Returns\n -------\n out: Array<string>\n List of ndarray casting modes.\n\n Examples\n --------\n > var out = ndarrayCastingModes()\n [ 'none', 'equiv', 'safe', 'same-kind', 'unsafe' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayDataTypes": "\nndarrayDataTypes()\n Returns a list of ndarray data types.\n\n The output array contains the following data types:\n\n - binary: binary.\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - generic: values of any type.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of ndarray data types.\n\n Examples\n --------\n > var out = ndarrayDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, array, ndarray, typedarrayDataTypes\n",
"ndarrayIndexModes": "\nndarrayIndexModes()\n Returns a list of ndarray index modes.\n\n The output array contains the following modes:\n\n - throw: specifies that a function should throw an error when an index is\n outside a restricted interval.\n - wrap: specifies that a function should wrap around an index using modulo\n arithmetic.\n - clamp: specifies that a function should set an index less than zero to\n zero (minimum index) and set an index greater than a maximum index value to\n the maximum possible index.\n\n Returns\n -------\n out: Array<string>\n List of ndarray index modes.\n\n Examples\n --------\n > var out = ndarrayIndexModes()\n [ 'throw', 'clamp', 'wrap' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayMemoized": "\nndarrayMemoized( dtype, ndims[, options] )\n Returns a memoized ndarray constructor.\n\n Parameters\n ----------\n dtype: string\n Underlying data type.\n\n ndims: integer\n Number of dimensions.\n\n options: Object (optional)\n Options.\n\n options.codegen: boolean (optional)\n Boolean indicating whether to use code generation. Code generation can\n boost performance, but may be problematic in browser contexts enforcing\n a strict content security policy (CSP). Default: true.\n\n options.mode: string (optional)\n Specifies how to handle indices which exceed array dimensions. If equal\n to 'throw', an ndarray instance throws an error when an index exceeds\n array dimensions. If equal to 'wrap', an ndarray instance wraps around\n indices exceeding array dimensions using modulo arithmetic. If equal to\n 'clamp', an ndarray instance sets an index exceeding array dimensions to\n either `0` (minimum index) or the maximum index. Default: 'throw'.\n\n options.submode: Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If a\n mode for a corresponding dimension is equal to 'throw', an ndarray\n instance throws an error when a subscript exceeds array dimensions. If\n equal to 'wrap', an ndarray instance wraps around subscripts exceeding\n array dimensions using modulo arithmetic. If equal to 'clamp', an\n ndarray instance sets a subscript exceeding array dimensions to either\n `0` (minimum index) or the maximum index. If the number of modes is\n fewer than the number of dimensions, the function recycles modes using\n modulo arithmetic. Default: [ options.mode ].\n\n Returns\n -------\n ctor: Function\n Memoized ndarray constructor.\n\n ctor.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.dtype: string\n Underlying data type.\n\n ctor.ndims: integer\n Number of dimensions.\n\n ctor.prototype.byteLength: integer\n Size (in bytes) of the array (if known).\n\n ctor.prototype.BYTES_PER_ELEMENT: integer\n Size (in bytes) of each array element (if known).\n\n ctor.prototype.data: ArrayLikeObject|TypedArray|Buffer\n Pointer to the underlying data buffer.\n\n ctor.prototype.dtype: string\n Underlying data type.\n\n ctor.prototype.flags: Object\n Information about the memory layout of the array.\n\n ctor.prototype.length: integer\n Length of the array (i.e., number of elements).\n\n ctor.prototype.ndims: integer\n Number of dimensions.\n\n ctor.prototype.offset: integer\n Index offset which specifies the buffer index at which to start\n iterating over array elements.\n\n ctor.prototype.order: string\n Array order. The array order is either row-major (C-style) or column-\n major (Fortran-style).\n\n ctor.prototype.shape: Array\n Array shape.\n\n ctor.prototype.strides: Array\n Index strides which specify how to access data along corresponding array\n dimensions.\n\n ctor.prototype.get: Function\n Returns an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iget: Function\n Returns an array element located at a specified linear index.\n\n ctor.prototype.set: Function\n Sets an array element specified according to provided subscripts. The\n number of provided subscripts should equal the number of dimensions.\n\n ctor.prototype.iset: Function\n Sets an array element located at a specified linear index.\n\n ctor.prototype.toString: Function\n Serializes an ndarray as a string. This method does **not** serialize\n data outside of the buffer region defined by the array configuration.\n\n ctor.prototype.toJSON: Function\n Serializes an ndarray as a JSON object. This method does **not**\n serialize data outside of the buffer region defined by the array\n configuration.\n\n Examples\n --------\n > var ctor = ndarrayMemoized( 'generic', 2 )\n <Function>\n > var f = ndarrayMemoized( 'generic', 2 )\n <Function>\n > var bool = ( f === ctor )\n true\n\n // To create a new instance...\n > var b = [ 1.0, 2.0, 3.0, 4.0 ]; // underlying data buffer\n > var d = [ 2, 2 ]; // shape\n > var s = [ 2, 1 ]; // strides\n > var o = 0; // index offset\n > var arr = ctor( b, d, s, o, 'row-major' )\n <ndarray>\n\n // Get an element using subscripts:\n > var v = arr.get( 1, 1 )\n 4.0\n\n // Get an element using a linear index:\n > v = arr.iget( 3 )\n 4.0\n\n // Set an element using subscripts:\n > arr.set( 1, 1, 40.0 );\n > arr.get( 1, 1 )\n 40.0\n\n // Set an element using a linear index:\n > arr.iset( 3, 99.0 );\n > arr.get( 1, 1 )\n 99.0\n\n See Also\n --------\n array, ndarray\n",
"ndarrayMinDataType": "\nndarrayMinDataType( value )\n Returns the minimum ndarray data type of the closest \"kind\" necessary for\n storing a provided scalar value.\n\n The function does *not* provide precision guarantees for non-integer-valued\n real numbers. In other words, the function returns the smallest possible\n floating-point (i.e., inexact) data type for storing numbers having\n decimals.\n\n Parameters\n ----------\n value: any\n Scalar value.\n\n Returns\n -------\n dt: string\n ndarray data type.\n\n Examples\n --------\n > var dt = ndarrayMinDataType( 3.141592653589793 )\n 'float32'\n > dt = ndarrayMinDataType( 3 )\n 'uint8'\n > dt = ndarrayMinDataType( -3 )\n 'int8'\n > dt = ndarrayMinDataType( '-3' )\n 'generic'\n\n See Also\n --------\n ndarrayDataTypes, ndarrayPromotionRules, ndarraySafeCasts\n",
"ndarrayNextDataType": "\nndarrayNextDataType( [dtype] )\n Returns the next larger ndarray data type of the same kind.\n\n If not provided a data type, the function returns a table.\n\n If a data type does not have a next larger data type or the next larger type\n is not supported, the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Next larger type(s).\n\n Examples\n --------\n > var out = ndarrayNextDataType( 'float32' )\n 'float64'\n\n See Also\n --------\n ndarrayDataTypes, ndarrayPromotionRules, ndarraySafeCasts\n",
"ndarrayOrders": "\nndarrayOrders()\n Returns a list of ndarray orders.\n\n The output array contains the following orders:\n\n - row-major: row-major (C-style) order.\n - column-major: column-major (Fortran-style) order.\n\n Returns\n -------\n out: Array<string>\n List of ndarray orders.\n\n Examples\n --------\n > var out = ndarrayOrders()\n [ 'row-major', 'column-major' ]\n\n See Also\n --------\n array, ndarray\n",
"ndarrayPromotionRules": "\nndarrayPromotionRules( [dtype1, dtype2] )\n Returns the ndarray data type with the smallest size and closest \"kind\" to\n which ndarray data types can be safely cast.\n\n If not provided data types, the function returns a type promotion table.\n\n If a data type to which data types can be safely cast does *not* exist (or\n is not supported), the function returns `-1`.\n\n If provided an unrecognized data type, the function returns `null`.\n\n Parameters\n ----------\n dtype1: string (optional)\n ndarray data type.\n\n dtype2: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|string|integer|null\n Promotion rule(s).\n\n Examples\n --------\n > var out = ndarrayPromotionRules( 'float32', 'int32' )\n 'float64'\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySafeCasts\n",
"ndarraySafeCasts": "\nndarraySafeCasts( [dtype] )\n Returns a list of ndarray data types to which a provided ndarray data type\n can be safely cast.\n\n If not provided an ndarray data type, the function returns a casting table.\n\n If provided an unrecognized ndarray data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n ndarray data types to which a data type can be safely cast.\n\n Examples\n --------\n > var out = ndarraySafeCasts( 'float32' )\n <Array>\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySameKindCasts\n",
"ndarraySameKindCasts": "\nndarraySameKindCasts( [dtype] )\n Returns a list of ndarray data types to which a provided ndarray data type\n can be safely cast or cast within the same \"kind\".\n\n If not provided an ndarray data type, the function returns a casting table.\n\n If provided an unrecognized ndarray data type, the function returns `null`.\n\n Parameters\n ----------\n dtype: string (optional)\n ndarray data type.\n\n Returns\n -------\n out: Object|Array<string>|null\n ndarray data types to which a data type can be safely cast or cast\n within the same \"kind\".\n\n Examples\n --------\n > var out = ndarraySameKindCasts( 'float32' )\n <Array>\n\n See Also\n --------\n ndarrayCastingModes, ndarrayDataTypes, ndarraySafeCasts\n",
"NIGHTINGALES_ROSE": "\nNIGHTINGALES_ROSE()\n Returns data for Nightingale's famous polar area diagram.\n\n Returns\n -------\n out: Array<Object>\n Nightingale's data.\n\n Examples\n --------\n > var data = NIGHTINGALES_ROSE()\n [{...}, {...}, ...]\n\n References\n ----------\n - Nightingale, Florence. 1859. *A contribution to the sanitary history of\n the British army during the late war with Russia*. London, United Kingdom:\n John W. Parker and Son. <http://ocp.hul.harvard.edu/dl/contagion/010164675>.\n\n",
"NINF": "\nNINF\n Double-precision floating-point negative infinity.\n\n Examples\n --------\n > NINF\n -Infinity\n\n See Also\n --------\n FLOAT16_NINF, FLOAT32_NINF, PINF\n",
"NODE_VERSION": "\nNODE_VERSION\n Node version.\n\n Examples\n --------\n > NODE_VERSION\n <string>\n\n",
"none": "\nnone( collection )\n Tests whether all elements in a collection are falsy.\n\n The function immediately returns upon encountering a truthy value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n Returns\n -------\n bool: boolean\n The function returns `true` if all elements are falsy; otherwise, the\n function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 0, 0, 0 ];\n > var bool = none( arr )\n true\n\n See Also\n --------\n any, every, forEach, noneBy, some\n",
"noneBy": "\nnoneBy( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a falsy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, 3, 4 ];\n > var bool = noneBy( arr, negative )\n true\n\n See Also\n --------\n anyBy, everyBy, forEach, none, noneByRight, someBy\n",
"noneByAsync": "\nnoneByAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a truthy `result` value\n and calls the `done` callback with `null` as the first argument and `false`\n as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null` as\n the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > noneByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\nnoneByAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection fail a\n test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = noneByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByAsync, everyByAsync, forEachAsync, noneBy, noneByRightAsync, someByAsync\n",
"noneByRight": "\nnoneByRight( collection, predicate[, thisArg ] )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon encountering a truthy return value.\n\n If provided an empty collection, the function returns `true`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if the predicate function returns a falsy\n value for all elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function positive( v ) { return ( v > 0 ); };\n > var arr = [ -1, -2, -3, -4 ];\n > var bool = noneByRight( arr, positive )\n true\n\n See Also\n --------\n anyByRight, everyByRight, forEachRight, none, noneBy, someByRight\n",
"noneByRightAsync": "\nnoneByRightAsync( collection, [options,] predicate, done )\n Tests whether all elements in a collection fail a test implemented by a\n predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon encountering a truthy `result` value\n and calls the `done` callback with `null` as the first argument and `false`\n as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null` as\n the first argument and `true` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n true\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n true\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > noneByRightAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n true\n\n\nnoneByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether all elements in a collection fail a\n test implemented by a predicate function, iterating from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = noneByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n true\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n true\n\n See Also\n --------\n anyByRightAsync, everyByRightAsync, forEachRightAsync, noneByAsync, noneByRight, someByRightAsync\n",
"nonEnumerableProperties": "\nnonEnumerableProperties( value )\n Returns an array of an object's own non-enumerable property names and\n symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own non-enumerable properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = false;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var props = nonEnumerableProperties( obj )\n [ 'beep' ]\n\n See Also\n --------\n enumerableProperties, inheritedNonEnumerableProperties, nonEnumerablePropertiesIn, properties\n",
"nonEnumerablePropertiesIn": "\nnonEnumerablePropertiesIn( value )\n Returns an array of an object's own and inherited non-enumerable property\n names and symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited non-enumerable property names and\n symbols.\n\n Examples\n --------\n > var props = nonEnumerablePropertiesIn( [] )\n\n See Also\n --------\n enumerablePropertiesIn, inheritedNonEnumerableProperties, nonEnumerableProperties, propertiesIn\n",
"nonEnumerablePropertyNames": "\nnonEnumerablePropertyNames( value )\n Returns an array of an object's own non-enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own non-enumerable property names.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var keys = nonEnumerablePropertyNames( obj )\n e.g., [ 'beep', ... ]\n\n See Also\n --------\n objectKeys, inheritedNonEnumerablePropertyNames, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbolsIn, propertyNames\n",
"nonEnumerablePropertyNamesIn": "\nnonEnumerablePropertyNamesIn( value )\n Returns an array of an object's own and inherited non-enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own and inherited non-enumerable property names.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > defineProperty( obj, 'beep', desc );\n > var keys = nonEnumerablePropertyNamesIn( obj )\n e.g., [ 'beep', ... ]\n\n See Also\n --------\n keysIn, inheritedNonEnumerablePropertyNames, nonEnumerablePropertyNames, propertyNamesIn\n",
"nonEnumerablePropertySymbols": "\nnonEnumerablePropertySymbols( value )\n Returns an array of an object's own non-enumerable symbol properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own non-enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = nonEnumerablePropertySymbols( obj )\n\n See Also\n --------\n enumerablePropertySymbols, inheritedNonEnumerablePropertySymbols, nonEnumerablePropertyNames, nonEnumerablePropertySymbolsIn, propertySymbols\n",
"nonEnumerablePropertySymbolsIn": "\nnonEnumerablePropertySymbolsIn( value )\n Returns an array of an object's own and inherited non-enumerable symbol\n properties.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited non-enumerable symbol properties.\n\n Examples\n --------\n > var obj = {};\n > var desc = {};\n > desc.configurable = false;\n > desc.enumerable = false;\n > desc.writable = true;\n > desc.value = 'boop';\n > var sym = ( {{@alias:@stdlib/symbol/ctor}} ) ? Symbol( 'beep' ) : 'beep';\n > defineProperty( obj, sym, desc );\n > var symbols = nonEnumerablePropertySymbolsIn( obj )\n\n See Also\n --------\n enumerablePropertySymbolsIn, inheritedNonEnumerablePropertySymbols, nonEnumerablePropertyNamesIn, nonEnumerablePropertySymbols, propertySymbolsIn\n",
"noop": "\nnoop()\n A function which does nothing.\n\n Examples\n --------\n > noop();\n\n",
"now": "\nnow()\n Returns the time in seconds since the epoch.\n\n The Unix epoch is 00:00:00 UTC on 1 January 1970.\n\n Returns\n -------\n out: integer\n Time in seconds since the epoch.\n\n Examples\n --------\n > var ts = now()\n <number>\n\n",
"NUM_CPUS": "\nNUM_CPUS\n Number of CPUs.\n\n In browser environments, the number of CPUs is determined by querying the\n hardware concurrency API.\n\n In Node.js environments, the number of CPUs is determined via the `os`\n module.\n\n Examples\n --------\n > NUM_CPUS\n <number>\n\n",
"Number": "\nNumber( value )\n Returns a Number object.\n\n This constructor should be used sparingly. Always prefer number primitives.\n\n Parameters\n ----------\n value: number\n Value to wrap in a Number object.\n\n Returns\n -------\n out: Number\n Number object.\n\n Examples\n --------\n > var v = new Number( 5 )\n <Number>\n\n",
"objectEntries": "\nobjectEntries( obj )\n Returns an array of an object's own enumerable property `[key, value]`\n pairs.\n\n Entry order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic return values.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n arr: Array\n Array containing key-value pairs.\n\n Examples\n --------\n > var obj = { 'beep': 'boop', 'foo': 'bar' };\n > var entries = objectEntries( obj )\n e.g., [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ]\n\n See Also\n --------\n objectEntriesIn, objectFromEntries, objectKeys, objectValues\n",
"objectEntriesIn": "\nobjectEntriesIn( obj )\n Returns an array of an object's own and inherited enumerable property\n `[key, value]` pairs.\n\n Entry order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic return values.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n arr: Array\n Array containing key-value pairs.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var entries = objectEntriesIn( obj )\n e.g., [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ]\n\n See Also\n --------\n objectEntries, objectFromEntries, keysIn, objectValuesIn\n",
"objectFromEntries": "\nobjectFromEntries( entries )\n Creates an object from an array of key-value pairs.\n\n Parameters\n ----------\n entries: Array<Array>\n Input object.\n\n Returns\n -------\n out: Object\n Object created from `[key, value]` pairs.\n\n Examples\n --------\n > var entries = [ [ 'beep', 'boop' ], [ 'foo', 'bar' ] ];\n > var obj = objectFromEntries( entries )\n { 'beep': 'boop', 'foo': 'bar' }\n\n See Also\n --------\n objectEntries\n",
"objectInverse": "\nobjectInverse( obj[, options] )\n Inverts an object, such that keys become values and values become keys.\n\n Beware when providing objects having values which are themselves objects.\n The function relies on native object serialization (`#toString`) when\n converting values to keys.\n\n Insertion order is not guaranteed, as object key enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's keys, thus allowing for\n deterministic inversion.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n options: Object (optional)\n Options.\n\n options.duplicates: boolean (optional)\n Boolean indicating whether to store keys mapped to duplicate values in\n arrays. Default: `true`.\n\n Returns\n -------\n out: Object\n Inverted object.\n\n Examples\n --------\n // Basic usage:\n > var obj = { 'a': 'beep', 'b': 'boop' };\n > var out = objectInverse( obj )\n { 'beep': 'a', 'boop': 'b' }\n\n // Duplicate values:\n > obj = { 'a': 'beep', 'b': 'beep' };\n > out = objectInverse( obj )\n { 'beep': [ 'a', 'b' ] }\n\n // Override duplicate values:\n > obj = {};\n > obj.a = 'beep';\n > obj.b = 'boop';\n > obj.c = 'beep';\n > out = objectInverse( obj, { 'duplicates': false } )\n { 'beep': 'c', 'boop': 'b' }\n\n See Also\n --------\n objectInverseBy\n",
"objectInverseBy": "\nobjectInverseBy( obj, [options,] transform )\n Inverts an object, such that keys become values and values become keys,\n according to a transform function.\n\n The transform function is provided three arguments:\n\n - `key`: object key\n - `value`: object value corresponding to `key`\n - `obj`: the input object\n\n The value returned by a transform function should be a value which can be\n serialized as an object key. Hence, beware when providing objects having\n values which are themselves objects. The function relies on native object\n serialization (`#toString`) when converting transform function return values\n to keys.\n\n Insertion order is not guaranteed, as object key enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's keys, thus allowing for\n deterministic inversion.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n options: Object (optional)\n Options.\n\n options.duplicates: boolean (optional)\n Boolean indicating whether to store keys mapped to duplicate values in\n arrays. Default: `true`.\n\n transform: Function\n Transform function.\n\n Returns\n -------\n out: Object\n Inverted object.\n\n Examples\n --------\n // Basic usage:\n > function transform( key, value ) { return key + value; };\n > var obj = { 'a': 'beep', 'b': 'boop' };\n > var out = objectInverseBy( obj, transform )\n { 'abeep': 'a', 'bboop': 'b' }\n\n // Duplicate values:\n > function transform( key, value ) { return value; };\n > obj = { 'a': 'beep', 'b': 'beep' };\n > out = objectInverseBy( obj, transform )\n { 'beep': [ 'a', 'b' ] }\n\n // Override duplicate values:\n > obj = {};\n > obj.a = 'beep';\n > obj.b = 'boop';\n > obj.c = 'beep';\n > out = objectInverseBy( obj, { 'duplicates': false }, transform )\n { 'beep': 'c', 'boop': 'b' }\n\n See Also\n --------\n objectInverse\n",
"objectKeys": "\nobjectKeys( value )\n Returns an array of an object's own enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own enumerable property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = objectKeys( obj )\n [ 'beep' ]\n\n See Also\n --------\n objectEntries, keysIn, objectValues\n",
"objectValues": "\nobjectValues( obj )\n Returns an array of an object's own enumerable property values.\n\n Value order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n values: Array\n Value array.\n\n Examples\n --------\n > var obj = { 'beep': 'boop', 'foo': 'bar' };\n > var vals = objectValues( obj )\n e.g., [ 'boop', 'bar' ]\n\n See Also\n --------\n objectEntries, objectKeys\n",
"objectValuesIn": "\nobjectValuesIn( obj )\n Returns an array of an object's own and inherited enumerable property\n values.\n\n Value order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n Parameters\n ----------\n obj: ObjectLike\n Input object.\n\n Returns\n -------\n values: Array\n Value array.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var values = objectValuesIn( obj )\n e.g., [ 'boop', 'bar' ]\n\n See Also\n --------\n objectEntriesIn, keysIn, objectValues\n",
"omit": "\nomit( obj, keys )\n Returns a partial object copy excluding specified keys.\n\n The function returns a shallow copy.\n\n The function ignores non-existent keys.\n\n The function only copies own properties. Hence, the function never copies\n inherited properties.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n keys: string|Array<string>\n Keys to exclude.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = omit( obj1, 'b' )\n { 'a': 1 }\n\n See Also\n --------\n omitBy\n",
"omitBy": "\nomitBy( obj, predicate )\n Returns a partial object copy excluding properties for which a predicate\n returns a truthy value.\n\n The function returns a shallow copy.\n\n The function only copies own properties. Hence, the function never copies\n inherited properties.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n predicate: Function\n Predicate function.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function predicate( key, value ) { return ( value > 1 ); };\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = omitBy( obj1, predicate )\n { 'a': 1 }\n\n See Also\n --------\n omit\n",
"openURL": "\nopenURL( url )\n Opens a URL in a user's default browser.\n\n In a non-browser environment, the function returns an unreferenced child\n process. In a browser environment, the function returns a reference to a\n `window` object.\n\n Parameters\n ----------\n url: string\n URL to open.\n\n Returns\n -------\n out: process|Window\n Child process or `window` object.\n\n Examples\n --------\n > var out = openURL( 'https://google.com' );\n\n",
"pad": "\npad( str, len[, options] )\n Pads a `string` such that the padded `string` has length `len`.\n\n Any padding which does not evenly divide available space is trimmed such\n that the returned string length is always `len`.\n\n If `len < str.length`, the input string is trimmed.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Output string length.\n\n options: Object (optional)\n Options.\n\n options.lpad: string (optional)\n String used to left pad.\n\n options.rpad: string (optional)\n String used to right pad.\n\n options.centerRight: boolean (optional)\n Boolean indicating whether to center right in the event of a tie.\n Default: `false` (i.e., center left).\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n // Standard usage:\n > var out = pad( 'a', 5 )\n 'a '\n\n // Left pad:\n > out = pad( 'a', 10, { 'lpad': 'b' })\n 'bbbbbbbbba'\n\n // Right pad:\n > out = pad( 'a', 12, { 'rpad': 'b' })\n 'abbbbbbbbbbb'\n\n // Center an input string:\n > var opts = { 'lpad': 'a', 'rpad': 'c' };\n > out = pad( 'b', 11, opts )\n 'aaaaabccccc'\n\n // Left center:\n > opts.centerRight = false;\n > out = pad( 'b', 10, opts )\n 'aaaabccccc'\n\n // Right center:\n > opts.centerRight = true;\n > out = pad( 'b', 10, opts )\n 'aaaaabcccc'\n\n // Output string always length `len`:\n > opts = { 'lpad': 'boop', 'rpad': 'woot' };\n > out = pad( 'beep', 10, opts )\n 'boobeepwoo'\n\n // Pad right, trim right:\n > out = pad( 'beep', 2 )\n 'be'\n\n // Pad left, trim left:\n > opts = { 'lpad': 'b' };\n > out = pad( 'beep', 2, opts )\n 'ep'\n\n // Pad both, trim both:\n > opts = { 'lpad': '@', 'rpad': '!' };\n > out = pad( 'beep', 2, opts )\n 'ee'\n\n // Pad both, trim both starting from left:\n > out = pad( 'abcdef', 3, opts )\n 'cde'\n\n // Pad both, trim both starting from right:\n > opts.centerRight = true;\n > out = pad( 'abcdef', 3, opts )\n 'bcd'\n\n See Also\n --------\n lpad, rpad\n",
"papply": "\npapply( fcn, ...args )\n Returns a function of smaller arity by partially applying arguments.\n\n The implementation does not set the `length` property of the returned\n function. Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n Parameters\n ----------\n fcn: Function\n Function to partially apply.\n\n args: ...any\n Arguments to partially apply.\n\n Returns\n -------\n out: Function\n Partially applied function.\n\n Examples\n --------\n > function add( x, y ) { return x + y; };\n > var add2 = papply( add, 2 );\n > var sum = add2( 3 )\n 5\n\n See Also\n --------\n papplyRight\n",
"papplyRight": "\npapplyRight( fcn, ...args )\n Returns a function of smaller arity by partially applying arguments from the\n right.\n\n The implementation does not set the `length` property of the returned\n function. Accordingly, the returned function `length` is always zero.\n\n The evaluation context is always `null`.\n\n Parameters\n ----------\n fcn: Function\n Function to partially apply.\n\n args: ...any\n Arguments to partially apply.\n\n Returns\n -------\n out: Function\n Partially applied function.\n\n Examples\n --------\n > function say( text, name ) { return text + ', ' + name + '.'; };\n > var toGrace = papplyRight( say, 'Grace Hopper' );\n > var str = toGrace( 'Hello' )\n 'Hello, Grace Hopper.'\n > str = toGrace( 'Thank you' )\n 'Thank you, Grace Hopper.'\n\n See Also\n --------\n papply\n",
"parallel": "\nparallel( files, [options,] clbk )\n Executes scripts in parallel.\n\n Relative file paths are resolved relative to the current working directory.\n\n Ordered script output does not imply that scripts are executed in order. To\n preserve script order, execute the scripts sequentially via some other\n means.\n\n Parameters\n ----------\n files: Array<string>\n Script file paths.\n\n options: Object (optional)\n Options.\n\n options.cmd: string (optional)\n Executable file/command. Default: `'node'`.\n\n options.concurrency: integer (optional)\n Number of scripts to execute concurrently. Script concurrency cannot\n exceed the number of scripts. By specifying a concurrency greater than\n the number of workers, a worker may be executing more than `1` script at\n any one time. While not likely to be advantageous for synchronous\n scripts, setting a higher concurrency may be advantageous for scripts\n performing asynchronous tasks. If the script concurrency is less than\n the number of workers, the number of workers is reduced to match the\n specified concurrency. Default: `options.workers`.\n\n options.workers: integer (optional)\n Number of workers. Default: number of CPUs minus `1`.\n\n options.ordered: boolean (optional)\n Boolean indicating whether to preserve the order of script output. By\n default, the `stdio` output for each script is interleaved; i.e., the\n `stdio` output from one script may be interleaved with the `stdio`\n output from one or more other scripts. To preserve the `stdio` output\n order for each script, set the `ordered` option to `true`. Default:\n `false`.\n\n options.uid: integer (optional)\n Process user identity.\n\n options.gid: integer (optional)\n Process group identity.\n\n options.maxBuffer: integer (optional)\n Max child process `stdio` buffer size. This option is only applied when\n `options.ordered = true`. Default: `200*1024*1024`.\n\n clbk: Function\n Callback to invoke after executing all scripts.\n\n Examples\n --------\n > function done( error ) { if ( error ) { throw error; } };\n > var files = [ './a.js', './b.js' ];\n > parallel( files, done );\n\n // Specify the number of workers:\n > var opts = { 'workers': 8 };\n > parallel( files, opts, done );\n\n",
"parseJSON": "\nparseJSON( str[, reviver] )\n Attempts to parse a string as JSON.\n\n Function behavior differs from `JSON.parse()` as follows:\n\n - throws a `TypeError` if provided any value which is not a string.\n - throws a `TypeError` if provided a `reviver` argument which is not a\n function.\n - returns, rather than throws, a `SyntaxError` if unable to parse a string\n as JSON.\n\n Parameters\n ----------\n str: string\n String to parse.\n\n reviver: Function (optional)\n Transformation function.\n\n Returns\n -------\n out: any|Error\n Parsed value or an error.\n\n Examples\n --------\n > var obj = parseJSON( '{\"beep\":\"boop\"}' )\n { 'beep': 'boop' }\n\n // Provide a reviver:\n > function reviver( key, value ) {\n ... if ( key === '' ) { return value; }\n ... if ( key === 'beep' ) { return value; }\n ... };\n > var str = '{\"beep\":\"boop\",\"a\":\"b\"}';\n > var out = parseJSON( str, reviver )\n { 'beep': 'boop' }\n\n",
"PATH_DELIMITER": "\nPATH_DELIMITER\n Platform-specific path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER\n <string>\n\n // POSIX environment:\n > var path = '/usr/bin:/bin:/usr/sbin';\n > var parts = path.split( PATH_DELIMITER )\n [ '/usr/bin', '/bin', '/usr/sbin' ]\n\n // Windows environment:\n > path = 'C:\\\\Windows\\\\system32;C:\\\\Windows';\n > parts = path.split( PATH_DELIMITER )\n [ 'C:\\\\Windows\\system32', 'C:\\\\Windows' ]\n\n See Also\n --------\n PATH_DELIMITER_POSIX, PATH_DELIMITER_WIN32\n",
"PATH_DELIMITER_POSIX": "\nPATH_DELIMITER_POSIX\n POSIX path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER_POSIX\n ':'\n > var PATH = '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin';\n > var paths = PATH.split( PATH_DELIMITER_POSIX )\n [ '/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin' ]\n\n See Also\n --------\n PATH_DELIMITER, PATH_DELIMITER_WIN32\n",
"PATH_DELIMITER_WIN32": "\nPATH_DELIMITER_WIN32\n Windows path delimiter.\n\n Examples\n --------\n > PATH_DELIMITER_WIN32\n ';'\n > var PATH = 'C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Program Files\\\\node\\\\';\n > var paths = PATH.split( PATH_DELIMITER_WIN32 )\n [ 'C:\\\\Windows\\\\system32', 'C:\\\\Windows', 'C:\\\\Program Files\\\\node\\\\' ]\n\n See Also\n --------\n PATH_DELIMITER, PATH_DELIMITER_POSIX\n",
"PATH_SEP": "\nPATH_SEP\n Platform-specific path segment separator.\n\n Examples\n --------\n > PATH_SEP\n <string>\n\n // Windows environment:\n > var parts = 'foo\\\\bar\\\\baz'.split( PATH_SEP )\n [ 'foo', 'bar', 'baz' ]\n\n // POSIX environment:\n > parts = 'foo/bar/baz'.split( PATH_SEP )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP_POSIX, PATH_SEP_WIN32\n",
"PATH_SEP_POSIX": "\nPATH_SEP_POSIX\n POSIX path segment separator.\n\n Examples\n --------\n > PATH_SEP_POSIX\n '/'\n > var parts = 'foo/bar/baz'.split( PATH_SEP_POSIX )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP, PATH_SEP_WIN32\n",
"PATH_SEP_WIN32": "\nPATH_SEP_WIN32\n Windows path segment separator.\n\n Examples\n --------\n > PATH_SEP_WIN32\n '\\\\'\n > var parts = 'foo\\\\bar\\\\baz'.split( PATH_SEP_WIN32 )\n [ 'foo', 'bar', 'baz' ]\n\n See Also\n --------\n PATH_SEP, PATH_SEP_POSIX\n",
"pcorrtest": "\npcorrtest( x, y[, options] )\n Computes a Pearson product-moment correlation test between paired samples.\n\n By default, the function performs a t-test for the null hypothesis that the\n data in arrays or typed arrays `x` and `y` is not correlated. A test against\n a different population correlation can be carried out by supplying the `rho`\n option. In this case, a test using the Fisher's z transform is conducted.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Nnumber in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.rho: number (optional)\n Number denoting the correlation under the null hypothesis.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the Pearson product-moment correlation\n coefficient. The confidence interval is calculated using Fisher's\n z-transform.\n\n out.nullValue: number\n Assumed correlation under H0 (equal to the supplied `rho` option).\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var rho = 0.5;\n > var x = new Array( 300 );\n > var y = new Array( 300 );\n > for ( var i = 0; i < 300; i++ ) {\n ... x[ i ] = base.random.normal( 0.0, 1.0 );\n ... y[ i ] = ( rho * x[ i ] ) + base.random.normal( 0.0,\n ... base.sqrt( 1.0 - (rho*rho) ) );\n ... }\n > var out = pcorrtest( x, y )\n {\n alpha: 0.05,\n rejected: true,\n pValue: 0,\n statistic: 10.115805615994121,\n ci: [ 0.4161679018930295, 0.5853122968949995 ],\n alternative: 'two-sided',\n method: 't-test for Pearson correlation coefficient',\n nullValue: 0,\n pcorr: 0.505582072355616,\n }\n\n // Print output:\n > var table = out.print()\n t-test for Pearson correlation coefficient\n\n Alternative hypothesis: True correlation coefficient is not equal to 0\n\n pValue: 0\n statistic: 9.2106\n 95% confidence interval: [0.3776,0.5544]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n",
"percentEncode": "\npercentEncode( str )\n Percent-encodes a UTF-16 encoded string according to RFC 3986.\n\n Parameters\n ----------\n str: string\n UTF-16 encoded string.\n\n Returns\n -------\n out: string\n Percent-encoded string.\n\n Examples\n --------\n > var out = percentEncode( '☃' )\n '%E2%98%83'\n\n",
"PHI": "\nPHI\n Golden ratio.\n\n Examples\n --------\n > PHI\n 1.618033988749895\n\n",
"PI": "\nPI\n The mathematical constant `π`.\n\n Examples\n --------\n > PI\n 3.141592653589793\n\n See Also\n --------\n TWO_PI\n",
"PI_SQUARED": "\nPI_SQUARED\n Square of the mathematical constant `π`.\n\n Examples\n --------\n > PI_SQUARED\n 9.869604401089358\n\n See Also\n --------\n PI\n",
"pick": "\npick( obj, keys )\n Returns a partial object copy containing only specified keys.\n\n If a key does not exist as an own property in a source object, the key is\n ignored.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n keys: string|Array<string>\n Keys to copy.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = pick( obj1, 'b' )\n { 'b': 2 }\n\n See Also\n --------\n pickBy\n",
"pickBy": "\npickBy( obj, predicate )\n Returns a partial object copy containing properties for which a predicate\n returns a truthy value.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n predicate: Function\n Predicate function.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > function predicate( key, value ) {\n ... return ( value > 1 );\n ... };\n > var obj1 = { 'a': 1, 'b': 2 };\n > var obj2 = pickBy( obj1, predicate )\n { 'b': 2 }\n\n See Also\n --------\n pick\n",
"PINF": "\nPINF\n Double-precision floating-point positive infinity.\n\n Examples\n --------\n > PINF\n Infinity\n\n See Also\n --------\n NINF\n",
"PLATFORM": "\nPLATFORM\n Platform on which the current process is running.\n\n Possible values:\n\n - win32\n - darwin\n - linux\n - freebsd\n - sunos\n\n Examples\n --------\n > PLATFORM\n <string>\n\n See Also\n --------\n ARCH\n",
"plot": "\nplot( [x, y,] [options] )\n Returns a plot instance for creating 2-dimensional plots.\n\n `x` and `y` arguments take precedence over `x` and `y` options.\n\n Parameters\n ----------\n x: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing x-coordinate values.\n\n y: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing y-coordinate values.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.autoView: boolean (optional)\n Boolean indicating whether to generate an updated view on a 'render'\n event. Default: false.\n\n options.colors: string|Array<string> (optional)\n Data color(s). Default: 'category10'.\n\n options.description: string (optional)\n Plot description.\n\n options.engine: string (optional)\n Plot engine. Default: 'svg'.\n\n options.height: number (optional)\n Plot height (in pixels). Default: 400.\n\n options.labels: Array|Array<string> (optional)\n Data labels.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.lineStyle: string|Array<string> (optional)\n Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'.\n Default: '-'.\n\n options.lineOpacity: number|Array<number> (optional)\n Data line opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.lineWidth: integer|Array<integer> (optional)\n Data line width (in pixels). Default: 2.\n\n options.paddingBottom: integer (optional)\n Bottom padding (in pixels). Default: 80.\n\n options.paddingLeft: integer (optional)\n Left padding (in pixels). Default: 90.\n\n options.paddingRight: integer (optional)\n Right padding (in pixels). Default: 20.\n\n options.paddingTop: integer (optional)\n Top padding (in pixels). Default: 80.\n\n options.renderFormat: string (optional)\n Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'.\n\n options.symbols: string|Array<string> (optional)\n Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'.\n Default: 'none'.\n\n options.symbolsOpacity: number|Array<number> (optional)\n Symbols opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.symbolsSize: integer|Array<integer> (optional)\n Symbols size (in pixels). Default: 6.\n\n options.title: string (optional)\n Plot title.\n\n options.viewer: string (optional)\n Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window',\n or 'none'. Default: 'none'.\n\n options.width: number (optional)\n Plot width (in pixels). Default: 400.\n\n options.x: Array<Array>|Array<TypedArray> (optional)\n x-coordinate values.\n\n options.xAxisOrient: string (optional)\n x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'.\n\n options.xLabel: string (optional)\n x-axis label. Default: 'x'.\n\n options.xMax: number|null (optional)\n Maximum value of the x-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.xMin: number|null (optional)\n Minimum value of the x-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.xNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.xRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the x-axis.\n\n options.xRugOrient: string|Array<string> (optional)\n x-axis rug plot orientation(s). Must be either 'bottom' or 'top'.\n Default: 'bottom'.\n\n options.xRugOpacity: number|Array<number> (optional)\n x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.xRugSize: integer|Array<integer> (optional)\n x-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.xScale: string\n x-axis scale. Default: 'linear'.\n\n options.xTickFormat: string|null\n x-axis tick format. Default: null.\n\n options.y: Array<Array>|Array<TypedArray> (optional)\n y-coordinate values.\n\n options.yAxisOrient: string (optional)\n x-axis orientation. Must be either 'left' or 'right'. Default: 'left'.\n\n options.yLabel: string (optional)\n y-axis label. Default: 'y'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.yNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.yRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the y-axis.\n\n options.yRugOrient: string|Array<string> (optional)\n y-axis rug plot orientation(s). Must be either 'left' or 'right'.\n Default: 'left'.\n\n options.yRugOpacity: number|Array<number> (optional)\n y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.yRugSize: integer|Array<integer> (optional)\n y-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.yScale: string\n y-axis scale. Default: 'linear'.\n\n options.yTickFormat: string|null\n y-axis tick format. Default: null.\n\n Returns\n -------\n plot: Plot\n Plot instance.\n\n plot.render()\n Renders a plot as a virtual DOM tree.\n\n plot.view( [viewer] )\n Generates a plot view.\n\n plot.x\n x-coordinate values. An assigned value must be an array where each\n element corresponds to a plotted dataset.\n\n plot.y\n y-coordinate values. An assigned value must be an array, where each\n element corresponds to a plotted dataset.\n\n plot.labels\n Data labels. During plot creation, each plotted dataset is assigned a\n label. If the number of labels is less than the number of plotted\n datasets, labels are reused using modulo arithmetic.\n\n plot.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n plot.colors\n Data colors. To set the color all plotted datasets, provide a color\n name. To specify the colors for each dataset, provide an array of\n colors. During plot creation, each plotted dataset is assigned one of\n the provided colors. If the number of colors is less than the number of\n plotted datasets, colors are reused using modulo arithmetic. Lastly,\n colors may also be specified by providing the name of a predefined color\n scheme. The following schemes are supported: 'category10', 'category20',\n 'category20b', and 'category20c'.\n\n plot.lineStyle\n Data line style(s). The following line styles are supported: '-' (solid\n line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes\n and dots), and 'none' (no line). To specify the line style for each\n dataset, provide an array of line styles. During plot creation, each\n plotted dataset is assigned a line style. If the number of line styles\n is less than the number of plotted datasets, line styles are reused\n using modulo arithmetic.\n\n plot.lineOpacity\n Data line opacity, where an opacity of `0.0` make a line completely\n transparent and an opacity of `1.0` makes a line completely opaque. To\n specify the line opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.lineWidth\n Data line width(s). To specify the line width for each dataset, provide\n an array of widths. During plot creation, each plotted dataset is\n assigned a line width. If the number of line widths is less than the\n number of plotted datasets, line widths are reused using modulo\n arithmetic.\n\n plot.symbols\n Data symbols. The following symbols are supported: 'closed-circle'\n (closed circles), 'open-circle' (open circles), and 'none' (no symbols).\n To specify the symbols used for each dataset, provide an array of\n symbols. During plot creation, each plotted dataset is assigned a\n symbol. If the number of symbols is less than the number of plotted\n datasets, symbols are reused using modulo arithmetic.\n\n plot.symbolSize\n Symbols size. To specify the symbols size for each dataset, provide an\n array of sizes. During plot creation, each plotted dataset is assigned\n a symbols size. If the number of sizes is less than the number of\n plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.symbolsOpacity\n Symbols opacity, where an opacity of `0.0` makes a symbol completely\n transparent and an opacity of `1.0` makes a symbol completely opaque. To\n specify the opacity for each dataset, provide an array of opacities.\n During plot creation, each plotted dataset is assigned an opacity. If\n the number of opacities is less than the number of plotted datasets,\n opacities are reused using modulo arithmetic.\n\n plot.width\n Plot width (in pixels).\n\n plot.height\n Plot height (in pixels).\n\n plot.paddingLeft\n Plot left padding (in pixels). Left padding is typically used to create\n space for a left-oriented y-axis.\n\n plot.paddingRight\n Plot right padding (in pixels). Right padding is typically used to\n create space for a right-oriented y-axis.\n\n plot.paddingTop\n Plot top padding (in pixels). Top padding is typically used to create\n space for a title or top-oriented x-axis.\n\n plot.paddingBottom\n Plot bottom padding (in pixels). Bottom padding is typically used to\n create space for a bottom-oriented x-axis.\n\n plot.xMin\n Minimum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.xMax\n Maximum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.yMin\n Minimum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.yMax\n Maximum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.xScale\n Scale function for mapping values to a coordinate along the x-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.yScale\n Scale function for mapping values to a coordinate along the y-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.xTickFormat\n x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.yTickFormat\n y-axis tick format (e.g., '%%'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.xNumTicks\n Number of x-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.yNumTicks\n Number of y-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.xAxisOrient\n x-axis orientation. The following orientations are supported: 'bottom'\n and 'top'.\n\n plot.yAxisOrient\n y-axis orientation. The following orientations are supported: 'left' and\n 'right'.\n\n plot.xRug\n Boolean flag(s) indicating whether to display a rug plot along the x-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.yRug\n Boolean flag(s) indicating whether to display a rug plot along the y-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.xRugOrient\n x-axis rug orientation. The following orientations are supported:\n 'bottom' or 'top'. To specify the x-axis rug orientation for each\n dataset, provide an array of orientations. During plot creation, each\n plotted dataset is assigned an orientation. If the number of\n orientations is less than the number of plotted datasets, orientations\n are reused using modulo arithmetic.\n\n plot.yRugOrient\n y-axis rug orientation. The following orientations are supported: 'left'\n or 'right'. To specify the y-axis rug orientation for each dataset,\n provide an array of orientations. During plot creation, each plotted\n dataset is assigned an orientation. If the number of orientations is\n less than the number of plotted datasets, orientations are reused using\n modulo arithmetic.\n\n plot.xRugOpacity\n x-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the x-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.yRugOpacity\n y-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the y-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.xRugSize\n x-axis rug tick (tassel) size. To specify the x-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.yRugSize\n y-axis rug tick (tassel) size. To specify the y-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.description\n Plot description.\n\n plot.title\n Plot title.\n\n plot.xLabel\n x-axis label.\n\n plot.yLabel\n y-axis label.\n\n plot.engine\n Plot rendering engine. The following engines are supported: 'svg'.\n\n plot.renderFormat\n Plot render format. The following formats are supported: 'vdom' and\n 'html'.\n\n plot.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n plot.viewer\n Plot viewer. The following viewers are supported: 'none', 'stdout',\n 'window', and 'browser'.\n\n plot.autoView\n Viewer mode. If `true`, an instance generates an updated view on each\n 'render' event; otherwise, generating a view must be triggered manually.\n\n plot.graphWidth\n Computed property corresponding to the expected graph width.\n\n plot.graphHeight\n Computed property corresponding to the expected graph height.\n\n plot.xDomain\n Computed property corresponding to the x-axis domain.\n\n plot.yDomain\n Computed property corresponding to the y-axis domain.\n\n plot.xRange\n Computed property corresponding to the x-axis range.\n\n plot.yRange\n Computed property correspond to the y-axis range.\n\n plot.xPos\n A function which maps values to x-axis coordinate values.\n\n plot.yPos\n A function which maps values to y-axis coordinate values.\n\n Examples\n --------\n > var plot = plot()\n <Plot>\n\n // Provide plot data at instantiation:\n > var x = [[0.10, 0.20, 0.30]];\n > var y = [[0.52, 0.79, 0.64]];\n > plot = plot( x, y )\n <Plot>\n\n See Also\n --------\n Plot\n",
"Plot": "\nPlot( [x, y,] [options] )\n Returns a plot instance for creating 2-dimensional plots.\n\n `x` and `y` arguments take precedence over `x` and `y` options.\n\n Parameters\n ----------\n x: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing x-coordinate values.\n\n y: Array<Array>|Array<TypedArray> (optional)\n An array of arrays containing y-coordinate values.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.autoView: boolean (optional)\n Boolean indicating whether to generate an updated view on a 'render'\n event. Default: false.\n\n options.colors: string|Array<string> (optional)\n Data color(s). Default: 'category10'.\n\n options.description: string (optional)\n Plot description.\n\n options.engine: string (optional)\n Plot engine. Default: 'svg'.\n\n options.height: number (optional)\n Plot height (in pixels). Default: 400.\n\n options.labels: Array|Array<string> (optional)\n Data labels.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.lineStyle: string|Array<string> (optional)\n Data line style(s). Must be one of: '-', '--', ':', '-.', or 'none'.\n Default: '-'.\n\n options.lineOpacity: number|Array<number> (optional)\n Data line opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.lineWidth: integer|Array<integer> (optional)\n Data line width (in pixels). Default: 2.\n\n options.paddingBottom: integer (optional)\n Bottom padding (in pixels). Default: 80.\n\n options.paddingLeft: integer (optional)\n Left padding (in pixels). Default: 90.\n\n options.paddingRight: integer (optional)\n Right padding (in pixels). Default: 20.\n\n options.paddingTop: integer (optional)\n Top padding (in pixels). Default: 80.\n\n options.renderFormat: string (optional)\n Plot render format. Must be one of 'vdom' or 'html'. Default: 'vdom'.\n\n options.symbols: string|Array<string> (optional)\n Data symbols. Must be one of 'closed-circle', 'open-circle', or 'none'.\n Default: 'none'.\n\n options.symbolsOpacity: number|Array<number> (optional)\n Symbols opacity. Must be on the interval [0,1]. Default: 0.9.\n\n options.symbolsSize: integer|Array<integer> (optional)\n Symbols size (in pixels). Default: 6.\n\n options.title: string (optional)\n Plot title.\n\n options.viewer: string (optional)\n Plot viewer. Must be one of 'browser', 'terminal', 'stdout', 'window',\n or 'none'. Default: 'none'.\n\n options.width: number (optional)\n Plot width (in pixels). Default: 400.\n\n options.x: Array<Array>|Array<TypedArray> (optional)\n x-coordinate values.\n\n options.xAxisOrient: string (optional)\n x-axis orientation. Must be either 'bottom' or 'top'. Default: 'bottom'.\n\n options.xLabel: string (optional)\n x-axis label. Default: 'x'.\n\n options.xMax: number|null (optional)\n Maximum value of the x-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.xMin: number|null (optional)\n Minimum value of the x-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.xNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.xRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the x-axis.\n\n options.xRugOrient: string|Array<string> (optional)\n x-axis rug plot orientation(s). Must be either 'bottom' or 'top'.\n Default: 'bottom'.\n\n options.xRugOpacity: number|Array<number> (optional)\n x-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.xRugSize: integer|Array<integer> (optional)\n x-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.xScale: string\n x-axis scale. Default: 'linear'.\n\n options.xTickFormat: string|null\n x-axis tick format. Default: null.\n\n options.y: Array<Array>|Array<TypedArray> (optional)\n y-coordinate values.\n\n options.yAxisOrient: string (optional)\n x-axis orientation. Must be either 'left' or 'right'. Default: 'left'.\n\n options.yLabel: string (optional)\n y-axis label. Default: 'y'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the maximum value is\n calculated from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the minimum value is\n calculated from the data. Default: null.\n\n options.yNumTicks: integer (optional)\n Number of x-axis tick marks. Default: 5.\n\n options.yRug: boolean|Array<boolean> (optional)\n Boolean flag(s) indicating whether to render one or more rug plots along\n the y-axis.\n\n options.yRugOrient: string|Array<string> (optional)\n y-axis rug plot orientation(s). Must be either 'left' or 'right'.\n Default: 'left'.\n\n options.yRugOpacity: number|Array<number> (optional)\n y-axis rug plot opacity. Must be on the interval [0,1]. Default: 0.1.\n\n options.yRugSize: integer|Array<integer> (optional)\n y-axis rug tick (tassel) size (in pixels). Default: 6.\n\n options.yScale: string\n y-axis scale. Default: 'linear'.\n\n options.yTickFormat: string|null\n y-axis tick format. Default: null.\n\n Returns\n -------\n plot: Plot\n Plot instance.\n\n plot.render()\n Renders a plot as a virtual DOM tree.\n\n plot.view( [viewer] )\n Generates a plot view.\n\n plot.x\n x-coordinate values. An assigned value must be an array where each\n element corresponds to a plotted dataset.\n\n plot.y\n y-coordinate values. An assigned value must be an array, where each\n element corresponds to a plotted dataset.\n\n plot.labels\n Data labels. During plot creation, each plotted dataset is assigned a\n label. If the number of labels is less than the number of plotted\n datasets, labels are reused using modulo arithmetic.\n\n plot.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n plot.colors\n Data colors. To set the color all plotted datasets, provide a color\n name. To specify the colors for each dataset, provide an array of\n colors. During plot creation, each plotted dataset is assigned one of\n the provided colors. If the number of colors is less than the number of\n plotted datasets, colors are reused using modulo arithmetic. Lastly,\n colors may also be specified by providing the name of a predefined color\n scheme. The following schemes are supported: 'category10', 'category20',\n 'category20b', and 'category20c'.\n\n plot.lineStyle\n Data line style(s). The following line styles are supported: '-' (solid\n line), '--' (dashed line), ':' (dotted line), '-.' (alternating dashes\n and dots), and 'none' (no line). To specify the line style for each\n dataset, provide an array of line styles. During plot creation, each\n plotted dataset is assigned a line style. If the number of line styles\n is less than the number of plotted datasets, line styles are reused\n using modulo arithmetic.\n\n plot.lineOpacity\n Data line opacity, where an opacity of `0.0` make a line completely\n transparent and an opacity of `1.0` makes a line completely opaque. To\n specify the line opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.lineWidth\n Data line width(s). To specify the line width for each dataset, provide\n an array of widths. During plot creation, each plotted dataset is\n assigned a line width. If the number of line widths is less than the\n number of plotted datasets, line widths are reused using modulo\n arithmetic.\n\n plot.symbols\n Data symbols. The following symbols are supported: 'closed-circle'\n (closed circles), 'open-circle' (open circles), and 'none' (no symbols).\n To specify the symbols used for each dataset, provide an array of\n symbols. During plot creation, each plotted dataset is assigned a\n symbol. If the number of symbols is less than the number of plotted\n datasets, symbols are reused using modulo arithmetic.\n\n plot.symbolSize\n Symbols size. To specify the symbols size for each dataset, provide an\n array of sizes. During plot creation, each plotted dataset is assigned\n a symbols size. If the number of sizes is less than the number of\n plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.symbolsOpacity\n Symbols opacity, where an opacity of `0.0` makes a symbol completely\n transparent and an opacity of `1.0` makes a symbol completely opaque. To\n specify the opacity for each dataset, provide an array of opacities.\n During plot creation, each plotted dataset is assigned an opacity. If\n the number of opacities is less than the number of plotted datasets,\n opacities are reused using modulo arithmetic.\n\n plot.width\n Plot width (in pixels).\n\n plot.height\n Plot height (in pixels).\n\n plot.paddingLeft\n Plot left padding (in pixels). Left padding is typically used to create\n space for a left-oriented y-axis.\n\n plot.paddingRight\n Plot right padding (in pixels). Right padding is typically used to\n create space for a right-oriented y-axis.\n\n plot.paddingTop\n Plot top padding (in pixels). Top padding is typically used to create\n space for a title or top-oriented x-axis.\n\n plot.paddingBottom\n Plot bottom padding (in pixels). Bottom padding is typically used to\n create space for a bottom-oriented x-axis.\n\n plot.xMin\n Minimum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.xMax\n Maximum value of the x-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `x` data.\n\n plot.yMin\n Minimum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.yMax\n Maximum value of the y-axis domain. When retrieved, if the value has\n been set to `null`, the returned value is computed from the `y` data.\n\n plot.xScale\n Scale function for mapping values to a coordinate along the x-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.yScale\n Scale function for mapping values to a coordinate along the y-axis. The\n following `scales` are supported: 'linear' (linear scale) and 'time'\n (time scale). When retrieved, the returned value is a scale function.\n\n plot.xTickFormat\n x-axis tick format (e.g., '%H:%M'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.yTickFormat\n y-axis tick format (e.g., '%%'). When retrieved, if the value has not\n been set to `null`, the returned value is a formatting function.\n\n plot.xNumTicks\n Number of x-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.yNumTicks\n Number of y-axis tick marks. If the value is set to `null`, the number\n of tick marks is computed internally.\n\n plot.xAxisOrient\n x-axis orientation. The following orientations are supported: 'bottom'\n and 'top'.\n\n plot.yAxisOrient\n y-axis orientation. The following orientations are supported: 'left' and\n 'right'.\n\n plot.xRug\n Boolean flag(s) indicating whether to display a rug plot along the x-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.yRug\n Boolean flag(s) indicating whether to display a rug plot along the y-\n axis. To specify the flag for each dataset, provide an array of\n booleans. During plot creation, each plotted dataset is assigned a flag.\n If the number of flags is less than the number of plotted datasets,\n flags are reused using modulo arithmetic.\n\n plot.xRugOrient\n x-axis rug orientation. The following orientations are supported:\n 'bottom' or 'top'. To specify the x-axis rug orientation for each\n dataset, provide an array of orientations. During plot creation, each\n plotted dataset is assigned an orientation. If the number of\n orientations is less than the number of plotted datasets, orientations\n are reused using modulo arithmetic.\n\n plot.yRugOrient\n y-axis rug orientation. The following orientations are supported: 'left'\n or 'right'. To specify the y-axis rug orientation for each dataset,\n provide an array of orientations. During plot creation, each plotted\n dataset is assigned an orientation. If the number of orientations is\n less than the number of plotted datasets, orientations are reused using\n modulo arithmetic.\n\n plot.xRugOpacity\n x-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the x-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.yRugOpacity\n y-axis rug opacity, where an opacity of `0.0` makes a rug completely\n transparent and an opacity of `1.0` makes a rug completely opaque. To\n specify the y-axis rug opacity for each dataset, provide an array of\n opacities. During plot creation, each plotted dataset is assigned an\n opacity. If the number of opacities is less than the number of plotted\n datasets, opacities are reused using modulo arithmetic.\n\n plot.xRugSize\n x-axis rug tick (tassel) size. To specify the x-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.yRugSize\n y-axis rug tick (tassel) size. To specify the y-axis rug size for each\n dataset, provide an array of sizes. During plot creation, each plotted\n dataset is assigned a tick size. If the number of sizes is less than the\n number of plotted datasets, sizes are reused using modulo arithmetic.\n\n plot.description\n Plot description.\n\n plot.title\n Plot title.\n\n plot.xLabel\n x-axis label.\n\n plot.yLabel\n y-axis label.\n\n plot.engine\n Plot rendering engine. The following engines are supported: 'svg'.\n\n plot.renderFormat\n Plot render format. The following formats are supported: 'vdom' and\n 'html'.\n\n plot.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n plot.viewer\n Plot viewer. The following viewers are supported: 'none', 'stdout',\n 'window', and 'browser'.\n\n plot.autoView\n Viewer mode. If `true`, an instance generates an updated view on each\n 'render' event; otherwise, generating a view must be triggered manually.\n\n plot.graphWidth\n Computed property corresponding to the expected graph width.\n\n plot.graphHeight\n Computed property corresponding to the expected graph height.\n\n plot.xDomain\n Computed property corresponding to the x-axis domain.\n\n plot.yDomain\n Computed property corresponding to the y-axis domain.\n\n plot.xRange\n Computed property corresponding to the x-axis range.\n\n plot.yRange\n Computed property correspond to the y-axis range.\n\n plot.xPos\n A function which maps values to x-axis coordinate values.\n\n plot.yPos\n A function which maps values to y-axis coordinate values.\n\n Examples\n --------\n > var plot = Plot()\n <Plot>\n\n // Provide plot data at instantiation:\n > var x = [[0.10, 0.20, 0.30]];\n > var y = [[0.52, 0.79, 0.64]];\n > plot = Plot( x, y )\n <Plot>\n\n See Also\n --------\n plot\n",
"pluck": "\npluck( arr, prop[, options] )\n Extracts a property value from each element of an object array.\n\n The function skips `null` and `undefined` array elements.\n\n Extracted values are not cloned.\n\n Parameters\n ----------\n arr: Array\n Source array.\n\n prop: string\n Property to access.\n\n options: Object (optional)\n Options.\n\n options.copy: boolean (optional)\n Boolean indicating whether to return a new data structure. To mutate the\n input data structure (e.g., when input values can be discarded or when\n optimizing memory usage), set the `copy` option to `false`. Default:\n true.\n\n Returns\n -------\n out: Array\n Destination array.\n\n Examples\n --------\n > var arr = [\n ... { 'a': 1, 'b': 2 },\n ... { 'a': 0.5, 'b': 3 }\n ... ];\n > var out = pluck( arr, 'a' )\n [ 1, 0.5 ]\n\n > arr = [\n ... { 'a': 1, 'b': 2 },\n ... { 'a': 0.5, 'b': 3 }\n ... ];\n > out = pluck( arr, 'a', { 'copy': false } )\n [ 1, 0.5 ]\n > var bool = ( arr[ 0 ] === out[ 0 ] )\n true\n\n See Also\n --------\n deepPluck, pick\n",
"pop": "\npop( collection )\n Removes and returns the last element of a collection.\n\n The function returns an array with two elements: the shortened collection\n and the removed element.\n\n If the input collection is a typed array whose length is greater than `0`,\n the first return value does not equal the input reference.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the value should be\n array-like.\n\n Returns\n -------\n out: Array\n Updated collection and the removed item.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var out = pop( arr )\n [ [ 1.0, 2.0, 3.0, 4.0 ], 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > out = pop( arr )\n [ <Float64Array>[ 1.0 ], 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 2, '0': 1.0, '1': 2.0 };\n > out = pop( arr )\n [ { 'length': 1, '0': 1.0 }, 2.0 ]\n\n See Also\n --------\n push, shift, unshift\n",
"prepend": "\nprepend( collection1, collection2 )\n Adds the elements of one collection to the beginning of another collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection1: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n collection2: Array|TypedArray|Object\n A collection containing the elements to add. If the collection is an\n `Object`, the collection should be array-like.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = prepend( arr, [ 6.0, 7.0 ] )\n [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = prepend( arr, [ 3.0, 4.0 ] )\n <Float64Array>[ 3.0, 4.0, 1.0, 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 1, '0': 1.0 };\n > arr = prepend( arr, [ 2.0, 3.0 ] )\n { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }\n\n See Also\n --------\n append, unshift\n",
"properties": "\nproperties( value )\n Returns an array of an object's own enumerable and non-enumerable property\n names and symbols.\n\n Property order is not guaranteed, as object property enumeration is not\n specified according to the ECMAScript specification. In practice, however,\n most engines use insertion order to sort an object's properties, thus\n allowing for deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own enumerable and non-enumerable properties.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var props = properties( obj )\n [ 'beep' ]\n\n See Also\n --------\n defineProperties, inheritedProperties, propertiesIn, propertyNames, propertySymbols\n",
"propertiesIn": "\npropertiesIn( value )\n Returns an array of an object's own and inherited property names and\n symbols.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n props: Array\n List of an object's own and inherited property names and symbols.\n\n Examples\n --------\n > var props = propertiesIn( [] )\n\n See Also\n --------\n defineProperties, inheritedProperties, properties, propertyNamesIn, propertySymbolsIn\n",
"propertyDescriptor": "\npropertyDescriptor( value, property )\n Returns a property descriptor for an object's own property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptor( obj, 'a' )\n {...}\n\n See Also\n --------\n hasOwnProp, defineProperty, propertyDescriptorIn, propertyDescriptors\n",
"propertyDescriptorIn": "\npropertyDescriptorIn( value, property )\n Returns a property descriptor for an object's own or inherited property.\n\n If provided `null` or `undefined` or provided a non-existent property, the\n function returns `null`.\n\n Parameters\n ----------\n value: any\n Input value.\n\n property: string|symbol\n Property name.\n\n Returns\n -------\n desc: Object|null\n Property descriptor.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptorIn( obj, 'a' )\n {...}\n\n See Also\n --------\n hasProp, defineProperty, propertyDescriptor, propertyDescriptorsIn\n",
"propertyDescriptors": "\npropertyDescriptors( value )\n Returns an object's own property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n desc: Object\n Property descriptors.\n\n Examples\n --------\n > var obj = { 'a': 'b' };\n > var desc = propertyDescriptors( obj )\n { 'a': {...} }\n\n See Also\n --------\n defineProperty, defineProperties, propertyDescriptor, propertyDescriptorsIn, propertyNames, propertySymbols\n",
"propertyDescriptorsIn": "\npropertyDescriptorsIn( value )\n Returns an object's own and inherited property descriptors.\n\n If provided `null` or `undefined`, the function returns an empty object.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n desc: Object\n An object's own and inherited property descriptors.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var desc = propertyDescriptorsIn( obj )\n { 'beep': {...}, 'foo': {...}, ... }\n\n See Also\n --------\n defineProperties, propertyDescriptorIn, propertyDescriptors, propertyNamesIn, propertySymbolsIn\n",
"propertyNames": "\npropertyNames( value )\n Returns an array of an object's own enumerable and non-enumerable property\n names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own enumerable and non-enumerable property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = propertyNames( obj )\n [ 'beep' ]\n\n See Also\n --------\n objectKeys, nonEnumerablePropertyNames, propertyNamesIn, propertySymbols\n",
"propertyNamesIn": "\npropertyNamesIn( value )\n Returns an array of an object's own and inherited enumerable and non-\n enumerable property names.\n\n Name order is not guaranteed, as object key enumeration is not specified\n according to the ECMAScript specification. In practice, however, most\n engines use insertion order to sort an object's keys, thus allowing for\n deterministic extraction.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n keys: Array\n List of an object's own and inherited enumerable and non-enumerable\n property names.\n\n Examples\n --------\n > function Foo() { this.beep = 'boop'; return this; };\n > Foo.prototype.foo = 'bar';\n > var obj = new Foo();\n > var keys = propertyNamesIn( obj )\n e.g., [ 'beep', 'foo', ... ]\n\n See Also\n --------\n objectKeys, nonEnumerablePropertyNamesIn, propertyNames, propertySymbolsIn\n",
"propertySymbols": "\npropertySymbols( value )\n Returns an array of an object's own symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own symbol properties.\n\n Examples\n --------\n > var s = propertySymbols( {} )\n\n See Also\n --------\n propertyNames, propertySymbolsIn\n",
"propertySymbolsIn": "\npropertySymbolsIn( value )\n Returns an array of an object's own and inherited symbol properties.\n\n If provided `null` or `undefined`, the function returns an empty array.\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n symbols: Array\n List of an object's own and inherited symbol properties.\n\n Examples\n --------\n > var s = propertySymbolsIn( [] )\n\n See Also\n --------\n propertyNamesIn, propertySymbols\n",
"Proxy": "\nProxy( target, handlers )\n Returns a proxy object implementing custom behavior for specified object\n operations.\n\n The following \"traps\" are supported:\n\n - getPrototypeOf( target )\n Trap for `Object.getPrototypeOf()`. Can be used to intercept the\n `instanceof` operator. The method must return an object or `null`.\n\n - setPrototypeOf( target, prototype )\n Trap for `Object.setPrototypeOf()`. The method must return a boolean\n indicating if prototype successfully set.\n\n - isExtensible( target )\n Trap for `Object.isExtensible()`. The method must return a boolean.\n\n - preventExtensions( target )\n Trap for `Object.preventExtensions()`. The method must return a boolean.\n\n - getOwnPropertyDescriptor( target, property )\n Trap for `Object.getOwnPropertyDescriptor()`. The method must return an\n object or `undefined`.\n\n - defineProperty( target, property, descriptor )\n Trap for `Object.defineProperty()`. The method must return a boolean\n indicating whether the operation succeeded.\n\n - has( target, property )\n Trap for the `in` operator. The method must return a boolean.\n\n - get( target, property, receiver )\n Trap for retrieving property values. The method can return any value.\n\n - set( target, property, value, receiver )\n Trap for setting property values. The method should return a boolean\n indicating whether assignment succeeded.\n\n - deleteProperty( target, property )\n Trap for the `delete` operator. The method must return a boolean\n indicating whether operation succeeded.\n\n - ownKeys( target )\n Trap for `Object.keys`, `Object.getOwnPropertyNames()`, and\n `Object.getOwnPropertySymbols()`. The method must return an enumerable\n object.\n\n - apply( target, thisArg, argumentsList )\n Trap for a function call. The method can return any value.\n\n - construct( target, argumentsList, newTarget )\n Trap for the `new` operator. The method must return an object.\n\n All traps are optional. If a trap is not defined, the default behavior is to\n forward the operation to the target.\n\n Parameters\n ----------\n target: Object\n Object which the proxy virtualizes.\n\n handlers: Object\n Object whose properties are functions which define the behavior of the\n proxy when performing operations.\n\n Returns\n -------\n p: Object\n Proxy object.\n\n Examples\n --------\n > function get( obj, prop ) { return obj[ prop ] * 2.0 };\n > var h = { 'get': get };\n > var p = new Proxy( {}, h );\n > p.a = 3.14;\n > p.a\n 6.28\n\n\nProxy.revocable( target, handlers )\n Returns a revocable proxy object\n\n Parameters\n ----------\n target: Object\n Object which the proxy virtualizes.\n\n handlers: Object\n Object whose properties are functions which define the behavior of the\n proxy when performing operations.\n\n Returns\n -------\n p: Object\n Revocable proxy object.\n\n p.proxy: Object\n Proxy object.\n\n p.revoke: Function\n Invalidates a proxy, rendering a proxy object unusable.\n\n Examples\n --------\n > function get( obj, prop ) { return obj[ prop ] * 2.0 };\n > var h = { 'get': get };\n > var p = Proxy.revocable( {}, h );\n > p.proxy.a = 3.14;\n > p.proxy.a\n 6.28\n > p.revoke();\n\n",
"push": "\npush( collection, ...items )\n Adds one or more elements to the end of a collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n items: ...any\n Items to add.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = push( arr, 6.0, 7.0 )\n [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = push( arr, 3.0, 4.0 )\n <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]\n\n // Array-like object:\n > arr = { 'length': 0 };\n > arr = push( arr, 1.0, 2.0 )\n { 'length': 2, '0': 1.0, '1': 2.0 }\n\n See Also\n --------\n pop, shift, unshift\n",
"quarterOfYear": "\nquarterOfYear( [month] )\n Returns the quarter of the year.\n\n By default, the function returns the quarter of the year for the current\n month in the current year (according to local time). To determine the\n quarter for a particular month, provide either a month or a `Date`\n object.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n Parameters\n ----------\n month: integer|string|Date (optional)\n Month (or `Date`).\n\n Returns\n -------\n out: integer\n Quarter of the year.\n\n Examples\n --------\n > var q = quarterOfYear( new Date() )\n <number>\n > q = quarterOfYear( 4 )\n 2\n > q = quarterOfYear( 'June' )\n 2\n\n // Other ways to supply month:\n > q = quarterOfYear( 'April' )\n 2\n > q = quarterOfYear( 'apr' )\n 2\n\n See Also\n --------\n dayOfYear\n",
"random.iterators.arcsine": "\nrandom.iterators.arcsine( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n arcsine distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.arcsine( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.arcsine\n",
"random.iterators.bernoulli": "\nrandom.iterators.bernoulli( p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Bernoulli distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.bernoulli( 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.bernoulli\n",
"random.iterators.beta": "\nrandom.iterators.beta( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n beta distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.beta( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.beta\n",
"random.iterators.betaprime": "\nrandom.iterators.betaprime( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n beta prime distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n First shape parameter.\n\n β: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.betaprime( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.betaprime\n",
"random.iterators.binomial": "\nrandom.iterators.binomial( n, p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n binomial distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n n: integer\n Number of trials.\n\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.binomial( 10, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.binomial\n",
"random.iterators.boxMuller": "\nrandom.iterators.boxMuller( [options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n standard normal distribution using the Box-Muller transform.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.boxMuller();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.boxMuller\n",
"random.iterators.cauchy": "\nrandom.iterators.cauchy( x0, Ɣ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Cauchy distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n x0: number\n Location parameter.\n\n Ɣ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.cauchy( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.cauchy\n",
"random.iterators.chi": "\nrandom.iterators.chi( k[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a chi\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.chi( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.chi\n",
"random.iterators.chisquare": "\nrandom.iterators.chisquare( k[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n chi-square distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n k: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.chisquare( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.chisquare\n",
"random.iterators.cosine": "\nrandom.iterators.cosine( μ, s[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a raised\n cosine distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n s: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.cosine( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.cosine\n",
"random.iterators.discreteUniform": "\nrandom.iterators.discreteUniform( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n discrete uniform distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: integer\n Minimum support.\n\n b: integer\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom integers. If provided, the `state` and `seed`\n options are ignored. In order to seed the returned iterator, one must\n seed the provided `prng` (assuming the provided `prng` is seedable). The\n provided PRNG must have `MIN` and `MAX` properties specifying the\n minimum and maximum possible pseudorandom integers.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.discreteUniform( 0, 3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.discreteUniform\n",
"random.iterators.erlang": "\nrandom.iterators.erlang( k, λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an Erlang\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n If `k` is not a positive integer or `λ <= 0`, the function throws an error.\n\n Parameters\n ----------\n k: integer\n Shape parameter.\n\n λ: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.erlang( 1, 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.erlang\n",
"random.iterators.exponential": "\nrandom.iterators.exponential( λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n exponential distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n λ: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.exponential( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.exponential\n",
"random.iterators.f": "\nrandom.iterators.f( d1, d2[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an F\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `d1 <= 0` or `d2 <= 0`.\n\n Parameters\n ----------\n d1: number\n Degrees of freedom.\n\n d2: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.f( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.f\n",
"random.iterators.frechet": "\nrandom.iterators.frechet( α, s, m[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Fréchet\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `s <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n s: number\n Scale parameter.\n\n m: number\n Location parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.frechet( 1.0, 1.0, 0.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.frechet\n",
"random.iterators.gamma": "\nrandom.iterators.gamma( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a gamma\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Rate parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.gamma( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.gamma\n",
"random.iterators.geometric": "\nrandom.iterators.geometric( p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n geometric distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.geometric( 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.geometric\n",
"random.iterators.gumbel": "\nrandom.iterators.gumbel( μ, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Gumbel\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.gumbel( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.gumbel\n",
"random.iterators.hypergeometric": "\nrandom.iterators.hypergeometric( N, K, n[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n hypergeometric distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n `N`, `K`, and `n` must all be nonnegative integers; otherwise, the function\n throws an error.\n\n If `n > N` or `K > N`, the function throws an error.\n\n Parameters\n ----------\n N: integer\n Population size.\n\n K: integer\n Subpopulation size.\n\n n: integer\n Number of draws.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.hypergeometric( 20, 10, 7 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.hypergeometric\n",
"random.iterators.improvedZiggurat": "\nrandom.iterators.improvedZiggurat( [options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n standard normal distribution using the Improved Ziggurat algorithm.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.improvedZiggurat();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.improvedZiggurat\n",
"random.iterators.invgamma": "\nrandom.iterators.invgamma( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from an\n inverse gamma distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.invgamma( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.invgamma\n",
"random.iterators.kumaraswamy": "\nrandom.iterators.kumaraswamy( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from\n Kumaraswamy's double bounded distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `a <= 0` or `b <= 0`.\n\n Parameters\n ----------\n a: number\n First shape parameter.\n\n b: number\n Second shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.kumaraswamy( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.kumaraswamy\n",
"random.iterators.laplace": "\nrandom.iterators.laplace( μ, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Laplace\n (double exponential) distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n b: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.laplace( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.laplace\n",
"random.iterators.levy": "\nrandom.iterators.levy( μ, c[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Lévy\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n c: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.levy( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.levy\n",
"random.iterators.logistic": "\nrandom.iterators.logistic( μ, s[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n logistic distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n s: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.logistic( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.logistic\n",
"random.iterators.lognormal": "\nrandom.iterators.lognormal( μ, σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n lognormal distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Location parameter.\n\n σ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.lognormal( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.lognormal\n",
"random.iterators.minstd": "\nrandom.iterators.minstd( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 2147483646]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) based on Park and Miller.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. More\n importantly, the \"randomness quality\" of the generator's output is lacking.\n These defects make the generator unsuitable, for example, in Monte Carlo\n simulations and in cryptographic applications.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer or, for arbitrary length seeds, an array-like\n object containing positive signed 32-bit integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Int32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Int32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.minstd();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.minstd, random.iterators.minstdShuffle, random.iterators.mt19937, random.iterators.randi, random.iterators.randu\n",
"random.iterators.minstdShuffle": "\nrandom.iterators.minstdShuffle( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 2147483646]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a linear congruential\n pseudorandom number generator (LCG) whose output is shuffled using the Bays-\n Durham algorithm. The shuffle step considerably strengthens the \"randomness\n quality\" of a simple LCG's output.\n\n The generator has a period of approximately `2.1e9`.\n\n An LCG is fast and uses little memory. On the other hand, because the\n generator is a simple LCG, the generator has recognized shortcomings. By\n today's PRNG standards, the generator's period is relatively short. In\n general, this generator is unsuitable for Monte Carlo simulations and\n cryptographic applications.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n signed 32-bit integer or, for arbitrary length seeds, an array-like\n object containing positive signed 32-bit integers.\n\n options.state: Int32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Int32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Int32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.minstdShuffle();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.minstdShuffle, random.iterators.minstd, random.iterators.mt19937, random.iterators.randi, random.iterators.randu\n",
"random.iterators.mt19937": "\nrandom.iterators.mt19937( [options] )\n Returns an iterator for generating pseudorandom integers on the interval\n `[1, 4294967295]`.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n This pseudorandom number generator (PRNG) is a 32-bit Mersenne Twister\n pseudorandom number generator.\n\n The PRNG is *not* a cryptographically secure PRNG.\n\n The PRNG has a period of 2^19937 - 1.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.normalized: boolean (optional)\n Boolean indicating whether to return pseudorandom numbers on the\n interval `[0,1)`.\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.seed: Uint32Array\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: Uint32Array\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.mt19937();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.mt19937, random.iterators.minstd, random.iterators.minstdShuffle, random.iterators.randi, random.iterators.randu\n",
"random.iterators.negativeBinomial": "\nrandom.iterators.negativeBinomial( r, p[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n negative binomial distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n r: number\n Number of successes until experiment is stopped.\n\n p: number\n Success probability.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.negativeBinomial( 10, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.negativeBinomial\n",
"random.iterators.normal": "\nrandom.iterators.normal( μ, σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a normal\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n μ: number\n Mean.\n\n σ: number\n Standard deviation.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.normal( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.normal\n",
"random.iterators.pareto1": "\nrandom.iterators.pareto1( α, β[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Pareto\n (Type I) distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `α <= 0` or `β <= 0`.\n\n Parameters\n ----------\n α: number\n Shape parameter.\n\n β: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.pareto1( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.pareto1\n",
"random.iterators.poisson": "\nrandom.iterators.poisson( λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a Poisson\n distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n λ: number\n Mean.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.poisson( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.poisson\n",
"random.iterators.randi": "\nrandom.iterators.randi( [options] )\n Create an iterator for generating pseudorandom numbers having integer\n values.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: `'mt19937'`.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: any\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randi();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randi\n",
"random.iterators.randn": "\nrandom.iterators.randn( [options] )\n Create an iterator for generating pseudorandom numbers drawn from a standard\n normal distribution.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - improved-ziggurat: improved ziggurat method.\n - box-muller: Box-Muller transform.\n\n Default: `'improved-ziggurat'`.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randn();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randn\n",
"random.iterators.randu": "\nrandom.iterators.randu( [options] )\n Create an iterator for generating uniformly distributed pseudorandom numbers\n between 0 and 1.\n\n The default underlying pseudorandom number generator (PRNG) *may* change in\n the future. If exact reproducibility is required, either explicitly specify\n a PRNG via the `name` option or use an underlying PRNG directly.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.name: string (optional)\n Name of a supported pseudorandom number generator (PRNG), which will\n serve as the underlying source of pseudorandom numbers. The following\n PRNGs are supported:\n\n - mt19937: 32-bit Mersenne Twister.\n - minstd: linear congruential PRNG based on Park and Miller.\n - minstd-shuffle: linear congruential PRNG whose output is shuffled.\n\n Default: `'mt19937'`.\n\n options.seed: any (optional)\n Pseudorandom number generator seed. Valid seed values vary according to\n the underlying PRNG.\n\n options.state: any (optional)\n Pseudorandom number generator state. Valid state values vary according\n to the underling PRNG. If provided, the `seed` option is ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned generator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: any\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer\n Length of generator seed.\n\n iterator.state: any\n Generator state.\n\n iterator.stateLength: integer\n Length of generator state.\n\n iterator.byteLength: integer\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.randu();\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.randu\n",
"random.iterators.rayleigh": "\nrandom.iterators.rayleigh( σ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Rayleigh distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n σ: number\n Scale parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.rayleigh( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.rayleigh\n",
"random.iterators.t": "\nrandom.iterators.t( v[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Student's t distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n v: number\n Degrees of freedom.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.t( 1.5 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.t\n",
"random.iterators.triangular": "\nrandom.iterators.triangular( a, b, c[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n triangular distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n c: number\n Mode.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.triangular( 0.0, 1.0, 0.3 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.triangular\n",
"random.iterators.uniform": "\nrandom.iterators.uniform( a, b[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n continuous uniform distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.uniform( 0.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.uniform\n",
"random.iterators.weibull": "\nrandom.iterators.weibull( k, λ[, options] )\n Returns an iterator for generating pseudorandom numbers drawn from a\n Weibull distribution.\n\n If an environment supports Symbol.iterator, the returned iterator is\n iterable.\n\n The function throws an error if `k <= 0` or `λ <= 0`.\n\n Parameters\n ----------\n k: number\n Scale parameter.\n\n λ: number\n Shape parameter.\n\n options: Object (optional)\n Options.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.iter: integer (optional)\n Number of iterations.\n\n Returns\n -------\n iterator: Object\n Iterator.\n\n iterator.next(): Function\n Returns an iterator protocol-compliant object containing the next\n iterated value (if one exists) and a boolean flag indicating whether the\n iterator is finished.\n\n iterator.return( [value] ): Function\n Finishes an iterator and returns a provided value.\n\n iterator.PRNG: Function\n Underlying pseudorandom number generator.\n\n iterator.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n iterator.seedLength: integer|null\n Length of generator seed.\n\n iterator.state: Uint32Array|null\n Generator state.\n\n iterator.stateLength: integer|null\n Length of generator state.\n\n iterator.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > var it = random.iterators.weibull( 1.0, 1.0 );\n > var r = it.next().value\n <number>\n > r = it.next().value\n <number>\n\n See Also\n --------\n base.random.weibull\n",
"random.streams.arcsine": "\nrandom.streams.arcsine( a, b[, options] )\n Returns a readable stream for generating pseudorandom numbers drawn from an\n arcsine distribution.\n\n In addition to standard readable stream events, the returned stream emits a\n 'state' event after internally generating `siter` pseudorandom numbers,\n which is useful when wanting to deterministically capture a stream's\n underlying PRNG state.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.sep: string (optional)\n Separator used to join streamed data. This option is only applicable\n when a stream is not in \"objectMode\". Default: '\\n'.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n stream: ReadableStream\n Readable stream.\n\n stream.PRNG: Function\n Underlying pseudorandom number generator.\n\n stream.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n stream.seedLength: integer|null\n Length of generator seed.\n\n stream.state: Uint32Array|null\n Generator state.\n\n stream.stateLength: integer|null\n Length of generator state.\n\n stream.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > function fcn( chunk ) { console.log( chunk.toString() ); };\n > var opts = { 'iter': 10 };\n > var s = random.streams.arcsine( 2.0, 5.0, opts );\n > var o = inspectStream( fcn );\n > s.pipe( o );\n\n\nrandom.streams.arcsine.factory( [a, b, ][options] )\n Returns a function for creating readable streams which generate pseudorandom\n numbers drawn from an arcsine distribution.\n\n If provided distribution parameters, the returned function returns readable\n streams which generate pseudorandom numbers drawn from the specified\n distribution.\n\n If not provided distribution parameters, the returned function requires that\n distribution parameters be provided at each invocation.\n\n Parameters\n ----------\n a: number (optional)\n Minimum support.\n\n b: number (optional)\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.sep: string (optional)\n Separator used to join streamed data. This option is only applicable\n when a stream is not in \"objectMode\". Default: '\\n'.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n fcn: Function\n Function for creating readable streams.\n\n Examples\n --------\n > var opts = { 'objectMode': true, 'highWaterMark': 64 };\n > var createStream = random.streams.arcsine.factory( opts );\n\n\nrandom.streams.arcsine.objectMode( a, b[, options] )\n Returns an \"objectMode\" readable stream for generating pseudorandom numbers\n drawn from an arcsine distribution.\n\n Parameters\n ----------\n a: number\n Minimum support.\n\n b: number\n Maximum support.\n\n options: Object (optional)\n Options.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to generate additional pseudorandom numbers.\n\n options.iter: integer (optional)\n Number of iterations.\n\n options.prng: Function (optional)\n Pseudorandom number generator (PRNG) for generating uniformly\n distributed pseudorandom numbers on the interval `[0,1)`. If provided,\n the `state` and `seed` options are ignored. In order to seed the\n returned iterator, one must seed the provided `prng` (assuming the\n provided `prng` is seedable).\n\n options.seed: integer|ArrayLikeObject<integer> (optional)\n Pseudorandom number generator seed. The seed may be either a positive\n unsigned 32-bit integer or, for arbitrary length seeds, an array-like\n object containing unsigned 32-bit integers.\n\n options.state: Uint32Array (optional)\n Pseudorandom number generator state. If provided, the `seed` option is\n ignored.\n\n options.copy: boolean (optional)\n Boolean indicating whether to copy a provided pseudorandom number\n generator state. Setting this option to `false` allows sharing state\n between two or more pseudorandom number generators. Setting this option\n to `true` ensures that a returned iterator has exclusive control over\n its internal state. Default: true.\n\n options.siter: integer (optional)\n Number of iterations after which to emit the PRNG state. Default: 1e308.\n\n Returns\n -------\n stream: ReadableStream\n Readable stream operating in \"objectMode\".\n\n stream.PRNG: Function\n Underlying pseudorandom number generator.\n\n stream.seed: Uint32Array|null\n Pseudorandom number generator seed.\n\n stream.seedLength: integer|null\n Length of generator seed.\n\n stream.state: Uint32Array|null\n Generator state.\n\n stream.stateLength: integer|null\n Length of generator state.\n\n stream.byteLength: integer|null\n Size (in bytes) of generator state.\n\n Examples\n --------\n > function fcn( v ) { console.log( v ); };\n > var opts = { 'iter': 10 };\n > var s = random.streams.arcsine.objectMode( 2.0, 5.0, opts );\n > var o = inspectStream.objectMode( fcn );\n > s.pipe( o );\n\n See Also\n --------\n random.iterators.arcsine\n",
"ranks": "\nranks( arr[, options] )\n Computes the sample ranks for the values of an array-like object.\n\n When all elements of the `array` are different, the ranks are uniquely\n determined. When there are equal elements (called *ties*), the `method`\n option determines how they are handled. The default, `'average'`, replaces\n the ranks of the ties by their mean. Other possible options are `'min'` and\n `'max'`, which replace the ranks of the ties by their minimum and maximum,\n respectively. `'dense'` works like `'min'`, with the difference that the\n next highest element after a tie is assigned the next smallest integer.\n Finally, `ordinal` gives each element in `arr` a distinct rank, according to\n the position they appear in.\n\n The `missing` option is used to specify how to handle missing data.\n By default, `NaN` or `null` are treated as missing values. `'last'`specifies\n that missing values are placed last, `'first'` that the are assigned the\n lowest ranks and `'remove'` means that they are removed from the array\n before the ranks are calculated.\n\n Parameters\n ----------\n arr: Array<number>\n Input values.\n\n options: Object (optional)\n Function options.\n\n options.method (optional)\n Method name determining how ties are treated (`average`, `min`, `max`,\n `dense`, or `ordinal`). Default: `'average'`.\n\n options.missing (optional)\n Determines where missing values go (`first`, `last`, or `remove`).\n Default: `'last'`.\n\n options.encoding (optional)\n Array of values encoding missing values. Default: `[ null, NaN ]`.\n\n Returns\n -------\n out: Array\n Array containing the computed ranks for the elements of the input array.\n\n Examples\n --------\n > var arr = [ 1.1, 2.0, 3.5, 0.0, 2.4 ] ;\n > var out = ranks( arr )\n [ 2, 3, 5, 1, 4 ]\n\n // Ties are averaged:\n > arr = [ 2, 2, 1, 4, 3 ];\n > out = ranks( arr )\n [ 2.5, 2.5, 1, 5, 4 ]\n\n // Missing values are placed last:\n > arr = [ null, 2, 2, 1, 4, 3, NaN, NaN ];\n > out = ranks( arr )\n [ 6, 2.5, 2.5, 1, 5, 4, 7 ,8 ]\n\n",
"RE_BASENAME": "\nRE_BASENAME\n Regular expression to capture the last part of a path.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_BASENAME.posix\n Regular expression to capture the last part of a POSIX path.\n\n Examples\n --------\n > var base = RE_BASENAME.exec( '/foo/bar/index.js' )[ 1 ]\n 'index.js'\n\n\nRE_BASENAME.win32\n Regular expression to capture the last part of a Windows path.\n\n Examples\n --------\n > var base = RE_BASENAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'index.js'\n\n See Also\n --------\n RE_BASENAME_POSIX, RE_BASENAME_WINDOWS\n",
"RE_BASENAME_POSIX": "\nRE_BASENAME_POSIX\n Regular expression to capture the last part of a POSIX path.\n\n Examples\n --------\n > var base = RE_BASENAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n '.gitignore'\n > base = RE_BASENAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n 'file.pdf'\n > base = RE_BASENAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n 'file'\n > base = RE_BASENAME_POSIX.exec( 'index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_POSIX.exec( '.' )[ 1 ]\n '.'\n > base = RE_BASENAME_POSIX.exec( './' )[ 1 ]\n '.'\n > base = RE_BASENAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_BASENAME, RE_BASENAME_WINDOWS\n",
"RE_BASENAME_WINDOWS": "\nRE_BASENAME_WINDOWS\n Regular expression to capture the last part of a Windows path.\n\n Examples\n --------\n > var base = RE_BASENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n '.gitignore'\n > base = RE_BASENAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n 'file.pdf'\n > base = RE_BASENAME_WINDOWS.exec( 'foo\\\\bar\\\\file' )[ 1 ]\n 'file'\n > base = RE_BASENAME_WINDOWS.exec( 'index.js' )[ 1 ]\n 'index.js'\n > base = RE_BASENAME_WINDOWS.exec( '.' )[ 1 ]\n '.'\n > base = RE_BASENAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_BASENAME, RE_BASENAME_POSIX\n",
"RE_COLOR_HEXADECIMAL": "\nRE_COLOR_HEXADECIMAL\n Regular expression to match a hexadecimal color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.test( 'ffffff' )\n true\n > bool = RE_COLOR_HEXADECIMAL.test( '000' )\n false\n > bool = RE_COLOR_HEXADECIMAL.test( 'beep' )\n false\n\n\nRE_COLOR_HEXADECIMAL.shorthand\n Regular expression to match a shorthand hexadecimal color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.shorthand.test( 'ffffff' )\n false\n > bool = RE_COLOR_HEXADECIMAL.shorthand.test( '000' )\n true\n > bool = RE_COLOR_HEXADECIMAL.shorthand.test( 'beep' )\n false\n\n\nRE_COLOR_HEXADECIMAL.either\n Regular expression to match either a shorthand or full length hexadecimal\n color.\n\n Examples\n --------\n > var bool = RE_COLOR_HEXADECIMAL.either.test( 'ffffff' )\n true\n > bool = RE_COLOR_HEXADECIMAL.either.test( '000' )\n true\n > bool = RE_COLOR_HEXADECIMAL.either.test( 'beep' )\n false\n\n",
"RE_DECIMAL_NUMBER": "\nRE_DECIMAL_NUMBER\n Regular expression to capture a decimal number.\n\n A leading digit is not required.\n\n A decimal point and at least one trailing digit is required.\n\n Examples\n --------\n > var bool = RE_DECIMAL_NUMBER.test( '1.234' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '-1.234' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '0.0' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '.0' )\n true\n > bool = RE_DECIMAL_NUMBER.test( '0' )\n false\n > bool = RE_DECIMAL_NUMBER.test( 'beep' )\n false\n\n // Create a RegExp to capture all decimal numbers:\n > var re = new RegExp( RE_DECIMAL_NUMBER.source, 'g' );\n > var str = '1.234 5.6, 7.8';\n > var out = str.match( re )\n [ '1.234', '5.6', '7.8' ]\n\n\n",
"RE_DIRNAME": "\nRE_DIRNAME\n Regular expression to capture a path dirname.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_DIRNAME.posix\n Regular expression to capture a POSIX path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME.exec( '/foo/bar/index.js' )[ 1 ]\n '/foo/bar'\n\n\nRE_DIRNAME.win32\n Regular expression to capture a Windows path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n 'C:\\\\foo\\\\bar'\n\n See Also\n --------\n RE_DIRNAME_POSIX, RE_DIRNAME_WINDOWS, dirname\n",
"RE_DIRNAME_POSIX": "\nRE_DIRNAME_POSIX\n Regular expression to capture a POSIX path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n '/foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n './foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n 'foo'\n > dir = RE_DIRNAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n '/foo/bar'\n > dir = RE_DIRNAME_POSIX.exec( 'index.js' )[ 1 ]\n ''\n > dir = RE_DIRNAME_POSIX.exec( '.' )[ 1 ]\n '.'\n > dir = RE_DIRNAME_POSIX.exec( './' )[ 1 ]\n '.'\n > dir = RE_DIRNAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_DIRNAME, RE_DIRNAME_WINDOWS, dirname\n",
"RE_DIRNAME_WINDOWS": "\nRE_DIRNAME_WINDOWS\n Regular expression to capture a Windows path dirname.\n\n Examples\n --------\n > var dir = RE_DIRNAME_WINDOWS.exec( 'foo\\\\bar\\\\index.js' )[ 1 ]\n 'foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n 'C:\\\\foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n 'foo'\n > dir = RE_DIRNAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' )[ 1 ]\n '\\\\foo\\\\bar'\n > dir = RE_DIRNAME_WINDOWS.exec( 'index.js' )[ 1 ]\n ''\n > dir = RE_DIRNAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_DIRNAME, RE_DIRNAME_POSIX, dirname\n",
"RE_EOL": "\nRE_EOL\n Regular expression to match a newline character sequence: /\\r?\\n/.\n\n Examples\n --------\n > var bool = RE_EOL.test( '\\n' )\n true\n > bool = RE_EOL.test( '\\r\\n' )\n true\n > bool = RE_EOL.test( '\\\\r\\\\n' )\n false\n\n",
"RE_EXTENDED_LENGTH_PATH": "\nRE_EXTENDED_LENGTH_PATH\n Regular expression to test if a string is an extended-length path.\n\n Extended-length paths are Windows paths which begin with `\\\\?\\`.\n\n Examples\n --------\n > var path = '\\\\\\\\?\\\\C:\\\\foo\\\\bar';\n > var bool = RE_EXTENDED_LENGTH_PATH.test( path )\n true\n > path = '\\\\\\\\?\\\\UNC\\\\server\\\\share';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n true\n > path = 'C:\\\\foo\\\\bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n > path = '/c/foo/bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n > path = '/foo/bar';\n > bool = RE_EXTENDED_LENGTH_PATH.test( path )\n false\n\n",
"RE_EXTNAME": "\nRE_EXTNAME\n Regular expression to capture a filename extension.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_EXTNAME.posix\n Regular expression to capture a POSIX filename extension.\n\n Examples\n --------\n > var dir = RE_EXTNAME.exec( '/foo/bar/index.js' )[ 1 ]\n '.js'\n\n\nRE_EXTNAME.win32\n Regular expression to capture a Windows filename extension.\n\n Examples\n --------\n > var dir = RE_EXTNAME.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n '.js'\n\n See Also\n --------\n RE_EXTNAME_POSIX, RE_EXTNAME_WINDOWS, extname\n",
"RE_EXTNAME_POSIX": "\nRE_EXTNAME_POSIX\n Regular expression to capture a POSIX filename extension.\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var ext = RE_EXTNAME_POSIX.exec( '/foo/bar/index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_POSIX.exec( './foo/bar/.gitignore' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( 'foo/file.pdf' )[ 1 ]\n '.pdf'\n > ext = RE_EXTNAME_POSIX.exec( '/foo/bar/file' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( 'index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_POSIX.exec( '.' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( './' )[ 1 ]\n ''\n > ext = RE_EXTNAME_POSIX.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_EXTNAME, RE_EXTNAME_WINDOWS, extname\n",
"RE_EXTNAME_WINDOWS": "\nRE_EXTNAME_WINDOWS\n Regular expression to capture a Windows filename extension.\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var ext = RE_EXTNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\.gitignore' )[ 1 ]\n ''\n > ext = RE_EXTNAME_WINDOWS.exec( 'foo\\\\file.pdf' )[ 1 ]\n '.pdf'\n > ext = RE_EXTNAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' )[ 1 ]\n ''\n > ext = RE_EXTNAME_WINDOWS.exec( 'beep\\\\boop.' )[ 1 ]\n '.'\n > ext = RE_EXTNAME_WINDOWS.exec( 'index.js' )[ 1 ]\n '.js'\n > ext = RE_EXTNAME_WINDOWS.exec( '' )[ 1 ]\n ''\n\n See Also\n --------\n RE_EXTNAME, RE_EXTNAME_POSIX, extname\n",
"RE_FILENAME": "\nRE_FILENAME\n Regular expression to split a filename.\n\n The regular expression is platform-dependent. If the current process is\n running on Windows, the regular expression is `*.win32`; otherwise,\n `*.posix`.\n\n\nRE_FILENAME.posix\n Regular expression to split a POSIX filename.\n\n When executed, the regular expression splits a POSIX filename into the\n following parts:\n\n - input value\n - root\n - dirname\n - basename\n - extname\n\n Examples\n --------\n > var f = '/foo/bar/index.js';\n > var parts = RE_FILENAME.exec( f ).slice()\n [ '/foo/bar/index.js', '/', 'foo/bar/', 'index.js', '.js' ]\n\n\nRE_FILENAME.win32\n Regular expression to split a Windows filename.\n\n When executed, the regular expression splits a Windows filename into the\n following parts:\n\n - input value\n - device\n - slash\n - dirname\n - basename\n - extname\n\n Examples\n --------\n > var f = 'C:\\\\foo\\\\bar\\\\index.js';\n > var parts = RE_FILENAME.exec( f ).slice()\n [ 'C:\\\\foo\\\\bar\\\\index.js', 'C:', '\\\\', 'foo\\\\bar\\\\', 'index.js', '.js' ]\n\n See Also\n --------\n RE_FILENAME_POSIX, RE_FILENAME_WINDOWS\n",
"RE_FILENAME_POSIX": "\nRE_FILENAME_POSIX\n Regular expression to split a POSIX filename.\n\n When executed, the regular expression splits a POSIX filename into the\n following parts:\n\n - input value\n - root\n - dirname\n - basename\n - extname\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var parts = RE_FILENAME_POSIX.exec( '/foo/bar/index.js' ).slice()\n [ '/foo/bar/index.js', '/', 'foo/bar/', 'index.js', '.js' ]\n > parts = RE_FILENAME_POSIX.exec( './foo/bar/.gitignore' ).slice()\n [ './foo/bar/.gitignore', '', './foo/bar/', '.gitignore', '' ]\n > parts = RE_FILENAME_POSIX.exec( 'foo/file.pdf' ).slice()\n [ 'foo/file.pdf', '', 'foo/', 'file.pdf', '.pdf' ]\n > parts = RE_FILENAME_POSIX.exec( '/foo/bar/file' ).slice()\n [ '/foo/bar/file', '/', 'foo/bar/', 'file', '' ]\n > parts = RE_FILENAME_POSIX.exec( 'index.js' ).slice()\n [ 'index.js', '', '', 'index.js', '.js' ]\n > parts = RE_FILENAME_POSIX.exec( '.' ).slice()\n [ '.', '', '', '.', '' ]\n > parts = RE_FILENAME_POSIX.exec( './' ).slice()\n [ './', '', '.', '.', '' ]\n > parts = RE_FILENAME_POSIX.exec( '' ).slice()\n [ '', '', '', '', '' ]\n\n See Also\n --------\n RE_FILENAME, RE_FILENAME_WINDOWS\n",
"RE_FILENAME_WINDOWS": "\nRE_FILENAME_WINDOWS\n Regular expression to split a Windows filename.\n\n When executed, the regular expression splits a Windows filename into the\n following parts:\n\n - input value\n - device\n - slash\n - dirname\n - basename\n - extname\n\n When executed against dotfile filenames (e.g., `.gitignore`), the regular\n expression does not capture the basename as a filename extension.\n\n Examples\n --------\n > var parts = RE_FILENAME_WINDOWS.exec( 'C:\\\\foo\\\\bar\\\\index.js' ).slice()\n [ 'C:\\\\foo\\\\bar\\\\index.js', 'C:', '\\\\', 'foo\\\\bar\\\\', 'index.js', '.js' ]\n > parts = RE_FILENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\.gitignore' ).slice()\n [ '\\\\foo\\\\bar\\\\.gitignore', '', '\\\\', 'foo\\\\bar\\\\', '.gitignore', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( 'foo\\\\file.pdf' ).slice()\n [ 'foo\\\\file.pdf', '', '', 'foo\\\\', 'file.pdf', '.pdf' ]\n > parts = RE_FILENAME_WINDOWS.exec( '\\\\foo\\\\bar\\\\file' ).slice()\n [ '\\\\foo\\\\bar\\\\file', '', '\\\\', 'foo\\\\bar\\\\', 'file', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( 'index.js' ).slice()\n [ 'index.js', '', '', '', 'index.js', '.js' ]\n > parts = RE_FILENAME_WINDOWS.exec( '.' ).slice()\n [ '.', '', '', '', '.', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( './' ).slice()\n [ './', '', '', '.', '.', '' ]\n > parts = RE_FILENAME_WINDOWS.exec( '' ).slice()\n [ '', '', '', '', '', '' ]\n\n See Also\n --------\n RE_FILENAME, RE_FILENAME_POSIX\n",
"RE_FUNCTION_NAME": "\nRE_FUNCTION_NAME\n Regular expression to capture a function name.\n\n Examples\n --------\n > function beep() { return 'boop'; };\n > var name = RE_FUNCTION_NAME.exec( beep.toString() )[ 1 ]\n 'beep'\n > name = RE_FUNCTION_NAME.exec( function () {} )[ 1 ]\n ''\n\n See Also\n --------\n functionName\n",
"RE_NATIVE_FUNCTION": "\nRE_NATIVE_FUNCTION\n Regular expression to match a native function.\n\n Examples\n --------\n > var bool = RE_NATIVE_FUNCTION.test( Date.toString() )\n true\n > bool = RE_NATIVE_FUNCTION.test( (function noop() {}).toString() )\n false\n\n See Also\n --------\n RE_FUNCTION_NAME, functionName\n",
"RE_REGEXP": "\nRE_REGEXP\n Regular expression to parse a regular expression string.\n\n Regular expression strings should be escaped.\n\n Examples\n --------\n > var bool = RE_REGEXP.test( '/^beep$/' )\n true\n > bool = RE_REGEXP.test( '/boop' )\n false\n\n // Escape regular expression strings:\n > bool = RE_REGEXP.test( '/^\\/([^\\/]+)\\/(.*)$/' )\n false\n > bool = RE_REGEXP.test( '/^\\\\/([^\\\\/]+)\\\\/(.*)$/' )\n true\n\n See Also\n --------\n reFromString\n",
"RE_UNC_PATH": "\nRE_UNC_PATH\n Regular expression to parse a UNC path.\n\n Examples\n --------\n > var path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:b';\n > var bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz::b';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share\\\\foo';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n true\n > path = '\\\\\\\\server\\\\\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\\\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = 'beep boop \\\\\\\\server\\\\share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz::';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\baz:a:b:c';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '\\\\\\\\server\\\\share\\\\foo\\\\bar\\\\';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '//server/share';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '/foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = 'foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = './foo/bar';\n > bool = RE_UNC_PATH.test( path )\n false\n > path = '/foo/../bar';\n > bool = RE_UNC_PATH.test( path )\n false\n\n See Also\n --------\n isUNCPath\n",
"RE_UTF16_SURROGATE_PAIR": "\nRE_UTF16_SURROGATE_PAIR\n Regular expression to match a UTF-16 surrogate pair.\n\n Examples\n --------\n > var bool = RE_UTF16_SURROGATE_PAIR.test( 'abc\\uD800\\uDC00def' )\n true\n > bool = RE_UTF16_SURROGATE_PAIR.test( 'abcdef' )\n false\n\n See Also\n --------\n RE_UTF16_UNPAIRED_SURROGATE\n",
"RE_UTF16_UNPAIRED_SURROGATE": "\nRE_UTF16_UNPAIRED_SURROGATE\n Regular expression to match an unpaired UTF-16 surrogate.\n\n Examples\n --------\n > var bool = RE_UTF16_UNPAIRED_SURROGATE.test( 'abc' )\n false\n > bool = RE_UTF16_UNPAIRED_SURROGATE.test( '\\uD800' )\n true\n\n See Also\n --------\n RE_UTF16_SURROGATE_PAIR\n",
"RE_WHITESPACE": "\nRE_WHITESPACE\n Regular expression to match a white space character.\n\n Matches the 25 characters defined as white space (\"WSpace=Y\",\"WS\")\n characters in the Unicode 9.0 character database.\n\n Matches one related white space character without the Unicode character\n property \"WSpace=Y\" (zero width non-breaking space which was deprecated as\n of Unicode 3.2).\n\n Examples\n --------\n > var bool = RE_WHITESPACE.test( '\\n' )\n true\n > bool = RE_WHITESPACE.test( ' ' )\n true\n > bool = RE_WHITESPACE.test( 'a' )\n false\n\n See Also\n --------\n isWhitespace\n",
"readDir": "\nreadDir( path, clbk )\n Asynchronously reads the contents of a directory.\n\n Parameters\n ----------\n path: string|Buffer\n Directory path.\n\n clbk: Function\n Callback to invoke after reading directory contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readDir( './beep/boop', onRead );\n\n\nreadDir.sync( path )\n Synchronously reads the contents of a directory.\n\n Parameters\n ----------\n path: string|Buffer\n Directory path.\n\n Returns\n -------\n out: Error|Array|Array<string>\n Directory contents.\n\n Examples\n --------\n > var out = readDir.sync( './beep/boop' );\n\n See Also\n --------\n exists, readFile\n",
"readFile": "\nreadFile( file[, options,] clbk )\n Asynchronously reads the entire contents of a file.\n\n If provided an encoding, the function returns a string. Otherwise, the\n function returns a Buffer object.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readFile( './beep/boop.js', onRead );\n\n\nreadFile.sync( file[, options] )\n Synchronously reads the entire contents of a file.\n\n If provided an encoding, the function returns a string. Otherwise, the\n function returns a Buffer object.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Buffer|string\n File contents.\n\n Examples\n --------\n > var out = readFile.sync( './beep/boop.js' );\n\n See Also\n --------\n exists, readDir, readJSON, writeFile\n",
"readFileList": "\nreadFileList( filepaths[, options,] clbk )\n Asynchronously reads the entire contents of each file in a file list.\n\n If a provided an encoding, the function returns file contents as strings.\n Otherwise, the function returns Buffer objects.\n\n Each file is represented by an object with the following fields:\n\n - file: file path\n - data: file contents as either a Buffer or string\n\n Parameters\n ----------\n filepaths: Array<string>\n Filepaths.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > var filepaths = [ './beep/boop.txt', './foo/bar.txt' ];\n > readFileList( filepaths, onRead );\n\n\nreadFileList.sync( filepaths[, options] )\n Synchronously reads the entire contents of each file in a file list.\n\n If a provided an encoding, the function returns file contents as strings.\n Otherwise, the function returns Buffer objects.\n\n Parameters\n ----------\n filepaths: Array<string>\n Filepaths.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Array|Array<string>\n File contents.\n\n out[ i ].file: string\n File path.\n\n out[ i ].data: Buffer|string\n File contents.\n\n Examples\n --------\n > var filepaths = [ './beep/boop.txt', './foo/bar.txt' ];\n > var out = readFileList.sync( filepaths );\n\n",
"readJSON": "\nreadJSON( file[, options,] clbk )\n Asynchronously reads a file as JSON.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. If the encoding option is set to `utf8` and the file has a\n UTF-8 byte order mark (BOM), the byte order mark is *removed* before\n attempting to parse as JSON. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n options.reviver: Function (optional)\n JSON transformation function.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readJSON( './beep/boop.json', onRead );\n\n\nreadJSON.sync( file[, options] )\n Synchronously reads a file as JSON.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. If the encoding option is set to `utf8` and the file has a\n UTF-8 byte order mark (BOM), the byte order mark is *removed* before\n attempting to parse as JSON. Default: null.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n options.reviver: Function (optional)\n JSON transformation function.\n\n Returns\n -------\n out: Error|JSON\n File contents.\n\n Examples\n --------\n > var out = readJSON.sync( './beep/boop.json' );\n\n See Also\n --------\n readFile\n",
"readWASM": "\nreadWASM( file, [options,] clbk )\n Asynchronously reads a file as WebAssembly.\n\n The function returns file contents as a Uint8Array.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object (optional)\n Options.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n clbk: Function\n Callback to invoke upon reading file contents.\n\n Examples\n --------\n > function onRead( error, data ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( data );\n ... }\n ... };\n > readWASM( './beep/boop.wasm', onRead );\n\n\nreadWASM.sync( file[, options] )\n Synchronously reads a file as WebAssembly.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n options: Object (optional)\n Options.\n\n options.flag: string (optional)\n Flag. Default: 'r'.\n\n Returns\n -------\n out: Error|Uint8Array\n File contents.\n\n Examples\n --------\n > var out = readWASM.sync( './beep/boop.wasm' );\n\n See Also\n --------\n readFile\n",
"real": "\nreal( z )\n Returns the real component of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n re: number\n Real component.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var re = real( z )\n 5.0\n\n See Also\n --------\n imag, reim\n",
"realmax": "\nrealmax( dtype )\n Returns the maximum finite value capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum finite value.\n\n Examples\n --------\n > var m = realmax( 'float16' )\n 65504.0\n > m = realmax( 'float32' )\n 3.4028234663852886e+38\n\n See Also\n --------\n realmin, typemax\n",
"realmin": "\nrealmin( dtype )\n Returns the smallest positive normal value capable of being represented by a\n numeric real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Smallest finite normal value.\n\n Examples\n --------\n > var m = realmin( 'float16' )\n 0.00006103515625\n > m = realmin( 'float32' )\n 1.1754943508222875e-38\n\n See Also\n --------\n realmax, typemin\n",
"reduce": "\nreduce( collection, initial, reducer[, thisArg] )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result.\n\n When invoked, the reduction function is provided four arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, the function returns the initial value.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n reducer: Function\n Function to invoke for each element in the input collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: any\n Accumulated result.\n\n Examples\n --------\n > function sum( acc, v ) { return acc + v; };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = reduce( arr, 0, sum )\n 6.0\n\n See Also\n --------\n forEach, reduceAsync, reduceRight\n",
"reduceAsync": "\nreduceAsync( collection, initial, [options,] reducer, done )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result.\n\n When invoked, `reducer` is provided a maximum of five arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If\n `reducer` accepts three arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `next`\n\n If `reducer` accepts four arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `index`\n - `next`\n\n For every other `reducer` signature, `reducer` is provided all five\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `accumulator`: accumulated value\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n If provided an empty collection, the function invokes the `done` callback\n with the `initial` value as the second argument.\n\n The function does not skip `undefined` elements.\n\n When processing collection elements concurrently, *beware* of race\n conditions when updating an accumulator. This is especially true when an\n accumulator is a primitive (e.g., a number). In general, prefer object\n accumulators.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n reducer: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, fcn, done )\n 3000\n 2500\n 1000\n 6500\n\n // Limit number of concurrent invocations:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, opts, fcn, done )\n 2500\n 3000\n 1000\n 6500\n\n // Process concurrently:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'series': false };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > reduceAsync( arr, acc, opts, fcn, done )\n 1000\n 2500\n 3000\n 6500\n\n\nreduceAsync.factory( [options,] fcn )\n Returns a function which applies a function against an accumulator and each\n element in a collection and returns the accumulated result.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > var opts = { 'series': false };\n > var f = reduceAsync.factory( opts, fcn );\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > var acc = { 'sum': 0 };\n > f( arr, acc, done )\n 1000\n 2500\n 3000\n 6500\n > acc = { 'sum': 0 };\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, acc, done )\n 1000\n 1500\n 2000\n 4500\n\n See Also\n --------\n forEachAsync, reduce, reduceRightAsync\n",
"reduceRight": "\nreduceRight( collection, initial, reducer[, thisArg] )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result, iterating from right to left.\n\n When invoked, the reduction function is provided four arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n If provided an empty collection, the function returns the initial value.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection. If provided an object, the object must be array-like\n (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n reducer: Function\n Function to invoke for each element in the input collection.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n out: any\n Accumulated result.\n\n Examples\n --------\n > function sum( acc, v ) {\n ... console.log( '%s: %d', acc, v );\n ... return acc + v;\n ... };\n > var arr = [ 1.0, 2.0, 3.0 ];\n > var out = reduceRight( arr, 0, sum );\n 2: 3.0\n 1: 2.0\n 0: 1.0\n > out\n 6.0\n\n See Also\n --------\n forEachRight, reduce, reduceRightAsync\n",
"reduceRightAsync": "\nreduceRightAsync( collection, initial, [options,] reducer, done )\n Applies a function against an accumulator and each element in a collection\n and returns the accumulated result, iterating from right to left.\n\n When invoked, `reducer` is provided a maximum of five arguments:\n\n - `accumulator`: accumulated value\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If\n `reducer` accepts three arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `next`\n\n If `reducer` accepts four arguments, `reducer` is provided:\n\n - `accumulator`\n - `value`\n - `index`\n - `next`\n\n For every other `reducer` signature, `reducer` is provided all five\n arguments.\n\n The `next` callback accepts two arguments:\n\n - `error`: error argument\n - `accumulator`: accumulated value\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n If provided an empty collection, the function invokes the `done` callback\n with the `initial` value as the second argument.\n\n The function does not skip `undefined` elements.\n\n When processing collection elements concurrently, *beware* of race\n conditions when updating an accumulator. This is especially true when an\n accumulator is a primitive (e.g., a number). In general, prefer object\n accumulators.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n initial: any\n Accumulator value used in the first invocation of the reduction\n function.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n reducer: Function\n The function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, fcn, done )\n 3000\n 2500\n 1000\n 6500\n\n // Limit number of concurrent invocations:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, opts, fcn, done )\n 2500\n 3000\n 1000\n 6500\n\n // Process concurrently:\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var opts = { 'series': false };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > reduceRightAsync( arr, acc, opts, fcn, done )\n 1000\n 2500\n 3000\n 6500\n\n\nreduceRightAsync.factory( [options,] fcn )\n Returns a function which applies a function against an accumulator and each\n element in a collection and returns the accumulated result, iterating from\n right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: true.\n\n options.thisArg: any (optional)\n Execution context.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which invokes a function for each element in a collection.\n\n Examples\n --------\n > function fcn( acc, value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... acc.sum += value;\n ... next( null, acc );\n ... }\n ... };\n > var opts = { 'series': false };\n > var f = reduceRightAsync.factory( opts, fcn );\n > function done( error, acc ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( acc.sum );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > var acc = { 'sum': 0 };\n > f( arr, acc, done )\n 1000\n 2500\n 3000\n 6500\n > acc = { 'sum': 0 };\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, acc, done )\n 1000\n 1500\n 2000\n 4500\n\n See Also\n --------\n forEachRightAsync, reduceAsync, reduceRight\n",
"reFromString": "\nreFromString( str )\n Parses a regular expression string and returns a new regular expression.\n\n Provided strings should be properly escaped.\n\n If unable to parse a string as a regular expression, the function returns\n `null`.\n\n Parameters\n ----------\n str: string\n Regular expression string.\n\n Returns\n -------\n out: RegExp|null\n Regular expression or null.\n\n Examples\n --------\n > var re = reFromString( '/beep/' )\n /beep/\n > re = reFromString( '/beep' )\n null\n\n",
"reim": "\nreim( z )\n Returns the real and imaginary components of a complex number.\n\n Parameters\n ----------\n z: Complex\n Complex number.\n\n Returns\n -------\n out: Float64Array|Float32Array\n Array containing the real and imaginary components, respectively.\n\n Examples\n --------\n > var z = new Complex128( 5.0, 3.0 );\n > var out = reim( z )\n <Float64Array>[ 5.0, 3.0 ]\n\n See Also\n --------\n imag, real\n",
"removeFirst": "\nremoveFirst( str )\n Removes the first character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Updated string.\n\n Examples\n --------\n > var out = removeFirst( 'beep' )\n 'eep'\n > out = removeFirst( 'Boop' )\n 'oop'\n\n See Also\n --------\n removeLast\n",
"removeLast": "\nremoveLast( str )\n Removes the last character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Updated string.\n\n Examples\n --------\n > var out = removeLast( 'beep' )\n 'bee'\n > out = removeLast( 'Boop' )\n 'Boo'\n\n See Also\n --------\n removeFirst\n",
"removePunctuation": "\nremovePunctuation( str )\n Removes punctuation characters from a `string`.\n\n The function removes the following characters:\n\n - Apostrophe: `\n - Braces : { }\n - Brackets: [ ]\n - Colon: :\n - Comma: ,\n - Exclamation Mark: !\n - Fraction Slash: /\n - Guillemets: < >\n - Parentheses: ( )\n - Period: .\n - Semicolon: ;\n - Tilde: ~\n - Vertical Bar: |\n - Question Mark: ?\n - Quotation Marks: ' \"\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with punctuation characters removed.\n\n Examples\n --------\n > var str = 'Sun Tzu said: \"A leader leads by example not by force.\"';\n > var out = removePunctuation( str )\n 'Sun Tzu said A leader leads by example not by force'\n\n > str = 'This function removes these characters: `{}[]:,!/<>().;~|?\\'\"';\n > out = removePunctuation( str )\n 'This function removes these characters '\n\n",
"removeUTF8BOM": "\nremoveUTF8BOM( str )\n Removes a UTF-8 byte order mark (BOM) from the beginning of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String with BOM removed.\n\n Examples\n --------\n > var out = removeUTF8BOM( '\\ufeffbeep' )\n 'beep'\n\n",
"removeWords": "\nremoveWords( str, words[, ignoreCase] )\n Removes all occurrences of the given words from a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n words: Array<string>\n Array of words to be removed.\n\n ignoreCase: boolean (optional)\n Boolean indicating whether to perform a case-insensitive operation.\n Default: `false`.\n\n Returns\n -------\n out: string\n String with words removed.\n\n Examples\n --------\n > var out = removeWords( 'beep boop Foo bar', [ 'boop', 'foo' ] )\n 'beep Foo bar'\n\n // Case-insensitive:\n > out = removeWords( 'beep boop Foo bar', [ 'boop', 'foo' ], true )\n 'beep bar'\n\n",
"rename": "\nrename( oldPath, newPath, clbk )\n Asynchronously renames a file.\n\n The old path can specify a directory. In this case, the new path must either\n not exist, or it must specify an empty directory.\n\n The old pathname should not name an ancestor directory of the new pathname.\n\n If the old path points to the pathname of a file that is not a directory,\n the new path should not point to the pathname of a directory.\n\n Write access permission is required for both the directory containing the\n old path and the directory containing the new path.\n\n If the link named by the new path exists, the new path is removed and the\n old path is renamed to the new path. The link named by the new path will\n remain visible to other threads throughout the renaming operation and refer\n to either the file referred to by the new path or to the file referred to by\n the old path before the operation began.\n\n If the old path and the new path resolve to either the same existing\n directory entry or to different directory entries for the same existing\n file, no action is taken, and no error is returned.\n\n If the old path points to a pathname of a symbolic link, the symbolic link\n is renamed. If the new path points to a pathname of a symbolic link, the\n symbolic link is removed.\n\n If a link named by the new path exists and the file's link count becomes 0\n when it is removed and no process has the file open, the space occupied by\n the file is freed and the file is no longer accessible. If one or more\n processes have the file open when the last link is removed, the link is\n removed before the function returns, but the removal of file contents is\n postponed until all references to the file are closed.\n\n Parameters\n ----------\n oldPath: string|Buffer\n Old path.\n\n newPath: string|Buffer\n New path.\n\n clbk: Function\n Callback to invoke upon renaming a file.\n\n Examples\n --------\n > function done( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > rename( './beep/boop.txt', './beep/foo.txt', done );\n\n\nrename.sync( oldPath, newPath )\n Synchronously renames a file.\n\n Parameters\n ----------\n oldPath: string|Buffer\n Old path.\n\n newPath: string|Buffer\n New path.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = rename.sync( './beep/boop.txt', './beep/foo.txt' );\n\n See Also\n --------\n exists, readFile, writeFile, unlink\n",
"reorderArguments": "\nreorderArguments( fcn, indices[, thisArg] )\n Returns a function that invokes a provided function with reordered\n arguments.\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n indices: Array<integer>\n Argument indices.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Function with reordered arguments.\n\n Examples\n --------\n > function foo( a, b, c ) { return [ a, b, c ]; };\n > var bar = reorderArguments( foo, [ 2, 0, 1 ] );\n > var out = bar( 1, 2, 3 )\n [ 3, 1, 2 ]\n\n See Also\n --------\n reverseArguments\n",
"repeat": "\nrepeat( str, n )\n Repeats a string `n` times and returns the concatenated result.\n\n Parameters\n ----------\n str: string\n Input string.\n\n n: integer\n Number of repetitions.\n\n Returns\n -------\n out: string\n Repeated string.\n\n Examples\n --------\n > var out = repeat( 'a', 5 )\n 'aaaaa'\n > out = repeat( '', 100 )\n ''\n > out = repeat( 'beep', 0 )\n ''\n\n See Also\n --------\n pad\n",
"replace": "\nreplace( str, search, newval )\n Replaces `search` occurrences with a replacement `string`.\n\n When provided a `string` as the `search` value, the function replaces *all*\n occurrences. To remove only the first match, use a regular expression.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string|RegExp\n Search expression.\n\n newval: string|Function\n Replacement value or function.\n\n Returns\n -------\n out: string\n String containing replacement(s).\n\n Examples\n --------\n // Standard usage:\n > var out = replace( 'beep', 'e', 'o' )\n 'boop'\n\n // Replacer function:\n > function replacer( match, p1 ) { return '/'+p1+'/'; };\n > var str = 'Oranges and lemons';\n > out = replace( str, /([^\\s]+)/gi, replacer )\n '/Oranges/ /and/ /lemons/'\n\n // Replace only first match:\n > out = replace( 'beep', /e/, 'o' )\n 'boep'\n\n",
"rescape": "\nrescape( str )\n Escapes a regular expression string.\n\n Parameters\n ----------\n str: string\n Regular expression string.\n\n Returns\n -------\n out: string\n Escaped string.\n\n Examples\n --------\n > var str = rescape( '[A-Z]*' )\n '\\\\[A\\\\-Z\\\\]\\\\*'\n\n",
"resolveParentPath": "\nresolveParentPath( path[, options,] clbk )\n Asynchronously resolves a path by walking parent directories.\n\n If unable to resolve a path, the function returns `null` as the path result.\n\n Parameters\n ----------\n path: string\n Path to resolve.\n\n options: Object (optional)\n Options.\n\n options.dir: string (optional)\n Base directory from which to search. Default: current working directory.\n\n clbk: Function\n Callback to invoke after resolving a path.\n\n Examples\n --------\n > function onPath( error, path ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... } else {\n ... console.log( path );\n ... }\n ... };\n > resolveParentPath( 'package.json', onPath );\n\n\nresolveParentPath.sync( path[, options] )\n Synchronously resolves a path by walking parent directories.\n\n Parameters\n ----------\n path: string\n Path to resolve.\n\n options: Object (optional)\n Options.\n\n options.dir: string (optional)\n Base directory from which to search. Default: current working directory.\n\n Returns\n -------\n out: string|null\n Resolved path.\n\n Examples\n --------\n > var out = resolveParentPath.sync( 'package.json' );\n\n",
"reverseArguments": "\nreverseArguments( fcn[, thisArg] )\n Returns a function that invokes a provided function with arguments in\n reverse order.\n\n Parameters\n ----------\n fcn: Function\n Input function.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Function with reversed arguments.\n\n Examples\n --------\n > function foo( a, b, c ) { return [ a, b, c ]; };\n > var bar = reverseArguments( foo );\n > var out = bar( 1, 2, 3 )\n [ 3, 2, 1 ]\n\n See Also\n --------\n reorderArguments\n",
"reverseString": "\nreverseString( str )\n Reverses a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Reversed string.\n\n Examples\n --------\n > var out = reverseString( 'foo' )\n 'oof'\n > out = reverseString( 'abcdef' )\n 'fedcba'\n\n",
"reviveBasePRNG": "\nreviveBasePRNG( key, value )\n Revives a JSON-serialized pseudorandom number generator (PRNG).\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or PRNG.\n\n Examples\n --------\n > var str = JSON.stringify( base.random.mt19937 );\n > var r = parseJSON( str, reviveBasePRNG )\n <Function>\n\n",
"reviveBuffer": "\nreviveBuffer( key, value )\n Revives a JSON-serialized Buffer.\n\n The serialization format for a Buffer is an object having the following\n fields:\n\n - type: value type (Buffer)\n - data: buffer data as an array of integers\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or Buffer.\n\n Examples\n --------\n > var str = '{\"type\":\"Buffer\",\"data\":[5,3]}';\n > var buf = parseJSON( str, reviveBuffer )\n <Buffer>[ 5, 3 ]\n\n See Also\n --------\n buffer2json\n",
"reviveComplex": "\nreviveComplex( key, value )\n Revives a JSON-serialized complex number.\n\n The serialization format for complex numbers is an object having the\n following fields:\n\n - type: complex number type (e.g., \"Complex128\", \"Complex64\")\n - re: real component (number)\n - im: imaginary component (number)\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex )\n <Complex128>\n\n See Also\n --------\n Complex128, Complex64, reviveComplex128, reviveComplex64\n",
"reviveComplex64": "\nreviveComplex64( key, value )\n Revives a JSON-serialized 64-bit complex number.\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex64\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex64 )\n <Complex64>\n\n See Also\n --------\n Complex64, reviveComplex128, reviveComplex\n",
"reviveComplex128": "\nreviveComplex128( key, value )\n Revives a JSON-serialized 128-bit complex number.\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or complex number.\n\n Examples\n --------\n > var str = '{\"type\":\"Complex128\",\"re\":5,\"im\":3}';\n > var z = parseJSON( str, reviveComplex128 )\n <Complex128>\n\n See Also\n --------\n Complex128, reviveComplex64, reviveComplex\n",
"reviveError": "\nreviveError( key, value )\n Revives a JSON-serialized error object.\n\n The following built-in error types are supported:\n\n - Error\n - URIError\n - ReferenceError\n - SyntaxError\n - RangeError\n - EvalError\n - TypeError\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or error object.\n\n Examples\n --------\n > var str = '{\"type\":\"TypeError\",\"message\":\"beep\"}';\n > var err = JSON.parse( str, reviveError )\n <TypeError>\n\n See Also\n --------\n error2json\n",
"reviveTypedArray": "\nreviveTypedArray( key, value )\n Revives a JSON-serialized typed array.\n\n The serialization format for typed array is an object having the following\n fields:\n\n - type: typed array type (e.g., \"Float64Array\", \"Int8Array\")\n - data: typed array data as an array of numbers\n\n Parameters\n ----------\n key: string\n Key.\n\n value: any\n Value.\n\n Returns\n -------\n out: any\n Value or typed array.\n\n Examples\n --------\n > var str = '{\"type\":\"Float64Array\",\"data\":[5,3]}';\n > var arr = parseJSON( str, reviveTypedArray )\n <Float64Array>[ 5.0, 3.0 ]\n\n See Also\n --------\n typedarray2json\n",
"rpad": "\nrpad( str, len[, pad] )\n Right pads a `string` such that the padded `string` has a length of at least\n `len`.\n\n An output string is not guaranteed to have a length of exactly `len`, but to\n have a length of at least `len`. To generate a padded string having a length\n equal to `len`, post-process a padded string by trimming off excess\n characters.\n\n Parameters\n ----------\n str: string\n Input string.\n\n len: integer\n Minimum string length.\n\n pad: string (optional)\n String used to pad. Default: ' '.\n\n Returns\n -------\n out: string\n Padded string.\n\n Examples\n --------\n > var out = rpad( 'a', 5 )\n 'a '\n > out = rpad( 'beep', 10, 'p' )\n 'beeppppppp'\n > out = rpad( 'beep', 12, 'boop' )\n 'beepboopboop'\n\n See Also\n --------\n lpad, pad\n",
"rtrim": "\nrtrim( str )\n Trims whitespace from the end of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = rtrim( ' \\t\\t\\n Beep \\r\\n\\t ' )\n ' \\t\\t\\n Beep'\n\n See Also\n --------\n ltrim, trim\n",
"safeintmax": "\nsafeintmax( dtype )\n Returns the maximum safe integer capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum safe integer.\n\n Examples\n --------\n > var m = safeintmax( 'float16' )\n 2047\n > m = safeintmax( 'float32' )\n 16777215\n\n See Also\n --------\n safeintmin, realmax, typemax\n",
"safeintmin": "\nsafeintmin( dtype )\n Returns the minimum safe integer capable of being represented by a numeric\n real type.\n\n The following numeric real types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Minimum safe integer.\n\n Examples\n --------\n > var m = safeintmin( 'float16' )\n -2047\n > m = safeintmin( 'float32' )\n -16777215\n\n See Also\n --------\n safeintmax, realmin, typemin\n",
"sample": "\nsample( x[, options] )\n Samples elements from an array-like object.\n\n Parameters\n ----------\n x: ArrayLike\n Array-like object from which to sample.\n\n options: Object (optional)\n Options.\n\n options.size: integer (optional)\n Sample size. By default, the function returns an array having the same\n length as `x`. Specify the `size` option to generate a sample of a\n different size.\n\n options.probs: Array<number> (optional)\n Element probabilities. By default, the probability of sampling an\n element is the same for all elements. To assign elements different\n probabilities, set the `probs` option. The `probs` option must be a\n numeric array consisting of nonnegative values which sum to one. When\n sampling without replacement, note that the `probs` option denotes the\n initial element probabilities which are then updated after each draw.\n\n options.replace: boolean (optional)\n Boolean indicating whether to sample with replacement. If the `replace`\n option is set to `false`, the `size` option cannot be an integer larger\n than the number of elements in `x`. Default: `true`.\n\n Returns\n -------\n out: Array\n Sample.\n\n Examples\n --------\n > var out = sample( 'abc' )\n e.g., [ 'a', 'a', 'b' ]\n > out = sample( [ 3, 6, 9 ] )\n e.g., [ 3, 9, 6 ]\n > var bool = ( out.length === 3 )\n true\n\n > out = sample( [ 3, null, NaN, 'abc', function(){} ] )\n e.g., [ 3, 'abc', null, 3, null ]\n\n // Set sample size:\n > out = sample( [ 3, 6, 9 ], { 'size': 10 })\n e.g., [ 6, 3, 9, 9, 9, 6, 9, 6, 9, 3 ]\n > out = sample( [ 0, 1 ], { 'size': 20 })\n e.g., [ 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0 ]\n\n // Draw without replacement:\n > out = sample( [ 1, 2, 3, 4, 5, 6 ], { 'replace': false, 'size': 3 })\n e.g., [ 6, 1, 5 ]\n > out = sample( [ 0, 1 ], { 'replace': false })\n e.g., [ 0, 1 ]\n\n // Assigning non-uniform element probabilities:\n > var x = [ 1, 2, 3, 4, 5, 6 ];\n > var probs = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.5 ];\n > out = sample( x, { 'probs': probs })\n e.g., [ 5, 6, 6, 5, 6, 4 ]\n > out = sample( x, { 'probs': probs, 'size': 3, 'replace': false })\n e.g., [ 6, 4, 1 ]\n\n\nsample.factory( [pool, ][options] )\n Returns a function to sample elements from an array-like object.\n\n If provided an array-like object `pool`, the returned function will always\n sample from the supplied object.\n\n Parameters\n ----------\n pool: ArrayLike (optional)\n Array-like object from which to sample.\n\n options: Object (optional)\n Options.\n\n options.seed: integer (optional)\n Integer-valued seed.\n\n options.size: integer (optional)\n Sample size.\n\n options.replace: boolean (optional)\n Boolean indicating whether to sample with replacement. Default: `true`.\n\n options.mutate: boolean (optional)\n Boolean indicating whether to mutate the `pool` when sampling without\n replacement. If a population from which to sample is provided, the\n underlying `pool` remains by default constant for each function\n invocation. To mutate the `pool` by permanently removing observations\n when sampling without replacement, set the `mutate` option to `true`.\n The returned function returns `null` after all population units are\n exhausted. Default: `false`.\n\n Returns\n -------\n fcn: Function\n Function to sample elements from an array-like object.\n\n Examples\n --------\n // Set a seed:\n > var mysample = sample.factory({ 'seed': 232 });\n > var out = mysample( 'abcdefg' )\n e.g., [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n\n // Provide `pool` and set a seed plus a default sample size:\n > var pool = [ 1, 2, 3, 4, 5, 6 ];\n > mysample = sample.factory( pool, { 'seed': 232, 'size': 2 });\n > out = mysample()\n e.g., [ 6, 4 ]\n > out = mysample()\n e.g., [ 6, 5 ]\n\n // Mutate the `pool`:\n > var opts = { 'seed': 474, 'size': 3, 'mutate': true, 'replace': false };\n > pool = [ 1, 2, 3, 4, 5, 6 ];\n > mysample = sample.factory( pool, opts );\n > out = mysample()\n e.g., [ 4, 3, 6 ]\n > out = mysample()\n e.g., [ 1, 5, 2 ]\n > out = mysample()\n null\n\n // Override default `size` parameter when invoking created function:\n > mysample = sample.factory( [ 0, 1 ], { 'size': 2 });\n > out = mysample()\n e.g., [ 1, 1 ]\n > out = mysample({ 'size': 10 })\n e.g, [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n\n // Sample with and without replacement:\n > mysample = sample.factory( [ 0, 1 ], { 'size': 2 });\n > out = mysample()\n e.g., [ 1, 1 ]\n > out = mysample({ 'replace': false })\n e.g., [ 0, 1 ] or [ 1, 0 ]\n > out = mysample()\n e.g., [ 1, 1 ]\n\n",
"SAVOY_STOPWORDS_FIN": "\nSAVOY_STOPWORDS_FIN()\n Returns a list of Finnish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_FIN()\n [ 'aiemmin', 'aika', 'aikaa', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_FR": "\nSAVOY_STOPWORDS_FR()\n Returns a list of French stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_FR()\n [ 'a', 'à', 'â', 'abord', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_GER": "\nSAVOY_STOPWORDS_GER()\n Returns a list of German stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_GER()\n [ 'a', 'ab', 'aber', 'ach', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_IT": "\nSAVOY_STOPWORDS_IT()\n Returns a list of Italian stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_IT()\n [ 'a', 'abbastanza', 'accidenti', 'ad', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_POR": "\nSAVOY_STOPWORDS_POR()\n Returns a list of Portuguese stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_POR()\n [ 'aiemmin', 'aika', 'aikaa', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_SP": "\nSAVOY_STOPWORDS_SP()\n Returns a list of Spanish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_SP()\n [ 'a', 'acuerdo', 'adelante', 'ademas', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SAVOY_STOPWORDS_SWE": "\nSAVOY_STOPWORDS_SWE()\n Returns a list of Swedish stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = SAVOY_STOPWORDS_SWE()\n [ 'aderton', 'adertonde', 'adjö', ... ]\n\n References\n ----------\n - Savoy, Jacques. 2005. \"IR Multilingual Resources at UniNE.\"\n <http://members.unine.ch/jacques.savoy/clef/>.\n\n",
"SECONDS_IN_DAY": "\nSECONDS_IN_DAY\n Number of seconds in a day.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var days = 3.14;\n > var secs = days * SECONDS_IN_DAY\n 271296\n\n",
"SECONDS_IN_HOUR": "\nSECONDS_IN_HOUR\n Number of seconds in an hour.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var hrs = 3.14;\n > var secs = hrs * SECONDS_IN_HOUR\n 11304\n\n",
"SECONDS_IN_MINUTE": "\nSECONDS_IN_MINUTE\n Number of seconds in a minute.\n\n The value is a generalization and does **not** take into account\n inaccuracies arising due to complications with time and dates.\n\n Examples\n --------\n > var mins = 3.14;\n > var secs = mins * SECONDS_IN_MINUTE\n 188.4\n\n",
"SECONDS_IN_WEEK": "\nSECONDS_IN_WEEK\n Number of seconds in a week.\n\n The value is a generalization and does **not** take into account\n inaccuracies due to daylight savings conventions, crossing timezones, or\n other complications with time and dates.\n\n Examples\n --------\n > var wks = 3.14;\n > var secs = wks * SECONDS_IN_WEEK\n 1899072\n\n",
"secondsInMonth": "\nsecondsInMonth( [month[, year]] )\n Returns the number of seconds in a month.\n\n By default, the function returns the number of seconds in the current month\n of the current year (according to local time). To determine the number of\n seconds for a particular month and year, provide `month` and `year`\n arguments.\n\n A `month` may be either a month's integer value, three letter abbreviation,\n or full name (case insensitive).\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n month: string|Date|integer (optional)\n Month.\n\n year: integer (optional)\n Year.\n\n Returns\n -------\n out: integer\n Seconds in a month.\n\n Examples\n --------\n > var num = secondsInMonth()\n <number>\n > num = secondsInMonth( 2 )\n <number>\n > num = secondsInMonth( 2, 2016 )\n 2505600\n > num = secondsInMonth( 2, 2017 )\n 2419200\n\n // Other ways to supply month:\n > num = secondsInMonth( 'feb', 2016 )\n 2505600\n > num = secondsInMonth( 'february', 2016 )\n 2505600\n\n See Also\n --------\n secondsInYear\n",
"secondsInYear": "\nsecondsInYear( [value] )\n Returns the number of seconds in a year according to the Gregorian calendar.\n\n By default, the function returns the number of seconds in the current year\n (according to local time). To determine the number of seconds for a\n particular year, provide either a year or a `Date` object.\n\n The function's return value is a generalization and does **not** take into\n account inaccuracies due to daylight savings conventions, crossing\n timezones, or other complications with time and dates.\n\n Parameters\n ----------\n value: integer|Date (optional)\n Year or `Date` object.\n\n Returns\n -------\n out: integer\n Number of seconds in a year.\n\n Examples\n --------\n > var num = secondsInYear()\n <number>\n > num = secondsInYear( 2016 )\n 31622400\n > num = secondsInYear( 2017 )\n 31536000\n\n See Also\n --------\n secondsInMonth\n",
"setNonEnumerableProperty": "\nsetNonEnumerableProperty( obj, prop, value )\n Defines a non-enumerable property.\n\n Non-enumerable properties are writable and configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setNonEnumerableProperty( obj, 'foo', 'bar' );\n > obj.foo\n 'bar'\n > objectKeys( obj )\n []\n\n See Also\n --------\n setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnly\n",
"setNonEnumerableReadOnly": "\nsetNonEnumerableReadOnly( obj, prop, value )\n Defines a non-enumerable read-only property.\n\n Non-enumerable read-only properties are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnly\n",
"setNonEnumerableReadOnlyAccessor": "\nsetNonEnumerableReadOnlyAccessor( obj, prop, getter )\n Defines a non-enumerable read-only accessor.\n\n Non-enumerable read-only accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n Examples\n --------\n > var obj = {};\n > function getter() { return 'bar'; };\n > setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n > obj.foo\n 'bar'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setNonEnumerableWriteOnlyAccessor, setReadOnlyAccessor\n",
"setNonEnumerableReadWriteAccessor": "\nsetNonEnumerableReadWriteAccessor( obj, prop, getter, setter )\n Defines a non-enumerable property having read-write accessors.\n\n Non-enumerable read-write accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var name = 'bar';\n > function getter() { return name + ' foo'; };\n > function setter( v ) { name = v; };\n > setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n > obj.foo\n 'bar foo'\n > obj.foo = 'beep';\n > obj.foo\n 'beep foo'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableWriteOnlyAccessor, setReadWriteAccessor\n",
"setNonEnumerableWriteOnlyAccessor": "\nsetNonEnumerableWriteOnlyAccessor( obj, prop, setter )\n Defines a non-enumerable write-only accessor.\n\n Non-enumerable write-only accessors are non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var val = '';\n > function setter( v ) { val = v; };\n > setNonEnumerableWriteOnlyAccessor( obj, 'foo', setter );\n > obj.foo = 'bar';\n > val\n 'bar'\n\n See Also\n --------\n setNonEnumerableProperty, setNonEnumerableReadOnlyAccessor, setNonEnumerableReadOnly, setNonEnumerableReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadOnly": "\nsetReadOnly( obj, prop, value )\n Defines a read-only property.\n\n Read-only properties are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n value: any\n Value to set.\n\n Examples\n --------\n > var obj = {};\n > setReadOnly( obj, 'foo', 'bar' );\n > obj.foo = 'boop';\n > obj\n { 'foo': 'bar' }\n\n See Also\n --------\n setReadOnlyAccessor, setReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadOnlyAccessor": "\nsetReadOnlyAccessor( obj, prop, getter )\n Defines a read-only accessor.\n\n Read-only accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n Examples\n --------\n > var obj = {};\n > function getter() { return 'bar'; };\n > setReadOnlyAccessor( obj, 'foo', getter );\n > obj.foo\n 'bar'\n\n See Also\n --------\n setReadOnly, setReadWriteAccessor, setWriteOnlyAccessor\n",
"setReadWriteAccessor": "\nsetReadWriteAccessor( obj, prop, getter, setter )\n Defines a property having read-write accessors.\n\n Read-write accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n getter: Function\n Get accessor.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var name = 'bar';\n > function getter() { return name + ' foo'; };\n > function setter( v ) { name = v; };\n > setReadWriteAccessor( obj, 'foo', getter, setter );\n > obj.foo\n 'bar foo'\n > obj.foo = 'beep';\n > obj.foo\n 'beep foo'\n\n See Also\n --------\n setReadOnly, setReadOnlyAccessor, setWriteOnlyAccessor\n",
"setWriteOnlyAccessor": "\nsetWriteOnlyAccessor( obj, prop, setter )\n Defines a write-only accessor.\n\n Write-only accessors are enumerable and non-configurable.\n\n Parameters\n ----------\n obj: Object\n Object on which to define the property.\n\n prop: string|symbol\n Property name.\n\n setter: Function\n Set accessor.\n\n Examples\n --------\n > var obj = {};\n > var val = '';\n > function setter( v ) { val = v; };\n > setWriteOnlyAccessor( obj, 'foo', setter );\n > obj.foo = 'bar';\n > val\n 'bar'\n\n See Also\n --------\n setReadOnly, setReadOnlyAccessor, setReadWriteAccessor\n",
"SharedArrayBuffer": "\nSharedArrayBuffer( size )\n Returns a shared array buffer having a specified number of bytes.\n\n A shared array buffer behaves similarly to a non-shared array buffer, except\n that a shared array buffer allows creating views of memory shared between\n threads.\n\n Buffer contents are initialized to 0.\n\n If an environment does not support shared array buffers, the function throws\n an error.\n\n Parameters\n ----------\n size: integer\n Number of bytes.\n\n Returns\n -------\n out: SharedArrayBuffer\n A shared array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var buf = new SharedArrayBuffer( 5 )\n <SharedArrayBuffer>\n\n\nSharedArrayBuffer.length\n Number of input arguments the constructor accepts.\n\n Examples\n --------\n > SharedArrayBuffer.length\n 1\n\n\nSharedArrayBuffer.prototype.byteLength\n Read-only property which returns the length (in bytes) of the array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var buf = new SharedArrayBuffer( 5 );\n > buf.byteLength\n 5\n\n\nSharedArrayBuffer.prototype.slice( [start[, end]] )\n Copies the bytes of a shared array buffer to a new shared array buffer.\n\n Parameters\n ----------\n start: integer (optional)\n Index at which to start copying buffer contents (inclusive). If\n negative, the index is relative to the end of the buffer.\n\n end: integer (optional)\n Index at which to stop copying buffer contents (exclusive). If negative,\n the index is relative to the end of the buffer.\n\n Returns\n -------\n out: SharedArrayBuffer\n A new shared array buffer whose contents have been copied from the\n calling shared array buffer.\n\n Examples\n --------\n // Assuming an environment supports SharedArrayBuffers...\n > var b1 = new SharedArrayBuffer( 10 );\n > var b2 = b1.slice( 2, 6 );\n > var bool = ( b1 === b2 )\n false\n > b2.byteLength\n 4\n\n See Also\n --------\n Buffer, ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"shift": "\nshift( collection )\n Removes and returns the first element of a collection.\n\n The function returns an array with two elements: the shortened collection\n and the removed element.\n\n If the input collection is a typed array whose length is greater than `0`,\n the first return value does not equal the input reference.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the value should be\n array-like.\n\n Returns\n -------\n out: Array\n Updated collection and the removed item.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > var out = shift( arr )\n [ [ 2.0, 3.0, 4.0, 5.0 ], 1.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > out = shift( arr )\n [ <Float64Array>[ 2.0 ], 1.0 ]\n\n // Array-like object:\n > arr = { 'length': 2, '0': 1.0, '1': 2.0 };\n > out = shift( arr )\n [ { 'length': 1, '0': 2.0 }, 1.0 ]\n\n See Also\n --------\n pop, push, unshift\n",
"shuffle": "\nshuffle( arr[, options] )\n Shuffles elements of an array-like object.\n\n Parameters\n ----------\n arr: ArrayLike\n Array-like object to shuffle.\n\n options: Object (optional)\n Options.\n\n options.copy: string (optional)\n String indicating whether to return a copy (`deep`,`shallow` or `none`).\n Default: `'shallow'`.\n\n Returns\n -------\n out: ArrayLike\n Shuffled array-like object.\n\n Examples\n --------\n > var data = [ 1, 2, 3 ];\n > var out = shuffle( data )\n e.g., [ 3, 1, 2 ]\n > out = shuffle( data, { 'copy': 'none' });\n > var bool = ( data === out )\n true\n\n\nshuffle.factory( [options] )\n Returns a function to shuffle elements of array-like objects.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.seed: integer (optional)\n Integer-valued seed.\n\n options.copy: string (optional)\n String indicating whether to return a copy (`deep`,`shallow` or `none`).\n Default: `'shallow'`.\n\n Returns\n -------\n fcn: Function\n Shuffle function.\n\n Examples\n --------\n > var myshuffle = shuffle.factory();\n\n // Set a seed:\n > myshuffle = shuffle.factory({ 'seed': 239 });\n > var arr = [ 0, 1, 2, 3, 4 ];\n > var out = myshuffle( arr )\n e.g., [ 3, 4, 1, 0, 2 ]\n\n // Use a different copy strategy:\n > myshuffle = shuffle.factory({ 'copy': 'none', 'seed': 867 });\n\n // Created shuffle function mutates input array by default:\n > arr = [ 1, 2, 3, 4, 5, 6 ];\n > out = myshuffle( arr );\n > var bool = ( arr === out )\n true\n // Default option can be overridden:\n > arr = [ 1, 2, 3, 4 ];\n > out = myshuffle( arr, { 'copy': 'shallow' });\n > bool = ( arr === out )\n false\n\n See Also\n --------\n sample\n",
"sizeOf": "\nsizeOf( dtype )\n Returns the size (in bytes) of the canonical binary representation of a\n specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n - complex128: 128-bit complex numbers\n - complex64: 64-bit complex numbers\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Size (in bytes).\n\n Examples\n --------\n > var s = sizeOf( 'int8' )\n 1\n > s = sizeOf( 'uint32' )\n 4\n\n See Also\n --------\n realmax, typemax\n",
"some": "\nsome( collection, n )\n Tests whether at least `n` elements in a collection are truthy.\n\n The function immediately returns upon finding `n` truthy elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of truthy elements.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n` truthy\n elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > var arr = [ 0, 0, 1, 2, 3 ];\n > var bool = some( arr, 3 )\n true\n\n See Also\n --------\n any, every, forEach, none, someBy\n",
"someBy": "\nsomeBy( collection, n, predicate[, thisArg ] )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon finding `n` successful elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n`\n successful elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ 1, 2, -3, 4, -1 ];\n > var bool = someBy( arr, 2, negative )\n true\n\n See Also\n --------\n anyBy, everyBy, forEach, noneBy, someByAsync, someByRight\n",
"someByAsync": "\nsomeByAsync( collection, n, [options,] predicate, done )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon receiving `n` non-falsy `result`\n values and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > someByAsync( arr, 2, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nsomeByAsync.factory( [options,] predicate )\n Returns a function which tests whether a collection contains at least `n`\n elements which pass a test implemented by a predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = someByAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, 2, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, 2, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByAsync, everyByAsync, forEachAsync, noneByAsync, someBy, someByRightAsync\n",
"someByRight": "\nsomeByRight( collection, n, predicate[, thisArg ] )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function, iterating from right to left.\n\n The predicate function is provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n The function immediately returns upon finding `n` successful elements.\n\n If provided an empty collection, the function returns `false`.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n predicate: Function\n The test function.\n\n thisArg: any (optional)\n Execution context.\n\n Returns\n -------\n bool: boolean\n The function returns `true` if a collection contains at least `n`\n successful elements; otherwise, the function returns `false`.\n\n Examples\n --------\n > function negative( v ) { return ( v < 0 ); };\n > var arr = [ -1, 1, -2, 3, 4 ];\n > var bool = someByRight( arr, 2, negative )\n true\n\n See Also\n --------\n anyByRight, everyByRight, forEachRight, noneByRight, someBy, someByRightAsync\n",
"someByRightAsync": "\nsomeByRightAsync( collection, n, [options,] predicate, done )\n Tests whether a collection contains at least `n` elements which pass a test\n implemented by a predicate function, iterating from right to left.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `result`: test result\n\n If a provided function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n The function immediately returns upon receiving `n` non-falsy `result`\n values and calls the `done` callback with `null` as the first argument and\n `true` as the second argument.\n\n If all elements fail, the function calls the `done` callback with `null`\n as the first argument and `false` as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n n: number\n Minimum number of successful elements.\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, predicate, done )\n 1000\n 2500\n 3000\n false\n\n // Limit number of concurrent invocations:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, opts, predicate, done )\n 2500\n 3000\n 1000\n false\n\n // Process sequentially:\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 1000, 2500, 3000 ];\n > someByRightAsync( arr, 2, opts, predicate, done )\n 3000\n 2500\n 1000\n false\n\n\nsomeByRightAsync.factory( [options,] predicate )\n Returns a function which tests whether a collection contains at least `n`\n elements which pass a test implemented by a predicate function, iterating\n from right to left.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n The test function to invoke for each element in a collection.\n\n Returns\n -------\n out: Function\n A function which tests each element in a collection.\n\n Examples\n --------\n > function predicate( value, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, false );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = someByRightAsync.factory( opts, predicate );\n > function done( error, bool ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( bool );\n ... };\n > var arr = [ 1000, 2500, 3000 ];\n > f( arr, 2, done )\n 3000\n 2500\n 1000\n false\n > arr = [ 1000, 1500, 2000 ];\n > f( arr, 2, done )\n 2000\n 1500\n 1000\n false\n\n See Also\n --------\n anyByRightAsync, everyByRightAsync, forEachRightAsync, noneByRightAsync, someByAsync, someByRight\n",
"SOTU": "\nSOTU( [options] )\n Returns State of the Union (SOTU) addresses.\n\n Each State of the Union address is represented by an object with the\n following fields:\n\n - year: speech year\n - name: President name\n - party: the President's political party\n - text: speech text\n\n The following political parties are recognized:\n\n - Democratic\n - Republican\n - Democratic-Republican\n - Federalist\n - National Union\n - Whig\n - Whig & Democratic\n - none\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.name: String|Array<string> (optional)\n President name(s).\n\n options.party: String|Array<string> (optional)\n Political party (or parties).\n\n options.year: integer|Array<integer> (optional)\n Year(s).\n\n options.range: Array<integer> (optional)\n Two-element array specifying a year range.\n\n Returns\n -------\n out: Array<Object>\n State of the Union addresses.\n\n Examples\n --------\n > var out = SOTU()\n [ {...}, {...}, ... ]\n\n // Retrieve addresses by one or more Presidents...\n > var opts = { 'name': 'Barack Obama' };\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n // Retrieve addresses by one or more political parties...\n > opts = { 'party': [ 'Democratic', 'Federalist' ] };\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n // Retrieve addresses from one or more years...\n > opts = { 'year': [ 2008, 2009, 2011 ] };\n > out = SOTU( opts )\n [ {...}, {...}, {...} ]\n\n // Retrieve addresses from a range of consecutive years...\n > opts = { 'range': [ 2008, 2016 ] }\n > out = SOTU( opts )\n [ {...}, {...}, ... ]\n\n",
"SPACHE_REVISED": "\nSPACHE_REVISED()\n Returns a list of simple American-English words (revised Spache).\n\n Returns\n -------\n out: Array<string>\n List of simple American-English words.\n\n Examples\n --------\n > var list = SPACHE_REVISED()\n [ 'a', 'able', 'about', 'above', ... ]\n\n References\n ----------\n - Spache, George. 1953. \"A New Readability Formula for Primary-Grade Reading\n Materials.\" *The Elementary School Journal* 53 (7): 410–13. doi:10.1086/\n 458513.\n - Klare, George R. 1974. \"Assessing Readability.\" *Reading Research\n Quarterly* 10 (1). Wiley, International Reading Association: 62–102.\n <http://www.jstor.org/stable/747086>.\n - Stone, Clarence R. 1956. \"Measuring Difficulty of Primary Reading\n Material: A Constructive Criticism of Spache's Measure.\" *The Elementary\n School Journal* 57 (1). University of Chicago Press: 36–41.\n <http://www.jstor.org/stable/999700>.\n - Perera, Katherine. 2012. \"The assessment of linguistic difficulty in\n reading material.\" In *Linguistics and the Teacher*, edited by Ronald\n Carter, 101–13. Routledge Library Editions: Education. Taylor & Francis.\n <https://books.google.com/books?id=oNXFQ9Gn6XIC>.\n\n",
"SPAM_ASSASSIN": "\nSPAM_ASSASSIN()\n Returns the Spam Assassin public mail corpus.\n\n Each array element has the following fields:\n\n - id: message id (relative to message group)\n - group: message group\n - checksum: object containing checksum info\n - text: message text (including headers)\n\n The message group may be one of the following:\n\n - easy-ham-1: easier to detect non-spam e-mails (2500 messages)\n - easy-ham-2: easier to detect non-spam e-mails collected at a later date\n (1400 messages)\n - hard-ham-1: harder to detect non-spam e-mails (250 messages)\n - spam-1: spam e-mails (500 messages)\n - spam-2: spam e-mails collected at a later date (1396 messages)\n\n The checksum object contains the following fields:\n\n - type: checksum type (e.g., MD5)\n - value: checksum value\n\n Returns\n -------\n out: Array<Object>\n Corpus.\n\n Examples\n --------\n > var data = SPAM_ASSASSIN()\n [ {...}, {...}, ... ]\n\n",
"SparklineBase": "\nSparklineBase( [data,] [options] )\n Returns a Sparkline instance.\n\n This constructor is a base Sparkline constructor from which constructors\n tailored to generating particular types of Sparkline graphics should be\n derived.\n\n At a minimum, descendants should implement a private `_render()` method\n which will be automatically invoked by the public `render()` method.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Sparkline data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Sparkline data.\n\n options.description: string (optional)\n Sparkline description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n sparkline: Sparkline\n Sparkline instance.\n\n sparkline.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n sparkline.bufferSize\n Data buffer size.\n\n sparkline.description\n Sparkline description.\n\n sparkline.data\n Sparkline data.\n\n sparkline.label\n Data label.\n\n sparkline.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n sparkline.render()\n Renders a sparkline. This method calls `_render()` which must be\n implemented by instances and child classes. The default behavior is\n throw an error.\n\n Examples\n --------\n > var sparkline = new SparklineBase()\n <Sparkline>\n\n // Provide sparkline data at instantiation:\n > var data = [ 1, 2, 3 ];\n > sparkline = new SparklineBase( data )\n <Sparkline>\n\n See Also\n --------\n plot, Plot, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeWinLossChartSparkline\n",
"splitStream": "\nsplitStream( [options] )\n Returns a transform stream which splits streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream.Default: /\\r?\\n/.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = splitStream();\n > s.write( 'a\\nb\\nc' );\n > s.end();\n\n\nsplitStream.factory( [options] )\n Returns a function for creating transform streams for splitting streamed\n data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream. Default: /\\r?\\n/.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n createStream: Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = splitStream.factory( opts );\n > var s = createStream();\n > s.write( 'a\\nb\\nc' );\n > s.end();\n\n\nsplitStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream for splitting streamed data.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.sep: string (optional)\n Separator used to split streamed data. A separator may be either a\n regular expression or a string. A separator which is a regular\n expression containing a matching group will result in the separator\n being retained in the output stream. Default: /\\r?\\n/.\n\n options.encoding: string|null (optional)\n Specifies how Buffer objects should be decoded to strings. Default:\n null.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of objects to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.writableObjectMode: boolean (optional)\n Specifies whether the writable side should be in \"objectMode\". Default:\n false.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = splitStream.objectMode();\n > s.write( 'a\\nb\\c' );\n > s.end();\n\n See Also\n --------\n joinStream\n",
"SQRT_EPS": "\nSQRT_EPS\n Square root of double-precision floating-point epsilon.\n\n Examples\n --------\n > SQRT_EPS\n 0.14901161193847656e-7\n\n See Also\n --------\n EPS\n",
"SQRT_HALF": "\nSQRT_HALF\n Square root of `1/2`.\n\n Examples\n --------\n > SQRT_HALF\n 0.7071067811865476\n\n See Also\n --------\n LN_HALF\n",
"SQRT_HALF_PI": "\nSQRT_HALF_PI\n Square root of the mathematical constant `π` divided by `2`.\n\n Examples\n --------\n > SQRT_HALF_PI\n 1.2533141373155003\n\n See Also\n --------\n PI\n",
"SQRT_PHI": "\nSQRT_PHI\n Square root of the golden ratio.\n\n Examples\n --------\n > SQRT_PHI\n 1.272019649514069\n\n See Also\n --------\n PHI\n",
"SQRT_PI": "\nSQRT_PI\n Square root of the mathematical constant `π`.\n\n Examples\n --------\n > SQRT_PI\n 1.7724538509055160\n\n See Also\n --------\n PI\n",
"SQRT_THREE": "\nSQRT_THREE\n Square root of `3`.\n\n Examples\n --------\n > SQRT_THREE\n 1.7320508075688772\n\n",
"SQRT_TWO": "\nSQRT_TWO\n Square root of `2`.\n\n Examples\n --------\n > SQRT_TWO\n 1.4142135623730951\n\n See Also\n --------\n LN2\n",
"SQRT_TWO_PI": "\nSQRT_TWO_PI\n Square root of the mathematical constant `π` times `2`.\n\n Examples\n --------\n > SQRT_TWO_PI\n 2.5066282746310007\n\n See Also\n --------\n TWO_PI\n",
"Stack": "\nStack()\n Stack constructor.\n\n A stack is also referred to as a \"last-in-first-out\" queue.\n\n Returns\n -------\n stack: Object\n Stack data structure.\n\n stack.clear: Function\n Clears the stack.\n\n stack.first: Function\n Returns the \"newest\" stack value (i.e., the value which is \"first-out\").\n If the stack is empty, the returned value is `undefined`.\n\n stack.iterator: Function\n Returns an iterator for iterating over a stack. If an environment\n supports Symbol.iterator, the returned iterator is iterable. Note that,\n in order to prevent confusion arising from stack mutation during\n iteration, a returned iterator **always** iterates over a stack\n \"snapshot\", which is defined as the list of stack elements at the time\n of the method's invocation.\n\n stack.last: Function\n Returns the \"oldest\" stack value (i.e., the value which is \"last-out\").\n If the stack is empty, the returned value is `undefined`.\n\n stack.length: integer\n Stack length.\n\n stack.pop: Function\n Removes and returns the current \"first-out\" value from the stack. If the\n stack is empty, the returned value is `undefined`.\n\n stack.push: Function\n Adds a value to the stack.\n\n stack.toArray: Function\n Returns an array of stack values.\n\n stack.toJSON: Function\n Serializes a stack as JSON.\n\n Examples\n --------\n > var s = Stack();\n > s.push( 'foo' ).push( 'bar' );\n > s.length\n 2\n > s.pop()\n 'bar'\n > s.length\n 1\n > s.pop()\n 'foo'\n > s.length\n 0\n\n See Also\n --------\n FIFO\n",
"startcase": "\nstartcase( str )\n Capitalizes the first letter of each word in an input `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n String containing words where each first letter is capitalized.\n\n Examples\n --------\n > var out = startcase( 'beep boop' )\n 'Beep Boop'\n\n See Also\n --------\n lowercase, uppercase\n",
"startsWith": "\nstartsWith( str, search[, position] )\n Tests if a `string` starts with the characters of another `string`.\n\n If provided an empty `search` string, the function always returns `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n search: string\n Search string.\n\n position: integer (optional)\n Position at which to start searching for `search`. If less than `0`, the\n start position is determined relative to the end of the input string.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether a `string` starts with the characters of\n another `string`.\n\n Examples\n --------\n > var bool = startsWith( 'Beep', 'Be' )\n true\n > bool = startsWith( 'Beep', 'ep' )\n false\n > bool = startsWith( 'Beep', 'ee', 1 )\n true\n > bool = startsWith( 'Beep', 'ee', -3 )\n true\n > bool = startsWith( 'Beep', '' )\n true\n\n See Also\n --------\n endsWith\n",
"STOPWORDS_EN": "\nSTOPWORDS_EN()\n Returns a list of English stop words.\n\n Returns\n -------\n out: Array<string>\n List of stop words.\n\n Examples\n --------\n > var list = STOPWORDS_EN()\n [ 'a', 'about', 'above', 'across', ... ]\n\n",
"string2buffer": "\nstring2buffer( str[, encoding] )\n Allocates a buffer containing a provided string.\n\n Parameters\n ----------\n str: string\n Input string.\n\n encoding: string (optional)\n Character encoding. Default: 'utf8'.\n\n Returns\n -------\n out: Buffer\n Buffer instance.\n\n Examples\n --------\n > var b = string2buffer( 'beep boop' )\n <Buffer>\n > b = string2buffer( '7468697320697320612074c3a97374', 'hex' );\n > b.toString()\n 'this is a tést'\n\n See Also\n --------\n Buffer, array2buffer, arraybuffer2buffer, copyBuffer\n",
"sub2ind": "\nsub2ind( shape, ...subscript[, options] )\n Converts subscripts to a linear index.\n\n Parameters\n ----------\n shape: ArrayLike\n Array shape.\n\n subscript: ...integer\n Subscripts.\n\n options: Object (optional)\n Options.\n\n options.order: string (optional)\n Specifies whether an array is row-major (C-style) or column-major\n (Fortran style). Default: 'row-major'.\n\n options.mode: string|Array<string> (optional)\n Specifies how to handle subscripts which exceed array dimensions. If\n equal to 'throw', the function throws an error when a subscript exceeds\n array dimensions. If equal to 'wrap', the function wraps around\n subscripts exceeding array dimensions using modulo arithmetic. If equal\n to 'clamp', the function sets subscripts exceeding array dimensions to\n either `0` (minimum index) or the maximum index along a particular\n dimension. If provided a mode array, each array element specifies the\n mode for a corresponding array dimension. If provided fewer modes than\n dimensions, the function recycles modes using modulo arithmetic.\n Default: [ 'throw' ].\n\n Returns\n -------\n idx: integer\n Linear index.\n\n Examples\n --------\n > var d = [ 3, 3, 3 ];\n > var idx = sub2ind( d, 1, 2, 2 )\n 17\n\n See Also\n --------\n array, ndarray, ind2sub\n",
"SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK": "\nSUTHAHARAN_MULTI_HOP_SENSOR_NETWORK()\n Returns a dataset consisting of labeled wireless sensor network data set\n collected from a multi-hop wireless sensor network deployment using TelosB\n motes.\n\n Humidity and temperature measurements were collected at 5 second intervals\n over a six hour period on July 10, 2010.\n\n Temperature is in degrees Celsius.\n\n Humidity is temperature corrected relative humidity, ranging from 0-100%.\n\n The label '0' denotes normal data, and the label '1' denotes an introduced\n event.\n\n If a mote was an indoor sensor, the corresponding indicator is '1'. If a\n mote was an outdoor sensor, the indoor indicator is '0'.\n\n Returns\n -------\n out: Array<Object>\n Sensor data.\n\n Examples\n --------\n > var data = SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK()\n [{...}, {...}, ...]\n\n References\n ----------\n - Suthaharan, Shan, Mohammed Alzahrani, Sutharshan Rajasegarar, Christopher\n Leckie, and Marimuthu Palaniswami. 2010. \"Labelled data collection for\n anomaly detection in wireless sensor networks.\" In _Proceedings of the Sixth\n International Conference on Intelligent Sensors, Sensor Networks and\n Information Processing (ISSNIP 2010)_. Brisbane, Australia: IEEE.\n\n * If you use the data for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK\n",
"SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK": "\nSUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK()\n Returns a dataset consisting of labeled wireless sensor network data set\n collected from a simple single-hop wireless sensor network deployment using\n TelosB motes.\n\n Humidity and temperature measurements were collected at 5 second intervals\n over a six hour period on May 9, 2010.\n\n Temperature is in degrees Celsius.\n\n Humidity is temperature corrected relative humidity, ranging from 0-100%.\n\n The label '0' denotes normal data, and the label '1' denotes an introduced\n event.\n\n If a mote was an indoor sensor, the corresponding indicator is '1'. If a\n mote was an outdoor sensor, the indoor indicator is '0'.\n\n Returns\n -------\n out: Array<Object>\n Sensor data.\n\n Examples\n --------\n > var data = SUTHAHARAN_SINGLE_HOP_SENSOR_NETWORK()\n [{...}, {...}, ...]\n\n References\n ----------\n - Suthaharan, Shan, Mohammed Alzahrani, Sutharshan Rajasegarar, Christopher\n Leckie, and Marimuthu Palaniswami. 2010. \"Labelled data collection for\n anomaly detection in wireless sensor networks.\" In _Proceedings of the Sixth\n International Conference on Intelligent Sensors, Sensor Networks and\n Information Processing (ISSNIP 2010)_. Brisbane, Australia: IEEE.\n\n * If you use the data for publication or third party consumption, please\n cite the listed reference.\n\n See Also\n --------\n SUTHAHARAN_MULTI_HOP_SENSOR_NETWORK\n",
"Symbol": "\nSymbol( [description] )\n Returns a symbol.\n\n Unlike conventional constructors, this function does **not** support the\n `new` keyword.\n\n This function is only supported in environments which support symbols.\n\n Parameters\n ----------\n description: string (optional)\n Symbol description which can be used for debugging but not to access the\n symbol itself.\n\n Returns\n -------\n out: symbol\n Symbol.\n\n Examples\n --------\n > var s = ( Symbol ) ? Symbol( 'beep' ) : null\n\n",
"tabulate": "\ntabulate( collection )\n Generates a frequency table.\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to tabulate. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n Returns\n -------\n out: Array<Array>|Array\n Frequency table.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'beep' ];\n > var out = tabulate( collection )\n [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]\n\n See Also\n --------\n countBy, groupBy, tabulateBy\n",
"tabulateBy": "\ntabulateBy( collection, [options,] indicator )\n Generates a frequency table according to an indicator function.\n\n When invoked, the indicator function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to tabulate. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n Returns\n -------\n out: Array<Array>|Array\n Frequency table.\n\n Examples\n --------\n > function indicator( value ) { return value[ 0 ]; };\n > var collection = [ 'beep', 'boop', 'foo', 'beep' ];\n > var out = tabulateBy( collection, indicator )\n [ [ 'b', 3, 0.75 ], [ 'f', 1, 0.25 ] ]\n\n See Also\n --------\n countBy, groupBy, tabulate\n",
"tabulateByAsync": "\ntabulateByAsync( collection, [options,] indicator, done )\n Generates a frequency table according to an indicator function.\n\n The table is an array of arrays where each sub-array corresponds to a unique\n value in the input collection. Each sub-array is structured as follows:\n\n - 0: unique value\n - 1: value count\n - 2: frequency percentage\n\n When invoked, the indicator function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n indicator function accepts two arguments, the indicator function is\n provided:\n\n - `value`\n - `next`\n\n If the indicator function accepts three arguments, the indicator function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other indicator function signature, the indicator function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an indicator function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty array as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even': 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, indicator, done )\n 750\n 1000\n 2500\n 3000\n [ [ 'odd', 2, 0.5 ], [ 'even', 2, 0.5 ] ]\n\n // Limit number of concurrent invocations:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, opts, indicator, done )\n 2500\n 3000\n 1000\n 750\n [ [ 'odd', 2, 0.5 ], [ 'even', 2, 0.5 ] ]\n\n // Process sequentially:\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > tabulateByAsync( arr, opts, indicator, done )\n 3000\n 2500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n\n\ntabulateByAsync.factory( [options,] indicator )\n Returns a function which generates a frequency table according to an\n indicator function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.thisArg: any (optional)\n Execution context.\n\n indicator: Function\n Indicator function specifying how to categorize a collection element.\n\n Returns\n -------\n out: Function\n A function which generates a frequency table according to an indicator\n function.\n\n Examples\n --------\n > function indicator( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) ? 'even' : 'odd' );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = tabulateByAsync.factory( opts, indicator );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000, 750 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n > arr = [ 2000, 1500, 1000, 750 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n 750\n [ [ 'even', 2, 0.5 ], [ 'odd', 2, 0.5 ] ]\n\n See Also\n --------\n countByAsync, groupByAsync, tabulateBy\n",
"tic": "\ntic()\n Returns a high-resolution time.\n\n The returned array has the following format: `[seconds, nanoseconds]`.\n\n Returns\n -------\n out: Array<integer>\n High resolution time.\n\n Examples\n --------\n > var t = tic()\n [ <number>, <number> ]\n\n See Also\n --------\n toc\n",
"timeit": "\ntimeit( code, [options,] clbk )\n Times a snippet.\n\n If the `asynchronous` option is set to `true`, the implementation assumes\n that `before`, `after`, and `code` snippets are all asynchronous.\n Accordingly, these snippets should invoke a `next( [error] )` callback\n once complete. The implementation wraps the snippet within a function\n accepting two arguments: `state` and `next`.\n\n The `state` parameter is simply an empty object which allows the `before`,\n `after`, and `code` snippets to share state.\n\n Notes:\n\n - Snippets always run in strict mode.\n - Always verify results. Doing so prevents the compiler from performing dead\n code elimination and other optimization techniques, which would render\n timing results meaningless.\n - Executed code is not sandboxed and has access to the global state. You are\n strongly advised against timing untrusted code. To time untrusted code,\n do so in an isolated environment (e.g., a separate process with restricted\n access to both global state and the host environment).\n - Wrapping asynchronous code does add overhead, but, in most cases, the\n overhead should be negligible compared to the execution cost of the timed\n snippet.\n - When the `asynchronous` options is `true`, ensure that the main `code`\n snippet is actually asynchronous. If a snippet releases the zalgo, an\n error complaining about exceeding the maximum call stack size is highly\n likely.\n - While many benchmark frameworks calculate various statistics over raw\n timing results (e.g., mean and standard deviation), do not do this.\n Instead, consider the fastest time an approximate lower bound for how fast\n an environment can execute a snippet. Slower times are more likely\n attributable to other processes interfering with timing accuracy rather\n than attributable to variability in JavaScript's speed. In which case, the\n minimum time is most likely the only result of interest. When considering\n all raw timing results, apply common sense rather than statistics.\n\n Parameters\n ----------\n code: string\n Snippet to time.\n\n options: Object (optional)\n Options.\n\n options.before: string (optional)\n Setup code. Default: `''`.\n\n options.after: string (optional)\n Cleanup code. Default: `''`.\n\n options.iterations: integer|null (optional)\n Number of iterations. If `null`, the number of iterations is determined\n by trying successive powers of `10` until the total time is at least\n `0.1` seconds. Default: `1e6`.\n\n options.repeats: integer (optional)\n Number of repeats. Default: `3`.\n\n options.asynchronous: boolean (optional)\n Boolean indicating whether a snippet is asynchronous. Default: `false`.\n\n clbk: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > var code = 'var x = Math.pow( Math.random(), 3 );';\n > code += 'if ( x !== x ) {';\n > code += 'throw new Error( \\'Something went wrong.\\' );';\n > code += '}';\n > function done( error, results ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.dir( results );\n ... };\n > timeit( code, done )\n e.g.,\n {\n \"iterations\": 1000000,\n \"repeats\": 3,\n \"min\": [ 0, 135734733 ], // [seconds,nanoseconds]\n \"elapsed\": 0.135734733, // seconds\n \"rate\": 7367311.062526641, // iterations/second\n \"times\": [ // raw timing results\n [ 0, 145641393 ],\n [ 0, 135734733 ],\n [ 0, 140462721 ]\n ]\n }\n\n",
"tmpdir": "\ntmpdir()\n Returns the directory for storing temporary files.\n\n Returns\n -------\n dir: string\n Directory for temporary files.\n\n Examples\n --------\n > var dir = tmpdir()\n e.g., '/path/to/temporary/files/directory'\n\n See Also\n --------\n configdir, homedir\n",
"toc": "\ntoc( time )\n Returns a high-resolution time difference, where `time` is a two-element\n array with format `[seconds, nanoseconds]`.\n\n Similar to `time`, the returned array has format `[seconds, nanoseconds]`.\n\n Parameters\n ----------\n time: Array<integer>\n High-resolution time.\n\n Returns\n -------\n out: Array<integer>\n High resolution time difference.\n\n Examples\n --------\n > var start = tic();\n > var delta = toc( start )\n [ <number>, <number> ]\n\n See Also\n --------\n tic\n",
"tokenize": "\ntokenize( str[, keepWhitespace] )\n Tokenizes a string.\n\n To include whitespace characters (spaces, tabs, line breaks) in the output\n array, set `keepWhitespace` to `true`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n keepWhitespace: boolean (optional)\n Boolean indicating whether whitespace characters should be returned as\n part of the token array. Default: `false`.\n\n Returns\n -------\n out: Array\n Array of tokens.\n\n Examples\n --------\n > var out = tokenize( 'Hello Mrs. Maple, could you call me back?' )\n [ 'Hello', 'Mrs.', 'Maple', ',', 'could', 'you', 'call', 'me', 'back', '?' ]\n\n > out = tokenize( 'Hello World!', true )\n [ 'Hello', ' ', 'World', '!' ]\n\n",
"transformStream": "\ntransformStream( [options] )\n Returns a transform stream.\n\n If a transform function is not provided, the returned stream will be a\n simple pass through stream.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n stream: TransformStream\n Transform stream.\n\n Examples\n --------\n > var s = transformStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ntransformStream.factory( [options] )\n Returns a function for creating transform streams.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n createStream( transform[, flush] ): Function\n Function for creating transform streams.\n\n Examples\n --------\n > var opts = { 'highWaterMark': 64 };\n > var createStream = transformStream.factory( opts );\n > function fcn( chunk, enc, cb ) { cb( null, chunk.toString()+'-beep' ); };\n > var s = createStream( fcn );\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n\ntransformStream.objectMode( [options] )\n Returns an \"objectMode\" transform stream.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n stream: TransformStream\n Transform stream operating in \"objectMode\".\n\n Examples\n --------\n > var s = transformStream.objectMode();\n > s.write( { 'value': 'a' } );\n > s.write( { 'value': 'b' } );\n > s.write( { 'value': 'c' } );\n > s.end();\n\n\ntransformStream.ctor( [options] )\n Returns a custom transform stream constructor.\n\n If provided `transform` and `flush` options, these methods are bound to the\n constructor prototype.\n\n If not provided a transform function, the returned constructor creates\n simple pass through streams.\n\n The returned constructor accepts the same options as the constructor\n factory, *except* for the `transform` and `flush` options, which are not\n supported.\n\n Any options provided to the constructor *override* options provided to the\n constructor factory.\n\n Parameters\n ----------\n options: Object (optional)\n Options.\n\n options.transform: Function (optional)\n Callback to invoke upon receiving a new chunk.\n\n options.flush: Function (optional)\n Callback to invoke after receiving all chunks and prior to a stream\n closing.\n\n options.objectMode: boolean (optional)\n Specifies whether a stream should operate in \"objectMode\". Default:\n false.\n\n options.highWaterMark: integer (optional)\n Specifies the maximum number of bytes to store in an internal buffer\n before ceasing to push downstream.\n\n options.allowHalfOpen: boolean (optional)\n Specifies whether a stream should remain open even if one side ends.\n Default: false.\n\n options.decodeStrings: boolean (optional)\n Specifies whether to decode strings into Buffer objects when writing.\n Default: true.\n\n Returns\n -------\n ctor: Function\n Custom transform stream constructor.\n\n Examples\n --------\n > function fcn( chunk, enc, cb ) { cb( null, chunk.toString()+'-beep' ); };\n > var opts = { 'highWaterMark': 64, 'transform': fcn };\n > var customStream = transformStream.ctor( opts );\n > var s = customStream();\n > s.write( 'a' );\n > s.write( 'b' );\n > s.write( 'c' );\n > s.end();\n\n",
"trim": "\ntrim( str )\n Trims whitespace from the beginning and end of a `string`.\n\n \"Whitespace\" is defined as the following characters:\n\n - \\f\n - \\n\n - \\r\n - \\t\n - \\v\n - \\u0020\n - \\u00a0\n - \\u1680\n - \\u2000-\\u200a\n - \\u2028\n - \\u2029\n - \\u202f\n - \\u205f\n - \\u3000\n - \\ufeff\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Trimmed string.\n\n Examples\n --------\n > var out = trim( ' \\t\\t\\n Beep \\r\\n\\t ' )\n 'Beep'\n\n See Also\n --------\n ltrim, pad, rtrim\n",
"trycatch": "\ntrycatch( x, y )\n If a function does not throw, returns the function return value; otherwise,\n returns `y`.\n\n Parameters\n ----------\n x: Function\n Function to try invoking.\n\n y: any\n Value to return if a function throws an error.\n\n Returns\n -------\n z: any\n Either the return value of `x` or the provided argument `y`.\n\n Examples\n --------\n > function x() {\n ... if ( base.random.randu() < 0.5 ) {\n ... throw new Error( 'beep' );\n ... }\n ... return 1.0;\n ... };\n > var z = trycatch( x, -1.0 )\n <number>\n\n See Also\n --------\n trycatchAsync, trythen\n",
"trycatchAsync": "\ntrycatchAsync( x, y, done )\n If a function does not return an error, invokes a callback with the function\n result; otherwise, invokes a callback with a value `y`.\n\n A function `x` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts two arguments:\n\n - error: error object\n - result: function result\n\n The `done` callback is invoked upon function completion and is provided two\n arguments:\n\n - error: error object\n - result: either the result of `x` or the provided argument `y`\n\n If `x` invokes `clbk` with an error argument, the function invokes the\n `done` callback with both the error and the argument `y`.\n\n If `x` does not invoke `clbk` with an error argument, the function invokes\n the `done` callback with a first argument equal to `null` and the function\n `result`.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n x: Function\n Function to invoke.\n\n y: any\n Value to return if `x` returns an error.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( new Error( 'beep' ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... // process error...\n ... }\n ... console.log( result );\n ... };\n > trycatchAsync( x, 'boop', done )\n 'boop'\n\n See Also\n --------\n trycatch, trythenAsync\n",
"tryFunction": "\ntryFunction( fcn[, thisArg] )\n Wraps a function in a try/catch block.\n\n If provided an asynchronous function, the returned function only traps\n errors which occur during the current event loop tick.\n\n If a function throws a literal, the literal is serialized as a string and\n returned as an `Error` object.\n\n Parameters\n ----------\n fcn: Function\n Function to wrap.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n out: Function\n Wrapped function.\n\n Examples\n --------\n > function fcn() { throw new Error( 'beep boop' ); };\n > var f = tryFunction( fcn );\n > var out = f();\n > out.message\n 'beep boop'\n\n",
"tryRequire": "\ntryRequire( id )\n Wraps `require` in a `try/catch` block.\n\n This function traps and returns any errors encountered when attempting to\n require a module.\n\n Use caution when attempting to resolve a relative path or a local module.\n This function attempts to resolve a module from its current path. Thus, the\n function is unable to resolve anything which is not along its search path.\n For local requires, use an absolute file path.\n\n Parameters\n ----------\n id: string\n Module id.\n\n Returns\n -------\n out: any|Error\n Resolved module or an `Error`.\n\n Examples\n --------\n > var out = tryRequire( '_unknown_module_id_' )\n <Error>\n\n",
"trythen": "\ntrythen( x, y )\n If a function does not throw, returns the function return value; otherwise,\n returns the value returned by a second function `y`.\n\n The function `y` is provided a single argument:\n\n - error: the error thrown by `x`\n\n Parameters\n ----------\n x: Function\n Function to try invoking.\n\n y: Function\n Function to invoke if an initial function throws an error.\n\n Returns\n -------\n z: any\n The return value of either `x` or `y`.\n\n Examples\n --------\n > function x() {\n ... if ( base.random.randu() < 0.5 ) {\n ... throw new Error( 'beep' );\n ... }\n ... return 1.0;\n ... };\n > function y() {\n ... return -1.0;\n ... };\n > var z = trythen( x, y )\n <number>\n\n See Also\n --------\n trycatch, trythenAsync\n",
"trythenAsync": "\ntrythenAsync( x, y, done )\n If a function does not return an error, invokes a callback with the function\n result; otherwise, invokes a second function `y`.\n\n A function `x` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the function invokes a `done` callback with\n its first argument as `null` and all other provided arguments.\n\n If the error argument is truthy, the function invokes a function `y`. The\n number of arguments provided to `y` depends on the function's length. If `y`\n is a unary function, `y` is provided a single argument:\n\n - clbk: callback to invoke upon function completion\n\n Otherwise, `y` is provided two arguments:\n\n - error: the error from `x`\n - clbk: callback to invoke upon function completion\n\n The callback function accepts any number of arguments, with the first\n argument reserved for providing an error.\n\n If the error argument is falsy, the `done` callback is invoked with its\n first argument equal to `null` and all other arguments provided by `y`.\n\n If the error argument is truthy, the `done` callback is invoked with only\n the error argument provided by `y`.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n x: Function\n Function to invoke.\n\n y: Function\n Function to invoke if `x` returns an error.\n\n done: Function\n Callback to invoke upon completion.\n\n Examples\n --------\n > function x( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( new Error( 'beep' ) );\n ... }\n ... };\n > function y( clbk ) {\n ... setTimeout( onTimeout, 0 );\n ... function onTimeout() {\n ... clbk( null, 'boop' );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > trythenAsync( x, y, done )\n 'boop'\n\n See Also\n --------\n trycatchAsync, trythen\n",
"ttest": "\nttest( x[, y][, options] )\n Computes a one-sample or paired Student's t test.\n\n When no `y` is supplied, the function performs a one-sample t-test for the\n null hypothesis that the data in array or typed array `x` is drawn from a\n normal distribution with mean zero and unknown variance.\n\n When array or typed array `y` is supplied, the function tests whether the\n differences `x - y` come from a normal distribution with mean zero and\n unknown variance via the paired t-test.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n Data array.\n\n y: Array<number> (optional)\n Paired data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.mu: number (optional)\n Hypothesized true mean under the null hypothesis. Set this option to\n test whether the data comes from a distribution with the specified `mu`.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed mean under H0 (or difference in means when `y` is supplied).\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.df: number\n Degrees of freedom.\n\n out.mean: number\n Sample mean of `x` or `x - y`, respectively.\n\n out.sd: number\n Standard error of the mean.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // One-sample t-test:\n > var rnorm = base.random.normal.factory( 0.0, 2.0, { 'seed': 5776 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... }\n > var out = ttest( x )\n {\n rejected: false,\n pValue: ~0.722,\n statistic: ~0.357,\n ci: [~-0.333,~0.479],\n // ...\n }\n\n // Paired t-test:\n > rnorm = base.random.normal.factory( 1.0, 2.0, { 'seed': 786 });\n > x = new Array( 100 );\n > var y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... y[ i ] = rnorm();\n ... }\n > out = ttest( x, y )\n {\n rejected: false,\n pValue: ~0.191,\n statistic: ~1.315,\n ci: [ ~-0.196, ~0.964 ],\n // ...\n }\n\n // Print formatted output:\n > var table = out.print()\n Paired t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.1916\n statistic: 1.3148\n df: 99\n 95% confidence interval: [-0.1955,0.9635]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose custom significance level:\n > arr = [ 2, 4, 3, 1, 0 ];\n > out = ttest( arr, { 'alpha': 0.01 });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is not equal to 0\n\n pValue: 0.0474\n statistic: 2.8284\n df: 4\n 99% confidence interval: [-1.2556,5.2556]\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n // Test for a mean equal to five:\n > var arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'mu': 5 })\n {\n rejected: false,\n pValue: 1,\n statistic: 0,\n ci: [ ~3.758, ~6.242 ],\n // ...\n }\n\n // Perform one-sided tests:\n > arr = [ 4, 4, 6, 6, 5 ];\n > out = ttest( arr, { 'alternative': 'less' });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is less than 0\n\n pValue: 0.9998\n statistic: 11.1803\n df: 4\n 95% confidence interval: [-Infinity,5.9534]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n > out = ttest( arr, { 'alternative': 'greater' });\n > table = out.print()\n One-sample t-test\n\n Alternative hypothesis: True mean is greater than 0\n\n pValue: 0.0002\n statistic: 11.1803\n df: 4\n 95% confidence interval: [4.0466,Infinity]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n See Also\n --------\n ttest2\n",
"ttest2": "\nttest2( x, y[, options] )\n Computes a two-sample Student's t test.\n\n By default, the function performs a two-sample t-test for the null\n hypothesis that the data in arrays or typed arrays `x` and `y` is\n independently drawn from normal distributions with equal means.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.difference: number (optional)\n Number denoting the difference in means under the null hypothesis.\n Default: `0`.\n\n options.variance: string (optional)\n String indicating if the test should be conducted under the assumption\n that the unknown variances of the normal distributions are `equal` or\n `unequal`. As a default choice, the function carries out the Welch test\n (using the Satterthwaite approximation for the degrees of freedom),\n which does not have the requirement that the variances of the underlying\n distributions are equal. If the equal variances assumption seems\n warranted, set the option to `equal`. Default: `unequal`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed difference in means under H0.\n\n out.xmean: number\n Sample mean of `x`.\n\n out.ymean: number\n Sample mean of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.df: number\n Degrees of freedom.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Student's sleep data:\n > var x = [ 0.7, -1.6, -0.2, -1.2, -0.1, 3.4, 3.7, 0.8, 0.0, 2.0 ];\n > var y = [ 1.9, 0.8, 1.1, 0.1, -0.1, 4.4, 5.5, 1.6, 4.6, 3.4 ];\n > var out = ttest2( x, y )\n {\n rejected: false,\n pValue: ~0.079,\n statistic: ~-1.861,\n ci: [ ~-3.365, ~0.205 ],\n // ...\n }\n\n // Print table output:\n > var table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 95% confidence interval: [-3.3655,0.2055]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose a different significance level than `0.05`:\n > out = ttest2( x, y, { 'alpha': 0.1 });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.0794\n statistic: -1.8608\n 90% confidence interval: [-3.0534,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 10% significance level\n\n // Perform one-sided tests:\n > out = ttest2( x, y, { 'alternative': 'less' });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is less than 0\n\n pValue: 0.0397\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-Infinity,-0.1066]\n\n Test Decision: Reject null in favor of alternative at 5% significance level\n\n > out = ttest2( x, y, { 'alternative': 'greater' });\n > table = out.print()\n Welch two-sample t-test\n\n Alternative hypothesis: True difference in means is greater than 0\n\n pValue: 0.9603\n statistic: -1.8608\n df: 17.7765\n 95% confidence interval: [-3.0534,Infinity]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Run tests with equal variances assumption:\n > x = [ 2, 3, 1, 4 ];\n > y = [ 1, 2, 3, 1, 2, 5, 3, 4 ];\n > out = ttest2( x, y, { 'variance': 'equal' });\n > table = out.print()\n Two-sample t-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.8848\n statistic: -0.1486\n df: 10\n 95% confidence interval: [-1.9996,1.7496]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Test for a difference in means besides zero:\n > var rnorm = base.random.normal.factory({ 'seed': 372 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm( 2.0, 3.0 );\n ... }\n > y = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... y[ i ] = rnorm( 1.0, 3.0 );\n ... }\n > out = ttest2( x, y, { 'difference': 1.0, 'variance': 'equal' })\n {\n rejected: false,\n pValue: ~0.642,\n statistic: ~-0.466,\n ci: [ ~-0.0455, ~1.646 ],\n // ...\n }\n\n See Also\n --------\n ttest\n",
"TWO_PI": "\nTWO_PI\n The mathematical constant `π` times `2`.\n\n Examples\n --------\n > TWO_PI\n 6.283185307179586\n\n See Also\n --------\n PI\n",
"typedarray": "\ntypedarray( [dtype] )\n Creates a typed array.\n\n The function supports the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n The default typed array data type is `float64`.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray()\n <Float64Array>\n > arr = typedarray( 'float32' )\n <Float32Array>\n\n\ntypedarray( length[, dtype] )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr = typedarray( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarray( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarray( typedarray[, dtype] )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = typedarray( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( obj[, dtype] )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarray( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarray( buffer[, byteOffset[, length]][, dtype] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = typedarray( buf, 0, 4, 'float32' )\n <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]\n\n See Also\n --------\n Float64Array, Float32Array, Int32Array, Uint32Array, Int16Array, Uint16Array, Int8Array, Uint8Array, Uint8ClampedArray\n",
"typedarray2json": "\ntypedarray2json( arr )\n Returns a JSON representation of a typed array.\n\n The following typed array types are supported:\n\n - Float64Array\n - Float32Array\n - Int32Array\n - Uint32Array\n - Int16Array\n - Uint16Array\n - Int8Array\n - Uint8Array\n - Uint8ClampedArray\n\n The returned JSON object has the following properties:\n\n - type: typed array type\n - data: typed array data as a generic array\n\n The implementation supports custom typed arrays and sets the `type` field to\n the closest known typed array type.\n\n Parameters\n ----------\n arr: TypedArray\n Typed array to serialize.\n\n Returns\n -------\n out: Object\n JSON representation.\n\n Examples\n --------\n > var arr = new Float64Array( 2 );\n > arr[ 0 ] = 5.0;\n > arr[ 1 ] = 3.0;\n > var json = typedarray2json( arr )\n { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n\n See Also\n --------\n reviveTypedArray\n",
"typedarrayComplexCtors": "\ntypedarrayComplexCtors( dtype )\n Returns a complex typed array constructor.\n\n The function returns constructors for the following data types:\n\n - complex64: single-precision floating-point complex numbers.\n - complex128: double-precision floating-point complex numbers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Complex typed array constructor.\n\n Examples\n --------\n > var ctor = typedarrayComplexCtors( 'complex64' )\n <Function>\n > ctor = typedarrayComplexCtors( 'float32' )\n null\n\n See Also\n --------\n arrayCtors, typedarrayCtors\n",
"typedarrayComplexDataTypes": "\ntypedarrayComplexDataTypes()\n Returns a list of complex typed array data types.\n\n The output array contains the following data types:\n\n - complex64: single-precision floating-point complex numbers.\n - complex128: double-precision floating-point complex numbers.\n\n Returns\n -------\n out: Array<string>\n List of complex typed array data types.\n\n Examples\n --------\n > var out = typedarrayComplexDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, typedarrayDataTypes, ndarrayDataTypes\n",
"typedarrayCtors": "\ntypedarrayCtors( dtype )\n Returns a typed array constructor.\n\n The function returns constructors for the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Parameters\n ----------\n dtype: string\n Data type.\n\n Returns\n -------\n out: Function|null\n Typed array constructor.\n\n Examples\n --------\n > var ctor = typedarrayCtors( 'float64' )\n <Function>\n > ctor = typedarrayCtors( 'float' )\n null\n\n See Also\n --------\n arrayCtors\n",
"typedarrayDataTypes": "\ntypedarrayDataTypes()\n Returns a list of typed array data types.\n\n The output array contains the following data types:\n\n - float32: single-precision floating-point numbers.\n - float64: double-precision floating-point numbers.\n - int16: signed 16-bit integers.\n - int32: signed 32-bit integers.\n - int8: signed 8-bit integers.\n - uint16: unsigned 16-bit integers.\n - uint32: unsigned 32-bit integers.\n - uint8: unsigned 8-bit integers.\n - uint8c: unsigned clamped 8-bit integers.\n\n Returns\n -------\n out: Array<string>\n List of typed array data types.\n\n Examples\n --------\n > var out = typedarrayDataTypes()\n <Array>\n\n See Also\n --------\n arrayDataTypes, ndarrayDataTypes\n",
"typedarraypool": "\ntypedarraypool( [dtype] )\n Returns an uninitialized typed array from a typed array memory pool.\n\n Memory is **uninitialized**, which means that the contents of a returned\n typed array may contain sensitive contents.\n\n The function supports the following data types:\n\n - float64: double-precision floating-point numbers (IEEE 754)\n - float32: single-precision floating-point numbers (IEEE 754)\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n The default typed array data type is `float64`.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool()\n <Float64Array>[]\n > arr = typedarraypool( 'float32' )\n <Float32Array>[]\n\n\ntypedarraypool( length[, dtype] )\n Returns an uninitialized typed array having a specified length from a typed\n array memory pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > arr = typedarraypool( 5, 'int32' )\n <Int32Array>\n\n\ntypedarraypool( typedarray[, dtype] )\n Creates a pooled typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = typedarraypool( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarraypool( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool( obj[, dtype] )\n Creates a pooled typed array from an array-like object.\n\n Parameters\n ----------\n obj: Object\n Array-like object from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarraypool( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.malloc( [dtype] )\n Returns an uninitialized typed array from a typed array memory pool.\n\n This method shares the same security vulnerabilities mentioned above.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.malloc()\n <Float64Array>\n > arr = typedarraypool.malloc( 'float32' )\n <Float32Array>\n\n\ntypedarraypool.malloc( length[, dtype] )\n Returns a typed array having a specified length from a typed array memory\n pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.malloc( 5 )\n <Float64Array>\n > arr = typedarraypool.malloc( 5, 'int32' )\n <Int32Array>\n\n\ntypedarraypool.malloc( typedarray[, dtype] )\n Creates a pooled typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = typedarraypool.malloc( [ 0.5, 0.5, 0.5 ] );\n > var arr2 = typedarraypool.malloc( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.malloc( obj[, dtype] )\n Creates a pooled typed array from an array-like object.\n\n Parameters\n ----------\n obj: Object\n Array-like object from which to generate a typed array.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr1 = [ 0.5, 0.5, 0.5 ];\n > var arr2 = typedarraypool.malloc( arr1, 'float32' )\n <Float32Array>[ 0.5, 0.5, 0.5 ]\n\n\ntypedarraypool.calloc( [dtype] )\n Returns a zero-initialized typed array from a typed array memory pool.\n\n Parameters\n ----------\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.calloc()\n <Float64Array>[]\n > arr = typedarraypool.calloc( 'float32' )\n <Float32Array>[]\n\n\ntypedarraypool.calloc( length[, dtype] )\n Returns a zero-initialized typed array having a specified length from a\n typed array memory pool.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n dtype: string (optional)\n Data type. Default: 'float64'.\n\n Returns\n -------\n out: TypedArray|null\n If the function is unable to allocate a typed array from the typed array\n pool (e.g., due to insufficient memory), the function returns `null`.\n\n Examples\n --------\n > var arr = typedarraypool.calloc( 5 )\n <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]\n > arr = typedarraypool.calloc( 5, 'int32' )\n <Int32Array>[ 0, 0, 0, 0, 0 ]\n\n\ntypedarraypool.free( buf )\n Frees a typed array or typed array buffer for use in a future allocation.\n\n Parameters\n ----------\n buf: TypedArray|ArrayBuffer\n Typed array or typed array buffer to free.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.free( arr )\n\n\ntypedarraypool.clear()\n Clears the typed array pool allowing garbage collection of previously\n allocated (and currently free) array buffers.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.free( arr );\n > typedarraypool.clear()\n\n\ntypedarraypool.highWaterMark\n Read-only property returning the pool's high water mark.\n\n Once a high water mark is reached, typed array allocation fails.\n\n Examples\n --------\n > typedarraypool.highWaterMark\n\n\ntypedarraypool.nbytes\n Read-only property returning the total number of allocated bytes.\n\n The returned value is the total accumulated value. Hence, anytime a pool\n must allocate a new array buffer (i.e., more memory), the pool increments\n this value.\n\n The only time this value is decremented is when a pool is cleared.\n\n This behavior means that, while allocated buffers which are never freed may,\n in fact, be garbage collected, they continue to count against the high water\n mark limit.\n\n Accordingly, you should *always* free allocated buffers in order to prevent\n the pool from believing that non-freed buffers are continually in use.\n\n Examples\n --------\n > var arr = typedarraypool( 5 )\n <Float64Array>\n > typedarraypool.nbytes\n\n\ntypedarraypool.factory( [options] )\n Creates a typed array pool.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.highWaterMark: integer (optional)\n Maximum total memory (in bytes) which can be allocated.\n\n Returns\n -------\n fcn: Function\n Function for creating typed arrays from a typed array memory pool.\n\n Examples\n --------\n > var pool = typedarraypool.factory();\n > var arr1 = pool( 3, 'float64' )\n <Float64Array>\n\n See Also\n --------\n typedarray\n",
"typemax": "\ntypemax( dtype )\n Returns the maximum value of a specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Maximum value.\n\n Examples\n --------\n > var m = typemax( 'int8' )\n 127\n > m = typemax( 'uint32' )\n 4294967295\n\n See Also\n --------\n realmax, typemin\n",
"typemin": "\ntypemin( dtype )\n Returns the minimum value of a specified numeric type.\n\n The following numeric types are supported:\n\n - float64: double-precision floating-point numbers\n - float32: single-precision floating-point numbers\n - float16: half-precision floating-point numbers\n - int32: 32-bit two's complement signed integers\n - uint32: 32-bit unsigned integers\n - int16: 16-bit two's complement signed integers\n - uint16: 16-bit unsigned integers\n - int8: 8-bit two's complement signed integers\n - uint8: 8-bit unsigned integers\n - uint8c: 8-bit unsigned integers clamped to 0-255\n\n Parameters\n ----------\n dtype: string\n Numeric type.\n\n Returns\n -------\n out: number\n Minimum value.\n\n Examples\n --------\n > var m = typemin( 'int8' )\n -128\n > m = typemin( 'uint32' )\n 0\n\n See Also\n --------\n realmin, typemax\n",
"typeOf": "\ntypeOf( value )\n Determines a value's type.\n\n The following values are not natively provided in older JavaScript engines:\n\n - Map\n - Set\n - WeakMap\n - WeakSet\n - Symbol\n\n Parameters\n ----------\n value: any\n Input value.\n\n Returns\n -------\n out: string\n The value's type.\n\n Examples\n --------\n // Built-ins:\n > var t = typeOf( 'a' )\n 'string'\n > t = typeOf( 5 )\n 'number'\n > t = typeOf( NaN )\n 'number'\n > t = typeOf( true )\n 'boolean'\n > t = typeOf( false )\n 'boolean'\n > t = typeOf( null )\n 'null'\n > t = typeOf( undefined )\n 'undefined'\n > t = typeOf( [] )\n 'array'\n > t = typeOf( {} )\n 'object'\n > t = typeOf( function noop() {} )\n 'function'\n > t = typeOf( Symbol( 'beep' ) )\n 'symbol'\n > t = typeOf( /.+/ )\n 'regexp'\n > t = typeOf( new String( 'beep' ) )\n 'string'\n > t = typeOf( new Number( 5 ) )\n 'number'\n > t = typeOf( new Boolean( false ) )\n 'boolean'\n > t = typeOf( new Array() )\n 'array'\n > t = typeOf( new Object() )\n 'object'\n > t = typeOf( new Int8Array( 10 ) )\n 'int8array'\n > t = typeOf( new Uint8Array( 10 ) )\n 'uint8array'\n > t = typeOf( new Uint8ClampedArray( 10 ) )\n 'uint8clampedarray'\n > t = typeOf( new Int16Array( 10 ) )\n 'int16array'\n > t = typeOf( new Uint16Array( 10 ) )\n 'uint16array'\n > t = typeOf( new Int32Array( 10 ) )\n 'int32array'\n > t = typeOf( new Uint32Array( 10 ) )\n 'uint32array'\n > t = typeOf( new Float32Array( 10 ) )\n 'float32array'\n > t = typeOf( new Float64Array( 10 ) )\n 'float64array'\n > t = typeOf( new ArrayBuffer( 10 ) )\n 'arraybuffer'\n > t = typeOf( new Date() )\n 'date'\n > t = typeOf( new RegExp( '.+' ) )\n 'regexp'\n > t = typeOf( new Map() )\n 'map'\n > t = typeOf( new Set() )\n 'set'\n > t = typeOf( new WeakMap() )\n 'weakmap'\n > t = typeOf( new WeakSet() )\n 'weakset'\n > t = typeOf( new Error( 'beep' ) )\n 'error'\n > t = typeOf( new TypeError( 'beep' ) )\n 'typeerror'\n > t = typeOf( new SyntaxError( 'beep' ) )\n 'syntaxerror'\n > t = typeOf( new ReferenceError( 'beep' ) )\n 'referenceerror'\n > t = typeOf( new URIError( 'beep' ) )\n 'urierror'\n > t = typeOf( new RangeError( 'beep' ) )\n 'rangeerror'\n > t = typeOf( new EvalError( 'beep' ) )\n 'evalerror'\n > t = typeOf( Math )\n 'math'\n > t = typeOf( JSON )\n 'json'\n\n // Arguments object:\n > function beep() { return arguments; };\n > t = typeOf( beep() )\n 'arguments'\n\n // Node.js Buffer object:\n > t = typeOf( new Buffer( 10 ) )\n 'buffer'\n\n // Custom constructor:\n > function Person() { return this };\n > t = typeOf( new Person() )\n 'person'\n\n // Anonymous constructor:\n > var Foo = function () { return this; };\n > t = typeOf( new Foo() )\n '' || 'foo'\n\n See Also\n --------\n constructorName, nativeClass\n",
"UINT8_MAX": "\nUINT8_MAX\n Maximum unsigned 8-bit integer.\n\n The maximum unsigned 8-bit integer is given by `2^8 - 1`.\n\n Examples\n --------\n > UINT8_MAX\n 255\n\n See Also\n --------\n INT8_MAX\n",
"UINT8_NUM_BYTES": "\nUINT8_NUM_BYTES\n Size (in bytes) of an 8-bit unsigned integer.\n\n Examples\n --------\n > UINT8_NUM_BYTES\n 1\n\n See Also\n --------\n INT8_NUM_BYTES, UINT16_NUM_BYTES, UINT32_NUM_BYTES\n",
"Uint8Array": "\nUint8Array()\n A typed array constructor which returns a typed array representing an array\n of 8-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8Array()\n <Uint8Array>\n\n\nUint8Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 )\n <Uint8Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint8Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint8Array( arr1 )\n <Uint8Array>[ 5, 5, 5 ]\n\n\nUint8Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint8Array( arr1 )\n <Uint8Array>[ 5, 5, 5 ]\n\n\nUint8Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Uint8Array( buf, 0, 4 )\n <Uint8Array>[ 0, 0, 0, 0 ]\n\n\nUint8Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint8Array.from( [ 1, 2 ], mapFcn )\n <Uint8Array>[ 2, 4 ]\n\n\nUint8Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint8Array.of( 1, 2 )\n <Uint8Array>[ 1, 2 ]\n\n\nUint8Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint8Array.BYTES_PER_ELEMENT\n 1\n\n\nUint8Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint8Array.name\n 'Uint8Array'\n\n\nUint8Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint8Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.byteLength\n 5\n\n\nUint8Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint8Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nUint8Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint8Array( 5 );\n > arr.length\n 5\n\n\nUint8Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint8Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint8Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint8Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint8Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint8Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint8Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint8Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint8Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint8Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint8Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint8Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint8Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint8Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint8Array>[ 2, 4, 6 ]\n\n\nUint8Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint8Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint8Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] )\n <Uint8Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint8Array>[ 3, 2, 1 ]\n\n\nUint8Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint8Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint8Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint8Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint8Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint8Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint8Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint8Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint8Array>[ 3, 4, 5 ]\n\n\nUint8Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint8Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint8Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint8Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8ClampedArray\n",
"Uint8ClampedArray": "\nUint8ClampedArray()\n A typed array constructor which returns a typed array representing an array\n of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray()\n <Uint8ClampedArray>\n\n\nUint8ClampedArray( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 )\n <Uint8ClampedArray>[ 0, 0, 0, 0, 0 ]\n\n\nUint8ClampedArray( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint8ClampedArray( arr1 )\n <Uint8ClampedArray>[ 5, 5, 5 ]\n\n\nUint8ClampedArray( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint8ClampedArray( arr1 )\n <Uint8ClampedArray>[ 5, 5, 5 ]\n\n\nUint8ClampedArray( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 4 );\n > var arr = new Uint8ClampedArray( buf, 0, 4 )\n <Uint8ClampedArray>[ 0, 0, 0, 0 ]\n\n\nUint8ClampedArray.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint8ClampedArray.from( [ 1, 2 ], mapFcn )\n <Uint8ClampedArray>[ 2, 4 ]\n\n\nUint8ClampedArray.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr = Uint8ClampedArray.of( 1, 2 )\n <Uint8ClampedArray>[ 1, 2 ]\n\n\nUint8ClampedArray.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint8ClampedArray.BYTES_PER_ELEMENT\n 1\n\n\nUint8ClampedArray.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint8ClampedArray.name\n 'Uint8ClampedArray'\n\n\nUint8ClampedArray.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint8ClampedArray.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.byteLength\n 5\n\n\nUint8ClampedArray.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.byteOffset\n 0\n\n\nUint8ClampedArray.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.BYTES_PER_ELEMENT\n 1\n\n\nUint8ClampedArray.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( 5 );\n > arr.length\n 5\n\n\nUint8ClampedArray.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint8ClampedArray.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint8ClampedArray.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint8ClampedArray.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint8ClampedArray.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint8ClampedArray.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint8ClampedArray.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint8ClampedArray.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint8ClampedArray.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint8ClampedArray.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint8ClampedArray.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint8ClampedArray.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint8ClampedArray.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint8ClampedArray.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint8ClampedArray>[ 2, 4, 6 ]\n\n\nUint8ClampedArray.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint8ClampedArray.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint8ClampedArray.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] )\n <Uint8ClampedArray>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint8ClampedArray>[ 3, 2, 1 ]\n\n\nUint8ClampedArray.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint8ClampedArray.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint8ClampedArray.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint8ClampedArray.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint8ClampedArray\n Modified array.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint8ClampedArray>[ 0, 1, 1, 2, 2 ]\n\n\nUint8ClampedArray.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint8ClampedArray\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint8ClampedArray( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint8ClampedArray>[ 3, 4, 5 ]\n\n\nUint8ClampedArray.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint8ClampedArray.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint8ClampedArray.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint8ClampedArray( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array\n",
"UINT16_MAX": "\nUINT16_MAX\n Maximum unsigned 16-bit integer.\n\n The maximum unsigned 16-bit integer is given by `2^16 - 1`.\n\n Examples\n --------\n > UINT16_MAX\n 65535\n\n See Also\n --------\n INT16_MAX\n",
"UINT16_NUM_BYTES": "\nUINT16_NUM_BYTES\n Size (in bytes) of a 16-bit unsigned integer.\n\n Examples\n --------\n > UINT16_NUM_BYTES\n 2\n\n See Also\n --------\n INT16_NUM_BYTES, UINT32_NUM_BYTES, UINT8_NUM_BYTES\n",
"Uint16Array": "\nUint16Array()\n A typed array constructor which returns a typed array representing an array\n of 16-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint16Array()\n <Uint16Array>\n\n\nUint16Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 )\n <Uint16Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint16Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint16Array( arr1 )\n <Uint16Array>[ 5, 5, 5 ]\n\n\nUint16Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint16Array( arr1 )\n <Uint16Array>[ 5, 5, 5 ]\n\n\nUint16Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 8 );\n > var arr = new Uint16Array( buf, 0, 4 )\n <Uint16Array>[ 0, 0, 0, 0 ]\n\n\nUint16Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint16Array.from( [ 1, 2 ], mapFcn )\n <Uint16Array>[ 2, 4 ]\n\n\nUint16Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint16Array.of( 1, 2 )\n <Uint16Array>[ 1, 2 ]\n\n\nUint16Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint16Array.BYTES_PER_ELEMENT\n 2\n\n\nUint16Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint16Array.name\n 'Uint16Array'\n\n\nUint16Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint16Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.byteLength\n 10\n\n\nUint16Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint16Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 2\n\n\nUint16Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint16Array( 5 );\n > arr.length\n 5\n\n\nUint16Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint16Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint16Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint16Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint16Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint16Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint16Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint16Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint16Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint16Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint16Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint16Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint16Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint16Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint16Array>[ 2, 4, 6 ]\n\n\nUint16Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint16Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint16Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] )\n <Uint16Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint16Array>[ 3, 2, 1 ]\n\n\nUint16Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint16Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint16Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint16Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint16Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint16Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint16Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint16Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint16Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint16Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint16Array>[ 3, 4, 5 ]\n\n\nUint16Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint16Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint16Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint16Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint32Array, Uint8Array, Uint8ClampedArray\n",
"UINT32_MAX": "\nUINT32_MAX\n Maximum unsigned 32-bit integer.\n\n The maximum unsigned 32-bit integer is given by `2^32 - 1`.\n\n Examples\n --------\n > UINT32_MAX\n 4294967295\n\n See Also\n --------\n INT32_MAX\n",
"UINT32_NUM_BYTES": "\nUINT32_NUM_BYTES\n Size (in bytes) of a 32-bit unsigned integer.\n\n Examples\n --------\n > UINT32_NUM_BYTES\n 4\n\n See Also\n --------\n INT32_NUM_BYTES, UINT16_NUM_BYTES, UINT8_NUM_BYTES\n",
"Uint32Array": "\nUint32Array()\n A typed array constructor which returns a typed array representing an array\n of 32-bit unsigned integers in the platform byte order.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint32Array()\n <Uint32Array>\n\n\nUint32Array( length )\n Returns a typed array having a specified length.\n\n Parameters\n ----------\n length: integer\n Typed array length.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 )\n <Uint32Array>[ 0, 0, 0, 0, 0 ]\n\n\nUint32Array( typedarray )\n Creates a typed array from another typed array.\n\n Parameters\n ----------\n typedarray: TypedArray\n Typed array from which to generate another typed array.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Int32Array( [ 5, 5, 5 ] );\n > var arr2 = new Uint32Array( arr1 )\n <Uint32Array>[ 5, 5, 5 ]\n\n\nUint32Array( obj )\n Creates a typed array from an array-like object or iterable.\n\n Parameters\n ----------\n obj: Object\n Array-like object or iterable from which to generate a typed array.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = [ 5.0, 5.0, 5.0 ];\n > var arr2 = new Uint32Array( arr1 )\n <Uint32Array>[ 5, 5, 5 ]\n\n\nUint32Array( buffer[, byteOffset[, length]] )\n Returns a typed array view of an ArrayBuffer.\n\n Parameters\n ----------\n buffer: ArrayBuffer\n Underlying ArrayBuffer.\n\n byteOffset: integer (optional)\n Integer byte offset specifying the location of the first typed array\n element. Default: 0.\n\n length: integer (optional)\n View length. If not provided, the view spans from the byteOffset to\n the end of the underlying ArrayBuffer.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var buf = new ArrayBuffer( 16 );\n > var arr = new Uint32Array( buf, 0, 4 )\n <Uint32Array>[ 0, 0, 0, 0 ]\n\n\nUint32Array.from( src[, map[, thisArg]] )\n Creates a new typed array from an array-like object or an iterable.\n\n A callback is provided the following arguments:\n\n - value: source value.\n - index: source index.\n\n Parameters\n ----------\n src: ArrayLike|Iterable\n Source of array elements.\n\n map: Function (optional)\n Callback to invoke for each source element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > function mapFcn( v ) { return v * 2; };\n > var arr = Uint32Array.from( [ 1, 2 ], mapFcn )\n <Uint32Array>[ 2, 4 ]\n\n\nUint32Array.of( element0[, element1[, ...[, elementN]]] )\n Creates a new typed array from a variable number of arguments.\n\n Parameters\n ----------\n element: number\n Array elements.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr = Uint32Array.of( 1, 2 )\n <Uint32Array>[ 1, 2 ]\n\n\nUint32Array.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > Uint32Array.BYTES_PER_ELEMENT\n 4\n\n\nUint32Array.name\n Typed array constructor name.\n\n Examples\n --------\n > Uint32Array.name\n 'Uint32Array'\n\n\nUint32Array.prototype.buffer\n Read-only property which returns the ArrayBuffer referenced by the typed\n array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.buffer\n <ArrayBuffer>\n\n\nUint32Array.prototype.byteLength\n Read-only property which returns the length (in bytes) of the typed array.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.byteLength\n 20\n\n\nUint32Array.prototype.byteOffset\n Read-only property which returns the offset (in bytes) of the typed array\n from the start of its ArrayBuffer.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.byteOffset\n 0\n\n\nUint32Array.prototype.BYTES_PER_ELEMENT\n Number of bytes per view element.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.BYTES_PER_ELEMENT\n 4\n\n\nUint32Array.prototype.length\n Read-only property which returns the number of view elements.\n\n Examples\n --------\n > var arr = new Uint32Array( 5 );\n > arr.length\n 5\n\n\nUint32Array.prototype.copyWithin( target, start[, end] )\n Copies a sequence of elements within the array starting at `start` and\n ending at `end` (non-inclusive) to the position starting at `target`.\n\n Parameters\n ----------\n target: integer\n Target start index position.\n\n start: integer\n Source start index position.\n\n end: integer (optional)\n Source end index position. Default: out.length.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3, 4, 5 ] );\n > arr.copyWithin( 3, 0, 2 );\n > arr[ 3 ]\n 1\n > arr[ 4 ]\n 2\n\n\nUint32Array.prototype.entries()\n Returns an iterator for iterating over array key-value pairs.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array key-value pairs.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.entries();\n > it.next().value\n [ 0, 1 ]\n > it.next().value\n [ 1, 2 ]\n > it.next().done\n true\n\n\nUint32Array.prototype.every( predicate[, thisArg] )\n Tests whether all array elements pass a test implemented by a predicate\n function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, an array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether all array elements pass.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v <= 1 ); };\n > arr.every( predicate )\n false\n\n\nUint32Array.prototype.fill( value[, start[, end]] )\n Fills an array from a start index to an end index (non-inclusive) with a\n provided value.\n\n Parameters\n ----------\n value: number\n Fill value.\n\n start: integer (optional)\n Start index. If less than zero, the start index is resolved relative to\n the last array element. Default: 0.\n\n end: integer (optional)\n End index (non-inclusive). If less than zero, the end index is resolved\n relative to the last array element. Default: out.length.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > arr.fill( 3 );\n > arr[ 0 ]\n 3\n > arr[ 1 ]\n 3\n\n\nUint32Array.prototype.filter( predicate[, thisArg] )\n Creates a new array which includes those elements for which a predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n If a predicate function does not return a truthy value for any array\n element, the method returns `null`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which filters array elements. If a predicate function\n returns a truthy value, an array element is included in the output\n array; otherwise, an array element is not included in the output array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > var arr2 = arr1.filter( predicate );\n > arr2.length\n 2\n\n\nUint32Array.prototype.find( predicate[, thisArg] )\n Returns the first array element for which a provided predicate function\n returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `undefined`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n value: number|undefined\n Array element.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var v = arr.find( predicate )\n 3\n\n\nUint32Array.prototype.findIndex( predicate[, thisArg] )\n Returns the index of the first array element for which a provided predicate\n function returns a truthy value.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n If a predicate function never returns a truthy value, the method returns\n `-1`.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function predicate( v ) { return ( v > 2 ); };\n > var idx = arr.findIndex( predicate )\n 2\n\n\nUint32Array.prototype.forEach( fcn[, thisArg] )\n Invokes a callback for each array element.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n fcn: Function\n Function to invoke for each array element.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 3, 2, 1 ] );\n > var str = ' ';\n > function fcn( v, i ) { str += i + ':' + v + ' '; };\n > arr.forEach( fcn );\n > str\n ' 0:3 1:2 2:1 '\n\n\nUint32Array.prototype.includes( searchElement[, fromIndex] )\n Returns a boolean indicating whether an array includes a search element.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether an array includes a search element.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > var bool = arr.includes( 4 )\n false\n > bool = arr.includes( 3 )\n true\n\n\nUint32Array.prototype.indexOf( searchElement[, fromIndex] )\n Returns the index of the first array element strictly equal to a search\n element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: 0.\n\n Returns\n -------\n idx: integer\n Array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > var idx = arr.indexOf( 4 )\n -1\n > idx = arr.indexOf( 3 )\n 2\n\n\nUint32Array.prototype.join( [separator] )\n Serializes an array by joining all array elements as a string.\n\n Parameters\n ----------\n separator: string (optional)\n String delineating array elements. Default: ','.\n\n Returns\n -------\n str: string\n Array serialized as a string.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.join( '|' )\n '1|2|3'\n\n\nUint32Array.prototype.keys()\n Returns an iterator for iterating over array keys.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array keys.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.keys();\n > it.next().value\n 0\n > it.next().value\n 1\n > it.next().done\n true\n\n\nUint32Array.prototype.lastIndexOf( searchElement[, fromIndex] )\n Returns the index of the last array element strictly equal to a search\n element.\n\n The method iterates from the last array element to the first array element.\n\n If unable to locate a search element, the method returns `-1`.\n\n Parameters\n ----------\n searchElement: number\n Search element.\n\n fromIndex: integer (optional)\n Array index from which to begin searching. If provided a negative value,\n the method resolves the start index relative to the last array element.\n Default: -1.\n\n Returns\n -------\n idx: integer\n array index.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 0, 2, 0, 1 ] );\n > var idx = arr.lastIndexOf( 3 )\n -1\n > idx = arr.lastIndexOf( 0 )\n 3\n\n\nUint32Array.prototype.map( fcn[, thisArg] )\n Maps each array element to an element in a new typed array.\n\n A provided function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n The returned array has the same data type as the host array.\n\n Parameters\n ----------\n fcn: Function\n Function which maps array elements to elements in the new array.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( v ) { return v * 2; };\n > var arr2 = arr1.map( fcn );\n <Uint32Array>[ 2, 4, 6 ]\n\n\nUint32Array.prototype.reduce( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the first array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the first array element as the first argument and the second array\n element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduce( fcn, 0 )\n 14\n\n\nUint32Array.prototype.reduceRight( fcn[, initialValue] )\n Applies a function against an accumulator and each element in an array and\n returns the accumulated result, iterating from right to left.\n\n The provided function is provided the following arguments:\n\n - acc: accumulated result.\n - value: current array element.\n - index: index of the current array element.\n - arr: array on which the method is invoked.\n\n If provided an initial value, the method invokes a provided function with\n the initial value as the first argument and the last array element as the\n second argument.\n\n If not provided an initial value, the method invokes a provided function\n with the last array element as the first argument and the second-to-last\n array element as the second argument.\n\n Parameters\n ----------\n fcn: Function\n Function to apply.\n\n initialValue: Any (optional)\n Initial accumulation value.\n\n Returns\n -------\n out: Any\n Accumulated result.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > function fcn( acc, v ) { return acc + (v*v); };\n > var v = arr.reduceRight( fcn, 0 )\n 14\n\n\nUint32Array.prototype.reverse()\n Reverses an array *in-place*.\n\n This method mutates the array on which the method is invoked.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] )\n <Uint32Array>[ 1, 2, 3 ]\n > arr.reverse()\n <Uint32Array>[ 3, 2, 1 ]\n\n\nUint32Array.prototype.set( arr[, offset] )\n Sets array elements.\n\n Parameters\n ----------\n arr: ArrayLike\n Source array containing array values to set.\n\n offset: integer (optional)\n Array index at which to start writing values. Default: 0.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.set( [ 4, 4 ], 1 );\n > arr[ 1 ]\n 4\n > arr[ 2 ]\n 4\n\n\nUint32Array.prototype.slice( [begin[, end]] )\n Copies array elements to a new array with the same underlying data type as\n the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns `null`.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint32Array\n A typed array.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3 ] );\n > var arr2 = arr1.slice( 1 );\n > arr2.length\n 2\n > arr2[ 0 ]\n 1\n > arr2[ 1 ]\n 2\n\n\nUint32Array.prototype.some( predicate[, thisArg] )\n Tests whether at least one array element passes a test implemented by a\n predicate function.\n\n A predicate function is provided the following arguments:\n\n - value: array element.\n - index: array index.\n - arr: array on which the method is invoked.\n\n Parameters\n ----------\n predicate: Function\n Predicate function which tests array elements. If a predicate function\n returns a truthy value, a array element passes; otherwise, an array\n element fails.\n\n thisArg: Any (optional)\n Callback execution context.\n\n Returns\n -------\n bool: boolean\n Boolean indicating whether at least one array element passes.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > function predicate( v ) { return ( v > 1 ); };\n > arr.some( predicate )\n true\n\n\nUint32Array.prototype.sort( [compareFunction] )\n Sorts an array *in-place*.\n\n The comparison function is provided two array elements per invocation: `a`\n and `b`.\n\n The comparison function return value determines the sort order as follows:\n\n - If the comparison function returns a value less than zero, then the method\n sorts `a` to an index lower than `b` (i.e., `a` should come *before* `b`).\n\n - If the comparison function returns a value greater than zero, then the\n method sorts `a` to an index higher than `b` (i.e., `b` should come *before*\n `a`).\n\n - If the comparison function returns zero, then the relative order of `a`\n and `b` should remain unchanged.\n\n This method mutates the array on which the method is invoked.\n\n Parameters\n ----------\n compareFunction: Function (optional)\n Function which specifies the sort order. The default sort order is\n ascending order.\n\n Returns\n -------\n out: Uint32Array\n Modified array.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 0, 2, 1 ] );\n > arr.sort()\n <Uint32Array>[ 0, 1, 1, 2, 2 ]\n\n\nUint32Array.prototype.subarray( [begin[, end]] )\n Creates a new typed array over the same underlying ArrayBuffer and with the\n same underlying data type as the host array.\n\n If the method is unable to resolve indices to a non-empty array subsequence,\n the method returns an empty typed array.\n\n Parameters\n ----------\n begin: integer (optional)\n Start element index (inclusive). If less than zero, the start index is\n resolved relative to the last array element. Default: 0.\n\n end: integer (optional)\n End element index (exclusive). If less than zero, the end index is\n resolved relative to the last array element. Default: arr.length.\n\n Returns\n -------\n out: Uint32Array\n A new typed array view.\n\n Examples\n --------\n > var arr1 = new Uint32Array( [ 1, 2, 3, 4, 5 ] );\n > var arr2 = arr1.subarray( 2 )\n <Uint32Array>[ 3, 4, 5 ]\n\n\nUint32Array.prototype.toLocaleString( [locales[, options]] )\n Serializes an array as a locale-specific string.\n\n Parameters\n ----------\n locales: string|Array<string> (optional)\n A BCP 47 language tag, or an array of such tags.\n\n options: Object (optional)\n Options.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.toLocaleString()\n '1,2,3'\n\n\nUint32Array.prototype.toString()\n Serializes an array as a string.\n\n Returns\n -------\n str: string\n A typed array string representation.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2, 3 ] );\n > arr.toString()\n '1,2,3'\n\n\nUint32Array.prototype.values()\n Returns an iterator for iterating over array elements.\n\n Returns\n -------\n iter: Iterator\n Iterator for iterating over array elements.\n\n Examples\n --------\n > var arr = new Uint32Array( [ 1, 2 ] );\n > it = arr.values();\n > it.next().value\n 1\n > it.next().value\n 2\n > it.next().done\n true\n\n\n See Also\n --------\n ArrayBuffer, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint8Array, Uint8ClampedArray\n",
"umask": "\numask( [mask,] [options] )\n Returns the current process mask, if not provided a mask; otherwise, sets\n the process mask and returns the previous mask.\n\n A mask is a set of bits, each of which restricts how its corresponding\n permission is set for newly created files.\n\n On POSIX platforms, each file has a set of attributes that control who can\n read, write, or execute that file. Upon creating a file, file permissions\n must be set to an initial setting. The process mask restricts those\n permission settings.\n\n If the mask contains a bit set to \"1\", the corresponding initial file\n permission is disabled. If the mask contains a bit set to \"0\", the\n corresponding permission is left to be determined by the requesting process\n and the system.\n\n The process mask is thus a filter that removes permissions as a file is\n created; i.e., each bit set to a \"1\" removes its corresponding permission.\n\n In octal representation, a mask is a four digit number, e.g., 0077,\n comprised as follows:\n\n - 0: special permissions (setuid, setgid, sticky bit)\n - 0: (u)ser/owner permissions\n - 7: (g)roup permissions\n - 7: (o)thers/non-group permissions\n\n Octal codes correspond to the following permissions:\n\n - 0: read, write, execute\n - 1: read, write\n - 2: read, execute\n - 3: read\n - 4: write, execute\n - 5: write\n - 6: execute\n - 7: no permissions\n\n If provided fewer than four digits, the mask is left-padded with zeros.\n\n Note, however, that only the last three digits (i.e., the file permissions\n digits) of the mask are actually used when the mask is applied.\n\n Permissions can be represented using the following symbolic form:\n\n u=rwx,g=rwx,o=rwx\n\n where\n\n - u: user permissions\n - g: group permissions\n - o: other/non-group permissions\n - r: read\n - w: write\n - x: execute\n\n When setting permissions using symbolic notation, the function accepts a\n mask expression of the form:\n\n [<classes>]<operator><symbols>\n\n where \"classes\" may be a combination of\n\n - u: user\n - g: group\n - o: other/non-group\n - a: all\n\n \"symbols\" may be a combination of\n\n - r: read\n - w: write\n - x: execute\n - X: special execute\n - s: setuid/gid on execution\n - t: sticky\n\n and \"operator\" may be one of\n\n - `+`: enable\n - `-`: disable\n - `=`: enable specified and disable unspecified permissions\n\n For example,\n\n - `u-w`: disable user write permissions\n - `u+w`: enable user write permissions\n - `u=w`: enable user write permissions and disable user read and execute\n\n To specify multiple changes, provide a comma-separated list of mask\n expressions. For example,\n\n u+rwx,g-x,o=r\n\n would enable user read, write, and execute permissions, disable group\n execute permissions, enable other read permissions, and disable other\n write and execute permissions.\n\n The `a` class indicates \"all\", which is the same as specifying \"ugo\". This\n is the default class if a class is omitted when specifying permissions. For\n example, `+x` is equivalent to `a+x` which is equivalent to `ugo+x` which\n is equivalent to `u+x,g+x,o+x` and enables execution for all classes.\n\n Parameters\n ----------\n mask: integer|string (optional)\n Mask or mask expression. If the mask is a string, the mask is assumed to\n be in symbolic notation.\n\n options: Object (optional)\n Options.\n\n options.symbolic: boolean (optional)\n Boolean indicating whether to return the mask using symbolic notation.\n\n Returns\n -------\n mask: integer|string\n Process mask. If provided a mask, the returned value is the previous\n mask; otherwise, the returned value is the current process mask.\n\n Examples\n --------\n > var mask = umask()\n <number>\n > mask = umask( { 'symbolic': true } )\n <string>\n\n",
"uncapitalize": "\nuncapitalize( str )\n Lowercases the first character of a `string`.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Uncapitalized string.\n\n Examples\n --------\n > var out = uncapitalize( 'Beep' )\n 'beep'\n > out = uncapitalize( 'bOOp' )\n 'bOOp'\n\n See Also\n --------\n capitalize, lowercase\n",
"uncapitalizeKeys": "\nuncapitalizeKeys( obj )\n Converts the first letter of each object key to lowercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'AA': 1, 'BB': 2 };\n > var out = uncapitalizeKeys( obj )\n { 'aA': 1, 'bB': 2 }\n\n See Also\n --------\n capitalizeKeys, lowercaseKeys\n",
"uncurry": "\nuncurry( fcn[, arity, ][thisArg] )\n Transforms a curried function into a function invoked with multiple\n arguments.\n\n Parameters\n ----------\n fcn: Function\n Curried function.\n\n arity: integer (optional)\n Number of parameters.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Uncurried function.\n\n Examples\n --------\n > function addX( x ) {\n ... return function addY( y ) {\n ... return x + y;\n ... };\n ... };\n > var fcn = uncurry( addX );\n > var sum = fcn( 2, 3 )\n 5\n\n // To enforce a fixed number of parameters, provide an `arity` argument:\n > function add( x ) {\n ... return function add( y ) {\n ... return x + y;\n ... };\n ... };\n > fcn = uncurry( add, 2 );\n > sum = fcn( 9 )\n <Error>\n\n // To specify an execution context, provide a `thisArg` argument:\n > function addX( x ) {\n ... this.x = x;\n ... return addY;\n ... };\n > function addY( y ) {\n ... return this.x + y;\n ... };\n > fcn = uncurry( addX, {} );\n > sum = fcn( 2, 3 )\n 5\n\n See Also\n --------\n curry, uncurryRight\n",
"uncurryRight": "\nuncurryRight( fcn[, arity, ][thisArg] )\n Transforms a curried function into a function invoked with multiple\n arguments.\n\n Provided arguments are applied starting from the right.\n\n Parameters\n ----------\n fcn: Function\n Curried function.\n\n arity: integer (optional)\n Number of parameters.\n\n thisArg: any (optional)\n Evaluation context.\n\n Returns\n -------\n out: Function\n Uncurried function.\n\n Examples\n --------\n > function addX( x ) {\n ... return function addY( y ) {\n ... return x + y;\n ... };\n ... };\n > var fcn = uncurryRight( addX );\n > var sum = fcn( 3, 2 )\n 5\n\n // To enforce a fixed number of parameters, provide an `arity` argument:\n > function add( y ) {\n ... return function add( x ) {\n ... return x + y;\n ... };\n ... };\n > fcn = uncurryRight( add, 2 );\n > sum = fcn( 9 )\n <Error>\n\n // To specify an execution context, provide a `thisArg` argument:\n > function addY( y ) {\n ... this.y = y;\n ... return addX;\n ... };\n > function addX( x ) {\n ... return x + this.y;\n ... };\n > fcn = uncurryRight( addY, {} );\n > sum = fcn( 3, 2 )\n 5\n\n See Also\n --------\n curry, curryRight, uncurry\n",
"UNICODE_MAX": "\nUNICODE_MAX\n Maximum Unicode code point.\n\n Examples\n --------\n > UNICODE_MAX\n 1114111\n\n See Also\n --------\n UNICODE_MAX_BMP\n",
"UNICODE_MAX_BMP": "\nUNICODE_MAX_BMP\n Maximum Unicode code point in the Basic Multilingual Plane (BMP).\n\n Examples\n --------\n > UNICODE_MAX_BMP\n 65535\n\n See Also\n --------\n UNICODE_MAX\n",
"UnicodeColumnChartSparkline": "\nUnicodeColumnChartSparkline( [data,] [options] )\n Returns a sparkline column chart instance.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: ColumnChart\n Column chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a column chart sparkline.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeColumnChartSparkline( data );\n > chart.render()\n '▁█▅▃▆▆▅'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeLineChartSparkline": "\nUnicodeLineChartSparkline( [data,] [options] )\n Returns a sparkline line chart instance.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: LineChart\n Line chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a line chart sparkline.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeLineChartSparkline( data );\n > chart.render()\n '⡈⠑⠢⠔⠒⠒⠒'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeSparkline": "\nUnicodeSparkline( [data,] [options] )\n Returns a Unicode sparkline instance.\n\n The following chart types are supported:\n\n - column: column chart (e.g., ▃▆▂▄▁▅▅).\n - line: line chart (e.g., ⡈⠑⠢⠔⠒⠒⠒).\n - tristate: tristate chart (e.g., ▄▀──▀▄▄▀).\n - up-down: up/down chart (e.g., ↓↑↑↑↑↓↓↑).\n - win-loss: win/loss chart (e.g., ┌╵└┴╵╷╷╵).\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.infinities: boolean (optional)\n Boolean indicating whether to encode infinite values. Default: false.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n options.type: string (optional)\n Chart type. Default: 'column'.\n\n options.yMax: number|null (optional)\n Maximum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n options.yMin: number|null (optional)\n Minimum value of the y-axis domain. If `null`, the value is computed\n from the data. Default: null.\n\n Returns\n -------\n chart: ColumnChart\n Column chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.infinities\n Indicates whether to encode infinite values.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a column chart sparkline.\n\n chart.type\n Chart type.\n\n chart.yMax\n Maximum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n chart.yMin\n Minimum value of the y-axis domain. If set to `null`, when accessed, the\n returned value is computed from the data.\n\n Examples\n --------\n > var data = [ 1.0, 5.0, 3.0, 2.0, 4.0, 4.0, 3.0 ];\n > var chart = new UnicodeSparkline( data );\n > chart.render()\n '▁█▅▃▆▆▅'\n > chart.type = 'line';\n > chart.render()\n '⡈⠑⠢⠔⠒⠒⠒'\n\n See Also\n --------\n plot, Plot, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeTristateChartSparkline": "\nUnicodeTristateChartSparkline( [data,] [options] )\n Returns a sparkline tristate chart instance.\n\n In a tristate chart, negative values are encoded as lower blocks, positive\n values are encoded as upper blocks, and values equal to zero are encoded as\n middle lines.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: TristateChart\n Tristate chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore values which are `NaN`.\n\n chart.render()\n Renders a tristate chart sparkline.\n\n Examples\n --------\n > var data = [ -1, 1, 0, 0, 1, -1, -1, 1 ];\n > var chart = new UnicodeTristateChartSparkline( data );\n > chart.render()\n '▄▀──▀▄▄▀'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeUpDownChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeUpDownChartSparkline": "\nUnicodeUpDownChartSparkline( [data,] [options] )\n Returns a sparkline up/down chart instance.\n\n Glyphs:\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 1 | ↑ |\n | -1 | ↓ |\n\n If provided any other value other than 1 or -1, the value is encoded as a\n missing value.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: UpDownChart\n Chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore any values which are not 1 or -1.\n\n chart.render()\n Renders an up/down chart sparkline.\n\n Examples\n --------\n > var data = [ -1, 1, 1, 1, 1, -1, -1, 1 ];\n > var chart = new UnicodeUpDownChartSparkline( data );\n > chart.render()\n '↓↑↑↑↑↓↓↑'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeWinLossChartSparkline\n",
"UnicodeWinLossChartSparkline": "\nUnicodeWinLossChartSparkline( [data,] [options] )\n Returns a sparkline win/loss chart instance.\n\n Glyphs:\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 1 | ╵ |\n | -1 | ╷ |\n | 2 | └ |\n | -2 | ┌ |\n\n If a `2` or `-2` is preceded by a `2` or `-2`,\n\n | Value | Glyph |\n |:-----:|:-----:|\n | 2 | ┴ |\n | -2 | ┬ |\n\n Based on the win/loss analogy,\n\n - 1: win away\n - 2: win at home\n - -1: loss away\n - -2: loss at home\n\n If provided any value other than 1, -1, 2, or -2, the value is encoded as a\n missing value.\n\n The `data` argument takes precedence over the `data` option.\n\n Parameters\n ----------\n data: ArrayLike|ndarray (optional)\n Chart data.\n\n options: Object (optional)\n Options.\n\n options.autoRender: boolean (optional)\n Boolean indicating whether to re-render on a 'change' event. Default:\n false.\n\n options.bufferSize: integer|null (optional)\n Data buffer size. If provided, data is kept in a first-in first-out\n (FIFO) buffer which cannot exceed the buffer size. Default: +infinity.\n\n options.data: ArrayLike|ndarray (optional)\n Chart data.\n\n options.description: string (optional)\n Chart description.\n\n options.isDefined: Function (optional)\n An accessor function indicating whether a datum is defined.\n\n options.label: string (optional)\n Data label.\n\n Returns\n -------\n chart: WinLossChart\n Chart instance.\n\n chart.autoRender\n Rendering mode. If `true`, an instance renders on each 'change' event;\n otherwise, rendering must be triggered manually.\n\n chart.bufferSize\n Data buffer size.\n\n chart.description\n Chart description.\n\n chart.data\n Chart data.\n\n chart.label\n Data label.\n\n chart.isDefined( d, i )\n An accessor function which defines whether a datum is defined. This\n accessor is used to define how missing values are encoded. The default\n behavior is to ignore any values which are not 1, -1, 2, or -2.\n\n chart.render()\n Renders a win/loss chart sparkline.\n\n Examples\n --------\n > var data = [ -2, 1, 2, 2, 1, -1, -1, 1 ];\n > var chart = new UnicodeWinLossChartSparkline( data );\n > chart.render()\n '┌╵└┴╵╷╷╵'\n\n See Also\n --------\n plot, Plot, UnicodeSparkline, UnicodeColumnChartSparkline, UnicodeLineChartSparkline, UnicodeTristateChartSparkline, UnicodeUpDownChartSparkline\n",
"unlink": "\nunlink( path, clbk )\n Asynchronously removes a directory entry.\n\n If a provided path is a symbolic link, the function removes the symbolic\n link named by the path and does not affect any file or directory named by\n the contents of the symbolic link.\n\n Otherwise, the function removes the link named by the provided path and\n decrements the link count of the file referenced by the link.\n\n When a file's link count becomes 0 and no process has the file open, the\n space occupied by the file is freed and the file is no longer accessible.\n\n If one or more processes have the file open when the last link is removed,\n the link is removed before the function returns; however, the removal of\n file contents is postponed until all references to the file are closed.\n\n If the path refers to a socket, FIFO, or device, processes which have the\n object open may continue to use it.\n\n The path argument should *not* be a directory. To remove a directory, use\n rmdir().\n\n Parameters\n ----------\n path: string|Buffer|integer\n Entry path.\n\n clbk: Function\n Callback to invoke upon removing an entry.\n\n Examples\n --------\n > function done( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > unlink( './beep/boop.txt', done );\n\n\nunlink.sync( path )\n Synchronously removes a directory entry.\n\n Parameters\n ----------\n path: string|Buffer|integer\n Entry path.\n\n Returns\n -------\n out: Error|null\n Error object or null.\n\n Examples\n --------\n > var out = unlink.sync( './beep/boop.txt' );\n\n See Also\n --------\n exists\n",
"unshift": "\nunshift( collection, ...items )\n Adds one or more elements to the beginning of a collection.\n\n If the input collection is a typed array, the output value does not equal\n the input reference and the underlying `ArrayBuffer` may *not* be the same\n as the `ArrayBuffer` belonging to the input view.\n\n For purposes of generality, always treat the output collection as distinct\n from the input collection.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n A collection. If the collection is an `Object`, the collection should be\n array-like.\n\n items: ...any\n Items to add.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Updated collection.\n\n Examples\n --------\n // Arrays:\n > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n > arr = unshift( arr, 6.0, 7.0 )\n [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]\n\n // Typed arrays:\n > arr = new Float64Array( [ 1.0, 2.0 ] );\n > arr = unshift( arr, 3.0, 4.0 )\n <Float64Array>[ 3.0, 4.0, 1.0, 2.0 ]\n\n // Array-like object:\n > arr = { 'length': 1, '0': 1.0 };\n > arr = unshift( arr, 2.0, 3.0 )\n { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }\n\n See Also\n --------\n pop, push, shift\n",
"until": "\nuntil( predicate, fcn[, thisArg] )\n Invokes a function until a test condition is true.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to stop invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i >= 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > until( predicate, beep )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhile, untilAsync, untilEach, whilst\n",
"untilAsync": "\nuntilAsync( predicate, fcn, done[, thisArg] )\n Invokes a function until a test condition is true.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is falsy, the function invokes `fcn`; otherwise, the\n function invokes the `done` callback.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i, clbk ) { clbk( null, i >= 5 ); };\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > untilAsync( predicate, fcn, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhileAsync, until, whileAsync\n",
"untilEach": "\nuntilEach( collection, predicate, fcn[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > untilEach( arr, predicate, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n untilEachRight, whileEach\n",
"untilEachRight": "\nuntilEachRight( collection, predicate, fcn[, thisArg] )\n Until a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to stop iterating over a\n collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v !== v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > untilEachRight( arr, predicate, logger )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n\n See Also\n --------\n untilEach, whileEachRight\n",
"unzip": "\nunzip( arr[, idx] )\n Unzips a zipped array (i.e., a nested array of tuples).\n\n Parameters\n ----------\n arr: Array\n Zipped array.\n\n idx: Array<number> (optional)\n Array of indices specifying which tuple elements to unzip.\n\n Returns\n -------\n out: Array\n Array of unzipped arrays.\n\n Examples\n --------\n // Basic usage:\n > var arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n > var out = unzip( arr )\n [ [ 1, 2 ], [ 'a', 'b' ], [ 3, 4 ] ]\n\n // Provide indices:\n > arr = [ [ 1, 'a', 3 ], [ 2, 'b', 4 ] ];\n > out = unzip( arr, [ 0, 2 ] )\n [ [ 1, 2 ], [ 3, 4 ] ]\n\n See Also\n --------\n zip\n",
"uppercase": "\nuppercase( str )\n Converts a `string` to uppercase.\n\n Parameters\n ----------\n str: string\n Input string.\n\n Returns\n -------\n out: string\n Uppercase string.\n\n Examples\n --------\n > var out = uppercase( 'bEEp' )\n 'BEEP'\n\n See Also\n --------\n capitalize, lowercase\n",
"uppercaseKeys": "\nuppercaseKeys( obj )\n Converts each object key to uppercase.\n\n The function only transforms own properties. Hence, the function does not\n transform inherited properties.\n\n The function shallow copies key values.\n\n Parameters\n ----------\n obj: Object\n Source object.\n\n Returns\n -------\n out: Object\n New object.\n\n Examples\n --------\n > var obj = { 'a': 1, 'b': 2 };\n > var out = uppercaseKeys( obj )\n { 'A': 1, 'B': 2 }\n\n See Also\n --------\n capitalizeKeys, lowercaseKeys\n",
"US_STATES_ABBR": "\nUS_STATES_ABBR()\n Returns a list of US state two-letter abbreviations in alphabetical order\n according to state name.\n\n Returns\n -------\n out: Array<string>\n List of US state two-letter abbreviations.\n\n Examples\n --------\n > var list = US_STATES_ABBR()\n [ 'AL', 'AK', 'AZ', 'AR', ... ]\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES\n",
"US_STATES_CAPITALS": "\nUS_STATES_CAPITALS()\n Returns a list of US state capitals in alphabetical order according to state\n name.\n\n Returns\n -------\n out: Array<string>\n List of US state capitals.\n\n Examples\n --------\n > var list = US_STATES_CAPITALS()\n [ 'Montgomery', 'Juneau', 'Phoenix', ... ]\n\n See Also\n --------\n US_STATES_ABBR, US_STATES_CAPITALS_NAMES, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_CAPITALS_NAMES": "\nUS_STATES_CAPITALS_NAMES()\n Returns an object mapping US state capitals to state names.\n\n Returns\n -------\n out: Object\n An object mapping US state capitals to state names.\n\n Examples\n --------\n > var out = US_STATES_CAPITALS_NAMES()\n { 'Montgomery': 'Alabama', 'Juneau': 'Alaska', ... }\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_NAMES": "\nUS_STATES_NAMES()\n Returns a list of US state names in alphabetical order.\n\n Returns\n -------\n out: Array<string>\n List of US state names.\n\n Examples\n --------\n > var list = US_STATES_NAMES()\n [ 'Alabama', 'Alaska', 'Arizona', ... ]\n\n See Also\n --------\n US_STATES_ABBR, US_STATES_CAPITALS, US_STATES_CAPITALS_NAMES, US_STATES_NAMES_CAPITALS\n",
"US_STATES_NAMES_CAPITALS": "\nUS_STATES_NAMES_CAPITALS()\n Returns an object mapping US state names to state capitals.\n\n Returns\n -------\n out: Object\n An object mapping US state names to state capitals.\n\n Examples\n --------\n > var out = US_STATES_NAMES_CAPITALS()\n { 'Alabama': 'Montgomery', 'Alaska': 'Juneau', ... }\n\n See Also\n --------\n US_STATES_CAPITALS, US_STATES_NAMES, US_STATES_NAMES_CAPITALS\n",
"utf16ToUTF8Array": "\nutf16ToUTF8Array( str )\n Converts a UTF-16 encoded string to an array of integers using UTF-8\n encoding.\n\n The following byte sequences are used to represent a character. The sequence\n depends on the code point:\n\n 0x00000000 - 0x0000007F:\n 0xxxxxxx\n\n 0x00000080 - 0x000007FF:\n 110xxxxx 10xxxxxx\n\n 0x00000800 - 0x0000FFFF:\n 1110xxxx 10xxxxxx 10xxxxxx\n\n 0x00010000 - 0x001FFFFF:\n 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\n The `x` bit positions correspond to code point bits.\n\n Only the shortest possible multi-byte sequence which can represent a code\n point is used.\n\n Parameters\n ----------\n str: string\n UTF-16 encoded string.\n\n Returns\n -------\n out: Array\n Array of integers.\n\n Examples\n --------\n > var str = '☃';\n > var out = utf16ToUTF8Array( str )\n [ 226, 152, 131 ]\n\n",
"vartest": "\nvartest( x, y[, options] )\n Computes a two-sample F-test for equal variances.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`.\n\n options.ratio: number (optional)\n Positive number denoting the ratio of the two population variances under\n the null hypothesis. Default: `1`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the ratio of variances.\n\n out.nullValue: number\n Assumed ratio of variances under H0.\n\n out.xvar: number\n Sample variance of `x`.\n\n out.yvar: number\n Sample variance of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.dfX: number\n Numerator degrees of freedom.\n\n out.dfY: number\n Denominator degrees of freedom.\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n > var x = [ 610, 610, 550, 590, 565, 570 ];\n > var y = [ 560, 550, 580, 550, 560, 590, 550, 590 ];\n > var out = vartest( x, y )\n {\n rejected: false,\n pValue: ~0.399,\n statistic: ~1.976,\n ci: [ ~0.374, ~13.542 ],\n // ...\n }\n\n // Print table output:\n > var table = out.print()\n F test for comparing two variances\n\n Alternative hypothesis: True ratio in variances is not equal to 1\n\n pValue: 0.3992\n statistic: 1.976\n variance of x: 617.5 (df of x: 5)\n variance of y: 312.5 (df of y: 7)\n 95% confidence interval: [0.3739,13.5417]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n See Also\n --------\n bartlettTest\n",
"waterfall": "\nwaterfall( fcns, clbk[, thisArg] )\n Executes functions in series, passing the results of one function as\n arguments to the next function.\n\n The last argument applied to each waterfall function is a callback. The\n callback should be invoked upon a series function completion. The first\n argument is reserved as an error argument (which can be `null`). Any results\n which should be passed to the next function in the series should be provided\n beginning with the second argument.\n\n If any function calls the provided callback with a truthy `error` argument,\n the waterfall suspends execution and immediately calls the completion\n callback for subsequent error handling.\n\n Execution is *not* guaranteed to be asynchronous. To ensure asynchrony, wrap\n the completion callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n fcns: Array<Function>\n Array of functions.\n\n clbk: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Function context.\n\n Examples\n --------\n > function foo( next ) { next( null, 'beep' ); };\n > function bar( str, next ) { console.log( str ); next(); };\n > function done( error ) { if ( error ) { throw error; } };\n > var fcns = [ foo, bar ];\n > waterfall( fcns, done );\n\n\nwaterfall.factory( fcns, clbk[, thisArg] )\n Returns a reusable waterfall function.\n\n Parameters\n ----------\n fcns: Array<Function>\n Array of functions.\n\n clbk: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Function context.\n\n Returns\n -------\n fcn: Function\n Waterfall function.\n\n Examples\n --------\n > function foo( next ) { next( null, 'beep' ); };\n > function bar( str, next ) { console.log( str ); next(); };\n > function done( error ) { if ( error ) { throw error; } };\n > var fcns = [ foo, bar ];\n > var waterfall = waterfall.factory( fcns, done );\n > waterfall();\n > waterfall();\n > waterfall();\n\n",
"whileAsync": "\nwhileAsync( predicate, fcn, done[, thisArg] )\n Invokes a function while a test condition is true.\n\n The predicate function is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `clbk`: a callback indicating whether to invoke `fcn`\n\n The `clbk` function accepts two arguments:\n\n - `error`: error argument\n - `bool`: test result\n\n If the test result is truthy, the function invokes `fcn`; otherwise, the\n function invokes the `done` callback.\n\n The function to invoke is provided two arguments:\n\n - `i`: iteration number (starting from zero)\n - `next`: a callback which must be invoked before proceeding to the next\n iteration\n\n The first argument of the `next` callback is an `error` argument. If `fcn`\n calls the `next` callback with a truthy `error` argument, the function\n suspends execution and immediately calls the `done` callback for subsequent\n `error` handling.\n\n The `done` callback is invoked with an `error` argument and any arguments\n passed to the final `next` callback.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n done: Function\n Callback to invoke upon completion.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i, clbk ) { clbk( null, i < 5 ); };\n > function fcn( i, next ) {\n ... setTimeout( onTimeout, i );\n ... function onTimeout() {\n ... next( null, 'boop'+i );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > whileAsync( predicate, fcn, done )\n boop: 4\n\n See Also\n --------\n doUntilAsync, doWhileAsync, untilAsync, whilst\n",
"whileEach": "\nwhileEach( collection, predicate, fcn[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, 2, 3, 4, NaN, 5 ];\n > whileEach( arr, predicate, logger )\n 0: 1\n 1: 2\n 2: 3\n 3: 4\n\n See Also\n --------\n untilEach, whileEachRight\n",
"whileEachRight": "\nwhileEachRight( collection, predicate, fcn[, thisArg] )\n While a test condition is true, invokes a function for each element in a\n collection, iterating from right to left.\n\n When invoked, both the predicate function and the function to apply are\n provided three arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n predicate: Function\n The predicate function which indicates whether to continue iterating\n over a collection.\n\n fcn: Function\n The function to invoke for each element in a collection.\n\n thisArg: any (optional)\n Execution context for the applied function.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Input collection.\n\n Examples\n --------\n > function predicate( v ) { return v === v; };\n > function logger( v, i ) { console.log( '%s: %d', i, v ); };\n > var arr = [ 1, NaN, 2, 3, 4, 5 ];\n > whileEachRight( arr, predicate, logger )\n 5: 5\n 4: 4\n 3: 3\n 2: 2\n\n See Also\n --------\n whileEach, untilEachRight\n",
"whilst": "\nwhilst( predicate, fcn[, thisArg] )\n Invokes a function while a test condition is true.\n\n When invoked, both the predicate function and the function to invoke are\n provided a single argument:\n\n - `i`: iteration number (starting from zero)\n\n Parameters\n ----------\n predicate: Function\n The predicate function which indicates whether to continue invoking a\n function.\n\n fcn: Function\n The function to invoke.\n\n thisArg: any (optional)\n Execution context for the invoked function.\n\n Examples\n --------\n > function predicate( i ) { return ( i < 5 ); };\n > function beep( i ) { console.log( 'boop: %d', i ); };\n > whilst( predicate, beep )\n boop: 0\n boop: 1\n boop: 2\n boop: 3\n boop: 4\n\n See Also\n --------\n doUntil, doWhile, until, whileAsync, whileEach\n",
"writeFile": "\nwriteFile( file, data[, options,] clbk )\n Asynchronously writes data to a file.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n data: string|Buffer\n Data to write.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. The encoding option is ignored if the data argument is a\n buffer. Default: 'utf8'.\n\n options.flag: string (optional)\n Flag. Default: 'w'.\n\n options.mode: integer (optional)\n Mode. Default: 0o666.\n\n clbk: Function\n Callback to invoke upon writing data to a file.\n\n Examples\n --------\n > function onWrite( error ) {\n ... if ( error ) {\n ... console.error( error.message );\n ... }\n ... };\n > writeFile( './beep/boop.txt', 'beep boop', onWrite );\n\n\nwriteFile.sync( file, data[, options] )\n Synchronously writes data to a file.\n\n Parameters\n ----------\n file: string|Buffer|integer\n Filename or file descriptor.\n\n data: string|Buffer\n Data to write.\n\n options: Object|string (optional)\n Options. If a string, the value is the encoding.\n\n options.encoding: string|null (optional)\n Encoding. The encoding option is ignored if the data argument is a\n buffer. Default: 'utf8'.\n\n options.flag: string (optional)\n Flag. Default: 'w'.\n\n options.mode: integer (optional)\n Mode. Default: 0o666.\n\n Returns\n -------\n err: Error|null\n Error object or null.\n\n Examples\n --------\n > var err = writeFile.sync( './beep/boop.txt', 'beep boop' );\n\n See Also\n --------\n exists, readFile\n",
"zip": "\nzip( ...arr[, options] )\n Generates array tuples from input arrays.\n\n Parameters\n ----------\n arr: ...Array\n Input arrays to be zipped.\n\n options: Object (optional)\n Options.\n\n options.trunc: boolean (optional)\n Boolean indicating whether to truncate arrays longer than the shortest\n input array. Default: `true`.\n\n options.fill: any (optional)\n Fill value used for arrays of unequal length. Default: `null`.\n\n options.arrays: boolean (optional)\n Boolean indicating whether an input array should be interpreted as an\n array of arrays to be zipped. Default: `false`.\n\n Returns\n -------\n out: Array\n Array of arrays.\n\n Examples\n --------\n // Basic usage:\n > var out = zip( [ 1, 2 ], [ 'a', 'b' ] )\n [ [ 1, 'a' ], [ 2, 'b' ] ]\n\n // Turn off truncation:\n > var opts = { 'trunc': false };\n > out = zip( [ 1, 2, 3 ], [ 'a', 'b' ], opts )\n [ [ 1, 'a' ], [ 2, 'b' ], [ 3, null ] ]\n\n See Also\n --------\n unzip\n",
"ztest": "\nztest( x, sigma[, options] )\n Computes a one-sample z-test.\n\n The function performs a one-sample z-test for the null hypothesis that the\n data in array or typed array `x` is drawn from a normal distribution with\n mean zero and standard deviation `sigma`.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n Data array.\n\n sigma: number\n Known standard deviation.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Indicates whether the alternative hypothesis is that the mean of `x` is\n larger than `mu` (`greater`), smaller than `mu` (`less`) or equal to\n `mu` (`two-sided`). Default: `'two-sided'`.\n\n options.mu: number (optional)\n Hypothesized true mean under the null hypothesis. Set this option to\n test whether the data comes from a distribution with the specified `mu`.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for mean.\n\n out.nullValue: number\n Assumed mean value under H0.\n\n out.sd: number\n Standard error.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test (`One-Sample z-test`).\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // One-sample z-test:\n > var rnorm = base.random.normal.factory( 0.0, 2.0, { 'seed': 212 });\n > var x = new Array( 100 );\n > for ( var i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm();\n ... }\n > var out = ztest( x, 2.0 )\n {\n alpha: 0.05,\n rejected: false,\n pValue: ~0.180,\n statistic: ~-1.34,\n ci: [ ~-0.66, ~0.124 ],\n ...\n }\n\n // Choose custom significance level and print output:\n > arr = [ 2, 4, 3, 1, 0 ];\n > out = ztest( arr, 2.0, { 'alpha': 0.01 });\n > table = out.print()\n One-sample z-test\n\n Alternative hypothesis: True mean is not equal to 0\n\n pValue: 0.0253\n statistic: 2.2361\n 99% confidence interval: [-0.3039,4.3039]\n\n Test Decision: Fail to reject null in favor of alternative at 1%\n significance level\n\n\n // Test for a mean equal to five:\n > var arr = [ 4, 4, 6, 6, 5 ];\n > out = ztest( arr, 1.0, { 'mu': 5 })\n {\n rejected: false,\n pValue: 1,\n statistic: 0,\n ci: [ ~4.123, ~5.877 ],\n // ...\n }\n\n // Perform one-sided tests:\n > arr = [ 4, 4, 6, 6, 5 ];\n > out = ztest( arr, 1.0, { 'alternative': 'less' })\n {\n alpha: 0.05,\n rejected: false,\n pValue: 1,\n statistic: 11.180339887498949,\n ci: [ -Infinity, 5.735600904580115 ],\n // ...\n }\n > out = ztest( arr, 1.0, { 'alternative': 'greater' })\n {\n alpha: 0.05,\n rejected: true,\n pValue: 0,\n statistic: 11.180339887498949,\n ci: [ 4.264399095419885, Infinity ],\n //...\n }\n\n See Also\n --------\n ztest2\n",
"ztest2": "\nztest2( x, y, sigmax, sigmay[, options] )\n Computes a two-sample z-test.\n\n By default, the function performs a two-sample z-test for the null\n hypothesis that the data in arrays or typed arrays `x` and `y` is\n independently drawn from normal distributions with equal means and known\n standard deviations `sigmax` and `sigmay`.\n\n The returned object comes with a `.print()` method which when invoked will\n print a formatted output of the results of the hypothesis test.\n\n Parameters\n ----------\n x: Array<number>\n First data array.\n\n y: Array<number>\n Second data array.\n\n sigmax: number\n Known standard deviation of first group.\n\n sigmay: number\n Known standard deviation of second group.\n\n options: Object (optional)\n Options.\n\n options.alpha: number (optional)\n Number in the interval `[0,1]` giving the significance level of the\n hypothesis test. Default: `0.05`.\n\n options.alternative: string (optional)\n Either `two-sided`, `less` or `greater`. Indicates whether the\n alternative hypothesis is that `x` has a larger mean than `y`\n (`greater`), `x` has a smaller mean than `y` (`less`) or the means are\n the same (`two-sided`). Default: `'two-sided'`.\n\n options.difference: number (optional)\n Number denoting the difference in means under the null hypothesis.\n Default: `0`.\n\n Returns\n -------\n out: Object\n Test result object.\n\n out.alpha: number\n Used significance level.\n\n out.rejected: boolean\n Test decision.\n\n out.pValue: number\n p-value of the test.\n\n out.statistic: number\n Value of test statistic.\n\n out.ci: Array<number>\n 1-alpha confidence interval for the mean.\n\n out.nullValue: number\n Assumed difference in means under H0.\n\n out.xmean: number\n Sample mean of `x`.\n\n out.ymean: number\n Sample mean of `y`.\n\n out.alternative: string\n Alternative hypothesis (`two-sided`, `less` or `greater`).\n\n out.method: string\n Name of test.\n\n out.print: Function\n Function to print formatted output.\n\n Examples\n --------\n // Drawn from Normal(0,2):\n > var x = [ -0.21, 0.14, 1.65, 2.11, -1.86, -0.29, 1.48, 0.81, 0.86, 1.04 ];\n\n // Drawn from Normal(1,2):\n > var y = [ -1.53, -2.93, 2.34, -1.15, 2.7, -0.12, 4.22, 1.66, 3.43, 4.66 ];\n > var out = ztest2( x, y, 2.0, 2.0 )\n {\n alpha: 0.05,\n rejected: false,\n pValue: ~0.398,\n statistic: ~-0.844\n ci: [ ~-2.508, ~0.988 ],\n alternative: 'two-sided',\n method: 'Two-sample z-test',\n nullValue: 0,\n xmean: ~0.573,\n ymean: ~1.328\n }\n\n // Print table output:\n > var table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.3986\n statistic: -0.8441\n 95% confidence interval: [-2.508,0.998]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Choose a different significance level than `0.05`:\n > out = ztest2( x, y, 2.0, 2.0, { 'alpha': 0.4 });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is not equal to 0\n\n pValue: 0.3986\n statistic: -0.8441\n 60% confidence interval: [-1.5078,-0.0022]\n\n Test Decision: Reject null in favor of alternative at 40% significance level\n\n // Perform one-sided tests:\n > out = ztest2( x, y, 2.0, 2.0, { 'alternative': 'less' });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is less than 0\n\n pValue: 0.1993\n statistic: -0.8441\n 95% confidence interval: [-Infinity,0.7162]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n\n > out = ztest2( x, y, 2.0, 2.0, { 'alternative': 'greater' });\n > table = out.print()\n Two-sample z-test\n\n Alternative hypothesis: True difference in means is greater than 0\n\n pValue: 0.8007\n statistic: -0.8441\n 95% confidence interval: [-2.2262,Infinity]\n\n Test Decision: Fail to reject null in favor of alternative at 5%\n significance level\n\n // Test for a difference in means besides zero:\n > var rnorm = base.random.normal.factory({ 'seed': 372 });\n > x = new Array( 100 );\n > for ( i = 0; i < x.length; i++ ) {\n ... x[ i ] = rnorm( 2.0, 1.0 );\n ... }\n > y = new Array( 100 );\n ... for ( i = 0; i < x.length; i++ ) {\n ... y[ i ] = rnorm( 0.0, 2.0 );\n ... }\n > out = ztest2( x, y, 1.0, 2.0, { 'difference': 2.0 })\n {\n rejected: false,\n pValue: ~0.35,\n statistic: ~-0.935\n ci: [ ~1.353, ~2.229 ],\n // ...\n }\n\n See Also\n --------\n ztest\n"
};
module.exports = db;
| Update REPL help
| lib/node_modules/@stdlib/repl/help/lib/db.js | Update REPL help | <ide><path>ib/node_modules/@stdlib/repl/help/lib/db.js
<ide> "base.xlog1py": "\nbase.xlog1py( x, y )\n Computes `x * ln(y+1)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlog1py( 3.0, 2.0 )\n ~3.296\n > out = base.xlog1py( 1.5, 5.9 )\n ~2.897\n > out = base.xlog1py( 0.9, 1.0 )\n ~0.624\n > out = base.xlog1py( 1.0, 0.0 )\n 0.0\n > out = base.xlog1py( 0.0, -2.0 )\n 0.0\n > out = base.xlog1py( 1.5, NaN )\n NaN\n > out = base.xlog1py( 0.0, NaN )\n NaN\n > out = base.xlog1py( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.log1p, base.xlogy\n",
<ide> "base.xlogy": "\nbase.xlogy( x, y )\n Computes `x * ln(y)` so that the result is `0` if `x = 0`.\n\n Parameters\n ----------\n x: number\n Input value.\n\n y: number\n Input value.\n\n Returns\n -------\n out: number\n Function value.\n\n Examples\n --------\n > var out = base.xlogy( 3.0, 2.0 )\n ~2.079\n > out = base.xlogy( 1.5, 5.9 )\n ~2.662\n > out = base.xlogy( 0.9, 1.0 )\n 0.0\n > out = base.xlogy( 0.0, -2.0 )\n 0.0\n > out = base.xlogy( 1.5, NaN )\n NaN\n > out = base.xlogy( 0.0, NaN )\n NaN\n > out = base.xlogy( NaN, 2.3 )\n NaN\n\n See Also\n --------\n base.ln, base.xlog1py\n",
<ide> "base.zeta": "\nbase.zeta( s )\n Evaluates the Riemann zeta function as a function of a real variable `s`.\n\n Parameters\n ----------\n s: number\n Input value.\n\n Returns\n -------\n y: number\n Function value.\n\n Examples\n --------\n > var y = base.zeta( 1.1 )\n ~10.584\n > y = base.zeta( -4.0 )\n 0.0\n > y = base.zeta( 70.0 )\n 1.0\n > y = base.zeta( 0.5 )\n ~-1.46\n > y = base.zeta( NaN )\n NaN\n\n // Evaluate at a pole:\n > y = base.zeta( 1.0 )\n NaN\n\n",
<del> "BERNDT_CPS_WAGES_1985": "\nBERNDT_CPS_WAGES_1985()\n Returns a random sample of 534 workers from the Current Population Survey\n (CPS) from 1985, including their wages and and other characteristics.\n\n Each array element has the following eleven fields:\n\n - education: number of years of education.\n - south: indicator variable for southern region (1 if person lives in the\n South; 0 if person does not live in the South).\n - gender: indicator for the gender of the person (1 if female; 0 if male).\n - experience: number of years of work experience.\n - union: indicator variable for union membership (1 if union member; 0 if\n not a union member).\n - wage: wage (in dollars per hour).\n - age: age (in years).\n - race: ethnicity/race ('white', 'hispanic', and 'other').\n - occupation: occupational category ('management', 'sales', 'clerical',\n 'service', 'professional', and 'other').\n - sector: sector ('Other', 'Manufacturing', or 'Construction').\n - married: marital status (0 if unmarried; 1 if married).\n\n Based on residual plots, wages were log-transformed to stabilize the\n variance.\n\n Returns\n -------\n out: Array<Object>\n CPS data.\n\n Examples\n --------\n > var data = BERNDT_CPS_WAGES_1985()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Berndt, Ernst R. 1991. _The Practice of Econometrics_. Addison Wesley\n Longman Publishing Co.\n\n",
<add> "BERNDT_CPS_WAGES_1985": "\nBERNDT_CPS_WAGES_1985()\n Returns a random sample of 534 workers from the Current Population Survey\n (CPS) from 1985, including their wages and and other characteristics.\n\n Each array element has the following eleven fields:\n\n - education: number of years of education.\n - south: indicator variable for southern region (1 if a person lives in the\n South; 0 if a person does not live in the South).\n - gender: gender of the person.\n - experience: number of years of work experience.\n - union: indicator variable for union membership (1 if union member; 0 if\n not a union member).\n - wage: wage (in dollars per hour).\n - age: age (in years).\n - race: ethnicity/race (white, hispanic, and other).\n - occupation: occupational category (management, sales, clerical, service,\n professional, and other).\n - sector: sector (other, manufacturing, or construction).\n - married: marital status (0 if unmarried; 1 if married).\n\n Based on residual plots, wages were log-transformed to stabilize the\n variance.\n\n Returns\n -------\n out: Array<Object>\n CPS data.\n\n Examples\n --------\n > var data = BERNDT_CPS_WAGES_1985()\n [ {...}, {...}, ... ]\n\n References\n ----------\n - Berndt, Ernst R. 1991. _The Practice of Econometrics_. Addison Wesley\n Longman Publishing Co.\n\n",
<ide> "bifurcate": "\nbifurcate( collection, [options,] filter )\n Splits values into two groups.\n\n If an element in `filter` is truthy, then the corresponding element in the\n input collection belongs to the first group; otherwise, the collection\n element belongs to the second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n filter: Array|TypedArray|Object\n A collection indicating which group an element in the input collection\n belongs to. If an element in `filter` is truthy, the corresponding\n element in `collection` belongs to the first group; otherwise, the\n collection element belongs to the second group. If provided an object,\n the object must be array-like (excluding strings and functions).\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var f = [ true, true, false, true ];\n > var out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n > f = [ 1, 1, 0, 1 ];\n > out = bifurcate( collection, f )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > f = [ true, true, false, true ];\n > var opts = { 'returns': 'indices' };\n > out = bifurcate( collection, opts, f )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-element pairs:\n > opts = { 'returns': '*' };\n > out = bifurcate( collection, opts, f )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo'] ] ]\n\n See Also\n --------\n bifurcateBy, bifurcateOwn, group\n",
<ide> "bifurcateBy": "\nbifurcateBy( collection, [options,] predicate )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided two arguments:\n\n - `value`: collection value\n - `index`: collection index\n\n If a predicate function returns a truthy value, a collection value is\n placed in the first group; otherwise, a collection value is placed in the\n second group.\n\n If provided an empty collection, the function returns an empty array.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection to group. If provided an object, the object must be\n array-like (excluding strings and functions).\n\n options: Object (optional)\n Options.\n\n options.thisArg: any (optional)\n Execution context.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Array<Array>|Array\n Group results.\n\n Examples\n --------\n > function predicate( v ) { return v[ 0 ] === 'b'; };\n > var collection = [ 'beep', 'boop', 'foo', 'bar' ];\n > var out = bifurcateBy( collection, predicate )\n [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ 0, 1, 3 ], [ 2 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > out = bifurcateBy( collection, opts, predicate )\n [ [ [0, 'beep'], [1, 'boop'], [3, 'bar'] ], [ [2, 'foo' ] ] ]\n\n See Also\n --------\n bifurcate, groupBy\n",
<ide> "bifurcateByAsync": "\nbifurcateByAsync( collection, [options,] predicate, done )\n Splits values into two groups according to a predicate function.\n\n When invoked, the predicate function is provided a maximum of four\n arguments:\n\n - `value`: collection value\n - `index`: collection index\n - `collection`: the input collection\n - `next`: a callback to be invoked after processing a collection `value`\n\n The actual number of provided arguments depends on function length. If the\n predicate function accepts two arguments, the predicate function is\n provided:\n\n - `value`\n - `next`\n\n If the predicate function accepts three arguments, the predicate function is\n provided:\n\n - `value`\n - `index`\n - `next`\n\n For every other predicate function signature, the predicate function is\n provided all four arguments.\n\n The `next` callback takes two arguments:\n\n - `error`: error argument\n - `group`: value group\n\n If an predicate function calls the `next` callback with a truthy `error`\n argument, the function suspends execution and immediately calls the `done`\n callback for subsequent `error` handling.\n\n If a predicate function calls the `next` callback with a truthy group value,\n a collection value is placed in the first group; otherwise, a collection\n value is placed in the second group.\n\n If provided an empty collection, the function calls the `done` callback with\n an empty array as the second argument.\n\n Execution is *not* guaranteed to be asynchronous. To guarantee asynchrony,\n wrap the `done` callback in a function which either executes at the end of\n the current stack (e.g., `nextTick`) or during a subsequent turn of the\n event loop (e.g., `setImmediate`, `setTimeout`).\n\n The function does not support dynamic collection resizing.\n\n The function does not skip `undefined` elements.\n\n Parameters\n ----------\n collection: Array|TypedArray|Object\n Input collection over which to iterate. If provided an object, the\n object must be array-like (excluding strings and functions).\n\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n done: Function\n A callback invoked either upon processing all collection elements or\n upon encountering an error.\n\n Examples\n --------\n // Basic usage:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, predicate, done )\n 1000\n 2500\n 3000\n [ [ 1000, 3000 ], [ 2500 ] ]\n\n // Output group results as indices:\n > var opts = { 'returns': 'indices' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ 2, 0 ], [ 1 ] ]\n\n // Output group results as index-value pairs:\n > opts = { 'returns': '*' };\n > bifurcateByAsync( arr, opts, predicate, done )\n 1000\n 2500\n 3000\n [ [ [ 2, 1000 ], [ 0, 3000 ] ], [ [ 1, 2500 ] ] ]\n\n // Limit number of concurrent invocations:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'limit': 2 };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 2500\n 3000\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n // Process sequentially:\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var opts = { 'series': true };\n > var arr = [ 3000, 2500, 1000 ];\n > bifurcateByAsync( arr, opts, predicate, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n\n\nbifurcateByAsync.factory( [options,] predicate )\n Returns a function which splits values into two groups according to an\n predicate function.\n\n Parameters\n ----------\n options: Object (optional)\n Function options.\n\n options.limit: integer (optional)\n Maximum number of pending invocations. Default: Infinity.\n\n options.series: boolean (optional)\n Boolean indicating whether to process each collection element\n sequentially. Default: false.\n\n options.returns: string (optional)\n If `values`, values are returned; if `indices`, indices are returned; if\n `*`, both indices and values are returned. Default: 'values'.\n\n options.thisArg: any (optional)\n Execution context.\n\n predicate: Function\n Predicate function indicating which group an element in the input\n collection belongs to.\n\n Returns\n -------\n out: Function\n A function which splits values into two groups.\n\n Examples\n --------\n > function predicate( value, index, next ) {\n ... setTimeout( onTimeout, value );\n ... function onTimeout() {\n ... console.log( value );\n ... next( null, ( index%2 === 0 ) );\n ... }\n ... };\n > var opts = { 'series': true };\n > var f = bifurcateByAsync.factory( opts, predicate );\n > function done( error, result ) {\n ... if ( error ) {\n ... throw error;\n ... }\n ... console.log( result );\n ... };\n > var arr = [ 3000, 2500, 1000 ];\n > f( arr, done )\n 3000\n 2500\n 1000\n [ [ 3000, 1000 ], [ 2500 ] ]\n > arr = [ 2000, 1500, 1000 ];\n > f( arr, done )\n 2000\n 1500\n 1000\n [ [ 2000, 1000 ], [ 1500 ] ]\n\n See Also\n --------\n bifurcateBy, groupByAsync\n", |
|
Java | apache-2.0 | 5a2eb66007c59e06d873056b184b45dab6b95e14 | 0 | opensciencegrid/oim,opensciencegrid/oim,opensciencegrid/oim,opensciencegrid/oim,opensciencegrid/oim | package edu.iu.grid.oim.model.cert;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.log4j.Logger;
import org.bouncycastle.asn1.x500.RDN;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x500.style.BCStyle;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.bouncycastle.util.encoders.Base64;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import edu.iu.grid.oim.lib.StaticConfig;
public class DigicertCertificateSigner implements ICertificateSigner {
static Logger log = Logger.getLogger(DigicertCertificateSigner.class);
class DigicertCPException extends CertificateProviderException {
public DigicertCPException(String msg, Exception e) {
super("From DigiCert: " + msg, e);
}
public DigicertCPException(String msg) {
super("From DigiCert: " + msg);
}
};
public Certificate signUserCertificate(String csr, String dn, String email_address) throws CertificateProviderException {
return requestUserCert(csr, dn, email_address);
}
//pass csrs, and
public void signHostCertificates(Certificate[] certs, IHostCertificatesCallBack callback) throws CertificateProviderException {
//request & approve all
for(Certificate cert : certs) {
//don't request if it's already requested
if(cert.serial != null) continue;
//pull CN
String cn;
String csr = cert.csr;
try {
PKCS10CertificationRequest pkcs10 = new PKCS10CertificationRequest(Base64.decode(csr));
X500Name name = pkcs10.getSubject();
RDN[] cn_rdn = name.getRDNs(BCStyle.CN);
cn = cn_rdn[0].getFirst().getValue().toString(); //wtf?
} catch (IOException e2) {
throw new CertificateProviderException("Failed to obtain cn from given csr:" + csr, e2);
}
//split optional service name (like.. rsv/ce.grid.iu.edu)
String tokens[] = cn.split("/");
String service_name = null;
String thecn = null;
if(tokens.length == 1) {
thecn = tokens[0];
} else if (tokens.length == 2) {
service_name = tokens[0];
thecn = tokens[1];
} else {
throw new CertificateProviderException("Failed to parse Service Name from CN");
}
//do request & approve
String request_id = requestHostCert(csr, service_name, thecn);
log.debug("Requested host certificate. Digicert Request ID:" + request_id);
String order_id = approve(request_id, "Approving for test purpose"); //like 00295828
log.debug("Approved host certificate. Digicert Order ID:" + order_id);
cert.serial = order_id;
}
callback.certificateRequested();
///////////////////////////////////////////////////////////////////////////////////////////
//
// TODO -- DigiCert will provide API to do this in more efficient way
//
/*
//wait for a while before start pinging (per Greg)
try {
log.debug("Sleeping for 5 seconds");
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
*/
//wait until all certificates are issued (or timeout)
log.debug("start looking for certificate that's issued");
int timeout_msec = 5*60*1000;
Date start = new Date();
while(true) {
//wait few seconds between each loops
try {
log.debug("Sleeping for 5 seconds");
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
//loop all certs - count number of certificates issued so far
int issued = 0;
for(int c = 0; c < certs.length; ++c) {
Certificate cert = certs[c];
if(cert.pkcs7 == null) {
try {
//WARNING - this resets csr stored in current cert
log.debug("Checking to see if OrderID:" + cert.serial + " has been issued");
cert = retrieveByOrderID(cert.serial);
if(cert != null) {
//found new certificate issued
certs[c] = cert;
issued++;
callback.certificateSigned(cert, c);
}
} catch(DigicertCPException e) {
//TODO - need to ask DigiCert to give me more specific error code so that I can distinguish between real error v.s. need_wait
log.info("Failed to retrieve cert for order ID:" + cert.serial + ". probably not yet issued.. ignoring");
}
} else {
issued++;
}
}
if(certs.length == issued) {
//all issued.
return;
}
//check timeout
Date now = new Date();
if(now.getTime() - start.getTime() > timeout_msec) {
//timed out..
throw new CertificateProviderException("DigiCert didn't return certificate after "+(timeout_msec/1000)+" seconds");
}
/*
//if we have less than 5 cert, wait few seconds between each loop in order to avoid
//hitting digicert too often on the same cert
if(certs.length - issued < 5) {
log.debug(issued + " issued out of " + certs.length + " requests... waiting for 5 second before re-trying");
try {
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
}
*/
}
}
private HttpClient createHttpClient() {
HttpClient cl = new HttpClient();
//cl.getParams().setParameter("http.protocol.single-cookie-header", true);
//cl.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
//cl.getHttpConnectionManager().getParams().setConnectionTimeout(1000*10);
cl.getParams().setParameter("http.useragent", "OIM (OSG Information Management System)");
//cl.getParams().setParameter("http.contenttype", "application/x-www-form-urlencoded")
return cl;
}
//used to check if certificate has been issued
private String getDetail_under_construction(String order_id) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_certificate_details");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("id", order_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_certificate_details request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append(" Error while accessing: grid_certificate_details");
errors.append(" Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_certificate_details\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
log.debug("Successfully retrieved certificate detail for " + order_id);
return "success";
}
throw new DigicertCPException("Unknown return code from grid_certificate_details: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_certificate_details request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_certificate_details request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_certificate_details", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_certificate_details", e);
}
}
private Document parseXML(InputStream in) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(in);
}
public Certificate requestUserCert(String csr, String cn, String email_address) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_email_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("email", email_address);
post.setParameter("full_name", cn);
post.setParameter("csr", csr);
post.setParameter("hash", StaticConfig.conf.getProperty("digicert.hash"));
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_retrieve_host_cert request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append(" Error while accessing: grid_request_email_cert");
errors.append(" Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_email_cert\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
ICertificateSigner.Certificate cert = new ICertificateSigner.Certificate();
Element serial_e = (Element)ret.getElementsByTagName("serial").item(0);
cert.serial = serial_e.getTextContent();
Element certificate_e = (Element)ret.getElementsByTagName("certificate").item(0);
cert.certificate = certificate_e.getTextContent();
Element intermediate_e = (Element)ret.getElementsByTagName("intermediate").item(0);
cert.intermediate = intermediate_e.getTextContent();
Element pkcs7_e = (Element)ret.getElementsByTagName("pkcs7").item(0);
cert.pkcs7 = pkcs7_e.getTextContent();
return cert;
}
throw new DigicertCPException("Unknown return code from grid_request_email_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_email_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_email_certrequest", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_email_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_email_cert", e);
}
}
private String requestHostCert(String csr, String service_name, String cn) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_host_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("common_name", cn);
//post.setParameter("sans", "a.digicert.com,b.digicert.com,c.digicert.com");
if(service_name != null) {
post.setParameter("service_name", service_name);
}
post.setParameter("csr", csr);
post.setParameter("hash", StaticConfig.conf.getProperty("digicert.hash"));
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_request_host_cert request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append("Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_host_cert..\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
Element request_id_e = (Element)ret.getElementsByTagName("request_id").item(0);
String request_id = request_id_e.getTextContent();
System.out.println("Obtained Digicert Request ID:" + request_id); //like "15757"
return request_id;
}
throw new DigicertCPException("Unknown return code from grid_request_host_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_host_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_host_cert request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_cert", e);
}
}
private String approve(String request_id, String comment) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_approve_request");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("comment", comment);
post.setParameter("request_id", request_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_approve_request request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_approve_request\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
Element order_id_e = (Element)ret.getElementsByTagName("order_id").item(0);
String order_id = order_id_e.getTextContent();
return order_id;
}
throw new DigicertCPException("Unknown return code from grid_approve_request: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_approve_request request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_approve_request request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_approve_request", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_approve_request", e);
}
}
private Certificate retrieveByOrderID(String order_id) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_retrieve_host_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("id", order_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_retrieve_host_cert\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
ICertificateSigner.Certificate cert = new ICertificateSigner.Certificate();
Element serial_e = (Element)ret.getElementsByTagName("serial").item(0);
cert.serial = serial_e.getTextContent();
Element certificate_e = (Element)ret.getElementsByTagName("certificate").item(0);
cert.certificate = certificate_e.getTextContent();
Element intermediate_e = (Element)ret.getElementsByTagName("intermediate").item(0);
cert.intermediate = intermediate_e.getTextContent();
Element pkcs7_e = (Element)ret.getElementsByTagName("pkcs7").item(0);
cert.pkcs7 = pkcs7_e.getTextContent();
return cert;
}
throw new DigicertCPException("Unknown return code for grid_retrieve_host_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_retrieve_host_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_retrieve_host_cert request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_retrieve_host_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_retrieve_host_cert", e);
}
}
@Override
public void revokeHostCertificate(String serial_id) throws CertificateProviderException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_host_revoke");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("serial", serial_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_host_revoke\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
//nothing particular to do
} else {
throw new DigicertCPException("Unknown return code from grid_request_host_revoke: " +result.getTextContent());
}
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_host_revoke request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_host_revoke request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_revoke", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_revoke", e);
}
}
@Override
public void revokeUserCertificate(String serial_id) throws CertificateProviderException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_email_revoke");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("serial", serial_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_email_revoke\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
//nothing particular to do
} else {
throw new DigicertCPException("Unknown return code from grid_email_revoke: " +result.getTextContent());
}
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_email_revoke request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_email_revoke request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_email_revoke", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_email_revoke", e);
}
}
}
| src/edu/iu/grid/oim/model/cert/DigicertCertificateSigner.java | package edu.iu.grid.oim.model.cert;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.log4j.Logger;
import org.bouncycastle.asn1.x500.RDN;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x500.style.BCStyle;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.bouncycastle.util.encoders.Base64;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import edu.iu.grid.oim.lib.StaticConfig;
public class DigicertCertificateSigner implements ICertificateSigner {
static Logger log = Logger.getLogger(DigicertCertificateSigner.class);
class DigicertCPException extends CertificateProviderException {
public DigicertCPException(String msg, Exception e) {
super("From DigiCert: " + msg, e);
}
public DigicertCPException(String msg) {
super("From DigiCert: " + msg);
}
};
public Certificate signUserCertificate(String csr, String dn, String email_address) throws CertificateProviderException {
return requestUserCert(csr, dn, email_address);
}
//pass csrs, and
public void signHostCertificates(Certificate[] certs, IHostCertificatesCallBack callback) throws CertificateProviderException {
//request & approve all
for(Certificate cert : certs) {
//don't request if it's already requested
if(cert.serial != null) continue;
//pull CN
String cn;
String csr = cert.csr;
try {
PKCS10CertificationRequest pkcs10 = new PKCS10CertificationRequest(Base64.decode(csr));
X500Name name = pkcs10.getSubject();
RDN[] cn_rdn = name.getRDNs(BCStyle.CN);
cn = cn_rdn[0].getFirst().getValue().toString(); //wtf?
} catch (IOException e2) {
throw new CertificateProviderException("Failed to obtain cn from given csr:" + csr, e2);
}
//split optional service name (like.. rsv/ce.grid.iu.edu)
String tokens[] = cn.split("/");
String service_name = null;
String thecn = null;
if(tokens.length == 1) {
thecn = tokens[0];
} else if (tokens.length == 2) {
service_name = tokens[0];
thecn = tokens[1];
} else {
throw new CertificateProviderException("Failed to parse Service Name from CN");
}
//do request & approve
String request_id = requestHostCert(csr, service_name, thecn);
log.debug("Requested host certificate. Digicert Request ID:" + request_id);
String order_id = approve(request_id, "Approving for test purpose"); //like 00295828
log.debug("Approved host certificate. Digicert Order ID:" + order_id);
cert.serial = order_id;
}
callback.certificateRequested();
///////////////////////////////////////////////////////////////////////////////////////////
//
// TODO -- DigiCert will provide API to do this in more efficient way
//
/*
//wait for a while before start pinging (per Greg)
try {
log.debug("Sleeping for 5 seconds");
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
*/
//wait until all certificates are issued (or timeout)
log.debug("start looking for certificate that's issued");
int timeout_msec = 5*60*1000;
Date start = new Date();
while(true) {
//wait few seconds between each loops
try {
log.debug("Sleeping for 5 seconds");
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
//loop all certs - count number of certificates issued so far
int issued = 0;
for(int c = 0; c < certs.length; ++c) {
Certificate cert = certs[c];
if(cert.pkcs7 == null) {
try {
//WARNING - this resets csr stored in current cert
log.debug("Checking to see if OrderID:" + cert.serial + " has been issued");
cert = retrieveByOrderID(cert.serial);
if(cert != null) {
//found new certificate issued
certs[c] = cert;
issued++;
callback.certificateSigned(cert, c);
}
} catch(DigicertCPException e) {
//TODO - need to ask DigiCert to give me more specific error code so that I can distinguish between real error v.s. need_wait
log.info("Failed to retrieve cert for order ID:" + cert.serial + ". probably not yet issued.. ignoring");
}
} else {
issued++;
}
}
if(certs.length == issued) {
//all issued.
return;
}
//check timeout
Date now = new Date();
if(now.getTime() - start.getTime() > timeout_msec) {
//timed out..
throw new CertificateProviderException("DigiCert didn't return certificate after "+(timeout_msec/1000)+" seconds");
}
/*
//if we have less than 5 cert, wait few seconds between each loop in order to avoid
//hitting digicert too often on the same cert
if(certs.length - issued < 5) {
log.debug(issued + " issued out of " + certs.length + " requests... waiting for 5 second before re-trying");
try {
Thread.sleep(1000*5);
} catch (InterruptedException e) {
log.error("Sleep interrupted", e);
}
}
*/
}
}
private HttpClient createHttpClient() {
HttpClient cl = new HttpClient();
//cl.getParams().setParameter("http.protocol.single-cookie-header", true);
//cl.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
//cl.getHttpConnectionManager().getParams().setConnectionTimeout(1000*10);
cl.getParams().setParameter("http.useragent", "OIM (OSG Information Management System)");
//cl.getParams().setParameter("http.contenttype", "application/x-www-form-urlencoded")
return cl;
}
//used to check if certificate has been issued
private String getDetail_under_construction(String order_id) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_certificate_details");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("id", order_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_certificate_details request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append(" Error while accessing: grid_certificate_details");
errors.append(" Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_certificate_details\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
log.debug("Successfully retrieved certificate detail for " + order_id);
return "success";
}
throw new DigicertCPException("Unknown return code from grid_certificate_details: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_certificate_details request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_certificate_details request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_certificate_details", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_certificate_details", e);
}
}
private Document parseXML(InputStream in) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(in);
}
public Certificate requestUserCert(String csr, String cn, String email_address) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_email_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("email", email_address);
post.setParameter("full_name", cn);
post.setParameter("csr", csr);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_retrieve_host_cert request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append(" Error while accessing: grid_request_email_cert");
errors.append(" Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_email_cert\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
ICertificateSigner.Certificate cert = new ICertificateSigner.Certificate();
Element serial_e = (Element)ret.getElementsByTagName("serial").item(0);
cert.serial = serial_e.getTextContent();
Element certificate_e = (Element)ret.getElementsByTagName("certificate").item(0);
cert.certificate = certificate_e.getTextContent();
Element intermediate_e = (Element)ret.getElementsByTagName("intermediate").item(0);
cert.intermediate = intermediate_e.getTextContent();
Element pkcs7_e = (Element)ret.getElementsByTagName("pkcs7").item(0);
cert.pkcs7 = pkcs7_e.getTextContent();
return cert;
}
throw new DigicertCPException("Unknown return code from grid_request_email_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_email_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_email_certrequest", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_email_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_email_cert", e);
}
}
private String requestHostCert(String csr, String service_name, String cn) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_host_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("common_name", cn);
//post.setParameter("sans", "a.digicert.com,b.digicert.com,c.digicert.com");
if(service_name != null) {
post.setParameter("service_name", service_name);
}
post.setParameter("csr", csr);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_request_host_cert request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append("Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_host_cert..\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
Element request_id_e = (Element)ret.getElementsByTagName("request_id").item(0);
String request_id = request_id_e.getTextContent();
System.out.println("Obtained Digicert Request ID:" + request_id); //like "15757"
return request_id;
}
throw new DigicertCPException("Unknown return code from grid_request_host_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_host_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_host_cert request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_cert", e);
}
}
private String approve(String request_id, String comment) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_approve_request");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("comment", comment);
post.setParameter("request_id", request_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
//System.out.println("failed to execute grid_approve_request request");
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_approve_request\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
Element order_id_e = (Element)ret.getElementsByTagName("order_id").item(0);
String order_id = order_id_e.getTextContent();
return order_id;
}
throw new DigicertCPException("Unknown return code from grid_approve_request: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_approve_request request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_approve_request request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_approve_request", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_approve_request", e);
}
}
private Certificate retrieveByOrderID(String order_id) throws DigicertCPException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_retrieve_host_cert");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("id", order_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_retrieve_host_cert\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
ICertificateSigner.Certificate cert = new ICertificateSigner.Certificate();
Element serial_e = (Element)ret.getElementsByTagName("serial").item(0);
cert.serial = serial_e.getTextContent();
Element certificate_e = (Element)ret.getElementsByTagName("certificate").item(0);
cert.certificate = certificate_e.getTextContent();
Element intermediate_e = (Element)ret.getElementsByTagName("intermediate").item(0);
cert.intermediate = intermediate_e.getTextContent();
Element pkcs7_e = (Element)ret.getElementsByTagName("pkcs7").item(0);
cert.pkcs7 = pkcs7_e.getTextContent();
return cert;
}
throw new DigicertCPException("Unknown return code for grid_retrieve_host_cert: " +result.getTextContent());
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_retrieve_host_cert request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_retrieve_host_cert request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_retrieve_host_cert", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_retrieve_host_cert", e);
}
}
@Override
public void revokeHostCertificate(String serial_id) throws CertificateProviderException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_request_host_revoke");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("serial", serial_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_request_host_revoke\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
//nothing particular to do
} else {
throw new DigicertCPException("Unknown return code from grid_request_host_revoke: " +result.getTextContent());
}
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_request_host_revoke request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_request_host_revoke request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_revoke", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_request_host_revoke", e);
}
}
@Override
public void revokeUserCertificate(String serial_id) throws CertificateProviderException {
HttpClient cl = createHttpClient();
PostMethod post = new PostMethod("https://www.digicert.com/enterprise/api/?action=grid_email_revoke");
post.addParameter("customer_name", StaticConfig.conf.getProperty("digicert.customer_name"));
post.setParameter("customer_api_key", StaticConfig.conf.getProperty("digicert.customer_api_key"));
post.setParameter("response_type", "xml");
post.setParameter("validity", "1"); //security by obscurity -- from the DigiCert dev team
post.setParameter("serial", serial_id);
post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
try {
cl.executeMethod(post);
Document ret = parseXML(post.getResponseBodyAsStream());
NodeList result_nl = ret.getElementsByTagName("result");
Element result = (Element)result_nl.item(0);
if(result.getTextContent().equals("failure")) {
NodeList error_code_nl = ret.getElementsByTagName("error_code");
StringBuffer errors = new StringBuffer();
for(int i = 0;i < error_code_nl.getLength(); ++i) {
Element error_code = (Element)error_code_nl.item(i);
Element code = (Element)error_code.getElementsByTagName("code").item(0);
Element description = (Element)error_code.getElementsByTagName("description").item(0);
errors.append("Code:" + code.getTextContent());
errors.append(" Description:" + description.getTextContent());
errors.append("\n");
}
throw new DigicertCPException("Request failed for grid_email_revoke\n" + errors.toString());
} else if(result.getTextContent().equals("success")) {
//nothing particular to do
} else {
throw new DigicertCPException("Unknown return code from grid_email_revoke: " +result.getTextContent());
}
} catch (HttpException e) {
throw new DigicertCPException("Failed to make grid_email_revoke request", e);
} catch (IOException e) {
throw new DigicertCPException("Failed to make grid_email_revoke request", e);
} catch (ParserConfigurationException e) {
throw new DigicertCPException("Failed to parse returned String from grid_email_revoke", e);
} catch (SAXException e) {
throw new DigicertCPException("Failed to parse returned String from grid_email_revoke", e);
}
}
}
| Added capability to configure whihc hash algorithm (sha1/sha256) to request to digicert via oim.conf (OSGPKI-328)
| src/edu/iu/grid/oim/model/cert/DigicertCertificateSigner.java | Added capability to configure whihc hash algorithm (sha1/sha256) to request to digicert via oim.conf (OSGPKI-328) | <ide><path>rc/edu/iu/grid/oim/model/cert/DigicertCertificateSigner.java
<ide> post.setParameter("email", email_address);
<ide> post.setParameter("full_name", cn);
<ide> post.setParameter("csr", csr);
<add> post.setParameter("hash", StaticConfig.conf.getProperty("digicert.hash"));
<ide>
<ide> post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
<ide>
<ide> post.setParameter("service_name", service_name);
<ide> }
<ide> post.setParameter("csr", csr);
<add> post.setParameter("hash", StaticConfig.conf.getProperty("digicert.hash"));
<ide>
<ide> post.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
<ide> |
|
Java | apache-2.0 | 076d0334c4e1ca8471a8e25c0a02bccce665f13b | 0 | real-logic/Agrona | /*
* Copyright 2014-2020 Real Logic Limited.
*
* 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
*
* https://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.
*/
package org.agrona;
import org.junit.jupiter.api.Test;
import static org.agrona.SystemUtil.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.core.Is.is;
import static org.junit.jupiter.api.Assertions.*;
public class SystemUtilTest
{
@Test
public void shouldParseSizesWithSuffix()
{
assertEquals(1L, parseSize("", "1"));
assertEquals(1024L, parseSize("", "1k"));
assertEquals(1024L, parseSize("", "1K"));
assertEquals(1024L * 1024L, parseSize("", "1m"));
assertEquals(1024L * 1024L, parseSize("", "1M"));
assertEquals(1024L * 1024L * 1024L, parseSize("", "1g"));
assertEquals(1024L * 1024L * 1024L, parseSize("", "1G"));
}
@Test
public void shouldParseTimesWithSuffix()
{
assertEquals(1L, parseDuration("", "1"));
assertEquals(1L, parseDuration("", "1ns"));
assertEquals(1L, parseDuration("", "1NS"));
assertEquals(1000L, parseDuration("", "1us"));
assertEquals(1000L, parseDuration("", "1US"));
assertEquals(1000L * 1000, parseDuration("", "1ms"));
assertEquals(1000L * 1000, parseDuration("", "1MS"));
assertEquals(1000L * 1000 * 1000, parseDuration("", "1s"));
assertEquals(1000L * 1000 * 1000, parseDuration("", "1S"));
assertEquals(12L * 1000 * 1000 * 1000, parseDuration("", "12S"));
}
@Test
public void shouldThrowWhenParseTimeHasBadSuffix()
{
assertThrows(NumberFormatException.class, () -> parseDuration("", "1g"));
}
@Test
public void shouldThrowWhenParseTimeHasBadTwoLetterSuffix()
{
assertThrows(NumberFormatException.class, () -> parseDuration("", "1zs"));
}
@Test
public void shouldThrowWhenParseSizeOverflows()
{
assertThrows(NumberFormatException.class, () -> parseSize("", 8589934592L + "g"));
}
@Test
public void shouldDoNothingToSystemPropsWhenLoadingFileWhichDoesNotExist()
{
final int originalSystemPropSize = System.getProperties().size();
loadPropertiesFile("$unknown-file$");
assertEquals(originalSystemPropSize, System.getProperties().size());
}
@Test
public void shouldMergeMultiplePropFilesTogether()
{
assertThat(System.getProperty("TestFileA.foo"), is(emptyOrNullString()));
assertThat(System.getProperty("TestFileB.foo"), is(emptyOrNullString()));
try
{
loadPropertiesFiles("TestFileA.properties", "TestFileB.properties");
assertEquals("AAA", System.getProperty("TestFileA.foo"));
assertEquals("BBB", System.getProperty("TestFileB.foo"));
}
finally
{
System.clearProperty("TestFileA.foo");
System.clearProperty("TestFileB.foo");
}
}
@Test
public void shouldOverrideSystemPropertiesWithConfigFromPropFile()
{
System.setProperty("TestFileA.foo", "ToBeOverridden");
assertEquals("ToBeOverridden", System.getProperty("TestFileA.foo"));
try
{
loadPropertiesFiles("TestFileA.properties");
assertEquals("AAA", System.getProperty("TestFileA.foo"));
}
finally
{
System.clearProperty("TestFileA.foo");
}
}
@Test
public void shouldNotOverrideSystemPropertiesWithConfigFromPropFile()
{
System.setProperty("TestFileA.foo", "ToBeNotOverridden");
assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
try
{
loadPropertiesFile(PropertyAction.PRESERVE, "TestFileA.properties");
assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
}
finally
{
System.clearProperty("TestFileA.foo");
}
}
@Test
void shouldReturnPid()
{
assertNotEquals(PID_NOT_FOUND, getPid());
}
}
| agrona/src/test/java/org/agrona/SystemUtilTest.java | /*
* Copyright 2014-2020 Real Logic Limited.
*
* 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
*
* https://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.
*/
package org.agrona;
import org.junit.jupiter.api.Test;
import static org.agrona.SystemUtil.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.core.Is.is;
import static org.junit.jupiter.api.Assertions.*;
public class SystemUtilTest
{
@Test
public void shouldParseSizesWithSuffix()
{
assertEquals(1L, parseSize("", "1"));
assertEquals(1024L, parseSize("", "1k"));
assertEquals(1024L, parseSize("", "1K"));
assertEquals(1024L * 1024L, parseSize("", "1m"));
assertEquals(1024L * 1024L, parseSize("", "1M"));
assertEquals(1024L * 1024L * 1024L, parseSize("", "1g"));
assertEquals(1024L * 1024L * 1024L, parseSize("", "1G"));
}
@Test
public void shouldParseTimesWithSuffix()
{
assertEquals(1L, parseDuration("", "1"));
assertEquals(1L, parseDuration("", "1ns"));
assertEquals(1L, parseDuration("", "1NS"));
assertEquals(1000L, parseDuration("", "1us"));
assertEquals(1000L, parseDuration("", "1US"));
assertEquals(1000L * 1000, parseDuration("", "1ms"));
assertEquals(1000L * 1000, parseDuration("", "1MS"));
assertEquals(1000L * 1000 * 1000, parseDuration("", "1s"));
assertEquals(1000L * 1000 * 1000, parseDuration("", "1S"));
assertEquals(12L * 1000 * 1000 * 1000, parseDuration("", "12S"));
}
@Test
public void shouldThrowWhenParseTimeHasBadSuffix()
{
assertThrows(NumberFormatException.class, () -> parseDuration("", "1g"));
}
@Test
public void shouldThrowWhenParseTimeHasBadTwoLetterSuffix()
{
assertThrows(NumberFormatException.class, () -> parseDuration("", "1zs"));
}
@Test
public void shouldThrowWhenParseSizeOverflows()
{
assertThrows(NumberFormatException.class, () -> parseSize("", 8589934592L + "g"));
}
@Test
public void shouldDoNothingToSystemPropsWhenLoadingFileWhichDoesNotExist()
{
final int originalSystemPropSize = System.getProperties().size();
loadPropertiesFile("$unknown-file$");
assertEquals(originalSystemPropSize, System.getProperties().size());
}
@Test
public void shouldMergeMultiplePropFilesTogether()
{
assertThat(System.getProperty("TestFileA.foo"), is(emptyOrNullString()));
assertThat(System.getProperty("TestFileB.foo"), is(emptyOrNullString()));
loadPropertiesFiles("TestFileA.properties", "TestFileB.properties");
assertEquals("AAA", System.getProperty("TestFileA.foo"));
assertEquals("BBB", System.getProperty("TestFileB.foo"));
}
@Test
public void shouldOverrideSystemPropertiesWithConfigFromPropFile()
{
System.setProperty("TestFileA.foo", "ToBeOverridden");
assertEquals("ToBeOverridden", System.getProperty("TestFileA.foo"));
loadPropertiesFile("TestFileA.properties");
assertEquals("AAA", System.getProperty("TestFileA.foo"));
System.clearProperty("TestFileA.foo");
}
@Test
public void shouldNotOverrideSystemPropertiesWithConfigFromPropFile()
{
System.setProperty("TestFileA.foo", "ToBeNotOverridden");
assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
loadPropertiesFile(PropertyAction.PRESERVE, "TestFileA.properties");
assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
System.clearProperty("TestFileA.foo");
}
@Test
void shouldReturnPid()
{
assertNotEquals(PID_NOT_FOUND, getPid());
}
}
| [Java] Clean up after setting system properties. Issue #226.
| agrona/src/test/java/org/agrona/SystemUtilTest.java | [Java] Clean up after setting system properties. Issue #226. | <ide><path>grona/src/test/java/org/agrona/SystemUtilTest.java
<ide> final int originalSystemPropSize = System.getProperties().size();
<ide>
<ide> loadPropertiesFile("$unknown-file$");
<del>
<ide> assertEquals(originalSystemPropSize, System.getProperties().size());
<ide> }
<ide>
<ide> assertThat(System.getProperty("TestFileA.foo"), is(emptyOrNullString()));
<ide> assertThat(System.getProperty("TestFileB.foo"), is(emptyOrNullString()));
<ide>
<del> loadPropertiesFiles("TestFileA.properties", "TestFileB.properties");
<del>
<del> assertEquals("AAA", System.getProperty("TestFileA.foo"));
<del> assertEquals("BBB", System.getProperty("TestFileB.foo"));
<add> try
<add> {
<add> loadPropertiesFiles("TestFileA.properties", "TestFileB.properties");
<add> assertEquals("AAA", System.getProperty("TestFileA.foo"));
<add> assertEquals("BBB", System.getProperty("TestFileB.foo"));
<add> }
<add> finally
<add> {
<add> System.clearProperty("TestFileA.foo");
<add> System.clearProperty("TestFileB.foo");
<add> }
<ide> }
<ide>
<ide> @Test
<ide> System.setProperty("TestFileA.foo", "ToBeOverridden");
<ide> assertEquals("ToBeOverridden", System.getProperty("TestFileA.foo"));
<ide>
<del> loadPropertiesFile("TestFileA.properties");
<del>
<del> assertEquals("AAA", System.getProperty("TestFileA.foo"));
<del>
<del> System.clearProperty("TestFileA.foo");
<add> try
<add> {
<add> loadPropertiesFiles("TestFileA.properties");
<add> assertEquals("AAA", System.getProperty("TestFileA.foo"));
<add> }
<add> finally
<add> {
<add> System.clearProperty("TestFileA.foo");
<add> }
<ide> }
<ide>
<ide> @Test
<ide> System.setProperty("TestFileA.foo", "ToBeNotOverridden");
<ide> assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
<ide>
<del> loadPropertiesFile(PropertyAction.PRESERVE, "TestFileA.properties");
<del> assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
<del>
<del> System.clearProperty("TestFileA.foo");
<add> try
<add> {
<add> loadPropertiesFile(PropertyAction.PRESERVE, "TestFileA.properties");
<add> assertEquals("ToBeNotOverridden", System.getProperty("TestFileA.foo"));
<add> }
<add> finally
<add> {
<add> System.clearProperty("TestFileA.foo");
<add> }
<ide> }
<ide>
<ide> @Test |
|
Java | mit | ed8f398a7b4fda3bc4a49513f3d0a6bc52b69460 | 0 | oscarguindzberg/multibit-hd,akonring/multibit-hd-modified,bitcoin-solutions/multibit-hd,bitcoin-solutions/multibit-hd,oscarguindzberg/multibit-hd,oscarguindzberg/multibit-hd,akonring/multibit-hd-modified,akonring/multibit-hd-modified,bitcoin-solutions/multibit-hd | package org.multibit.hd.core.error_reporting;
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.eventbus.SubscriberExceptionContext;
import com.google.common.eventbus.SubscriberExceptionHandler;
import com.google.common.io.Files;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.text.WordUtils;
import org.multibit.hd.core.events.CoreEvents;
import org.multibit.hd.core.events.ShutdownEvent;
import org.multibit.hd.core.logging.LogbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
/**
* <p>Exception handler to provide the following to application:</p>
* <ul>
* <li>Displays a critical failure dialog to the user and handles process of bug reporting</li>
* </ul>
*
* @since 0.0.1
*/
@SuppressFBWarnings({"DM_EXIT"})
public class ExceptionHandler extends EventQueue implements Thread.UncaughtExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(ExceptionHandler.class);
/**
* <p>Set this as the default uncaught exception handler</p>
*/
public static void registerExceptionHandler() {
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
System.setProperty("sun.awt.exception.handler", ExceptionHandler.class.getName());
}
/**
* <p>The handler of last resort when a programming error has caused an uncaught exception to occur</p>
*
* @param t The cause of the problem
*/
@SuppressWarnings("unchecked")
public static void handleThrowable(Throwable t) {
log.error("Uncaught exception", t);
final String message;
if (t.getLocalizedMessage() == null || t.getLocalizedMessage().length() == 0) {
message = "Fatal: " + t.getClass();
} else {
message = t.getLocalizedMessage();
}
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
try {
// Internationalisation and layout issues require a dynamic invocation
// of a class present in the Swing module
Class nativeApplicationClass = Class.forName("org.multibit.hd.ui.error_reporting.ErrorReportingDialog");
// Instantiate through newInstance() and supply constructor arguments
// Dialog will show and handle all further requirements including hard shutdown
nativeApplicationClass.getDeclaredConstructor(String.class).newInstance(message);
} catch (Throwable t1) {
log.error("Unable to use standard error reporting dialog.", t1);
try {
// This should never happen due to static binding of the Swing library
JOptionPane.showMessageDialog(
null, "Oh Snap!\n\nA serious error has occurred with the following message:\n" + WordUtils.wrap(message, 30),
"Error", JOptionPane
.ERROR_MESSAGE);
// Fire a hard shutdown after dialog closes with emergency fallback
CoreEvents.fireShutdownEvent(ShutdownEvent.ShutdownType.HARD);
} catch (Throwable t2) {
log.error("Unable to use fallback error reporting dialog. Forcing immediate shutdown.", t2);
// Safest option at this point is an emergency shutdown
System.exit(-1);
}
}
}
});
}
@Override
protected void dispatchEvent(AWTEvent newEvent) {
try {
super.dispatchEvent(newEvent);
} catch (Throwable t) {
handleThrowable(t);
}
}
@Override
public void uncaughtException(Thread t, Throwable e) {
handleThrowable(e);
}
/**
* @return A subscriber exception handler for the Guava event bus
*/
public static SubscriberExceptionHandler newSubscriberExceptionHandler() {
return new SubscriberExceptionHandler() {
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
// This is not serious enough to concern the user
log.error(exception.getMessage(), exception);
}
};
}
/**
* Reads the current logging file (obtained through Logback) as a String
*/
public static String readCurrentLogfile() {
Optional<File> currentLoggingFile = LogbackFactory.getCurrentLoggingFile();
if (currentLoggingFile.isPresent()) {
// Read it
try {
return Files.toString(currentLoggingFile.get(), Charsets.UTF_8);
} catch (IOException e) {
return "Current log file not available";
}
}
return "Current log file not available";
}
/**
* @param userNotes The additional user notes to upload
*/
public static void handleErrorReportUpload(String userNotes) {
Optional<File> currentLoggingFile = LogbackFactory.getCurrentLoggingFile();
if (currentLoggingFile.isPresent()) {
// Read and encrypt it as ASCII Armor
}
}
}
| mbhd-core/src/main/java/org/multibit/hd/core/error_reporting/ExceptionHandler.java | package org.multibit.hd.core.error_reporting;
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.eventbus.SubscriberExceptionContext;
import com.google.common.eventbus.SubscriberExceptionHandler;
import com.google.common.io.Files;
import org.apache.commons.lang3.text.WordUtils;
import org.multibit.hd.core.events.CoreEvents;
import org.multibit.hd.core.events.ShutdownEvent;
import org.multibit.hd.core.logging.LogbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
/**
* <p>Exception handler to provide the following to application:</p>
* <ul>
* <li>Displays a critical failure dialog to the user and handles process of bug reporting</li>
* </ul>
*
* @since 0.0.1
*/
public class ExceptionHandler extends EventQueue implements Thread.UncaughtExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(ExceptionHandler.class);
/**
* <p>Set this as the default uncaught exception handler</p>
*/
public static void registerExceptionHandler() {
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
System.setProperty("sun.awt.exception.handler", ExceptionHandler.class.getName());
}
/**
* <p>The handler of last resort when a programming error has caused an uncaught exception to occur</p>
*
* @param t The cause of the problem
*/
@SuppressWarnings("unchecked")
public static void handleThrowable(Throwable t) {
log.error("Uncaught exception", t);
final String message;
if (t.getLocalizedMessage() == null || t.getLocalizedMessage().length() == 0) {
message = "Fatal: " + t.getClass();
} else {
message = t.getLocalizedMessage();
}
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
try {
// Internationalisation and layout issues require a dynamic invocation
// of a class present in the Swing module
Class nativeApplicationClass = Class.forName("org.multibit.hd.ui.error_reporting.ErrorReportingDialog");
// Instantiate through newInstance() and supply constructor arguments
// Dialog will show and handle all further requirements including hard shutdown
nativeApplicationClass.getDeclaredConstructor(String.class).newInstance(message);
} catch (Throwable t1) {
log.error("Unable to use standard error reporting dialog.", t1);
try {
// This should never happen due to static binding of the Swing library
JOptionPane.showMessageDialog(
null, "Oh Snap!\n\nA serious error has occurred with the following message:\n" + WordUtils.wrap(message, 30),
"Error", JOptionPane
.ERROR_MESSAGE);
// Fire a hard shutdown after dialog closes with emergency fallback
CoreEvents.fireShutdownEvent(ShutdownEvent.ShutdownType.HARD);
} catch (Throwable t2) {
log.error("Unable to use fallback error reporting dialog. Forcing immediate shutdown.", t2);
// Safest option at this point is an emergency shutdown
System.exit(-1);
}
}
}
});
}
@Override
protected void dispatchEvent(AWTEvent newEvent) {
try {
super.dispatchEvent(newEvent);
} catch (Throwable t) {
handleThrowable(t);
}
}
@Override
public void uncaughtException(Thread t, Throwable e) {
handleThrowable(e);
}
/**
* @return A subscriber exception handler for the Guava event bus
*/
public static SubscriberExceptionHandler newSubscriberExceptionHandler() {
return new SubscriberExceptionHandler() {
@Override
public void handleException(Throwable exception, SubscriberExceptionContext context) {
// This is not serious enough to concern the user
log.error(exception.getMessage(), exception);
}
};
}
/**
* Reads the current logging file (obtained through Logback) as a String
*/
public static String readCurrentLogfile() {
Optional<File> currentLoggingFile = LogbackFactory.getCurrentLoggingFile();
if (currentLoggingFile.isPresent()) {
// Read it
try {
return Files.toString(currentLoggingFile.get(), Charsets.UTF_8);
} catch (IOException e) {
return "Current log file not available";
}
}
return "Current log file not available";
}
/**
* @param userNotes The additional user notes to upload
*/
public static void handleErrorReportUpload(String userNotes) {
Optional<File> currentLoggingFile = LogbackFactory.getCurrentLoggingFile();
if (currentLoggingFile.isPresent()) {
// Read and encrypt it as ASCII Armor
}
}
}
| #168 Fix Findbugs complaint about System.exit()
| mbhd-core/src/main/java/org/multibit/hd/core/error_reporting/ExceptionHandler.java | #168 Fix Findbugs complaint about System.exit() | <ide><path>bhd-core/src/main/java/org/multibit/hd/core/error_reporting/ExceptionHandler.java
<ide> import com.google.common.eventbus.SubscriberExceptionContext;
<ide> import com.google.common.eventbus.SubscriberExceptionHandler;
<ide> import com.google.common.io.Files;
<add>import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
<ide> import org.apache.commons.lang3.text.WordUtils;
<ide> import org.multibit.hd.core.events.CoreEvents;
<ide> import org.multibit.hd.core.events.ShutdownEvent;
<ide> *
<ide> * @since 0.0.1
<ide> */
<add>@SuppressFBWarnings({"DM_EXIT"})
<ide> public class ExceptionHandler extends EventQueue implements Thread.UncaughtExceptionHandler {
<ide>
<ide> private static final Logger log = LoggerFactory.getLogger(ExceptionHandler.class); |
|
Java | apache-2.0 | 5e6d68037960a1e814d5a65ff86949e076d57767 | 0 | realityforge/jml,realityforge/jml | package jamex.link;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import org.junit.Test;
public class MessageLinkTestCase
extends AbstractBrokerBasedTestCase
{
static final String HEADER_KEY = "MyHeader";
@Test
public void transferFromInputQueueToOutputQueue()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, null );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputQueueToOutputQueueWithSelector()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, HEADER_KEY + " <= 2" );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 3 );
// Ensure that those not matching selector are still in source queue
collectResults( TestHelper.QUEUE_1_NAME, false ).expectMessageCount( 2 );
link.stop();
}
@Test
public void transferFromInputQueueToOutputTopic()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.TOPIC_2_NAME, true );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, null );
link.setOutputTopic( TestHelper.TOPIC_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputQueue()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, null );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputQueueWithSelector()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageCollector inputCollector = collectResults( TestHelper.TOPIC_1_NAME, true );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, HEADER_KEY + " <= 2" );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 3 );
// Check that 5 went through input even if only 3 flowed through
inputCollector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputTopic()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.TOPIC_2_NAME, true );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, null );
link.setOutputTopic( TestHelper.TOPIC_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputTopicWithDurableSubscription()
throws Exception
{
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, "MySubscriptionName", null );
link.setOutputTopic( TestHelper.TOPIC_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
link.stop();
// Should work fine as durable subscription exists
createSession().unsubscribe( "MySubscriptionName" );
try
{
createSession().unsubscribe( "MySubscriptionName" );
}
catch( Exception e )
{
//Should fail as the subscription has already been removed
}
}
private static void publishMessage( final Session session,
final Destination destination,
final String messageContent,
final Object headerValue )
throws Exception
{
final MessageProducer producer = session.createProducer( destination );
final Message message = session.createTextMessage( messageContent );
message.setObjectProperty( HEADER_KEY, headerValue );
// Disable generation of ids as we don't care about them
// (Actually ignored by OMQ)
producer.setDisableMessageID( true );
// Disable generation of approximate transmit timestamps as we don't care about them
producer.setDisableMessageTimestamp( true );
producer.setPriority( 1 );
producer.setDeliveryMode( DeliveryMode.NON_PERSISTENT );
producer.send( message );
producer.close();
}
private void produceMessages( final String channelName, final boolean topic, final int messageCount )
throws Exception
{
final Session session = createSession();
final Destination destination = createDestination( session, channelName, topic );
for( int i = 0; i < messageCount; i++ )
{
publishMessage( session, destination, "Message-" + i, i );
}
}
private MessageCollector collectResults( final String channelName, final boolean topic )
throws Exception
{
final Session session = createSession();
final Destination destination = createDestination( session, channelName, topic );
final MessageConsumer consumer = session.createConsumer( destination );
final MessageCollector collector = new MessageCollector();
consumer.setMessageListener( collector );
return collector;
}
private Destination createDestination( final Session session, final String channelName, final boolean topic )
throws JMSException
{
return topic ? session.createTopic( channelName ) : session.createQueue( channelName );
}
}
| link/src/test/java/jamex/link/MessageLinkTestCase.java | package jamex.link;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import org.junit.Test;
public class MessageLinkTestCase
extends AbstractBrokerBasedTestCase
{
static final String HEADER_KEY = "MyHeader";
@Test
public void transferFromInputQueueToOutputQueue()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, null );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputQueueToOutputQueueWithSelector()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, HEADER_KEY + " <= 2" );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 3 );
// Ensure that those not matching selector are still in source queue
collectResults( TestHelper.QUEUE_1_NAME, false ).expectMessageCount( 2 );
link.stop();
}
@Test
public void transferFromInputQueueToOutputTopic()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.TOPIC_2_NAME, true );
final MessageLink link = new MessageLink();
link.setInputQueue( TestHelper.QUEUE_1_NAME, null );
link.setOutputTopic( TestHelper.TOPIC_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.QUEUE_1_NAME, false, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputQueue()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, null );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputQueueWithSelector()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.QUEUE_2_NAME, false );
final MessageCollector inputCollector = collectResults( TestHelper.TOPIC_1_NAME, true );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, HEADER_KEY + " <= 2" );
link.setOutputQueue( TestHelper.QUEUE_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 3 );
// Check that 5 went through input even if only 3 flowed through
inputCollector.expectMessageCount( 5 );
link.stop();
}
@Test
public void transferFromInputTopicToOutputTopic()
throws Exception
{
final MessageCollector collector = collectResults( TestHelper.TOPIC_2_NAME, true );
final MessageLink link = new MessageLink();
link.setInputTopic( TestHelper.TOPIC_1_NAME, null, null );
link.setOutputTopic( TestHelper.TOPIC_2_NAME );
link.setName( "TestLink" );
link.start( createSession() );
produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
collector.expectMessageCount( 5 );
link.stop();
}
private static void publishMessage( final Session session,
final Destination destination,
final String messageContent,
final Object headerValue )
throws Exception
{
final MessageProducer producer = session.createProducer( destination );
final Message message = session.createTextMessage( messageContent );
message.setObjectProperty( HEADER_KEY, headerValue );
// Disable generation of ids as we don't care about them
// (Actually ignored by OMQ)
producer.setDisableMessageID( true );
// Disable generation of approximate transmit timestamps as we don't care about them
producer.setDisableMessageTimestamp( true );
producer.setPriority( 1 );
producer.setDeliveryMode( DeliveryMode.NON_PERSISTENT );
producer.send( message );
producer.close();
}
private void produceMessages( final String channelName, final boolean topic, final int messageCount )
throws Exception
{
final Session session = createSession();
final Destination destination = createDestination( session, channelName, topic );
for( int i = 0; i < messageCount; i++ )
{
publishMessage( session, destination, "Message-" + i, i );
}
}
private MessageCollector collectResults( final String channelName, final boolean topic )
throws Exception
{
final Session session = createSession();
final Destination destination = createDestination( session, channelName, topic );
final MessageConsumer consumer = session.createConsumer( destination );
final MessageCollector collector = new MessageCollector();
consumer.setMessageListener( collector );
return collector;
}
private Destination createDestination( final Session session, final String channelName, final boolean topic )
throws JMSException
{
return topic ? session.createTopic( channelName ) : session.createQueue( channelName );
}
}
| Add test for durable subscriptions
| link/src/test/java/jamex/link/MessageLinkTestCase.java | Add test for durable subscriptions | <ide><path>ink/src/test/java/jamex/link/MessageLinkTestCase.java
<ide> produceMessages( TestHelper.TOPIC_1_NAME, true, 5 );
<ide> collector.expectMessageCount( 5 );
<ide> link.stop();
<add> }
<add>
<add> @Test
<add> public void transferFromInputTopicToOutputTopicWithDurableSubscription()
<add> throws Exception
<add> {
<add> final MessageLink link = new MessageLink();
<add> link.setInputTopic( TestHelper.TOPIC_1_NAME, "MySubscriptionName", null );
<add> link.setOutputTopic( TestHelper.TOPIC_2_NAME );
<add> link.setName( "TestLink" );
<add>
<add> link.start( createSession() );
<add> link.stop();
<add>
<add> // Should work fine as durable subscription exists
<add> createSession().unsubscribe( "MySubscriptionName" );
<add>
<add> try
<add> {
<add> createSession().unsubscribe( "MySubscriptionName" );
<add> }
<add> catch( Exception e )
<add> {
<add> //Should fail as the subscription has already been removed
<add> }
<ide> }
<ide>
<ide> private static void publishMessage( final Session session, |
|
Java | lgpl-2.1 | fa2e093d5209d28fccb6f8690c8adc6efa5a5066 | 0 | AkshitaKukreja30/checkstyle,checkstyle/checkstyle,izishared/checkstyle,AkshitaKukreja30/checkstyle,rnveach/checkstyle,bansalayush/checkstyle,liscju/checkstyle,romani/checkstyle,ilanKeshet/checkstyle,bansalayush/checkstyle,sharang108/checkstyle,sharang108/checkstyle,sirdis/checkstyle,checkstyle/checkstyle,sabaka/checkstyle,romani/checkstyle,baratali/checkstyle,rnveach/checkstyle,AkshitaKukreja30/checkstyle,jochenvdv/checkstyle,vboerchers/checkstyle,izishared/checkstyle,vboerchers/checkstyle,sabaka/checkstyle,sirdis/checkstyle,romani/checkstyle,rnveach/checkstyle,checkstyle/checkstyle,romani/checkstyle,jochenvdv/checkstyle,sabaka/checkstyle,MEZk/checkstyle,liscju/checkstyle,baratali/checkstyle,romani/checkstyle,checkstyle/checkstyle,romani/checkstyle,rnveach/checkstyle,liscju/checkstyle,MEZk/checkstyle,jonmbake/checkstyle,vboerchers/checkstyle,bansalayush/checkstyle,sirdis/checkstyle,izishared/checkstyle,rnveach/checkstyle,rnveach/checkstyle,nikhilgupta23/checkstyle,nikhilgupta23/checkstyle,sharang108/checkstyle,jonmbake/checkstyle,nikhilgupta23/checkstyle,checkstyle/checkstyle,ilanKeshet/checkstyle,jonmbake/checkstyle,jochenvdv/checkstyle,checkstyle/checkstyle,MEZk/checkstyle,baratali/checkstyle,ilanKeshet/checkstyle | ////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2016 the original author or authors.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.api;
import com.puppycrawl.tools.checkstyle.grammars.GeneratedJavaTokenTypes;
/**
* Contains the constants for all the tokens contained in the Abstract
* Syntax Tree.
*
* <p>Implementation detail: This class has been introduced to break
* the circular dependency between packages.</p>
*
* @author Oliver Burn
* @author <a href="mailto:[email protected]">Peter Dobratz</a>
*/
public final class TokenTypes {
// The following three types are never part of an AST,
// left here as a reminder so nobody will read them accidentally
// These are the types that can actually occur in an AST
// it makes sense to register Checks for these types
/**
* The end of file token. This is the root node for the source
* file. It's children are an optional package definition, zero
* or more import statements, and one or more class or interface
* definitions.
*
* @see #PACKAGE_DEF
* @see #IMPORT
* @see #CLASS_DEF
* @see #INTERFACE_DEF
**/
public static final int EOF = GeneratedJavaTokenTypes.EOF;
/**
* Modifiers for type, method, and field declarations. The
* modifiers element is always present even though it may have no
* children.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java
* Language Specification, §8</a>
* @see #LITERAL_PUBLIC
* @see #LITERAL_PROTECTED
* @see #LITERAL_PRIVATE
* @see #ABSTRACT
* @see #LITERAL_STATIC
* @see #FINAL
* @see #LITERAL_TRANSIENT
* @see #LITERAL_VOLATILE
* @see #LITERAL_SYNCHRONIZED
* @see #LITERAL_NATIVE
* @see #STRICTFP
* @see #ANNOTATION
* @see #LITERAL_DEFAULT
**/
public static final int MODIFIERS = GeneratedJavaTokenTypes.MODIFIERS;
/**
* An object block. These are children of class, interface, enum,
* annotation and enum constant declarations.
* Also, object blocks are children of the new keyword when defining
* anonymous inner types.
*
* @see #LCURLY
* @see #INSTANCE_INIT
* @see #STATIC_INIT
* @see #CLASS_DEF
* @see #CTOR_DEF
* @see #METHOD_DEF
* @see #VARIABLE_DEF
* @see #RCURLY
* @see #INTERFACE_DEF
* @see #LITERAL_NEW
* @see #ENUM_DEF
* @see #ENUM_CONSTANT_DEF
* @see #ANNOTATION_DEF
**/
public static final int OBJBLOCK = GeneratedJavaTokenTypes.OBJBLOCK;
/**
* A list of statements.
*
* @see #RCURLY
* @see #EXPR
* @see #LABELED_STAT
* @see #LITERAL_THROWS
* @see #LITERAL_RETURN
* @see #SEMI
* @see #METHOD_DEF
* @see #CTOR_DEF
* @see #LITERAL_FOR
* @see #LITERAL_WHILE
* @see #LITERAL_IF
* @see #LITERAL_ELSE
* @see #CASE_GROUP
**/
public static final int SLIST = GeneratedJavaTokenTypes.SLIST;
/**
* A constructor declaration.
*
* <p>For example:</p>
* <pre>
* public SpecialEntry(int value, String text)
* {
* this.value = value;
* this.text = text;
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--CTOR_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--IDENT (SpecialEntry)
* +--LPAREN (()
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (value)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (text)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--DOT (.)
* |
* +--LITERAL_THIS (this)
* +--IDENT (value)
* +--IDENT (value)
* +--SEMI (;)
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--DOT (.)
* |
* +--LITERAL_THIS (this)
* +--IDENT (text)
* +--IDENT (text)
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #OBJBLOCK
* @see #CLASS_DEF
**/
public static final int CTOR_DEF = GeneratedJavaTokenTypes.CTOR_DEF;
/**
* A method declaration. The children are modifiers, type parameters,
* return type, method name, parameter list, an optional throws list, and
* statement list. The statement list is omitted if the method
* declaration appears in an interface declaration. Method
* declarations may appear inside object blocks of class
* declarations, interface declarations, enum declarations,
* enum constant declarations or anonymous inner-class declarations.
*
* <p>For example:</p>
*
* <pre>
* public static int square(int x)
* {
* return x*x;
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_STATIC (static)
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (square)
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (x)
* +--SLIST ({)
* |
* +--LITERAL_RETURN (return)
* |
* +--EXPR
* |
* +--STAR (*)
* |
* +--IDENT (x)
* +--IDENT (x)
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #MODIFIERS
* @see #TYPE_PARAMETERS
* @see #TYPE
* @see #IDENT
* @see #PARAMETERS
* @see #LITERAL_THROWS
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int METHOD_DEF = GeneratedJavaTokenTypes.METHOD_DEF;
/**
* A field or local variable declaration. The children are
* modifiers, type, the identifier name, and an optional
* assignment statement.
*
* @see #MODIFIERS
* @see #TYPE
* @see #IDENT
* @see #ASSIGN
**/
public static final int VARIABLE_DEF =
GeneratedJavaTokenTypes.VARIABLE_DEF;
/**
* An instance initializer. Zero or more instance initializers
* may appear in class and enum definitions. This token will be a child
* of the object block of the declaring type.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.6">Java
* Language Specification§8.6</a>
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int INSTANCE_INIT =
GeneratedJavaTokenTypes.INSTANCE_INIT;
/**
* A static initialization block. Zero or more static
* initializers may be children of the object block of a class
* or enum declaration (interfaces cannot have static initializers). The
* first and only child is a statement list.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.7">Java
* Language Specification, §8.7</a>
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int STATIC_INIT =
GeneratedJavaTokenTypes.STATIC_INIT;
/**
* A type. This is either a return type of a method or a type of
* a variable or field. The first child of this element is the
* actual type. This may be a primitive type, an identifier, a
* dot which is the root of a fully qualified type, or an array of
* any of these. The second child may be type arguments to the type.
*
* @see #VARIABLE_DEF
* @see #METHOD_DEF
* @see #PARAMETER_DEF
* @see #IDENT
* @see #DOT
* @see #LITERAL_VOID
* @see #LITERAL_BOOLEAN
* @see #LITERAL_BYTE
* @see #LITERAL_CHAR
* @see #LITERAL_SHORT
* @see #LITERAL_INT
* @see #LITERAL_FLOAT
* @see #LITERAL_LONG
* @see #LITERAL_DOUBLE
* @see #ARRAY_DECLARATOR
* @see #TYPE_ARGUMENTS
**/
public static final int TYPE = GeneratedJavaTokenTypes.TYPE;
/**
* A class declaration.
*
* <p>For example:</p>
* <pre>
* public class MyClass
* implements Serializable
* {
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--CLASS_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_CLASS (class)
* +--IDENT (MyClass)
* +--EXTENDS_CLAUSE
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java
* Language Specification, §8</a>
* @see #MODIFIERS
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #IMPLEMENTS_CLAUSE
* @see #OBJBLOCK
* @see #LITERAL_NEW
**/
public static final int CLASS_DEF = GeneratedJavaTokenTypes.CLASS_DEF;
/**
* An interface declaration.
*
* <p>For example:</p>
*
* <pre>
* public interface MyInterface
* {
* }
*
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--INTERFACE_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_INTERFACE (interface)
* +--IDENT (MyInterface)
* +--EXTENDS_CLAUSE
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html">Java
* Language Specification, §9</a>
* @see #MODIFIERS
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #OBJBLOCK
**/
public static final int INTERFACE_DEF =
GeneratedJavaTokenTypes.INTERFACE_DEF;
/**
* The package declaration. This is optional, but if it is
* included, then there is only one package declaration per source
* file and it must be the first non-comment in the file. A package
* declaration may be annotated in which case the annotations comes
* before the rest of the declaration (and are the first children).
*
* <p>For example:</p>
*
* <pre>
* package com.puppycrawl.tools.checkstyle.api;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--PACKAGE_DEF (package)
* |
* +--ANNOTATIONS
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (com)
* +--IDENT (puppycrawl)
* +--IDENT (tools)
* +--IDENT (checkstyle)
* +--IDENT (api)
* +--SEMI (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4">Java
* Language Specification §7.4</a>
* @see #DOT
* @see #IDENT
* @see #SEMI
* @see #ANNOTATIONS
* @see FullIdent
**/
public static final int PACKAGE_DEF = GeneratedJavaTokenTypes.PACKAGE_DEF;
/**
* An array declaration.
*
* <p>If the array declaration represents a type, then the type of
* the array elements is the first child. Multidimensional arrays
* may be regarded as arrays of arrays. In other words, the first
* child of the array declaration is another array
* declaration.</p>
*
* <p>For example:</p>
* <pre>
* int[] x;
* </pre>
* <p>parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (x)
* +--SEMI (;)
* </pre>
*
* <p>The array declaration may also represent an inline array
* definition. In this case, the first child will be either an
* expression specifying the length of the array or an array
* initialization block.</p>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html">Java
* Language Specification §10</a>
* @see #TYPE
* @see #ARRAY_INIT
**/
public static final int ARRAY_DECLARATOR =
GeneratedJavaTokenTypes.ARRAY_DECLARATOR;
/**
* An extends clause. This appear as part of class and interface
* definitions. This element appears even if the
* <code>extends</code> keyword is not explicitly used. The child
* is an optional identifier.
*
* <p>For example:</p>
*
* <pre>
* extends java.util.LinkedList
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--EXTENDS_CLAUSE
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (util)
* +--IDENT (LinkedList)
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #CLASS_DEF
* @see #INTERFACE_DEF
* @see FullIdent
**/
public static final int EXTENDS_CLAUSE =
GeneratedJavaTokenTypes.EXTENDS_CLAUSE;
/**
* An implements clause. This always appears in a class or enum
* declaration, even if there are no implemented interfaces. The
* children are a comma separated list of zero or more
* identifiers.
*
* <p>For example:</p>
* <pre>
* implements Serializable, Comparable
* </pre>
* <p>parses as:</p>
* <pre>
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--COMMA (,)
* +--IDENT (Comparable)
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #COMMA
* @see #CLASS_DEF
* @see #ENUM_DEF
**/
public static final int IMPLEMENTS_CLAUSE =
GeneratedJavaTokenTypes.IMPLEMENTS_CLAUSE;
/**
* A list of parameters to a method or constructor. The children
* are zero or more parameter declarations separated by commas.
*
* <p>For example</p>
* <pre>
* int start, int end
* </pre>
* <p>parses as:</p>
* <pre>
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (start)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (end)
* </pre>
*
* @see #PARAMETER_DEF
* @see #COMMA
* @see #METHOD_DEF
* @see #CTOR_DEF
**/
public static final int PARAMETERS = GeneratedJavaTokenTypes.PARAMETERS;
/**
* A parameter declaration. The last parameter in a list of parameters may
* be variable length (indicated by the ELLIPSIS child node immediately
* after the TYPE child).
*
* @see #MODIFIERS
* @see #TYPE
* @see #IDENT
* @see #PARAMETERS
* @see #ELLIPSIS
**/
public static final int PARAMETER_DEF =
GeneratedJavaTokenTypes.PARAMETER_DEF;
/**
* A labeled statement.
*
* <p>For example:</p>
* <pre>
* outside: ;
* </pre>
* <p>parses as:</p>
* <pre>
* +--LABELED_STAT (:)
* |
* +--IDENT (outside)
* +--EMPTY_STAT (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.7">Java
* Language Specification, §14.7</a>
* @see #SLIST
**/
public static final int LABELED_STAT =
GeneratedJavaTokenTypes.LABELED_STAT;
/**
* A type-cast.
*
* <p>For example:</p>
* <pre>
* (String)it.next()
* </pre>
* <p>parses as:</p>
* <pre>
* +--TYPECAST (()
* |
* +--TYPE
* |
* +--IDENT (String)
* +--RPAREN ())
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (it)
* +--IDENT (next)
* +--ELIST
* +--RPAREN ())
* </pre>
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.16">Java
* Language Specification, §15.16</a>
* @see #EXPR
* @see #TYPE
* @see #TYPE_ARGUMENTS
* @see #RPAREN
**/
public static final int TYPECAST = GeneratedJavaTokenTypes.TYPECAST;
/**
* The array index operator.
*
* <p>For example:</p>
* <pre>
* ar[2] = 5;
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--INDEX_OP ([)
* |
* +--IDENT (ar)
* +--EXPR
* |
* +--NUM_INT (2)
* +--NUM_INT (5)
* +--SEMI (;)
* </pre>
*
* @see #EXPR
**/
public static final int INDEX_OP = GeneratedJavaTokenTypes.INDEX_OP;
/**
* The <code>++</code> (postfix increment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.1">Java
* Language Specification, §15.14.1</a>
* @see #EXPR
* @see #INC
**/
public static final int POST_INC = GeneratedJavaTokenTypes.POST_INC;
/**
* The <code>--</code> (postfix decrement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.2">Java
* Language Specification, §15.14.2</a>
* @see #EXPR
* @see #DEC
**/
public static final int POST_DEC = GeneratedJavaTokenTypes.POST_DEC;
/**
* A method call. A method call may have type arguments however these
* are attached to the appropriate node in the qualified method name.
*
* <p>For example:</p>
* <pre>
* Math.random()
* </pre>
*
* <p>parses as:
* <pre>
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (Math)
* +--IDENT (random)
* +--ELIST
* +--RPAREN ())
* </pre>
*
*
* @see #IDENT
* @see #TYPE_ARGUMENTS
* @see #DOT
* @see #ELIST
* @see #RPAREN
* @see FullIdent
**/
public static final int METHOD_CALL = GeneratedJavaTokenTypes.METHOD_CALL;
/**
* Part of Java 8 syntax. Method or constructor call without arguments.
* @see #DOUBLE_COLON
*/
public static final int METHOD_REF = GeneratedJavaTokenTypes.METHOD_REF;
/**
* An expression. Operators with lower precedence appear at a
* higher level in the tree than operators with higher precedence.
* Parentheses are siblings to the operator they enclose.
*
* <p>For example:</p>
* <pre>
* x = 4 + 3 * 5 + (30 + 26) / 4 + 5 % 4 + (1<<3);
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--NUM_INT (4)
* +--STAR (*)
* |
* +--NUM_INT (3)
* +--NUM_INT (5)
* +--DIV (/)
* |
* +--LPAREN (()
* +--PLUS (+)
* |
* +--NUM_INT (30)
* +--NUM_INT (26)
* +--RPAREN ())
* +--NUM_INT (4)
* +--MOD (%)
* |
* +--NUM_INT (5)
* +--NUM_INT (4)
* +--LPAREN (()
* +--SL (<<)
* |
* +--NUM_INT (1)
* +--NUM_INT (3)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #ELIST
* @see #ASSIGN
* @see #LPAREN
* @see #RPAREN
**/
public static final int EXPR = GeneratedJavaTokenTypes.EXPR;
/**
* An array initialization. This may occur as part of an array
* declaration or inline with <code>new</code>.
*
* <p>For example:</p>
* <pre>
* int[] y =
* {
* 1,
* 2,
* };
* </pre>
* <p>parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (y)
* +--ASSIGN (=)
* |
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_INT (2)
* +--COMMA (,)
* +--RCURLY (})
* +--SEMI (;)
* </pre>
*
* <p>Also consider:</p>
* <pre>
* int[] z = new int[]
* {
* 1,
* 2,
* };
* </pre>
* <p>which parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (z)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--LITERAL_INT (int)
* +--ARRAY_DECLARATOR ([)
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_INT (2)
* +--COMMA (,)
* +--RCURLY (})
* </pre>
*
* @see #ARRAY_DECLARATOR
* @see #TYPE
* @see #LITERAL_NEW
* @see #COMMA
**/
public static final int ARRAY_INIT = GeneratedJavaTokenTypes.ARRAY_INIT;
/**
* An import declaration. Import declarations are option, but
* must appear after the package declaration and before the first type
* declaration.
*
* <p>For example:</p>
*
* <pre>
* import java.io.IOException;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--IMPORT (import)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (io)
* +--IDENT (IOException)
* +--SEMI (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5">Java
* Language Specification §7.5</a>
* @see #DOT
* @see #IDENT
* @see #STAR
* @see #SEMI
* @see FullIdent
**/
public static final int IMPORT = GeneratedJavaTokenTypes.IMPORT;
/**
* The <code>-</code> (unary minus) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.4">Java
* Language Specification, §15.15.4</a>
* @see #EXPR
**/
public static final int UNARY_MINUS = GeneratedJavaTokenTypes.UNARY_MINUS;
/**
* The <code>+</code> (unary plus) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.3">Java
* Language Specification, §15.15.3</a>
* @see #EXPR
**/
public static final int UNARY_PLUS = GeneratedJavaTokenTypes.UNARY_PLUS;
/**
* A group of case clauses. Case clauses with no associated
* statements are grouped together into a case group. The last
* child is a statement list containing the statements to execute
* upon a match.
*
* <p>For example:</p>
* <pre>
* case 0:
* case 1:
* case 2:
* x = 3;
* break;
* </pre>
* <p>parses as:</p>
* <pre>
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (2)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--NUM_INT (3)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* </pre>
*
* @see #LITERAL_CASE
* @see #LITERAL_DEFAULT
* @see #LITERAL_SWITCH
**/
public static final int CASE_GROUP = GeneratedJavaTokenTypes.CASE_GROUP;
/**
* An expression list. The children are a comma separated list of
* expressions.
*
* @see #LITERAL_NEW
* @see #FOR_INIT
* @see #FOR_ITERATOR
* @see #EXPR
* @see #METHOD_CALL
* @see #CTOR_CALL
* @see #SUPER_CTOR_CALL
**/
public static final int ELIST = GeneratedJavaTokenTypes.ELIST;
/**
* A for loop initializer. This is a child of
* <code>LITERAL_FOR</code>. The children of this element may be
* a comma separated list of variable declarations, an expression
* list, or empty.
*
* @see #VARIABLE_DEF
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_INIT = GeneratedJavaTokenTypes.FOR_INIT;
/**
* A for loop condition. This is a child of
* <code>LITERAL_FOR</code>. The child of this element is an
* optional expression.
*
* @see #EXPR
* @see #LITERAL_FOR
**/
public static final int FOR_CONDITION =
GeneratedJavaTokenTypes.FOR_CONDITION;
/**
* A for loop iterator. This is a child of
* <code>LITERAL_FOR</code>. The child of this element is an
* optional expression list.
*
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_ITERATOR =
GeneratedJavaTokenTypes.FOR_ITERATOR;
/**
* The empty statement. This goes in place of an
* <code>SLIST</code> for a <code>for</code> or <code>while</code>
* loop body.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.6">Java
* Language Specification, §14.6</a>
* @see #LITERAL_FOR
* @see #LITERAL_WHILE
**/
public static final int EMPTY_STAT = GeneratedJavaTokenTypes.EMPTY_STAT;
/**
* The <code>final</code> keyword.
*
* @see #MODIFIERS
**/
public static final int FINAL = GeneratedJavaTokenTypes.FINAL;
/**
* The <code>abstract</code> keyword.
*
* @see #MODIFIERS
**/
public static final int ABSTRACT = GeneratedJavaTokenTypes.ABSTRACT;
/**
* The <code>strictfp</code> keyword.
*
* @see #MODIFIERS
**/
public static final int STRICTFP = GeneratedJavaTokenTypes.STRICTFP;
/**
* A super constructor call.
*
* @see #ELIST
* @see #RPAREN
* @see #SEMI
* @see #CTOR_CALL
**/
public static final int SUPER_CTOR_CALL =
GeneratedJavaTokenTypes.SUPER_CTOR_CALL;
/**
* A constructor call.
*
* <p>For example:</p>
* <pre>
* this(1);
* </pre>
* <p>parses as:</p>
* <pre>
* +--CTOR_CALL (this)
* |
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #ELIST
* @see #RPAREN
* @see #SEMI
* @see #SUPER_CTOR_CALL
**/
public static final int CTOR_CALL = GeneratedJavaTokenTypes.CTOR_CALL;
/**
* The statement terminator (<code>;</code>). Depending on the
* context, this make occur as a sibling, a child, or not at all.
*
* @see #PACKAGE_DEF
* @see #IMPORT
* @see #SLIST
* @see #ARRAY_INIT
* @see #LITERAL_FOR
**/
public static final int SEMI = GeneratedJavaTokenTypes.SEMI;
/**
* The <code>]</code> symbol.
*
* @see #INDEX_OP
* @see #ARRAY_DECLARATOR
**/
public static final int RBRACK = GeneratedJavaTokenTypes.RBRACK;
/**
* The <code>void</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_VOID =
GeneratedJavaTokenTypes.LITERAL_void;
/**
* The <code>boolean</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_BOOLEAN =
GeneratedJavaTokenTypes.LITERAL_boolean;
/**
* The <code>byte</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_BYTE =
GeneratedJavaTokenTypes.LITERAL_byte;
/**
* The <code>char</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_CHAR =
GeneratedJavaTokenTypes.LITERAL_char;
/**
* The <code>short</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_SHORT =
GeneratedJavaTokenTypes.LITERAL_short;
/**
* The <code>int</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_INT = GeneratedJavaTokenTypes.LITERAL_int;
/**
* The <code>float</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_FLOAT =
GeneratedJavaTokenTypes.LITERAL_float;
/**
* The <code>long</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_LONG =
GeneratedJavaTokenTypes.LITERAL_long;
/**
* The <code>double</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_DOUBLE =
GeneratedJavaTokenTypes.LITERAL_double;
/**
* An identifier. These can be names of types, subpackages,
* fields, methods, parameters, and local variables.
**/
public static final int IDENT = GeneratedJavaTokenTypes.IDENT;
/**
* The <code>.</code> (dot) operator.
*
* @see FullIdent
**/
public static final int DOT = GeneratedJavaTokenTypes.DOT;
/**
* The <code>*</code> (multiplication or wildcard) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5.2">Java
* Language Specification, §7.5.2</a>
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.1">Java
* Language Specification, §15.17.1</a>
* @see #EXPR
* @see #IMPORT
**/
public static final int STAR = GeneratedJavaTokenTypes.STAR;
/**
* The <code>private</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PRIVATE =
GeneratedJavaTokenTypes.LITERAL_private;
/**
* The <code>public</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PUBLIC =
GeneratedJavaTokenTypes.LITERAL_public;
/**
* The <code>protected</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PROTECTED =
GeneratedJavaTokenTypes.LITERAL_protected;
/**
* The <code>static</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_STATIC =
GeneratedJavaTokenTypes.LITERAL_static;
/**
* The <code>transient</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_TRANSIENT =
GeneratedJavaTokenTypes.LITERAL_transient;
/**
* The <code>native</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_NATIVE =
GeneratedJavaTokenTypes.LITERAL_native;
/**
* The <code>synchronized</code> keyword. This may be used as a
* modifier of a method or in the definition of a synchronized
* block.
*
* <p>For example:</p>
*
* <pre>
* synchronized(this)
* {
* x++;
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--LITERAL_SYNCHRONIZED (synchronized)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--LITERAL_THIS (this)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--POST_INC (++)
* |
* +--IDENT (x)
* +--SEMI (;)
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see #MODIFIERS
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #SLIST
* @see #RCURLY
**/
public static final int LITERAL_SYNCHRONIZED =
GeneratedJavaTokenTypes.LITERAL_synchronized;
/**
* The <code>volatile</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_VOLATILE =
GeneratedJavaTokenTypes.LITERAL_volatile;
/**
* The <code>class</code> keyword. This element appears both
* as part of a class declaration, and inline to reference a
* class object.
*
* <p>For example:</p>
*
* <pre>
* int.class
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--DOT (.)
* |
* +--LITERAL_INT (int)
* +--LITERAL_CLASS (class)
* </pre>
*
* @see #DOT
* @see #IDENT
* @see #CLASS_DEF
* @see FullIdent
**/
public static final int LITERAL_CLASS =
GeneratedJavaTokenTypes.LITERAL_class;
/**
* The <code>interface</code> keyword. This token appears in
* interface definition.
*
* @see #INTERFACE_DEF
**/
public static final int LITERAL_INTERFACE =
GeneratedJavaTokenTypes.LITERAL_interface;
/**
* A left (curly) brace (<code>{</code>).
*
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see #SLIST
**/
public static final int LCURLY = GeneratedJavaTokenTypes.LCURLY;
/**
* A right (curly) brace (<code>}</code>).
*
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see #SLIST
**/
public static final int RCURLY = GeneratedJavaTokenTypes.RCURLY;
/**
* The <code>,</code> (comma) operator.
*
* @see #ARRAY_INIT
* @see #FOR_INIT
* @see #FOR_ITERATOR
* @see #LITERAL_THROWS
* @see #IMPLEMENTS_CLAUSE
**/
public static final int COMMA = GeneratedJavaTokenTypes.COMMA;
/**
* A left parenthesis (<code>(</code>).
*
* @see #LITERAL_FOR
* @see #LITERAL_NEW
* @see #EXPR
* @see #LITERAL_SWITCH
* @see #LITERAL_CATCH
**/
public static final int LPAREN = GeneratedJavaTokenTypes.LPAREN;
/**
* A right parenthesis (<code>)</code>).
*
* @see #LITERAL_FOR
* @see #LITERAL_NEW
* @see #METHOD_CALL
* @see #TYPECAST
* @see #EXPR
* @see #LITERAL_SWITCH
* @see #LITERAL_CATCH
**/
public static final int RPAREN = GeneratedJavaTokenTypes.RPAREN;
/**
* The <code>this</code> keyword.
*
* @see #EXPR
* @see #CTOR_CALL
**/
public static final int LITERAL_THIS =
GeneratedJavaTokenTypes.LITERAL_this;
/**
* The <code>super</code> keyword.
*
* @see #EXPR
* @see #SUPER_CTOR_CALL
**/
public static final int LITERAL_SUPER =
GeneratedJavaTokenTypes.LITERAL_super;
/**
* The <code>=</code> (assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.1">Java
* Language Specification, §15.26.1</a>
* @see #EXPR
**/
public static final int ASSIGN = GeneratedJavaTokenTypes.ASSIGN;
/**
* The <code>throws</code> keyword. The children are a number of
* one or more identifiers separated by commas.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.4">Java
* Language Specification, §8.4.4</a>
* @see #IDENT
* @see #DOT
* @see #COMMA
* @see #METHOD_DEF
* @see #CTOR_DEF
* @see FullIdent
**/
public static final int LITERAL_THROWS =
GeneratedJavaTokenTypes.LITERAL_throws;
/**
* The <code>:</code> (colon) operator. This will appear as part
* of the conditional operator (<code>? :</code>).
*
* @see #QUESTION
* @see #LABELED_STAT
* @see #CASE_GROUP
**/
public static final int COLON = GeneratedJavaTokenTypes.COLON;
/**
* The <code>::</code> (double colon) operator.
* It is part of Java 8 syntax that is used for method reference.
* @see #METHOD_REF
*/
public static final int DOUBLE_COLON = GeneratedJavaTokenTypes.DOUBLE_COLON;
/**
* The <code>if</code> keyword.
*
* <p>For example:</p>
* <pre>
* if(optimistic)
* {
* message = "half full";
* }
* else
* {
* message = "half empty";
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_IF (if)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--IDENT (optimistic)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (message)
* +--STRING_LITERAL ("half full")
* +--SEMI (;)
* +--RCURLY (})
* +--LITERAL_ELSE (else)
* |
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (message)
* +--STRING_LITERAL ("half empty")
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #SLIST
* @see #EMPTY_STAT
* @see #LITERAL_ELSE
**/
public static final int LITERAL_IF = GeneratedJavaTokenTypes.LITERAL_if;
/**
* The <code>for</code> keyword. The children are <code>(</code>,
* an initializer, a condition, an iterator, a <code>)</code> and
* either a statement list, a single expression, or an empty
* statement.
*
* <p>For example:</p>
* <pre>
* for(int i = 0, n = myArray.length; i < n; i++)
* {
* }
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_FOR (for)
* |
* +--LPAREN (()
* +--FOR_INIT
* |
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (i)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--COMMA (,)
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (n)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--DOT (.)
* |
* +--IDENT (myArray)
* +--IDENT (length)
* +--SEMI (;)
* +--FOR_CONDITION
* |
* +--EXPR
* |
* +--LT (<)
* |
* +--IDENT (i)
* +--IDENT (n)
* +--SEMI (;)
* +--FOR_ITERATOR
* |
* +--ELIST
* |
* +--EXPR
* |
* +--POST_INC (++)
* |
* +--IDENT (i)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #FOR_INIT
* @see #SEMI
* @see #FOR_CONDITION
* @see #FOR_ITERATOR
* @see #RPAREN
* @see #SLIST
* @see #EMPTY_STAT
* @see #EXPR
**/
public static final int LITERAL_FOR = GeneratedJavaTokenTypes.LITERAL_for;
/**
* The <code>while</code> keyword.
*
* <p>For example:</p>
* <pre>
* while(line != null)
* {
* process(line);
* line = in.readLine();
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_WHILE (while)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--NOT_EQUAL (!=)
* |
* +--IDENT (line)
* +--LITERAL_NULL (null)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--METHOD_CALL (()
* |
* +--IDENT (process)
* +--ELIST
* |
* +--EXPR
* |
* +--IDENT (line)
* +--RPAREN ())
* +--SEMI (;)
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (line)
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (in)
* +--IDENT (readLine)
* +--ELIST
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* </pre>
**/
public static final int LITERAL_WHILE =
GeneratedJavaTokenTypes.LITERAL_while;
/**
* The <code>do</code> keyword. Note the the while token does not
* appear as part of the do-while construct.
*
* <p>For example:</p>
* <pre>
* do
* {
* x = rand.nextInt(10);
* }
* while(x < 5);
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_DO (do)
* |
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (rand)
* +--IDENT (nextInt)
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (10)
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--DO_WHILE (while)
* +--LPAREN (()
* +--EXPR
* |
* +--LT (<)
* |
* +--IDENT (x)
* +--NUM_INT (5)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #SLIST
* @see #EXPR
* @see #EMPTY_STAT
* @see #LPAREN
* @see #RPAREN
* @see #SEMI
**/
public static final int LITERAL_DO = GeneratedJavaTokenTypes.LITERAL_do;
/**
* Literal <code>while</code> in do-while loop.
* @see #LITERAL_DO
*/
public static final int DO_WHILE = GeneratedJavaTokenTypes.DO_WHILE;
/**
* The <code>break</code> keyword. The first child is an optional
* identifier and the last child is a semicolon.
*
* @see #IDENT
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_BREAK =
GeneratedJavaTokenTypes.LITERAL_break;
/**
* The <code>continue</code> keyword. The first child is an
* optional identifier and the last child is a semicolon.
*
* @see #IDENT
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_CONTINUE =
GeneratedJavaTokenTypes.LITERAL_continue;
/**
* The <code>return</code> keyword. The first child is an
* optional expression for the return value. The last child is a
* semi colon.
*
* @see #EXPR
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_RETURN =
GeneratedJavaTokenTypes.LITERAL_return;
/**
* The <code>switch</code> keyword.
*
* <p>For example:</p>
* <pre>
* switch(type)
* {
* case 0:
* background = Color.blue;
* break;
* case 1:
* background = Color.red;
* break;
* default:
* background = Color.green;
* break;
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_SWITCH (switch)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--IDENT (type)
* +--RPAREN ())
* +--LCURLY ({)
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (blue)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (red)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--CASE_GROUP
* |
* +--LITERAL_DEFAULT (default)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (green)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10">Java
* Language Specification, §14.10</a>
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #LCURLY
* @see #CASE_GROUP
* @see #RCURLY
* @see #SLIST
**/
public static final int LITERAL_SWITCH =
GeneratedJavaTokenTypes.LITERAL_switch;
/**
* The <code>throw</code> keyword. The first child is an
* expression that evaluates to a <code>Throwable</code> instance.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.17">Java
* Language Specification, §14.17</a>
* @see #SLIST
* @see #EXPR
**/
public static final int LITERAL_THROW =
GeneratedJavaTokenTypes.LITERAL_throw;
/**
* The <code>else</code> keyword. This appears as a child of an
* <code>if</code> statement.
*
* @see #SLIST
* @see #EXPR
* @see #EMPTY_STAT
* @see #LITERAL_IF
**/
public static final int LITERAL_ELSE =
GeneratedJavaTokenTypes.LITERAL_else;
/**
* The <code>case</code> keyword. The first child is a constant
* expression that evaluates to a integer.
*
* @see #CASE_GROUP
* @see #EXPR
**/
public static final int LITERAL_CASE =
GeneratedJavaTokenTypes.LITERAL_case;
/**
* The <code>default</code> keyword. This element has no
* children.
*
* @see #CASE_GROUP
* @see #MODIFIERS
**/
public static final int LITERAL_DEFAULT =
GeneratedJavaTokenTypes.LITERAL_default;
/**
* The <code>try</code> keyword. The children are a statement
* list, zero or more catch blocks and then an optional finally
* block.
*
* <p>For example:</p>
* <pre>
* try
* {
* FileReader in = new FileReader("abc.txt");
* }
* catch(IOException ioe)
* {
* }
* finally
* {
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_TRY (try)
* |
* +--SLIST ({)
* |
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (FileReader)
* +--IDENT (in)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (FileReader)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--STRING_LITERAL ("abc.txt")
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--LITERAL_CATCH (catch)
* |
* +--LPAREN (()
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (IOException)
* +--IDENT (ioe)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--LITERAL_FINALLY (finally)
* |
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.19">Java
* Language Specification, §14.19</a>
* @see #SLIST
* @see #LITERAL_CATCH
* @see #LITERAL_FINALLY
**/
public static final int LITERAL_TRY = GeneratedJavaTokenTypes.LITERAL_try;
/**
* Java 7 try-with-resources construct.
*
* <p>For example:</p>
* <pre>
* try (Foo foo = new Foo(); Bar bar = new Bar()) { }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_TRY (try)
* |
* +--RESOURCE_SPECIFICATION
* |
* +--LPAREN (()
* +--RESOURCES
* |
* +--RESOURCE
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (Foo)
* +--IDENT (foo)
* +--ASSIGN (=)
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (Foo)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--SEMI (;)
* +--RESOURCE
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (Bar)
* +--IDENT (bar)
* +--ASSIGN (=)
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (Bar)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--RPAREN ())
* +--SLIST ({)
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #RESOURCES
* @see #RESOURCE
* @see #SEMI
* @see #RPAREN
* @see #LITERAL_TRY
**/
public static final int RESOURCE_SPECIFICATION =
GeneratedJavaTokenTypes.RESOURCE_SPECIFICATION;
/**
* Java 7 try-with-resources construct.
*
* @see #RESOURCE_SPECIFICATION
**/
public static final int RESOURCES =
GeneratedJavaTokenTypes.RESOURCES;
/**
* Java 7 try-with-resources construct.
*
* @see #RESOURCE_SPECIFICATION
**/
public static final int RESOURCE =
GeneratedJavaTokenTypes.RESOURCE;
/**
* The <code>catch</code> keyword.
*
* @see #LPAREN
* @see #PARAMETER_DEF
* @see #RPAREN
* @see #SLIST
* @see #LITERAL_TRY
**/
public static final int LITERAL_CATCH =
GeneratedJavaTokenTypes.LITERAL_catch;
/**
* The <code>finally</code> keyword.
*
* @see #SLIST
* @see #LITERAL_TRY
**/
public static final int LITERAL_FINALLY =
GeneratedJavaTokenTypes.LITERAL_finally;
/**
* The <code>+=</code> (addition assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int PLUS_ASSIGN = GeneratedJavaTokenTypes.PLUS_ASSIGN;
/**
* The <code>-=</code> (subtraction assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int MINUS_ASSIGN =
GeneratedJavaTokenTypes.MINUS_ASSIGN;
/**
* The <code>*=</code> (multiplication assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int STAR_ASSIGN = GeneratedJavaTokenTypes.STAR_ASSIGN;
/**
* The <code>/=</code> (division assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int DIV_ASSIGN = GeneratedJavaTokenTypes.DIV_ASSIGN;
/**
* The <code>%=</code> (remainder assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int MOD_ASSIGN = GeneratedJavaTokenTypes.MOD_ASSIGN;
/**
* The <code>>>=</code> (signed right shift assignment)
* operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int SR_ASSIGN = GeneratedJavaTokenTypes.SR_ASSIGN;
/**
* The <code>>>>=</code> (unsigned right shift assignment)
* operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BSR_ASSIGN = GeneratedJavaTokenTypes.BSR_ASSIGN;
/**
* The <code><<=</code> (left shift assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int SL_ASSIGN = GeneratedJavaTokenTypes.SL_ASSIGN;
/**
* The <code>&=</code> (bitwise AND assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BAND_ASSIGN = GeneratedJavaTokenTypes.BAND_ASSIGN;
/**
* The <code>^=</code> (bitwise exclusive OR assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BXOR_ASSIGN = GeneratedJavaTokenTypes.BXOR_ASSIGN;
/**
* The <code>|=</code> (bitwise OR assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BOR_ASSIGN = GeneratedJavaTokenTypes.BOR_ASSIGN;
/**
* The <code>?</code> (conditional) operator. Technically,
* the colon is also part of this operator, but it appears as a
* separate token.
*
* <p>For example:</p>
* <pre>
* (quantity == 1) ? "": "s"
* </pre>
* <p>
* parses as:
* </p>
* <pre>
* +--QUESTION (?)
* |
* +--LPAREN (()
* +--EQUAL (==)
* |
* +--IDENT (quantity)
* +--NUM_INT (1)
* +--RPAREN ())
* +--STRING_LITERAL ("")
* +--COLON (:)
* +--STRING_LITERAL ("s")
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.25">Java
* Language Specification, §15.25</a>
* @see #EXPR
* @see #COLON
**/
public static final int QUESTION = GeneratedJavaTokenTypes.QUESTION;
/**
* The <code>||</code> (conditional OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.24">Java
* Language Specification, §15.24</a>
* @see #EXPR
**/
public static final int LOR = GeneratedJavaTokenTypes.LOR;
/**
* The <code>&&</code> (conditional AND) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.23">Java
* Language Specification, §15.23</a>
* @see #EXPR
**/
public static final int LAND = GeneratedJavaTokenTypes.LAND;
/**
* The <code>|</code> (bitwise OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BOR = GeneratedJavaTokenTypes.BOR;
/**
* The <code>^</code> (bitwise exclusive OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BXOR = GeneratedJavaTokenTypes.BXOR;
/**
* The <code>&</code> (bitwise AND) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BAND = GeneratedJavaTokenTypes.BAND;
/**
* The <code>!=</code> (not equal) operator.
*
* @see #EXPR
**/
public static final int NOT_EQUAL = GeneratedJavaTokenTypes.NOT_EQUAL;
/**
* The <code>==</code> (equal) operator.
*
* @see #EXPR
**/
public static final int EQUAL = GeneratedJavaTokenTypes.EQUAL;
/**
* The <code><</code> (less than) operator.
*
* @see #EXPR
**/
public static final int LT = GeneratedJavaTokenTypes.LT;
/**
* The <code>></code> (greater than) operator.
*
* @see #EXPR
**/
public static final int GT = GeneratedJavaTokenTypes.GT;
/**
* The <code><=</code> (less than or equal) operator.
*
* @see #EXPR
**/
public static final int LE = GeneratedJavaTokenTypes.LE;
/**
* The <code>>=</code> (greater than or equal) operator.
*
* @see #EXPR
**/
public static final int GE = GeneratedJavaTokenTypes.GE;
/**
* The <code>instanceof</code> operator. The first child is an
* object reference or something that evaluates to an object
* reference. The second child is a reference type.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.20.2">Java
* Language Specification, §15.20.2</a>
* @see #EXPR
* @see #METHOD_CALL
* @see #IDENT
* @see #DOT
* @see #TYPE
* @see FullIdent
**/
public static final int LITERAL_INSTANCEOF =
GeneratedJavaTokenTypes.LITERAL_instanceof;
/**
* The <code><<</code> (shift left) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int SL = GeneratedJavaTokenTypes.SL;
/**
* The <code>>></code> (signed shift right) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int SR = GeneratedJavaTokenTypes.SR;
/**
* The <code>>>></code> (unsigned shift right) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int BSR = GeneratedJavaTokenTypes.BSR;
/**
* The <code>+</code> (addition) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java
* Language Specification, §15.18</a>
* @see #EXPR
**/
public static final int PLUS = GeneratedJavaTokenTypes.PLUS;
/**
* The <code>-</code> (subtraction) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java
* Language Specification, §15.18</a>
* @see #EXPR
**/
public static final int MINUS = GeneratedJavaTokenTypes.MINUS;
/**
* The <code>/</code> (division) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.2">Java
* Language Specification, §15.17.2</a>
* @see #EXPR
**/
public static final int DIV = GeneratedJavaTokenTypes.DIV;
/**
* The <code>%</code> (remainder) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.3">Java
* Language Specification, §15.17.3</a>
* @see #EXPR
**/
public static final int MOD = GeneratedJavaTokenTypes.MOD;
/**
* The <code>++</code> (prefix increment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.1">Java
* Language Specification, §15.15.1</a>
* @see #EXPR
* @see #POST_INC
**/
public static final int INC = GeneratedJavaTokenTypes.INC;
/**
* The <code>--</code> (prefix decrement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.2">Java
* Language Specification, §15.15.2</a>
* @see #EXPR
* @see #POST_DEC
**/
public static final int DEC = GeneratedJavaTokenTypes.DEC;
/**
* The <code>~</code> (bitwise complement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.5">Java
* Language Specification, §15.15.5</a>
* @see #EXPR
**/
public static final int BNOT = GeneratedJavaTokenTypes.BNOT;
/**
* The <code>!</code> (logical complement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.6">Java
* Language Specification, §15.15.6</a>
* @see #EXPR
**/
public static final int LNOT = GeneratedJavaTokenTypes.LNOT;
/**
* The <code>true</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java
* Language Specification, §3.10.3</a>
* @see #EXPR
* @see #LITERAL_FALSE
**/
public static final int LITERAL_TRUE =
GeneratedJavaTokenTypes.LITERAL_true;
/**
* The <code>false</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java
* Language Specification, §3.10.3</a>
* @see #EXPR
* @see #LITERAL_TRUE
**/
public static final int LITERAL_FALSE =
GeneratedJavaTokenTypes.LITERAL_false;
/**
* The <code>null</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7">Java
* Language Specification, §3.10.7</a>
* @see #EXPR
**/
public static final int LITERAL_NULL =
GeneratedJavaTokenTypes.LITERAL_null;
/**
* The <code>new</code> keyword. This element is used to define
* new instances of objects, new arrays, and new anonymous inner
* classes.
*
* <p>For example:</p>
*
* <pre>
* new ArrayList(50)
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--IDENT (ArrayList)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (50)
* +--RPAREN ())
* </pre>
*
* <p>For example:</p>
* <pre>
* new float[]
* {
* 3.0f,
* 4.0f
* };
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--LITERAL_FLOAT (float)
* +--ARRAY_DECLARATOR ([)
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_FLOAT (3.0f)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_FLOAT (4.0f)
* +--RCURLY (})
* </pre>
*
* <p>For example:</p>
* <pre>
* new FilenameFilter()
* {
* public boolean accept(File dir, String name)
* {
* return name.endsWith(".java");
* }
* }
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--IDENT (FilenameFilter)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_BOOLEAN (boolean)
* +--IDENT (accept)
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (File)
* +--IDENT (dir)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (name)
* +--SLIST ({)
* |
* +--LITERAL_RETURN (return)
* |
* +--EXPR
* |
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (name)
* +--IDENT (endsWith)
* +--ELIST
* |
* +--EXPR
* |
* +--STRING_LITERAL (".java")
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #LPAREN
* @see #ELIST
* @see #RPAREN
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see FullIdent
**/
public static final int LITERAL_NEW = GeneratedJavaTokenTypes.LITERAL_new;
/**
* An integer literal. These may be specified in decimal,
* hexadecimal, or octal form.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java
* Language Specification, §3.10.1</a>
* @see #EXPR
* @see #NUM_LONG
**/
public static final int NUM_INT = GeneratedJavaTokenTypes.NUM_INT;
/**
* A character literal. This is a (possibly escaped) character
* enclosed in single quotes.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.4">Java
* Language Specification, §3.10.4</a>
* @see #EXPR
**/
public static final int CHAR_LITERAL =
GeneratedJavaTokenTypes.CHAR_LITERAL;
/**
* A string literal. This is a sequence of (possibly escaped)
* characters enclosed in double quotes.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.5">Java
* Language Specification, §3.10.5</a>
* @see #EXPR
**/
public static final int STRING_LITERAL =
GeneratedJavaTokenTypes.STRING_LITERAL;
/**
* A single precision floating point literal. This is a floating
* point number with an <code>F</code> or <code>f</code> suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java
* Language Specification, §3.10.2</a>
* @see #EXPR
* @see #NUM_DOUBLE
**/
public static final int NUM_FLOAT = GeneratedJavaTokenTypes.NUM_FLOAT;
/**
* A long integer literal. These are almost the same as integer
* literals, but they have an <code>L</code> or <code>l</code>
* (ell) suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java
* Language Specification, §3.10.1</a>
* @see #EXPR
* @see #NUM_INT
**/
public static final int NUM_LONG = GeneratedJavaTokenTypes.NUM_LONG;
/**
* A double precision floating point literal. This is a floating
* point number with an optional <code>D</code> or <code>d</code>
* suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java
* Language Specification, §3.10.2</a>
* @see #EXPR
* @see #NUM_FLOAT
**/
public static final int NUM_DOUBLE = GeneratedJavaTokenTypes.NUM_DOUBLE;
/**
* The <code>assert</code> keyword. This is only for Java 1.4 and
* later.
*
* <p>For example:</p>
* <pre>
* assert(x==4);
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_ASSERT (assert)
* |
* +--EXPR
* |
* +--LPAREN (()
* +--EQUAL (==)
* |
* +--IDENT (x)
* +--NUM_INT (4)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
**/
public static final int LITERAL_ASSERT = GeneratedJavaTokenTypes.ASSERT;
/**
* A static import declaration. Static import declarations are optional,
* but must appear after the package declaration and before the type
* declaration.
*
* <p>For example:</p>
*
* <pre>
* import static java.io.IOException;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--STATIC_IMPORT (import)
* |
* +--LITERAL_STATIC
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (io)
* +--IDENT (IOException)
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #LITERAL_STATIC
* @see #DOT
* @see #IDENT
* @see #STAR
* @see #SEMI
* @see FullIdent
**/
public static final int STATIC_IMPORT =
GeneratedJavaTokenTypes.STATIC_IMPORT;
/**
* An enum declaration. Its notable children are
* enum constant declarations followed by
* any construct that may be expected in a class body.
*
* <p>For example:</p>
* <pre>
* public enum MyEnum
* implements Serializable
* {
* FIRST_CONSTANT,
* SECOND_CONSTANT;
*
* public void someMethod()
* {
* }
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ENUM_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--ENUM (enum)
* +--IDENT (MyEnum)
* +--EXTENDS_CLAUSE
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--ENUM_CONSTANT_DEF
* |
* +--IDENT (FIRST_CONSTANT)
* +--COMMA (,)
* +--ENUM_CONSTANT_DEF
* |
* +--IDENT (SECOND_CONSTANT)
* +--SEMI (;)
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_void (void)
* +--IDENT (someMethod)
* +--LPAREN (()
* +--PARAMETERS
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #ENUM
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #IMPLEMENTS_CLAUSE
* @see #OBJBLOCK
* @see #LITERAL_NEW
* @see #ENUM_CONSTANT_DEF
**/
public static final int ENUM_DEF =
GeneratedJavaTokenTypes.ENUM_DEF;
/**
* The <code>enum</code> keyword. This element appears
* as part of an enum declaration.
**/
public static final int ENUM =
GeneratedJavaTokenTypes.ENUM;
/**
* An enum constant declaration. Its notable children are annotations,
* arguments and object block akin to an anonymous
* inner class' body.
*
* <p>For example:</p>
* <pre>
* SOME_CONSTANT(1)
* {
* public void someMethodOverriddenFromMainBody()
* {
* }
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ENUM_CONSTANT_DEF
* |
* +--ANNOTATIONS
* +--IDENT (SOME_CONSTANT)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--RPAREN ())
* +--OBJBLOCK
* |
* +--LCURLY ({)
* |
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_void (void)
* +--IDENT (someMethodOverriddenFromMainBody)
* +--LPAREN (()
* +--PARAMETERS
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATIONS
* @see #MODIFIERS
* @see #IDENT
* @see #ELIST
* @see #OBJBLOCK
**/
public static final int ENUM_CONSTANT_DEF =
GeneratedJavaTokenTypes.ENUM_CONSTANT_DEF;
/**
* A for-each clause. This is a child of
* <code>LITERAL_FOR</code>. The children of this element may be
* a parameter definition, the colon literal and an expression.
*
* <p>For example:</p>
* <pre>
* for (int value : values) {
* doSmth();
* }
* </pre>
* <p>parses as:</p>
* <pre>
* --LITERAL_FOR (for)
* |--LPAREN (()
* |--FOR_EACH_CLAUSE
* | |--VARIABLE_DEF
* | | |--MODIFIERS
* | | |--TYPE
* | | | `--LITERAL_INT (int)
* | | `--IDENT (value)
* | |--COLON (:)
* | `--EXPR
* | `--IDENT (values
* |--RPAREN ())
* `--SLIST ({)
* |--EXPR
* | `--METHOD_CALL (()
* | |--IDENT (doSmth)
* | |--ELIST
* | `--RPAREN ())
* |--SEMI (;)
* `--RCURLY (})
*
* </pre>
*
* @see #VARIABLE_DEF
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_EACH_CLAUSE =
GeneratedJavaTokenTypes.FOR_EACH_CLAUSE;
/**
* An annotation declaration. The notable children are the name of the
* annotation type, annotation field declarations and (constant) fields.
*
* <p>For example:</p>
* <pre>
* public @interface MyAnnotation
* {
* int someValue();
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ANNOTATION_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--AT (@)
* +--LITERAL_INTERFACE (interface)
* +--IDENT (MyAnnotation)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--ANNOTATION_FIELD_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (someValue)
* +--LPAREN (()
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #LITERAL_INTERFACE
* @see #IDENT
* @see #OBJBLOCK
* @see #ANNOTATION_FIELD_DEF
**/
public static final int ANNOTATION_DEF =
GeneratedJavaTokenTypes.ANNOTATION_DEF;
/**
* An annotation field declaration. The notable children are modifiers,
* field type, field name and an optional default value (a conditional
* compile-time constant expression). Default values may also by
* annotations.
*
* <p>For example:</p>
*
* <pre>
* String someField() default "Hello world";
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION_FIELD_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (someField)
* +--LPAREN (()
* +--RPAREN ())
* +--LITERAL_DEFAULT (default)
* +--STRING_LITERAL ("Hello world")
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #TYPE
* @see #LITERAL_DEFAULT
*/
public static final int ANNOTATION_FIELD_DEF =
GeneratedJavaTokenTypes.ANNOTATION_FIELD_DEF;
// note: @ is the html escape for '@',
// used here to avoid confusing the javadoc tool
/**
* A collection of annotations on a package or enum constant.
* A collections of annotations will only occur on these nodes
* as all other nodes that may be qualified with an annotation can
* be qualified with any other modifier and hence these annotations
* would be contained in a {@link #MODIFIERS} node.
*
* <p>For example:</p>
*
* <pre>
* @MyAnnotation package blah;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--PACKAGE_DEF (package)
* |
* +--ANNOTATIONS
* |
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (MyAnnotation)
* +--IDENT (blah)
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #AT
* @see #IDENT
*/
public static final int ANNOTATIONS =
GeneratedJavaTokenTypes.ANNOTATIONS;
// note: @ is the html escape for '@',
// used here to avoid confusing the javadoc tool
/**
* An annotation of a package, type, field, parameter or variable.
* An annotation may occur anywhere modifiers occur (it is a
* type of modifier) and may also occur prior to a package definition.
* The notable children are: The annotation name and either a single
* default annotation value or a sequence of name value pairs.
* Annotation values may also be annotations themselves.
*
* <p>For example:</p>
*
* <pre>
* @MyAnnotation(someField1 = "Hello",
* someField2 = @SomeOtherAnnotation)
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (MyAnnotation)
* +--LPAREN (()
* +--ANNOTATION_MEMBER_VALUE_PAIR
* |
* +--IDENT (someField1)
* +--ASSIGN (=)
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (SomeOtherAnnotation)
* +--ANNOTATION_MEMBER_VALUE_PAIR
* |
* +--IDENT (someField2)
* +--ASSIGN (=)
* +--STRING_LITERAL ("Hello")
* +--RPAREN ())
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #IDENT
* @see #ANNOTATION_MEMBER_VALUE_PAIR
*/
public static final int ANNOTATION =
GeneratedJavaTokenTypes.ANNOTATION;
/**
* An initialisation of an annotation member with a value.
* Its children are the name of the member, the assignment literal
* and the (compile-time constant conditional expression) value.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #IDENT
*/
public static final int ANNOTATION_MEMBER_VALUE_PAIR =
GeneratedJavaTokenTypes.ANNOTATION_MEMBER_VALUE_PAIR;
/**
* An annotation array member initialisation.
* Initializers can not be nested.
* Am initializer may be present as a default to a annotation
* member, as the single default value to an annotation
* (e.g. @Annotation({1,2})) or as the value of an annotation
* member value pair.
*
* <p>For example:</p>
*
* <pre>
* { 1, 2 }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION_ARRAY_INIT ({)
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--NUM_INT (2)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #IDENT
* @see #ANNOTATION_MEMBER_VALUE_PAIR
*/
public static final int ANNOTATION_ARRAY_INIT =
GeneratedJavaTokenTypes.ANNOTATION_ARRAY_INIT;
/**
* A list of type parameters to a class, interface or
* method definition. Children are LT, at least one
* TYPE_PARAMETER, zero or more of: a COMMAs followed by a single
* TYPE_PARAMETER and a final GT.
*
* <p>For example:</p>
*
* <pre>
* public class Blah<A, B>
* {
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--CLASS_DEF ({)
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_CLASS (class)
* +--IDENT (Blah)
* +--TYPE_PARAMETERS
* |
* +--GENERIC_START (<)
* +--TYPE_PARAMETER
* |
* +--IDENT (A)
* +--COMMA (,)
* +--TYPE_PARAMETER
* |
* +--IDENT (B)
* +--GENERIC_END (>)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--NUM_INT (1)
* +--COMMA (,)
* +--NUM_INT (2)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #GENERIC_START
* @see #GENERIC_END
* @see #TYPE_PARAMETER
* @see #COMMA
*/
public static final int TYPE_PARAMETERS =
GeneratedJavaTokenTypes.TYPE_PARAMETERS;
/**
* A type parameter to a class, interface or method definition.
* Children are the type name and an optional TYPE_UPPER_BOUNDS.
*
* <p>For example:</p>
*
* <pre>
* A extends Collection
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--TYPE_PARAMETER
* |
* +--IDENT (A)
* +--TYPE_UPPER_BOUNDS
* |
* +--IDENT (Collection)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #IDENT
* @see #WILDCARD_TYPE
* @see #TYPE_UPPER_BOUNDS
*/
public static final int TYPE_PARAMETER =
GeneratedJavaTokenTypes.TYPE_PARAMETER;
/**
* A list of type arguments to a type reference or
* a method/ctor invocation. Children are GENERIC_START, at least one
* TYPE_ARGUMENT, zero or more of a COMMAs followed by a single
* TYPE_ARGUMENT, and a final GENERIC_END.
*
* <p>For example:</p>
*
* <pre>
* public Collection<?> a;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--IDENT (Collection)
* |
* +--TYPE_ARGUMENTS
* |
* +--GENERIC_START (<)
* +--TYPE_ARGUMENT
* |
* +--WILDCARD_TYPE (?)
* +--GENERIC_END (>)
* +--IDENT (a)
* +--SEMI (;)
* </pre>
*
* @see #GENERIC_START
* @see #GENERIC_END
* @see #TYPE_ARGUMENT
* @see #COMMA
*/
public static final int TYPE_ARGUMENTS =
GeneratedJavaTokenTypes.TYPE_ARGUMENTS;
/**
* A type arguments to a type reference or a method/ctor invocation.
* Children are either: type name or wildcard type with possible type
* upper or lower bounds.
*
* <p>For example:</p>
*
* <pre>
* ? super List
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--TYPE_ARGUMENT
* |
* +--WILDCARD_TYPE (?)
* +--TYPE_LOWER_BOUNDS
* |
* +--IDENT (List)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #WILDCARD_TYPE
* @see #TYPE_UPPER_BOUNDS
* @see #TYPE_LOWER_BOUNDS
*/
public static final int TYPE_ARGUMENT =
GeneratedJavaTokenTypes.TYPE_ARGUMENT;
/**
* The type that refers to all types. This node has no children.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_ARGUMENT
* @see #TYPE_UPPER_BOUNDS
* @see #TYPE_LOWER_BOUNDS
*/
public static final int WILDCARD_TYPE =
GeneratedJavaTokenTypes.WILDCARD_TYPE;
/**
* An upper bounds on a wildcard type argument or type parameter.
* This node has one child - the type that is being used for
* the bounding.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_PARAMETER
* @see #TYPE_ARGUMENT
* @see #WILDCARD_TYPE
*/
public static final int TYPE_UPPER_BOUNDS =
GeneratedJavaTokenTypes.TYPE_UPPER_BOUNDS;
/**
* A lower bounds on a wildcard type argument. This node has one child
* - the type that is being used for the bounding.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_ARGUMENT
* @see #WILDCARD_TYPE
*/
public static final int TYPE_LOWER_BOUNDS =
GeneratedJavaTokenTypes.TYPE_LOWER_BOUNDS;
/**
* An 'at' symbol - signifying an annotation instance or the prefix
* to the interface literal signifying the definition of an annotation
* declaration.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
*/
public static final int AT = GeneratedJavaTokenTypes.AT;
/**
* A triple dot for variable-length parameters. This token only ever occurs
* in a parameter declaration immediately after the type of the parameter.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
*/
public static final int ELLIPSIS = GeneratedJavaTokenTypes.ELLIPSIS;
/**
* '&' symbol when used in a generic upper or lower bounds constrain
* e.g. {@code Comparable<<? extends Serializable, CharSequence>}.
*/
public static final int TYPE_EXTENSION_AND =
GeneratedJavaTokenTypes.TYPE_EXTENSION_AND;
/**
* '<' symbol signifying the start of type arguments or type
* parameters.
*/
public static final int GENERIC_START =
GeneratedJavaTokenTypes.GENERIC_START;
/**
* '>' symbol signifying the end of type arguments or type parameters.
*/
public static final int GENERIC_END = GeneratedJavaTokenTypes.GENERIC_END;
/**
* Special lambda symbol '->'.
*/
public static final int LAMBDA = GeneratedJavaTokenTypes.LAMBDA;
/**
* Beginning of single line comment: '//'.
*
* <pre>
* +--SINGLE_LINE_COMMENT
* |
* +--COMMENT_CONTENT
* </pre>
*/
public static final int SINGLE_LINE_COMMENT =
GeneratedJavaTokenTypes.SINGLE_LINE_COMMENT;
/**
* Beginning of block comment: '/*'.
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int BLOCK_COMMENT_BEGIN =
GeneratedJavaTokenTypes.BLOCK_COMMENT_BEGIN;
/**
* End of block comment: '* /'.
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int BLOCK_COMMENT_END =
GeneratedJavaTokenTypes.BLOCK_COMMENT_END;
/**
* Text of single-line or block comment.
*
*<pre>
* +--SINGLE_LINE_COMMENT
* |
* +--COMMENT_CONTENT
* </pre>
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int COMMENT_CONTENT =
GeneratedJavaTokenTypes.COMMENT_CONTENT;
/** Prevent instantiation. */
private TokenTypes() {
}
}
| src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java | ////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2016 the original author or authors.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.api;
import com.puppycrawl.tools.checkstyle.grammars.GeneratedJavaTokenTypes;
/**
* Contains the constants for all the tokens contained in the Abstract
* Syntax Tree.
*
* <p>Implementation detail: This class has been introduced to break
* the circular dependency between packages.</p>
*
* @author Oliver Burn
* @author <a href="mailto:[email protected]">Peter Dobratz</a>
*/
public final class TokenTypes {
// The following three types are never part of an AST,
// left here as a reminder so nobody will read them accidentally
// These are the types that can actually occur in an AST
// it makes sense to register Checks for these types
/**
* The end of file token. This is the root node for the source
* file. It's children are an optional package definition, zero
* or more import statements, and one or more class or interface
* definitions.
*
* @see #PACKAGE_DEF
* @see #IMPORT
* @see #CLASS_DEF
* @see #INTERFACE_DEF
**/
public static final int EOF = GeneratedJavaTokenTypes.EOF;
/**
* Modifiers for type, method, and field declarations. The
* modifiers element is always present even though it may have no
* children.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java
* Language Specification, §8</a>
* @see #LITERAL_PUBLIC
* @see #LITERAL_PROTECTED
* @see #LITERAL_PRIVATE
* @see #ABSTRACT
* @see #LITERAL_STATIC
* @see #FINAL
* @see #LITERAL_TRANSIENT
* @see #LITERAL_VOLATILE
* @see #LITERAL_SYNCHRONIZED
* @see #LITERAL_NATIVE
* @see #STRICTFP
* @see #ANNOTATION
* @see #LITERAL_DEFAULT
**/
public static final int MODIFIERS = GeneratedJavaTokenTypes.MODIFIERS;
/**
* An object block. These are children of class, interface, enum,
* annotation and enum constant declarations.
* Also, object blocks are children of the new keyword when defining
* anonymous inner types.
*
* @see #LCURLY
* @see #INSTANCE_INIT
* @see #STATIC_INIT
* @see #CLASS_DEF
* @see #CTOR_DEF
* @see #METHOD_DEF
* @see #VARIABLE_DEF
* @see #RCURLY
* @see #INTERFACE_DEF
* @see #LITERAL_NEW
* @see #ENUM_DEF
* @see #ENUM_CONSTANT_DEF
* @see #ANNOTATION_DEF
**/
public static final int OBJBLOCK = GeneratedJavaTokenTypes.OBJBLOCK;
/**
* A list of statements.
*
* @see #RCURLY
* @see #EXPR
* @see #LABELED_STAT
* @see #LITERAL_THROWS
* @see #LITERAL_RETURN
* @see #SEMI
* @see #METHOD_DEF
* @see #CTOR_DEF
* @see #LITERAL_FOR
* @see #LITERAL_WHILE
* @see #LITERAL_IF
* @see #LITERAL_ELSE
* @see #CASE_GROUP
**/
public static final int SLIST = GeneratedJavaTokenTypes.SLIST;
/**
* A constructor declaration.
*
* <p>For example:</p>
* <pre>
* public SpecialEntry(int value, String text)
* {
* this.value = value;
* this.text = text;
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--CTOR_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--IDENT (SpecialEntry)
* +--LPAREN (()
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (value)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (text)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--DOT (.)
* |
* +--LITERAL_THIS (this)
* +--IDENT (value)
* +--IDENT (value)
* +--SEMI (;)
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--DOT (.)
* |
* +--LITERAL_THIS (this)
* +--IDENT (text)
* +--IDENT (text)
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #OBJBLOCK
* @see #CLASS_DEF
**/
public static final int CTOR_DEF = GeneratedJavaTokenTypes.CTOR_DEF;
/**
* A method declaration. The children are modifiers, type parameters,
* return type, method name, parameter list, an optional throws list, and
* statement list. The statement list is omitted if the method
* declaration appears in an interface declaration. Method
* declarations may appear inside object blocks of class
* declarations, interface declarations, enum declarations,
* enum constant declarations or anonymous inner-class declarations.
*
* <p>For example:</p>
*
* <pre>
* public static int square(int x)
* {
* return x*x;
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_STATIC (static)
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (square)
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (x)
* +--SLIST ({)
* |
* +--LITERAL_RETURN (return)
* |
* +--EXPR
* |
* +--STAR (*)
* |
* +--IDENT (x)
* +--IDENT (x)
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #MODIFIERS
* @see #TYPE_PARAMETERS
* @see #TYPE
* @see #IDENT
* @see #PARAMETERS
* @see #LITERAL_THROWS
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int METHOD_DEF = GeneratedJavaTokenTypes.METHOD_DEF;
/**
* A field or local variable declaration. The children are
* modifiers, type, the identifier name, and an optional
* assignment statement.
*
* @see #MODIFIERS
* @see #TYPE
* @see #IDENT
* @see #ASSIGN
**/
public static final int VARIABLE_DEF =
GeneratedJavaTokenTypes.VARIABLE_DEF;
/**
* An instance initializer. Zero or more instance initializers
* may appear in class and enum definitions. This token will be a child
* of the object block of the declaring type.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.6">Java
* Language Specification§8.6</a>
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int INSTANCE_INIT =
GeneratedJavaTokenTypes.INSTANCE_INIT;
/**
* A static initialization block. Zero or more static
* initializers may be children of the object block of a class
* or enum declaration (interfaces cannot have static initializers). The
* first and only child is a statement list.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.7">Java
* Language Specification, §8.7</a>
* @see #SLIST
* @see #OBJBLOCK
**/
public static final int STATIC_INIT =
GeneratedJavaTokenTypes.STATIC_INIT;
/**
* A type. This is either a return type of a method or a type of
* a variable or field. The first child of this element is the
* actual type. This may be a primitive type, an identifier, a
* dot which is the root of a fully qualified type, or an array of
* any of these. The second child may be type arguments to the type.
*
* @see #VARIABLE_DEF
* @see #METHOD_DEF
* @see #PARAMETER_DEF
* @see #IDENT
* @see #DOT
* @see #LITERAL_VOID
* @see #LITERAL_BOOLEAN
* @see #LITERAL_BYTE
* @see #LITERAL_CHAR
* @see #LITERAL_SHORT
* @see #LITERAL_INT
* @see #LITERAL_FLOAT
* @see #LITERAL_LONG
* @see #LITERAL_DOUBLE
* @see #ARRAY_DECLARATOR
* @see #TYPE_ARGUMENTS
**/
public static final int TYPE = GeneratedJavaTokenTypes.TYPE;
/**
* A class declaration.
*
* <p>For example:</p>
* <pre>
* public class MyClass
* implements Serializable
* {
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--CLASS_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_CLASS (class)
* +--IDENT (MyClass)
* +--EXTENDS_CLAUSE
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java
* Language Specification, §8</a>
* @see #MODIFIERS
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #IMPLEMENTS_CLAUSE
* @see #OBJBLOCK
* @see #LITERAL_NEW
**/
public static final int CLASS_DEF = GeneratedJavaTokenTypes.CLASS_DEF;
/**
* An interface declaration.
*
* <p>For example:</p>
*
* <pre>
* public interface MyInterface
* {
* }
*
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--INTERFACE_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_INTERFACE (interface)
* +--IDENT (MyInterface)
* +--EXTENDS_CLAUSE
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html">Java
* Language Specification, §9</a>
* @see #MODIFIERS
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #OBJBLOCK
**/
public static final int INTERFACE_DEF =
GeneratedJavaTokenTypes.INTERFACE_DEF;
/**
* The package declaration. This is optional, but if it is
* included, then there is only one package declaration per source
* file and it must be the first non-comment in the file. A package
* declaration may be annotated in which case the annotations comes
* before the rest of the declaration (and are the first children).
*
* <p>For example:</p>
*
* <pre>
* package com.puppycrawl.tools.checkstyle.api;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--PACKAGE_DEF (package)
* |
* +--ANNOTATIONS
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (com)
* +--IDENT (puppycrawl)
* +--IDENT (tools)
* +--IDENT (checkstyle)
* +--IDENT (api)
* +--SEMI (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4">Java
* Language Specification §7.4</a>
* @see #DOT
* @see #IDENT
* @see #SEMI
* @see #ANNOTATIONS
* @see FullIdent
**/
public static final int PACKAGE_DEF = GeneratedJavaTokenTypes.PACKAGE_DEF;
/**
* An array declaration.
*
* <p>If the array declaration represents a type, then the type of
* the array elements is the first child. Multidimensional arrays
* may be regarded as arrays of arrays. In other words, the first
* child of the array declaration is another array
* declaration.</p>
*
* <p>For example:</p>
* <pre>
* int[] x;
* </pre>
* <p>parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (x)
* +--SEMI (;)
* </pre>
*
* <p>The array declaration may also represent an inline array
* definition. In this case, the first child will be either an
* expression specifying the length of the array or an array
* initialization block.</p>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html">Java
* Language Specification §10</a>
* @see #TYPE
* @see #ARRAY_INIT
**/
public static final int ARRAY_DECLARATOR =
GeneratedJavaTokenTypes.ARRAY_DECLARATOR;
/**
* An extends clause. This appear as part of class and interface
* definitions. This element appears even if the
* <code>extends</code> keyword is not explicitly used. The child
* is an optional identifier.
*
* <p>For example:</p>
*
* <pre>
* extends java.util.LinkedList
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--EXTENDS_CLAUSE
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (util)
* +--IDENT (LinkedList)
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #CLASS_DEF
* @see #INTERFACE_DEF
* @see FullIdent
**/
public static final int EXTENDS_CLAUSE =
GeneratedJavaTokenTypes.EXTENDS_CLAUSE;
/**
* An implements clause. This always appears in a class or enum
* declaration, even if there are no implemented interfaces. The
* children are a comma separated list of zero or more
* identifiers.
*
* <p>For example:</p>
* <pre>
* implements Serializable, Comparable
* </pre>
* <p>parses as:</p>
* <pre>
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--COMMA (,)
* +--IDENT (Comparable)
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #COMMA
* @see #CLASS_DEF
* @see #ENUM_DEF
**/
public static final int IMPLEMENTS_CLAUSE =
GeneratedJavaTokenTypes.IMPLEMENTS_CLAUSE;
/**
* A list of parameters to a method or constructor. The children
* are zero or more parameter declarations separated by commas.
*
* <p>For example</p>
* <pre>
* int start, int end
* </pre>
* <p>parses as:</p>
* <pre>
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (start)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (end)
* </pre>
*
* @see #PARAMETER_DEF
* @see #COMMA
* @see #METHOD_DEF
* @see #CTOR_DEF
**/
public static final int PARAMETERS = GeneratedJavaTokenTypes.PARAMETERS;
/**
* A parameter declaration. The last parameter in a list of parameters may
* be variable length (indicated by the ELLIPSIS child node immediately
* after the TYPE child).
*
* @see #MODIFIERS
* @see #TYPE
* @see #IDENT
* @see #PARAMETERS
* @see #ELLIPSIS
**/
public static final int PARAMETER_DEF =
GeneratedJavaTokenTypes.PARAMETER_DEF;
/**
* A labeled statement.
*
* <p>For example:</p>
* <pre>
* outside: ;
* </pre>
* <p>parses as:</p>
* <pre>
* +--LABELED_STAT (:)
* |
* +--IDENT (outside)
* +--EMPTY_STAT (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.7">Java
* Language Specification, §14.7</a>
* @see #SLIST
**/
public static final int LABELED_STAT =
GeneratedJavaTokenTypes.LABELED_STAT;
/**
* A type-cast.
*
* <p>For example:</p>
* <pre>
* (String)it.next()
* </pre>
* <p>parses as:</p>
* <pre>
* +--TYPECAST (()
* |
* +--TYPE
* |
* +--IDENT (String)
* +--RPAREN ())
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (it)
* +--IDENT (next)
* +--ELIST
* +--RPAREN ())
* </pre>
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.16">Java
* Language Specification, §15.16</a>
* @see #EXPR
* @see #TYPE
* @see #TYPE_ARGUMENTS
* @see #RPAREN
**/
public static final int TYPECAST = GeneratedJavaTokenTypes.TYPECAST;
/**
* The array index operator.
*
* <p>For example:</p>
* <pre>
* ar[2] = 5;
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--INDEX_OP ([)
* |
* +--IDENT (ar)
* +--EXPR
* |
* +--NUM_INT (2)
* +--NUM_INT (5)
* +--SEMI (;)
* </pre>
*
* @see #EXPR
**/
public static final int INDEX_OP = GeneratedJavaTokenTypes.INDEX_OP;
/**
* The <code>++</code> (postfix increment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.1">Java
* Language Specification, §15.14.1</a>
* @see #EXPR
* @see #INC
**/
public static final int POST_INC = GeneratedJavaTokenTypes.POST_INC;
/**
* The <code>--</code> (postfix decrement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.2">Java
* Language Specification, §15.14.2</a>
* @see #EXPR
* @see #DEC
**/
public static final int POST_DEC = GeneratedJavaTokenTypes.POST_DEC;
/**
* A method call. A method call may have type arguments however these
* are attached to the appropriate node in the qualified method name.
*
* <p>For example:</p>
* <pre>
* Math.random()
* </pre>
*
* <p>parses as:
* <pre>
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (Math)
* +--IDENT (random)
* +--ELIST
* +--RPAREN ())
* </pre>
*
*
* @see #IDENT
* @see #TYPE_ARGUMENTS
* @see #DOT
* @see #ELIST
* @see #RPAREN
* @see FullIdent
**/
public static final int METHOD_CALL = GeneratedJavaTokenTypes.METHOD_CALL;
/**
* Part of Java 8 syntax. Method or constructor call without arguments.
* @see #DOUBLE_COLON
*/
public static final int METHOD_REF = GeneratedJavaTokenTypes.METHOD_REF;
/**
* An expression. Operators with lower precedence appear at a
* higher level in the tree than operators with higher precedence.
* Parentheses are siblings to the operator they enclose.
*
* <p>For example:</p>
* <pre>
* x = 4 + 3 * 5 + (30 + 26) / 4 + 5 % 4 + (1<<3);
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--PLUS (+)
* |
* +--NUM_INT (4)
* +--STAR (*)
* |
* +--NUM_INT (3)
* +--NUM_INT (5)
* +--DIV (/)
* |
* +--LPAREN (()
* +--PLUS (+)
* |
* +--NUM_INT (30)
* +--NUM_INT (26)
* +--RPAREN ())
* +--NUM_INT (4)
* +--MOD (%)
* |
* +--NUM_INT (5)
* +--NUM_INT (4)
* +--LPAREN (()
* +--SL (<<)
* |
* +--NUM_INT (1)
* +--NUM_INT (3)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #ELIST
* @see #ASSIGN
* @see #LPAREN
* @see #RPAREN
**/
public static final int EXPR = GeneratedJavaTokenTypes.EXPR;
/**
* An array initialization. This may occur as part of an array
* declaration or inline with <code>new</code>.
*
* <p>For example:</p>
* <pre>
* int[] y =
* {
* 1,
* 2,
* };
* </pre>
* <p>parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (y)
* +--ASSIGN (=)
* |
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_INT (2)
* +--COMMA (,)
* +--RCURLY (})
* +--SEMI (;)
* </pre>
*
* <p>Also consider:</p>
* <pre>
* int[] z = new int[]
* {
* 1,
* 2,
* };
* </pre>
* <p>which parses as:</p>
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--ARRAY_DECLARATOR ([)
* |
* +--LITERAL_INT (int)
* +--IDENT (z)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--LITERAL_INT (int)
* +--ARRAY_DECLARATOR ([)
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_INT (2)
* +--COMMA (,)
* +--RCURLY (})
* </pre>
*
* @see #ARRAY_DECLARATOR
* @see #TYPE
* @see #LITERAL_NEW
* @see #COMMA
**/
public static final int ARRAY_INIT = GeneratedJavaTokenTypes.ARRAY_INIT;
/**
* An import declaration. Import declarations are option, but
* must appear after the package declaration and before the first type
* declaration.
*
* <p>For example:</p>
*
* <pre>
* import java.io.IOException;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--IMPORT (import)
* |
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (io)
* +--IDENT (IOException)
* +--SEMI (;)
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5">Java
* Language Specification §7.5</a>
* @see #DOT
* @see #IDENT
* @see #STAR
* @see #SEMI
* @see FullIdent
**/
public static final int IMPORT = GeneratedJavaTokenTypes.IMPORT;
/**
* The <code>-</code> (unary minus) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.4">Java
* Language Specification, §15.15.4</a>
* @see #EXPR
**/
public static final int UNARY_MINUS = GeneratedJavaTokenTypes.UNARY_MINUS;
/**
* The <code>+</code> (unary plus) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.3">Java
* Language Specification, §15.15.3</a>
* @see #EXPR
**/
public static final int UNARY_PLUS = GeneratedJavaTokenTypes.UNARY_PLUS;
/**
* A group of case clauses. Case clauses with no associated
* statements are grouped together into a case group. The last
* child is a statement list containing the statements to execute
* upon a match.
*
* <p>For example:</p>
* <pre>
* case 0:
* case 1:
* case 2:
* x = 3;
* break;
* </pre>
* <p>parses as:</p>
* <pre>
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (2)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--NUM_INT (3)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* </pre>
*
* @see #LITERAL_CASE
* @see #LITERAL_DEFAULT
* @see #LITERAL_SWITCH
**/
public static final int CASE_GROUP = GeneratedJavaTokenTypes.CASE_GROUP;
/**
* An expression list. The children are a comma separated list of
* expressions.
*
* @see #LITERAL_NEW
* @see #FOR_INIT
* @see #FOR_ITERATOR
* @see #EXPR
* @see #METHOD_CALL
* @see #CTOR_CALL
* @see #SUPER_CTOR_CALL
**/
public static final int ELIST = GeneratedJavaTokenTypes.ELIST;
/**
* A for loop initializer. This is a child of
* <code>LITERAL_FOR</code>. The children of this element may be
* a comma separated list of variable declarations, an expression
* list, or empty.
*
* @see #VARIABLE_DEF
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_INIT = GeneratedJavaTokenTypes.FOR_INIT;
/**
* A for loop condition. This is a child of
* <code>LITERAL_FOR</code>. The child of this element is an
* optional expression.
*
* @see #EXPR
* @see #LITERAL_FOR
**/
public static final int FOR_CONDITION =
GeneratedJavaTokenTypes.FOR_CONDITION;
/**
* A for loop iterator. This is a child of
* <code>LITERAL_FOR</code>. The child of this element is an
* optional expression list.
*
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_ITERATOR =
GeneratedJavaTokenTypes.FOR_ITERATOR;
/**
* The empty statement. This goes in place of an
* <code>SLIST</code> for a <code>for</code> or <code>while</code>
* loop body.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.6">Java
* Language Specification, §14.6</a>
* @see #LITERAL_FOR
* @see #LITERAL_WHILE
**/
public static final int EMPTY_STAT = GeneratedJavaTokenTypes.EMPTY_STAT;
/**
* The <code>final</code> keyword.
*
* @see #MODIFIERS
**/
public static final int FINAL = GeneratedJavaTokenTypes.FINAL;
/**
* The <code>abstract</code> keyword.
*
* @see #MODIFIERS
**/
public static final int ABSTRACT = GeneratedJavaTokenTypes.ABSTRACT;
/**
* The <code>strictfp</code> keyword.
*
* @see #MODIFIERS
**/
public static final int STRICTFP = GeneratedJavaTokenTypes.STRICTFP;
/**
* A super constructor call.
*
* @see #ELIST
* @see #RPAREN
* @see #SEMI
* @see #CTOR_CALL
**/
public static final int SUPER_CTOR_CALL =
GeneratedJavaTokenTypes.SUPER_CTOR_CALL;
/**
* A constructor call.
*
* <p>For example:</p>
* <pre>
* this(1);
* </pre>
* <p>parses as:</p>
* <pre>
* +--CTOR_CALL (this)
* |
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #ELIST
* @see #RPAREN
* @see #SEMI
* @see #SUPER_CTOR_CALL
**/
public static final int CTOR_CALL = GeneratedJavaTokenTypes.CTOR_CALL;
/**
* The statement terminator (<code>;</code>). Depending on the
* context, this make occur as a sibling, a child, or not at all.
*
* @see #PACKAGE_DEF
* @see #IMPORT
* @see #SLIST
* @see #ARRAY_INIT
* @see #LITERAL_FOR
**/
public static final int SEMI = GeneratedJavaTokenTypes.SEMI;
/**
* The <code>]</code> symbol.
*
* @see #INDEX_OP
* @see #ARRAY_DECLARATOR
**/
public static final int RBRACK = GeneratedJavaTokenTypes.RBRACK;
/**
* The <code>void</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_VOID =
GeneratedJavaTokenTypes.LITERAL_void;
/**
* The <code>boolean</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_BOOLEAN =
GeneratedJavaTokenTypes.LITERAL_boolean;
/**
* The <code>byte</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_BYTE =
GeneratedJavaTokenTypes.LITERAL_byte;
/**
* The <code>char</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_CHAR =
GeneratedJavaTokenTypes.LITERAL_char;
/**
* The <code>short</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_SHORT =
GeneratedJavaTokenTypes.LITERAL_short;
/**
* The <code>int</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_INT = GeneratedJavaTokenTypes.LITERAL_int;
/**
* The <code>float</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_FLOAT =
GeneratedJavaTokenTypes.LITERAL_float;
/**
* The <code>long</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_LONG =
GeneratedJavaTokenTypes.LITERAL_long;
/**
* The <code>double</code> keyword.
*
* @see #TYPE
**/
public static final int LITERAL_DOUBLE =
GeneratedJavaTokenTypes.LITERAL_double;
/**
* An identifier. These can be names of types, subpackages,
* fields, methods, parameters, and local variables.
**/
public static final int IDENT = GeneratedJavaTokenTypes.IDENT;
/**
* The <code>.</code> (dot) operator.
*
* @see FullIdent
**/
public static final int DOT = GeneratedJavaTokenTypes.DOT;
/**
* The <code>*</code> (multiplication or wildcard) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5.2">Java
* Language Specification, §7.5.2</a>
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.1">Java
* Language Specification, §15.17.1</a>
* @see #EXPR
* @see #IMPORT
**/
public static final int STAR = GeneratedJavaTokenTypes.STAR;
/**
* The <code>private</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PRIVATE =
GeneratedJavaTokenTypes.LITERAL_private;
/**
* The <code>public</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PUBLIC =
GeneratedJavaTokenTypes.LITERAL_public;
/**
* The <code>protected</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_PROTECTED =
GeneratedJavaTokenTypes.LITERAL_protected;
/**
* The <code>static</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_STATIC =
GeneratedJavaTokenTypes.LITERAL_static;
/**
* The <code>transient</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_TRANSIENT =
GeneratedJavaTokenTypes.LITERAL_transient;
/**
* The <code>native</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_NATIVE =
GeneratedJavaTokenTypes.LITERAL_native;
/**
* The <code>synchronized</code> keyword. This may be used as a
* modifier of a method or in the definition of a synchronized
* block.
*
* <p>For example:</p>
*
* <pre>
* synchronized(this)
* {
* x++;
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--LITERAL_SYNCHRONIZED (synchronized)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--LITERAL_THIS (this)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--POST_INC (++)
* |
* +--IDENT (x)
* +--SEMI (;)
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see #MODIFIERS
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #SLIST
* @see #RCURLY
**/
public static final int LITERAL_SYNCHRONIZED =
GeneratedJavaTokenTypes.LITERAL_synchronized;
/**
* The <code>volatile</code> keyword.
*
* @see #MODIFIERS
**/
public static final int LITERAL_VOLATILE =
GeneratedJavaTokenTypes.LITERAL_volatile;
/**
* The <code>class</code> keyword. This element appears both
* as part of a class declaration, and inline to reference a
* class object.
*
* <p>For example:</p>
*
* <pre>
* int.class
* </pre>
* <p>parses as:</p>
* <pre>
* +--EXPR
* |
* +--DOT (.)
* |
* +--LITERAL_INT (int)
* +--LITERAL_CLASS (class)
* </pre>
*
* @see #DOT
* @see #IDENT
* @see #CLASS_DEF
* @see FullIdent
**/
public static final int LITERAL_CLASS =
GeneratedJavaTokenTypes.LITERAL_class;
/**
* The <code>interface</code> keyword. This token appears in
* interface definition.
*
* @see #INTERFACE_DEF
**/
public static final int LITERAL_INTERFACE =
GeneratedJavaTokenTypes.LITERAL_interface;
/**
* A left (curly) brace (<code>{</code>).
*
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see #SLIST
**/
public static final int LCURLY = GeneratedJavaTokenTypes.LCURLY;
/**
* A right (curly) brace (<code>}</code>).
*
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see #SLIST
**/
public static final int RCURLY = GeneratedJavaTokenTypes.RCURLY;
/**
* The <code>,</code> (comma) operator.
*
* @see #ARRAY_INIT
* @see #FOR_INIT
* @see #FOR_ITERATOR
* @see #LITERAL_THROWS
* @see #IMPLEMENTS_CLAUSE
**/
public static final int COMMA = GeneratedJavaTokenTypes.COMMA;
/**
* A left parenthesis (<code>(</code>).
*
* @see #LITERAL_FOR
* @see #LITERAL_NEW
* @see #EXPR
* @see #LITERAL_SWITCH
* @see #LITERAL_CATCH
**/
public static final int LPAREN = GeneratedJavaTokenTypes.LPAREN;
/**
* A right parenthesis (<code>)</code>).
*
* @see #LITERAL_FOR
* @see #LITERAL_NEW
* @see #METHOD_CALL
* @see #TYPECAST
* @see #EXPR
* @see #LITERAL_SWITCH
* @see #LITERAL_CATCH
**/
public static final int RPAREN = GeneratedJavaTokenTypes.RPAREN;
/**
* The <code>this</code> keyword.
*
* @see #EXPR
* @see #CTOR_CALL
**/
public static final int LITERAL_THIS =
GeneratedJavaTokenTypes.LITERAL_this;
/**
* The <code>super</code> keyword.
*
* @see #EXPR
* @see #SUPER_CTOR_CALL
**/
public static final int LITERAL_SUPER =
GeneratedJavaTokenTypes.LITERAL_super;
/**
* The <code>=</code> (assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.1">Java
* Language Specification, §15.26.1</a>
* @see #EXPR
**/
public static final int ASSIGN = GeneratedJavaTokenTypes.ASSIGN;
/**
* The <code>throws</code> keyword. The children are a number of
* one or more identifiers separated by commas.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.4">Java
* Language Specification, §8.4.4</a>
* @see #IDENT
* @see #DOT
* @see #COMMA
* @see #METHOD_DEF
* @see #CTOR_DEF
* @see FullIdent
**/
public static final int LITERAL_THROWS =
GeneratedJavaTokenTypes.LITERAL_throws;
/**
* The <code>:</code> (colon) operator. This will appear as part
* of the conditional operator (<code>? :</code>).
*
* @see #QUESTION
* @see #LABELED_STAT
* @see #CASE_GROUP
**/
public static final int COLON = GeneratedJavaTokenTypes.COLON;
/**
* The <code>::</code> (double colon) operator.
* It is part of Java 8 syntax that is used for method reference.
* @see #METHOD_REF
*/
public static final int DOUBLE_COLON = GeneratedJavaTokenTypes.DOUBLE_COLON;
/**
* The <code>if</code> keyword.
*
* <p>For example:</p>
* <pre>
* if(optimistic)
* {
* message = "half full";
* }
* else
* {
* message = "half empty";
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_IF (if)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--IDENT (optimistic)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (message)
* +--STRING_LITERAL ("half full")
* +--SEMI (;)
* +--RCURLY (})
* +--LITERAL_ELSE (else)
* |
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (message)
* +--STRING_LITERAL ("half empty")
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #SLIST
* @see #EMPTY_STAT
* @see #LITERAL_ELSE
**/
public static final int LITERAL_IF = GeneratedJavaTokenTypes.LITERAL_if;
/**
* The <code>for</code> keyword. The children are <code>(</code>,
* an initializer, a condition, an iterator, a <code>)</code> and
* either a statement list, a single expression, or an empty
* statement.
*
* <p>For example:</p>
* <pre>
* for(int i = 0, n = myArray.length; i < n; i++)
* {
* }
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_FOR (for)
* |
* +--LPAREN (()
* +--FOR_INIT
* |
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (i)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--COMMA (,)
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (n)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--DOT (.)
* |
* +--IDENT (myArray)
* +--IDENT (length)
* +--SEMI (;)
* +--FOR_CONDITION
* |
* +--EXPR
* |
* +--LT (<)
* |
* +--IDENT (i)
* +--IDENT (n)
* +--SEMI (;)
* +--FOR_ITERATOR
* |
* +--ELIST
* |
* +--EXPR
* |
* +--POST_INC (++)
* |
* +--IDENT (i)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #FOR_INIT
* @see #SEMI
* @see #FOR_CONDITION
* @see #FOR_ITERATOR
* @see #RPAREN
* @see #SLIST
* @see #EMPTY_STAT
* @see #EXPR
**/
public static final int LITERAL_FOR = GeneratedJavaTokenTypes.LITERAL_for;
/**
* The <code>while</code> keyword.
*
* <p>For example:</p>
* <pre>
* while(line != null)
* {
* process(line);
* line = in.readLine();
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_WHILE (while)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--NOT_EQUAL (!=)
* |
* +--IDENT (line)
* +--LITERAL_NULL (null)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--EXPR
* |
* +--METHOD_CALL (()
* |
* +--IDENT (process)
* +--ELIST
* |
* +--EXPR
* |
* +--IDENT (line)
* +--RPAREN ())
* +--SEMI (;)
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (line)
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (in)
* +--IDENT (readLine)
* +--ELIST
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* </pre>
**/
public static final int LITERAL_WHILE =
GeneratedJavaTokenTypes.LITERAL_while;
/**
* The <code>do</code> keyword. Note the the while token does not
* appear as part of the do-while construct.
*
* <p>For example:</p>
* <pre>
* do
* {
* x = rand.nextInt(10);
* }
* while(x < 5);
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_DO (do)
* |
* +--SLIST ({)
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (x)
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (rand)
* +--IDENT (nextInt)
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (10)
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--DO_WHILE (while)
* +--LPAREN (()
* +--EXPR
* |
* +--LT (<)
* |
* +--IDENT (x)
* +--NUM_INT (5)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
*
* @see #SLIST
* @see #EXPR
* @see #EMPTY_STAT
* @see #LPAREN
* @see #RPAREN
* @see #SEMI
**/
public static final int LITERAL_DO = GeneratedJavaTokenTypes.LITERAL_do;
/**
* Literal <code>while</code> in do-while loop.
* @see #LITERAL_DO
*/
public static final int DO_WHILE = GeneratedJavaTokenTypes.DO_WHILE;
/**
* The <code>break</code> keyword. The first child is an optional
* identifier and the last child is a semicolon.
*
* @see #IDENT
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_BREAK =
GeneratedJavaTokenTypes.LITERAL_break;
/**
* The <code>continue</code> keyword. The first child is an
* optional identifier and the last child is a semicolon.
*
* @see #IDENT
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_CONTINUE =
GeneratedJavaTokenTypes.LITERAL_continue;
/**
* The <code>return</code> keyword. The first child is an
* optional expression for the return value. The last child is a
* semi colon.
*
* @see #EXPR
* @see #SEMI
* @see #SLIST
**/
public static final int LITERAL_RETURN =
GeneratedJavaTokenTypes.LITERAL_return;
/**
* The <code>switch</code> keyword.
*
* <p>For example:</p>
* <pre>
* switch(type)
* {
* case 0:
* background = Color.blue;
* break;
* case 1:
* background = Color.red;
* break;
* default:
* background = Color.green;
* break;
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_SWITCH (switch)
* |
* +--LPAREN (()
* +--EXPR
* |
* +--IDENT (type)
* +--RPAREN ())
* +--LCURLY ({)
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (0)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (blue)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--CASE_GROUP
* |
* +--LITERAL_CASE (case)
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (red)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--CASE_GROUP
* |
* +--LITERAL_DEFAULT (default)
* +--SLIST
* |
* +--EXPR
* |
* +--ASSIGN (=)
* |
* +--IDENT (background)
* +--DOT (.)
* |
* +--IDENT (Color)
* +--IDENT (green)
* +--SEMI (;)
* +--LITERAL_BREAK (break)
* |
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10">Java
* Language Specification, §14.10</a>
* @see #LPAREN
* @see #EXPR
* @see #RPAREN
* @see #LCURLY
* @see #CASE_GROUP
* @see #RCURLY
* @see #SLIST
**/
public static final int LITERAL_SWITCH =
GeneratedJavaTokenTypes.LITERAL_switch;
/**
* The <code>throw</code> keyword. The first child is an
* expression that evaluates to a <code>Throwable</code> instance.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.17">Java
* Language Specification, §14.17</a>
* @see #SLIST
* @see #EXPR
**/
public static final int LITERAL_THROW =
GeneratedJavaTokenTypes.LITERAL_throw;
/**
* The <code>else</code> keyword. This appears as a child of an
* <code>if</code> statement.
*
* @see #SLIST
* @see #EXPR
* @see #EMPTY_STAT
* @see #LITERAL_IF
**/
public static final int LITERAL_ELSE =
GeneratedJavaTokenTypes.LITERAL_else;
/**
* The <code>case</code> keyword. The first child is a constant
* expression that evaluates to a integer.
*
* @see #CASE_GROUP
* @see #EXPR
**/
public static final int LITERAL_CASE =
GeneratedJavaTokenTypes.LITERAL_case;
/**
* The <code>default</code> keyword. This element has no
* children.
*
* @see #CASE_GROUP
* @see #MODIFIERS
**/
public static final int LITERAL_DEFAULT =
GeneratedJavaTokenTypes.LITERAL_default;
/**
* The <code>try</code> keyword. The children are a statement
* list, zero or more catch blocks and then an optional finally
* block.
*
* <p>For example:</p>
* <pre>
* try
* {
* FileReader in = new FileReader("abc.txt");
* }
* catch(IOException ioe)
* {
* }
* finally
* {
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_TRY (try)
* |
* +--SLIST ({)
* |
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (FileReader)
* +--IDENT (in)
* +--ASSIGN (=)
* |
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (FileReader)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--STRING_LITERAL ("abc.txt")
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--LITERAL_CATCH (catch)
* |
* +--LPAREN (()
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (IOException)
* +--IDENT (ioe)
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--LITERAL_FINALLY (finally)
* |
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.19">Java
* Language Specification, §14.19</a>
* @see #SLIST
* @see #LITERAL_CATCH
* @see #LITERAL_FINALLY
**/
public static final int LITERAL_TRY = GeneratedJavaTokenTypes.LITERAL_try;
/**
* Java 7 try-with-resources construct.
*
* <p>For example:</p>
* <pre>
* try (Foo foo = new Foo(); Bar bar = new Bar()) { }
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_TRY (try)
* |
* +--RESOURCE_SPECIFICATION
* |
* +--LPAREN (()
* +--RESOURCES
* |
* +--RESOURCE
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (Foo)
* +--IDENT (foo)
* +--ASSIGN (=)
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (Foo)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--SEMI (;)
* +--RESOURCE
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (Bar)
* +--IDENT (bar)
* +--ASSIGN (=)
* +--EXPR
* |
* +--LITERAL_NEW (new)
* |
* +--IDENT (Bar)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--RPAREN ())
* +--SLIST ({)
* +--RCURLY (})
* </pre>
*
* @see #LPAREN
* @see #RESOURCES
* @see #RESOURCE
* @see #SEMI
* @see #RPAREN
* @see #LITERAL_TRY
**/
public static final int RESOURCE_SPECIFICATION =
GeneratedJavaTokenTypes.RESOURCE_SPECIFICATION;
/**
* Java 7 try-with-resources construct.
*
* @see #RESOURCE_SPECIFICATION
**/
public static final int RESOURCES =
GeneratedJavaTokenTypes.RESOURCES;
/**
* Java 7 try-with-resources construct.
*
* @see #RESOURCE_SPECIFICATION
**/
public static final int RESOURCE =
GeneratedJavaTokenTypes.RESOURCE;
/**
* The <code>catch</code> keyword.
*
* @see #LPAREN
* @see #PARAMETER_DEF
* @see #RPAREN
* @see #SLIST
* @see #LITERAL_TRY
**/
public static final int LITERAL_CATCH =
GeneratedJavaTokenTypes.LITERAL_catch;
/**
* The <code>finally</code> keyword.
*
* @see #SLIST
* @see #LITERAL_TRY
**/
public static final int LITERAL_FINALLY =
GeneratedJavaTokenTypes.LITERAL_finally;
/**
* The <code>+=</code> (addition assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int PLUS_ASSIGN = GeneratedJavaTokenTypes.PLUS_ASSIGN;
/**
* The <code>-=</code> (subtraction assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int MINUS_ASSIGN =
GeneratedJavaTokenTypes.MINUS_ASSIGN;
/**
* The <code>*=</code> (multiplication assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int STAR_ASSIGN = GeneratedJavaTokenTypes.STAR_ASSIGN;
/**
* The <code>/=</code> (division assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int DIV_ASSIGN = GeneratedJavaTokenTypes.DIV_ASSIGN;
/**
* The <code>%=</code> (remainder assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int MOD_ASSIGN = GeneratedJavaTokenTypes.MOD_ASSIGN;
/**
* The <code>>>=</code> (signed right shift assignment)
* operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int SR_ASSIGN = GeneratedJavaTokenTypes.SR_ASSIGN;
/**
* The <code>>>>=</code> (unsigned right shift assignment)
* operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BSR_ASSIGN = GeneratedJavaTokenTypes.BSR_ASSIGN;
/**
* The <code><<=</code> (left shift assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int SL_ASSIGN = GeneratedJavaTokenTypes.SL_ASSIGN;
/**
* The <code>&=</code> (bitwise AND assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BAND_ASSIGN = GeneratedJavaTokenTypes.BAND_ASSIGN;
/**
* The <code>^=</code> (bitwise exclusive OR assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BXOR_ASSIGN = GeneratedJavaTokenTypes.BXOR_ASSIGN;
/**
* The <code>|=</code> (bitwise OR assignment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java
* Language Specification, §15.26.2</a>
* @see #EXPR
**/
public static final int BOR_ASSIGN = GeneratedJavaTokenTypes.BOR_ASSIGN;
/**
* The <code>?</code> (conditional) operator. Technically,
* the colon is also part of this operator, but it appears as a
* separate token.
*
* <p>For example:</p>
* <pre>
* (quantity == 1) ? "": "s"
* </pre>
* <p>
* parses as:
* </p>
* <pre>
* +--QUESTION (?)
* |
* +--LPAREN (()
* +--EQUAL (==)
* |
* +--IDENT (quantity)
* +--NUM_INT (1)
* +--RPAREN ())
* +--STRING_LITERAL ("")
* +--COLON (:)
* +--STRING_LITERAL ("s")
* </pre>
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.25">Java
* Language Specification, §15.25</a>
* @see #EXPR
* @see #COLON
**/
public static final int QUESTION = GeneratedJavaTokenTypes.QUESTION;
/**
* The <code>||</code> (conditional OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.24">Java
* Language Specification, §15.24</a>
* @see #EXPR
**/
public static final int LOR = GeneratedJavaTokenTypes.LOR;
/**
* The <code>&&</code> (conditional AND) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.23">Java
* Language Specification, §15.23</a>
* @see #EXPR
**/
public static final int LAND = GeneratedJavaTokenTypes.LAND;
/**
* The <code>|</code> (bitwise OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BOR = GeneratedJavaTokenTypes.BOR;
/**
* The <code>^</code> (bitwise exclusive OR) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BXOR = GeneratedJavaTokenTypes.BXOR;
/**
* The <code>&</code> (bitwise AND) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java
* Language Specification, §15.22.1</a>
* @see #EXPR
**/
public static final int BAND = GeneratedJavaTokenTypes.BAND;
/**
* The <code>!=</code> (not equal) operator.
*
* @see #EXPR
**/
public static final int NOT_EQUAL = GeneratedJavaTokenTypes.NOT_EQUAL;
/**
* The <code>==</code> (equal) operator.
*
* @see #EXPR
**/
public static final int EQUAL = GeneratedJavaTokenTypes.EQUAL;
/**
* The <code><</code> (less than) operator.
*
* @see #EXPR
**/
public static final int LT = GeneratedJavaTokenTypes.LT;
/**
* The <code>></code> (greater than) operator.
*
* @see #EXPR
**/
public static final int GT = GeneratedJavaTokenTypes.GT;
/**
* The <code><=</code> (less than or equal) operator.
*
* @see #EXPR
**/
public static final int LE = GeneratedJavaTokenTypes.LE;
/**
* The <code>>=</code> (greater than or equal) operator.
*
* @see #EXPR
**/
public static final int GE = GeneratedJavaTokenTypes.GE;
/**
* The <code>instanceof</code> operator. The first child is an
* object reference or something that evaluates to an object
* reference. The second child is a reference type.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.20.2">Java
* Language Specification, §15.20.2</a>
* @see #EXPR
* @see #METHOD_CALL
* @see #IDENT
* @see #DOT
* @see #TYPE
* @see FullIdent
**/
public static final int LITERAL_INSTANCEOF =
GeneratedJavaTokenTypes.LITERAL_instanceof;
/**
* The <code><<</code> (shift left) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int SL = GeneratedJavaTokenTypes.SL;
/**
* The <code>>></code> (signed shift right) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int SR = GeneratedJavaTokenTypes.SR;
/**
* The <code>>>></code> (unsigned shift right) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java
* Language Specification, §15.19</a>
* @see #EXPR
**/
public static final int BSR = GeneratedJavaTokenTypes.BSR;
/**
* The <code>+</code> (addition) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java
* Language Specification, §15.18</a>
* @see #EXPR
**/
public static final int PLUS = GeneratedJavaTokenTypes.PLUS;
/**
* The <code>-</code> (subtraction) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java
* Language Specification, §15.18</a>
* @see #EXPR
**/
public static final int MINUS = GeneratedJavaTokenTypes.MINUS;
/**
* The <code>/</code> (division) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.2">Java
* Language Specification, §15.17.2</a>
* @see #EXPR
**/
public static final int DIV = GeneratedJavaTokenTypes.DIV;
/**
* The <code>%</code> (remainder) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.3">Java
* Language Specification, §15.17.3</a>
* @see #EXPR
**/
public static final int MOD = GeneratedJavaTokenTypes.MOD;
/**
* The <code>++</code> (prefix increment) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.1">Java
* Language Specification, §15.15.1</a>
* @see #EXPR
* @see #POST_INC
**/
public static final int INC = GeneratedJavaTokenTypes.INC;
/**
* The <code>--</code> (prefix decrement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.2">Java
* Language Specification, §15.15.2</a>
* @see #EXPR
* @see #POST_DEC
**/
public static final int DEC = GeneratedJavaTokenTypes.DEC;
/**
* The <code>~</code> (bitwise complement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.5">Java
* Language Specification, §15.15.5</a>
* @see #EXPR
**/
public static final int BNOT = GeneratedJavaTokenTypes.BNOT;
/**
* The <code>!</code> (logical complement) operator.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.6">Java
* Language Specification, §15.15.6</a>
* @see #EXPR
**/
public static final int LNOT = GeneratedJavaTokenTypes.LNOT;
/**
* The <code>true</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java
* Language Specification, §3.10.3</a>
* @see #EXPR
* @see #LITERAL_FALSE
**/
public static final int LITERAL_TRUE =
GeneratedJavaTokenTypes.LITERAL_true;
/**
* The <code>false</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java
* Language Specification, §3.10.3</a>
* @see #EXPR
* @see #LITERAL_TRUE
**/
public static final int LITERAL_FALSE =
GeneratedJavaTokenTypes.LITERAL_false;
/**
* The <code>null</code> keyword.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7">Java
* Language Specification, §3.10.7</a>
* @see #EXPR
**/
public static final int LITERAL_NULL =
GeneratedJavaTokenTypes.LITERAL_null;
/**
* The <code>new</code> keyword. This element is used to define
* new instances of objects, new arrays, and new anonymous inner
* classes.
*
* <p>For example:</p>
*
* <pre>
* new ArrayList(50)
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--IDENT (ArrayList)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (50)
* +--RPAREN ())
* </pre>
*
* <p>For example:</p>
* <pre>
* new float[]
* {
* 3.0f,
* 4.0f
* };
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--LITERAL_FLOAT (float)
* +--ARRAY_DECLARATOR ([)
* +--ARRAY_INIT ({)
* |
* +--EXPR
* |
* +--NUM_FLOAT (3.0f)
* +--COMMA (,)
* +--EXPR
* |
* +--NUM_FLOAT (4.0f)
* +--RCURLY (})
* </pre>
*
* <p>For example:</p>
* <pre>
* new FilenameFilter()
* {
* public boolean accept(File dir, String name)
* {
* return name.endsWith(".java");
* }
* }
* </pre>
*
* <p>parses as:</p>
* <pre>
* +--LITERAL_NEW (new)
* |
* +--IDENT (FilenameFilter)
* +--LPAREN (()
* +--ELIST
* +--RPAREN ())
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_BOOLEAN (boolean)
* +--IDENT (accept)
* +--PARAMETERS
* |
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (File)
* +--IDENT (dir)
* +--COMMA (,)
* +--PARAMETER_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (name)
* +--SLIST ({)
* |
* +--LITERAL_RETURN (return)
* |
* +--EXPR
* |
* +--METHOD_CALL (()
* |
* +--DOT (.)
* |
* +--IDENT (name)
* +--IDENT (endsWith)
* +--ELIST
* |
* +--EXPR
* |
* +--STRING_LITERAL (".java")
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see #IDENT
* @see #DOT
* @see #LPAREN
* @see #ELIST
* @see #RPAREN
* @see #OBJBLOCK
* @see #ARRAY_INIT
* @see FullIdent
**/
public static final int LITERAL_NEW = GeneratedJavaTokenTypes.LITERAL_new;
/**
* An integer literal. These may be specified in decimal,
* hexadecimal, or octal form.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java
* Language Specification, §3.10.1</a>
* @see #EXPR
* @see #NUM_LONG
**/
public static final int NUM_INT = GeneratedJavaTokenTypes.NUM_INT;
/**
* A character literal. This is a (possibly escaped) character
* enclosed in single quotes.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.4">Java
* Language Specification, §3.10.4</a>
* @see #EXPR
**/
public static final int CHAR_LITERAL =
GeneratedJavaTokenTypes.CHAR_LITERAL;
/**
* A string literal. This is a sequence of (possibly escaped)
* characters enclosed in double quotes.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.5">Java
* Language Specification, §3.10.5</a>
* @see #EXPR
**/
public static final int STRING_LITERAL =
GeneratedJavaTokenTypes.STRING_LITERAL;
/**
* A single precision floating point literal. This is a floating
* point number with an <code>F</code> or <code>f</code> suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java
* Language Specification, §3.10.2</a>
* @see #EXPR
* @see #NUM_DOUBLE
**/
public static final int NUM_FLOAT = GeneratedJavaTokenTypes.NUM_FLOAT;
/**
* A long integer literal. These are almost the same as integer
* literals, but they have an <code>L</code> or <code>l</code>
* (ell) suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java
* Language Specification, §3.10.1</a>
* @see #EXPR
* @see #NUM_INT
**/
public static final int NUM_LONG = GeneratedJavaTokenTypes.NUM_LONG;
/**
* A double precision floating point literal. This is a floating
* point number with an optional <code>D</code> or <code>d</code>
* suffix.
*
* @see <a
* href="http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java
* Language Specification, §3.10.2</a>
* @see #EXPR
* @see #NUM_FLOAT
**/
public static final int NUM_DOUBLE = GeneratedJavaTokenTypes.NUM_DOUBLE;
/**
* The <code>assert</code> keyword. This is only for Java 1.4 and
* later.
*
* <p>For example:</p>
* <pre>
* assert(x==4);
* </pre>
* <p>parses as:</p>
* <pre>
* +--LITERAL_ASSERT (assert)
* |
* +--EXPR
* |
* +--LPAREN (()
* +--EQUAL (==)
* |
* +--IDENT (x)
* +--NUM_INT (4)
* +--RPAREN ())
* +--SEMI (;)
* </pre>
**/
public static final int LITERAL_ASSERT = GeneratedJavaTokenTypes.ASSERT;
/**
* A static import declaration. Static import declarations are optional,
* but must appear after the package declaration and before the type
* declaration.
*
* <p>For example:</p>
*
* <pre>
* import static java.io.IOException;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--STATIC_IMPORT (import)
* |
* +--LITERAL_STATIC
* +--DOT (.)
* |
* +--DOT (.)
* |
* +--IDENT (java)
* +--IDENT (io)
* +--IDENT (IOException)
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #LITERAL_STATIC
* @see #DOT
* @see #IDENT
* @see #STAR
* @see #SEMI
* @see FullIdent
**/
public static final int STATIC_IMPORT =
GeneratedJavaTokenTypes.STATIC_IMPORT;
/**
* An enum declaration. Its notable children are
* enum constant declarations followed by
* any construct that may be expected in a class body.
*
* <p>For example:</p>
* <pre>
* public enum MyEnum
* implements Serializable
* {
* FIRST_CONSTANT,
* SECOND_CONSTANT;
*
* public void someMethod()
* {
* }
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ENUM_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--ENUM (enum)
* +--IDENT (MyEnum)
* +--EXTENDS_CLAUSE
* +--IMPLEMENTS_CLAUSE
* |
* +--IDENT (Serializable)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--ENUM_CONSTANT_DEF
* |
* +--IDENT (FIRST_CONSTANT)
* +--COMMA (,)
* +--ENUM_CONSTANT_DEF
* |
* +--IDENT (SECOND_CONSTANT)
* +--SEMI (;)
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_void (void)
* +--IDENT (someMethod)
* +--LPAREN (()
* +--PARAMETERS
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #ENUM
* @see #IDENT
* @see #EXTENDS_CLAUSE
* @see #IMPLEMENTS_CLAUSE
* @see #OBJBLOCK
* @see #LITERAL_NEW
* @see #ENUM_CONSTANT_DEF
**/
public static final int ENUM_DEF =
GeneratedJavaTokenTypes.ENUM_DEF;
/**
* The <code>enum</code> keyword. This element appears
* as part of an enum declaration.
**/
public static final int ENUM =
GeneratedJavaTokenTypes.ENUM;
/**
* An enum constant declaration. Its notable children are annotations,
* arguments and object block akin to an anonymous
* inner class' body.
*
* <p>For example:</p>
* <pre>
* SOME_CONSTANT(1)
* {
* public void someMethodOverriddenFromMainBody()
* {
* }
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ENUM_CONSTANT_DEF
* |
* +--ANNOTATIONS
* +--IDENT (SOME_CONSTANT)
* +--LPAREN (()
* +--ELIST
* |
* +--EXPR
* |
* +--NUM_INT (1)
* +--RPAREN ())
* +--OBJBLOCK
* |
* +--LCURLY ({)
* |
* +--METHOD_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--LITERAL_void (void)
* +--IDENT (someMethodOverriddenFromMainBody)
* +--LPAREN (()
* +--PARAMETERS
* +--RPAREN ())
* +--SLIST ({)
* |
* +--RCURLY (})
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATIONS
* @see #MODIFIERS
* @see #IDENT
* @see #ELIST
* @see #OBJBLOCK
**/
public static final int ENUM_CONSTANT_DEF =
GeneratedJavaTokenTypes.ENUM_CONSTANT_DEF;
/**
* A for-each clause. This is a child of
* <code>LITERAL_FOR</code>. The children of this element may be
* a parameter definition, the colon literal and an expression.
*
* @see #VARIABLE_DEF
* @see #ELIST
* @see #LITERAL_FOR
**/
public static final int FOR_EACH_CLAUSE =
GeneratedJavaTokenTypes.FOR_EACH_CLAUSE;
/**
* An annotation declaration. The notable children are the name of the
* annotation type, annotation field declarations and (constant) fields.
*
* <p>For example:</p>
* <pre>
* public @interface MyAnnotation
* {
* int someValue();
* }
* </pre>
* <p>parses as:</p>
* <pre>
* +--ANNOTATION_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--AT (@)
* +--LITERAL_INTERFACE (interface)
* +--IDENT (MyAnnotation)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--ANNOTATION_FIELD_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--LITERAL_INT (int)
* +--IDENT (someValue)
* +--LPAREN (()
* +--RPAREN ())
* +--SEMI (;)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #LITERAL_INTERFACE
* @see #IDENT
* @see #OBJBLOCK
* @see #ANNOTATION_FIELD_DEF
**/
public static final int ANNOTATION_DEF =
GeneratedJavaTokenTypes.ANNOTATION_DEF;
/**
* An annotation field declaration. The notable children are modifiers,
* field type, field name and an optional default value (a conditional
* compile-time constant expression). Default values may also by
* annotations.
*
* <p>For example:</p>
*
* <pre>
* String someField() default "Hello world";
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION_FIELD_DEF
* |
* +--MODIFIERS
* +--TYPE
* |
* +--IDENT (String)
* +--IDENT (someField)
* +--LPAREN (()
* +--RPAREN ())
* +--LITERAL_DEFAULT (default)
* +--STRING_LITERAL ("Hello world")
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #TYPE
* @see #LITERAL_DEFAULT
*/
public static final int ANNOTATION_FIELD_DEF =
GeneratedJavaTokenTypes.ANNOTATION_FIELD_DEF;
// note: @ is the html escape for '@',
// used here to avoid confusing the javadoc tool
/**
* A collection of annotations on a package or enum constant.
* A collections of annotations will only occur on these nodes
* as all other nodes that may be qualified with an annotation can
* be qualified with any other modifier and hence these annotations
* would be contained in a {@link #MODIFIERS} node.
*
* <p>For example:</p>
*
* <pre>
* @MyAnnotation package blah;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--PACKAGE_DEF (package)
* |
* +--ANNOTATIONS
* |
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (MyAnnotation)
* +--IDENT (blah)
* +--SEMI (;)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #AT
* @see #IDENT
*/
public static final int ANNOTATIONS =
GeneratedJavaTokenTypes.ANNOTATIONS;
// note: @ is the html escape for '@',
// used here to avoid confusing the javadoc tool
/**
* An annotation of a package, type, field, parameter or variable.
* An annotation may occur anywhere modifiers occur (it is a
* type of modifier) and may also occur prior to a package definition.
* The notable children are: The annotation name and either a single
* default annotation value or a sequence of name value pairs.
* Annotation values may also be annotations themselves.
*
* <p>For example:</p>
*
* <pre>
* @MyAnnotation(someField1 = "Hello",
* someField2 = @SomeOtherAnnotation)
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (MyAnnotation)
* +--LPAREN (()
* +--ANNOTATION_MEMBER_VALUE_PAIR
* |
* +--IDENT (someField1)
* +--ASSIGN (=)
* +--ANNOTATION
* |
* +--AT (@)
* +--IDENT (SomeOtherAnnotation)
* +--ANNOTATION_MEMBER_VALUE_PAIR
* |
* +--IDENT (someField2)
* +--ASSIGN (=)
* +--STRING_LITERAL ("Hello")
* +--RPAREN ())
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #MODIFIERS
* @see #IDENT
* @see #ANNOTATION_MEMBER_VALUE_PAIR
*/
public static final int ANNOTATION =
GeneratedJavaTokenTypes.ANNOTATION;
/**
* An initialisation of an annotation member with a value.
* Its children are the name of the member, the assignment literal
* and the (compile-time constant conditional expression) value.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #IDENT
*/
public static final int ANNOTATION_MEMBER_VALUE_PAIR =
GeneratedJavaTokenTypes.ANNOTATION_MEMBER_VALUE_PAIR;
/**
* An annotation array member initialisation.
* Initializers can not be nested.
* Am initializer may be present as a default to a annotation
* member, as the single default value to an annotation
* (e.g. @Annotation({1,2})) or as the value of an annotation
* member value pair.
*
* <p>For example:</p>
*
* <pre>
* { 1, 2 }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--ANNOTATION_ARRAY_INIT ({)
* |
* +--NUM_INT (1)
* +--COMMA (,)
* +--NUM_INT (2)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
* @see #ANNOTATION
* @see #IDENT
* @see #ANNOTATION_MEMBER_VALUE_PAIR
*/
public static final int ANNOTATION_ARRAY_INIT =
GeneratedJavaTokenTypes.ANNOTATION_ARRAY_INIT;
/**
* A list of type parameters to a class, interface or
* method definition. Children are LT, at least one
* TYPE_PARAMETER, zero or more of: a COMMAs followed by a single
* TYPE_PARAMETER and a final GT.
*
* <p>For example:</p>
*
* <pre>
* public class Blah<A, B>
* {
* }
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--CLASS_DEF ({)
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--LITERAL_CLASS (class)
* +--IDENT (Blah)
* +--TYPE_PARAMETERS
* |
* +--GENERIC_START (<)
* +--TYPE_PARAMETER
* |
* +--IDENT (A)
* +--COMMA (,)
* +--TYPE_PARAMETER
* |
* +--IDENT (B)
* +--GENERIC_END (>)
* +--OBJBLOCK
* |
* +--LCURLY ({)
* +--NUM_INT (1)
* +--COMMA (,)
* +--NUM_INT (2)
* +--RCURLY (})
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #GENERIC_START
* @see #GENERIC_END
* @see #TYPE_PARAMETER
* @see #COMMA
*/
public static final int TYPE_PARAMETERS =
GeneratedJavaTokenTypes.TYPE_PARAMETERS;
/**
* A type parameter to a class, interface or method definition.
* Children are the type name and an optional TYPE_UPPER_BOUNDS.
*
* <p>For example:</p>
*
* <pre>
* A extends Collection
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--TYPE_PARAMETER
* |
* +--IDENT (A)
* +--TYPE_UPPER_BOUNDS
* |
* +--IDENT (Collection)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #IDENT
* @see #WILDCARD_TYPE
* @see #TYPE_UPPER_BOUNDS
*/
public static final int TYPE_PARAMETER =
GeneratedJavaTokenTypes.TYPE_PARAMETER;
/**
* A list of type arguments to a type reference or
* a method/ctor invocation. Children are GENERIC_START, at least one
* TYPE_ARGUMENT, zero or more of a COMMAs followed by a single
* TYPE_ARGUMENT, and a final GENERIC_END.
*
* <p>For example:</p>
*
* <pre>
* public Collection<?> a;
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--VARIABLE_DEF
* |
* +--MODIFIERS
* |
* +--LITERAL_PUBLIC (public)
* +--TYPE
* |
* +--IDENT (Collection)
* |
* +--TYPE_ARGUMENTS
* |
* +--GENERIC_START (<)
* +--TYPE_ARGUMENT
* |
* +--WILDCARD_TYPE (?)
* +--GENERIC_END (>)
* +--IDENT (a)
* +--SEMI (;)
* </pre>
*
* @see #GENERIC_START
* @see #GENERIC_END
* @see #TYPE_ARGUMENT
* @see #COMMA
*/
public static final int TYPE_ARGUMENTS =
GeneratedJavaTokenTypes.TYPE_ARGUMENTS;
/**
* A type arguments to a type reference or a method/ctor invocation.
* Children are either: type name or wildcard type with possible type
* upper or lower bounds.
*
* <p>For example:</p>
*
* <pre>
* ? super List
* </pre>
*
* <p>parses as:</p>
*
* <pre>
* +--TYPE_ARGUMENT
* |
* +--WILDCARD_TYPE (?)
* +--TYPE_LOWER_BOUNDS
* |
* +--IDENT (List)
* </pre>
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #WILDCARD_TYPE
* @see #TYPE_UPPER_BOUNDS
* @see #TYPE_LOWER_BOUNDS
*/
public static final int TYPE_ARGUMENT =
GeneratedJavaTokenTypes.TYPE_ARGUMENT;
/**
* The type that refers to all types. This node has no children.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_ARGUMENT
* @see #TYPE_UPPER_BOUNDS
* @see #TYPE_LOWER_BOUNDS
*/
public static final int WILDCARD_TYPE =
GeneratedJavaTokenTypes.WILDCARD_TYPE;
/**
* An upper bounds on a wildcard type argument or type parameter.
* This node has one child - the type that is being used for
* the bounding.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_PARAMETER
* @see #TYPE_ARGUMENT
* @see #WILDCARD_TYPE
*/
public static final int TYPE_UPPER_BOUNDS =
GeneratedJavaTokenTypes.TYPE_UPPER_BOUNDS;
/**
* A lower bounds on a wildcard type argument. This node has one child
* - the type that is being used for the bounding.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=14">
* JSR14</a>
* @see #TYPE_ARGUMENT
* @see #WILDCARD_TYPE
*/
public static final int TYPE_LOWER_BOUNDS =
GeneratedJavaTokenTypes.TYPE_LOWER_BOUNDS;
/**
* An 'at' symbol - signifying an annotation instance or the prefix
* to the interface literal signifying the definition of an annotation
* declaration.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
*/
public static final int AT = GeneratedJavaTokenTypes.AT;
/**
* A triple dot for variable-length parameters. This token only ever occurs
* in a parameter declaration immediately after the type of the parameter.
*
* @see <a href="https://www.jcp.org/en/jsr/detail?id=201">
* JSR201</a>
*/
public static final int ELLIPSIS = GeneratedJavaTokenTypes.ELLIPSIS;
/**
* '&' symbol when used in a generic upper or lower bounds constrain
* e.g. {@code Comparable<<? extends Serializable, CharSequence>}.
*/
public static final int TYPE_EXTENSION_AND =
GeneratedJavaTokenTypes.TYPE_EXTENSION_AND;
/**
* '<' symbol signifying the start of type arguments or type
* parameters.
*/
public static final int GENERIC_START =
GeneratedJavaTokenTypes.GENERIC_START;
/**
* '>' symbol signifying the end of type arguments or type parameters.
*/
public static final int GENERIC_END = GeneratedJavaTokenTypes.GENERIC_END;
/**
* Special lambda symbol '->'.
*/
public static final int LAMBDA = GeneratedJavaTokenTypes.LAMBDA;
/**
* Beginning of single line comment: '//'.
*
* <pre>
* +--SINGLE_LINE_COMMENT
* |
* +--COMMENT_CONTENT
* </pre>
*/
public static final int SINGLE_LINE_COMMENT =
GeneratedJavaTokenTypes.SINGLE_LINE_COMMENT;
/**
* Beginning of block comment: '/*'.
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int BLOCK_COMMENT_BEGIN =
GeneratedJavaTokenTypes.BLOCK_COMMENT_BEGIN;
/**
* End of block comment: '* /'.
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int BLOCK_COMMENT_END =
GeneratedJavaTokenTypes.BLOCK_COMMENT_END;
/**
* Text of single-line or block comment.
*
*<pre>
* +--SINGLE_LINE_COMMENT
* |
* +--COMMENT_CONTENT
* </pre>
*
* <pre>
* +--BLOCK_COMMENT_BEGIN
* |
* +--COMMENT_CONTENT
* +--BLOCK_COMMENT_END
* </pre>
*/
public static final int COMMENT_CONTENT =
GeneratedJavaTokenTypes.COMMENT_CONTENT;
/** Prevent instantiation. */
private TokenTypes() {
}
}
| Issue #3209: add example to TokenTypes for FOR_EACH_CLAUSE
| src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java | Issue #3209: add example to TokenTypes for FOR_EACH_CLAUSE | <ide><path>rc/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java
<ide> * <code>LITERAL_FOR</code>. The children of this element may be
<ide> * a parameter definition, the colon literal and an expression.
<ide> *
<add> * <p>For example:</p>
<add> * <pre>
<add> * for (int value : values) {
<add> * doSmth();
<add> * }
<add> * </pre>
<add> * <p>parses as:</p>
<add> * <pre>
<add> * --LITERAL_FOR (for)
<add> * |--LPAREN (()
<add> * |--FOR_EACH_CLAUSE
<add> * | |--VARIABLE_DEF
<add> * | | |--MODIFIERS
<add> * | | |--TYPE
<add> * | | | `--LITERAL_INT (int)
<add> * | | `--IDENT (value)
<add> * | |--COLON (:)
<add> * | `--EXPR
<add> * | `--IDENT (values
<add> * |--RPAREN ())
<add> * `--SLIST ({)
<add> * |--EXPR
<add> * | `--METHOD_CALL (()
<add> * | |--IDENT (doSmth)
<add> * | |--ELIST
<add> * | `--RPAREN ())
<add> * |--SEMI (;)
<add> * `--RCURLY (})
<add> *
<add> * </pre>
<add> *
<ide> * @see #VARIABLE_DEF
<ide> * @see #ELIST
<ide> * @see #LITERAL_FOR |
|
Java | apache-2.0 | 0303c5889474e02463030f8979092e2d10059dda | 0 | aiyanbo/sliner | package jmotor.sliner.mapper.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import jmotor.sliner.mapper.ConditionMapping;
import jmotor.sliner.mapper.SearchMapper;
import jmotor.sliner.mapper.SearchMapperXPath;
import jmotor.sliner.mapper.SorterMapping;
import jmotor.util.CollectionUtils;
import jmotor.util.XmlUtils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.Node;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
/**
* Component:
* Description:
* Date: 13-6-18
*
* @author Andy Ai
*/
public class SearchMapperImpl implements SearchMapper, SearchMapperXPath {
private LoadingCache<String, SearchMapping> searchMappingCache;
private String suffix = ".xml";
private Long cacheInSeconds = 10L;
private String workingPath = "config/mapper";
private void initComponent() {
searchMappingCache = CacheBuilder.newBuilder().
expireAfterWrite(cacheInSeconds, TimeUnit.SECONDS).
maximumSize(1024).
build(new CacheLoader<String, SearchMapping>() {
@Override
public SearchMapping load(String key) throws Exception {
return null;
}
});
}
@Override
public String getSchema(String key) {
return getSearchMappingInCache(key).getSchema();
}
@Override
public Set<ConditionMapping> getConditionMapper(String key) {
return getSearchMappingInCache(key).getConditionMapper();
}
@Override
public Set<SorterMapping> getSorterMapper(String key) {
return getSearchMappingInCache(key).getSorterMapper();
}
private SearchMapping getSearchMappingInCache(String key) {
try {
return searchMappingCache.get(key);
} catch (ExecutionException e) {
throw new NullPointerException("Can't find key: " + key);
}
}
@SuppressWarnings("unchecked")
private SearchMapping parseSearchMapping(String key) {
String fileName = workingPath.replace("\\", "/") + "/" + key + suffix;
Document document = XmlUtils.loadDocument(fileName);
Element rootElement = document.getRootElement();
String schema = XmlUtils.getAttribute(rootElement, SCHEMA_ATTR);
Node conditionsNode = rootElement.selectSingleNode(CONDITIONS_NODE);
List<Node> conditionNodes = conditionsNode.selectNodes(CONDITION_NODE);
Set<ConditionMapping> conditionMappings = parseConditionMappings(conditionNodes);
Node sortersNode = rootElement.selectSingleNode(SORTERS_NODE);
List<Node> sorterNodes = sortersNode.selectNodes(SORTER_NODE);
Set<SorterMapping> sorterMappings = parseSorterMappings(sorterNodes);
SearchMapping searchMapping = new SearchMapping();
searchMapping.setKey(key);
searchMapping.setSchema(schema);
searchMapping.setConditionMapper(conditionMappings);
searchMapping.setSorterMapper(sorterMappings);
return searchMapping;
}
private Set<ConditionMapping> parseConditionMappings(List<Node> conditionNodes) {
Set<ConditionMapping> mappings = new HashSet<ConditionMapping>(conditionNodes.size());
for (Node node : conditionNodes) {
String name = XmlUtils.getAttribute(node, NAME_ATTR);
String column = XmlUtils.getAttribute(node, COLUMN_ATTR);
String type = XmlUtils.getAttribute(node, TYPE_ATTR);
ConditionMapping mapping = new ConditionMapping();
mapping.setName(name);
mapping.setColumnName(column);
mapping.setType(type);
mappings.add(mapping);
}
return mappings;
}
private Set<SorterMapping> parseSorterMappings(List<Node> sorterNodes) {
if (CollectionUtils.isNotEmpty(sorterNodes)) {
Set<SorterMapping> mappings = new HashSet<SorterMapping>(sorterNodes.size());
for (Node node : sorterNodes) {
String name = XmlUtils.getAttribute(node, NAME_ATTR);
String column = XmlUtils.getAttribute(node, COLUMN_ATTR);
SorterMapping mapping = new SorterMapping();
mapping.setName(name);
mapping.setColumnName(column);
mappings.add(mapping);
}
return mappings;
}
return Collections.emptySet();
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public void setCacheInSeconds(Long cacheInSeconds) {
this.cacheInSeconds = cacheInSeconds;
}
public void setWorkingPath(String workingPath) {
this.workingPath = workingPath;
}
}
| src/main/java/jmotor/sliner/mapper/impl/SearchMapperImpl.java | package jmotor.sliner.mapper.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import jmotor.sliner.mapper.ConditionMapping;
import jmotor.sliner.mapper.SearchMapper;
import jmotor.sliner.mapper.SearchMapperXPath;
import jmotor.sliner.mapper.SorterMapping;
import jmotor.util.XmlUtils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.Node;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
/**
* Component:
* Description:
* Date: 13-6-18
*
* @author Andy Ai
*/
public class SearchMapperImpl implements SearchMapper, SearchMapperXPath {
private LoadingCache<String, SearchMapping> searchMappingCache;
private String suffix = ".xml";
private Long cacheInSeconds = 10L;
private String workingPath = "config/mapper";
private void initComponent() {
searchMappingCache = CacheBuilder.newBuilder().
expireAfterWrite(cacheInSeconds, TimeUnit.SECONDS).
maximumSize(1024).
build(new CacheLoader<String, SearchMapping>() {
@Override
public SearchMapping load(String key) throws Exception {
return null;
}
});
}
@Override
public String getSchema(String key) {
return getSearchMappingInCache(key).getSchema();
}
@Override
public Set<ConditionMapping> getConditionMapper(String key) {
return getSearchMappingInCache(key).getConditionMapper();
}
@Override
public Set<SorterMapping> getSorterMapper(String key) {
return getSearchMappingInCache(key).getSorterMapper();
}
private SearchMapping getSearchMappingInCache(String key) {
try {
return searchMappingCache.get(key);
} catch (ExecutionException e) {
throw new NullPointerException("Can't find key: " + key);
}
}
@SuppressWarnings("unchecked")
private SearchMapping parseSearchMapping(String key) {
String fileName = workingPath.replace("\\", "/") + "/" + key + suffix;
Document document = XmlUtils.loadDocument(fileName);
Element rootElement = document.getRootElement();
String schema = XmlUtils.getAttribute(rootElement, SCHEMA_ATTR);
Node conditionsNode = rootElement.selectSingleNode(CONDITIONS_NODE);
Set<ConditionMapping> conditionMappings = parseConditionMappings(conditionsNode);
Node sortersNode = rootElement.selectSingleNode(SORTERS_NODE);
Set<SorterMapping> sorterMappings = parseSorterMappings(sortersNode);
SearchMapping searchMapping = new SearchMapping();
searchMapping.setKey(key);
searchMapping.setSchema(schema);
searchMapping.setConditionMapper(conditionMappings);
searchMapping.setSorterMapper(sorterMappings);
return searchMapping;
}
private Set<ConditionMapping> parseConditionMappings(Node conditionsNode) {
return null;
}
private Set<SorterMapping> parseSorterMappings(Node sortersNode) {
return null;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public void setCacheInSeconds(Long cacheInSeconds) {
this.cacheInSeconds = cacheInSeconds;
}
public void setWorkingPath(String workingPath) {
this.workingPath = workingPath;
}
}
| Remarks: parse search mapping config
| src/main/java/jmotor/sliner/mapper/impl/SearchMapperImpl.java | Remarks: parse search mapping config | <ide><path>rc/main/java/jmotor/sliner/mapper/impl/SearchMapperImpl.java
<ide> import jmotor.sliner.mapper.SearchMapper;
<ide> import jmotor.sliner.mapper.SearchMapperXPath;
<ide> import jmotor.sliner.mapper.SorterMapping;
<add>import jmotor.util.CollectionUtils;
<ide> import jmotor.util.XmlUtils;
<ide> import org.dom4j.Document;
<ide> import org.dom4j.Element;
<ide> import org.dom4j.Node;
<ide>
<add>import java.util.Collections;
<add>import java.util.HashSet;
<add>import java.util.List;
<ide> import java.util.Set;
<ide> import java.util.concurrent.ExecutionException;
<ide> import java.util.concurrent.TimeUnit;
<ide> Element rootElement = document.getRootElement();
<ide> String schema = XmlUtils.getAttribute(rootElement, SCHEMA_ATTR);
<ide> Node conditionsNode = rootElement.selectSingleNode(CONDITIONS_NODE);
<del> Set<ConditionMapping> conditionMappings = parseConditionMappings(conditionsNode);
<add> List<Node> conditionNodes = conditionsNode.selectNodes(CONDITION_NODE);
<add> Set<ConditionMapping> conditionMappings = parseConditionMappings(conditionNodes);
<ide> Node sortersNode = rootElement.selectSingleNode(SORTERS_NODE);
<del> Set<SorterMapping> sorterMappings = parseSorterMappings(sortersNode);
<add> List<Node> sorterNodes = sortersNode.selectNodes(SORTER_NODE);
<add> Set<SorterMapping> sorterMappings = parseSorterMappings(sorterNodes);
<ide> SearchMapping searchMapping = new SearchMapping();
<ide> searchMapping.setKey(key);
<ide> searchMapping.setSchema(schema);
<ide> return searchMapping;
<ide> }
<ide>
<del> private Set<ConditionMapping> parseConditionMappings(Node conditionsNode) {
<del> return null;
<add> private Set<ConditionMapping> parseConditionMappings(List<Node> conditionNodes) {
<add> Set<ConditionMapping> mappings = new HashSet<ConditionMapping>(conditionNodes.size());
<add> for (Node node : conditionNodes) {
<add> String name = XmlUtils.getAttribute(node, NAME_ATTR);
<add> String column = XmlUtils.getAttribute(node, COLUMN_ATTR);
<add> String type = XmlUtils.getAttribute(node, TYPE_ATTR);
<add> ConditionMapping mapping = new ConditionMapping();
<add> mapping.setName(name);
<add> mapping.setColumnName(column);
<add> mapping.setType(type);
<add> mappings.add(mapping);
<add> }
<add> return mappings;
<ide> }
<ide>
<del> private Set<SorterMapping> parseSorterMappings(Node sortersNode) {
<del> return null;
<add> private Set<SorterMapping> parseSorterMappings(List<Node> sorterNodes) {
<add> if (CollectionUtils.isNotEmpty(sorterNodes)) {
<add> Set<SorterMapping> mappings = new HashSet<SorterMapping>(sorterNodes.size());
<add> for (Node node : sorterNodes) {
<add> String name = XmlUtils.getAttribute(node, NAME_ATTR);
<add> String column = XmlUtils.getAttribute(node, COLUMN_ATTR);
<add> SorterMapping mapping = new SorterMapping();
<add> mapping.setName(name);
<add> mapping.setColumnName(column);
<add> mappings.add(mapping);
<add> }
<add> return mappings;
<add> }
<add> return Collections.emptySet();
<ide> }
<ide>
<ide> public void setSuffix(String suffix) { |
|
Java | apache-2.0 | 98d3ecc07c0a03c91885646f93a85d84bed4e88e | 0 | tadayosi/camel,tadayosi/camel,apache/camel,tadayosi/camel,christophd/camel,christophd/camel,apache/camel,apache/camel,tadayosi/camel,apache/camel,christophd/camel,christophd/camel,apache/camel,christophd/camel,tadayosi/camel,apache/camel,christophd/camel,tadayosi/camel | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.camel.main;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.camel.CamelConfiguration;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.Configuration;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.NoSuchLanguageException;
import org.apache.camel.PropertiesLookupListener;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.StartupStep;
import org.apache.camel.console.DevConsole;
import org.apache.camel.console.DevConsoleRegistry;
import org.apache.camel.health.HealthCheck;
import org.apache.camel.health.HealthCheckRegistry;
import org.apache.camel.health.HealthCheckRepository;
import org.apache.camel.saga.CamelSagaService;
import org.apache.camel.spi.AutowiredLifecycleStrategy;
import org.apache.camel.spi.CamelBeanPostProcessor;
import org.apache.camel.spi.CamelEvent;
import org.apache.camel.spi.ContextReloadStrategy;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.Language;
import org.apache.camel.spi.PackageScanClassResolver;
import org.apache.camel.spi.PeriodTaskScheduler;
import org.apache.camel.spi.PropertiesComponent;
import org.apache.camel.spi.RouteTemplateParameterSource;
import org.apache.camel.spi.StartupStepRecorder;
import org.apache.camel.support.CamelContextHelper;
import org.apache.camel.support.DefaultContextReloadStrategy;
import org.apache.camel.support.EventNotifierSupport;
import org.apache.camel.support.LifecycleStrategySupport;
import org.apache.camel.support.PropertyBindingSupport;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.support.service.BaseService;
import org.apache.camel.support.startup.LoggingStartupStepRecorder;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.OrderedLocationProperties;
import org.apache.camel.util.OrderedProperties;
import org.apache.camel.util.SensitiveUtils;
import org.apache.camel.util.StringHelper;
import org.apache.camel.util.TimeUtils;
import org.apache.camel.vault.VaultConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.camel.main.MainHelper.computeProperties;
import static org.apache.camel.main.MainHelper.optionKey;
import static org.apache.camel.main.MainHelper.setPropertiesOnTarget;
import static org.apache.camel.main.MainHelper.validateOptionAndValue;
import static org.apache.camel.util.LocationHelper.locationSummary;
import static org.apache.camel.util.StringHelper.matches;
/**
* Base class for main implementations to allow bootstrapping Camel in standalone mode.
*/
public abstract class BaseMainSupport extends BaseService {
public static final String DEFAULT_PROPERTY_PLACEHOLDER_LOCATION = "classpath:application.properties;optional=true";
public static final String INITIAL_PROPERTIES_LOCATION = "camel.main.initial-properties-location";
public static final String OVERRIDE_PROPERTIES_LOCATION = "camel.main.override-properties-location";
public static final String PROPERTY_PLACEHOLDER_LOCATION = "camel.main.property-placeholder-location";
private static final Logger LOG = LoggerFactory.getLogger(BaseMainSupport.class);
protected final List<MainListener> listeners = new ArrayList<>();
protected volatile CamelContext camelContext;
protected MainConfigurationProperties mainConfigurationProperties = new MainConfigurationProperties();
protected OrderedLocationProperties wildcardProperties = new OrderedLocationProperties();
protected RoutesCollector routesCollector = new DefaultRoutesCollector();
protected String propertyPlaceholderLocations;
protected String defaultPropertyPlaceholderLocation = DEFAULT_PROPERTY_PLACEHOLDER_LOCATION;
protected Properties initialProperties;
protected Properties overrideProperties;
protected boolean standalone = true;
protected final MainHelper helper;
protected BaseMainSupport() {
this.helper = new MainHelper();
}
protected BaseMainSupport(CamelContext camelContext) {
this.camelContext = camelContext;
this.helper = new MainHelper();
}
/**
* To configure options on Camel Main.
*/
public MainConfigurationProperties configure() {
return mainConfigurationProperties;
}
public RoutesCollector getRoutesCollector() {
return routesCollector;
}
/**
* To use a custom {@link RoutesCollector}.
*/
public void setRoutesCollector(RoutesCollector routesCollector) {
this.routesCollector = routesCollector;
}
public String getPropertyPlaceholderLocations() {
return propertyPlaceholderLocations;
}
/**
* A list of locations to add for loading properties. You can use comma to separate multiple locations.
*/
public void setPropertyPlaceholderLocations(String location) {
this.propertyPlaceholderLocations = location;
}
public String getDefaultPropertyPlaceholderLocation() {
return defaultPropertyPlaceholderLocation;
}
/**
* Set the default location for application properties if no locations have been set. If the value is set to "false"
* or empty, the default location is not taken into account.
* <p/>
* Default value is "classpath:application.properties;optional=true".
*/
public void setDefaultPropertyPlaceholderLocation(String defaultPropertyPlaceholderLocation) {
this.defaultPropertyPlaceholderLocation = defaultPropertyPlaceholderLocation;
}
public Properties getInitialProperties() {
if (initialProperties == null) {
initialProperties = new OrderedProperties();
}
return initialProperties;
}
/**
* Sets initial properties for the properties component, which will be used before any locations are resolved.
*/
public void setInitialProperties(Properties initialProperties) {
this.initialProperties = initialProperties;
}
/**
* Sets initial properties for the properties component, which will be used before any locations are resolved.
*/
public void setInitialProperties(Map<String, Object> initialProperties) {
this.initialProperties = new OrderedProperties();
this.initialProperties.putAll(initialProperties);
}
/**
* Adds a property (initial) for the properties component, which will be used before any locations are resolved.
*
* @param key the property key
* @param value the property value
* @see #addInitialProperty(String, String)
* @see #addOverrideProperty(String, String)
*/
public void addProperty(String key, String value) {
addInitialProperty(key, value);
}
/**
* Adds a property (initial) for the properties component, which will be used before any locations are resolved.
*
* @param key the property key
* @param value the property value
*/
public void addInitialProperty(String key, String value) {
if (initialProperties == null) {
initialProperties = new OrderedProperties();
}
initialProperties.setProperty(key, value);
}
public Properties getOverrideProperties() {
return overrideProperties;
}
/**
* Sets a special list of override properties that take precedence and will use first, if a property exist.
*/
public void setOverrideProperties(Properties overrideProperties) {
this.overrideProperties = overrideProperties;
}
/**
* Sets a special list of override properties that take precedence and will use first, if a property exist.
*/
public void setOverrideProperties(Map<String, Object> initialProperties) {
this.overrideProperties = new OrderedProperties();
this.overrideProperties.putAll(initialProperties);
}
/**
* Adds an override property that take precedence and will use first, if a property exist.
*
* @param key the property key
* @param value the property value
*/
public void addOverrideProperty(String key, String value) {
if (overrideProperties == null) {
overrideProperties = new OrderedProperties();
}
overrideProperties.setProperty(key, value);
}
public CamelContext getCamelContext() {
return camelContext;
}
/**
* Adds a {@link MainListener} to receive callbacks when the main is started or stopping
*
* @param listener the listener
*/
public void addMainListener(MainListener listener) {
listeners.add(listener);
}
/**
* Removes the {@link MainListener}
*
* @param listener the listener
*/
public void removeMainListener(MainListener listener) {
listeners.remove(listener);
}
protected void loadConfigurations(CamelContext camelContext) throws Exception {
// auto-detect camel configurations via base package scanning
String basePackage = camelContext.adapt(ExtendedCamelContext.class).getBasePackageScan();
if (basePackage != null) {
PackageScanClassResolver pscr = camelContext.adapt(ExtendedCamelContext.class).getPackageScanClassResolver();
Set<Class<?>> found1 = pscr.findImplementations(CamelConfiguration.class, basePackage);
Set<Class<?>> found2 = pscr.findAnnotated(Configuration.class, basePackage);
Set<Class<?>> found = new LinkedHashSet<>();
found.addAll(found1);
found.addAll(found2);
for (Class<?> clazz : found) {
// lets use Camel's injector so the class has some support for dependency injection
Object config = camelContext.getInjector().newInstance(clazz);
if (config instanceof CamelConfiguration) {
LOG.debug("Discovered CamelConfiguration class: {}", clazz);
CamelConfiguration cc = (CamelConfiguration) config;
mainConfigurationProperties.addConfiguration(cc);
}
}
}
if (mainConfigurationProperties.getConfigurationClasses() != null) {
String[] configClasses = mainConfigurationProperties.getConfigurationClasses().split(",");
for (String configClass : configClasses) {
Class<CamelConfiguration> configClazz
= camelContext.getClassResolver().resolveClass(configClass, CamelConfiguration.class);
// skip main classes
boolean mainClass = false;
try {
configClazz.getDeclaredMethod("main", String[].class);
mainClass = true;
} catch (NoSuchMethodException e) {
// ignore
}
if (!mainClass) {
// lets use Camel's injector so the class has some support for dependency injection
CamelConfiguration config = camelContext.getInjector().newInstance(configClazz);
mainConfigurationProperties.addConfiguration(config);
}
}
}
// lets use Camel's bean post processor on any existing configuration classes
// so the instance has some support for dependency injection
CamelBeanPostProcessor postProcessor = camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor();
// discover configurations from the registry
Set<CamelConfiguration> registryConfigurations = camelContext.getRegistry().findByType(CamelConfiguration.class);
for (CamelConfiguration configuration : registryConfigurations) {
postProcessor.postProcessBeforeInitialization(configuration, configuration.getClass().getName());
postProcessor.postProcessAfterInitialization(configuration, configuration.getClass().getName());
}
// prepare the directly configured instances (from registry should have been post processed already)
for (Object configuration : mainConfigurationProperties.getConfigurations()) {
postProcessor.postProcessBeforeInitialization(configuration, configuration.getClass().getName());
postProcessor.postProcessAfterInitialization(configuration, configuration.getClass().getName());
}
// invoke configure on configurations
for (CamelConfiguration config : mainConfigurationProperties.getConfigurations()) {
config.configure(camelContext);
}
// invoke configure on configurations that are from registry
for (CamelConfiguration config : registryConfigurations) {
config.configure(camelContext);
}
}
protected void configurePropertiesService(CamelContext camelContext) throws Exception {
PropertiesComponent pc = camelContext.getPropertiesComponent();
if (pc.getLocations().isEmpty()) {
String locations = propertyPlaceholderLocations;
if (locations == null) {
locations
= MainHelper.lookupPropertyFromSysOrEnv(PROPERTY_PLACEHOLDER_LOCATION)
.orElse(defaultPropertyPlaceholderLocation);
}
if (locations != null) {
locations = locations.trim();
}
if (!Objects.equals(locations, "false")) {
pc.addLocation(locations);
if (DEFAULT_PROPERTY_PLACEHOLDER_LOCATION.equals(locations)) {
LOG.debug("Using properties from: {}", locations);
} else {
// if not default location then log at INFO
LOG.info("Using properties from: {}", locations);
}
}
}
Properties ip = initialProperties;
if (ip == null || ip.isEmpty()) {
Optional<String> location = MainHelper.lookupPropertyFromSysOrEnv(INITIAL_PROPERTIES_LOCATION);
if (location.isPresent()) {
try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
ip = new Properties();
ip.load(is);
}
}
}
if (ip != null) {
pc.setInitialProperties(ip);
}
Properties op = overrideProperties;
if (op == null || op.isEmpty()) {
Optional<String> location = MainHelper.lookupPropertyFromSysOrEnv(OVERRIDE_PROPERTIES_LOCATION);
if (location.isPresent()) {
try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
op = new Properties();
op.load(is);
}
}
}
if (op != null) {
pc.setOverrideProperties(op);
}
}
protected void configureLifecycle(CamelContext camelContext) throws Exception {
}
/**
* Configures security vaults such as AWS, Azure, Google and Hashicorp.
*/
protected void configureVault(CamelContext camelContext) throws Exception {
VaultConfiguration vc = camelContext.getVaultConfiguration();
if (vc == null) {
return;
}
if (vc.aws().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("aws-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.aws().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
if (vc.gcp().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("gcp-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.gcp().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
if (vc.azure().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("azure-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.azure().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
}
protected void autoconfigure(CamelContext camelContext) throws Exception {
// gathers the properties (key=value) that was auto-configured
final OrderedLocationProperties autoConfiguredProperties = new OrderedLocationProperties();
// need to eager allow to auto-configure properties component
if (mainConfigurationProperties.isAutoConfigurationEnabled()) {
autoConfigurationFailFast(camelContext, autoConfiguredProperties);
autoConfigurationPropertiesComponent(camelContext, autoConfiguredProperties);
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesIncludePattern",
value -> {
mainConfigurationProperties.setRoutesIncludePattern(value);
return null;
});
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesCompileDirectory",
value -> {
mainConfigurationProperties.setRoutesCompileDirectory(value);
return null;
});
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesCompileLoadFirst",
value -> {
boolean bool = CamelContextHelper.parseBoolean(camelContext, value);
mainConfigurationProperties.setRoutesCompileLoadFirst(bool);
return null;
});
// eager load properties from modeline by scanning DSL sources and gather properties for auto configuration
if (camelContext.isModeline() || mainConfigurationProperties.isModeline()) {
modelineRoutes(camelContext);
}
autoConfigurationMainConfiguration(camelContext, mainConfigurationProperties, autoConfiguredProperties);
}
// configure from main configuration properties
doConfigureCamelContextFromMainConfiguration(camelContext, mainConfigurationProperties, autoConfiguredProperties);
// try to load configuration classes
loadConfigurations(camelContext);
if (mainConfigurationProperties.isAutoConfigurationEnabled()) {
autoConfigurationFromProperties(camelContext, autoConfiguredProperties);
autowireWildcardProperties(camelContext);
}
// log summary of configurations
if (mainConfigurationProperties.isAutoConfigurationLogSummary() && !autoConfiguredProperties.isEmpty()) {
boolean header = false;
for (var entry : autoConfiguredProperties.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
String loc = locationSummary(autoConfiguredProperties, k);
// tone down logging noise for our own internal configurations
boolean debug = loc.contains("[camel-main]");
if (debug && !LOG.isDebugEnabled()) {
continue;
}
if (!header) {
LOG.info("Auto-configuration summary");
header = true;
}
if (SensitiveUtils.containsSensitive(k)) {
if (debug) {
LOG.debug(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}=xxxxxx", loc, k);
}
} else {
if (debug) {
LOG.debug(" {} {}={}", loc, k, v);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
// we are now done with the main helper during bootstrap
helper.bootstrapDone();
}
protected void configureStartupRecorder(CamelContext camelContext) {
// we need to load these configurations early as they control the startup recorder when using camel-jfr
// and we want to start jfr recording as early as possible to also capture details during bootstrapping Camel
// load properties
Properties prop = camelContext.getPropertiesComponent().loadProperties(name -> name.startsWith("camel."),
MainHelper::optionKey);
Object value = prop.remove("camel.main.startupRecorder");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorder(value.toString());
}
value = prop.remove("camel.main.startupRecorderRecording");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderRecording("true".equalsIgnoreCase(value.toString()));
}
value = prop.remove("camel.main.startupRecorderProfile");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderProfile(
CamelContextHelper.parseText(camelContext, value.toString()));
}
value = prop.remove("camel.main.startupRecorderDuration");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderDuration(Long.parseLong(value.toString()));
}
value = prop.remove("camel.main.startupRecorderMaxDepth");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderMaxDepth(Integer.parseInt(value.toString()));
}
if ("off".equals(mainConfigurationProperties.getStartupRecorder())
|| "false".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder().setEnabled(false);
} else if ("logging".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(new LoggingStartupStepRecorder());
} else if ("jfr".equals(mainConfigurationProperties.getStartupRecorder())
|| "java-flight-recorder".equals(mainConfigurationProperties.getStartupRecorder())
|| mainConfigurationProperties.getStartupRecorder() == null) {
// try to auto discover camel-jfr to use
StartupStepRecorder fr = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
.newInstance(StartupStepRecorder.FACTORY, StartupStepRecorder.class).orElse(null);
if (fr != null) {
LOG.debug("Discovered startup recorder: {} from classpath", fr);
fr.setRecording(mainConfigurationProperties.isStartupRecorderRecording());
fr.setStartupRecorderDuration(mainConfigurationProperties.getStartupRecorderDuration());
fr.setRecordingProfile(mainConfigurationProperties.getStartupRecorderProfile());
fr.setMaxDepth(mainConfigurationProperties.getStartupRecorderMaxDepth());
camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(fr);
}
}
}
protected void configurePackageScan(CamelContext camelContext) {
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
camelContext.adapt(ExtendedCamelContext.class).setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
if (mainConfigurationProperties.getBasePackageScan() != null) {
LOG.info("Classpath scanning enabled from base package: {}", mainConfigurationProperties.getBasePackageScan());
}
}
}
protected void configureRoutesLoader(CamelContext camelContext) {
// use main based routes loader
camelContext.adapt(ExtendedCamelContext.class).setRoutesLoader(new MainRoutesLoader(mainConfigurationProperties));
}
protected void modelineRoutes(CamelContext camelContext) throws Exception {
// then configure and add the routes
RoutesConfigurer configurer = new RoutesConfigurer();
if (mainConfigurationProperties.isRoutesCollectorEnabled()) {
configurer.setRoutesCollector(routesCollector);
}
configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor());
configurer.setRoutesBuilders(mainConfigurationProperties.getRoutesBuilders());
configurer.setRoutesBuilderClasses(mainConfigurationProperties.getRoutesBuilderClasses());
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
configurer.setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
}
configurer.setJavaRoutesExcludePattern(mainConfigurationProperties.getJavaRoutesExcludePattern());
configurer.setJavaRoutesIncludePattern(mainConfigurationProperties.getJavaRoutesIncludePattern());
configurer.setRoutesExcludePattern(mainConfigurationProperties.getRoutesExcludePattern());
configurer.setRoutesIncludePattern(mainConfigurationProperties.getRoutesIncludePattern());
configurer.configureModeline(camelContext);
}
protected void configureRoutes(CamelContext camelContext) throws Exception {
// then configure and add the routes
RoutesConfigurer configurer = new RoutesConfigurer();
if (mainConfigurationProperties.isRoutesCollectorEnabled()) {
configurer.setRoutesCollector(routesCollector);
}
configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor());
configurer.setRoutesBuilders(mainConfigurationProperties.getRoutesBuilders());
configurer.setRoutesBuilderClasses(mainConfigurationProperties.getRoutesBuilderClasses());
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
configurer.setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
}
configurer.setJavaRoutesExcludePattern(mainConfigurationProperties.getJavaRoutesExcludePattern());
configurer.setJavaRoutesIncludePattern(mainConfigurationProperties.getJavaRoutesIncludePattern());
configurer.setRoutesExcludePattern(mainConfigurationProperties.getRoutesExcludePattern());
configurer.setRoutesIncludePattern(mainConfigurationProperties.getRoutesIncludePattern());
configurer.configureRoutes(camelContext);
}
protected void postProcessCamelContext(CamelContext camelContext) throws Exception {
// gathers the properties (key=value) that was used as property placeholders during bootstrap
final OrderedLocationProperties propertyPlaceholders = new OrderedLocationProperties();
// use the main autowired lifecycle strategy instead of the default
camelContext.getLifecycleStrategies().removeIf(s -> s instanceof AutowiredLifecycleStrategy);
camelContext.addLifecycleStrategy(new MainAutowiredLifecycleStrategy(camelContext));
// setup properties
configurePropertiesService(camelContext);
// register listener on properties component so we can capture them
PropertiesComponent pc = camelContext.getPropertiesComponent();
pc.addPropertiesLookupListener(new PropertyPlaceholderListener(propertyPlaceholders));
// setup startup recorder before building context
configureStartupRecorder(camelContext);
// setup package scan
configurePackageScan(camelContext);
// configure to use our main routes loader
configureRoutesLoader(camelContext);
// ensure camel context is build
camelContext.build();
for (MainListener listener : listeners) {
listener.beforeInitialize(this);
}
// allow doing custom configuration before camel is started
for (MainListener listener : listeners) {
listener.beforeConfigure(this);
}
// we want to capture startup events for import tasks during main bootstrap
StartupStepRecorder recorder = camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder();
StartupStep step;
if (standalone) {
step = recorder.beginStep(BaseMainSupport.class, "autoconfigure", "Auto Configure");
autoconfigure(camelContext);
recorder.endStep(step);
}
configureLifecycle(camelContext);
configureVault(camelContext);
if (standalone) {
step = recorder.beginStep(BaseMainSupport.class, "configureRoutes", "Collect Routes");
configureRoutes(camelContext);
recorder.endStep(step);
}
// allow doing custom configuration before camel is started
for (MainListener listener : listeners) {
listener.afterConfigure(this);
listener.configure(camelContext);
}
// we want to log the property placeholder summary after routes has been started,
// but before camel context logs that it has been started, so we need to use an event listener
if (standalone && mainConfigurationProperties.isAutoConfigurationLogSummary()) {
camelContext.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {
@Override
public boolean isEnabled(CamelEvent event) {
return event instanceof CamelEvent.CamelContextRoutesStartedEvent;
}
@Override
public void notify(CamelEvent event) throws Exception {
// log summary of configurations
if (!propertyPlaceholders.isEmpty()) {
LOG.info("Property-placeholders summary");
for (var entry : propertyPlaceholders.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
Object dv = propertyPlaceholders.getDefaultValue(k);
// skip logging configurations that are using default-value
// or a kamelet that uses templateId as a parameter
boolean same = ObjectHelper.equal(v, dv);
boolean skip = "templateId".equals(k);
if (!same && !skip) {
String loc = locationSummary(propertyPlaceholders, k);
if (SensitiveUtils.containsSensitive(k)) {
LOG.info(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
}
});
}
}
protected void autoConfigurationFailFast(CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
LOG.debug("Properties from Camel properties component:");
for (String key : prop.stringPropertyNames()) {
LOG.debug(" {}={}", key, prop.getProperty(key));
}
// special for environment-variable-enabled as we need to know this early before we set all the other options
Object envEnabled = prop.remove("camel.main.autoConfigurationEnvironmentVariablesEnabled");
if (ObjectHelper.isNotEmpty(envEnabled)) {
mainConfigurationProperties.setAutoConfigurationEnvironmentVariablesEnabled(
CamelContextHelper.parseBoolean(camelContext, envEnabled.toString()));
String loc = prop.getLocation("camel.main.autoConfigurationEnvironmentVariablesEnabled");
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationEnvironmentVariablesEnabled",
envEnabled.toString());
}
// special for system-properties-enabled as we need to know this early before we set all the other options
Object jvmEnabled = prop.remove("camel.main.autoConfigurationSystemPropertiesEnabled");
if (ObjectHelper.isNotEmpty(jvmEnabled)) {
mainConfigurationProperties.setAutoConfigurationSystemPropertiesEnabled(
CamelContextHelper.parseBoolean(camelContext, jvmEnabled.toString()));
String loc = prop.getLocation("camel.main.autoConfigurationSystemPropertiesEnabled");
autoConfiguredProperties.put(loc, "camel.autoConfigurationSystemPropertiesEnabled",
jvmEnabled.toString());
}
// load properties from ENV (override existing)
Properties propENV = null;
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
if (!propENV.isEmpty()) {
prop.putAll(propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
Properties propJVM = null;
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
if (!propJVM.isEmpty()) {
prop.putAll(propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
// special for fail-fast as we need to know this early before we set all the other options
String loc = "ENV";
Object failFast = propENV != null ? propENV.remove("camel.main.autoconfigurationfailfast") : null;
if (ObjectHelper.isNotEmpty(propJVM)) {
Object val = propJVM.remove("camel.main.autoconfigurationfailfast");
if (ObjectHelper.isNotEmpty(val)) {
loc = "SYS";
failFast = val;
}
}
if (ObjectHelper.isNotEmpty(failFast)) {
mainConfigurationProperties
.setAutoConfigurationFailFast(CamelContextHelper.parseBoolean(camelContext, failFast.toString()));
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationFailFast", failFast.toString());
} else {
loc = prop.getLocation("camel.main.autoConfigurationFailFast");
failFast = prop.remove("camel.main.autoConfigurationFailFast");
if (ObjectHelper.isNotEmpty(failFast)) {
mainConfigurationProperties
.setAutoConfigurationFailFast(CamelContextHelper.parseBoolean(camelContext, failFast.toString()));
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationFailFast", failFast.toString());
}
}
}
protected void autoConfigurationSingleOption(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties,
String optionName, Function<String, Object> setter) {
String lowerOptionName = optionName.toLowerCase(Locale.US);
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
LOG.debug("Properties from Camel properties component:");
for (String key : prop.stringPropertyNames()) {
LOG.debug(" {}={}", key, prop.getProperty(key));
}
// load properties from ENV (override existing)
Properties propENV = null;
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
Properties propJVM = null;
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
// SYS and ENV take priority (ENV are in lower-case keys)
String loc = "ENV";
Object value = propENV != null ? propENV.remove(lowerOptionName) : null;
if (ObjectHelper.isNotEmpty(propJVM)) {
Object val = propJVM.remove(optionName);
if (ObjectHelper.isNotEmpty(val)) {
// SYS override ENV
loc = "SYS";
value = val;
}
}
if (ObjectHelper.isEmpty(value)) {
// then try properties
loc = prop.getLocation(optionName);
value = prop.remove(optionName);
}
if (ObjectHelper.isEmpty(value)) {
// fallback to initial properties
value = getInitialProperties().getProperty(optionName);
loc = "initial";
}
// set the option if we have a value
if (ObjectHelper.isNotEmpty(value)) {
String str = CamelContextHelper.parseText(camelContext, value.toString());
setter.apply(str);
autoConfiguredProperties.put(loc, optionName, value.toString());
}
}
/**
* Configures CamelContext from the {@link MainConfigurationProperties} properties.
*/
protected void doConfigureCamelContextFromMainConfiguration(
CamelContext camelContext, MainConfigurationProperties config,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
if (ObjectHelper.isNotEmpty(config.getFileConfigurations())) {
String[] locs = config.getFileConfigurations().split(",");
for (String loc : locs) {
String path = FileUtil.onlyPath(loc);
if (path != null) {
String pattern = loc.length() > path.length() ? loc.substring(path.length() + 1) : null;
File[] files = new File(path).listFiles(f -> matches(pattern, f.getName()));
if (files != null) {
for (File file : files) {
Properties props = new Properties();
try (FileInputStream is = new FileInputStream(file)) {
props.load(is);
}
if (!props.isEmpty()) {
if (overrideProperties == null) {
// setup override properties on properties component
overrideProperties = new Properties();
PropertiesComponent pc = camelContext.getPropertiesComponent();
pc.setOverrideProperties(overrideProperties);
}
LOG.info("Loaded additional {} properties from file: {}", props.size(), file);
overrideProperties.putAll(props);
}
}
}
}
}
}
// configure the common/default options
DefaultConfigurationConfigurer.configure(camelContext, config);
// lookup and configure SPI beans
DefaultConfigurationConfigurer.afterConfigure(camelContext);
// now configure context/resilience4j/rest with additional properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
OrderedLocationProperties contextProperties = new OrderedLocationProperties();
OrderedLocationProperties resilience4jProperties = new OrderedLocationProperties();
OrderedLocationProperties faultToleranceProperties = new OrderedLocationProperties();
OrderedLocationProperties restProperties = new OrderedLocationProperties();
OrderedLocationProperties vaultProperties = new OrderedLocationProperties();
OrderedLocationProperties threadPoolProperties = new OrderedLocationProperties();
OrderedLocationProperties healthProperties = new OrderedLocationProperties();
OrderedLocationProperties lraProperties = new OrderedLocationProperties();
OrderedLocationProperties routeTemplateProperties = new OrderedLocationProperties();
OrderedLocationProperties beansProperties = new OrderedLocationProperties();
OrderedLocationProperties devConsoleProperties = new OrderedLocationProperties();
OrderedLocationProperties globalOptions = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
String loc = prop.getLocation(key);
if (key.startsWith("camel.context.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(14);
validateOptionAndValue(key, option, value);
contextProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.resilience4j.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(19);
validateOptionAndValue(key, option, value);
resilience4jProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.faulttolerance.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(21);
validateOptionAndValue(key, option, value);
faultToleranceProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.rest.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(11);
validateOptionAndValue(key, option, value);
restProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.vault.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(12);
validateOptionAndValue(key, option, value);
vaultProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.threadpool.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(17);
validateOptionAndValue(key, option, value);
threadPoolProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.health.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(13);
validateOptionAndValue(key, option, value);
healthProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.lra.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(10);
validateOptionAndValue(key, option, value);
lraProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.routeTemplate")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(19);
validateOptionAndValue(key, option, value);
routeTemplateProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.devConsole.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(17);
validateOptionAndValue(key, option, value);
devConsoleProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.beans.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(12);
validateOptionAndValue(key, option, value);
beansProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.globalOptions.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(20);
validateOptionAndValue(key, option, value);
globalOptions.put(loc, optionKey(option), value);
}
}
// global options first
if (!globalOptions.isEmpty()) {
for (var name : globalOptions.stringPropertyNames()) {
Object value = globalOptions.getProperty(name);
mainConfigurationProperties.addGlobalOption(name, value);
}
}
// create beans first as they may be used later
if (!beansProperties.isEmpty()) {
LOG.debug("Creating and binding beans to registry from loaded properties: {}", beansProperties.size());
bindBeansToRegistry(camelContext, beansProperties, "camel.beans.",
mainConfigurationProperties.isAutoConfigurationFailFast(),
mainConfigurationProperties.isAutoConfigurationLogSummary(), true, autoConfiguredProperties);
}
if (!contextProperties.isEmpty()) {
LOG.debug("Auto-configuring CamelContext from loaded properties: {}", contextProperties.size());
setPropertiesOnTarget(camelContext, camelContext, contextProperties, "camel.context.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
if (!restProperties.isEmpty() || mainConfigurationProperties.hasRestConfiguration()) {
RestConfigurationProperties rest = mainConfigurationProperties.rest();
LOG.debug("Auto-configuring Rest DSL from loaded properties: {}", restProperties.size());
setPropertiesOnTarget(camelContext, rest, restProperties, "camel.rest.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
camelContext.setRestConfiguration(rest);
}
if (!vaultProperties.isEmpty() || mainConfigurationProperties.hasVaultConfiguration()) {
LOG.debug("Auto-configuring Vault from loaded properties: {}", vaultProperties.size());
setVaultProperties(camelContext, vaultProperties, mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
if (!threadPoolProperties.isEmpty() || mainConfigurationProperties.hasThreadPoolConfiguration()) {
LOG.debug("Auto-configuring Thread Pool from loaded properties: {}", threadPoolProperties.size());
MainSupportModelConfigurer.setThreadPoolProperties(camelContext, mainConfigurationProperties, threadPoolProperties,
autoConfiguredProperties);
}
// need to let camel-main setup health-check using its convention over configuration
boolean hc = mainConfigurationProperties.health().getEnabled() != null; // health-check is enabled by default
if (hc || !healthProperties.isEmpty() || mainConfigurationProperties.hasHealthCheckConfiguration()) {
LOG.debug("Auto-configuring HealthCheck from loaded properties: {}", healthProperties.size());
setHealthCheckProperties(camelContext, healthProperties,
autoConfiguredProperties);
}
if (!routeTemplateProperties.isEmpty()) {
LOG.debug("Auto-configuring Route templates from loaded properties: {}", routeTemplateProperties.size());
setRouteTemplateProperties(camelContext, routeTemplateProperties,
autoConfiguredProperties);
}
if (!lraProperties.isEmpty() || mainConfigurationProperties.hasLraConfiguration()) {
LOG.debug("Auto-configuring Saga LRA from loaded properties: {}", lraProperties.size());
setLraCheckProperties(camelContext, lraProperties, mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
if (!devConsoleProperties.isEmpty()) {
LOG.debug("Auto-configuring Dev Console from loaded properties: {}", devConsoleProperties.size());
setDevConsoleProperties(camelContext, devConsoleProperties,
mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
// configure which requires access to the model
MainSupportModelConfigurer.configureModelCamelContext(camelContext, mainConfigurationProperties,
autoConfiguredProperties, resilience4jProperties, faultToleranceProperties);
// log which options was not set
if (!beansProperties.isEmpty()) {
beansProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.beans.{}={}", k, v);
});
}
if (!contextProperties.isEmpty()) {
contextProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.context.{}={}", k, v);
});
}
if (!resilience4jProperties.isEmpty()) {
resilience4jProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.resilience4j.{}={}", k, v);
});
}
if (!faultToleranceProperties.isEmpty()) {
faultToleranceProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.faulttolerance.{}={}", k, v);
});
}
if (!restProperties.isEmpty()) {
restProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.rest.{}={}", k, v);
});
}
if (!vaultProperties.isEmpty()) {
vaultProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.vault.{}={}", k, v);
});
}
if (!threadPoolProperties.isEmpty()) {
threadPoolProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.threadpool.{}={}", k, v);
});
}
if (!healthProperties.isEmpty()) {
healthProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.health.{}={}", k, v);
});
}
if (!routeTemplateProperties.isEmpty()) {
routeTemplateProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.routetemplate.{}={}", k, v);
});
}
if (!lraProperties.isEmpty()) {
lraProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.lra.{}={}", k, v);
});
}
// and call after all properties are set
DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
}
private void setRouteTemplateProperties(
CamelContext camelContext, OrderedLocationProperties routeTemplateProperties,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// store the route template parameters as a source and register it on the camel context
PropertiesRouteTemplateParametersSource source = new PropertiesRouteTemplateParametersSource();
for (Map.Entry<Object, Object> entry : routeTemplateProperties.entrySet()) {
String key = entry.getKey().toString();
String id = StringHelper.between(key, "[", "]");
key = StringHelper.after(key, "].");
source.addParameter(id, key, entry.getValue());
}
camelContext.getRegistry().bind("CamelMainRouteTemplateParametersSource", RouteTemplateParameterSource.class, source);
// lets sort by keys
Map<String, Object> sorted = new TreeMap<>(routeTemplateProperties.asMap());
sorted.forEach((k, v) -> {
String loc = routeTemplateProperties.getLocation(k);
autoConfiguredProperties.put(loc, "camel.routeTemplate" + k, v.toString());
});
routeTemplateProperties.clear();
}
private void setHealthCheckProperties(
CamelContext camelContext, OrderedLocationProperties healthCheckProperties,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
HealthConfigurationProperties health = mainConfigurationProperties.health();
setPropertiesOnTarget(camelContext, health, healthCheckProperties, "camel.health.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
if (health.getEnabled() != null && !health.getEnabled()) {
// health-check is disabled
return;
}
// auto-detect camel-health on classpath
HealthCheckRegistry hcr = camelContext.getExtension(HealthCheckRegistry.class);
if (hcr == null) {
if (health.getEnabled() != null && health.getEnabled()) {
LOG.warn("Cannot find HealthCheckRegistry from classpath. Add camel-health to classpath.");
}
return;
}
if (health.getEnabled() != null) {
hcr.setEnabled(health.getEnabled());
}
if (health.getExcludePattern() != null) {
hcr.setExcludePattern(health.getExcludePattern());
}
if (health.getExposureLevel() != null) {
hcr.setExposureLevel(health.getExposureLevel());
}
if (health.getInitialState() != null) {
hcr.setInitialState(camelContext.getTypeConverter().convertTo(HealthCheck.State.class, health.getInitialState()));
}
// context is enabled by default
if (hcr.isEnabled()) {
HealthCheck hc = (HealthCheck) hcr.resolveById("context");
if (hc != null) {
hcr.register(hc);
}
}
// routes are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc = hcr.getRepository("routes").orElse((HealthCheckRepository) hcr.resolveById("routes"));
if (hc != null) {
if (health.getRoutesEnabled() != null) {
hc.setEnabled(health.getRoutesEnabled());
}
hcr.register(hc);
}
}
// consumers are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc
= hcr.getRepository("consumers").orElse((HealthCheckRepository) hcr.resolveById("consumers"));
if (hc != null) {
if (health.getConsumersEnabled() != null) {
hc.setEnabled(health.getConsumersEnabled());
}
hcr.register(hc);
}
}
// registry are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc
= hcr.getRepository("registry").orElse((HealthCheckRepository) hcr.resolveById("registry"));
if (hc != null) {
if (health.getRegistryEnabled() != null) {
hc.setEnabled(health.getRegistryEnabled());
}
hcr.register(hc);
}
}
}
private void setLraCheckProperties(
CamelContext camelContext, OrderedLocationProperties lraProperties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
Object obj = lraProperties.remove("enabled");
if (ObjectHelper.isNotEmpty(obj)) {
String loc = lraProperties.getLocation("enabled");
autoConfiguredProperties.put(loc, "camel.lra.enabled", obj.toString());
}
boolean enabled = obj != null ? CamelContextHelper.parseBoolean(camelContext, obj.toString()) : true;
if (enabled) {
CamelSagaService css = resolveLraSagaService(camelContext);
setPropertiesOnTarget(camelContext, css, lraProperties, "camel.lra.", failIfNotSet, true, autoConfiguredProperties);
}
}
private void setDevConsoleProperties(
CamelContext camelContext, OrderedLocationProperties properties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// set properties per console
for (String key : keys) {
String name = StringHelper.before(key, ".");
DevConsole console = camelContext.getExtension(DevConsoleRegistry.class).resolveById(name);
if (console == null) {
throw new IllegalArgumentException(
"Cannot resolve DevConsole with id: " + name);
}
// configure all the properties on the console at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, console, config, "camel.devConsole." + name + ".", failIfNotSet, true,
autoConfiguredProperties);
}
}
private void setVaultProperties(
CamelContext camelContext, OrderedLocationProperties properties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
if (mainConfigurationProperties.hasVaultConfiguration()) {
camelContext.setVaultConfiguration(mainConfigurationProperties.vault());
}
VaultConfiguration target = camelContext.getVaultConfiguration();
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// set properties per different vault component
for (String key : keys) {
String name = StringHelper.before(key, ".");
if ("aws".equalsIgnoreCase(name)) {
target = target.aws();
}
if ("gcp".equalsIgnoreCase(name)) {
target = target.gcp();
}
if ("azure".equalsIgnoreCase(name)) {
target = target.azure();
}
if ("hashicorp".equalsIgnoreCase(name)) {
target = target.hashicorp();
}
// configure all the properties on the vault at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, target, config, "camel.vault." + name + ".", failIfNotSet, true,
autoConfiguredProperties);
}
}
private void bindBeansToRegistry(
CamelContext camelContext, OrderedLocationProperties properties,
String optionPrefix, boolean failIfNotSet, boolean logSummary, boolean ignoreCase,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// find names of beans (dot style)
final Set<String> beansDot
= properties.keySet().stream()
.map(k -> StringHelper.before(k.toString(), ".", k.toString()))
.filter(k -> k.indexOf('[') == -1)
.collect(Collectors.toSet());
// find names of beans (map style)
final Set<String> beansMap
= properties.keySet().stream()
.map(k -> StringHelper.before(k.toString(), "[", k.toString()))
.filter(k -> k.indexOf('.') == -1)
.collect(Collectors.toSet());
// then create beans first (beans with #class values etc)
for (String key : keys) {
if (key.indexOf('.') == -1 && key.indexOf('[') == -1) {
String name = key;
Object value = properties.remove(key);
Object bean = PropertyBindingSupport.resolveBean(camelContext, value);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot create/resolve bean with name " + name + " from value: " + value);
}
// register bean
if (logSummary) {
LOG.info("Binding bean: {} (type: {}) to the registry", key, ObjectHelper.classCanonicalName(bean));
} else {
LOG.debug("Binding bean: {} (type: {}) to the registry", key, ObjectHelper.classCanonicalName(bean));
}
camelContext.getRegistry().bind(name, bean);
}
}
// create map beans if none already exists
for (String name : beansMap) {
if (camelContext.getRegistry().lookupByName(name) == null) {
// register bean as a map
Map<String, Object> bean = new LinkedHashMap<>();
if (logSummary) {
LOG.info("Binding bean: {} (type: {}) to the registry", name, ObjectHelper.classCanonicalName(bean));
} else {
LOG.debug("Binding bean: {} (type: {}) to the registry", name, ObjectHelper.classCanonicalName(bean));
}
camelContext.getRegistry().bind(name, bean);
}
}
// then set properties per bean (dot style)
for (String name : beansDot) {
Object bean = camelContext.getRegistry().lookupByName(name);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot resolve bean with name " + name);
}
// configure all the properties on the bean at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, bean, config, optionPrefix + name + ".", failIfNotSet, ignoreCase,
autoConfiguredProperties);
}
// then set properties per bean (map style)
for (String name : beansMap) {
Object bean = camelContext.getRegistry().lookupByName(name);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot resolve bean with name " + name);
}
// configure all the properties on the bean at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + "[", "]");
setPropertiesOnTarget(camelContext, bean, config, optionPrefix + name + ".", failIfNotSet, ignoreCase,
autoConfiguredProperties);
}
}
protected void autoConfigurationPropertiesComponent(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
OrderedLocationProperties properties = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
if (key.startsWith("camel.component.properties.")) {
int dot = key.indexOf('.', 26);
String option = dot == -1 ? "" : key.substring(dot + 1);
String value = prop.getProperty(key, "");
validateOptionAndValue(key, option, value);
String loc = prop.getLocation(key);
properties.put(loc, optionKey(option), value);
}
}
if (!properties.isEmpty()) {
LOG.debug("Auto-configuring properties component from loaded properties: {}", properties.size());
setPropertiesOnTarget(camelContext, camelContext.getPropertiesComponent(), properties,
"camel.component.properties.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
properties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.component.properties.{}={} on object: {}", k, v,
camelContext.getPropertiesComponent());
});
}
}
protected void autoConfigurationMainConfiguration(
CamelContext camelContext, MainConfigurationProperties config, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
// special handling of these so remove them
// ENV variables cannot use dash so replace with dot
propENV.remove(INITIAL_PROPERTIES_LOCATION.replace('-', '.'));
propENV.remove(OVERRIDE_PROPERTIES_LOCATION.replace('-', '.'));
propENV.remove(PROPERTY_PLACEHOLDER_LOCATION.replace('-', '.'));
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
// special handling of these so remove them
propJVM.remove(INITIAL_PROPERTIES_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(INITIAL_PROPERTIES_LOCATION));
propJVM.remove(OVERRIDE_PROPERTIES_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(OVERRIDE_PROPERTIES_LOCATION));
propJVM.remove(PROPERTY_PLACEHOLDER_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(PROPERTY_PLACEHOLDER_LOCATION));
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
OrderedLocationProperties properties = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
if (key.startsWith("camel.main.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(11);
validateOptionAndValue(key, option, value);
String loc = prop.getLocation(key);
properties.put(loc, optionKey(option), value);
}
}
if (!properties.isEmpty()) {
LOG.debug("Auto-configuring main from loaded properties: {}", properties.size());
setPropertiesOnTarget(camelContext, config, properties, "camel.main.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
properties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.main.{}={} on bean: {}", k, v, config);
});
}
}
protected void autoConfigurationFromProperties(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
OrderedLocationProperties prop = new OrderedLocationProperties();
// load properties from properties component (override existing)
OrderedLocationProperties propPC = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."));
prop.putAll(propPC);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Map<String, String> env = MainHelper
.filterEnvVariables(new String[] { "camel.component.", "camel.dataformat.", "camel.language." });
LOG.debug("Gathered {} ENV variables to configure components, dataformats, languages", env.size());
// special configuration when using ENV variables as we need to extract the ENV variables
// that are for the out of the box components first, and then afterwards for any 3rd party custom components
Properties propENV = new OrderedProperties();
helper.addComponentEnvVariables(env, propENV, false);
helper.addDataFormatEnvVariables(env, propENV, false);
helper.addLanguageEnvVariables(env, propENV, false);
if (!env.isEmpty()) {
LOG.debug("Remaining {} ENV variables to configure custom components, dataformats, languages", env.size());
helper.addComponentEnvVariables(env, propENV, true);
helper.addDataFormatEnvVariables(env, propENV, true);
helper.addLanguageEnvVariables(env, propENV, true);
}
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(
new String[] { "camel.component.", "camel.dataformat.", "camel.language." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
Map<PropertyOptionKey, OrderedLocationProperties> properties = new LinkedHashMap<>();
// filter out wildcard properties
for (String key : prop.stringPropertyNames()) {
if (key.contains("*")) {
String loc = prop.getLocation(key);
wildcardProperties.put(loc, key, prop.getProperty(key));
}
}
// and remove wildcards
for (String key : wildcardProperties.stringPropertyNames()) {
prop.remove(key);
}
for (String key : prop.stringPropertyNames()) {
computeProperties("camel.component.", key, prop, properties, name -> {
// its an existing component name
Component target = camelContext.getComponent(name);
if (target == null) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find component with name " + name
+ ". Make sure you have the component on the classpath");
}
return Collections.singleton(target);
});
computeProperties("camel.dataformat.", key, prop, properties, name -> {
DataFormat target = camelContext.resolveDataFormat(name);
if (target == null) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find dataformat with name " + name
+ ". Make sure you have the dataformat on the classpath");
}
return Collections.singleton(target);
});
computeProperties("camel.language.", key, prop, properties, name -> {
Language target;
try {
target = camelContext.resolveLanguage(name);
} catch (NoSuchLanguageException e) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find language with name " + name
+ ". Make sure you have the language on the classpath");
}
return Collections.singleton(target);
});
}
if (!properties.isEmpty()) {
long total = properties.values().stream().mapToLong(Map::size).sum();
LOG.debug("Auto-configuring {} components/dataformat/languages from loaded properties: {}", properties.size(),
total);
}
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
setPropertiesOnTarget(
camelContext,
entry.getKey().getInstance(),
entry.getValue(),
entry.getKey().getOptionPrefix(),
mainConfigurationProperties.isAutoConfigurationFailFast(),
true,
autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
PropertyOptionKey pok = entry.getKey();
OrderedLocationProperties values = entry.getValue();
values.forEach((k, v) -> {
String stringValue = v != null ? v.toString() : null;
LOG.warn("Property ({}={}) not auto-configured with name: {} on bean: {} with value: {}",
pok.getOptionPrefix() + "." + k, stringValue, k, pok.getInstance(), stringValue);
});
}
}
}
protected void autowireWildcardProperties(CamelContext camelContext) {
if (wildcardProperties.isEmpty()) {
return;
}
// autowire any pre-existing components as they have been added before we are invoked
for (String name : camelContext.getComponentNames()) {
Component comp = camelContext.getComponent(name);
doAutowireWildcardProperties(name, comp);
}
// and autowire any new components that may be added in the future
camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
@Override
public void onComponentAdd(String name, Component component) {
doAutowireWildcardProperties(name, component);
}
});
}
protected void doAutowireWildcardProperties(String name, Component component) {
Map<PropertyOptionKey, OrderedLocationProperties> properties = new LinkedHashMap<>();
OrderedLocationProperties autoConfiguredProperties = new OrderedLocationProperties();
String match = ("camel.component." + name).toLowerCase(Locale.ENGLISH);
for (String key : wildcardProperties.stringPropertyNames()) {
String mKey = key.substring(0, key.indexOf('*')).toLowerCase(Locale.ENGLISH);
if (match.startsWith(mKey)) {
computeProperties("camel.component.", key, wildcardProperties, properties,
s -> Collections.singleton(component));
}
}
try {
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
setPropertiesOnTarget(
camelContext,
entry.getKey().getInstance(),
entry.getValue(),
entry.getKey().getOptionPrefix(),
mainConfigurationProperties.isAutoConfigurationFailFast(),
true,
autoConfiguredProperties);
}
// log summary of configurations
if (mainConfigurationProperties.isAutoConfigurationLogSummary() && !autoConfiguredProperties.isEmpty()) {
boolean header = false;
for (var entry : autoConfiguredProperties.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
String loc = locationSummary(autoConfiguredProperties, k);
// tone down logging noise for our own internal configurations
boolean debug = loc.contains("[camel-main]");
if (debug && !LOG.isDebugEnabled()) {
continue;
}
if (!header) {
LOG.info("Auto-configuration component {} summary", name);
header = true;
}
if (SensitiveUtils.containsSensitive(k)) {
if (debug) {
LOG.debug(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}=xxxxxx", loc, k);
}
} else {
if (debug) {
LOG.debug(" {} {}={}", loc, k, v);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
} catch (Exception e) {
throw RuntimeCamelException.wrapRuntimeException(e);
}
}
private static CamelSagaService resolveLraSagaService(CamelContext camelContext) throws Exception {
// lookup in service registry first
CamelSagaService answer = camelContext.getRegistry().findSingleByType(CamelSagaService.class);
if (answer == null) {
answer = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
.newInstance("lra-saga-service", CamelSagaService.class)
.orElseThrow(() -> new IllegalArgumentException(
"Cannot find LRASagaService on classpath. Add camel-lra to classpath."));
// add as service so its discover by saga eip
camelContext.addService(answer, true, false);
}
return answer;
}
private static final class PropertyPlaceholderListener implements PropertiesLookupListener {
private final OrderedLocationProperties olp;
public PropertyPlaceholderListener(OrderedLocationProperties olp) {
this.olp = olp;
}
@Override
public void onLookup(String name, String value, String defaultValue, String source) {
if (source == null) {
source = "unknown";
}
olp.put(source, name, value, defaultValue);
}
}
}
| core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.camel.main;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.camel.CamelConfiguration;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.Configuration;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.NoSuchLanguageException;
import org.apache.camel.PropertiesLookupListener;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.StartupStep;
import org.apache.camel.console.DevConsole;
import org.apache.camel.console.DevConsoleRegistry;
import org.apache.camel.health.HealthCheck;
import org.apache.camel.health.HealthCheckRegistry;
import org.apache.camel.health.HealthCheckRepository;
import org.apache.camel.saga.CamelSagaService;
import org.apache.camel.spi.AutowiredLifecycleStrategy;
import org.apache.camel.spi.CamelBeanPostProcessor;
import org.apache.camel.spi.CamelEvent;
import org.apache.camel.spi.ContextReloadStrategy;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.Language;
import org.apache.camel.spi.PackageScanClassResolver;
import org.apache.camel.spi.PeriodTaskScheduler;
import org.apache.camel.spi.PropertiesComponent;
import org.apache.camel.spi.RouteTemplateParameterSource;
import org.apache.camel.spi.StartupStepRecorder;
import org.apache.camel.support.CamelContextHelper;
import org.apache.camel.support.DefaultContextReloadStrategy;
import org.apache.camel.support.EventNotifierSupport;
import org.apache.camel.support.LifecycleStrategySupport;
import org.apache.camel.support.PropertyBindingSupport;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.support.service.BaseService;
import org.apache.camel.support.startup.LoggingStartupStepRecorder;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.OrderedLocationProperties;
import org.apache.camel.util.OrderedProperties;
import org.apache.camel.util.SensitiveUtils;
import org.apache.camel.util.StringHelper;
import org.apache.camel.util.TimeUtils;
import org.apache.camel.vault.VaultConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.camel.main.MainHelper.computeProperties;
import static org.apache.camel.main.MainHelper.optionKey;
import static org.apache.camel.main.MainHelper.setPropertiesOnTarget;
import static org.apache.camel.main.MainHelper.validateOptionAndValue;
import static org.apache.camel.util.LocationHelper.locationSummary;
import static org.apache.camel.util.StringHelper.matches;
/**
* Base class for main implementations to allow bootstrapping Camel in standalone mode.
*/
public abstract class BaseMainSupport extends BaseService {
public static final String DEFAULT_PROPERTY_PLACEHOLDER_LOCATION = "classpath:application.properties;optional=true";
public static final String INITIAL_PROPERTIES_LOCATION = "camel.main.initial-properties-location";
public static final String OVERRIDE_PROPERTIES_LOCATION = "camel.main.override-properties-location";
public static final String PROPERTY_PLACEHOLDER_LOCATION = "camel.main.property-placeholder-location";
private static final Logger LOG = LoggerFactory.getLogger(BaseMainSupport.class);
protected final List<MainListener> listeners = new ArrayList<>();
protected volatile CamelContext camelContext;
protected MainConfigurationProperties mainConfigurationProperties = new MainConfigurationProperties();
protected OrderedLocationProperties wildcardProperties = new OrderedLocationProperties();
protected RoutesCollector routesCollector = new DefaultRoutesCollector();
protected String propertyPlaceholderLocations;
protected String defaultPropertyPlaceholderLocation = DEFAULT_PROPERTY_PLACEHOLDER_LOCATION;
protected Properties initialProperties;
protected Properties overrideProperties;
protected boolean standalone = true;
protected final MainHelper helper;
protected BaseMainSupport() {
this.helper = new MainHelper();
}
protected BaseMainSupport(CamelContext camelContext) {
this.camelContext = camelContext;
this.helper = new MainHelper();
}
/**
* To configure options on Camel Main.
*/
public MainConfigurationProperties configure() {
return mainConfigurationProperties;
}
public RoutesCollector getRoutesCollector() {
return routesCollector;
}
/**
* To use a custom {@link RoutesCollector}.
*/
public void setRoutesCollector(RoutesCollector routesCollector) {
this.routesCollector = routesCollector;
}
public String getPropertyPlaceholderLocations() {
return propertyPlaceholderLocations;
}
/**
* A list of locations to add for loading properties. You can use comma to separate multiple locations.
*/
public void setPropertyPlaceholderLocations(String location) {
this.propertyPlaceholderLocations = location;
}
public String getDefaultPropertyPlaceholderLocation() {
return defaultPropertyPlaceholderLocation;
}
/**
* Set the default location for application properties if no locations have been set. If the value is set to "false"
* or empty, the default location is not taken into account.
* <p/>
* Default value is "classpath:application.properties;optional=true".
*/
public void setDefaultPropertyPlaceholderLocation(String defaultPropertyPlaceholderLocation) {
this.defaultPropertyPlaceholderLocation = defaultPropertyPlaceholderLocation;
}
public Properties getInitialProperties() {
if (initialProperties == null) {
initialProperties = new OrderedProperties();
}
return initialProperties;
}
/**
* Sets initial properties for the properties component, which will be used before any locations are resolved.
*/
public void setInitialProperties(Properties initialProperties) {
this.initialProperties = initialProperties;
}
/**
* Sets initial properties for the properties component, which will be used before any locations are resolved.
*/
public void setInitialProperties(Map<String, Object> initialProperties) {
this.initialProperties = new OrderedProperties();
this.initialProperties.putAll(initialProperties);
}
/**
* Adds a property (initial) for the properties component, which will be used before any locations are resolved.
*
* @param key the property key
* @param value the property value
* @see #addInitialProperty(String, String)
* @see #addOverrideProperty(String, String)
*/
public void addProperty(String key, String value) {
addInitialProperty(key, value);
}
/**
* Adds a property (initial) for the properties component, which will be used before any locations are resolved.
*
* @param key the property key
* @param value the property value
*/
public void addInitialProperty(String key, String value) {
if (initialProperties == null) {
initialProperties = new OrderedProperties();
}
initialProperties.setProperty(key, value);
}
public Properties getOverrideProperties() {
return overrideProperties;
}
/**
* Sets a special list of override properties that take precedence and will use first, if a property exist.
*/
public void setOverrideProperties(Properties overrideProperties) {
this.overrideProperties = overrideProperties;
}
/**
* Sets a special list of override properties that take precedence and will use first, if a property exist.
*/
public void setOverrideProperties(Map<String, Object> initialProperties) {
this.overrideProperties = new OrderedProperties();
this.overrideProperties.putAll(initialProperties);
}
/**
* Adds an override property that take precedence and will use first, if a property exist.
*
* @param key the property key
* @param value the property value
*/
public void addOverrideProperty(String key, String value) {
if (overrideProperties == null) {
overrideProperties = new OrderedProperties();
}
overrideProperties.setProperty(key, value);
}
public CamelContext getCamelContext() {
return camelContext;
}
/**
* Adds a {@link MainListener} to receive callbacks when the main is started or stopping
*
* @param listener the listener
*/
public void addMainListener(MainListener listener) {
listeners.add(listener);
}
/**
* Removes the {@link MainListener}
*
* @param listener the listener
*/
public void removeMainListener(MainListener listener) {
listeners.remove(listener);
}
protected void loadConfigurations(CamelContext camelContext) throws Exception {
// auto-detect camel configurations via base package scanning
String basePackage = camelContext.adapt(ExtendedCamelContext.class).getBasePackageScan();
if (basePackage != null) {
PackageScanClassResolver pscr = camelContext.adapt(ExtendedCamelContext.class).getPackageScanClassResolver();
Set<Class<?>> found1 = pscr.findImplementations(CamelConfiguration.class, basePackage);
Set<Class<?>> found2 = pscr.findAnnotated(Configuration.class, basePackage);
Set<Class<?>> found = new LinkedHashSet<>();
found.addAll(found1);
found.addAll(found2);
for (Class<?> clazz : found) {
// lets use Camel's injector so the class has some support for dependency injection
Object config = camelContext.getInjector().newInstance(clazz);
if (config instanceof CamelConfiguration) {
LOG.debug("Discovered CamelConfiguration class: {}", clazz);
CamelConfiguration cc = (CamelConfiguration) config;
mainConfigurationProperties.addConfiguration(cc);
}
}
}
if (mainConfigurationProperties.getConfigurationClasses() != null) {
String[] configClasses = mainConfigurationProperties.getConfigurationClasses().split(",");
for (String configClass : configClasses) {
Class<CamelConfiguration> configClazz
= camelContext.getClassResolver().resolveClass(configClass, CamelConfiguration.class);
// skip main classes
boolean mainClass = false;
try {
configClazz.getDeclaredMethod("main", String[].class);
mainClass = true;
} catch (NoSuchMethodException e) {
// ignore
}
if (!mainClass) {
// lets use Camel's injector so the class has some support for dependency injection
CamelConfiguration config = camelContext.getInjector().newInstance(configClazz);
mainConfigurationProperties.addConfiguration(config);
}
}
}
// lets use Camel's bean post processor on any existing configuration classes
// so the instance has some support for dependency injection
CamelBeanPostProcessor postProcessor = camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor();
// discover configurations from the registry
Set<CamelConfiguration> registryConfigurations = camelContext.getRegistry().findByType(CamelConfiguration.class);
for (CamelConfiguration configuration : registryConfigurations) {
postProcessor.postProcessBeforeInitialization(configuration, configuration.getClass().getName());
postProcessor.postProcessAfterInitialization(configuration, configuration.getClass().getName());
}
// prepare the directly configured instances (from registry should have been post processed already)
for (Object configuration : mainConfigurationProperties.getConfigurations()) {
postProcessor.postProcessBeforeInitialization(configuration, configuration.getClass().getName());
postProcessor.postProcessAfterInitialization(configuration, configuration.getClass().getName());
}
// invoke configure on configurations
for (CamelConfiguration config : mainConfigurationProperties.getConfigurations()) {
config.configure(camelContext);
}
// invoke configure on configurations that are from registry
for (CamelConfiguration config : registryConfigurations) {
config.configure(camelContext);
}
}
protected void configurePropertiesService(CamelContext camelContext) throws Exception {
PropertiesComponent pc = camelContext.getPropertiesComponent();
if (pc.getLocations().isEmpty()) {
String locations = propertyPlaceholderLocations;
if (locations == null) {
locations
= helper.lookupPropertyFromSysOrEnv(PROPERTY_PLACEHOLDER_LOCATION)
.orElse(defaultPropertyPlaceholderLocation);
}
if (locations != null) {
locations = locations.trim();
}
if (!Objects.equals(locations, "false")) {
pc.addLocation(locations);
if (DEFAULT_PROPERTY_PLACEHOLDER_LOCATION.equals(locations)) {
LOG.debug("Using properties from: {}", locations);
} else {
// if not default location then log at INFO
LOG.info("Using properties from: {}", locations);
}
}
}
Properties ip = initialProperties;
if (ip == null || ip.isEmpty()) {
Optional<String> location = helper.lookupPropertyFromSysOrEnv(INITIAL_PROPERTIES_LOCATION);
if (location.isPresent()) {
try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
ip = new Properties();
ip.load(is);
}
}
}
if (ip != null) {
pc.setInitialProperties(ip);
}
Properties op = overrideProperties;
if (op == null || op.isEmpty()) {
Optional<String> location = helper.lookupPropertyFromSysOrEnv(OVERRIDE_PROPERTIES_LOCATION);
if (location.isPresent()) {
try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
op = new Properties();
op.load(is);
}
}
}
if (op != null) {
pc.setOverrideProperties(op);
}
}
protected void configureLifecycle(CamelContext camelContext) throws Exception {
}
/**
* Configures security vaults such as AWS, Azure, Google and Hashicorp.
*/
protected void configureVault(CamelContext camelContext) throws Exception {
VaultConfiguration vc = camelContext.getVaultConfiguration();
if (vc == null) {
return;
}
if (vc.aws().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("aws-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.aws().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
if (vc.gcp().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("gcp-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.gcp().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
if (vc.azure().isRefreshEnabled()) {
Optional<Runnable> task = camelContext.adapt(ExtendedCamelContext.class)
.getPeriodTaskResolver().newInstance("azure-secret-refresh", Runnable.class);
if (task.isPresent()) {
long period = vc.azure().getRefreshPeriod();
Runnable r = task.get();
if (LOG.isDebugEnabled()) {
LOG.debug("Scheduling: {} (period: {})", r, TimeUtils.printDuration(period, false));
}
if (camelContext.hasService(ContextReloadStrategy.class) == null) {
// refresh is enabled then we need to automatically enable context-reload as well
ContextReloadStrategy reloader = new DefaultContextReloadStrategy();
camelContext.addService(reloader);
}
PeriodTaskScheduler scheduler = getCamelContext().adapt(ExtendedCamelContext.class).getPeriodTaskScheduler();
scheduler.schedulePeriodTask(r, period);
}
}
}
protected void autoconfigure(CamelContext camelContext) throws Exception {
// gathers the properties (key=value) that was auto-configured
final OrderedLocationProperties autoConfiguredProperties = new OrderedLocationProperties();
// need to eager allow to auto-configure properties component
if (mainConfigurationProperties.isAutoConfigurationEnabled()) {
autoConfigurationFailFast(camelContext, autoConfiguredProperties);
autoConfigurationPropertiesComponent(camelContext, autoConfiguredProperties);
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesIncludePattern",
value -> {
mainConfigurationProperties.setRoutesIncludePattern(value);
return null;
});
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesCompileDirectory",
value -> {
mainConfigurationProperties.setRoutesCompileDirectory(value);
return null;
});
autoConfigurationSingleOption(camelContext, autoConfiguredProperties, "camel.main.routesCompileLoadFirst",
value -> {
boolean bool = CamelContextHelper.parseBoolean(camelContext, value);
mainConfigurationProperties.setRoutesCompileLoadFirst(bool);
return null;
});
// eager load properties from modeline by scanning DSL sources and gather properties for auto configuration
if (camelContext.isModeline() || mainConfigurationProperties.isModeline()) {
modelineRoutes(camelContext);
}
autoConfigurationMainConfiguration(camelContext, mainConfigurationProperties, autoConfiguredProperties);
}
// configure from main configuration properties
doConfigureCamelContextFromMainConfiguration(camelContext, mainConfigurationProperties, autoConfiguredProperties);
// try to load configuration classes
loadConfigurations(camelContext);
if (mainConfigurationProperties.isAutoConfigurationEnabled()) {
autoConfigurationFromProperties(camelContext, autoConfiguredProperties);
autowireWildcardProperties(camelContext);
}
// log summary of configurations
if (mainConfigurationProperties.isAutoConfigurationLogSummary() && !autoConfiguredProperties.isEmpty()) {
boolean header = false;
for (var entry : autoConfiguredProperties.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
String loc = locationSummary(autoConfiguredProperties, k);
// tone down logging noise for our own internal configurations
boolean debug = loc.contains("[camel-main]");
if (debug && !LOG.isDebugEnabled()) {
continue;
}
if (!header) {
LOG.info("Auto-configuration summary");
header = true;
}
if (SensitiveUtils.containsSensitive(k)) {
if (debug) {
LOG.debug(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}=xxxxxx", loc, k);
}
} else {
if (debug) {
LOG.debug(" {} {}={}", loc, k, v);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
// we are now done with the main helper during bootstrap
helper.bootstrapDone();
}
protected void configureStartupRecorder(CamelContext camelContext) {
// we need to load these configurations early as they control the startup recorder when using camel-jfr
// and we want to start jfr recording as early as possible to also capture details during bootstrapping Camel
// load properties
Properties prop = camelContext.getPropertiesComponent().loadProperties(name -> name.startsWith("camel."),
MainHelper::optionKey);
Object value = prop.remove("camel.main.startupRecorder");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorder(value.toString());
}
value = prop.remove("camel.main.startupRecorderRecording");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderRecording("true".equalsIgnoreCase(value.toString()));
}
value = prop.remove("camel.main.startupRecorderProfile");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderProfile(
CamelContextHelper.parseText(camelContext, value.toString()));
}
value = prop.remove("camel.main.startupRecorderDuration");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderDuration(Long.parseLong(value.toString()));
}
value = prop.remove("camel.main.startupRecorderMaxDepth");
if (ObjectHelper.isNotEmpty(value)) {
mainConfigurationProperties.setStartupRecorderMaxDepth(Integer.parseInt(value.toString()));
}
if ("off".equals(mainConfigurationProperties.getStartupRecorder())
|| "false".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder().setEnabled(false);
} else if ("logging".equals(mainConfigurationProperties.getStartupRecorder())) {
camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(new LoggingStartupStepRecorder());
} else if ("jfr".equals(mainConfigurationProperties.getStartupRecorder())
|| "java-flight-recorder".equals(mainConfigurationProperties.getStartupRecorder())
|| mainConfigurationProperties.getStartupRecorder() == null) {
// try to auto discover camel-jfr to use
StartupStepRecorder fr = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
.newInstance(StartupStepRecorder.FACTORY, StartupStepRecorder.class).orElse(null);
if (fr != null) {
LOG.debug("Discovered startup recorder: {} from classpath", fr);
fr.setRecording(mainConfigurationProperties.isStartupRecorderRecording());
fr.setStartupRecorderDuration(mainConfigurationProperties.getStartupRecorderDuration());
fr.setRecordingProfile(mainConfigurationProperties.getStartupRecorderProfile());
fr.setMaxDepth(mainConfigurationProperties.getStartupRecorderMaxDepth());
camelContext.adapt(ExtendedCamelContext.class).setStartupStepRecorder(fr);
}
}
}
protected void configurePackageScan(CamelContext camelContext) {
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
camelContext.adapt(ExtendedCamelContext.class).setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
if (mainConfigurationProperties.getBasePackageScan() != null) {
LOG.info("Classpath scanning enabled from base package: {}", mainConfigurationProperties.getBasePackageScan());
}
}
}
protected void configureRoutesLoader(CamelContext camelContext) {
// use main based routes loader
camelContext.adapt(ExtendedCamelContext.class).setRoutesLoader(new MainRoutesLoader(mainConfigurationProperties));
}
protected void modelineRoutes(CamelContext camelContext) throws Exception {
// then configure and add the routes
RoutesConfigurer configurer = new RoutesConfigurer();
if (mainConfigurationProperties.isRoutesCollectorEnabled()) {
configurer.setRoutesCollector(routesCollector);
}
configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor());
configurer.setRoutesBuilders(mainConfigurationProperties.getRoutesBuilders());
configurer.setRoutesBuilderClasses(mainConfigurationProperties.getRoutesBuilderClasses());
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
configurer.setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
}
configurer.setJavaRoutesExcludePattern(mainConfigurationProperties.getJavaRoutesExcludePattern());
configurer.setJavaRoutesIncludePattern(mainConfigurationProperties.getJavaRoutesIncludePattern());
configurer.setRoutesExcludePattern(mainConfigurationProperties.getRoutesExcludePattern());
configurer.setRoutesIncludePattern(mainConfigurationProperties.getRoutesIncludePattern());
configurer.configureModeline(camelContext);
}
protected void configureRoutes(CamelContext camelContext) throws Exception {
// then configure and add the routes
RoutesConfigurer configurer = new RoutesConfigurer();
if (mainConfigurationProperties.isRoutesCollectorEnabled()) {
configurer.setRoutesCollector(routesCollector);
}
configurer.setBeanPostProcessor(camelContext.adapt(ExtendedCamelContext.class).getBeanPostProcessor());
configurer.setRoutesBuilders(mainConfigurationProperties.getRoutesBuilders());
configurer.setRoutesBuilderClasses(mainConfigurationProperties.getRoutesBuilderClasses());
if (mainConfigurationProperties.isBasePackageScanEnabled()) {
// only set the base package if enabled
configurer.setBasePackageScan(mainConfigurationProperties.getBasePackageScan());
}
configurer.setJavaRoutesExcludePattern(mainConfigurationProperties.getJavaRoutesExcludePattern());
configurer.setJavaRoutesIncludePattern(mainConfigurationProperties.getJavaRoutesIncludePattern());
configurer.setRoutesExcludePattern(mainConfigurationProperties.getRoutesExcludePattern());
configurer.setRoutesIncludePattern(mainConfigurationProperties.getRoutesIncludePattern());
configurer.configureRoutes(camelContext);
}
protected void postProcessCamelContext(CamelContext camelContext) throws Exception {
// gathers the properties (key=value) that was used as property placeholders during bootstrap
final OrderedLocationProperties propertyPlaceholders = new OrderedLocationProperties();
// use the main autowired lifecycle strategy instead of the default
camelContext.getLifecycleStrategies().removeIf(s -> s instanceof AutowiredLifecycleStrategy);
camelContext.addLifecycleStrategy(new MainAutowiredLifecycleStrategy(camelContext));
// setup properties
configurePropertiesService(camelContext);
// register listener on properties component so we can capture them
PropertiesComponent pc = camelContext.getPropertiesComponent();
pc.addPropertiesLookupListener(new PropertyPlaceholderListener(propertyPlaceholders));
// setup startup recorder before building context
configureStartupRecorder(camelContext);
// setup package scan
configurePackageScan(camelContext);
// configure to use our main routes loader
configureRoutesLoader(camelContext);
// ensure camel context is build
camelContext.build();
for (MainListener listener : listeners) {
listener.beforeInitialize(this);
}
// allow doing custom configuration before camel is started
for (MainListener listener : listeners) {
listener.beforeConfigure(this);
}
// we want to capture startup events for import tasks during main bootstrap
StartupStepRecorder recorder = camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder();
StartupStep step;
if (standalone) {
step = recorder.beginStep(BaseMainSupport.class, "autoconfigure", "Auto Configure");
autoconfigure(camelContext);
recorder.endStep(step);
}
configureLifecycle(camelContext);
configureVault(camelContext);
if (standalone) {
step = recorder.beginStep(BaseMainSupport.class, "configureRoutes", "Collect Routes");
configureRoutes(camelContext);
recorder.endStep(step);
}
// allow doing custom configuration before camel is started
for (MainListener listener : listeners) {
listener.afterConfigure(this);
listener.configure(camelContext);
}
// we want to log the property placeholder summary after routes has been started,
// but before camel context logs that it has been started, so we need to use an event listener
if (standalone && mainConfigurationProperties.isAutoConfigurationLogSummary()) {
camelContext.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {
@Override
public boolean isEnabled(CamelEvent event) {
return event instanceof CamelEvent.CamelContextRoutesStartedEvent;
}
@Override
public void notify(CamelEvent event) throws Exception {
// log summary of configurations
if (!propertyPlaceholders.isEmpty()) {
LOG.info("Property-placeholders summary");
for (var entry : propertyPlaceholders.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
Object dv = propertyPlaceholders.getDefaultValue(k);
// skip logging configurations that are using default-value
// or a kamelet that uses templateId as a parameter
boolean same = ObjectHelper.equal(v, dv);
boolean skip = "templateId".equals(k);
if (!same && !skip) {
String loc = locationSummary(propertyPlaceholders, k);
if (SensitiveUtils.containsSensitive(k)) {
LOG.info(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
}
});
}
}
protected void autoConfigurationFailFast(CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
LOG.debug("Properties from Camel properties component:");
for (String key : prop.stringPropertyNames()) {
LOG.debug(" {}={}", key, prop.getProperty(key));
}
// special for environment-variable-enabled as we need to know this early before we set all the other options
Object envEnabled = prop.remove("camel.main.autoConfigurationEnvironmentVariablesEnabled");
if (ObjectHelper.isNotEmpty(envEnabled)) {
mainConfigurationProperties.setAutoConfigurationEnvironmentVariablesEnabled(
CamelContextHelper.parseBoolean(camelContext, envEnabled.toString()));
String loc = prop.getLocation("camel.main.autoConfigurationEnvironmentVariablesEnabled");
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationEnvironmentVariablesEnabled",
envEnabled.toString());
}
// special for system-properties-enabled as we need to know this early before we set all the other options
Object jvmEnabled = prop.remove("camel.main.autoConfigurationSystemPropertiesEnabled");
if (ObjectHelper.isNotEmpty(jvmEnabled)) {
mainConfigurationProperties.setAutoConfigurationSystemPropertiesEnabled(
CamelContextHelper.parseBoolean(camelContext, jvmEnabled.toString()));
String loc = prop.getLocation("camel.main.autoConfigurationSystemPropertiesEnabled");
autoConfiguredProperties.put(loc, "camel.autoConfigurationSystemPropertiesEnabled",
jvmEnabled.toString());
}
// load properties from ENV (override existing)
Properties propENV = null;
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
if (!propENV.isEmpty()) {
prop.putAll(propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
Properties propJVM = null;
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
if (!propJVM.isEmpty()) {
prop.putAll(propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
// special for fail-fast as we need to know this early before we set all the other options
String loc = "ENV";
Object failFast = propENV != null ? propENV.remove("camel.main.autoconfigurationfailfast") : null;
if (ObjectHelper.isNotEmpty(propJVM)) {
Object val = propJVM.remove("camel.main.autoconfigurationfailfast");
if (ObjectHelper.isNotEmpty(val)) {
loc = "SYS";
failFast = val;
}
}
if (ObjectHelper.isNotEmpty(failFast)) {
mainConfigurationProperties
.setAutoConfigurationFailFast(CamelContextHelper.parseBoolean(camelContext, failFast.toString()));
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationFailFast", failFast.toString());
} else {
loc = prop.getLocation("camel.main.autoConfigurationFailFast");
failFast = prop.remove("camel.main.autoConfigurationFailFast");
if (ObjectHelper.isNotEmpty(failFast)) {
mainConfigurationProperties
.setAutoConfigurationFailFast(CamelContextHelper.parseBoolean(camelContext, failFast.toString()));
autoConfiguredProperties.put(loc, "camel.main.autoConfigurationFailFast", failFast.toString());
}
}
}
protected void autoConfigurationSingleOption(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties,
String optionName, Function<String, Object> setter) {
String lowerOptionName = optionName.toLowerCase(Locale.US);
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
LOG.debug("Properties from Camel properties component:");
for (String key : prop.stringPropertyNames()) {
LOG.debug(" {}={}", key, prop.getProperty(key));
}
// load properties from ENV (override existing)
Properties propENV = null;
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
Properties propJVM = null;
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
// SYS and ENV take priority (ENV are in lower-case keys)
String loc = "ENV";
Object value = propENV != null ? propENV.remove(lowerOptionName) : null;
if (ObjectHelper.isNotEmpty(propJVM)) {
Object val = propJVM.remove(optionName);
if (ObjectHelper.isNotEmpty(val)) {
// SYS override ENV
loc = "SYS";
value = val;
}
}
if (ObjectHelper.isEmpty(value)) {
// then try properties
loc = prop.getLocation(optionName);
value = prop.remove(optionName);
}
if (ObjectHelper.isEmpty(value)) {
// fallback to initial properties
value = getInitialProperties().getProperty(optionName);
loc = "initial";
}
// set the option if we have a value
if (ObjectHelper.isNotEmpty(value)) {
String str = CamelContextHelper.parseText(camelContext, value.toString());
setter.apply(str);
autoConfiguredProperties.put(loc, optionName, value.toString());
}
}
/**
* Configures CamelContext from the {@link MainConfigurationProperties} properties.
*/
protected void doConfigureCamelContextFromMainConfiguration(
CamelContext camelContext, MainConfigurationProperties config,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
if (ObjectHelper.isNotEmpty(config.getFileConfigurations())) {
String[] locs = config.getFileConfigurations().split(",");
for (String loc : locs) {
String path = FileUtil.onlyPath(loc);
if (path != null) {
String pattern = loc.length() > path.length() ? loc.substring(path.length() + 1) : null;
File[] files = new File(path).listFiles(f -> matches(pattern, f.getName()));
if (files != null) {
for (File file : files) {
Properties props = new Properties();
try (FileInputStream is = new FileInputStream(file)) {
props.load(is);
}
if (!props.isEmpty()) {
if (overrideProperties == null) {
// setup override properties on properties component
overrideProperties = new Properties();
PropertiesComponent pc = camelContext.getPropertiesComponent();
pc.setOverrideProperties(overrideProperties);
}
LOG.info("Loaded additional {} properties from file: {}", props.size(), file);
overrideProperties.putAll(props);
}
}
}
}
}
}
// configure the common/default options
DefaultConfigurationConfigurer.configure(camelContext, config);
// lookup and configure SPI beans
DefaultConfigurationConfigurer.afterConfigure(camelContext);
// now configure context/resilience4j/rest with additional properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
LOG.debug("Properties from OS environment variables:");
for (String key : propENV.stringPropertyNames()) {
LOG.debug(" {}={}", key, propENV.getProperty(key));
}
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
LOG.debug("Properties from JVM system properties:");
for (String key : propJVM.stringPropertyNames()) {
LOG.debug(" {}={}", key, propJVM.getProperty(key));
}
}
}
OrderedLocationProperties contextProperties = new OrderedLocationProperties();
OrderedLocationProperties resilience4jProperties = new OrderedLocationProperties();
OrderedLocationProperties faultToleranceProperties = new OrderedLocationProperties();
OrderedLocationProperties restProperties = new OrderedLocationProperties();
OrderedLocationProperties vaultProperties = new OrderedLocationProperties();
OrderedLocationProperties threadPoolProperties = new OrderedLocationProperties();
OrderedLocationProperties healthProperties = new OrderedLocationProperties();
OrderedLocationProperties lraProperties = new OrderedLocationProperties();
OrderedLocationProperties routeTemplateProperties = new OrderedLocationProperties();
OrderedLocationProperties beansProperties = new OrderedLocationProperties();
OrderedLocationProperties devConsoleProperties = new OrderedLocationProperties();
OrderedLocationProperties globalOptions = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
String loc = prop.getLocation(key);
if (key.startsWith("camel.context.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(14);
validateOptionAndValue(key, option, value);
contextProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.resilience4j.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(19);
validateOptionAndValue(key, option, value);
resilience4jProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.faulttolerance.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(21);
validateOptionAndValue(key, option, value);
faultToleranceProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.rest.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(11);
validateOptionAndValue(key, option, value);
restProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.vault.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(12);
validateOptionAndValue(key, option, value);
vaultProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.threadpool.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(17);
validateOptionAndValue(key, option, value);
threadPoolProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.health.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(13);
validateOptionAndValue(key, option, value);
healthProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.lra.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(10);
validateOptionAndValue(key, option, value);
lraProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.routeTemplate")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(19);
validateOptionAndValue(key, option, value);
routeTemplateProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.devConsole.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(17);
validateOptionAndValue(key, option, value);
devConsoleProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.beans.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(12);
validateOptionAndValue(key, option, value);
beansProperties.put(loc, optionKey(option), value);
} else if (key.startsWith("camel.globalOptions.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(20);
validateOptionAndValue(key, option, value);
globalOptions.put(loc, optionKey(option), value);
}
}
// global options first
if (!globalOptions.isEmpty()) {
for (var name : globalOptions.stringPropertyNames()) {
Object value = globalOptions.getProperty(name);
mainConfigurationProperties.addGlobalOption(name, value);
}
}
// create beans first as they may be used later
if (!beansProperties.isEmpty()) {
LOG.debug("Creating and binding beans to registry from loaded properties: {}", beansProperties.size());
bindBeansToRegistry(camelContext, beansProperties, "camel.beans.",
mainConfigurationProperties.isAutoConfigurationFailFast(),
mainConfigurationProperties.isAutoConfigurationLogSummary(), true, autoConfiguredProperties);
}
if (!contextProperties.isEmpty()) {
LOG.debug("Auto-configuring CamelContext from loaded properties: {}", contextProperties.size());
setPropertiesOnTarget(camelContext, camelContext, contextProperties, "camel.context.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
if (!restProperties.isEmpty() || mainConfigurationProperties.hasRestConfiguration()) {
RestConfigurationProperties rest = mainConfigurationProperties.rest();
LOG.debug("Auto-configuring Rest DSL from loaded properties: {}", restProperties.size());
setPropertiesOnTarget(camelContext, rest, restProperties, "camel.rest.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
camelContext.setRestConfiguration(rest);
}
if (!vaultProperties.isEmpty() || mainConfigurationProperties.hasVaultConfiguration()) {
LOG.debug("Auto-configuring Vault from loaded properties: {}", vaultProperties.size());
setVaultProperties(camelContext, vaultProperties, mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
if (!threadPoolProperties.isEmpty() || mainConfigurationProperties.hasThreadPoolConfiguration()) {
LOG.debug("Auto-configuring Thread Pool from loaded properties: {}", threadPoolProperties.size());
MainSupportModelConfigurer.setThreadPoolProperties(camelContext, mainConfigurationProperties, threadPoolProperties,
autoConfiguredProperties);
}
// need to let camel-main setup health-check using its convention over configuration
boolean hc = mainConfigurationProperties.health().getEnabled() != null; // health-check is enabled by default
if (hc || !healthProperties.isEmpty() || mainConfigurationProperties.hasHealthCheckConfiguration()) {
LOG.debug("Auto-configuring HealthCheck from loaded properties: {}", healthProperties.size());
setHealthCheckProperties(camelContext, healthProperties,
autoConfiguredProperties);
}
if (!routeTemplateProperties.isEmpty()) {
LOG.debug("Auto-configuring Route templates from loaded properties: {}", routeTemplateProperties.size());
setRouteTemplateProperties(camelContext, routeTemplateProperties,
autoConfiguredProperties);
}
if (!lraProperties.isEmpty() || mainConfigurationProperties.hasLraConfiguration()) {
LOG.debug("Auto-configuring Saga LRA from loaded properties: {}", lraProperties.size());
setLraCheckProperties(camelContext, lraProperties, mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
if (!devConsoleProperties.isEmpty()) {
LOG.debug("Auto-configuring Dev Console from loaded properties: {}", devConsoleProperties.size());
setDevConsoleProperties(camelContext, devConsoleProperties,
mainConfigurationProperties.isAutoConfigurationFailFast(),
autoConfiguredProperties);
}
// configure which requires access to the model
MainSupportModelConfigurer.configureModelCamelContext(camelContext, mainConfigurationProperties,
autoConfiguredProperties, resilience4jProperties, faultToleranceProperties);
// log which options was not set
if (!beansProperties.isEmpty()) {
beansProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.beans.{}={}", k, v);
});
}
if (!contextProperties.isEmpty()) {
contextProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.context.{}={}", k, v);
});
}
if (!resilience4jProperties.isEmpty()) {
resilience4jProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.resilience4j.{}={}", k, v);
});
}
if (!faultToleranceProperties.isEmpty()) {
faultToleranceProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.faulttolerance.{}={}", k, v);
});
}
if (!restProperties.isEmpty()) {
restProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.rest.{}={}", k, v);
});
}
if (!vaultProperties.isEmpty()) {
vaultProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.vault.{}={}", k, v);
});
}
if (!threadPoolProperties.isEmpty()) {
threadPoolProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.threadpool.{}={}", k, v);
});
}
if (!healthProperties.isEmpty()) {
healthProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.health.{}={}", k, v);
});
}
if (!routeTemplateProperties.isEmpty()) {
routeTemplateProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.routetemplate.{}={}", k, v);
});
}
if (!lraProperties.isEmpty()) {
lraProperties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.lra.{}={}", k, v);
});
}
// and call after all properties are set
DefaultConfigurationConfigurer.afterPropertiesSet(camelContext);
}
private void setRouteTemplateProperties(
CamelContext camelContext, OrderedLocationProperties routeTemplateProperties,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// store the route template parameters as a source and register it on the camel context
PropertiesRouteTemplateParametersSource source = new PropertiesRouteTemplateParametersSource();
for (Map.Entry<Object, Object> entry : routeTemplateProperties.entrySet()) {
String key = entry.getKey().toString();
String id = StringHelper.between(key, "[", "]");
key = StringHelper.after(key, "].");
source.addParameter(id, key, entry.getValue());
}
camelContext.getRegistry().bind("CamelMainRouteTemplateParametersSource", RouteTemplateParameterSource.class, source);
// lets sort by keys
Map<String, Object> sorted = new TreeMap<>(routeTemplateProperties.asMap());
sorted.forEach((k, v) -> {
String loc = routeTemplateProperties.getLocation(k);
autoConfiguredProperties.put(loc, "camel.routeTemplate" + k, v.toString());
});
routeTemplateProperties.clear();
}
private void setHealthCheckProperties(
CamelContext camelContext, OrderedLocationProperties healthCheckProperties,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
HealthConfigurationProperties health = mainConfigurationProperties.health();
setPropertiesOnTarget(camelContext, health, healthCheckProperties, "camel.health.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
if (health.getEnabled() != null && !health.getEnabled()) {
// health-check is disabled
return;
}
// auto-detect camel-health on classpath
HealthCheckRegistry hcr = camelContext.getExtension(HealthCheckRegistry.class);
if (hcr == null) {
if (health.getEnabled() != null && health.getEnabled()) {
LOG.warn("Cannot find HealthCheckRegistry from classpath. Add camel-health to classpath.");
}
return;
}
if (health.getEnabled() != null) {
hcr.setEnabled(health.getEnabled());
}
if (health.getExcludePattern() != null) {
hcr.setExcludePattern(health.getExcludePattern());
}
if (health.getExposureLevel() != null) {
hcr.setExposureLevel(health.getExposureLevel());
}
if (health.getInitialState() != null) {
hcr.setInitialState(camelContext.getTypeConverter().convertTo(HealthCheck.State.class, health.getInitialState()));
}
// context is enabled by default
if (hcr.isEnabled()) {
HealthCheck hc = (HealthCheck) hcr.resolveById("context");
if (hc != null) {
hcr.register(hc);
}
}
// routes are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc = hcr.getRepository("routes").orElse((HealthCheckRepository) hcr.resolveById("routes"));
if (hc != null) {
if (health.getRoutesEnabled() != null) {
hc.setEnabled(health.getRoutesEnabled());
}
hcr.register(hc);
}
}
// consumers are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc
= hcr.getRepository("consumers").orElse((HealthCheckRepository) hcr.resolveById("consumers"));
if (hc != null) {
if (health.getConsumersEnabled() != null) {
hc.setEnabled(health.getConsumersEnabled());
}
hcr.register(hc);
}
}
// registry are enabled by default
if (hcr.isEnabled()) {
HealthCheckRepository hc
= hcr.getRepository("registry").orElse((HealthCheckRepository) hcr.resolveById("registry"));
if (hc != null) {
if (health.getRegistryEnabled() != null) {
hc.setEnabled(health.getRegistryEnabled());
}
hcr.register(hc);
}
}
}
private void setLraCheckProperties(
CamelContext camelContext, OrderedLocationProperties lraProperties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
Object obj = lraProperties.remove("enabled");
if (ObjectHelper.isNotEmpty(obj)) {
String loc = lraProperties.getLocation("enabled");
autoConfiguredProperties.put(loc, "camel.lra.enabled", obj.toString());
}
boolean enabled = obj != null ? CamelContextHelper.parseBoolean(camelContext, obj.toString()) : true;
if (enabled) {
CamelSagaService css = resolveLraSagaService(camelContext);
setPropertiesOnTarget(camelContext, css, lraProperties, "camel.lra.", failIfNotSet, true, autoConfiguredProperties);
}
}
private void setDevConsoleProperties(
CamelContext camelContext, OrderedLocationProperties properties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// set properties per console
for (String key : keys) {
String name = StringHelper.before(key, ".");
DevConsole console = camelContext.getExtension(DevConsoleRegistry.class).resolveById(name);
if (console == null) {
throw new IllegalArgumentException(
"Cannot resolve DevConsole with id: " + name);
}
// configure all the properties on the console at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, console, config, "camel.devConsole." + name + ".", failIfNotSet, true,
autoConfiguredProperties);
}
}
private void setVaultProperties(
CamelContext camelContext, OrderedLocationProperties properties,
boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
if (mainConfigurationProperties.hasVaultConfiguration()) {
camelContext.setVaultConfiguration(mainConfigurationProperties.vault());
}
VaultConfiguration target = camelContext.getVaultConfiguration();
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// set properties per different vault component
for (String key : keys) {
String name = StringHelper.before(key, ".");
if ("aws".equalsIgnoreCase(name)) {
target = target.aws();
}
if ("gcp".equalsIgnoreCase(name)) {
target = target.gcp();
}
if ("azure".equalsIgnoreCase(name)) {
target = target.azure();
}
if ("hashicorp".equalsIgnoreCase(name)) {
target = target.hashicorp();
}
// configure all the properties on the vault at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, target, config, "camel.vault." + name + ".", failIfNotSet, true,
autoConfiguredProperties);
}
}
private void bindBeansToRegistry(
CamelContext camelContext, OrderedLocationProperties properties,
String optionPrefix, boolean failIfNotSet, boolean logSummary, boolean ignoreCase,
OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// make defensive copy as we mutate the map
Set<String> keys = new LinkedHashSet(properties.keySet());
// find names of beans (dot style)
final Set<String> beansDot
= properties.keySet().stream()
.map(k -> StringHelper.before(k.toString(), ".", k.toString()))
.filter(k -> k.indexOf('[') == -1)
.collect(Collectors.toSet());
// find names of beans (map style)
final Set<String> beansMap
= properties.keySet().stream()
.map(k -> StringHelper.before(k.toString(), "[", k.toString()))
.filter(k -> k.indexOf('.') == -1)
.collect(Collectors.toSet());
// then create beans first (beans with #class values etc)
for (String key : keys) {
if (key.indexOf('.') == -1 && key.indexOf('[') == -1) {
String name = key;
Object value = properties.remove(key);
Object bean = PropertyBindingSupport.resolveBean(camelContext, value);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot create/resolve bean with name " + name + " from value: " + value);
}
// register bean
if (logSummary) {
LOG.info("Binding bean: {} (type: {}) to the registry", key, ObjectHelper.classCanonicalName(bean));
} else {
LOG.debug("Binding bean: {} (type: {}) to the registry", key, ObjectHelper.classCanonicalName(bean));
}
camelContext.getRegistry().bind(name, bean);
}
}
// create map beans if none already exists
for (String name : beansMap) {
if (camelContext.getRegistry().lookupByName(name) == null) {
// register bean as a map
Map<String, Object> bean = new LinkedHashMap<>();
if (logSummary) {
LOG.info("Binding bean: {} (type: {}) to the registry", name, ObjectHelper.classCanonicalName(bean));
} else {
LOG.debug("Binding bean: {} (type: {}) to the registry", name, ObjectHelper.classCanonicalName(bean));
}
camelContext.getRegistry().bind(name, bean);
}
}
// then set properties per bean (dot style)
for (String name : beansDot) {
Object bean = camelContext.getRegistry().lookupByName(name);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot resolve bean with name " + name);
}
// configure all the properties on the bean at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + ".");
setPropertiesOnTarget(camelContext, bean, config, optionPrefix + name + ".", failIfNotSet, ignoreCase,
autoConfiguredProperties);
}
// then set properties per bean (map style)
for (String name : beansMap) {
Object bean = camelContext.getRegistry().lookupByName(name);
if (bean == null) {
throw new IllegalArgumentException(
"Cannot resolve bean with name " + name);
}
// configure all the properties on the bean at once (to ensure they are configured in right order)
OrderedLocationProperties config = MainHelper.extractProperties(properties, name + "[", "]");
setPropertiesOnTarget(camelContext, bean, config, optionPrefix + name + ".", failIfNotSet, ignoreCase,
autoConfiguredProperties);
}
}
protected void autoConfigurationPropertiesComponent(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
OrderedLocationProperties properties = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
if (key.startsWith("camel.component.properties.")) {
int dot = key.indexOf('.', 26);
String option = dot == -1 ? "" : key.substring(dot + 1);
String value = prop.getProperty(key, "");
validateOptionAndValue(key, option, value);
String loc = prop.getLocation(key);
properties.put(loc, optionKey(option), value);
}
}
if (!properties.isEmpty()) {
LOG.debug("Auto-configuring properties component from loaded properties: {}", properties.size());
setPropertiesOnTarget(camelContext, camelContext.getPropertiesComponent(), properties,
"camel.component.properties.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
properties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.component.properties.{}={} on object: {}", k, v,
camelContext.getPropertiesComponent());
});
}
}
protected void autoConfigurationMainConfiguration(
CamelContext camelContext, MainConfigurationProperties config, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
// load properties
OrderedLocationProperties prop = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."), MainHelper::optionKey);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
// special handling of these so remove them
// ENV variables cannot use dash so replace with dot
propENV.remove(INITIAL_PROPERTIES_LOCATION.replace('-', '.'));
propENV.remove(OVERRIDE_PROPERTIES_LOCATION.replace('-', '.'));
propENV.remove(PROPERTY_PLACEHOLDER_LOCATION.replace('-', '.'));
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
// special handling of these so remove them
propJVM.remove(INITIAL_PROPERTIES_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(INITIAL_PROPERTIES_LOCATION));
propJVM.remove(OVERRIDE_PROPERTIES_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(OVERRIDE_PROPERTIES_LOCATION));
propJVM.remove(PROPERTY_PLACEHOLDER_LOCATION);
propJVM.remove(StringHelper.dashToCamelCase(PROPERTY_PLACEHOLDER_LOCATION));
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
OrderedLocationProperties properties = new OrderedLocationProperties();
for (String key : prop.stringPropertyNames()) {
if (key.startsWith("camel.main.")) {
// grab the value
String value = prop.getProperty(key);
String option = key.substring(11);
validateOptionAndValue(key, option, value);
String loc = prop.getLocation(key);
properties.put(loc, optionKey(option), value);
}
}
if (!properties.isEmpty()) {
LOG.debug("Auto-configuring main from loaded properties: {}", properties.size());
setPropertiesOnTarget(camelContext, config, properties, "camel.main.",
mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
properties.forEach((k, v) -> {
LOG.warn("Property not auto-configured: camel.main.{}={} on bean: {}", k, v, config);
});
}
}
protected void autoConfigurationFromProperties(
CamelContext camelContext, OrderedLocationProperties autoConfiguredProperties)
throws Exception {
OrderedLocationProperties prop = new OrderedLocationProperties();
// load properties from properties component (override existing)
OrderedLocationProperties propPC = (OrderedLocationProperties) camelContext.getPropertiesComponent()
.loadProperties(name -> name.startsWith("camel."));
prop.putAll(propPC);
// load properties from ENV (override existing)
if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
Map<String, String> env = MainHelper
.filterEnvVariables(new String[] { "camel.component.", "camel.dataformat.", "camel.language." });
LOG.debug("Gathered {} ENV variables to configure components, dataformats, languages", env.size());
// special configuration when using ENV variables as we need to extract the ENV variables
// that are for the out of the box components first, and then afterwards for any 3rd party custom components
Properties propENV = new OrderedProperties();
helper.addComponentEnvVariables(env, propENV, false);
helper.addDataFormatEnvVariables(env, propENV, false);
helper.addLanguageEnvVariables(env, propENV, false);
if (!env.isEmpty()) {
LOG.debug("Remaining {} ENV variables to configure custom components, dataformats, languages", env.size());
helper.addComponentEnvVariables(env, propENV, true);
helper.addDataFormatEnvVariables(env, propENV, true);
helper.addLanguageEnvVariables(env, propENV, true);
}
if (!propENV.isEmpty()) {
prop.putAll("ENV", propENV);
}
}
// load properties from JVM (override existing)
if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(
new String[] { "camel.component.", "camel.dataformat.", "camel.language." });
if (!propJVM.isEmpty()) {
prop.putAll("SYS", propJVM);
}
}
Map<PropertyOptionKey, OrderedLocationProperties> properties = new LinkedHashMap<>();
// filter out wildcard properties
for (String key : prop.stringPropertyNames()) {
if (key.contains("*")) {
String loc = prop.getLocation(key);
wildcardProperties.put(loc, key, prop.getProperty(key));
}
}
// and remove wildcards
for (String key : wildcardProperties.stringPropertyNames()) {
prop.remove(key);
}
for (String key : prop.stringPropertyNames()) {
computeProperties("camel.component.", key, prop, properties, name -> {
// its an existing component name
Component target = camelContext.getComponent(name);
if (target == null) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find component with name " + name
+ ". Make sure you have the component on the classpath");
}
return Collections.singleton(target);
});
computeProperties("camel.dataformat.", key, prop, properties, name -> {
DataFormat target = camelContext.resolveDataFormat(name);
if (target == null) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find dataformat with name " + name
+ ". Make sure you have the dataformat on the classpath");
}
return Collections.singleton(target);
});
computeProperties("camel.language.", key, prop, properties, name -> {
Language target;
try {
target = camelContext.resolveLanguage(name);
} catch (NoSuchLanguageException e) {
throw new IllegalArgumentException(
"Error configuring property: " + key + " because cannot find language with name " + name
+ ". Make sure you have the language on the classpath");
}
return Collections.singleton(target);
});
}
if (!properties.isEmpty()) {
long total = properties.values().stream().mapToLong(Map::size).sum();
LOG.debug("Auto-configuring {} components/dataformat/languages from loaded properties: {}", properties.size(),
total);
}
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
setPropertiesOnTarget(
camelContext,
entry.getKey().getInstance(),
entry.getValue(),
entry.getKey().getOptionPrefix(),
mainConfigurationProperties.isAutoConfigurationFailFast(),
true,
autoConfiguredProperties);
}
// log which options was not set
if (!properties.isEmpty()) {
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
PropertyOptionKey pok = entry.getKey();
OrderedLocationProperties values = entry.getValue();
values.forEach((k, v) -> {
String stringValue = v != null ? v.toString() : null;
LOG.warn("Property ({}={}) not auto-configured with name: {} on bean: {} with value: {}",
pok.getOptionPrefix() + "." + k, stringValue, k, pok.getInstance(), stringValue);
});
}
}
}
protected void autowireWildcardProperties(CamelContext camelContext) {
if (wildcardProperties.isEmpty()) {
return;
}
// autowire any pre-existing components as they have been added before we are invoked
for (String name : camelContext.getComponentNames()) {
Component comp = camelContext.getComponent(name);
doAutowireWildcardProperties(name, comp);
}
// and autowire any new components that may be added in the future
camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
@Override
public void onComponentAdd(String name, Component component) {
doAutowireWildcardProperties(name, component);
}
});
}
protected void doAutowireWildcardProperties(String name, Component component) {
Map<PropertyOptionKey, OrderedLocationProperties> properties = new LinkedHashMap<>();
OrderedLocationProperties autoConfiguredProperties = new OrderedLocationProperties();
String match = ("camel.component." + name).toLowerCase(Locale.ENGLISH);
for (String key : wildcardProperties.stringPropertyNames()) {
String mKey = key.substring(0, key.indexOf('*')).toLowerCase(Locale.ENGLISH);
if (match.startsWith(mKey)) {
computeProperties("camel.component.", key, wildcardProperties, properties,
s -> Collections.singleton(component));
}
}
try {
for (Map.Entry<PropertyOptionKey, OrderedLocationProperties> entry : properties.entrySet()) {
setPropertiesOnTarget(
camelContext,
entry.getKey().getInstance(),
entry.getValue(),
entry.getKey().getOptionPrefix(),
mainConfigurationProperties.isAutoConfigurationFailFast(),
true,
autoConfiguredProperties);
}
// log summary of configurations
if (mainConfigurationProperties.isAutoConfigurationLogSummary() && !autoConfiguredProperties.isEmpty()) {
boolean header = false;
for (var entry : autoConfiguredProperties.entrySet()) {
String k = entry.getKey().toString();
Object v = entry.getValue();
String loc = locationSummary(autoConfiguredProperties, k);
// tone down logging noise for our own internal configurations
boolean debug = loc.contains("[camel-main]");
if (debug && !LOG.isDebugEnabled()) {
continue;
}
if (!header) {
LOG.info("Auto-configuration component {} summary", name);
header = true;
}
if (SensitiveUtils.containsSensitive(k)) {
if (debug) {
LOG.debug(" {} {}=xxxxxx", loc, k);
} else {
LOG.info(" {} {}=xxxxxx", loc, k);
}
} else {
if (debug) {
LOG.debug(" {} {}={}", loc, k, v);
} else {
LOG.info(" {} {}={}", loc, k, v);
}
}
}
}
} catch (Exception e) {
throw RuntimeCamelException.wrapRuntimeException(e);
}
}
private static CamelSagaService resolveLraSagaService(CamelContext camelContext) throws Exception {
// lookup in service registry first
CamelSagaService answer = camelContext.getRegistry().findSingleByType(CamelSagaService.class);
if (answer == null) {
answer = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
.newInstance("lra-saga-service", CamelSagaService.class)
.orElseThrow(() -> new IllegalArgumentException(
"Cannot find LRASagaService on classpath. Add camel-lra to classpath."));
// add as service so its discover by saga eip
camelContext.addService(answer, true, false);
}
return answer;
}
private static final class PropertyPlaceholderListener implements PropertiesLookupListener {
private final OrderedLocationProperties olp;
public PropertyPlaceholderListener(OrderedLocationProperties olp) {
this.olp = olp;
}
@Override
public void onLookup(String name, String value, String defaultValue, String source) {
if (source == null) {
source = "unknown";
}
olp.put(source, name, value, defaultValue);
}
}
}
| chore(main): fix warning about accessing MainHelpe static members via instance reference (#8598)
| core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java | chore(main): fix warning about accessing MainHelpe static members via instance reference (#8598) | <ide><path>ore/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
<ide> String locations = propertyPlaceholderLocations;
<ide> if (locations == null) {
<ide> locations
<del> = helper.lookupPropertyFromSysOrEnv(PROPERTY_PLACEHOLDER_LOCATION)
<add> = MainHelper.lookupPropertyFromSysOrEnv(PROPERTY_PLACEHOLDER_LOCATION)
<ide> .orElse(defaultPropertyPlaceholderLocation);
<ide> }
<ide> if (locations != null) {
<ide>
<ide> Properties ip = initialProperties;
<ide> if (ip == null || ip.isEmpty()) {
<del> Optional<String> location = helper.lookupPropertyFromSysOrEnv(INITIAL_PROPERTIES_LOCATION);
<add> Optional<String> location = MainHelper.lookupPropertyFromSysOrEnv(INITIAL_PROPERTIES_LOCATION);
<ide> if (location.isPresent()) {
<ide> try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
<ide> ip = new Properties();
<ide>
<ide> Properties op = overrideProperties;
<ide> if (op == null || op.isEmpty()) {
<del> Optional<String> location = helper.lookupPropertyFromSysOrEnv(OVERRIDE_PROPERTIES_LOCATION);
<add> Optional<String> location = MainHelper.lookupPropertyFromSysOrEnv(OVERRIDE_PROPERTIES_LOCATION);
<ide> if (location.isPresent()) {
<ide> try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, location.get())) {
<ide> op = new Properties();
<ide> // load properties from ENV (override existing)
<ide> Properties propENV = null;
<ide> if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
<del> propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<add> propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<ide> if (!propENV.isEmpty()) {
<ide> prop.putAll(propENV);
<ide> LOG.debug("Properties from OS environment variables:");
<ide> // load properties from JVM (override existing)
<ide> Properties propJVM = null;
<ide> if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
<del> propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<add> propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<ide> if (!propJVM.isEmpty()) {
<ide> prop.putAll(propJVM);
<ide> LOG.debug("Properties from JVM system properties:");
<ide> // load properties from ENV (override existing)
<ide> Properties propENV = null;
<ide> if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
<del> propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<add> propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<ide> if (!propENV.isEmpty()) {
<ide> prop.putAll("ENV", propENV);
<ide> LOG.debug("Properties from OS environment variables:");
<ide> // load properties from JVM (override existing)
<ide> Properties propJVM = null;
<ide> if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
<del> propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<add> propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<ide> if (!propJVM.isEmpty()) {
<ide> prop.putAll("SYS", propJVM);
<ide> LOG.debug("Properties from JVM system properties:");
<ide>
<ide> // load properties from ENV (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
<del> Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
<add> Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
<ide> if (!propENV.isEmpty()) {
<ide> prop.putAll("ENV", propENV);
<ide> LOG.debug("Properties from OS environment variables:");
<ide> }
<ide> // load properties from JVM (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
<del> Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
<add> Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
<ide> if (!propJVM.isEmpty()) {
<ide> prop.putAll("SYS", propJVM);
<ide> LOG.debug("Properties from JVM system properties:");
<ide>
<ide> // load properties from ENV (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
<del> Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
<add> Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.component.properties." });
<ide> if (!propENV.isEmpty()) {
<ide> prop.putAll("ENV", propENV);
<ide> }
<ide> }
<ide> // load properties from JVM (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
<del> Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
<add> Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.component.properties." });
<ide> if (!propJVM.isEmpty()) {
<ide> prop.putAll("SYS", propJVM);
<ide> }
<ide>
<ide> // load properties from ENV (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationEnvironmentVariablesEnabled()) {
<del> Properties propENV = helper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<add> Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new String[] { "camel.main." });
<ide> // special handling of these so remove them
<ide> // ENV variables cannot use dash so replace with dot
<ide> propENV.remove(INITIAL_PROPERTIES_LOCATION.replace('-', '.'));
<ide> }
<ide> // load properties from JVM (override existing)
<ide> if (mainConfigurationProperties.isAutoConfigurationSystemPropertiesEnabled()) {
<del> Properties propJVM = helper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<add> Properties propJVM = MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { "camel.main." });
<ide> // special handling of these so remove them
<ide> propJVM.remove(INITIAL_PROPERTIES_LOCATION);
<ide> propJVM.remove(StringHelper.dashToCamelCase(INITIAL_PROPERTIES_LOCATION)); |
|
Java | mpl-2.0 | e7ec826ba024615b8906aa36215dcec6e90f159d | 0 | EMAXio/heimdal,EMAXio/cosigner,Braveno/cosigner,EMAXio/cosigner,Braveno/cosigner,trevorbernard/heimdal,EMAXio/heimdal | package io.emax.cosigner.core.currency;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.emax.cosigner.api.core.CurrencyPackage;
import io.emax.cosigner.api.core.CurrencyParameters;
import io.emax.cosigner.api.core.CurrencyParametersRecipient;
import io.emax.cosigner.api.core.Server;
import io.emax.cosigner.api.currency.Monitor;
import io.emax.cosigner.api.currency.SigningType;
import io.emax.cosigner.api.currency.Wallet.Recipient;
import io.emax.cosigner.api.currency.Wallet.TransactionDetails;
import io.emax.cosigner.api.validation.Validator;
import io.emax.cosigner.common.Json;
import io.emax.cosigner.core.CosignerApplication;
import io.emax.cosigner.core.cluster.ClusterInfo;
import io.emax.cosigner.core.cluster.Coordinator;
import io.emax.cosigner.core.cluster.commands.CurrencyCommand;
import io.emax.cosigner.core.cluster.commands.CurrencyCommandType;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.eclipse.jetty.websocket.api.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Subscription;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class Common {
private static final Logger LOGGER = LoggerFactory.getLogger(Common.class);
private static final HashMap<String, Subscription> balanceSubscriptions = new HashMap<>();
private static final HashMap<String, Subscription> transactionSubscriptions = new HashMap<>();
private static final HashMap<String, Monitor> monitors = new HashMap<>();
private static CurrencyParameters convertParams(String params) {
try {
JsonFactory jsonFact = new JsonFactory();
JsonParser jsonParser = jsonFact.createParser(params);
CurrencyParameters currencyParams =
new ObjectMapper().readValue(jsonParser, CurrencyParameters.class);
String userKey = currencyParams.getUserKey();
currencyParams.setUserKey("");
String sanitizedParams = Json.stringifyObject(CurrencyParameters.class, currencyParams);
currencyParams.setUserKey(userKey);
LOGGER.debug("[CurrencyParams] " + sanitizedParams);
return currencyParams;
} catch (IOException e) {
LOGGER.warn(null, e);
return null;
}
}
/**
* Lookup the currency package declared in the parameters.
*/
public static CurrencyPackage lookupCurrency(CurrencyParameters params) {
if (CosignerApplication.getCurrencies().containsKey(params.getCurrencySymbol())) {
return CosignerApplication.getCurrencies().get(params.getCurrencySymbol());
} else {
return null;
}
}
/**
* List all currencies that are currently loaded in cosigner.
*
* @return String list of currencies.
*/
public static String listCurrencies() {
List<String> currencies = new LinkedList<>();
CosignerApplication.getCurrencies().keySet().forEach(currencies::add);
String currencyString = Json.stringifyObject(LinkedList.class, currencies);
LOGGER.debug("[Response] " + currencyString);
return currencyString;
}
/**
* Registers addresses for currency libraries that need a watch list.
*/
public static String registerAddress(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
HashMap<String, Boolean> responses = new HashMap<>();
currencyParams.getAccount().forEach(address -> {
Boolean result = currency.getWallet().registerAddress(address);
responses.put(address, result);
});
String response = Json.stringifyObject(HashMap.class, responses);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Get a new address for the provided currency & user key.
*
* @param params {@link CurrencyParameters} with the currency code and user key filled in.
* @return Address that the user can use to deposit funds, for which we can generate the private
* keys.
*/
public static String getNewAddress(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String userAccount = currency.getWallet().createAddress(currencyParams.getUserKey());
LinkedList<String> accounts = new LinkedList<>();
if (currencyParams.getAccount() != null) {
accounts.addAll(currencyParams.getAccount());
}
accounts.add(userAccount);
String response =
currency.getWallet().getMultiSigAddress(accounts, currencyParams.getUserKey());
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Generates a currency-specific address from a public key.
*/
public static String generateAddressFromKey(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String publicKey = currencyParams.getUserKey();
String publicAddress = currency.getWallet().createAddressFromKey(publicKey, false);
LOGGER.debug("[Response] " + publicAddress);
return publicAddress;
}
/**
* List all addresses that we have generated for the given user key and currency.
*
* @param params {@link CurrencyParameters} with the currency code and user key filled in.
* @return All addresses that cosigner can generate the private key for belonging to that user
* key.
*/
public static String listAllAddresses(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
LinkedList<String> accounts = new LinkedList<>();
currency.getWallet().getAddresses(currencyParams.getUserKey()).forEach(accounts::add);
String response = Json.stringifyObject(LinkedList.class, accounts);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* List transactions for the given address and currency.
*
* <p>Will only return data for addresses that belong to cosigner.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled in.
* @return List of transactions that affect each account.
*/
public static String listTransactions(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
LinkedList<TransactionDetails> txDetails = new LinkedList<>();
currencyParams.getAccount().forEach(account -> txDetails
.addAll(Arrays.asList(currency.getWallet().getTransactions(account, 100, 0))));
String response = Json.stringifyObject(LinkedList.class, txDetails);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Returns the combined balance of all addresses provided in the parameters.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled in.
* @return Sum of all balances for the provided addresses.
*/
public static String getBalance(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
BigDecimal balance = BigDecimal.ZERO;
if (currencyParams.getAccount() == null || currencyParams.getAccount().isEmpty()) {
for (String account : currency.getWallet().getAddresses(currencyParams.getUserKey())) {
balance = balance.add(new BigDecimal(currency.getWallet().getBalance(account)));
}
} else {
for (String account : currencyParams.getAccount()) {
balance = balance.add(new BigDecimal(currency.getWallet().getBalance(account)));
}
}
String response = balance.toPlainString();
LOGGER.debug("[Response] " + response);
return response;
}
private static void cleanUpSubscriptions(String id) {
if (balanceSubscriptions.containsKey(id)) {
balanceSubscriptions.get(id).unsubscribe();
balanceSubscriptions.remove(id);
}
if (transactionSubscriptions.containsKey(id)) {
transactionSubscriptions.get(id).unsubscribe();
transactionSubscriptions.remove(id);
}
if (monitors.containsKey(id)) {
monitors.get(id).destroyMonitor();
monitors.remove(id);
}
}
/**
* Sets up a monitor for the given addresses.
*
* <p>A monitor provides periodic balance updates, along with all known transactions when
* initialized, and any new transactions that come in while it's active. Transactions can be
* distinguished from balance updates in that the transaction data portion of the response has
* data, it contains the transaction hash.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled
* in. If using a REST callback, the callback needs to be filled in as
* well.
* @param responseSocket If this has been called using a web socket, pass the socket in here and
* the data will be written to is as it's available.
* @return An empty {@link CurrencyParameters} object is returned when the monitor is set up. The
* actual data is sent through the socket or callback.
*/
public static String monitorBalance(String params, Session responseSocket) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
Monitor monitor = currency.getMonitor().createNewMonitor();
monitor.addAddresses(currencyParams.getAccount());
CurrencyParameters returnParms = new CurrencyParameters();
String response = Json.stringifyObject(CurrencyParameters.class, returnParms);
// Web socket was passed to us
if (responseSocket != null) {
cleanUpSubscriptions(responseSocket.toString());
Subscription wsBalanceSubscription = monitor.getObservableBalances().subscribe(balanceMap -> {
balanceMap.forEach((address, balance) -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().add(address);
CurrencyParametersRecipient accountData = new CurrencyParametersRecipient();
accountData.setAmount(balance);
accountData.setRecipientAddress(address);
responseParms.setReceivingAccount(Collections.singletonList(accountData));
LOGGER.debug("Sending balance update...");
responseSocket.getRemote()
.sendString(Json.stringifyObject(CurrencyParameters.class, responseParms));
responseSocket.getRemote().flush();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(responseSocket.toString());
}
});
});
balanceSubscriptions.put(responseSocket.toString(), wsBalanceSubscription);
Subscription wsTransactionSubscription =
monitor.getObservableTransactions().subscribe(transactionSet -> {
transactionSet.forEach(transaction -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().addAll(Arrays.asList(transaction.getFromAddress()));
LinkedList<CurrencyParametersRecipient> receivers = new LinkedList<>();
Arrays.asList(transaction.getToAddress()).forEach(address -> {
CurrencyParametersRecipient sendData = new CurrencyParametersRecipient();
sendData.setAmount(transaction.getAmount().toPlainString());
sendData.setRecipientAddress(address);
receivers.add(sendData);
});
responseParms.setReceivingAccount(receivers);
responseParms.setTransactionData(transaction.getTxHash());
responseSocket.getRemote()
.sendString(Json.stringifyObject(CurrencyParameters.class, responseParms));
responseSocket.getRemote().flush();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(responseSocket.toString());
}
});
});
transactionSubscriptions.put(responseSocket.toString(), wsTransactionSubscription);
monitors.put(responseSocket.toString(), monitor);
} else if (currencyParams.getCallback() != null && !currencyParams.getCallback().isEmpty()) {
// It's a REST callback
cleanUpSubscriptions(currencyParams.getCallback());
Subscription rsBalanceSubscription = monitor.getObservableBalances().subscribe(balanceMap -> {
balanceMap.forEach((address, balance) -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().add(address);
CurrencyParametersRecipient accountData = new CurrencyParametersRecipient();
accountData.setAmount(balance);
accountData.setRecipientAddress(address);
responseParms.setReceivingAccount(Collections.singletonList(accountData));
HttpPost httpPost = new HttpPost(currencyParams.getCallback());
httpPost.addHeader("content-type", "application/json");
StringEntity entity;
entity =
new StringEntity(Json.stringifyObject(CurrencyParameters.class, responseParms));
httpPost.setEntity(entity);
HttpClients.createDefault().execute(httpPost).close();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(currencyParams.getCallback());
}
});
});
balanceSubscriptions.put(currencyParams.getCallback(), rsBalanceSubscription);
Subscription rsTransactionSubscription =
monitor.getObservableTransactions().subscribe(transactionSet -> {
transactionSet.forEach(transaction -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().addAll(Arrays.asList(transaction.getFromAddress()));
LinkedList<CurrencyParametersRecipient> receivers = new LinkedList<>();
Arrays.asList(transaction.getToAddress()).forEach(address -> {
CurrencyParametersRecipient sendData = new CurrencyParametersRecipient();
sendData.setAmount(transaction.getAmount().toPlainString());
sendData.setRecipientAddress(address);
receivers.add(sendData);
});
responseParms.setReceivingAccount(receivers);
responseParms.setTransactionData(transaction.getTxHash());
HttpPost httpPost = new HttpPost(currencyParams.getCallback());
httpPost.addHeader("content-type", "application/json");
StringEntity entity;
entity =
new StringEntity(Json.stringifyObject(CurrencyParameters.class, responseParms));
httpPost.setEntity(entity);
HttpClients.createDefault().execute(httpPost).close();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(currencyParams.getCallback());
}
});
});
transactionSubscriptions.put(currencyParams.getCallback(), rsTransactionSubscription);
monitors.put(currencyParams.getCallback(), monitor);
} else {
// We have no way to respond to the caller other than with this response.
monitor.destroyMonitor();
}
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Create and sign a transaction.
*
* <p>This only signs the transaction with the user's key, showing that the user has requested the
* transaction. The server keys are not used until the approve stage.
*
* @param params {@link CurrencyParameters} with the currency code, user key, senders, recipients
* and amounts filled in.
* @return The transaction string that was requested.
*/
public static String prepareTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
if (currencyParams.getTransactionData() == null || currencyParams.getTransactionData()
.isEmpty()) {
// Create the transaction
List<String> addresses = new LinkedList<>();
addresses.addAll(currencyParams.getAccount());
LinkedList<Recipient> recipients = new LinkedList<>();
currencyParams.getReceivingAccount().forEach(account -> {
Recipient recipient = new Recipient();
recipient.setAmount(new BigDecimal(account.getAmount()));
recipient.setRecipientAddress(account.getRecipientAddress());
recipients.add(recipient);
});
currencyParams
.setTransactionData(currency.getWallet().createTransaction(addresses, recipients));
}
// Authorize it with the user account
String initalTx = currencyParams.getTransactionData();
LOGGER.debug("Wallet.CreateTransaction Result: " + initalTx);
if (currencyParams.getUserKey() != null && !currencyParams.getUserKey().isEmpty()) {
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(initalTx, currencyParams.getAccount().get(0),
currencyParams.getUserKey()));
LOGGER.debug("Sign with userKey: " + currencyParams.getTransactionData());
}
// If the userKey/address combo don't work then we stop here.
if (currencyParams.getTransactionData().equalsIgnoreCase(initalTx)) {
LOGGER.debug("No userKey signature, returning unsigned TX: " + initalTx);
return initalTx;
}
// Try to validate it, don't sign if it fails.
for (Validator validator : CosignerApplication.getValidators()) {
if (!validator.validateTransaction(currency, currencyParams.getTransactionData())) {
return initalTx;
}
}
// Send it if it's a sign-each and there's more than one signature
// required (we're at 1/X)
if (currency.getConfiguration().getMinSignatures() > 1 && currency.getConfiguration()
.getSigningType().equals(SigningType.SENDEACH)) {
submitTransaction(Json.stringifyObject(CurrencyParameters.class, currencyParams));
}
String response = currencyParams.getTransactionData();
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Get list of addresses that could sign this transaction.
*/
public static String getSignersForTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
Iterable<String> signers =
currency.getWallet().getSignersForTransaction(currencyParams.getTransactionData());
return Json.stringifyObject(Iterable.class, signers);
}
/**
* Get the data needed to create an offline signature for the transaction.
*/
public static String getSignatureString(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String address = "";
if (currencyParams.getAccount() != null && currencyParams.getAccount().size() > 0) {
address = currencyParams.getAccount().get(0);
}
Iterable<Iterable<String>> sigData =
currency.getWallet().getSigString(currencyParams.getTransactionData(), address);
return Json.stringifyObject(Iterable.class, sigData);
}
/**
* Apply an offline signature to a transaction.
*/
@SuppressWarnings("unchecked")
public static String applySignature(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String address = "";
if (currencyParams.getAccount() != null && currencyParams.getAccount().size() > 0) {
address = currencyParams.getAccount().get(0);
}
Iterator<String> txList = ((Iterable<String>) Json
.objectifyString(Iterable.class, currencyParams.getTransactionData())).iterator();
String tx = txList.next();
Iterable<Iterable<String>> sigData =
(Iterable<Iterable<String>>) Json.objectifyString(Iterable.class, txList.next());
return currency.getWallet().applySignature(tx, address, sigData);
}
/**
* Approve a transaction that's been signed off on by the user.
*
* <p>This stage signs the transaction with the server keys after running it through any sanity
* checks and validation required.
*
* @param params {@link CurrencyParameters} with the currency code, user key, senders,
* recipients and amounts filled in. The transaction data should be filled in
* with the response from prepareTransaction.
* @param sendToRemotes Indicates whether cosigner should attempt to request signature from any
* other cosigner servers in the cluster.
* @return Signed transaction string
*/
public static String approveTransaction(String params, boolean sendToRemotes) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
for (Server server : ClusterInfo.getInstance().getServers()) {
if (server.isOriginator()) { // It's us, try to sign it locally.
// But first check that it's valid.
for (Validator validator : CosignerApplication.getValidators()) {
if (!validator.validateTransaction(currency, currencyParams.getTransactionData())) {
return currencyParams.getTransactionData();
}
}
// Apply user-key signature first if it exists.
if (currencyParams.getUserKey() != null && !currencyParams.getUserKey().isEmpty()) {
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(currencyParams.getTransactionData(),
currencyParams.getAccount().get(0), currencyParams.getUserKey()));
}
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(currencyParams.getTransactionData(),
currencyParams.getAccount().get(0)));
} else if (sendToRemotes) {
try {
CurrencyCommand command = new CurrencyCommand();
CurrencyParameters copyParams = convertParams(params);
// Don't want every server trying to sign with the user-key.
copyParams.setUserKey("");
command.setCurrencyParams(copyParams);
command.setCommandType(CurrencyCommandType.SIGN);
command =
CurrencyCommand.parseCommandString(Coordinator.broadcastCommand(command, server));
if (command != null) {
String originalTx = currencyParams.getTransactionData();
currencyParams.setTransactionData(command.getCurrencyParams().getTransactionData());
// If it's send-each and the remote actually signed it, send it.
if (!originalTx.equalsIgnoreCase(currencyParams.getTransactionData()) && currency
.getConfiguration().getSigningType().equals(SigningType.SENDEACH)) {
submitTransaction(Json.stringifyObject(CurrencyParameters.class, currencyParams));
}
}
} catch (Exception e) {
// Likely caused by an offline server or bad response.
LOGGER.warn(null, e);
}
}
}
String response = currencyParams.getTransactionData();
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Submits a transaction for processing on the network.
*
* @param params {@link CurrencyParameters} with the currency and transaction data filled in. The
* transaction data required is the result from the approveTransaction stage.
* @return The transaction hash/ID.
*/
public static String submitTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String response = currency.getWallet().sendTransaction(currencyParams.getTransactionData());
LOGGER.debug("[Response] " + response);
return response;
}
}
| cosigner-core/src/main/java/io/emax/cosigner/core/currency/Common.java | package io.emax.cosigner.core.currency;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.emax.cosigner.api.core.CurrencyPackage;
import io.emax.cosigner.api.core.CurrencyParameters;
import io.emax.cosigner.api.core.CurrencyParametersRecipient;
import io.emax.cosigner.api.core.Server;
import io.emax.cosigner.api.currency.Monitor;
import io.emax.cosigner.api.currency.SigningType;
import io.emax.cosigner.api.currency.Wallet.Recipient;
import io.emax.cosigner.api.currency.Wallet.TransactionDetails;
import io.emax.cosigner.api.validation.Validator;
import io.emax.cosigner.common.Json;
import io.emax.cosigner.core.CosignerApplication;
import io.emax.cosigner.core.cluster.ClusterInfo;
import io.emax.cosigner.core.cluster.Coordinator;
import io.emax.cosigner.core.cluster.commands.CurrencyCommand;
import io.emax.cosigner.core.cluster.commands.CurrencyCommandType;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;
import org.eclipse.jetty.websocket.api.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Subscription;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class Common {
private static final Logger LOGGER = LoggerFactory.getLogger(Common.class);
private static final HashMap<String, Subscription> balanceSubscriptions = new HashMap<>();
private static final HashMap<String, Subscription> transactionSubscriptions = new HashMap<>();
private static final HashMap<String, Monitor> monitors = new HashMap<>();
private static CurrencyParameters convertParams(String params) {
try {
JsonFactory jsonFact = new JsonFactory();
JsonParser jsonParser = jsonFact.createParser(params);
CurrencyParameters currencyParams =
new ObjectMapper().readValue(jsonParser, CurrencyParameters.class);
String userKey = currencyParams.getUserKey();
currencyParams.setUserKey("");
String sanitizedParams = Json.stringifyObject(CurrencyParameters.class, currencyParams);
currencyParams.setUserKey(userKey);
LOGGER.debug("[CurrencyParams] " + sanitizedParams);
return currencyParams;
} catch (IOException e) {
LOGGER.warn(null, e);
return null;
}
}
/**
* Lookup the currency package declared in the parameters.
*/
public static CurrencyPackage lookupCurrency(CurrencyParameters params) {
if (CosignerApplication.getCurrencies().containsKey(params.getCurrencySymbol())) {
return CosignerApplication.getCurrencies().get(params.getCurrencySymbol());
} else {
return null;
}
}
/**
* List all currencies that are currently loaded in cosigner.
*
* @return String list of currencies.
*/
public static String listCurrencies() {
List<String> currencies = new LinkedList<>();
CosignerApplication.getCurrencies().keySet().forEach(currencies::add);
String currencyString = Json.stringifyObject(LinkedList.class, currencies);
LOGGER.debug("[Response] " + currencyString);
return currencyString;
}
/**
* Registers addresses for currency libraries that need a watch list.
*/
public static String registerAddress(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
HashMap<String, Boolean> responses = new HashMap<>();
currencyParams.getAccount().forEach(address -> {
Boolean result = currency.getWallet().registerAddress(address);
responses.put(address, result);
});
String response = Json.stringifyObject(HashMap.class, responses);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Get a new address for the provided currency & user key.
*
* @param params {@link CurrencyParameters} with the currency code and user key filled in.
* @return Address that the user can use to deposit funds, for which we can generate the private
* keys.
*/
public static String getNewAddress(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String userAccount = currency.getWallet().createAddress(currencyParams.getUserKey());
LinkedList<String> accounts = new LinkedList<>();
if (currencyParams.getAccount() != null) {
accounts.addAll(currencyParams.getAccount());
}
accounts.add(userAccount);
String response =
currency.getWallet().getMultiSigAddress(accounts, currencyParams.getUserKey());
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Generates a currency-specific address from a public key.
*/
public static String generateAddressFromKey(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String publicKey = currencyParams.getUserKey();
String publicAddress = currency.getWallet().createAddressFromKey(publicKey, false);
LOGGER.debug("[Response] " + publicAddress);
return publicAddress;
}
/**
* List all addresses that we have generated for the given user key and currency.
*
* @param params {@link CurrencyParameters} with the currency code and user key filled in.
* @return All addresses that cosigner can generate the private key for belonging to that user
* key.
*/
public static String listAllAddresses(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
LinkedList<String> accounts = new LinkedList<>();
currency.getWallet().getAddresses(currencyParams.getUserKey()).forEach(accounts::add);
String response = Json.stringifyObject(LinkedList.class, accounts);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* List transactions for the given address and currency.
*
* <p>Will only return data for addresses that belong to cosigner.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled in.
* @return List of transactions that affect each account.
*/
public static String listTransactions(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
LinkedList<TransactionDetails> txDetails = new LinkedList<>();
currencyParams.getAccount().forEach(account -> txDetails
.addAll(Arrays.asList(currency.getWallet().getTransactions(account, 100, 0))));
String response = Json.stringifyObject(LinkedList.class, txDetails);
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Returns the combined balance of all addresses provided in the parameters.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled in.
* @return Sum of all balances for the provided addresses.
*/
public static String getBalance(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
BigDecimal balance = BigDecimal.ZERO;
if (currencyParams.getAccount() == null || currencyParams.getAccount().isEmpty()) {
for (String account : currency.getWallet().getAddresses(currencyParams.getUserKey())) {
balance = balance.add(new BigDecimal(currency.getWallet().getBalance(account)));
}
} else {
for (String account : currencyParams.getAccount()) {
balance = balance.add(new BigDecimal(currency.getWallet().getBalance(account)));
}
}
String response = balance.toPlainString();
LOGGER.debug("[Response] " + response);
return response;
}
private static void cleanUpSubscriptions(String id) {
if (balanceSubscriptions.containsKey(id)) {
balanceSubscriptions.get(id).unsubscribe();
balanceSubscriptions.remove(id);
}
if (transactionSubscriptions.containsKey(id)) {
transactionSubscriptions.get(id).unsubscribe();
transactionSubscriptions.remove(id);
}
if (monitors.containsKey(id)) {
monitors.get(id).destroyMonitor();
monitors.remove(id);
}
}
/**
* Sets up a monitor for the given addresses.
*
* <p>A monitor provides periodic balance updates, along with all known transactions when
* initialized, and any new transactions that come in while it's active. Transactions can be
* distinguished from balance updates in that the transaction data portion of the response has
* data, it contains the transaction hash.
*
* @param params {@link CurrencyParameters} with the currency code and addresses filled
* in. If using a REST callback, the callback needs to be filled in as
* well.
* @param responseSocket If this has been called using a web socket, pass the socket in here and
* the data will be written to is as it's available.
* @return An empty {@link CurrencyParameters} object is returned when the monitor is set up. The
* actual data is sent through the socket or callback.
*/
public static String monitorBalance(String params, Session responseSocket) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
Monitor monitor = currency.getMonitor().createNewMonitor();
monitor.addAddresses(currencyParams.getAccount());
CurrencyParameters returnParms = new CurrencyParameters();
String response = Json.stringifyObject(CurrencyParameters.class, returnParms);
// Web socket was passed to us
if (responseSocket != null) {
cleanUpSubscriptions(responseSocket.toString());
Subscription wsBalanceSubscription = monitor.getObservableBalances().subscribe(balanceMap -> {
balanceMap.forEach((address, balance) -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().add(address);
CurrencyParametersRecipient accountData = new CurrencyParametersRecipient();
accountData.setAmount(balance);
accountData.setRecipientAddress(address);
responseParms.setReceivingAccount(Collections.singletonList(accountData));
LOGGER.debug("Sending balance update...");
responseSocket.getRemote()
.sendString(Json.stringifyObject(CurrencyParameters.class, responseParms));
responseSocket.getRemote().flush();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(responseSocket.toString());
}
});
});
balanceSubscriptions.put(responseSocket.toString(), wsBalanceSubscription);
Subscription wsTransactionSubscription =
monitor.getObservableTransactions().subscribe(transactionSet -> {
transactionSet.forEach(transaction -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().addAll(Arrays.asList(transaction.getFromAddress()));
LinkedList<CurrencyParametersRecipient> receivers = new LinkedList<>();
Arrays.asList(transaction.getToAddress()).forEach(address -> {
CurrencyParametersRecipient sendData = new CurrencyParametersRecipient();
sendData.setAmount(transaction.getAmount().toPlainString());
sendData.setRecipientAddress(address);
receivers.add(sendData);
});
responseParms.setReceivingAccount(receivers);
responseParms.setTransactionData(transaction.getTxHash());
responseSocket.getRemote()
.sendString(Json.stringifyObject(CurrencyParameters.class, responseParms));
responseSocket.getRemote().flush();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(responseSocket.toString());
}
});
});
transactionSubscriptions.put(responseSocket.toString(), wsTransactionSubscription);
monitors.put(responseSocket.toString(), monitor);
} else if (currencyParams.getCallback() != null && !currencyParams.getCallback().isEmpty()) {
// It's a REST callback
cleanUpSubscriptions(currencyParams.getCallback());
Subscription rsBalanceSubscription = monitor.getObservableBalances().subscribe(balanceMap -> {
balanceMap.forEach((address, balance) -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().add(address);
CurrencyParametersRecipient accountData = new CurrencyParametersRecipient();
accountData.setAmount(balance);
accountData.setRecipientAddress(address);
responseParms.setReceivingAccount(Collections.singletonList(accountData));
HttpPost httpPost = new HttpPost(currencyParams.getCallback());
httpPost.addHeader("content-type", "application/json");
StringEntity entity;
entity =
new StringEntity(Json.stringifyObject(CurrencyParameters.class, responseParms));
httpPost.setEntity(entity);
HttpClients.createDefault().execute(httpPost).close();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(currencyParams.getCallback());
}
});
});
balanceSubscriptions.put(currencyParams.getCallback(), rsBalanceSubscription);
Subscription rsTransactionSubscription =
monitor.getObservableTransactions().subscribe(transactionSet -> {
transactionSet.forEach(transaction -> {
try {
CurrencyParameters responseParms = new CurrencyParameters();
responseParms.setAccount(new LinkedList<>());
responseParms.getAccount().addAll(Arrays.asList(transaction.getFromAddress()));
LinkedList<CurrencyParametersRecipient> receivers = new LinkedList<>();
Arrays.asList(transaction.getToAddress()).forEach(address -> {
CurrencyParametersRecipient sendData = new CurrencyParametersRecipient();
sendData.setAmount(transaction.getAmount().toPlainString());
sendData.setRecipientAddress(address);
receivers.add(sendData);
});
responseParms.setReceivingAccount(receivers);
responseParms.setTransactionData(transaction.getTxHash());
HttpPost httpPost = new HttpPost(currencyParams.getCallback());
httpPost.addHeader("content-type", "application/json");
StringEntity entity;
entity =
new StringEntity(Json.stringifyObject(CurrencyParameters.class, responseParms));
httpPost.setEntity(entity);
HttpClients.createDefault().execute(httpPost).close();
} catch (Exception e) {
LOGGER.debug(null, e);
cleanUpSubscriptions(currencyParams.getCallback());
}
});
});
transactionSubscriptions.put(currencyParams.getCallback(), rsTransactionSubscription);
monitors.put(currencyParams.getCallback(), monitor);
} else {
// We have no way to respond to the caller other than with this response.
monitor.destroyMonitor();
}
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Create and sign a transaction.
*
* <p>This only signs the transaction with the user's key, showing that the user has requested the
* transaction. The server keys are not used until the approve stage.
*
* @param params {@link CurrencyParameters} with the currency code, user key, senders, recipients
* and amounts filled in.
* @return The transaction string that was requested.
*/
public static String prepareTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
// Create the transaction
List<String> addresses = new LinkedList<>();
addresses.addAll(currencyParams.getAccount());
LinkedList<Recipient> recipients = new LinkedList<>();
currencyParams.getReceivingAccount().forEach(account -> {
Recipient recipient = new Recipient();
recipient.setAmount(new BigDecimal(account.getAmount()));
recipient.setRecipientAddress(account.getRecipientAddress());
recipients.add(recipient);
});
currencyParams
.setTransactionData(currency.getWallet().createTransaction(addresses, recipients));
// Authorize it with the user account
String initalTx = currencyParams.getTransactionData();
LOGGER.debug("Wallet.CreateTransaction Result: " + initalTx);
if (currencyParams.getUserKey() != null && !currencyParams.getUserKey().isEmpty()) {
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(initalTx, currencyParams.getAccount().get(0),
currencyParams.getUserKey()));
LOGGER.debug("Sign with userKey: " + currencyParams.getTransactionData());
}
// If the userKey/address combo don't work then we stop here.
if (currencyParams.getTransactionData().equalsIgnoreCase(initalTx)) {
LOGGER.debug("No userKey signature, returning unsigned TX: " + initalTx);
return initalTx;
}
// Try to validate it, don't sign if it fails.
for (Validator validator : CosignerApplication.getValidators()) {
if (!validator.validateTransaction(currency, currencyParams.getTransactionData())) {
return initalTx;
}
}
// Send it if it's a sign-each and there's more than one signature
// required (we're at 1/X)
if (currency.getConfiguration().getMinSignatures() > 1 && currency.getConfiguration()
.getSigningType().equals(SigningType.SENDEACH)) {
submitTransaction(Json.stringifyObject(CurrencyParameters.class, currencyParams));
}
String response = currencyParams.getTransactionData();
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Get list of addresses that could sign this transaction.
*/
public static String getSignersForTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
Iterable<String> signers =
currency.getWallet().getSignersForTransaction(currencyParams.getTransactionData());
return Json.stringifyObject(Iterable.class, signers);
}
/**
* Get the data needed to create an offline signature for the transaction.
*/
public static String getSignatureString(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String address = "";
if (currencyParams.getAccount() != null && currencyParams.getAccount().size() > 0) {
address = currencyParams.getAccount().get(0);
}
Iterable<Iterable<String>> sigData =
currency.getWallet().getSigString(currencyParams.getTransactionData(), address);
return Json.stringifyObject(Iterable.class, sigData);
}
/**
* Apply an offline signature to a transaction.
*/
@SuppressWarnings("unchecked")
public static String applySignature(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String address = "";
if (currencyParams.getAccount() != null && currencyParams.getAccount().size() > 0) {
address = currencyParams.getAccount().get(0);
}
Iterator<String> txList = ((Iterable<String>) Json
.objectifyString(Iterable.class, currencyParams.getTransactionData())).iterator();
String tx = txList.next();
Iterable<Iterable<String>> sigData =
(Iterable<Iterable<String>>) Json.objectifyString(Iterable.class, txList.next());
return currency.getWallet().applySignature(tx, address, sigData);
}
/**
* Approve a transaction that's been signed off on by the user.
*
* <p>This stage signs the transaction with the server keys after running it through any sanity
* checks and validation required.
*
* @param params {@link CurrencyParameters} with the currency code, user key, senders,
* recipients and amounts filled in. The transaction data should be filled in
* with the response from prepareTransaction.
* @param sendToRemotes Indicates whether cosigner should attempt to request signature from any
* other cosigner servers in the cluster.
* @return Signed transaction string
*/
public static String approveTransaction(String params, boolean sendToRemotes) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
for (Server server : ClusterInfo.getInstance().getServers()) {
if (server.isOriginator()) { // It's us, try to sign it locally.
// But first check that it's valid.
for (Validator validator : CosignerApplication.getValidators()) {
if (!validator.validateTransaction(currency, currencyParams.getTransactionData())) {
return currencyParams.getTransactionData();
}
}
// Apply user-key signature first if it exists.
if (currencyParams.getUserKey() != null && !currencyParams.getUserKey().isEmpty()) {
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(currencyParams.getTransactionData(),
currencyParams.getAccount().get(0), currencyParams.getUserKey()));
}
currencyParams.setTransactionData(currency.getWallet()
.signTransaction(currencyParams.getTransactionData(),
currencyParams.getAccount().get(0)));
} else if (sendToRemotes) {
try {
CurrencyCommand command = new CurrencyCommand();
CurrencyParameters copyParams = convertParams(params);
// Don't want every server trying to sign with the user-key.
copyParams.setUserKey("");
command.setCurrencyParams(copyParams);
command.setCommandType(CurrencyCommandType.SIGN);
command =
CurrencyCommand.parseCommandString(Coordinator.broadcastCommand(command, server));
if (command != null) {
String originalTx = currencyParams.getTransactionData();
currencyParams.setTransactionData(command.getCurrencyParams().getTransactionData());
// If it's send-each and the remote actually signed it, send it.
if (!originalTx.equalsIgnoreCase(currencyParams.getTransactionData()) && currency
.getConfiguration().getSigningType().equals(SigningType.SENDEACH)) {
submitTransaction(Json.stringifyObject(CurrencyParameters.class, currencyParams));
}
}
} catch (Exception e) {
// Likely caused by an offline server or bad response.
LOGGER.warn(null, e);
}
}
}
String response = currencyParams.getTransactionData();
LOGGER.debug("[Response] " + response);
return response;
}
/**
* Submits a transaction for processing on the network.
*
* @param params {@link CurrencyParameters} with the currency and transaction data filled in. The
* transaction data required is the result from the approveTransaction stage.
* @return The transaction hash/ID.
*/
public static String submitTransaction(String params) {
CurrencyParameters currencyParams = convertParams(params);
CurrencyPackage currency = lookupCurrency(currencyParams);
String response = currency.getWallet().sendTransaction(currencyParams.getTransactionData());
LOGGER.debug("[Response] " + response);
return response;
}
}
| Adding prepare to be called multiple times to apply multiple user keys.
| cosigner-core/src/main/java/io/emax/cosigner/core/currency/Common.java | Adding prepare to be called multiple times to apply multiple user keys. | <ide><path>osigner-core/src/main/java/io/emax/cosigner/core/currency/Common.java
<ide>
<ide> CurrencyPackage currency = lookupCurrency(currencyParams);
<ide>
<del> // Create the transaction
<del> List<String> addresses = new LinkedList<>();
<del> addresses.addAll(currencyParams.getAccount());
<del> LinkedList<Recipient> recipients = new LinkedList<>();
<del> currencyParams.getReceivingAccount().forEach(account -> {
<del> Recipient recipient = new Recipient();
<del> recipient.setAmount(new BigDecimal(account.getAmount()));
<del> recipient.setRecipientAddress(account.getRecipientAddress());
<del> recipients.add(recipient);
<del> });
<del> currencyParams
<del> .setTransactionData(currency.getWallet().createTransaction(addresses, recipients));
<add> if (currencyParams.getTransactionData() == null || currencyParams.getTransactionData()
<add> .isEmpty()) {
<add> // Create the transaction
<add> List<String> addresses = new LinkedList<>();
<add> addresses.addAll(currencyParams.getAccount());
<add> LinkedList<Recipient> recipients = new LinkedList<>();
<add> currencyParams.getReceivingAccount().forEach(account -> {
<add> Recipient recipient = new Recipient();
<add> recipient.setAmount(new BigDecimal(account.getAmount()));
<add> recipient.setRecipientAddress(account.getRecipientAddress());
<add> recipients.add(recipient);
<add> });
<add> currencyParams
<add> .setTransactionData(currency.getWallet().createTransaction(addresses, recipients));
<add> }
<ide>
<ide> // Authorize it with the user account
<ide> String initalTx = currencyParams.getTransactionData(); |
|
JavaScript | mit | 3e11b6b0299f00c897732ce4bfd1f89cc3fa3a64 | 0 | froatsnook/meteor-shopify,froatsnook/meteor-shopify | Shopify = { };
Shopify._IsNonEmptyString = Match.Where(function(x) {
check(x, String);
return x.length > 0;
});
// Load ShopifyApp from Shopify's CDN. It must be initialized by calling
// ShopifyApp.init.
//
// @param callback(err, ShopifyAPI) {Function} Called on success or failure. Optional on server.
Shopify.getEmbeddedAppAPI = function(callback) {
var url = "https://cdn.shopify.com/s/assets/external/app.js";
if (callback) {
HTTP.get(url, function(err, res) {
if (err) {
callback(err);
return;
}
if (res.statusCode !== 200) {
callback("Request failed: " + res.statusCode, null);
return;
}
eval(res.content);
callback(null, this.ShopifyApp);
});
} else if (!Meteor.isServer) {
throw new Error("Invalid usage: must provide callback on client");
} else {
var res = HTTP.get(url);
if (res.statusCode !== 200) {
throw new Error("Failed to load ShopifyAPI");
}
eval(res.content);
return this.ShopifyApp;
}
};
| lib/01-shopify.js | Shopify = { };
Shopify._IsNonEmptyString = Match.Where(function(x) {
check(x, String);
return x.length > 0;
});
| Add Shopify.getEmbeddedAppAPI.
| lib/01-shopify.js | Add Shopify.getEmbeddedAppAPI. | <ide><path>ib/01-shopify.js
<ide> return x.length > 0;
<ide> });
<ide>
<add>// Load ShopifyApp from Shopify's CDN. It must be initialized by calling
<add>// ShopifyApp.init.
<add>//
<add>// @param callback(err, ShopifyAPI) {Function} Called on success or failure. Optional on server.
<add>Shopify.getEmbeddedAppAPI = function(callback) {
<add> var url = "https://cdn.shopify.com/s/assets/external/app.js";
<add>
<add> if (callback) {
<add> HTTP.get(url, function(err, res) {
<add> if (err) {
<add> callback(err);
<add> return;
<add> }
<add>
<add> if (res.statusCode !== 200) {
<add> callback("Request failed: " + res.statusCode, null);
<add> return;
<add> }
<add>
<add> eval(res.content);
<add> callback(null, this.ShopifyApp);
<add> });
<add>
<add> } else if (!Meteor.isServer) {
<add> throw new Error("Invalid usage: must provide callback on client");
<add> } else {
<add> var res = HTTP.get(url);
<add> if (res.statusCode !== 200) {
<add> throw new Error("Failed to load ShopifyAPI");
<add> }
<add>
<add> eval(res.content);
<add> return this.ShopifyApp;
<add> }
<add>};
<add> |
|
Java | apache-2.0 | 328ba3516ea2d13d78ed3bdace8d33dd11b328a7 | 0 | brandt/GridSphere,brandt/GridSphere | /*
* @author <a href="mailto:[email protected]">Jason Novotny</a>
* @version $Id$
*/
package org.gridlab.gridsphere.portlet;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.util.Enumeration;
/**
* The abstract PortletInfo is used by the portlet container to invoke the portlet.
* Every portlet has to implement this abstract class, either by deriving directly from it,
* or by using one of the abstract portlet implementations.
*
* A portlet is a small Java program that runs within a portlet container.
* Portlets receive and respond to requests from the portlet container.
* There is ever only one portlet object instance per portlet configuration in the web deployment descriptor.
* There may be many PortletSettings objects parameterisng the same portlet object according to the
* Flyweight pattern, provided on a per-request basis. A concrete parameterization of a portlet object
* is referred to as a concrete portlet. The settings of concrete portlets may change at any time caused
* by administrators modifying portlet settings, e.g. using the config mode of a portlet.
*
* Additionally, user can have personal views of concrete portlets. Therefore, the transient portlet session
* and persistent concrete portlet data carries vital information for the portlet to create a personalized
* user experience. A concrete portlet in conjunction with portlet data creates a concrete portlet instance.
* This is similar to why a servlet may not store things depending on requests or sessions in instance variables.
* As a consequence, the portlet should not attempt to store any data that depends on portlet settings,
* portlet data or the portlet session or any other user-related information as instance or class variables.
* The general programming rules for servlets also apply to portlets - instance variables should only used
* when the intent is to share them between all the parallel threads that concurrently execute a portlet, and
* portlet code should avoid synchronization unless absolutely required.
*
* As part of running within the portlet container each portlet has a life-cycle.
* The corresponding methods are called in the following sequence:
*
* 1. The portlet is constructed, then initialized with the init() method.
* 2. A concrete portlet s initialized with the initConcrete() method for each PortletSettings.
* 3. Any calls from the portlet container to the service() method are handled.
* 4. The concrete portlet is taken out of service with the destroyConcrete() method.
* 5. The portlet is taken out of service, then destroyed with the destroy() method,
* then garbage collected and finalized.
*
* The concrete portlet instance is created and destroyed with the login() and logout() methods, respectively.
* If a portlet provides personalized views these methods should be implemented.
*
* The portlet container loads and instantiates the portlet class.
* This can happen during startup of the portal server or later,
* but no later then when the first request to the portlet has to be serviced.
* Also, if a portlet is taken out of service temporarily, for example while administrating it,
* the portlet container may finish the life-cycle before taking the portlet out of service.
* When the administration is done, the portlet will be newly initialized.
*/
public abstract class Portlet extends HttpServlet
implements Servlet, ServletConfig, java.io.Serializable, PortletSessionListener {
protected transient static PortletLog log = org.gridlab.gridsphere.portlet.impl.SportletLog.getInstance(Portlet.class);
protected PortletConfig portletConfig = null;
protected PortletSettings portletSettings = null;
//protected Cacheable cacheable = null;
//private PortletRegistryService registryService = null;
private String registeryID = null;
public static class Mode implements Serializable {
protected static final int VIEW_MODE = 0;
protected static final int EDIT_MODE = 1;
protected static final int HELP_MODE = 2;
protected static final int CONFIGURE_MODE = 3;
public static final Mode EDIT = new Mode(EDIT_MODE);
public static final Mode VIEW = new Mode(VIEW_MODE);
public static final Mode HELP = new Mode(HELP_MODE);
public static final Mode CONFIGURE = new Mode(CONFIGURE_MODE);
private int mode = VIEW_MODE;
private Mode(int mode) {
this.mode = mode;
}
public static Portlet.Mode getInstance(String mode) {
if (mode.equals(EDIT.toString())) {
return EDIT;
} else if (mode.equals(VIEW.toString())) {
return VIEW;
} else if (mode.equals(HELP.toString())) {
return HELP;
} else if (mode.equals(CONFIGURE.toString())) {
return CONFIGURE;
}
return null;
}
public int getMode() {
return mode;
}
public Object readResolve() {
// XXX: FILL ME IN
return null;
}
public String toString() {
String tagstring;
if (mode == EDIT_MODE) {
tagstring = "EDIT";
} else if (mode == HELP_MODE) {
tagstring = "HELP";
} else if (mode == CONFIGURE_MODE) {
tagstring = "CONFIGURE";
} else {
tagstring = "VIEW";
}
return tagstring;
}
}
public static class ModeModifier implements Serializable {
public static final int CURRENT_MODE = 0;
public static final int PREVIOUS_MODE = 1;
public static final int REQUESTED_MODE = 2;
public static final ModeModifier CURRENT = new ModeModifier(CURRENT_MODE);
public static final ModeModifier PREVIOUS = new ModeModifier(PREVIOUS_MODE);
public static final ModeModifier REQUESTED = new ModeModifier(REQUESTED_MODE);
private int modifier = CURRENT_MODE;
private ModeModifier(int modifier) {
this.modifier = modifier;
}
public int getId() {
return modifier;
}
public Object readResolve() {
// XXX: FILL ME IN
return null;
}
public String toString() {
String tagstring;
if (modifier == PREVIOUS_MODE) {
tagstring = "PREVIOUS";
} else if (modifier == REQUESTED_MODE) {
tagstring = "REQUESTED";
} else {
tagstring = "CURRENT";
}
return tagstring;
}
}
public Portlet() {
}
/**
* Called by the portlet container to indicate to this portlet that it is put into service.
*
* The portlet container calls the init() method for the whole life-cycle of the portlet.
* The init() method must complete successfully before concrete portlets are created through
* the initConcrete() method.
*
* The portlet container cannot place the portlet into service if the init() method
*
* 1. throws UnavailableException
* 2. does not return within a time period defined by the portlet container.
*
* @param config the portlet configuration
* @throws UnavailableException if an exception has occurrred that interferes with the portlet's
* normal initialization
*/
public abstract void init(PortletConfig config) throws UnavailableException;
/**
* Called by the portlet container to indicate to this portlet that it is taken out of service.
* This method is only called once all threads within the portlet's service() method have exited
* or after a timeout period has passed. After the portlet container calls this method,
* it will not call the service() method again on this portlet.
*
* This method gives the portlet an opportunity to clean up any resources that are
* being held (for example, memory, file handles, threads).
*
* @param config the portlet configuration
*/
public abstract void destroy(PortletConfig config);
/**
* Called by the portlet container to indicate that the concrete portlet is put into service.
* The portlet container calls the initConcrete() method for the whole life-cycle of the portlet.
* The initConcrete() method must complete successfully before concrete portlet instances can be
* created through the login() method.
*
* The portlet container cannot place the portlet into service if the initConcrete() method
*
* 1. throws UnavailableException
* 2. does not return within a time period defined by the portlet container.
*
* @param settings the portlet settings
*/
public abstract void initConcrete(PortletSettings settings) throws UnavailableException;
/**
* Called by the portlet container to indicate that the concrete portlet is taken out of service.
* This method is only called once all threads within the portlet's service() method have exited
* or after a timeout period has passed. After the portlet container calls this method,
* it will not call the service() method again on this portlet.
*
* This method gives the portlet an opportunity to clean up any resources that are being
* held (for example, memory, file handles, threads).
*
* @param settings the portlet settings
*/
public abstract void destroyConcrete(PortletSettings settings);
/**
* Called by the portlet container to ask this portlet to generate its markup using the given
* request/response pair. Depending on the mode of the portlet and the requesting client device,
* the markup will be different. Also, the portlet can take language preferences and/or
* personalized settings into account.
*
* @param request the portlet request
* @param response the portlet response
*
* @throws PortletException if the portlet has trouble fulfilling the rendering request
* @throws IOException if the streaming causes an I/O problem
*/
public abstract void service(PortletRequest request, PortletResponse response)
throws PortletException, IOException;
/**
* Description copied from interface: PortletSessionListener
* Called by the portlet container to ask the portlet to initialize a personalized user experience.
* In addition to initializing the session this method allows the portlet to initialize the
* concrete portlet instance, for example, to store attributes in the session.
*
* @param request the portlet request
*/
public abstract void login(PortletRequest request);
/**
* Description copied from interface: PortletSessionListener
* Called by the portlet container to indicate that a concrete portlet instance is being removed.
* This method gives the concrete portlet instance an opportunity to clean up any resources
* (for example, memory, file handles, threads), before it is removed.
* This happens if the user logs out, or decides to remove this portlet from a page.
*
* @param session the portlet session
*/
public abstract void logout(PortletSession session);
/**
* Returns the time the response of the PortletInfo object was last modified, in milliseconds since midnight
* January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default).
*
* Portlets that can quickly determine their last modification time should override this method.
* This makes browser and proxy caches work more effectively, reducing the load on server and network resources.
*
* @param request the portlet request
* @return long a long integer specifying the time the response of the PortletInfo
* object was last modified, in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is not known
*/
public abstract long getLastModified(PortletRequest request);
/**
* Returns the PortletConfig object of the portlet
*
* @return the PortletConfig object
*/
protected abstract PortletConfig getPortletConfig();
/**
* Returns the PortletSettings object of the concrete portlet.
*
* @return the PortletSettings object, or NULL if no PortletSettings object is available.
*/
protected PortletSettings getPortletSettings() {
return this.portletSettings;
}
/**
* Initializes the PortletConfig using the web.xml file entry for this portlet
*/
public final void init(ServletConfig config) throws ServletException {
super.init(config);
log.info("in init(ServletConfig)");
/*
portletConfig = new SportletConfig(config);
PortletContext context = portletConfig.getContext();
PortletRegistryService registryService = (PortletRegistryService)context.getService(PortletRegistryService.class);
AccessControlService aclService = (AccessControlService)context.getService(AccessControlService.class);
*/
//registryService.registerPortletConfig(portletConfig);
/*
This will register the portlet (servlet) with the registry service on startup.
I took this path initially thinking I could forward to remote third-party
portlets outside of gridsphere.jar and provide their context to the registry
service too. Now I've moved this to GridSphere.java so the portlet container
controls the entire loading and initialization/shutdown of the portlets.
And whaddya know-- I started it up again trying to be compatible with WPS portlet API
in that the PortletConfig must contain the Initparameters defined in the web.xml for this portlet class
Also thinking more about portlets as autonomous units-- decouple gridsphere.jar from portlets such that
one can reload portlet components-- need to find switch to enable "smarter" jar reloading in Tomcat
*/
/*
String concreteID = config.getInitParameter(GridSphereProperties.ID);
PortletDeploymentDescriptor pdd = null;
try {
pdd = new PortletDeploymentDescriptor(config);
} catch (IOException e) {
throw new ServletException("Unable to deserialize portlet.xml: ", e);
}
ConcretePortletApplication concreteApp = pdd.getConcretePortletApplication(concreteID);
PortletApplication portletApp = pdd.getPortletApplication(concreteID);
ConcretePortlet concretePortlet = new ConcreteSportlet(pdd, portletApp, concreteApp, aclService);
// create sportlet settings that is not modifiable initially
portletSettings = concretePortlet.getPortletSettings(false);
cacheable = concretePortlet.getCacheablePortletInfo();
context = concretePortlet.getPortletConfig().getContext();
registryService = (PortletRegistryService)context.getService(PortletRegistryService.class);
registeryID = registryService.registerPortlet(concretePortlet);
*/
}
public final void init() throws ServletException {
super.init();
}
public final ServletConfig getServletConfig() {
return super.getServletConfig();
}
public final String getInitParameter(String name) {
return super.getInitParameter(name);
}
public final Enumeration getInitParameterNames() {
return super.getInitParameterNames();
}
public final ServletContext getServletContext() {
return super.getServletContext();
}
protected long getLastModified(HttpServletRequest req) {
return super.getLastModified(req);
}
public String getServletInfo() {
return super.getServletInfo();
}
public final void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
log.info("in service(ServletRequest, ServletResponse) of Portlet");
// make cacheable
// serve cached portlet output
//if (cacheable.getExpiration() < 0) {
//}
// redirect to GridSphere
}
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// redirect to gridsphere
}
protected void doPut(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doPut(req, resp);
}
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doPost(req, resp);
}
protected void doTrace(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doTrace(req, resp);
}
protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doDelete(req, resp);
}
public final void destroy() {
super.destroy();
//registryService.unregisterPortlet(registeryID);
}
}
| src/org/gridlab/gridsphere/portlet/Portlet.java | /*
* @author <a href="mailto:[email protected]">Jason Novotny</a>
* @version $Id$
*/
package org.gridlab.gridsphere.portlet;
import org.gridlab.gridsphere.portletcontainer.impl.ConcreteSportlet;
import org.gridlab.gridsphere.portletcontainer.ConcretePortlet;
import org.gridlab.gridsphere.portletcontainer.GridSphereProperties;
import org.gridlab.gridsphere.portletcontainer.descriptor.ConcretePortletApplication;
import org.gridlab.gridsphere.portletcontainer.descriptor.PortletDeploymentDescriptor;
import org.gridlab.gridsphere.portletcontainer.descriptor.PortletApplication;
import org.gridlab.gridsphere.portlet.impl.SportletConfig;
import org.gridlab.gridsphere.services.container.registry.PortletRegistryService;
import org.gridlab.gridsphere.services.security.acl.AccessControlService;
import org.gridlab.gridsphere.core.persistence.PersistenceException;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.util.Enumeration;
/**
* The abstract PortletInfo is used by the portlet container to invoke the portlet.
* Every portlet has to implement this abstract class, either by deriving directly from it,
* or by using one of the abstract portlet implementations.
*
* A portlet is a small Java program that runs within a portlet container.
* Portlets receive and respond to requests from the portlet container.
* There is ever only one portlet object instance per portlet configuration in the web deployment descriptor.
* There may be many PortletSettings objects parameterisng the same portlet object according to the
* Flyweight pattern, provided on a per-request basis. A concrete parameterization of a portlet object
* is referred to as a concrete portlet. The settings of concrete portlets may change at any time caused
* by administrators modifying portlet settings, e.g. using the config mode of a portlet.
*
* Additionally, user can have personal views of concrete portlets. Therefore, the transient portlet session
* and persistent concrete portlet data carries vital information for the portlet to create a personalized
* user experience. A concrete portlet in conjunction with portlet data creates a concrete portlet instance.
* This is similar to why a servlet may not store things depending on requests or sessions in instance variables.
* As a consequence, the portlet should not attempt to store any data that depends on portlet settings,
* portlet data or the portlet session or any other user-related information as instance or class variables.
* The general programming rules for servlets also apply to portlets - instance variables should only used
* when the intent is to share them between all the parallel threads that concurrently execute a portlet, and
* portlet code should avoid synchronization unless absolutely required.
*
* As part of running within the portlet container each portlet has a life-cycle.
* The corresponding methods are called in the following sequence:
*
* 1. The portlet is constructed, then initialized with the init() method.
* 2. A concrete portlet s initialized with the initConcrete() method for each PortletSettings.
* 3. Any calls from the portlet container to the service() method are handled.
* 4. The concrete portlet is taken out of service with the destroyConcrete() method.
* 5. The portlet is taken out of service, then destroyed with the destroy() method,
* then garbage collected and finalized.
*
* The concrete portlet instance is created and destroyed with the login() and logout() methods, respectively.
* If a portlet provides personalized views these methods should be implemented.
*
* The portlet container loads and instantiates the portlet class.
* This can happen during startup of the portal server or later,
* but no later then when the first request to the portlet has to be serviced.
* Also, if a portlet is taken out of service temporarily, for example while administrating it,
* the portlet container may finish the life-cycle before taking the portlet out of service.
* When the administration is done, the portlet will be newly initialized.
*/
public abstract class Portlet extends HttpServlet
implements Servlet, ServletConfig, java.io.Serializable, PortletSessionListener {
protected transient static PortletLog log = org.gridlab.gridsphere.portlet.impl.SportletLog.getInstance(Portlet.class);
protected PortletConfig portletConfig = null;
protected PortletSettings portletSettings = null;
private PortletRegistryService registryService = null;
private String registeryID = null;
public static class Mode implements Serializable {
protected static final int VIEW_MODE = 0;
protected static final int EDIT_MODE = 1;
protected static final int HELP_MODE = 2;
protected static final int CONFIGURE_MODE = 3;
public static final Mode EDIT = new Mode(EDIT_MODE);
public static final Mode VIEW = new Mode(VIEW_MODE);
public static final Mode HELP = new Mode(HELP_MODE);
public static final Mode CONFIGURE = new Mode(CONFIGURE_MODE);
private int mode = VIEW_MODE;
private Mode(int mode) {
this.mode = mode;
}
public static Portlet.Mode getInstance(String mode) {
if (mode.equals(EDIT.toString())) {
return EDIT;
} else if (mode.equals(VIEW.toString())) {
return VIEW;
} else if (mode.equals(HELP.toString())) {
return HELP;
} else if (mode.equals(CONFIGURE.toString())) {
return CONFIGURE;
}
return null;
}
public int getMode() {
return mode;
}
public Object readResolve() {
// XXX: FILL ME IN
return null;
}
public String toString() {
String tagstring;
if (mode == EDIT_MODE) {
tagstring = "EDIT";
} else if (mode == HELP_MODE) {
tagstring = "HELP";
} else if (mode == CONFIGURE_MODE) {
tagstring = "CONFIGURE";
} else {
tagstring = "VIEW";
}
return tagstring;
}
}
public static class ModeModifier implements Serializable {
public static final int CURRENT_MODE = 0;
public static final int PREVIOUS_MODE = 1;
public static final int REQUESTED_MODE = 2;
public static final ModeModifier CURRENT = new ModeModifier(CURRENT_MODE);
public static final ModeModifier PREVIOUS = new ModeModifier(PREVIOUS_MODE);
public static final ModeModifier REQUESTED = new ModeModifier(REQUESTED_MODE);
private int modifier = CURRENT_MODE;
private ModeModifier(int modifier) {
this.modifier = modifier;
}
public int getId() {
return modifier;
}
public Object readResolve() {
// XXX: FILL ME IN
return null;
}
public String toString() {
String tagstring;
if (modifier == PREVIOUS_MODE) {
tagstring = "PREVIOUS";
} else if (modifier == REQUESTED_MODE) {
tagstring = "REQUESTED";
} else {
tagstring = "CURRENT";
}
return tagstring;
}
}
public Portlet() {
}
/**
* Called by the portlet container to indicate to this portlet that it is put into service.
*
* The portlet container calls the init() method for the whole life-cycle of the portlet.
* The init() method must complete successfully before concrete portlets are created through
* the initConcrete() method.
*
* The portlet container cannot place the portlet into service if the init() method
*
* 1. throws UnavailableException
* 2. does not return within a time period defined by the portlet container.
*
* @param config the portlet configuration
* @throws UnavailableException if an exception has occurrred that interferes with the portlet's
* normal initialization
*/
public abstract void init(PortletConfig config) throws UnavailableException;
/**
* Called by the portlet container to indicate to this portlet that it is taken out of service.
* This method is only called once all threads within the portlet's service() method have exited
* or after a timeout period has passed. After the portlet container calls this method,
* it will not call the service() method again on this portlet.
*
* This method gives the portlet an opportunity to clean up any resources that are
* being held (for example, memory, file handles, threads).
*
* @param config the portlet configuration
*/
public abstract void destroy(PortletConfig config);
/**
* Called by the portlet container to indicate that the concrete portlet is put into service.
* The portlet container calls the initConcrete() method for the whole life-cycle of the portlet.
* The initConcrete() method must complete successfully before concrete portlet instances can be
* created through the login() method.
*
* The portlet container cannot place the portlet into service if the initConcrete() method
*
* 1. throws UnavailableException
* 2. does not return within a time period defined by the portlet container.
*
* @param settings the portlet settings
*/
public abstract void initConcrete(PortletSettings settings) throws UnavailableException;
/**
* Called by the portlet container to indicate that the concrete portlet is taken out of service.
* This method is only called once all threads within the portlet's service() method have exited
* or after a timeout period has passed. After the portlet container calls this method,
* it will not call the service() method again on this portlet.
*
* This method gives the portlet an opportunity to clean up any resources that are being
* held (for example, memory, file handles, threads).
*
* @param settings the portlet settings
*/
public abstract void destroyConcrete(PortletSettings settings);
/**
* Called by the portlet container to ask this portlet to generate its markup using the given
* request/response pair. Depending on the mode of the portlet and the requesting client device,
* the markup will be different. Also, the portlet can take language preferences and/or
* personalized settings into account.
*
* @param request the portlet request
* @param response the portlet response
*
* @throws PortletException if the portlet has trouble fulfilling the rendering request
* @throws IOException if the streaming causes an I/O problem
*/
public abstract void service(PortletRequest request, PortletResponse response)
throws PortletException, IOException;
/**
* Description copied from interface: PortletSessionListener
* Called by the portlet container to ask the portlet to initialize a personalized user experience.
* In addition to initializing the session this method allows the portlet to initialize the
* concrete portlet instance, for example, to store attributes in the session.
*
* @param request the portlet request
*/
public abstract void login(PortletRequest request);
/**
* Description copied from interface: PortletSessionListener
* Called by the portlet container to indicate that a concrete portlet instance is being removed.
* This method gives the concrete portlet instance an opportunity to clean up any resources
* (for example, memory, file handles, threads), before it is removed.
* This happens if the user logs out, or decides to remove this portlet from a page.
*
* @param session the portlet session
*/
public abstract void logout(PortletSession session);
/**
* Returns the time the response of the PortletInfo object was last modified, in milliseconds since midnight
* January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default).
*
* Portlets that can quickly determine their last modification time should override this method.
* This makes browser and proxy caches work more effectively, reducing the load on server and network resources.
*
* @param request the portlet request
* @return long a long integer specifying the time the response of the PortletInfo
* object was last modified, in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is not known
*/
public abstract long getLastModified(PortletRequest request);
/**
* Returns the PortletConfig object of the portlet
*
* @return the PortletConfig object
*/
protected abstract PortletConfig getPortletConfig();
/**
* Returns the PortletSettings object of the concrete portlet.
*
* @return the PortletSettings object, or NULL if no PortletSettings object is available.
*/
protected PortletSettings getPortletSettings() {
return this.portletSettings;
}
/**
* Initializes the PortletConfig using the web.xml file entry for this portlet
*/
public final void init(ServletConfig config) throws ServletException {
super.init(config);
log.info("in init(ServletConfig)");
/*
portletConfig = new SportletConfig(config);
PortletContext context = portletConfig.getContext();
PortletRegistryService registryService = (PortletRegistryService)context.getService(PortletRegistryService.class);
AccessControlService aclService = (AccessControlService)context.getService(AccessControlService.class);
*/
//registryService.registerPortletConfig(portletConfig);
/*
This will register the portlet (servlet) with the registry service on startup.
I took this path initially thinking I could forward to remote third-party
portlets outside of gridsphere.jar and provide their context to the registry
service too. Now I've moved this to GridSphere.java so the portlet container
controls the entire loading and initialization/shutdown of the portlets.
And whaddya know-- I started it up again trying to be compatible with WPS portlet API
in that the PortletConfig must contain the Initparameters defined in the web.xml for this portlet class
Also thinking more about portlets as autonomous units-- decouple gridsphere.jar from portlets such that
one can reload portlet components-- need to find switch to enable "smarter" jar reloading in Tomcat
*/
/*
String concreteID = config.getInitParameter(GridSphereProperties.ID);
PortletDeploymentDescriptor pdd = null;
try {
pdd = new PortletDeploymentDescriptor(config);
} catch (IOException e) {
throw new ServletException("Unable to deserialize portlet.xml: ", e);
}
ConcretePortletApplication concreteApp = pdd.getConcretePortletApplication(concreteID);
PortletApplication portletApp = pdd.getPortletApplication(concreteID);
ConcretePortlet concretePortlet = new ConcreteSportlet(pdd, portletApp, concreteApp, aclService);
// create sportlet settings that is not modifiable initially
portletSettings = concretePortlet.getPortletSettings(false);
context = concretePortlet.getPortletConfig().getContext();
registryService = (PortletRegistryService)context.getService(PortletRegistryService.class);
registeryID = registryService.registerPortlet(concretePortlet);
*/
}
public final void init() throws ServletException {
super.init();
}
public final ServletConfig getServletConfig() {
return super.getServletConfig();
}
public final String getInitParameter(String name) {
return super.getInitParameter(name);
}
public final Enumeration getInitParameterNames() {
return super.getInitParameterNames();
}
public final ServletContext getServletContext() {
return super.getServletContext();
}
protected long getLastModified(HttpServletRequest req) {
return super.getLastModified(req);
}
public String getServletInfo() {
return super.getServletInfo();
}
public final void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
log.info("in service(ServletRequest, ServletResponse) of Portlet");
// redirect to GridSphere
}
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// redirect to gridsphere
}
protected void doPut(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doPut(req, resp);
}
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doPost(req, resp);
}
protected void doTrace(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doTrace(req, resp);
}
protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doDelete(req, resp);
}
public final void destroy() {
super.destroy();
registryService.unregisterPortlet(registeryID);
}
}
| tried getting rid of extraneous imports
git-svn-id: 616481d960d639df1c769687dde8737486ca2a9a@429 9c99c85f-4d0c-0410-8460-a9a1c48a3a7f
| src/org/gridlab/gridsphere/portlet/Portlet.java | tried getting rid of extraneous imports | <ide><path>rc/org/gridlab/gridsphere/portlet/Portlet.java
<ide> * @version $Id$
<ide> */
<ide> package org.gridlab.gridsphere.portlet;
<del>
<del>import org.gridlab.gridsphere.portletcontainer.impl.ConcreteSportlet;
<del>import org.gridlab.gridsphere.portletcontainer.ConcretePortlet;
<del>import org.gridlab.gridsphere.portletcontainer.GridSphereProperties;
<del>import org.gridlab.gridsphere.portletcontainer.descriptor.ConcretePortletApplication;
<del>import org.gridlab.gridsphere.portletcontainer.descriptor.PortletDeploymentDescriptor;
<del>import org.gridlab.gridsphere.portletcontainer.descriptor.PortletApplication;
<del>import org.gridlab.gridsphere.portlet.impl.SportletConfig;
<del>import org.gridlab.gridsphere.services.container.registry.PortletRegistryService;
<del>import org.gridlab.gridsphere.services.security.acl.AccessControlService;
<del>import org.gridlab.gridsphere.core.persistence.PersistenceException;
<ide>
<ide> import javax.servlet.*;
<ide> import javax.servlet.http.HttpServlet;
<ide> protected PortletConfig portletConfig = null;
<ide> protected PortletSettings portletSettings = null;
<ide>
<del> private PortletRegistryService registryService = null;
<add> //protected Cacheable cacheable = null;
<add>
<add> //private PortletRegistryService registryService = null;
<ide>
<ide> private String registeryID = null;
<ide>
<ide>
<ide> // create sportlet settings that is not modifiable initially
<ide> portletSettings = concretePortlet.getPortletSettings(false);
<add> cacheable = concretePortlet.getCacheablePortletInfo();
<ide> context = concretePortlet.getPortletConfig().getContext();
<ide> registryService = (PortletRegistryService)context.getService(PortletRegistryService.class);
<ide> registeryID = registryService.registerPortlet(concretePortlet);
<ide> public final void service(ServletRequest request, ServletResponse response)
<ide> throws ServletException, IOException {
<ide> log.info("in service(ServletRequest, ServletResponse) of Portlet");
<add>
<add> // make cacheable
<add> // serve cached portlet output
<add> //if (cacheable.getExpiration() < 0) {
<add>
<add> //}
<ide> // redirect to GridSphere
<ide> }
<ide>
<ide>
<ide> public final void destroy() {
<ide> super.destroy();
<del> registryService.unregisterPortlet(registeryID);
<add> //registryService.unregisterPortlet(registeryID);
<ide> }
<ide>
<ide> } |
|
Java | apache-2.0 | 7001fe4ed5f352a5ad2862da6029afae7bc88af6 | 0 | CMPUT301F13T13/StoryHoard | /**
* Copyright 2013 Alex Wong, Ashley Brown, Josh Tate, Kim Wu, Stephanie Gil
*
* 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.
*/
package ca.ualberta.cs.c301f13t13.gui;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import ca.ualberta.cmput301f13t13.storyhoard.R;
/**
*
* ViewBrowseAuthorStories:
*
* The ViewBrowseAuthorStories activity displays a scrolling list of all stories
* created by the user. Information displayed includes the Title of the story
* and the author(s) which wrote them.
*
* Upon clicking a story, the user has the option to gain access of the
* following: a) Settings: Update settings such as story information b) Edit:
* Add/Edit chapters in the story c) Read: Read the story. Cancel will take the
* user back to the ViewBrowseAuthorStories activity.
*
* @author Kim Wu
*
*/
public class ViewBrowseAuthorStories extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_browse_author_stories);
// Populates list with stories and displays author
String[] stories = new String[] { "Story1 \nby:asd", "Stor2\nby:mandy",
"Story3 \nby:Tom", "Story4 \nby:Dan", "Story5 \nby:Sue" };
//
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, stories) {
@Override
// Formats the listView
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
TextView textView = (TextView) view
.findViewById(android.R.id.text1);
textView.setTextColor(Color.parseColor("#fff190"));
return view;
}
};
setListAdapter(adapter);
}
// When user clicks a story from the list:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Dialog dialog = userAction(position, id);
dialog.show();
}
/**
* userAction Choices: 3 possible actions can be taking from clicking a
* story on the list. 1) Settings: Will take user to story settings 2) EDIT:
* will allow user to edit/add chapters 3) Read : take users to read the
* story
*
*/
private AlertDialog userAction(final int position, final long id) {
// Initialize the Alert Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// Source of the data in the DIalog
CharSequence[] array = { "Settings", "Edit", "Read" };
// Set the dialog title
builder.setTitle("Story Action")
// Specify the list array, the items to be selected by default
.setSingleChoiceItems(array, 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
// TODO Auto-generated method stub
}
})
// Set the action buttons
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// add method
}
})
.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
});
return builder.create();
}
} | src/ca/ualberta/cs/c301f13t13/gui/ViewBrowseAuthorStories.java | /**
* Copyright 2013 Alex Wong, Ashley Brown, Josh Tate, Kim Wu, Stephanie Gil
*
* 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.
*/
package ca.ualberta.cs.c301f13t13.gui;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import ca.ualberta.cmput301f13t13.storyhoard.R;
/**
*
* ViewBrowseAuthorStories:
*
* The ViewBrowseAuthorStories activity displays a scrolling list of all stories
* created by the user. Information displayed includes the Title of the story and
* the author(s) which wrote them.
*
* Upon clicking a story, the user has the option to gain access of the following:
* a) Settings: Update settings such as story information
* b) Edit: Add/Edit chapters in the story
* c) Read: Read the story.
* Cancel will take the user back to the ViewBrowseAuthorStories activity.
*
* @author Kim Wu
*
*/
public class ViewBrowseAuthorStories extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_browse_author_stories);
// Populates list with stories and displays author
String[] stories = new String[] { "Story1 \nby:asd", "Stor2\nby:mandy",
"Story3 \nby:Tom", "Story4 \nby:Dan", "Story5 \nby:Sue" };
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, stories);
setListAdapter(adapter);
}
// When user clicks a story from the list:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Dialog dialog = userAction(position, id);
dialog.show();
}
/**
* userAction Choices: 3 possible actions can be taking from clicking a
* story on the list.
* 1) Settings: Will take user to story settings
* 2) EDIT: will allow user to edit/add chapters
* 3) Read : take users to read the story
*
*/
private AlertDialog userAction(final int position, final long id) {
// Initialize the Alert Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// Source of the data in the DIalog
CharSequence[] array = { "Settings", "Edit", "Read" };
// Set the dialog title
builder.setTitle("Story Action")
// Specify the list array, the items to be selected by default
.setSingleChoiceItems(array, 1,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
// TODO Auto-generated method stub
}
})
// Set the action buttons
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
//add method
}
})
.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
});
return builder.create();
}
} | Reformatted listView
| src/ca/ualberta/cs/c301f13t13/gui/ViewBrowseAuthorStories.java | Reformatted listView | <ide><path>rc/ca/ualberta/cs/c301f13t13/gui/ViewBrowseAuthorStories.java
<ide> import android.app.Dialog;
<ide> import android.app.ListActivity;
<ide> import android.content.DialogInterface;
<add>import android.graphics.Color;
<ide> import android.os.Bundle;
<ide> import android.view.View;
<add>import android.view.ViewGroup;
<ide> import android.widget.ArrayAdapter;
<ide> import android.widget.ListView;
<add>import android.widget.TextView;
<ide> import ca.ualberta.cmput301f13t13.storyhoard.R;
<ide>
<ide> /**
<ide> * ViewBrowseAuthorStories:
<ide> *
<ide> * The ViewBrowseAuthorStories activity displays a scrolling list of all stories
<del> * created by the user. Information displayed includes the Title of the story and
<del> * the author(s) which wrote them.
<add> * created by the user. Information displayed includes the Title of the story
<add> * and the author(s) which wrote them.
<ide> *
<del> * Upon clicking a story, the user has the option to gain access of the following:
<del> * a) Settings: Update settings such as story information
<del> * b) Edit: Add/Edit chapters in the story
<del> * c) Read: Read the story.
<del> * Cancel will take the user back to the ViewBrowseAuthorStories activity.
<add> * Upon clicking a story, the user has the option to gain access of the
<add> * following: a) Settings: Update settings such as story information b) Edit:
<add> * Add/Edit chapters in the story c) Read: Read the story. Cancel will take the
<add> * user back to the ViewBrowseAuthorStories activity.
<ide> *
<ide> * @author Kim Wu
<ide> *
<ide> String[] stories = new String[] { "Story1 \nby:asd", "Stor2\nby:mandy",
<ide> "Story3 \nby:Tom", "Story4 \nby:Dan", "Story5 \nby:Sue" };
<ide>
<add> //
<ide> ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
<del> android.R.layout.simple_list_item_1, stories);
<add> android.R.layout.simple_list_item_1, stories) {
<add> @Override
<add> // Formats the listView
<add> public View getView(int position, View convertView, ViewGroup parent) {
<add> View view = super.getView(position, convertView, parent);
<add> TextView textView = (TextView) view
<add> .findViewById(android.R.id.text1);
<add> textView.setTextColor(Color.parseColor("#fff190"));
<add> return view;
<add> }
<add> };
<ide> setListAdapter(adapter);
<ide> }
<ide>
<ide>
<ide> /**
<ide> * userAction Choices: 3 possible actions can be taking from clicking a
<del> * story on the list.
<del> * 1) Settings: Will take user to story settings
<del> * 2) EDIT: will allow user to edit/add chapters
<del> * 3) Read : take users to read the story
<add> * story on the list. 1) Settings: Will take user to story settings 2) EDIT:
<add> * will allow user to edit/add chapters 3) Read : take users to read the
<add> * story
<ide> *
<ide> */
<ide> private AlertDialog userAction(final int position, final long id) {
<ide> .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
<ide> @Override
<ide> public void onClick(DialogInterface dialog, int id) {
<del> //add method
<add> // add method
<ide>
<ide> }
<ide> }) |
|
Java | mit | error: pathspec 'TurtleBot/src/com/team1458/turtleshell/TurtleMaths.java' did not match any file(s) known to git
| ff9cc3387771a8ff4e85efae5eae5d5855ee1b70 | 1 | FRC1458/turtleshell,FRC1458/turtleshell,FRC1458/turtleshell,FRC1458/turtleshell,FRC1458/turtleshell,FRC1458/turtleshell | package com.team1458.turtleshell;
/**
* A class holding helpful static methods for maths-related things.
*
* @author mehnadnerd
*
*/
public class TurtleMaths {
/**
* Fit the double to a specified range.
*
* @param toFit
* number to fit in range
* @param min
* minimum value for toFit
* @param max
* Maximum value for toFit
* @return
*/
public static double fitRange(double toFit, double min, double max) {
if (toFit > max) {
return max;
}
if (toFit < min) {
return min;
}
return toFit;
}
/**
* Returns the absolute difference between the two numbers
*
* @param a
* 1st value
* @param b
* 2nd value
* @return The absolute difference of the two, equal to Math.abs(a-b)
*/
public static double absDiff(double a, double b) {
return Math.abs(a - b);
}
/**
* Returns the bigger of the two double values.
*
* @param a
* @param b
* @return
*/
public static double biggerOf(double a, double b) {
return (a > b ? a : b);
}
/**
* Returns the bigger of the two int values
*
* @param a
* @param b
* @return
*/
public static int biggerOf(int a, int b) {
return (a > b ? a : b);
}
/**
* A class to help with moving values between different ranges, i.e. 0-100
* to 3-7
*
* @author mehnadnerd
*
*/
public static class RangeShifter {
private final double minA;
private final double minB;
private final double rngA;
private final double rngB;
/**
* Construct a new RangeShifter
*
* @param minA
* Minimum point of first range
* @param maxA
* Maximum point of first range
* @param minB
* Minimum point of second range
* @param maxB
* Maximum point of second range
*/
public RangeShifter(double minA, double maxA, double minB, double maxB) {
this.minA = minA;
this.rngA = maxA - minA;
this.minB = minB;
this.rngB = maxB - minB;
}
/**
* Use the RangeShifter to actually shift numbers.
*
* @param toShift
* The number to shift
* @return The shifted value.
*/
public double shift(double toShift) {
return minB + (rngB / rngA) * (toShift - minA);
}
}
/**
* Rounds a double to a certain number of places past the decimal point
*
* @param toRound
* The double to round
* @param decimalPlaces
* The number of digits past the decimal point to keep, negative
* numbers are supported.
* @return
*/
public static double round(double toRound, int decimalPlaces) {
toRound *= Math.pow(10, decimalPlaces);
toRound = Math.round(Math.round(toRound));
toRound /= Math.pow(10, decimalPlaces);
return toRound;
}
/**
* Returns the smallest of two double values
*
* @param a
* @param b
* @return The smaller of the two values, or b if they are equal or such
*/
public static double smallerOf(double a, double b) {
return (a < b ? a : b);
}
/**
* Returns the smaller of the two int values
*
* @param a
* @param b
* @return
*/
public static int smallerOf(int a, int b) {
return (a < b ? a : b);
}
/**
* Normalises a slope to between zero and one. Used in arcade drive code
*
* @param m
* The slope to normalise
* @return The slope normalised to (0, 1], it will be absolute valued and
* recipocaled as nessecary
*/
public static double normaliseM(double m) {
m = Math.abs(m);
if (m > 1) {
m = 1 / m;
}
if (Double.isNaN(m)) {
m = 0;
}
return m;
}
/**
* Calculates percent Error
* @param actual The ideal or "correct" value
* @param measured The measured value
* @return
*/
public static double percentError(double actual, double measured) {
return TurtleMaths.absDiff(actual, measured)/actual;
}
} | TurtleBot/src/com/team1458/turtleshell/TurtleMaths.java | Repaired TurtleMaths, which was destroyed in the merge
| TurtleBot/src/com/team1458/turtleshell/TurtleMaths.java | Repaired TurtleMaths, which was destroyed in the merge | <ide><path>urtleBot/src/com/team1458/turtleshell/TurtleMaths.java
<add>package com.team1458.turtleshell;
<add>
<add>/**
<add> * A class holding helpful static methods for maths-related things.
<add> *
<add> * @author mehnadnerd
<add> *
<add> */
<add>public class TurtleMaths {
<add> /**
<add> * Fit the double to a specified range.
<add> *
<add> * @param toFit
<add> * number to fit in range
<add> * @param min
<add> * minimum value for toFit
<add> * @param max
<add> * Maximum value for toFit
<add> * @return
<add> */
<add> public static double fitRange(double toFit, double min, double max) {
<add> if (toFit > max) {
<add> return max;
<add> }
<add> if (toFit < min) {
<add> return min;
<add> }
<add> return toFit;
<add> }
<add>
<add> /**
<add> * Returns the absolute difference between the two numbers
<add> *
<add> * @param a
<add> * 1st value
<add> * @param b
<add> * 2nd value
<add> * @return The absolute difference of the two, equal to Math.abs(a-b)
<add> */
<add> public static double absDiff(double a, double b) {
<add> return Math.abs(a - b);
<add> }
<add>
<add> /**
<add> * Returns the bigger of the two double values.
<add> *
<add> * @param a
<add> * @param b
<add> * @return
<add> */
<add> public static double biggerOf(double a, double b) {
<add> return (a > b ? a : b);
<add> }
<add>
<add> /**
<add> * Returns the bigger of the two int values
<add> *
<add> * @param a
<add> * @param b
<add> * @return
<add> */
<add> public static int biggerOf(int a, int b) {
<add> return (a > b ? a : b);
<add> }
<add>
<add> /**
<add> * A class to help with moving values between different ranges, i.e. 0-100
<add> * to 3-7
<add> *
<add> * @author mehnadnerd
<add> *
<add> */
<add> public static class RangeShifter {
<add> private final double minA;
<add> private final double minB;
<add> private final double rngA;
<add> private final double rngB;
<add>
<add> /**
<add> * Construct a new RangeShifter
<add> *
<add> * @param minA
<add> * Minimum point of first range
<add> * @param maxA
<add> * Maximum point of first range
<add> * @param minB
<add> * Minimum point of second range
<add> * @param maxB
<add> * Maximum point of second range
<add> */
<add> public RangeShifter(double minA, double maxA, double minB, double maxB) {
<add> this.minA = minA;
<add> this.rngA = maxA - minA;
<add> this.minB = minB;
<add> this.rngB = maxB - minB;
<add> }
<add>
<add> /**
<add> * Use the RangeShifter to actually shift numbers.
<add> *
<add> * @param toShift
<add> * The number to shift
<add> * @return The shifted value.
<add> */
<add> public double shift(double toShift) {
<add> return minB + (rngB / rngA) * (toShift - minA);
<add> }
<add> }
<add>
<add> /**
<add> * Rounds a double to a certain number of places past the decimal point
<add> *
<add> * @param toRound
<add> * The double to round
<add> * @param decimalPlaces
<add> * The number of digits past the decimal point to keep, negative
<add> * numbers are supported.
<add> * @return
<add> */
<add> public static double round(double toRound, int decimalPlaces) {
<add> toRound *= Math.pow(10, decimalPlaces);
<add> toRound = Math.round(Math.round(toRound));
<add> toRound /= Math.pow(10, decimalPlaces);
<add> return toRound;
<add> }
<add>
<add> /**
<add> * Returns the smallest of two double values
<add> *
<add> * @param a
<add> * @param b
<add> * @return The smaller of the two values, or b if they are equal or such
<add> */
<add> public static double smallerOf(double a, double b) {
<add> return (a < b ? a : b);
<add> }
<add>
<add> /**
<add> * Returns the smaller of the two int values
<add> *
<add> * @param a
<add> * @param b
<add> * @return
<add> */
<add> public static int smallerOf(int a, int b) {
<add> return (a < b ? a : b);
<add> }
<add>
<add> /**
<add> * Normalises a slope to between zero and one. Used in arcade drive code
<add> *
<add> * @param m
<add> * The slope to normalise
<add> * @return The slope normalised to (0, 1], it will be absolute valued and
<add> * recipocaled as nessecary
<add> */
<add> public static double normaliseM(double m) {
<add> m = Math.abs(m);
<add> if (m > 1) {
<add> m = 1 / m;
<add> }
<add> if (Double.isNaN(m)) {
<add> m = 0;
<add> }
<add> return m;
<add> }
<add>
<add> /**
<add> * Calculates percent Error
<add> * @param actual The ideal or "correct" value
<add> * @param measured The measured value
<add> * @return
<add> */
<add> public static double percentError(double actual, double measured) {
<add> return TurtleMaths.absDiff(actual, measured)/actual;
<add> }
<add>} |
|
Java | bsd-3-clause | ac34a71804137e04445c88308cd5c33925196519 | 0 | cerebro/ggp-base,cerebro/ggp-base | package util.statemachine;
import java.util.Set;
import util.gdl.grammar.Gdl;
import util.gdl.grammar.GdlConstant;
import util.gdl.grammar.GdlFunction;
import util.gdl.grammar.GdlRelation;
import util.gdl.grammar.GdlSentence;
public abstract class MachineState {
/* Abstract methods */
/**
* getContents returns the GDL sentences which determine the current state
* of the game being played. Two given states with identical GDL sentences
* should be identical states of the game.
*/
public abstract Set<GdlSentence> getContents();
/* Utility methods */
public int hashCode()
{
return getContents().hashCode();
}
public String toString()
{
Set<GdlSentence> contents = getContents();
if(contents == null)
return "(MachineState with null contents)";
else
return contents.toString();
}
public boolean equals(Object o)
{
if ((o != null) && (o instanceof MachineState))
{
MachineState state = (MachineState) o;
return state.getContents().equals(getContents());
}
return false;
}
public final String toXML()
{
String rval = "<state>\n";
Set<GdlSentence> theContents = getContents();
for(GdlSentence sentence : theContents)
{
rval += gdlToXML(sentence);
}
rval += "</state>";
return rval;
}
// TODO: Do we really need this method?
public final String toMatchXML()
{
String rval = "<match>\n <herstory>\n";
rval += toXML();
rval += " </herstory>\n</match>";
return rval;
}
private final String gdlToXML(Gdl gdl)
{
String rval = "";
if(gdl instanceof GdlConstant)
{
GdlConstant c = (GdlConstant)gdl;
return c.getValue();
} else if(gdl instanceof GdlFunction) {
GdlFunction f = (GdlFunction)gdl;
if(f.getName().toString().equals("true"))
{
return "\t<fact>\n"+gdlToXML(f.get(0))+"\t</fact>\n";
}
else
{
rval += "\t\t<relation>"+f.getName()+"</relation>\n";
for(int i=0; i<f.arity(); i++)
rval += "\t\t<argument>"+gdlToXML(f.get(i))+"</argument>\n";
return rval;
}
} else if (gdl instanceof GdlRelation) {
GdlRelation relation = (GdlRelation) gdl;
if(relation.getName().toString().equals("true"))
{
for(int i=0; i<relation.arity(); i++)
rval+="\t<fact>\n"+gdlToXML(relation.get(i))+"\t</fact>\n";
return rval;
} else {
rval+="\t\t<relation>"+relation.getName()+"</relation>\n";
for(int i=0; i<relation.arity(); i++)
rval+="\t\t<argument>"+gdlToXML(relation.get(i))+"</argument>\n";
return rval;
}
} else {
System.err.println("MachineState gdlToXML Error: could not handle "+gdl.toString());
return "";
}
}
} | ggp-base/src/util/statemachine/MachineState.java | package util.statemachine;
import java.util.Set;
import util.gdl.grammar.Gdl;
import util.gdl.grammar.GdlConstant;
import util.gdl.grammar.GdlFunction;
import util.gdl.grammar.GdlRelation;
import util.gdl.grammar.GdlSentence;
public abstract class MachineState {
/* Abstract methods */
/**
* getContents returns the GDL sentences which determine the current state
* of the game being played. Two given states with identical GDL sentences
* should be identical states of the game.
*/
public abstract Set<GdlSentence> getContents();
/* Utility methods */
public int hashCode()
{
return getContents().hashCode();
}
public String toString()
{
Set<GdlSentence> contents = getContents();
if(contents == null)
return "(MachineState with null contents)";
else
return contents.toString();
}
public boolean equals(Object o)
{
if ((o != null) && (o instanceof MachineState))
{
MachineState state = (MachineState) o;
return state.getContents().equals(getContents());
}
return false;
}
public final String toXML()
{
String rval = "<match>\n\n<herstory>\n\n\t<state>\n\n";
Set<GdlSentence> theContents = getContents();
for(GdlSentence sentence : theContents)
{
rval += gdlToXML(sentence);
}
rval += "\n\t</state>\n\n</herstory>\n\n</match>\n";
return rval;
}
private final String gdlToXML(Gdl gdl)
{
String rval = "";
if(gdl instanceof GdlConstant)
{
GdlConstant c = (GdlConstant)gdl;
return c.getValue();
} else if(gdl instanceof GdlFunction) {
GdlFunction f = (GdlFunction)gdl;
if(f.getName().toString().equals("true"))
{
return "<fact>\n\n"+gdlToXML(f.get(0))+"</fact>\n\n";
}
else
{
rval += "\t<relation>"+f.getName()+"</relation>\n\n";
for(int i=0; i<f.arity(); i++)
rval += "\t\t<argument>"+gdlToXML(f.get(i))+"</argument>\n\n";
return rval;
}
} else if (gdl instanceof GdlRelation) {
GdlRelation relation = (GdlRelation) gdl;
if(relation.getName().toString().equals("true"))
{
for(int i=0; i<relation.arity(); i++)
rval+="<fact>\n\n"+gdlToXML(relation.get(i))+"</fact>\n\n";
return rval;
} else {
rval+="\t<relation>"+relation.getName()+"</relation>\n\n";
for(int i=0; i<relation.arity(); i++)
rval+="\t\t<argument>"+gdlToXML(relation.get(i))+"</argument>\n\n";
return rval;
}
} else {
System.err.println("Oh oh: "+gdl.toString());
return "";
}
}
} | Split out the generation of XML for an individual state from the generation of XML for a state wrapped in an otherwise-empty match.
git-svn-id: 4739e81c2fe647bfb539b919360e2c658e6121ea@293 716a755e-b13f-cedc-210d-596dafc6fb9b
| ggp-base/src/util/statemachine/MachineState.java | Split out the generation of XML for an individual state from the generation of XML for a state wrapped in an otherwise-empty match. | <ide><path>gp-base/src/util/statemachine/MachineState.java
<ide>
<ide> public final String toXML()
<ide> {
<del> String rval = "<match>\n\n<herstory>\n\n\t<state>\n\n";
<add> String rval = "<state>\n";
<ide> Set<GdlSentence> theContents = getContents();
<ide> for(GdlSentence sentence : theContents)
<ide> {
<ide> rval += gdlToXML(sentence);
<ide> }
<del> rval += "\n\t</state>\n\n</herstory>\n\n</match>\n";
<add> rval += "</state>";
<add> return rval;
<add> }
<add>
<add> // TODO: Do we really need this method?
<add> public final String toMatchXML()
<add> {
<add> String rval = "<match>\n <herstory>\n";
<add> rval += toXML();
<add> rval += " </herstory>\n</match>";
<ide> return rval;
<ide> }
<ide>
<ide> GdlFunction f = (GdlFunction)gdl;
<ide> if(f.getName().toString().equals("true"))
<ide> {
<del> return "<fact>\n\n"+gdlToXML(f.get(0))+"</fact>\n\n";
<add> return "\t<fact>\n"+gdlToXML(f.get(0))+"\t</fact>\n";
<ide> }
<ide> else
<ide> {
<del> rval += "\t<relation>"+f.getName()+"</relation>\n\n";
<add> rval += "\t\t<relation>"+f.getName()+"</relation>\n";
<ide> for(int i=0; i<f.arity(); i++)
<del> rval += "\t\t<argument>"+gdlToXML(f.get(i))+"</argument>\n\n";
<add> rval += "\t\t<argument>"+gdlToXML(f.get(i))+"</argument>\n";
<ide> return rval;
<ide> }
<ide> } else if (gdl instanceof GdlRelation) {
<ide> if(relation.getName().toString().equals("true"))
<ide> {
<ide> for(int i=0; i<relation.arity(); i++)
<del> rval+="<fact>\n\n"+gdlToXML(relation.get(i))+"</fact>\n\n";
<add> rval+="\t<fact>\n"+gdlToXML(relation.get(i))+"\t</fact>\n";
<ide> return rval;
<ide> } else {
<del> rval+="\t<relation>"+relation.getName()+"</relation>\n\n";
<add> rval+="\t\t<relation>"+relation.getName()+"</relation>\n";
<ide> for(int i=0; i<relation.arity(); i++)
<del> rval+="\t\t<argument>"+gdlToXML(relation.get(i))+"</argument>\n\n";
<add> rval+="\t\t<argument>"+gdlToXML(relation.get(i))+"</argument>\n";
<ide> return rval;
<ide> }
<ide> } else {
<del> System.err.println("Oh oh: "+gdl.toString());
<add> System.err.println("MachineState gdlToXML Error: could not handle "+gdl.toString());
<ide> return "";
<ide> }
<ide> } |
|
Java | epl-1.0 | abc176dbb1b151ed8962ddd6613283811467b784 | 0 | miklossy/xtext-core,miklossy/xtext-core | package org.eclipse.xtext.parser.antlr;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.IntStream;
import org.antlr.runtime.Parser;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.LexerRule;
import org.eclipse.xtext.parser.IAstFactory;
import org.eclipse.xtext.parser.IParseResult;
import org.eclipse.xtext.parser.ParseException;
import org.eclipse.xtext.parser.ParseResult;
import org.eclipse.xtext.parsetree.AbstractNode;
import org.eclipse.xtext.parsetree.CompositeNode;
import org.eclipse.xtext.parsetree.LeafNode;
import org.eclipse.xtext.parsetree.NodeAdapter;
import org.eclipse.xtext.parsetree.NodeAdapterFactory;
import org.eclipse.xtext.parsetree.ParsetreeFactory;
import org.eclipse.xtext.parsetree.SyntaxError;
import org.eclipse.xtext.resource.ClassloaderClasspathUriResolver;
import org.eclipse.xtext.util.MultiMap;
import org.eclipse.xtext.util.Strings;
public abstract class AbstractAntlrParser extends Parser {
protected CompositeNode currentNode;
protected org.eclipse.xtext.Grammar grammar;
protected IAstFactory factory;
protected int lastConsumedIndex = -1;
private MultiMap<Token, CompositeNode> deferredLookaheadMap = new MultiMap<Token, CompositeNode>();
private Map<Token, LeafNode> token2NodeMap = new HashMap<Token, LeafNode>();
protected AbstractAntlrParser(TokenStream input) {
super(input);
}
public TokenStream getInput() {
return input;
}
protected CompositeNode getCurrentNode() {
return currentNode;
}
protected void associateNodeWithAstElement(CompositeNode node, EObject astElement) {
if (astElement == null)
throw new NullPointerException("passed astElement was null");
if (node == null)
throw new NullPointerException("passed node was null");
if (node.getElement() != null && node.getElement() != astElement) {
throw new ParseException("Reassignment of astElement in parse tree node");
}
if (node.getElement() != astElement) {
node.setElement(astElement);
NodeAdapter adapter = (NodeAdapter) NodeAdapterFactory.INSTANCE.adapt(astElement, AbstractNode.class);
adapter.setParserNode(node);
}
}
protected Object createLeafNode(String grammarElementID, String feature) {
Token token = input.LT(-1);
if (token.getTokenIndex() > lastConsumedIndex) {
int indexOfTokenBefore = lastConsumedIndex;
if (indexOfTokenBefore + 1 < token.getTokenIndex()) {
for (int x = indexOfTokenBefore + 1; x < token.getTokenIndex(); x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
}
}
LeafNode leafNode = createLeafNode(token, false);
leafNode.setGrammarElement(getGrammarElement(grammarElementID));
leafNode.setFeature(feature);
lastConsumedIndex = token.getTokenIndex();
tokenConsumed(token, leafNode);
return leafNode;
}
return null;
}
private EObject getGrammarElement(String grammarElementID) {
URI uri = URI
.createURI(grammarElementID);
// URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), uri);
return grammar.eResource().getResourceSet().getEObject(uri, true);
}
private Map<Integer, String> antlrTypeToLexerName = null;
public void setTokenTypeMap(Map<Integer, String> tokenTypeMap) {
antlrTypeToLexerName = new HashMap<Integer, String>();
for(Entry<Integer, String> mapEntry: tokenTypeMap.entrySet()) {
String value = mapEntry.getValue();
if(TokenTool.isLexerRule(value)) {
antlrTypeToLexerName.put(mapEntry.getKey(), TokenTool.getLexerRuleName(value));
}
}
}
protected void setLexerRule(LeafNode leafNode, Token hidden) {
String ruleName = antlrTypeToLexerName.get(hidden.getType());
AbstractRule rule = GrammarUtil.findRuleForName(grammar, ruleName);
if (rule instanceof LexerRule) {
leafNode.setGrammarElement(rule);
}
}
protected CompositeNode createCompositeNode(String grammarElementID, CompositeNode parentNode) {
CompositeNode compositeNode = ParsetreeFactory.eINSTANCE.createCompositeNode();
if (parentNode != null)
parentNode.getChildren().add(compositeNode);
EObject grammarEle = getGrammarElement(grammarElementID);
compositeNode.setGrammarElement(grammarEle);
return compositeNode;
}
private void appendError(AbstractNode node) {
if (currentError != null) {
SyntaxError error = ParsetreeFactory.eINSTANCE.createSyntaxError();
error.setMessage(currentError);
node.setSyntaxError(error);
currentError = null;
}
}
private LeafNode createLeafNode(Token token, boolean isHidden) {
LeafNode leafNode = ParsetreeFactory.eINSTANCE.createLeafNode();
leafNode.setText(token.getText());
leafNode.setHidden(isHidden);
if (isSemanticChannel(token))
appendError(leafNode);
if (token.getType() == Token.INVALID_TOKEN_TYPE) {
SyntaxError error = ParsetreeFactory.eINSTANCE.createSyntaxError();
String lexerErrorMessage = ((XtextTokenStream) input).getLexerErrorMessage(token);
error.setMessage(lexerErrorMessage);
leafNode.setSyntaxError(error);
}
currentNode.getChildren().add(leafNode);
return leafNode;
}
protected void appendAllTokens() {
for (int x = lastConsumedIndex + 1; input.size() > x; input.consume(), x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
}
if (currentError != null) {
EList<LeafNode> leafNodes = currentNode.getLeafNodes();
if (leafNodes.isEmpty()) {
appendError(currentNode);
} else {
appendError(leafNodes.get(leafNodes.size() - 1));
}
}
}
private boolean isSemanticChannel(Token hidden) {
return hidden.getChannel() != HIDDEN;
}
protected List<LeafNode> appendSkippedTokens() {
List<LeafNode> skipped = new ArrayList<LeafNode>();
Token currentToken = input.LT(-1);
int currentTokenIndex = (currentToken == null) ? -1 : currentToken.getTokenIndex();
Token tokenBefore = (lastConsumedIndex == -1) ? null : input.get(lastConsumedIndex);
int indexOfTokenBefore = tokenBefore != null ? tokenBefore.getTokenIndex() : -1;
if (indexOfTokenBefore + 1 < currentTokenIndex) {
for (int x = indexOfTokenBefore + 1; x < currentTokenIndex; x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
skipped.add(leafNode);
}
}
if (lastConsumedIndex < currentTokenIndex) {
LeafNode leafNode = createLeafNode(currentToken, true);
setLexerRule(leafNode, currentToken);
skipped.add(leafNode);
lastConsumedIndex = currentToken.getTokenIndex();
}
return skipped;
}
protected void appendTrailingHiddenTokens() {
Token tokenBefore = input.LT(-1);
int size = input.size();
if (tokenBefore != null && tokenBefore.getTokenIndex() < size) {
for (int x = tokenBefore.getTokenIndex() + 1; x < size; x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
lastConsumedIndex = hidden.getTokenIndex();
}
}
}
private String currentError = null;
@Override
public void recover(IntStream input, RecognitionException re) {
if (currentError == null)
currentError = getErrorMessage(re, getTokenNames());
super.recover(input, re);
}
@Override
public void recoverFromMismatchedToken(IntStream in, RecognitionException re, int ttype, BitSet follow)
throws RecognitionException {
if (currentError == null)
currentError = getErrorMessage(re, getTokenNames());
super.recoverFromMismatchedToken(in, re, ttype, follow);
}
public final IParseResult parse() throws RecognitionException {
return parse(getFirstRuleName());
}
public final IParseResult parse(String entryRuleName) throws RecognitionException {
IParseResult result = null;
EObject current = null;
try {
String antlrEntryRuleName = normalizeEntryRuleName(entryRuleName);
try {
Method method = this.getClass().getMethod(antlrEntryRuleName);
current = (EObject) method.invoke(this);
} catch (InvocationTargetException ite) {
Throwable targetException = ite.getTargetException();
if (targetException instanceof RecognitionException) {
throw (RecognitionException) targetException;
}
if (targetException instanceof Exception) {
throw new WrappedException((Exception) targetException);
}
throw new RuntimeException(targetException);
} catch (Exception e) {
throw new WrappedException(e);
}
appendTrailingHiddenTokens();
} finally {
try {
appendAllTokens();
} finally {
result = new ParseResult(current, currentNode);
}
}
return result;
}
private String normalizeEntryRuleName(String entryRuleName) {
String antlrEntryRuleName;
if (!entryRuleName.startsWith("entryRule")) {
if (!entryRuleName.startsWith("rule")) {
antlrEntryRuleName = "entryRule" + entryRuleName;
} else {
antlrEntryRuleName = "entry" + Strings.toFirstUpper(entryRuleName);
}
} else {
antlrEntryRuleName = entryRuleName;
}
return antlrEntryRuleName;
}
private void tokenConsumed(Token token, LeafNode leafNode) {
List<CompositeNode> nodesDecidingOnToken = deferredLookaheadMap.get(token);
for (CompositeNode nodeDecidingOnToken : nodesDecidingOnToken) {
nodeDecidingOnToken.getLookaheadLeafNodes().add(leafNode);
}
deferredLookaheadMap.remove(token);
token2NodeMap.put(token, leafNode);
}
/**
* The current lookahead is the number of tokens that have been matched by
* the parent rule to decide that the current rule has to be called.
*
* @return the currentLookahead
*/
protected void setCurrentLookahead() {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
List<Token> lookaheadTokens = xtextTokenStream.getLookaheadTokens();
for (Token lookaheadToken : lookaheadTokens) {
LeafNode leafNode = token2NodeMap.get(lookaheadToken);
if (leafNode == null) {
deferredLookaheadMap.put(lookaheadToken, currentNode);
} else {
currentNode.getLookaheadLeafNodes().add(leafNode);
}
}
}
/**
* Sets the current lookahead to zero. See
* {@link AbstractAntlrParser#setCurrentLookahead()}
*/
protected void resetLookahead() {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
xtextTokenStream.resetLookahead();
token2NodeMap.clear();
}
protected void moveLookaheadInfo(CompositeNode source, CompositeNode target) {
EList<LeafNode> sourceLookaheadLeafNodes = source.getLookaheadLeafNodes();
target.getLookaheadLeafNodes().addAll(sourceLookaheadLeafNodes);
sourceLookaheadLeafNodes.clear();
for (Token deferredLookaheadToken : deferredLookaheadMap.keySet()) {
List<CompositeNode> nodesDecidingOnToken = deferredLookaheadMap.get(deferredLookaheadToken);
while (nodesDecidingOnToken.indexOf(source) != -1) {
nodesDecidingOnToken.set(nodesDecidingOnToken.indexOf(source), target);
}
}
}
/**
* Match is called to consume unambiguous tokens. It calls input.LA() and
* therefore increases the currentLookahead. We need to compensate. See
* {@link AbstractAntlrParser#setCurrentLookahead()}
*
* @see org.antlr.runtime.BaseRecognizer#match(org.antlr.runtime.IntStream,
* int, org.antlr.runtime.BitSet)
*/
@Override
public void match(IntStream input, int ttype, BitSet follow) throws RecognitionException {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
int numLookaheadBeforeMatch = xtextTokenStream.getLookaheadTokens().size();
super.match(input, ttype, follow);
if (xtextTokenStream.getLookaheadTokens().size() > numLookaheadBeforeMatch) {
xtextTokenStream.removeLastLookaheadToken();
}
}
protected abstract InputStream getTokenFile();
/**
* @return
*/
protected abstract String getFirstRuleName();
}
| plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java | package org.eclipse.xtext.parser.antlr;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.IntStream;
import org.antlr.runtime.Parser;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.LexerRule;
import org.eclipse.xtext.parser.IAstFactory;
import org.eclipse.xtext.parser.IParseResult;
import org.eclipse.xtext.parser.ParseException;
import org.eclipse.xtext.parser.ParseResult;
import org.eclipse.xtext.parsetree.AbstractNode;
import org.eclipse.xtext.parsetree.CompositeNode;
import org.eclipse.xtext.parsetree.LeafNode;
import org.eclipse.xtext.parsetree.NodeAdapter;
import org.eclipse.xtext.parsetree.NodeAdapterFactory;
import org.eclipse.xtext.parsetree.ParsetreeFactory;
import org.eclipse.xtext.parsetree.SyntaxError;
import org.eclipse.xtext.resource.ClassloaderClasspathUriResolver;
import org.eclipse.xtext.util.MultiMap;
import org.eclipse.xtext.util.Strings;
public abstract class AbstractAntlrParser extends Parser {
protected CompositeNode currentNode;
protected org.eclipse.xtext.Grammar grammar;
protected IAstFactory factory;
protected int lastConsumedIndex = -1;
private MultiMap<Token, CompositeNode> deferredLookaheadMap = new MultiMap<Token, CompositeNode>();
private Map<Token, LeafNode> token2NodeMap = new HashMap<Token, LeafNode>();
protected AbstractAntlrParser(TokenStream input) {
super(input);
}
public TokenStream getInput() {
return input;
}
protected CompositeNode getCurrentNode() {
return currentNode;
}
protected void associateNodeWithAstElement(CompositeNode node, EObject astElement) {
if (astElement == null)
throw new NullPointerException("passed astElement was null");
if (node == null)
throw new NullPointerException("passed node was null");
if (node.getElement() != null && node.getElement() != astElement) {
throw new ParseException("Reassignment of astElement in parse tree node");
}
if (node.getElement() != astElement) {
node.setElement(astElement);
NodeAdapter adapter = (NodeAdapter) NodeAdapterFactory.INSTANCE.adapt(astElement, AbstractNode.class);
adapter.setParserNode(node);
}
}
protected Object createLeafNode(String grammarElementID, String feature) {
Token token = input.LT(-1);
if (token.getTokenIndex() > lastConsumedIndex) {
int indexOfTokenBefore = lastConsumedIndex;
if (indexOfTokenBefore + 1 < token.getTokenIndex()) {
for (int x = indexOfTokenBefore + 1; x < token.getTokenIndex(); x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
}
}
LeafNode leafNode = createLeafNode(token, false);
leafNode.setGrammarElement(getGrammarElement(grammarElementID));
leafNode.setFeature(feature);
lastConsumedIndex = token.getTokenIndex();
tokenConsumed(token, leafNode);
return leafNode;
}
return null;
}
private EObject getGrammarElement(String grammarElementID) {
URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), URI
.createURI(grammarElementID));
return grammar.eResource().getResourceSet().getEObject(resolved, true);
}
private Map<Integer, String> antlrTypeToLexerName = null;
public void setTokenTypeMap(Map<Integer, String> tokenTypeMap) {
antlrTypeToLexerName = new HashMap<Integer, String>();
for(Entry<Integer, String> mapEntry: tokenTypeMap.entrySet()) {
String value = mapEntry.getValue();
if(TokenTool.isLexerRule(value)) {
antlrTypeToLexerName.put(mapEntry.getKey(), TokenTool.getLexerRuleName(value));
}
}
}
protected void setLexerRule(LeafNode leafNode, Token hidden) {
String ruleName = antlrTypeToLexerName.get(hidden.getType());
AbstractRule rule = GrammarUtil.findRuleForName(grammar, ruleName);
if (rule instanceof LexerRule) {
leafNode.setGrammarElement(rule);
}
}
protected CompositeNode createCompositeNode(String grammarElementID, CompositeNode parentNode) {
CompositeNode compositeNode = ParsetreeFactory.eINSTANCE.createCompositeNode();
if (parentNode != null)
parentNode.getChildren().add(compositeNode);
EObject grammarEle = getGrammarElement(grammarElementID);
compositeNode.setGrammarElement(grammarEle);
return compositeNode;
}
private void appendError(AbstractNode node) {
if (currentError != null) {
SyntaxError error = ParsetreeFactory.eINSTANCE.createSyntaxError();
error.setMessage(currentError);
node.setSyntaxError(error);
currentError = null;
}
}
private LeafNode createLeafNode(Token token, boolean isHidden) {
LeafNode leafNode = ParsetreeFactory.eINSTANCE.createLeafNode();
leafNode.setText(token.getText());
leafNode.setHidden(isHidden);
if (isSemanticChannel(token))
appendError(leafNode);
if (token.getType() == Token.INVALID_TOKEN_TYPE) {
SyntaxError error = ParsetreeFactory.eINSTANCE.createSyntaxError();
String lexerErrorMessage = ((XtextTokenStream) input).getLexerErrorMessage(token);
error.setMessage(lexerErrorMessage);
leafNode.setSyntaxError(error);
}
currentNode.getChildren().add(leafNode);
return leafNode;
}
protected void appendAllTokens() {
for (int x = lastConsumedIndex + 1; input.size() > x; input.consume(), x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
}
if (currentError != null) {
EList<LeafNode> leafNodes = currentNode.getLeafNodes();
if (leafNodes.isEmpty()) {
appendError(currentNode);
} else {
appendError(leafNodes.get(leafNodes.size() - 1));
}
}
}
private boolean isSemanticChannel(Token hidden) {
return hidden.getChannel() != HIDDEN;
}
protected List<LeafNode> appendSkippedTokens() {
List<LeafNode> skipped = new ArrayList<LeafNode>();
Token currentToken = input.LT(-1);
int currentTokenIndex = (currentToken == null) ? -1 : currentToken.getTokenIndex();
Token tokenBefore = (lastConsumedIndex == -1) ? null : input.get(lastConsumedIndex);
int indexOfTokenBefore = tokenBefore != null ? tokenBefore.getTokenIndex() : -1;
if (indexOfTokenBefore + 1 < currentTokenIndex) {
for (int x = indexOfTokenBefore + 1; x < currentTokenIndex; x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
skipped.add(leafNode);
}
}
if (lastConsumedIndex < currentTokenIndex) {
LeafNode leafNode = createLeafNode(currentToken, true);
setLexerRule(leafNode, currentToken);
skipped.add(leafNode);
lastConsumedIndex = currentToken.getTokenIndex();
}
return skipped;
}
protected void appendTrailingHiddenTokens() {
Token tokenBefore = input.LT(-1);
int size = input.size();
if (tokenBefore != null && tokenBefore.getTokenIndex() < size) {
for (int x = tokenBefore.getTokenIndex() + 1; x < size; x++) {
Token hidden = input.get(x);
LeafNode leafNode = createLeafNode(hidden, true);
setLexerRule(leafNode, hidden);
lastConsumedIndex = hidden.getTokenIndex();
}
}
}
private String currentError = null;
@Override
public void recover(IntStream input, RecognitionException re) {
if (currentError == null)
currentError = getErrorMessage(re, getTokenNames());
super.recover(input, re);
}
@Override
public void recoverFromMismatchedToken(IntStream in, RecognitionException re, int ttype, BitSet follow)
throws RecognitionException {
if (currentError == null)
currentError = getErrorMessage(re, getTokenNames());
super.recoverFromMismatchedToken(in, re, ttype, follow);
}
public final IParseResult parse() throws RecognitionException {
return parse(getFirstRuleName());
}
public final IParseResult parse(String entryRuleName) throws RecognitionException {
IParseResult result = null;
EObject current = null;
try {
String antlrEntryRuleName = normalizeEntryRuleName(entryRuleName);
try {
Method method = this.getClass().getMethod(antlrEntryRuleName);
current = (EObject) method.invoke(this);
} catch (InvocationTargetException ite) {
Throwable targetException = ite.getTargetException();
if (targetException instanceof RecognitionException) {
throw (RecognitionException) targetException;
}
if (targetException instanceof Exception) {
throw new WrappedException((Exception) targetException);
}
throw new RuntimeException(targetException);
} catch (Exception e) {
throw new WrappedException(e);
}
appendTrailingHiddenTokens();
} finally {
try {
appendAllTokens();
} finally {
result = new ParseResult(current, currentNode);
}
}
return result;
}
private String normalizeEntryRuleName(String entryRuleName) {
String antlrEntryRuleName;
if (!entryRuleName.startsWith("entryRule")) {
if (!entryRuleName.startsWith("rule")) {
antlrEntryRuleName = "entryRule" + entryRuleName;
} else {
antlrEntryRuleName = "entry" + Strings.toFirstUpper(entryRuleName);
}
} else {
antlrEntryRuleName = entryRuleName;
}
return antlrEntryRuleName;
}
private void tokenConsumed(Token token, LeafNode leafNode) {
List<CompositeNode> nodesDecidingOnToken = deferredLookaheadMap.get(token);
for (CompositeNode nodeDecidingOnToken : nodesDecidingOnToken) {
nodeDecidingOnToken.getLookaheadLeafNodes().add(leafNode);
}
deferredLookaheadMap.remove(token);
token2NodeMap.put(token, leafNode);
}
/**
* The current lookahead is the number of tokens that have been matched by
* the parent rule to decide that the current rule has to be called.
*
* @return the currentLookahead
*/
protected void setCurrentLookahead() {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
List<Token> lookaheadTokens = xtextTokenStream.getLookaheadTokens();
for (Token lookaheadToken : lookaheadTokens) {
LeafNode leafNode = token2NodeMap.get(lookaheadToken);
if (leafNode == null) {
deferredLookaheadMap.put(lookaheadToken, currentNode);
} else {
currentNode.getLookaheadLeafNodes().add(leafNode);
}
}
}
/**
* Sets the current lookahead to zero. See
* {@link AbstractAntlrParser#setCurrentLookahead()}
*/
protected void resetLookahead() {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
xtextTokenStream.resetLookahead();
token2NodeMap.clear();
}
protected void moveLookaheadInfo(CompositeNode source, CompositeNode target) {
EList<LeafNode> sourceLookaheadLeafNodes = source.getLookaheadLeafNodes();
target.getLookaheadLeafNodes().addAll(sourceLookaheadLeafNodes);
sourceLookaheadLeafNodes.clear();
for (Token deferredLookaheadToken : deferredLookaheadMap.keySet()) {
List<CompositeNode> nodesDecidingOnToken = deferredLookaheadMap.get(deferredLookaheadToken);
while (nodesDecidingOnToken.indexOf(source) != -1) {
nodesDecidingOnToken.set(nodesDecidingOnToken.indexOf(source), target);
}
}
}
/**
* Match is called to consume unambiguous tokens. It calls input.LA() and
* therefore increases the currentLookahead. We need to compensate. See
* {@link AbstractAntlrParser#setCurrentLookahead()}
*
* @see org.antlr.runtime.BaseRecognizer#match(org.antlr.runtime.IntStream,
* int, org.antlr.runtime.BitSet)
*/
@Override
public void match(IntStream input, int ttype, BitSet follow) throws RecognitionException {
XtextTokenStream xtextTokenStream = (XtextTokenStream) input;
int numLookaheadBeforeMatch = xtextTokenStream.getLookaheadTokens().size();
super.match(input, ttype, follow);
if (xtextTokenStream.getLookaheadTokens().size() > numLookaheadBeforeMatch) {
xtextTokenStream.removeLastLookaheadToken();
}
}
protected abstract InputStream getTokenFile();
/**
* @return
*/
protected abstract String getFirstRuleName();
}
| removed explicite usage of classpathuri resolver. The grammar is loaded via XtextResourceSetImpl, which contains and uses the ClassPathURIResolver.
| plugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java | removed explicite usage of classpathuri resolver. The grammar is loaded via XtextResourceSetImpl, which contains and uses the ClassPathURIResolver. | <ide><path>lugins/org.eclipse.xtext/src/org/eclipse/xtext/parser/antlr/AbstractAntlrParser.java
<ide> }
<ide>
<ide> private EObject getGrammarElement(String grammarElementID) {
<del> URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), URI
<del> .createURI(grammarElementID));
<del> return grammar.eResource().getResourceSet().getEObject(resolved, true);
<add> URI uri = URI
<add> .createURI(grammarElementID);
<add>// URI resolved = new ClassloaderClasspathUriResolver().resolve(getClass().getClassLoader(), uri);
<add> return grammar.eResource().getResourceSet().getEObject(uri, true);
<ide> }
<ide>
<ide> private Map<Integer, String> antlrTypeToLexerName = null; |
|
Java | mit | error: pathspec 'main/src/com/peter/codewars/KataExampleTwist.java' did not match any file(s) known to git
| afb6093685313cec5d537cb31d9eb29ea90cad4b | 1 | Peter-Liang/CodeWars-Java | package com.peter.codewars;
import java.util.Arrays;
/**
* Created by peter on 4/18/15.
* Solution of the kata 'Kata Example Twist'.
*/
public class KataExampleTwist {
public static String[] kataExampleTwist() {
String[] websites = new String[1000];
Arrays.fill(websites, "codewars");
return websites;
}
} | main/src/com/peter/codewars/KataExampleTwist.java | Solved the kata 'Kata Example Twist'.
| main/src/com/peter/codewars/KataExampleTwist.java | Solved the kata 'Kata Example Twist'. | <ide><path>ain/src/com/peter/codewars/KataExampleTwist.java
<add>package com.peter.codewars;
<add>
<add>import java.util.Arrays;
<add>
<add>/**
<add> * Created by peter on 4/18/15.
<add> * Solution of the kata 'Kata Example Twist'.
<add> */
<add>public class KataExampleTwist {
<add> public static String[] kataExampleTwist() {
<add> String[] websites = new String[1000];
<add> Arrays.fill(websites, "codewars");
<add> return websites;
<add> }
<add>} |
|
JavaScript | mit | 4742275a7991200009b430cea2630318d4ec0b6a | 0 | reify-screep/screep | var roleReserver = require('roleReserver')
roleSpawner = {
run: function(roomId) {
var store = {
'harvester': 2,
'worker': 5,
'reserver': Object.keys(Memory.claimTargets).length,
'distanceHarvester': 4,
};
//if(!roleReserver.expiringSoon()) {
// store['reserver'] = 0;
//}
for(role in store) {
var count = store[role];
var creeps = _.filter(Game.creeps, (creep) => creep.memory.role == role && creep.memory.home == roomId);
if(creeps.length < count) {
var build = undefined;
switch (role) {
case 'harvester':
build = roleSpawner.currentHarvesterBuild();
break;
case 'worker':
build = roleSpawner.currentWorkerBuild();
break;
case 'roadLayer':
build = roleSpawner.currentWorkerBuild();
break;
case 'reserver':
build = roleSpawner.currentReserverBuild();
break;
case 'claimer':
build = roleSpawner.currentClaimerBuild();
break;
case 'settler':
build = roleSpawner.currentSettlerBuild();
break;
case 'attacker':
build = roleSpawner.currentAttackerBuild();
break;
case 'distanceHarvester':
build = roleSpawner.currentDistanceHarvesterBuild();
break;
}
var spawnName = Memory[roomId].spawns[0];
var targetHome = roomId;
if(role == 'settler') {
targetHome = Memory.expansionTarget;
}
var newName = Game.spawns[spawnName].createCreep(build, undefined, {role: role, home: targetHome});
if(newName != ERR_BUSY && newName != ERR_NOT_ENOUGH_ENERGY) {
console.log('spawning new ' + role + ': ' + newName);
}
}
}
},
assembleBuild: function(stats) {
var build = [];
for(part in stats) {
for(var i=0; i < stats[part]; i++) {
var partCode = undefined;
switch (part) {
case 'WORK':
partCode = WORK;
break;
case 'CARRY':
partCode = CARRY;
break;
case 'MOVE':
partCode = MOVE;
break;
case 'ATTACK':
partCode = ATTACK;
break;
}
build.push(partCode);
}
}
return build;
},
currentWorkerBuild: function() {
var spawnRoomCapacity = Game.rooms[Memory.home].energyCapacityAvailable;
if(spawnRoomCapacity >= 1300) {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 8,
MOVE: 6,
})
} else if(spawnRoomCapacity >= 800) {
return roleSpawner.assembleBuild({
WORK: 2,
CARRY: 6,
MOVE: 4,
})
} else if(spawnRoomCapacity >= 550) {
return roleSpawner.assembleBuild({
WORK: 2,
CARRY: 3,
MOVE: 3,
})
} else {
return [WORK,CARRY,MOVE];
}
},
currentHarvesterBuild: function() {
var spawnRoomCapacity = Game.rooms[Memory.home].energyCapacityAvailable;
if(spawnRoomCapacity >= 1300) {
return roleSpawner.assembleBuild({
WORK: 6,
CARRY: 4,
MOVE: 3,
})
} else if(spawnRoomCapacity >= 800) {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 4,
MOVE: 2,
})
} else if(spawnRoomCapacity >= 550) {
return roleSpawner.assembleBuild({
WORK: 3,
CARRY: 3,
MOVE: 2,
})
} else {
return [WORK,CARRY,MOVE];
}
},
currentReserverBuild: function() {
return [CLAIM, CLAIM, MOVE, MOVE];
},
currentClaimerBuild: function() {
return [CLAIM, CARRY, CARRY, CARRY, CARRY, CARRY, MOVE, MOVE, MOVE, MOVE, MOVE, MOVE];
},
currentSettlerBuild: function() {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 4,
MOVE: 8,
})
},
currentAttackerBuild: function() {
return roleSpawner.assembleBuild({
ATTACK: 10,
MOVE: 10,
})
},
currentDistanceHarvesterBuild: function() {
return roleSpawner.assembleBuild({
WORK: 5, // 500 + 250
CARRY: 10, // 500 + 500
MOVE: 15,
})
},
}
module.exports = roleSpawner;
| src/roleSpawner.js | var roleReserver = require('roleReserver')
roleSpawner = {
run: function(roomId) {
var store = {
'harvester': 2,
'worker': 5,
'reserver': Object.keys(Memory.claimTargets).length + 1,
'distanceHarvester': 4,
};
//if(!roleReserver.expiringSoon()) {
// store['reserver'] = 0;
//}
for(role in store) {
var count = store[role];
var creeps = _.filter(Game.creeps, (creep) => creep.memory.role == role && creep.memory.home == roomId);
if(creeps.length < count) {
var build = undefined;
switch (role) {
case 'harvester':
build = roleSpawner.currentHarvesterBuild();
break;
case 'worker':
build = roleSpawner.currentWorkerBuild();
break;
case 'roadLayer':
build = roleSpawner.currentWorkerBuild();
break;
case 'reserver':
build = roleSpawner.currentReserverBuild();
break;
case 'claimer':
build = roleSpawner.currentClaimerBuild();
break;
case 'settler':
build = roleSpawner.currentSettlerBuild();
break;
case 'attacker':
build = roleSpawner.currentAttackerBuild();
break;
case 'distanceHarvester':
build = roleSpawner.currentDistanceHarvesterBuild();
break;
}
var spawnName = Memory[roomId].spawns[0];
var targetHome = roomId;
if(role == 'settler') {
targetHome = Memory.expansionTarget;
}
var newName = Game.spawns[spawnName].createCreep(build, undefined, {role: role, home: targetHome});
if(newName != ERR_BUSY && newName != ERR_NOT_ENOUGH_ENERGY) {
console.log('spawning new ' + role + ': ' + newName);
}
}
}
},
assembleBuild: function(stats) {
var build = [];
for(part in stats) {
for(var i=0; i < stats[part]; i++) {
var partCode = undefined;
switch (part) {
case 'WORK':
partCode = WORK;
break;
case 'CARRY':
partCode = CARRY;
break;
case 'MOVE':
partCode = MOVE;
break;
case 'ATTACK':
partCode = ATTACK;
break;
}
build.push(partCode);
}
}
return build;
},
currentWorkerBuild: function() {
var spawnRoomCapacity = Game.rooms[Memory.home].energyCapacityAvailable;
if(spawnRoomCapacity >= 1300) {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 8,
MOVE: 6,
})
} else if(spawnRoomCapacity >= 800) {
return roleSpawner.assembleBuild({
WORK: 2,
CARRY: 6,
MOVE: 4,
})
} else if(spawnRoomCapacity >= 550) {
return roleSpawner.assembleBuild({
WORK: 2,
CARRY: 3,
MOVE: 3,
})
} else {
return [WORK,CARRY,MOVE];
}
},
currentHarvesterBuild: function() {
var spawnRoomCapacity = Game.rooms[Memory.home].energyCapacityAvailable;
if(spawnRoomCapacity >= 1300) {
return roleSpawner.assembleBuild({
WORK: 6,
CARRY: 4,
MOVE: 3,
})
} else if(spawnRoomCapacity >= 800) {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 4,
MOVE: 2,
})
} else if(spawnRoomCapacity >= 550) {
return roleSpawner.assembleBuild({
WORK: 3,
CARRY: 3,
MOVE: 2,
})
} else {
return [WORK,CARRY,MOVE];
}
},
currentReserverBuild: function() {
return [CLAIM, CLAIM, MOVE, MOVE];
},
currentClaimerBuild: function() {
return [CLAIM, CARRY, CARRY, CARRY, CARRY, CARRY, MOVE, MOVE, MOVE, MOVE, MOVE, MOVE];
},
currentSettlerBuild: function() {
return roleSpawner.assembleBuild({
WORK: 4,
CARRY: 4,
MOVE: 8,
})
},
currentAttackerBuild: function() {
return roleSpawner.assembleBuild({
ATTACK: 10,
MOVE: 10,
})
},
currentDistanceHarvesterBuild: function() {
return roleSpawner.assembleBuild({
WORK: 5, // 500 + 250
CARRY: 10, // 500 + 500
MOVE: 15,
})
},
}
module.exports = roleSpawner;
| regular count again
| src/roleSpawner.js | regular count again | <ide><path>rc/roleSpawner.js
<ide> var store = {
<ide> 'harvester': 2,
<ide> 'worker': 5,
<del> 'reserver': Object.keys(Memory.claimTargets).length + 1,
<add> 'reserver': Object.keys(Memory.claimTargets).length,
<ide> 'distanceHarvester': 4,
<ide> };
<ide> |
|
Java | agpl-3.0 | 04e6f17f992307b8d917e8daa0d17bf358778dbe | 0 | duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test,duaneking/rockstar_test | 53e26098-2e61-11e5-9284-b827eb9e62be | hello.java | 53dcf13a-2e61-11e5-9284-b827eb9e62be | 53e26098-2e61-11e5-9284-b827eb9e62be | hello.java | 53e26098-2e61-11e5-9284-b827eb9e62be | <ide><path>ello.java
<del>53dcf13a-2e61-11e5-9284-b827eb9e62be
<add>53e26098-2e61-11e5-9284-b827eb9e62be |
|
Java | apache-2.0 | error: pathspec 'CountSummaryAlertFixManagerImpl.java' did not match any file(s) known to git
| fa285c5295746da06b643e4d5c6ccab02eabca91 | 1 | lkpnotice/lkptest2 | package com.alibaba.soc.biz.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.alibaba.aim.biz.common.beans.MailMessageBean;
import com.alibaba.aim.biz.common.enums.AppLogType;
import com.alibaba.aim.biz.common.vo.Notify;
import com.alibaba.aim.dal.domain.NtConfig;
import com.alibaba.aim.dal.mapper.NtConfigMapper;
import com.alibaba.aim.utils.AppLogUtil;
import com.alibaba.aim.utils.ArrayUtil;
import com.alibaba.aim.utils.CollectionUtil;
import com.alibaba.aim.utils.ConstantsUtil;
import com.alibaba.aim.utils.DataBaseUtil;
import com.alibaba.aim.utils.DateUtil;
import com.alibaba.aim.utils.EncryptionUtil;
import com.alibaba.aim.utils.MsgMailUtil;
import com.alibaba.aim.utils.MsgUtil;
import com.alibaba.aim.utils.NumberUtil;
import com.alibaba.aim.utils.StringUtil;
import com.alibaba.aim.utils.SysLogUtil;
import com.alibaba.alert.dal.domain.SummaryAlertV1;
import com.alibaba.alert.dal.mapper.SummaryAlertV1Mapper;
import com.alibaba.soc.biz.CountSummaryAlertFixManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
/**
* Created by lkpnotice on 2017/6/14.
*/
public class CountSummaryAlertFixManagerImpl implements CountSummaryAlertFixManager {
String tableName = "alert_adl_anti_invasion";
@Autowired
JdbcTemplate alertJdbcTemplate;
@Autowired
private SummaryAlertV1Mapper summaryAlertMapper;
@Autowired
private NtConfigMapper ntConfigMapper;
@Autowired
private AppLogUtil appLogUtil;
@Autowired
private MsgMailUtil msgMailUtil;
@Autowired
private ConstantsUtil constantsUtil;
private Map<String, SummaryAlertV1> lastSummaryRcds;
private int notifyRiskValue = 4;
private Integer[] riskLevelList = new Integer[]{4, 3, 2, 1};
private String notifyUserMail = "";
private List<SummaryAlertV1> newSummaryRcds;
private List<Notify> notifyList;
private String currBatchTime;
private List<String> currBatchLogCache;
/**重复的归并记录*/
private List<Long> multipleSummaryRcds;
private SysLogUtil logger = SysLogUtil.getLogger(getClass());
String timeRecorder = "[CountSummaryAlertFixManagerImpl-time record] ";
@Override
public boolean dispatchMain() {
timeRecorder = "[CountSummaryAlertFixManagerImpl-time record] ";
long timeStart = System.currentTimeMillis();
try {
// 参数、历史数据初始化
if (!this.initArgs()) {
return false;
}
// 归并计算
this.doCountRecursiveNameSummaryAlert();
this.doCountVipSummaryAlert();
this.doCountHostnameSummaryAlert();
} catch (Exception e) {
MsgUtil.sendErrorMsgToDev(e, getClass());
return false;
}
List<String> logInfos = new ArrayList<String>();
logInfos.add("\n" + System.currentTimeMillis() + " 归并计算完成");
try {
// 内容操作(插入、更新)
this.doUpdateSummaryAlert();
logInfos.add(System.currentTimeMillis() + " 内容操作(插入、更新)完成");
// 告警消息发送
this.doAlertNotify();
logInfos.add(System.currentTimeMillis() + " 告警发送完成");
// 更新告警发送成功的记录的状态
this.updNotifyStatus();
logInfos.add(System.currentTimeMillis() + " 更新告警发送成功的记录的状态完成");
String msgBreaker = "\n\n", msg = ArrayUtil.join(currBatchLogCache, msgBreaker);
appLogUtil.doLog(msg, AppLogType.DTS_TASK, "告警归并计算", currBatchTime);
logger.infoNotOnline(ArrayUtil.join(logInfos, "\n"));
long timeEnd = System.currentTimeMillis();
timeRecorder += "[ start: " + timeStart + " - end: " + timeEnd +" = " + (timeEnd -timeStart) + " ]";
logger.infoNotOnline(timeRecorder);
return true;
} catch (Exception e) {
MsgUtil.sendErrorMsgToDev(e, getClass());
}
logger.infoNotOnline(ArrayUtil.join(logInfos, "\n"));
return false;
}
public boolean initArgs() throws Exception {
currBatchLogCache = new ArrayList<String>();
currBatchTime = DateUtil.format(new Date());
// 从nt_config表得到所有关注的config_key
List<String> cfgKeys = Arrays.asList(
"notify_risk_value", "risk_level_split", "detail_src_ip_mapper", "notify_user_mail"
);
List<NtConfig> ntCfgs = ntConfigMapper.selectByConfigKeys(cfgKeys);
Map<String, NtConfig> ntCfgMap = new HashMap<String, NtConfig>();
for (NtConfig el : ntCfgs) {
ntCfgMap.put(el.getConfigKey(), el);
}
// notify risk value:通知威胁分值
NtConfig riskValueCfg = ntCfgMap.get("notify_risk_value");
if (riskValueCfg != null && StringUtil.isNotEmpty(riskValueCfg.getConfigValue())) {
notifyRiskValue = Integer.parseInt(riskValueCfg.getConfigValue());
}
// risk level list:威胁级别列表
NtConfig riskLevelCfg = ntCfgMap.get("risk_level_split");
if (riskLevelCfg != null && StringUtil.isNotEmpty(riskLevelCfg.getConfigValue())) {
String[] tmpStrArray = riskLevelCfg.getConfigValue().split(",");
Integer[] tmpIntArray = new Integer[tmpStrArray.length];
for (int i = 0; i < tmpStrArray.length; i++) {
tmpIntArray[i] = Integer.parseInt(tmpStrArray[i]);
}
riskLevelList = tmpIntArray;
}
// notify user list:通知人员列表(邮件)
NtConfig notifyUserMailCfg = ntCfgMap.get("notify_user_mail");
if (notifyUserMailCfg != null && StringUtil.isNotBlank(notifyUserMailCfg.getConfigValue())) {
notifyUserMail = notifyUserMailCfg.getConfigValue();
}
// 有效的归并记录
List<SummaryAlertV1> summaryAlerts = summaryAlertMapper.queryByStatus(1);
lastSummaryRcds = new HashMap<String, SummaryAlertV1>();
multipleSummaryRcds = new ArrayList<Long>();
for (SummaryAlertV1 item : summaryAlerts) {
if (lastSummaryRcds.containsKey(item.getCombinePrimaryKey())) {
multipleSummaryRcds.add(item.getId());
} else {
lastSummaryRcds.put(item.getCombinePrimaryKey(), item);
}
}
newSummaryRcds = new ArrayList<SummaryAlertV1>();
notifyList = new ArrayList<Notify>();
String msg = "有效记录数%s";
currBatchLogCache.add(String.format(msg, lastSummaryRcds.size()));
this.deleteMultipleSummaryRcds();
return true;
}
/**批量删除重复的归并记录*/
private void deleteMultipleSummaryRcds(){
if(CollectionUtil.isEmpty(multipleSummaryRcds)){
return;
}
summaryAlertMapper.deleteByBatch(multipleSummaryRcds);
}
protected JdbcTemplate getJdbcHandler() {
return this.alertJdbcTemplate;
}
/**
*
* @return
* @throws Exception
*/
public int doCountRecursiveNameSummaryAlert() throws Exception {
String args[] = queryRecursiveSql();
parseAndAddResult(args[0], args[1], "recursive_name", "getRecursiveName");
return 0;
}
/**
*
* @return
* @throws Exception
*/
public int doCountVipSummaryAlert() throws Exception {
String args[] = queryVipSql();
parseAndAddResult(args[0], args[1], "vip", "getVip");
return 0;
}
/**
*
* @return
* @throws Exception
*/
public int doCountHostnameSummaryAlert() throws Exception {
String args[] = queryHostSql();
parseAndAddResult(args[0], args[1],"hostname", "getHostname");
return 0;
}
/**
*
* @param mergeCountSql
* @param mergeSumStatusSql
* @param combineType
* @param summaryAlertMethod
* @throws Exception
*/
protected void parseAndAddResult(
String mergeCountSql, String mergeSumStatusSql, String combineType, String summaryAlertMethod
) throws Exception {
if (!constantsUtil.isOnline()) {
String tpl = "combineType: %s \n-->countSql: %s\n-->statusSql: %s";
logger.info(String.format(tpl, combineType, mergeCountSql, mergeSumStatusSql));
}
// 为了后续处理方便,将归并告警记录按照归并方式以key-value的形式存放在Map中
// key : {String} 归并方式
// value: {AdlSummaryAlert} 归并记录
Map<String, SummaryAlertV1> saRecNameMap = new HashMap<String, SummaryAlertV1>();
// 通过SQL计算细表汇总的记录
List<Map<String, Object>> summaryAlertList = DataBaseUtil.queryForList(getJdbcHandler().getDataSource(), mergeCountSql);
SummaryAlertV1 newSa = null;
ParseVal pv;
for (Map<String, Object> saMap : summaryAlertList) {
pv = new ParseVal(saMap);
newSa = new SummaryAlertV1();
newSa.setCombineType(combineType);
newSa.setRecursiveName(pv.getWithDefaultVal("recursive_name"));
newSa.setVip(this.sort(pv.getWithDefaultVal("vip")));
newSa.setHostname(this.sort(pv.getWithDefaultVal("hostname")));
newSa.setInsRuleList(this.sort(pv.getWithDefaultVal("ins_rule_list")));
newSa.setSec(this.sort(pv.getWithDefaultVal("sec_list")));
newSa.setRiskValue(this.toInt(pv.getWithDefaultVal("risk_value", "0")));
newSa.setRiskLevel(this.getRiskLevel(newSa.getRiskValue()));
newSa.setSrcIp(pv.getWithDefaultVal("src_ip"));
saRecNameMap.put((String) saMap.get(combineType), newSa);
}
List<Map<String, Object>> statusCountList = DataBaseUtil.queryForList(getJdbcHandler().getDataSource(), mergeSumStatusSql);
for (Map<String, Object> scMap : statusCountList) {
Object merageVal = scMap.get(combineType);
if (merageVal == null || StringUtil.isEmpty((String) merageVal)) {
continue;
}
SummaryAlertV1 sa = saRecNameMap.get(merageVal);
if (sa == null) {
continue;
}
sa.setGmtCreate((Date) scMap.get("gmt_create"));
sa.setProgress((getInt(scMap, "all_sum") - getInt(scMap, "undo_sum")) + "/" + scMap.get("all_sum"));
sa.setProgressStatus(((BigDecimal) scMap.get("undo_sum")).intValue() <= 0 ? "已完成" : "未完成");
sa.setAlgoInfo(getInt(scMap, "algo_valid_sum") + "/" + getInt(scMap, "algo_marked_sum"));
String priKey = sa.getCombineType() + ":" + (String) sa.getClass().getMethod(summaryAlertMethod).invoke(sa);
sa.setCombinePrimaryKey(priKey);
newSummaryRcds.add(sa);
}
String msg = String.format("combineType: %s\n"
+ " --> SummaryCountSql:%s\n"
+ " --> StatusCountSql :%s\n"
+ " --> summaryAlertListSize:%s, statusCountListSize:%s, newSummaryRcds size: %s",
combineType,
mergeCountSql,
mergeSumStatusSql,
summaryAlertList.size(), statusCountList.size(), newSummaryRcds.size()
);
currBatchLogCache.add(msg);
}
private int getInt(Map<String, Object> dataMap, String key) throws Exception {
Object valObj = dataMap.get(key);
if (valObj == null) {
return 0;
}
return ((BigDecimal) valObj).intValue();
}
private String getRiskLevel(int levelVal) throws Exception {
int idx1 = 0, idx2 = 1, idx3 = 2, idx4 = 3;
if (levelVal >= this.riskLevelList[idx1]) {
return "严重";
} else if (levelVal >= this.riskLevelList[idx2]) {
return "高";
} else if (levelVal >= this.riskLevelList[idx3]) {
return "中";
} else if (levelVal >= this.riskLevelList[idx4]) {
return "低";
} else {
return "低";
}
}
private String sort(Object str) throws Exception {
String t = (String) str;
if (StringUtil.isNotEmpty(t)) {
String[] tmp = t.split(",");
Arrays.sort(tmp);
return ArrayUtil.join(tmp, ",");
}
return t;
}
/** string to int */
private int toInt(String riskValue) {
try {
return (int) Double.parseDouble(riskValue);
} catch (NumberFormatException e) {
logger.info("ERROR", e);
}
return 0;
}
private Long insertSummaryAlert(SummaryAlertV1 sa) throws Exception {
sa.setCreateTime(new Date());
sa.setStatus((short) 1);
summaryAlertMapper.insertSelective(sa);
return sa.getId();
}
private void updSummaryAlert(SummaryAlertV1 sa) throws Exception {
sa.setHashValue(null);
summaryAlertMapper.updateByPrimaryKeySelective(sa);
}
/**
* 更新告警状态,插入或者更新
* @return
* @throws Exception
*/
public boolean doUpdateSummaryAlert() throws Exception {
int addCount = 0, udpCount = 0, delCount = 0;
String hashSrc, combinePrimaryKey, delSql = null;
// 所有需要新增的combinePrimaryKey
List<String> allNewCombineKey = new ArrayList<String>();
// 重复的combinePrimaryKey
List<String> dupCombineKey = new ArrayList<String>();
// 已经插入成功的AdlSummaryAlert
List<SummaryAlertV1> insertedRcds = new ArrayList<SummaryAlertV1>();
//logger.infoNotOnline(String.format("归并告警产生了%s条记录", newSummaryRcds.size()));
timeRecorder += "[newSummaryRcds: " + newSummaryRcds.size() + " ]";
for (SummaryAlertV1 nSa : this.newSummaryRcds) {
//保证新计算出的归并告警的惟一性
if (allNewCombineKey.contains(nSa.getCombinePrimaryKey())) {
dupCombineKey.add(nSa.getCombinePrimaryKey());
continue;
}
allNewCombineKey.add(nSa.getCombinePrimaryKey());
// 计算归并告警的hashValue
hashSrc = "%s%s%s%s%s";
hashSrc = String.format(
hashSrc, nSa.getRecursiveName(), nSa.getVip(), nSa.getHostname(),
nSa.getRiskValue(), nSa.getRiskLevel()
);
nSa.setHashValue(EncryptionUtil.md5(hashSrc));
combinePrimaryKey = nSa.getCombinePrimaryKey();
// * 在原来的汇中表中没有找到,插入新记录
if (this.lastSummaryRcds.get(combinePrimaryKey) == null) {
addCount += 1;
// 插入汇总记录
this.insertSummaryAlert(nSa);
// 将汇总记录的Id,更新到相关联的明细表的summary_id字段上,建立关系
insertedRcds.add(nSa);
if (!constantsUtil.isOnline()) {
logger.info(String.format("归并告警, '%s' 被插入, 记录ID: %s", combinePrimaryKey, nSa.getId()));
}
// * 满足加入到告警列表的条件
if (nSa.getRiskValue() >= this.notifyRiskValue) {
this.notifyList.add(new Notify(nSa, 0));
}
}
// * 在原来的汇中表找到同样combine_primary_key的行,更新该行记录
else {
// 得到并从缓存中删除这条记录
SummaryAlertV1 oSa = this.lastSummaryRcds.remove(combinePrimaryKey);
boolean isHashValueSame = nSa.getHashValue().equals(oSa.getHashValue());
boolean isGmtCreateSame = nSa.getGmtCreate().getTime() == oSa.getGmtCreate().getTime();
boolean isProStatusSame = nSa.getProgressStatus().equals(oSa.getProgressStatus());
boolean isProgresssSame = nSa.getProgress().equals(oSa.getProgress());
// 内容一样,不做更新
if (isHashValueSame && isGmtCreateSame && isProStatusSame && isProgresssSame) {
continue;
}
udpCount += 1;
nSa.setId(oSa.getId());
if (!constantsUtil.isOnline()) {
logger.info(String.format("归并告警, %s 归并方式的记录将被更新, 记录ID: %s", combinePrimaryKey, nSa.getId()));
}
// 内容不一样,需要更新
this.updSummaryAlert(nSa);
// * 满足加入到告警列表的条件
if (nSa.getRiskValue() > oSa.getRiskValue() && nSa.getRiskValue() >= this.notifyRiskValue) {
this.notifyList.add(new Notify(nSa, oSa.getRiskValue()));
}
}
}
// 启动批量更新告警明细记录
// this.batchUpdDetailSummaryId(insertedRcds);
// * 废弃(更新status = 0)原来在汇中表中有而在新的归并记录中没有的汇总记录
List<String> keys = new ArrayList<String>();
String ins = null;
Iterator<Entry<String, SummaryAlertV1>> it = this.lastSummaryRcds.entrySet().iterator();
Entry<String, SummaryAlertV1> entry;
while (it.hasNext()){
entry = it.next();
SummaryAlertV1 oSa = entry.getValue();
if (oSa == null) {
continue;
}
keys.add(oSa.getCombinePrimaryKey());
delCount += 1;
}
logger.infoNotOnline(String.format("归并告警记录: 新增了%s条, 更新了%s条, %s条记录会被废弃", addCount, udpCount, delCount));
this.disableRecordByBatch(keys);
// do log
String dupKeys = "";
if (dupCombineKey.size() > 0) {
dupKeys = ", filterInvalidSummaryAlert=" + "'" + ArrayUtil.join(dupCombineKey, "','") + "'";
}
String msg = "alert_adl_summary_alert add=%s, update=%s, delete(set status=0)=%s%s";
msg = String.format(msg, addCount, udpCount, delCount, dupKeys);
currBatchLogCache.add(msg);
return true;
}
private void disableRecordByBatch(List<String> keys) {
if (CollectionUtil.isEmpty(keys)) {
return;
}
// 每次更新的最大记录数
int eachCount = 300;
int size = keys.size(), times = NumberUtil.quotientUp(size, eachCount);
String ins, delSql;
for (int i = 0, s, e; i < times; i++) {
s = i * eachCount;
e = (i + 1) * eachCount;
e = e > size ? size : e;
List<String> subList = keys.subList(s, e);
ins = "'" + ArrayUtil.join(subList, "','") + "'";
delSql = String.format(
"UPDATE %s SET `status`=0 WHERE combine_primary_key IN(%s) AND status = 1",
"alert_adl_summary_alert", ins
);
logger.infoNotOnline(String.format("删除过滤的归并告警记录SQL: %s", delSql));
getJdbcHandler().execute(delSql);
}
}
/**
* 邮件通知
* @return
* @throws Exception
*/
public boolean doAlertNotify() throws Exception {
// 没有需要通知的告警消息 或者 没有需要通知的人, 则不需要发送告警消息
if (this.notifyList.size() == 0 || StringUtil.isNotBlank(notifyUserMail)) {
return true;
}
// 组织通知内容
String currTime = DateUtil.format(new Date()), tmpMsg = null;
List<String> newMsg = new ArrayList<String>(), upgradeMsg = new ArrayList<String>();
for (Notify n : this.notifyList) {
if (n.getPreRiskValue() == 0) {
// 新增告警
tmpMsg = "[AIM]新增告警。应用信息:%s,规则:%s,风险值:%s,告警时间:%s";
tmpMsg = String.format(tmpMsg, n.getCombinePrimaryKey(), n.getInsRuleList(), n.getRiskValue(), currTime);
newMsg.add(tmpMsg);
} else {
// 升级告警
tmpMsg = "[AIM]告警升级。应用信息:%s,规则:%s,风险值:%s,告警时间:%s,上次风险值:%s,处理状态:%s";
tmpMsg = String.format(
tmpMsg, n.getCombinePrimaryKey(), n.getInsRuleList(), n.getRiskValue(), currTime, n.getPreRiskValue(),
n.getProgressStatus()
);
upgradeMsg.add(tmpMsg);
}
// 设置为 "已发送告警通知消息" 状态
n.setSendSucceed(true);
}
// 向员工发送邮件
boolean hasMsgToSend = (CollectionUtil.isNotEmpty(newMsg) || CollectionUtil.isNotEmpty(newMsg));
if (hasMsgToSend) {
MailMessageBean mmb = new MailMessageBean();
mmb.setMailTo(this.notifyUserMail);
tmpMsg = "告警归并计算告警 - " + DateUtil.format(new Date(), "yyyy-MM-dd");
mmb.setSubject(tmpMsg);
tmpMsg = "告警归并计算产生以下归并记录, 请关注:<br/><br/>新增告警:<br/>%s<br/><br/>告警升级:%s";
tmpMsg = String.format(tmpMsg, ArrayUtil.join(newMsg, "<br/>"), ArrayUtil.join(upgradeMsg, "<br/>"));
mmb.setText(tmpMsg);
msgMailUtil.sendMail(mmb);
}
return true;
}
/**
* 更新通知数据
* @throws Exception
*/
public void updNotifyStatus() throws Exception {
if (this.notifyList.size() == 0) {
return;
}
String currDateTime, sql, ins;
List<String> keys = new ArrayList<String>();
for (Notify n : this.notifyList) {
if (!n.isSendSucceed()) {
continue;
}
keys.add(n.getCombinePrimaryKey());
}
if (keys.size() == 0) {
return;
}
ins = "'" + ArrayUtil.join(keys, "','") + "'";
currDateTime = DateUtil.format(new Date());
sql = "UPDATE %s SET is_notified='%s', notify_time='%s' WHERE combine_primary_key IN(%s) AND is_notified != 1 AND status = 1";
sql = String.format(sql, "alert_adl_summary_alert", "1", currDateTime, ins);
getJdbcHandler().execute(sql);
}
/**
* 产品线归并
* 返回值为2个元素String数组,[0]是归并预警SQL [1]是归并预警状态SQL
* @return
*/
public String[] queryRecursiveSql(){
StringBuilder sBuild = createStrBuilderInstance(" ");
/********************************** 按照产品线归并************************/
/*第一层查询处理*/
String sqlSelectVipLv1 = sBuild.append(" SELECT recursive_name, ").
append(" vip, ").
append(" HOST, ").
append(" rule_id, ").
append(" sec, ").
append(" max(risk_value) risk_value, ").
append(" src_ip ").
toString();
String sqlSelectHostLv1 = reset(sBuild).append(" SELECT recursive_name, ").
append(" vip, ").
append(" hostname, ").
append(" rule_id, ").
append(" sec, ").
append(" max(risk_value) risk_value, ").
append(" src_ip ").
toString();
String sqlFromLv1 = reset(sBuild).
append(" from %s ").
toString();
String sqlWhereLv1 = reset(sBuild).
append(" where 1=1 ").
append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
append(" and recursive_name IS NOT NULL ").
append(" and recursive_name !='' ").
append(" and recursive_name NOT LIKE '开发测试%%' ").
append(" %s ").
toString();
String conditionHost = " AND (hostname is not null and hostname <> '')";
String conditionVip = " AND (hostname is null or hostname = '')";
String groupByHostLv1 = " GROUP BY rule_id, hostname, recursive_name ";
String groupByVipLv1 = " GROUP BY rule_id, vip, recursive_name ";
String sqlQueryVipLv1 = reset(sBuild)
.append(sqlSelectVipLv1)
.append(String.format(sqlFromLv1,tableName))
.append(String.format(sqlWhereLv1,conditionVip))
.append(groupByVipLv1)
.toString();
String sqlQueryHostLv1 = reset(sBuild)
.append(sqlSelectHostLv1)
.append(String.format(sqlFromLv1,tableName))
.append(String.format(sqlWhereLv1,conditionHost))
.append(groupByHostLv1)
.toString();
/*第二层查询处理*/
String sqlQueryVipLv2 = reset(sBuild)
.append(" select ")
.append(" recursive_name, ")
.append(" GROUP_CONCAT(DISTINCT vip) AS vip, ")
.append(" GROUP_CONCAT(DISTINCT HOST) AS hostname, ")
.append(" SUM(risk_value)/COUNT(DISTINCT vip) AS risk_value, ")
.append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
.append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
.append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
.append(" from ")
.append("(" + sqlQueryVipLv1 + ") as Ta ")
.append(" group by recursive_name ")
.toString();
String sqlQueryHostLv2 = reset(sBuild)
.append(" select ")
.append(" recursive_name, ")
.append(" GROUP_CONCAT(DISTINCT vip) AS vip, ")
.append(" GROUP_CONCAT(DISTINCT hostname) AS hostname, ")
.append(" SUM(risk_value)/COUNT(DISTINCT hostname) AS risk_value, ")
.append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
.append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
.append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
.append(" from ")
.append("(" + sqlQueryHostLv1 + ") as Tb ")
.append(" group by recursive_name ")
.toString();
/*第三层查询处理*/
String sqlQueryProdLine = reset(sBuild)
.append(" select ")
.append(" recursive_name, ")
.append(" GROUP_CONCAT(vip) vip, ")
.append(" GROUP_CONCAT(hostname) hostname, ")
.append(" SUM(risk_value) risk_value, ")
.append(" GROUP_CONCAT(ins_rule_list) ins_rule_list, ")
.append(" GROUP_CONCAT(sec_list) sec_list, ")
.append(" GROUP_CONCAT(src_ip) src_ip ")
.append(" from ")
.append(" ( ")
.append( "(" + sqlQueryVipLv2 + ") UNION ALL (" + sqlQueryHostLv2+ ") ")
.append(" ) allAlert ")
.append(" group by recursive_name ")
.toString();
/*按产品线归并的状态归并状态查询*/
String sqlQueryProStatus = reset(sBuild)
.append(" select ")
.append(" recursive_name, ")
.append(" sum(1) AS all_sum, ")
.append(" sum(handle_status='未确认') AS undo_sum, ")
.append(" sum( algo_flag=0) as algo_valid_sum, ")
.append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
.append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
.append(" from " + tableName + " all_alert ")
.append(" where 1=1 ")
.append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
.append(" and recursive_name IS NOT NULL ")
.append(" and recursive_name != '' ")
.append(" and recursive_name NOT LIKE '开发测试%%' ")
.append(" and data_type != 'anomaly' ")
.append(" GROUP BY recursive_name ")
.toString();
return new String[]{sqlQueryProdLine,sqlQueryProStatus};
}
public String[] queryVipSql(){
StringBuilder sBuild = createStrBuilderInstance(" ");
/********************************** 按照VIP归并************************/
/*第一层查询处理*/
String sqlSelectVipLv1 = sBuild.append(" SELECT recursive_name, ").
append(" vip, ").
append(" HOST, ").
append(" rule_id, ").
append(" sec, ").
append(" max(risk_value) risk_value, ").
append(" src_ip ").
toString();
String sqlSelectHostLv1 = reset(sBuild).append(" SELECT recursive_name, ").
append(" vip, ").
append(" hostname, ").
append(" rule_id, ").
append(" sec, ").
append(" max(risk_value) risk_value, ").
append(" src_ip ").
toString();
String sqlFromLv1 = reset(sBuild).
append(" from %s ").
toString();
String sqlWhereLv1 = reset(sBuild).
append(" where 1=1 ").
append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ").
append(" and vip <> '' ").
append(" %s ").
toString();
String conditionHost = " AND (hostname is not null and hostname <> '') ";
String conditionVip = " AND (hostname is null or hostname = '') ";
String groupByHostLv1 = " GROUP BY rule_id, hostname, vip ";
String groupByVipLv1 = " GROUP BY rule_id, vip ";
String sqlQueryVipLv1 = reset(sBuild)
.append(sqlSelectVipLv1)
.append(String.format(sqlFromLv1,tableName))
.append(String.format(sqlWhereLv1,conditionVip))
.append(groupByVipLv1)
.toString();
String sqlQueryHostLv1 = reset(sBuild)
.append(sqlSelectHostLv1)
.append(String.format(sqlFromLv1,tableName))
.append(String.format(sqlWhereLv1,conditionHost))
.append(groupByHostLv1)
.toString();
/*第二层查询处理*/
String sqlQueryVipLv2 = reset(sBuild)
.append(" select ")
.append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
.append(" vip, ")
.append(" GROUP_CONCAT(DISTINCT HOST) AS hostname, ")
.append(" SUM(risk_value)/COUNT(DISTINCT vip) AS risk_value, ")
.append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
.append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
.append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
.append(" from ")
.append("(" + sqlQueryVipLv1 + ") as Ta ")
.append(" group by vip ")
.toString();
String sqlQueryHostLv2 = reset(sBuild)
.append(" select ")
.append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
.append(" vip, ")
.append(" GROUP_CONCAT(DISTINCT hostname) AS hostname, ")
.append(" SUM(risk_value)/COUNT(DISTINCT hostname) AS risk_value, ")
.append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
.append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
.append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
.append(" from ")
.append("(" + sqlQueryHostLv1 + ") as Tb ")
.append(" group by vip ")
.toString();
/*第三层查询处理*/
String sqlQueryVip = reset(sBuild)
.append(" select ")
.append(" GROUP_CONCAT(recursive_name) AS recursive_name, ")
.append(" vip, ")
.append(" GROUP_CONCAT(hostname) hostname, ")
.append(" SUM(risk_value) risk_value, ")
.append(" GROUP_CONCAT(ins_rule_list) ins_rule_list, ")
.append(" GROUP_CONCAT(sec_list) sec_list, ")
.append(" GROUP_CONCAT(src_ip) src_ip ")
.append(" from ")
.append(" ( ")
.append( "(" + sqlQueryVipLv2 + ") UNION ALL (" + sqlQueryHostLv2+ ") ")
.append(" ) allAlert ")
.append(" group by vip ")
.toString();
/*按VIP归并的状态归并状态查询*/
String sqlQueryVipStatus = reset(sBuild)
.append(" select ")
.append(" vip, ")
.append(" sum(1) AS all_sum, ")
.append(" sum(handle_status='未确认') AS undo_sum, ")
.append(" sum( algo_flag=0) as algo_valid_sum, ")
.append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
.append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
.append(" from " + tableName + " all_alert ")
.append(" where 1=1 ")
.append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
.append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ")
.append(" and vip <> '' ")
.append(" and data_type != 'anomaly' ")
.append(" GROUP BY vip ")
.toString();
return new String[]{sqlQueryVip,sqlQueryVipStatus};
}
/**
* 按照主机类型进行归并
* @return
*/
public String[] queryHostSql(){
/********************************** 按照HOSTNAME归并************************/
StringBuilder sBuild = createStrBuilderInstance(" ");
String sqlSelectHostLv1 = sBuild.append(" SELECT recursive_name, ").
append(" vip, ").
append(" hostname, ").
append(" rule_id, ").
append(" sec, ").
append(" max(risk_value) risk_value, ").
append(" src_ip ").
toString();
String sqlFromLv1 = reset(sBuild).
append(" from %s ").
toString();
String sqlWhereLv1 = reset(sBuild).
append(" where 1=1 ").
append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ").
append(" and ( vip = '' or vip is null ) ").
append(" %s ").
toString();
String conditionHost = " AND (hostname is not null and hostname <> '') ";
String groupByHostLv1 = " GROUP BY rule_id,hostname ";
String sqlQueryHostLv1 = reset(sBuild)
.append(sqlSelectHostLv1)
.append(String.format(sqlFromLv1,tableName))
.append(String.format(sqlWhereLv1,conditionHost))
.append(groupByHostLv1)
.toString();
/*第二层查询处理*/
String sqlQueryHostStr = reset(sBuild)
.append(" select ")
.append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
.append(" hostname, ")
.append(" SUM(risk_value) AS risk_value, ")
.append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
.append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
.append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
.append(" from ")
.append("(" + sqlQueryHostLv1 + ") as Tb ")
.append(" group by hostname ")
.toString();
/*状态查询*/
String sqlQueryHostStatus = reset(sBuild)
.append(" select ")
.append(" hostname, ")
.append(" sum(1) AS all_sum, ")
.append(" sum(handle_status='未确认') AS undo_sum, ")
.append(" sum( algo_flag=0) as algo_valid_sum, ")
.append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
.append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
.append(" from " + tableName + " all_alert ")
.append(" where 1=1 ")
.append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
.append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ")
.append(" and (vip = '' or vip is null) ")
.append(" and hostname is not null and hostname <> '' ")
.append(" and data_type != 'anomaly' ")
.append(" GROUP BY hostname ")
.toString();
return new String[] {sqlQueryHostStr,sqlQueryHostStatus};
}
protected StringBuilder createStrBuilderInstance(String initStr){
return new StringBuilder(initStr);
}
protected StringBuilder reset(StringBuilder strBui){
return strBui.delete(0,strBui.length());
}
private class ParseVal {
Map<String, Object> saMap;
public ParseVal(Map<String, Object> saMap) {
this.saMap = saMap;
}
public String getWithDefaultVal(String key, String... defVal) {
Object obj = saMap.get(key);
if (obj == null) {
return (defVal.length == 0) ? "" : defVal[0];
}
return obj.toString();
}
}
}
| CountSummaryAlertFixManagerImpl.java | 11
11
| CountSummaryAlertFixManagerImpl.java | 11 | <ide><path>ountSummaryAlertFixManagerImpl.java
<add>package com.alibaba.soc.biz.impl;
<add>
<add>import java.math.BigDecimal;
<add>import java.util.ArrayList;
<add>import java.util.Arrays;
<add>import java.util.Date;
<add>import java.util.HashMap;
<add>import java.util.Iterator;
<add>import java.util.List;
<add>import java.util.Map;
<add>import java.util.Map.Entry;
<add>
<add>import com.alibaba.aim.biz.common.beans.MailMessageBean;
<add>import com.alibaba.aim.biz.common.enums.AppLogType;
<add>import com.alibaba.aim.biz.common.vo.Notify;
<add>import com.alibaba.aim.dal.domain.NtConfig;
<add>import com.alibaba.aim.dal.mapper.NtConfigMapper;
<add>import com.alibaba.aim.utils.AppLogUtil;
<add>import com.alibaba.aim.utils.ArrayUtil;
<add>import com.alibaba.aim.utils.CollectionUtil;
<add>import com.alibaba.aim.utils.ConstantsUtil;
<add>import com.alibaba.aim.utils.DataBaseUtil;
<add>import com.alibaba.aim.utils.DateUtil;
<add>import com.alibaba.aim.utils.EncryptionUtil;
<add>import com.alibaba.aim.utils.MsgMailUtil;
<add>import com.alibaba.aim.utils.MsgUtil;
<add>import com.alibaba.aim.utils.NumberUtil;
<add>import com.alibaba.aim.utils.StringUtil;
<add>import com.alibaba.aim.utils.SysLogUtil;
<add>import com.alibaba.alert.dal.domain.SummaryAlertV1;
<add>import com.alibaba.alert.dal.mapper.SummaryAlertV1Mapper;
<add>import com.alibaba.soc.biz.CountSummaryAlertFixManager;
<add>
<add>import org.springframework.beans.factory.annotation.Autowired;
<add>import org.springframework.jdbc.core.JdbcTemplate;
<add>
<add>/**
<add> * Created by lkpnotice on 2017/6/14.
<add> */
<add>public class CountSummaryAlertFixManagerImpl implements CountSummaryAlertFixManager {
<add>
<add> String tableName = "alert_adl_anti_invasion";
<add> @Autowired
<add> JdbcTemplate alertJdbcTemplate;
<add> @Autowired
<add> private SummaryAlertV1Mapper summaryAlertMapper;
<add> @Autowired
<add> private NtConfigMapper ntConfigMapper;
<add> @Autowired
<add> private AppLogUtil appLogUtil;
<add> @Autowired
<add> private MsgMailUtil msgMailUtil;
<add> @Autowired
<add> private ConstantsUtil constantsUtil;
<add>
<add>
<add> private Map<String, SummaryAlertV1> lastSummaryRcds;
<add> private int notifyRiskValue = 4;
<add> private Integer[] riskLevelList = new Integer[]{4, 3, 2, 1};
<add> private String notifyUserMail = "";
<add> private List<SummaryAlertV1> newSummaryRcds;
<add> private List<Notify> notifyList;
<add> private String currBatchTime;
<add> private List<String> currBatchLogCache;
<add> /**重复的归并记录*/
<add> private List<Long> multipleSummaryRcds;
<add> private SysLogUtil logger = SysLogUtil.getLogger(getClass());
<add>
<add> String timeRecorder = "[CountSummaryAlertFixManagerImpl-time record] ";
<add>
<add>
<add>
<add> @Override
<add> public boolean dispatchMain() {
<add> timeRecorder = "[CountSummaryAlertFixManagerImpl-time record] ";
<add> long timeStart = System.currentTimeMillis();
<add> try {
<add> // 参数、历史数据初始化
<add> if (!this.initArgs()) {
<add> return false;
<add> }
<add>
<add> // 归并计算
<add> this.doCountRecursiveNameSummaryAlert();
<add> this.doCountVipSummaryAlert();
<add> this.doCountHostnameSummaryAlert();
<add> } catch (Exception e) {
<add> MsgUtil.sendErrorMsgToDev(e, getClass());
<add> return false;
<add> }
<add>
<add> List<String> logInfos = new ArrayList<String>();
<add> logInfos.add("\n" + System.currentTimeMillis() + " 归并计算完成");
<add>
<add> try {
<add> // 内容操作(插入、更新)
<add> this.doUpdateSummaryAlert();
<add> logInfos.add(System.currentTimeMillis() + " 内容操作(插入、更新)完成");
<add>
<add> // 告警消息发送
<add> this.doAlertNotify();
<add> logInfos.add(System.currentTimeMillis() + " 告警发送完成");
<add>
<add> // 更新告警发送成功的记录的状态
<add> this.updNotifyStatus();
<add> logInfos.add(System.currentTimeMillis() + " 更新告警发送成功的记录的状态完成");
<add>
<add> String msgBreaker = "\n\n", msg = ArrayUtil.join(currBatchLogCache, msgBreaker);
<add> appLogUtil.doLog(msg, AppLogType.DTS_TASK, "告警归并计算", currBatchTime);
<add>
<add> logger.infoNotOnline(ArrayUtil.join(logInfos, "\n"));
<add>
<add> long timeEnd = System.currentTimeMillis();
<add> timeRecorder += "[ start: " + timeStart + " - end: " + timeEnd +" = " + (timeEnd -timeStart) + " ]";
<add> logger.infoNotOnline(timeRecorder);
<add>
<add> return true;
<add> } catch (Exception e) {
<add> MsgUtil.sendErrorMsgToDev(e, getClass());
<add> }
<add>
<add> logger.infoNotOnline(ArrayUtil.join(logInfos, "\n"));
<add>
<add> return false;
<add> }
<add>
<add>
<add>
<add>
<add>
<add> public boolean initArgs() throws Exception {
<add> currBatchLogCache = new ArrayList<String>();
<add> currBatchTime = DateUtil.format(new Date());
<add>
<add> // 从nt_config表得到所有关注的config_key
<add> List<String> cfgKeys = Arrays.asList(
<add> "notify_risk_value", "risk_level_split", "detail_src_ip_mapper", "notify_user_mail"
<add> );
<add> List<NtConfig> ntCfgs = ntConfigMapper.selectByConfigKeys(cfgKeys);
<add> Map<String, NtConfig> ntCfgMap = new HashMap<String, NtConfig>();
<add> for (NtConfig el : ntCfgs) {
<add> ntCfgMap.put(el.getConfigKey(), el);
<add> }
<add>
<add> // notify risk value:通知威胁分值
<add> NtConfig riskValueCfg = ntCfgMap.get("notify_risk_value");
<add> if (riskValueCfg != null && StringUtil.isNotEmpty(riskValueCfg.getConfigValue())) {
<add> notifyRiskValue = Integer.parseInt(riskValueCfg.getConfigValue());
<add> }
<add>
<add> // risk level list:威胁级别列表
<add> NtConfig riskLevelCfg = ntCfgMap.get("risk_level_split");
<add> if (riskLevelCfg != null && StringUtil.isNotEmpty(riskLevelCfg.getConfigValue())) {
<add> String[] tmpStrArray = riskLevelCfg.getConfigValue().split(",");
<add> Integer[] tmpIntArray = new Integer[tmpStrArray.length];
<add> for (int i = 0; i < tmpStrArray.length; i++) {
<add> tmpIntArray[i] = Integer.parseInt(tmpStrArray[i]);
<add> }
<add> riskLevelList = tmpIntArray;
<add> }
<add>
<add> // notify user list:通知人员列表(邮件)
<add> NtConfig notifyUserMailCfg = ntCfgMap.get("notify_user_mail");
<add> if (notifyUserMailCfg != null && StringUtil.isNotBlank(notifyUserMailCfg.getConfigValue())) {
<add> notifyUserMail = notifyUserMailCfg.getConfigValue();
<add> }
<add>
<add>
<add> // 有效的归并记录
<add> List<SummaryAlertV1> summaryAlerts = summaryAlertMapper.queryByStatus(1);
<add> lastSummaryRcds = new HashMap<String, SummaryAlertV1>();
<add> multipleSummaryRcds = new ArrayList<Long>();
<add> for (SummaryAlertV1 item : summaryAlerts) {
<add> if (lastSummaryRcds.containsKey(item.getCombinePrimaryKey())) {
<add> multipleSummaryRcds.add(item.getId());
<add> } else {
<add> lastSummaryRcds.put(item.getCombinePrimaryKey(), item);
<add> }
<add> }
<add>
<add> newSummaryRcds = new ArrayList<SummaryAlertV1>();
<add> notifyList = new ArrayList<Notify>();
<add>
<add> String msg = "有效记录数%s";
<add> currBatchLogCache.add(String.format(msg, lastSummaryRcds.size()));
<add>
<add> this.deleteMultipleSummaryRcds();
<add>
<add> return true;
<add> }
<add>
<add> /**批量删除重复的归并记录*/
<add> private void deleteMultipleSummaryRcds(){
<add> if(CollectionUtil.isEmpty(multipleSummaryRcds)){
<add> return;
<add> }
<add>
<add> summaryAlertMapper.deleteByBatch(multipleSummaryRcds);
<add> }
<add>
<add>
<add> protected JdbcTemplate getJdbcHandler() {
<add> return this.alertJdbcTemplate;
<add> }
<add>
<add> /**
<add> *
<add> * @return
<add> * @throws Exception
<add> */
<add>
<add> public int doCountRecursiveNameSummaryAlert() throws Exception {
<add> String args[] = queryRecursiveSql();
<add> parseAndAddResult(args[0], args[1], "recursive_name", "getRecursiveName");
<add> return 0;
<add> }
<add>
<add>
<add> /**
<add> *
<add> * @return
<add> * @throws Exception
<add> */
<add>
<add> public int doCountVipSummaryAlert() throws Exception {
<add> String args[] = queryVipSql();
<add> parseAndAddResult(args[0], args[1], "vip", "getVip");
<add> return 0;
<add> }
<add>
<add> /**
<add> *
<add> * @return
<add> * @throws Exception
<add> */
<add>
<add> public int doCountHostnameSummaryAlert() throws Exception {
<add> String args[] = queryHostSql();
<add> parseAndAddResult(args[0], args[1],"hostname", "getHostname");
<add> return 0;
<add> }
<add>
<add> /**
<add> *
<add> * @param mergeCountSql
<add> * @param mergeSumStatusSql
<add> * @param combineType
<add> * @param summaryAlertMethod
<add> * @throws Exception
<add> */
<add> protected void parseAndAddResult(
<add> String mergeCountSql, String mergeSumStatusSql, String combineType, String summaryAlertMethod
<add> ) throws Exception {
<add> if (!constantsUtil.isOnline()) {
<add> String tpl = "combineType: %s \n-->countSql: %s\n-->statusSql: %s";
<add> logger.info(String.format(tpl, combineType, mergeCountSql, mergeSumStatusSql));
<add> }
<add>
<add> // 为了后续处理方便,将归并告警记录按照归并方式以key-value的形式存放在Map中
<add> // key : {String} 归并方式
<add> // value: {AdlSummaryAlert} 归并记录
<add> Map<String, SummaryAlertV1> saRecNameMap = new HashMap<String, SummaryAlertV1>();
<add>
<add> // 通过SQL计算细表汇总的记录
<add> List<Map<String, Object>> summaryAlertList = DataBaseUtil.queryForList(getJdbcHandler().getDataSource(), mergeCountSql);
<add> SummaryAlertV1 newSa = null;
<add> ParseVal pv;
<add> for (Map<String, Object> saMap : summaryAlertList) {
<add> pv = new ParseVal(saMap);
<add>
<add> newSa = new SummaryAlertV1();
<add> newSa.setCombineType(combineType);
<add> newSa.setRecursiveName(pv.getWithDefaultVal("recursive_name"));
<add> newSa.setVip(this.sort(pv.getWithDefaultVal("vip")));
<add> newSa.setHostname(this.sort(pv.getWithDefaultVal("hostname")));
<add> newSa.setInsRuleList(this.sort(pv.getWithDefaultVal("ins_rule_list")));
<add> newSa.setSec(this.sort(pv.getWithDefaultVal("sec_list")));
<add> newSa.setRiskValue(this.toInt(pv.getWithDefaultVal("risk_value", "0")));
<add> newSa.setRiskLevel(this.getRiskLevel(newSa.getRiskValue()));
<add> newSa.setSrcIp(pv.getWithDefaultVal("src_ip"));
<add>
<add> saRecNameMap.put((String) saMap.get(combineType), newSa);
<add> }
<add>
<add> List<Map<String, Object>> statusCountList = DataBaseUtil.queryForList(getJdbcHandler().getDataSource(), mergeSumStatusSql);
<add> for (Map<String, Object> scMap : statusCountList) {
<add> Object merageVal = scMap.get(combineType);
<add> if (merageVal == null || StringUtil.isEmpty((String) merageVal)) {
<add> continue;
<add> }
<add>
<add> SummaryAlertV1 sa = saRecNameMap.get(merageVal);
<add> if (sa == null) {
<add> continue;
<add> }
<add>
<add> sa.setGmtCreate((Date) scMap.get("gmt_create"));
<add> sa.setProgress((getInt(scMap, "all_sum") - getInt(scMap, "undo_sum")) + "/" + scMap.get("all_sum"));
<add> sa.setProgressStatus(((BigDecimal) scMap.get("undo_sum")).intValue() <= 0 ? "已完成" : "未完成");
<add> sa.setAlgoInfo(getInt(scMap, "algo_valid_sum") + "/" + getInt(scMap, "algo_marked_sum"));
<add>
<add> String priKey = sa.getCombineType() + ":" + (String) sa.getClass().getMethod(summaryAlertMethod).invoke(sa);
<add> sa.setCombinePrimaryKey(priKey);
<add>
<add> newSummaryRcds.add(sa);
<add> }
<add>
<add> String msg = String.format("combineType: %s\n"
<add> + " --> SummaryCountSql:%s\n"
<add> + " --> StatusCountSql :%s\n"
<add> + " --> summaryAlertListSize:%s, statusCountListSize:%s, newSummaryRcds size: %s",
<add> combineType,
<add> mergeCountSql,
<add> mergeSumStatusSql,
<add> summaryAlertList.size(), statusCountList.size(), newSummaryRcds.size()
<add> );
<add> currBatchLogCache.add(msg);
<add> }
<add>
<add>
<add> private int getInt(Map<String, Object> dataMap, String key) throws Exception {
<add> Object valObj = dataMap.get(key);
<add> if (valObj == null) {
<add> return 0;
<add> }
<add>
<add> return ((BigDecimal) valObj).intValue();
<add> }
<add>
<add> private String getRiskLevel(int levelVal) throws Exception {
<add> int idx1 = 0, idx2 = 1, idx3 = 2, idx4 = 3;
<add> if (levelVal >= this.riskLevelList[idx1]) {
<add> return "严重";
<add> } else if (levelVal >= this.riskLevelList[idx2]) {
<add> return "高";
<add> } else if (levelVal >= this.riskLevelList[idx3]) {
<add> return "中";
<add> } else if (levelVal >= this.riskLevelList[idx4]) {
<add> return "低";
<add> } else {
<add> return "低";
<add> }
<add> }
<add>
<add> private String sort(Object str) throws Exception {
<add> String t = (String) str;
<add> if (StringUtil.isNotEmpty(t)) {
<add> String[] tmp = t.split(",");
<add> Arrays.sort(tmp);
<add> return ArrayUtil.join(tmp, ",");
<add> }
<add> return t;
<add> }
<add>
<add> /** string to int */
<add> private int toInt(String riskValue) {
<add> try {
<add> return (int) Double.parseDouble(riskValue);
<add> } catch (NumberFormatException e) {
<add> logger.info("ERROR", e);
<add> }
<add> return 0;
<add> }
<add>
<add> private Long insertSummaryAlert(SummaryAlertV1 sa) throws Exception {
<add> sa.setCreateTime(new Date());
<add> sa.setStatus((short) 1);
<add> summaryAlertMapper.insertSelective(sa);
<add>
<add> return sa.getId();
<add> }
<add>
<add> private void updSummaryAlert(SummaryAlertV1 sa) throws Exception {
<add> sa.setHashValue(null);
<add> summaryAlertMapper.updateByPrimaryKeySelective(sa);
<add> }
<add>
<add> /**
<add> * 更新告警状态,插入或者更新
<add> * @return
<add> * @throws Exception
<add> */
<add> public boolean doUpdateSummaryAlert() throws Exception {
<add> int addCount = 0, udpCount = 0, delCount = 0;
<add> String hashSrc, combinePrimaryKey, delSql = null;
<add> // 所有需要新增的combinePrimaryKey
<add> List<String> allNewCombineKey = new ArrayList<String>();
<add> // 重复的combinePrimaryKey
<add> List<String> dupCombineKey = new ArrayList<String>();
<add> // 已经插入成功的AdlSummaryAlert
<add> List<SummaryAlertV1> insertedRcds = new ArrayList<SummaryAlertV1>();
<add>
<add> //logger.infoNotOnline(String.format("归并告警产生了%s条记录", newSummaryRcds.size()));
<add> timeRecorder += "[newSummaryRcds: " + newSummaryRcds.size() + " ]";
<add>
<add>
<add> for (SummaryAlertV1 nSa : this.newSummaryRcds) {
<add> //保证新计算出的归并告警的惟一性
<add> if (allNewCombineKey.contains(nSa.getCombinePrimaryKey())) {
<add> dupCombineKey.add(nSa.getCombinePrimaryKey());
<add> continue;
<add> }
<add> allNewCombineKey.add(nSa.getCombinePrimaryKey());
<add>
<add> // 计算归并告警的hashValue
<add> hashSrc = "%s%s%s%s%s";
<add> hashSrc = String.format(
<add> hashSrc, nSa.getRecursiveName(), nSa.getVip(), nSa.getHostname(),
<add> nSa.getRiskValue(), nSa.getRiskLevel()
<add> );
<add> nSa.setHashValue(EncryptionUtil.md5(hashSrc));
<add>
<add> combinePrimaryKey = nSa.getCombinePrimaryKey();
<add> // * 在原来的汇中表中没有找到,插入新记录
<add> if (this.lastSummaryRcds.get(combinePrimaryKey) == null) {
<add> addCount += 1;
<add>
<add> // 插入汇总记录
<add> this.insertSummaryAlert(nSa);
<add> // 将汇总记录的Id,更新到相关联的明细表的summary_id字段上,建立关系
<add> insertedRcds.add(nSa);
<add>
<add> if (!constantsUtil.isOnline()) {
<add> logger.info(String.format("归并告警, '%s' 被插入, 记录ID: %s", combinePrimaryKey, nSa.getId()));
<add> }
<add>
<add> // * 满足加入到告警列表的条件
<add> if (nSa.getRiskValue() >= this.notifyRiskValue) {
<add> this.notifyList.add(new Notify(nSa, 0));
<add> }
<add> }
<add> // * 在原来的汇中表找到同样combine_primary_key的行,更新该行记录
<add> else {
<add> // 得到并从缓存中删除这条记录
<add> SummaryAlertV1 oSa = this.lastSummaryRcds.remove(combinePrimaryKey);
<add>
<add> boolean isHashValueSame = nSa.getHashValue().equals(oSa.getHashValue());
<add> boolean isGmtCreateSame = nSa.getGmtCreate().getTime() == oSa.getGmtCreate().getTime();
<add> boolean isProStatusSame = nSa.getProgressStatus().equals(oSa.getProgressStatus());
<add> boolean isProgresssSame = nSa.getProgress().equals(oSa.getProgress());
<add> // 内容一样,不做更新
<add> if (isHashValueSame && isGmtCreateSame && isProStatusSame && isProgresssSame) {
<add> continue;
<add> }
<add>
<add> udpCount += 1;
<add> nSa.setId(oSa.getId());
<add>
<add> if (!constantsUtil.isOnline()) {
<add> logger.info(String.format("归并告警, %s 归并方式的记录将被更新, 记录ID: %s", combinePrimaryKey, nSa.getId()));
<add> }
<add>
<add> // 内容不一样,需要更新
<add> this.updSummaryAlert(nSa);
<add>
<add> // * 满足加入到告警列表的条件
<add> if (nSa.getRiskValue() > oSa.getRiskValue() && nSa.getRiskValue() >= this.notifyRiskValue) {
<add> this.notifyList.add(new Notify(nSa, oSa.getRiskValue()));
<add> }
<add> }
<add> }
<add>
<add> // 启动批量更新告警明细记录
<add> // this.batchUpdDetailSummaryId(insertedRcds);
<add>
<add> // * 废弃(更新status = 0)原来在汇中表中有而在新的归并记录中没有的汇总记录
<add> List<String> keys = new ArrayList<String>();
<add> String ins = null;
<add> Iterator<Entry<String, SummaryAlertV1>> it = this.lastSummaryRcds.entrySet().iterator();
<add> Entry<String, SummaryAlertV1> entry;
<add> while (it.hasNext()){
<add> entry = it.next();
<add> SummaryAlertV1 oSa = entry.getValue();
<add> if (oSa == null) {
<add> continue;
<add> }
<add> keys.add(oSa.getCombinePrimaryKey());
<add> delCount += 1;
<add> }
<add>
<add> logger.infoNotOnline(String.format("归并告警记录: 新增了%s条, 更新了%s条, %s条记录会被废弃", addCount, udpCount, delCount));
<add>
<add> this.disableRecordByBatch(keys);
<add>
<add> // do log
<add> String dupKeys = "";
<add> if (dupCombineKey.size() > 0) {
<add> dupKeys = ", filterInvalidSummaryAlert=" + "'" + ArrayUtil.join(dupCombineKey, "','") + "'";
<add> }
<add> String msg = "alert_adl_summary_alert add=%s, update=%s, delete(set status=0)=%s%s";
<add> msg = String.format(msg, addCount, udpCount, delCount, dupKeys);
<add> currBatchLogCache.add(msg);
<add>
<add> return true;
<add> }
<add>
<add> private void disableRecordByBatch(List<String> keys) {
<add> if (CollectionUtil.isEmpty(keys)) {
<add> return;
<add> }
<add>
<add> // 每次更新的最大记录数
<add> int eachCount = 300;
<add> int size = keys.size(), times = NumberUtil.quotientUp(size, eachCount);
<add> String ins, delSql;
<add> for (int i = 0, s, e; i < times; i++) {
<add> s = i * eachCount;
<add> e = (i + 1) * eachCount;
<add> e = e > size ? size : e;
<add> List<String> subList = keys.subList(s, e);
<add>
<add> ins = "'" + ArrayUtil.join(subList, "','") + "'";
<add> delSql = String.format(
<add> "UPDATE %s SET `status`=0 WHERE combine_primary_key IN(%s) AND status = 1",
<add> "alert_adl_summary_alert", ins
<add> );
<add> logger.infoNotOnline(String.format("删除过滤的归并告警记录SQL: %s", delSql));
<add> getJdbcHandler().execute(delSql);
<add> }
<add> }
<add>
<add> /**
<add> * 邮件通知
<add> * @return
<add> * @throws Exception
<add> */
<add> public boolean doAlertNotify() throws Exception {
<add> // 没有需要通知的告警消息 或者 没有需要通知的人, 则不需要发送告警消息
<add> if (this.notifyList.size() == 0 || StringUtil.isNotBlank(notifyUserMail)) {
<add> return true;
<add> }
<add>
<add> // 组织通知内容
<add> String currTime = DateUtil.format(new Date()), tmpMsg = null;
<add> List<String> newMsg = new ArrayList<String>(), upgradeMsg = new ArrayList<String>();
<add> for (Notify n : this.notifyList) {
<add> if (n.getPreRiskValue() == 0) {
<add> // 新增告警
<add> tmpMsg = "[AIM]新增告警。应用信息:%s,规则:%s,风险值:%s,告警时间:%s";
<add> tmpMsg = String.format(tmpMsg, n.getCombinePrimaryKey(), n.getInsRuleList(), n.getRiskValue(), currTime);
<add> newMsg.add(tmpMsg);
<add> } else {
<add> // 升级告警
<add> tmpMsg = "[AIM]告警升级。应用信息:%s,规则:%s,风险值:%s,告警时间:%s,上次风险值:%s,处理状态:%s";
<add> tmpMsg = String.format(
<add> tmpMsg, n.getCombinePrimaryKey(), n.getInsRuleList(), n.getRiskValue(), currTime, n.getPreRiskValue(),
<add> n.getProgressStatus()
<add> );
<add> upgradeMsg.add(tmpMsg);
<add> }
<add>
<add> // 设置为 "已发送告警通知消息" 状态
<add> n.setSendSucceed(true);
<add> }
<add>
<add> // 向员工发送邮件
<add> boolean hasMsgToSend = (CollectionUtil.isNotEmpty(newMsg) || CollectionUtil.isNotEmpty(newMsg));
<add> if (hasMsgToSend) {
<add> MailMessageBean mmb = new MailMessageBean();
<add> mmb.setMailTo(this.notifyUserMail);
<add> tmpMsg = "告警归并计算告警 - " + DateUtil.format(new Date(), "yyyy-MM-dd");
<add> mmb.setSubject(tmpMsg);
<add> tmpMsg = "告警归并计算产生以下归并记录, 请关注:<br/><br/>新增告警:<br/>%s<br/><br/>告警升级:%s";
<add> tmpMsg = String.format(tmpMsg, ArrayUtil.join(newMsg, "<br/>"), ArrayUtil.join(upgradeMsg, "<br/>"));
<add> mmb.setText(tmpMsg);
<add>
<add> msgMailUtil.sendMail(mmb);
<add> }
<add>
<add> return true;
<add> }
<add>
<add> /**
<add> * 更新通知数据
<add> * @throws Exception
<add> */
<add> public void updNotifyStatus() throws Exception {
<add> if (this.notifyList.size() == 0) {
<add> return;
<add> }
<add>
<add> String currDateTime, sql, ins;
<add> List<String> keys = new ArrayList<String>();
<add> for (Notify n : this.notifyList) {
<add> if (!n.isSendSucceed()) {
<add> continue;
<add> }
<add> keys.add(n.getCombinePrimaryKey());
<add> }
<add>
<add> if (keys.size() == 0) {
<add> return;
<add> }
<add> ins = "'" + ArrayUtil.join(keys, "','") + "'";
<add> currDateTime = DateUtil.format(new Date());
<add>
<add> sql = "UPDATE %s SET is_notified='%s', notify_time='%s' WHERE combine_primary_key IN(%s) AND is_notified != 1 AND status = 1";
<add> sql = String.format(sql, "alert_adl_summary_alert", "1", currDateTime, ins);
<add>
<add> getJdbcHandler().execute(sql);
<add> }
<add>
<add>
<add>
<add> /**
<add> * 产品线归并
<add> * 返回值为2个元素String数组,[0]是归并预警SQL [1]是归并预警状态SQL
<add> * @return
<add> */
<add> public String[] queryRecursiveSql(){
<add> StringBuilder sBuild = createStrBuilderInstance(" ");
<add> /********************************** 按照产品线归并************************/
<add> /*第一层查询处理*/
<add> String sqlSelectVipLv1 = sBuild.append(" SELECT recursive_name, ").
<add> append(" vip, ").
<add> append(" HOST, ").
<add> append(" rule_id, ").
<add> append(" sec, ").
<add> append(" max(risk_value) risk_value, ").
<add> append(" src_ip ").
<add> toString();
<add>
<add> String sqlSelectHostLv1 = reset(sBuild).append(" SELECT recursive_name, ").
<add> append(" vip, ").
<add> append(" hostname, ").
<add> append(" rule_id, ").
<add> append(" sec, ").
<add> append(" max(risk_value) risk_value, ").
<add> append(" src_ip ").
<add> toString();
<add>
<add>
<add> String sqlFromLv1 = reset(sBuild).
<add> append(" from %s ").
<add> toString();
<add>
<add> String sqlWhereLv1 = reset(sBuild).
<add> append(" where 1=1 ").
<add> append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
<add> append(" and recursive_name IS NOT NULL ").
<add> append(" and recursive_name !='' ").
<add> append(" and recursive_name NOT LIKE '开发测试%%' ").
<add> append(" %s ").
<add> toString();
<add>
<add>
<add> String conditionHost = " AND (hostname is not null and hostname <> '')";
<add> String conditionVip = " AND (hostname is null or hostname = '')";
<add>
<add> String groupByHostLv1 = " GROUP BY rule_id, hostname, recursive_name ";
<add> String groupByVipLv1 = " GROUP BY rule_id, vip, recursive_name ";
<add>
<add>
<add> String sqlQueryVipLv1 = reset(sBuild)
<add> .append(sqlSelectVipLv1)
<add> .append(String.format(sqlFromLv1,tableName))
<add> .append(String.format(sqlWhereLv1,conditionVip))
<add> .append(groupByVipLv1)
<add> .toString();
<add>
<add>
<add> String sqlQueryHostLv1 = reset(sBuild)
<add> .append(sqlSelectHostLv1)
<add> .append(String.format(sqlFromLv1,tableName))
<add> .append(String.format(sqlWhereLv1,conditionHost))
<add> .append(groupByHostLv1)
<add> .toString();
<add>
<add> /*第二层查询处理*/
<add> String sqlQueryVipLv2 = reset(sBuild)
<add> .append(" select ")
<add> .append(" recursive_name, ")
<add> .append(" GROUP_CONCAT(DISTINCT vip) AS vip, ")
<add> .append(" GROUP_CONCAT(DISTINCT HOST) AS hostname, ")
<add> .append(" SUM(risk_value)/COUNT(DISTINCT vip) AS risk_value, ")
<add> .append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
<add> .append(" from ")
<add> .append("(" + sqlQueryVipLv1 + ") as Ta ")
<add> .append(" group by recursive_name ")
<add> .toString();
<add>
<add> String sqlQueryHostLv2 = reset(sBuild)
<add> .append(" select ")
<add> .append(" recursive_name, ")
<add> .append(" GROUP_CONCAT(DISTINCT vip) AS vip, ")
<add> .append(" GROUP_CONCAT(DISTINCT hostname) AS hostname, ")
<add> .append(" SUM(risk_value)/COUNT(DISTINCT hostname) AS risk_value, ")
<add> .append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
<add> .append(" from ")
<add> .append("(" + sqlQueryHostLv1 + ") as Tb ")
<add> .append(" group by recursive_name ")
<add> .toString();
<add>
<add> /*第三层查询处理*/
<add> String sqlQueryProdLine = reset(sBuild)
<add> .append(" select ")
<add> .append(" recursive_name, ")
<add> .append(" GROUP_CONCAT(vip) vip, ")
<add> .append(" GROUP_CONCAT(hostname) hostname, ")
<add> .append(" SUM(risk_value) risk_value, ")
<add> .append(" GROUP_CONCAT(ins_rule_list) ins_rule_list, ")
<add> .append(" GROUP_CONCAT(sec_list) sec_list, ")
<add> .append(" GROUP_CONCAT(src_ip) src_ip ")
<add> .append(" from ")
<add> .append(" ( ")
<add> .append( "(" + sqlQueryVipLv2 + ") UNION ALL (" + sqlQueryHostLv2+ ") ")
<add> .append(" ) allAlert ")
<add> .append(" group by recursive_name ")
<add> .toString();
<add>
<add>
<add>
<add> /*按产品线归并的状态归并状态查询*/
<add> String sqlQueryProStatus = reset(sBuild)
<add> .append(" select ")
<add> .append(" recursive_name, ")
<add> .append(" sum(1) AS all_sum, ")
<add> .append(" sum(handle_status='未确认') AS undo_sum, ")
<add> .append(" sum( algo_flag=0) as algo_valid_sum, ")
<add> .append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
<add> .append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
<add> .append(" from " + tableName + " all_alert ")
<add> .append(" where 1=1 ")
<add> .append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
<add> .append(" and recursive_name IS NOT NULL ")
<add> .append(" and recursive_name != '' ")
<add> .append(" and recursive_name NOT LIKE '开发测试%%' ")
<add> .append(" and data_type != 'anomaly' ")
<add> .append(" GROUP BY recursive_name ")
<add> .toString();
<add>
<add> return new String[]{sqlQueryProdLine,sqlQueryProStatus};
<add> }
<add>
<add>
<add> public String[] queryVipSql(){
<add> StringBuilder sBuild = createStrBuilderInstance(" ");
<add> /********************************** 按照VIP归并************************/
<add> /*第一层查询处理*/
<add> String sqlSelectVipLv1 = sBuild.append(" SELECT recursive_name, ").
<add> append(" vip, ").
<add> append(" HOST, ").
<add> append(" rule_id, ").
<add> append(" sec, ").
<add> append(" max(risk_value) risk_value, ").
<add> append(" src_ip ").
<add> toString();
<add>
<add> String sqlSelectHostLv1 = reset(sBuild).append(" SELECT recursive_name, ").
<add> append(" vip, ").
<add> append(" hostname, ").
<add> append(" rule_id, ").
<add> append(" sec, ").
<add> append(" max(risk_value) risk_value, ").
<add> append(" src_ip ").
<add> toString();
<add>
<add>
<add> String sqlFromLv1 = reset(sBuild).
<add> append(" from %s ").
<add> toString();
<add>
<add> String sqlWhereLv1 = reset(sBuild).
<add> append(" where 1=1 ").
<add> append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
<add> append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ").
<add> append(" and vip <> '' ").
<add> append(" %s ").
<add> toString();
<add>
<add>
<add> String conditionHost = " AND (hostname is not null and hostname <> '') ";
<add> String conditionVip = " AND (hostname is null or hostname = '') ";
<add>
<add> String groupByHostLv1 = " GROUP BY rule_id, hostname, vip ";
<add> String groupByVipLv1 = " GROUP BY rule_id, vip ";
<add>
<add>
<add> String sqlQueryVipLv1 = reset(sBuild)
<add> .append(sqlSelectVipLv1)
<add> .append(String.format(sqlFromLv1,tableName))
<add> .append(String.format(sqlWhereLv1,conditionVip))
<add> .append(groupByVipLv1)
<add> .toString();
<add>
<add>
<add> String sqlQueryHostLv1 = reset(sBuild)
<add> .append(sqlSelectHostLv1)
<add> .append(String.format(sqlFromLv1,tableName))
<add> .append(String.format(sqlWhereLv1,conditionHost))
<add> .append(groupByHostLv1)
<add> .toString();
<add>
<add>
<add> /*第二层查询处理*/
<add> String sqlQueryVipLv2 = reset(sBuild)
<add> .append(" select ")
<add> .append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
<add> .append(" vip, ")
<add> .append(" GROUP_CONCAT(DISTINCT HOST) AS hostname, ")
<add> .append(" SUM(risk_value)/COUNT(DISTINCT vip) AS risk_value, ")
<add> .append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
<add> .append(" from ")
<add> .append("(" + sqlQueryVipLv1 + ") as Ta ")
<add> .append(" group by vip ")
<add> .toString();
<add>
<add> String sqlQueryHostLv2 = reset(sBuild)
<add> .append(" select ")
<add> .append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
<add> .append(" vip, ")
<add> .append(" GROUP_CONCAT(DISTINCT hostname) AS hostname, ")
<add> .append(" SUM(risk_value)/COUNT(DISTINCT hostname) AS risk_value, ")
<add> .append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
<add> .append(" from ")
<add> .append("(" + sqlQueryHostLv1 + ") as Tb ")
<add> .append(" group by vip ")
<add> .toString();
<add>
<add> /*第三层查询处理*/
<add>
<add> String sqlQueryVip = reset(sBuild)
<add> .append(" select ")
<add> .append(" GROUP_CONCAT(recursive_name) AS recursive_name, ")
<add> .append(" vip, ")
<add> .append(" GROUP_CONCAT(hostname) hostname, ")
<add> .append(" SUM(risk_value) risk_value, ")
<add> .append(" GROUP_CONCAT(ins_rule_list) ins_rule_list, ")
<add> .append(" GROUP_CONCAT(sec_list) sec_list, ")
<add> .append(" GROUP_CONCAT(src_ip) src_ip ")
<add> .append(" from ")
<add> .append(" ( ")
<add> .append( "(" + sqlQueryVipLv2 + ") UNION ALL (" + sqlQueryHostLv2+ ") ")
<add> .append(" ) allAlert ")
<add> .append(" group by vip ")
<add> .toString();
<add>
<add> /*按VIP归并的状态归并状态查询*/
<add> String sqlQueryVipStatus = reset(sBuild)
<add> .append(" select ")
<add> .append(" vip, ")
<add> .append(" sum(1) AS all_sum, ")
<add> .append(" sum(handle_status='未确认') AS undo_sum, ")
<add> .append(" sum( algo_flag=0) as algo_valid_sum, ")
<add> .append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
<add> .append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
<add> .append(" from " + tableName + " all_alert ")
<add> .append(" where 1=1 ")
<add> .append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
<add> .append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ")
<add> .append(" and vip <> '' ")
<add> .append(" and data_type != 'anomaly' ")
<add> .append(" GROUP BY vip ")
<add> .toString();
<add>
<add> return new String[]{sqlQueryVip,sqlQueryVipStatus};
<add> }
<add>
<add>
<add>
<add>
<add> /**
<add> * 按照主机类型进行归并
<add> * @return
<add> */
<add> public String[] queryHostSql(){
<add> /********************************** 按照HOSTNAME归并************************/
<add> StringBuilder sBuild = createStrBuilderInstance(" ");
<add> String sqlSelectHostLv1 = sBuild.append(" SELECT recursive_name, ").
<add> append(" vip, ").
<add> append(" hostname, ").
<add> append(" rule_id, ").
<add> append(" sec, ").
<add> append(" max(risk_value) risk_value, ").
<add> append(" src_ip ").
<add> toString();
<add>
<add>
<add> String sqlFromLv1 = reset(sBuild).
<add> append(" from %s ").
<add> toString();
<add>
<add> String sqlWhereLv1 = reset(sBuild).
<add> append(" where 1=1 ").
<add> append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ").
<add> append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ").
<add> append(" and ( vip = '' or vip is null ) ").
<add> append(" %s ").
<add> toString();
<add>
<add> String conditionHost = " AND (hostname is not null and hostname <> '') ";
<add>
<add> String groupByHostLv1 = " GROUP BY rule_id,hostname ";
<add>
<add> String sqlQueryHostLv1 = reset(sBuild)
<add> .append(sqlSelectHostLv1)
<add> .append(String.format(sqlFromLv1,tableName))
<add> .append(String.format(sqlWhereLv1,conditionHost))
<add> .append(groupByHostLv1)
<add> .toString();
<add>
<add>
<add> /*第二层查询处理*/
<add> String sqlQueryHostStr = reset(sBuild)
<add> .append(" select ")
<add> .append(" GROUP_CONCAT(DISTINCT recursive_name) AS recursive_name, ")
<add> .append(" hostname, ")
<add> .append(" SUM(risk_value) AS risk_value, ")
<add> .append(" GROUP_CONCAT(DISTINCT rule_id) AS ins_rule_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT sec) AS sec_list, ")
<add> .append(" GROUP_CONCAT(DISTINCT src_ip) AS src_ip ")
<add> .append(" from ")
<add> .append("(" + sqlQueryHostLv1 + ") as Tb ")
<add> .append(" group by hostname ")
<add> .toString();
<add>
<add> /*状态查询*/
<add> String sqlQueryHostStatus = reset(sBuild)
<add> .append(" select ")
<add> .append(" hostname, ")
<add> .append(" sum(1) AS all_sum, ")
<add> .append(" sum(handle_status='未确认') AS undo_sum, ")
<add> .append(" sum( algo_flag=0) as algo_valid_sum, ")
<add> .append(" sum(algo_flag in (0,1)) as algo_marked_sum, ")
<add> .append(" max(STR_TO_DATE(all_alert.gmt_create,'%Y-%m-%d %H:%i:%s')) AS gmt_create ")
<add> .append(" from " + tableName + " all_alert ")
<add> .append(" where 1=1 ")
<add> .append(" and gmt_create>=TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 7 DAY)) ")
<add> .append(" and (recursive_name IS NULL OR recursive_name = '' OR recursive_name LIKE '开发测试%%') ")
<add> .append(" and (vip = '' or vip is null) ")
<add> .append(" and hostname is not null and hostname <> '' ")
<add> .append(" and data_type != 'anomaly' ")
<add> .append(" GROUP BY hostname ")
<add> .toString();
<add>
<add> return new String[] {sqlQueryHostStr,sqlQueryHostStatus};
<add> }
<add>
<add> protected StringBuilder createStrBuilderInstance(String initStr){
<add> return new StringBuilder(initStr);
<add> }
<add>
<add> protected StringBuilder reset(StringBuilder strBui){
<add> return strBui.delete(0,strBui.length());
<add> }
<add>
<add>
<add> private class ParseVal {
<add> Map<String, Object> saMap;
<add>
<add> public ParseVal(Map<String, Object> saMap) {
<add> this.saMap = saMap;
<add> }
<add>
<add> public String getWithDefaultVal(String key, String... defVal) {
<add> Object obj = saMap.get(key);
<add> if (obj == null) {
<add> return (defVal.length == 0) ? "" : defVal[0];
<add> }
<add>
<add> return obj.toString();
<add> }
<add> }
<add>
<add>
<add>
<add>} |
|
Java | apache-2.0 | 9fd480e3193e976f9d7c03270e616b0ae2840d29 | 0 | bluebytes60/fse-F14-SA5-SSNoC-Java-REST,ccjeremiahlin/fse-F14-SA5-SSNoC-Java-REST,ccjeremiahlin/fse-F14-SA5-SSNoC-Java-REST,bluebytes60/fse-F14-SA5-SSNoC-Java-REST | package edu.cmu.sv.ws.ssnoc.rest;
import edu.cmu.sv.ws.ssnoc.common.logging.Log;
import edu.cmu.sv.ws.ssnoc.control.GroupSegregate;
import edu.cmu.sv.ws.ssnoc.data.dao.DAOFactory;
import edu.cmu.sv.ws.ssnoc.data.po.ChatBuddyPO;
import edu.cmu.sv.ws.ssnoc.data.po.UserListPO;
import edu.cmu.sv.ws.ssnoc.data.po.UserPO;
import edu.cmu.sv.ws.ssnoc.dto.DBTime;
import edu.cmu.sv.ws.ssnoc.dto.Group;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Path("/usergroups")
public class UserGroups extends BaseService {
/**
* This method loads all active users in the system.
*
* @return - List of all active users.
*/
@POST
@Path("/unconnected")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@XmlElementWrapper(name = "groups")
public Set<Group> loadGroups(DBTime dbTime) {
Log.enter();
Set<Group> groupList = new HashSet<Group>();
try {
Set<Set<String>> groupSet = new HashSet<Set<String>>();
//add full list to each users
//get chat buddies from database
GroupSegregate gsControl = GroupSegregate.getInstance();
groupSet = gsControl.getSegregatedGroups(dbTime);
for(Set<String> addGroup: groupSet){
Group newGroup = new Group();
newGroup.setGroupMembers(addGroup);
groupList.add(newGroup);
}
} catch (Exception e) {
handleException(e);
} finally {
Log.exit(groupList);
}
return groupList;
}
}
| src/main/java/edu/cmu/sv/ws/ssnoc/rest/UserGroups.java | package edu.cmu.sv.ws.ssnoc.rest;
import edu.cmu.sv.ws.ssnoc.common.logging.Log;
import edu.cmu.sv.ws.ssnoc.control.GroupSegregate;
import edu.cmu.sv.ws.ssnoc.data.dao.DAOFactory;
import edu.cmu.sv.ws.ssnoc.data.po.ChatBuddyPO;
import edu.cmu.sv.ws.ssnoc.data.po.UserListPO;
import edu.cmu.sv.ws.ssnoc.data.po.UserPO;
import edu.cmu.sv.ws.ssnoc.dto.DBTime;
import edu.cmu.sv.ws.ssnoc.dto.Group;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Path("/usergroups")
public class UserGroups extends BaseService {
/**
* This method loads all active users in the system.
*
* @return - List of all active users.
*/
@POST
@Path("/unconnected")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@XmlElementWrapper(name = "groups")
public Set<Group> loadGroups(DBTime dbTime) {
Log.enter();
Set<Group> groupList = new HashSet<Group>();
try {
Set<Set<String>> groupSet = new HashSet<Set<String>>();
//add full list to each users
//get chat buddies from database
GroupSegregate gsControl = GroupSegregate.getInstance();
gsControl.getChatBuddyPOsFromDB(dbTime);
} catch (Exception e) {
handleException(e);
} finally {
Log.exit(groupList);
}
return groupList;
}
}
| Add user group API function
| src/main/java/edu/cmu/sv/ws/ssnoc/rest/UserGroups.java | Add user group API function | <ide><path>rc/main/java/edu/cmu/sv/ws/ssnoc/rest/UserGroups.java
<ide> //add full list to each users
<ide> //get chat buddies from database
<ide> GroupSegregate gsControl = GroupSegregate.getInstance();
<del> gsControl.getChatBuddyPOsFromDB(dbTime);
<add> groupSet = gsControl.getSegregatedGroups(dbTime);
<add> for(Set<String> addGroup: groupSet){
<add> Group newGroup = new Group();
<add> newGroup.setGroupMembers(addGroup);
<add> groupList.add(newGroup);
<add> }
<ide>
<ide> } catch (Exception e) {
<ide> handleException(e); |
|
Java | apache-2.0 | a38d0ace6b66951a59bc7cc48bea5b6a8ef3e577 | 0 | ptupitsyn/ignite,ascherbakoff/ignite,ilantukh/ignite,samaitra/ignite,NSAmelchev/ignite,nizhikov/ignite,SomeFire/ignite,andrey-kuznetsov/ignite,shroman/ignite,samaitra/ignite,chandresh-pancholi/ignite,SomeFire/ignite,apache/ignite,BiryukovVA/ignite,andrey-kuznetsov/ignite,ascherbakoff/ignite,xtern/ignite,BiryukovVA/ignite,samaitra/ignite,BiryukovVA/ignite,xtern/ignite,andrey-kuznetsov/ignite,shroman/ignite,ptupitsyn/ignite,apache/ignite,apache/ignite,NSAmelchev/ignite,ptupitsyn/ignite,ascherbakoff/ignite,chandresh-pancholi/ignite,ilantukh/ignite,BiryukovVA/ignite,apache/ignite,andrey-kuznetsov/ignite,daradurvs/ignite,ilantukh/ignite,ptupitsyn/ignite,nizhikov/ignite,shroman/ignite,samaitra/ignite,nizhikov/ignite,chandresh-pancholi/ignite,andrey-kuznetsov/ignite,daradurvs/ignite,chandresh-pancholi/ignite,xtern/ignite,andrey-kuznetsov/ignite,chandresh-pancholi/ignite,andrey-kuznetsov/ignite,NSAmelchev/ignite,daradurvs/ignite,ilantukh/ignite,ilantukh/ignite,daradurvs/ignite,chandresh-pancholi/ignite,nizhikov/ignite,BiryukovVA/ignite,ptupitsyn/ignite,NSAmelchev/ignite,SomeFire/ignite,ilantukh/ignite,NSAmelchev/ignite,daradurvs/ignite,chandresh-pancholi/ignite,BiryukovVA/ignite,apache/ignite,nizhikov/ignite,BiryukovVA/ignite,ptupitsyn/ignite,xtern/ignite,SomeFire/ignite,shroman/ignite,shroman/ignite,ilantukh/ignite,daradurvs/ignite,nizhikov/ignite,shroman/ignite,NSAmelchev/ignite,ascherbakoff/ignite,SomeFire/ignite,NSAmelchev/ignite,xtern/ignite,shroman/ignite,samaitra/ignite,andrey-kuznetsov/ignite,samaitra/ignite,shroman/ignite,ilantukh/ignite,samaitra/ignite,xtern/ignite,SomeFire/ignite,apache/ignite,ilantukh/ignite,samaitra/ignite,shroman/ignite,nizhikov/ignite,ptupitsyn/ignite,andrey-kuznetsov/ignite,daradurvs/ignite,apache/ignite,nizhikov/ignite,ascherbakoff/ignite,BiryukovVA/ignite,NSAmelchev/ignite,SomeFire/ignite,ascherbakoff/ignite,andrey-kuznetsov/ignite,daradurvs/ignite,ptupitsyn/ignite,SomeFire/ignite,BiryukovVA/ignite,xtern/ignite,samaitra/ignite,xtern/ignite,apache/ignite,ascherbakoff/ignite,SomeFire/ignite,chandresh-pancholi/ignite,samaitra/ignite,daradurvs/ignite,ascherbakoff/ignite,NSAmelchev/ignite,SomeFire/ignite,apache/ignite,ilantukh/ignite,chandresh-pancholi/ignite,ptupitsyn/ignite,ascherbakoff/ignite,xtern/ignite,ptupitsyn/ignite,BiryukovVA/ignite,daradurvs/ignite,nizhikov/ignite,shroman/ignite | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.ignite.testsuites;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.model.InitializationError;
/**
* IgniteBinaryObjectsCacheTestSuite3 is kept together with {@link IgniteCacheTestSuite3}
* for backward compatibility.
*
* In Ignite 2.0 tests
* - http://ci.ignite.apache.org/viewType.html?buildTypeId=Ignite20Tests_IgniteCache3
* IgniteBinaryObjectsCacheTestSuite3 is used,
*
* and in Ignite tests
* http://ci.ignite.apache.org/viewType.html?buildTypeId=IgniteTests_IgniteCache3
* - IgniteCacheTestSuite3.
* And if someone runs old run configs then most test will be executed anyway.
*
* In future this suite may be merged with {@link IgniteCacheTestSuite3}
*
*/
@RunWith(IgniteBinaryObjectsCacheTestSuite3.DynamicSuite.class)
public class IgniteBinaryObjectsCacheTestSuite3 {
/**
* @return Test suite.
*/
public static List<Class<?>> suite() {
return suite(null);
}
/**
* @param ignoredTests Tests to ignore.
* @return Test suite.
*/
public static List<Class<?>> suite(Collection<Class> ignoredTests) {
GridTestProperties.setProperty(GridTestProperties.ENTRY_PROCESSOR_CLASS_NAME,
"org.apache.ignite.tests.p2p.CacheDeploymentBinaryEntryProcessor");
List<Class<?>> suite = new ArrayList<>(IgniteCacheTestSuite3.suite(ignoredTests));
GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests);
GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests);
return suite;
}
/** */
public static class DynamicSuite extends Suite {
/** */
public DynamicSuite(Class<?> cls) throws InitializationError {
super(cls, suite().toArray(new Class<?>[] {null}));
}
}
}
| modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.ignite.testsuites;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest;
import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.model.InitializationError;
/**
* IgniteBinaryObjectsCacheTestSuite3 is kept together with {@link IgniteCacheTestSuite3}
* for backward compatibility.
*
* In Ignite 2.0 tests
* - http://ci.ignite.apache.org/viewType.html?buildTypeId=Ignite20Tests_IgniteCache3
* IgniteBinaryObjectsCacheTestSuite3 is used,
*
* and in Ignite tests
* http://ci.ignite.apache.org/viewType.html?buildTypeId=IgniteTests_IgniteCache3
* - IgniteCacheTestSuite3.
* And if someone runs old run configs then most test will be executed anyway.
*
* In future this suite may be merged with {@link IgniteCacheTestSuite3}
*
*/
@RunWith(IgniteBinaryObjectsCacheTestSuite3.DynamicSuite.class)
public class IgniteBinaryObjectsCacheTestSuite3 {
/**
* @return Test suite.
*/
public static List<Class<?>> suite() {
return suite(null);
}
/**
* @param ignoredTests Tests to ignore.
* @return Test suite.
*/
public static List<Class<?>> suite(Collection<Class> ignoredTests) {
GridTestProperties.setProperty(GridTestProperties.ENTRY_PROCESSOR_CLASS_NAME,
"org.apache.ignite.tests.p2p.CacheDeploymentBinaryEntryProcessor");
List<Class<?>> suite = new ArrayList<>();
GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests);
GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests);
return suite;
}
/** */
public static class DynamicSuite extends Suite {
/** */
public DynamicSuite(Class<?> cls) throws InitializationError {
super(cls, suite().toArray(new Class<?>[] {null}));
}
}
}
| IGNITE-11038 recover IgniteCacheTestSuite3 - Fixes #5895.
Signed-off-by: Dmitriy Govorukhin <[email protected]>
| modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java | IGNITE-11038 recover IgniteCacheTestSuite3 - Fixes #5895. | <ide><path>odules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java
<ide> GridTestProperties.setProperty(GridTestProperties.ENTRY_PROCESSOR_CLASS_NAME,
<ide> "org.apache.ignite.tests.p2p.CacheDeploymentBinaryEntryProcessor");
<ide>
<del> List<Class<?>> suite = new ArrayList<>();
<add> List<Class<?>> suite = new ArrayList<>(IgniteCacheTestSuite3.suite(ignoredTests));
<ide>
<ide> GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryAtomicEntryProcessorDeploymentSelfTest.class, ignoredTests);
<ide> GridTestUtils.addTestIfNeeded(suite,GridCacheBinaryTransactionalEntryProcessorDeploymentSelfTest.class, ignoredTests); |
|
Java | agpl-3.0 | 7e119218fbd90aaef77e3476779e7867579a8f02 | 0 | opensourceBIM/BIMserver,opensourceBIM/BIMserver,opensourceBIM/BIMserver | package org.bimserver.client;
/******************************************************************************
* Copyright (C) 2009-2019 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see {@literal<http://www.gnu.org/licenses/>}.
*****************************************************************************/
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.zip.DeflaterInputStream;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.InputStreamBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.bimserver.interfaces.objects.SLongCheckinActionState;
import org.bimserver.shared.ChannelConnectionException;
import org.bimserver.shared.ConnectDisconnectListener;
import org.bimserver.shared.ServiceHolder;
import org.bimserver.shared.TokenHolder;
import org.bimserver.shared.exceptions.PublicInterfaceNotFoundException;
import org.bimserver.shared.exceptions.ServerException;
import org.bimserver.shared.exceptions.UserException;
import org.bimserver.shared.interfaces.AdminInterface;
import org.bimserver.shared.interfaces.AuthInterface;
import org.bimserver.shared.interfaces.LowLevelInterface;
import org.bimserver.shared.interfaces.MetaInterface;
import org.bimserver.shared.interfaces.NewServicesInterface;
import org.bimserver.shared.interfaces.NotificationRegistryInterface;
import org.bimserver.shared.interfaces.PluginInterface;
import org.bimserver.shared.interfaces.PublicInterface;
import org.bimserver.shared.interfaces.ServiceInterface;
import org.bimserver.shared.interfaces.SettingsInterface;
import org.bimserver.shared.json.ConvertException;
import org.bimserver.shared.json.JsonConverter;
import org.bimserver.shared.meta.SServicesMap;
import org.bimserver.shared.reflector.Reflector;
import org.bimserver.shared.reflector.ReflectorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Charsets;
public abstract class Channel implements ServiceHolder {
private final Map<String, PublicInterface> serviceInterfaces = new HashMap<String, PublicInterface>();
private final Set<ConnectDisconnectListener> connectDisconnectListeners = new HashSet<ConnectDisconnectListener>();
private static final Logger LOGGER = LoggerFactory.getLogger(Channel.class);
private CloseableHttpClient closeableHttpClient;
public Channel(CloseableHttpClient closeableHttpClient) {
this.closeableHttpClient = closeableHttpClient;
}
@SuppressWarnings("unchecked")
public <T extends PublicInterface> T get(String interfaceClass) {
return (T) serviceInterfaces.get(interfaceClass);
}
public void add(String interfaceClass, PublicInterface service) {
serviceInterfaces.put(interfaceClass, service);
}
public Map<String, PublicInterface> getServiceInterfaces() {
return serviceInterfaces;
}
public void registerConnectDisconnectListener(ConnectDisconnectListener connectDisconnectListener) {
connectDisconnectListeners.add(connectDisconnectListener);
}
public void notifyOfConnect() {
for (ConnectDisconnectListener connectDisconnectListener : connectDisconnectListeners) {
connectDisconnectListener.connected();
}
}
public void notifyOfDisconnect() {
for (ConnectDisconnectListener connectDisconnectListener : connectDisconnectListeners) {
connectDisconnectListener.disconnected();
}
}
protected void finish(Reflector reflector, ReflectorFactory reflectorFactory) {
}
public abstract void disconnect();
public abstract void connect(TokenHolder tokenHolder) throws ChannelConnectionException;
public SLongCheckinActionState checkinSync(String baseAddress, String token, long poid, String comment, long deserializerOid, boolean merge, long fileSize, String filename, InputStream inputStream, Long topicId) throws ServerException, UserException {
String address = baseAddress + "/upload";
HttpPost httppost = new HttpPost(address);
try {
if (topicId == null) {
topicId = getServiceInterface().initiateCheckin(poid, deserializerOid);
}
// TODO find some GzipInputStream variant that _compresses_ instead
// of _decompresses_ using deflate for now
InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("deserializerOid", new StringBody("" + deserializerOid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("merge", new StringBody("" + merge, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("sync", new StringBody("" + true, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("compression", new StringBody("deflate", ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
} else {
SServicesMap sServicesMap = getSServicesMap();
try {
return (SLongCheckinActionState) getJsonConverter().fromJson(sServicesMap.getSType("SLongCheckinState"), null, result);
} catch (ConvertException e) {
e.printStackTrace();
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
return null;
}
private MultipartEntityBuilder createMultiPart() {
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setCharset(Charsets.UTF_8);
multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
return multipartEntityBuilder;
}
protected JsonConverter getJsonConverter() {
return null;
}
protected SServicesMap getSServicesMap() {
return null;
}
public long checkinAsync(String baseAddress, String token, long poid, String comment, long deserializerOid, boolean merge, long fileSize, String filename, InputStream inputStream, long topicId) throws ServerException, UserException {
String address = baseAddress + "/upload";
HttpPost httppost = new HttpPost(address);
try {
// TODO find some GzipInputStream variant that _compresses_ instead
// of _decompresses_ using deflate for now
InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("deserializerOid", new StringBody("" + deserializerOid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("merge", new StringBody("" + merge, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("sync", new StringBody("" + false, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("compression", new StringBody("deflate", ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
} else {
if (result.has("topicId")) {
return result.get("topicId").asLong();
} else {
throw new ServerException("No topicId found in response: " + result.toString());
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
return -1;
}
public InputStream getDownloadData(String baseAddress, String token, long topicId) throws IOException {
String address = baseAddress + "/download?token=" + token + "&topicId=" + topicId;
HttpPost httppost = new HttpPost(address);
try {
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
return httpResponse.getEntity().getContent();
} else {
LOGGER.error(httpResponse.getStatusLine().getStatusCode() + " - " + httpResponse.getStatusLine().getReasonPhrase());
httppost.releaseConnection();
}
} catch (ClientProtocolException e) {
LOGGER.error("", e);
} catch (IOException e) {
LOGGER.error("", e);
}
return null;
}
public InputStream getDownloadExtendedData(String baseAddress, String token, long edid) throws IOException {
String address = baseAddress + "/download?token=" + token + "&action=extendeddata&edid=" + edid;
HttpPost httppost = new HttpPost(address);
try {
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
return httpResponse.getEntity().getContent();
} else {
LOGGER.error(httpResponse.getStatusLine().getStatusCode() + " - " + httpResponse.getStatusLine().getReasonPhrase());
httppost.releaseConnection();
}
} catch (ClientProtocolException e) {
LOGGER.error("", e);
} catch (IOException e) {
LOGGER.error("", e);
}
return null;
}
public <T extends PublicInterface> T get(Class<T> class1) throws PublicInterfaceNotFoundException {
T t = get(class1.getName());
if (t == null) {
throw new PublicInterfaceNotFoundException("Interface " + class1.getSimpleName() + " not registered on channel " + this);
}
return t;
}
@Override
public AdminInterface getAdminInterface() throws PublicInterfaceNotFoundException {
return get(AdminInterface.class);
}
@Override
public AuthInterface getAuthInterface() throws PublicInterfaceNotFoundException {
return get(AuthInterface.class);
}
@Override
public LowLevelInterface getLowLevelInterface() throws PublicInterfaceNotFoundException {
return get(LowLevelInterface.class);
}
@Override
public MetaInterface getMeta() throws PublicInterfaceNotFoundException {
return get(MetaInterface.class);
}
@Override
public PluginInterface getPluginInterface() throws PublicInterfaceNotFoundException {
return get(PluginInterface.class);
}
@Override
public NotificationRegistryInterface getRegistry() throws PublicInterfaceNotFoundException {
return get(NotificationRegistryInterface.class);
}
@Override
public SettingsInterface getSettingsInterface() throws PublicInterfaceNotFoundException {
return get(SettingsInterface.class);
}
@Override
public ServiceInterface getServiceInterface() throws PublicInterfaceNotFoundException {
return get(ServiceInterface.class);
}
@Override
public NewServicesInterface getNewServicesInterface() throws PublicInterfaceNotFoundException {
return get(NewServicesInterface.class);
}
protected boolean has(Class<? extends PublicInterface> interface1) {
return serviceInterfaces.containsKey(interface1.getName());
}
public AuthInterface getBimServerAuthInterface() throws PublicInterfaceNotFoundException {
return get(AuthInterface.class);
}
public void bulkCheckin(String baseAddress, String token, long poid, String comment, Path file) throws UserException, ServerException {
String address = baseAddress + "/bulkupload";
HttpPost httppost = new HttpPost(address);
try (InputStream inputStream = Files.newInputStream(file)) {
InputStreamBody data = new InputStreamBody(inputStream, file.getFileName().toString());
MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
}
} | BimServerClientLib/src/org/bimserver/client/Channel.java | package org.bimserver.client;
/******************************************************************************
* Copyright (C) 2009-2019 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see {@literal<http://www.gnu.org/licenses/>}.
*****************************************************************************/
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.zip.DeflaterInputStream;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.InputStreamBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.bimserver.interfaces.objects.SLongCheckinActionState;
import org.bimserver.shared.ChannelConnectionException;
import org.bimserver.shared.ConnectDisconnectListener;
import org.bimserver.shared.ServiceHolder;
import org.bimserver.shared.TokenHolder;
import org.bimserver.shared.exceptions.PublicInterfaceNotFoundException;
import org.bimserver.shared.exceptions.ServerException;
import org.bimserver.shared.exceptions.UserException;
import org.bimserver.shared.interfaces.AdminInterface;
import org.bimserver.shared.interfaces.AuthInterface;
import org.bimserver.shared.interfaces.LowLevelInterface;
import org.bimserver.shared.interfaces.MetaInterface;
import org.bimserver.shared.interfaces.NewServicesInterface;
import org.bimserver.shared.interfaces.NotificationRegistryInterface;
import org.bimserver.shared.interfaces.PluginInterface;
import org.bimserver.shared.interfaces.PublicInterface;
import org.bimserver.shared.interfaces.ServiceInterface;
import org.bimserver.shared.interfaces.SettingsInterface;
import org.bimserver.shared.json.ConvertException;
import org.bimserver.shared.json.JsonConverter;
import org.bimserver.shared.meta.SServicesMap;
import org.bimserver.shared.reflector.Reflector;
import org.bimserver.shared.reflector.ReflectorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Charsets;
public abstract class Channel implements ServiceHolder {
private final Map<String, PublicInterface> serviceInterfaces = new HashMap<String, PublicInterface>();
private final Set<ConnectDisconnectListener> connectDisconnectListeners = new HashSet<ConnectDisconnectListener>();
private static final Logger LOGGER = LoggerFactory.getLogger(Channel.class);
private CloseableHttpClient closeableHttpClient;
public Channel(CloseableHttpClient closeableHttpClient) {
this.closeableHttpClient = closeableHttpClient;
}
@SuppressWarnings("unchecked")
public <T extends PublicInterface> T get(String interfaceClass) {
return (T) serviceInterfaces.get(interfaceClass);
}
public void add(String interfaceClass, PublicInterface service) {
serviceInterfaces.put(interfaceClass, service);
}
public Map<String, PublicInterface> getServiceInterfaces() {
return serviceInterfaces;
}
public void registerConnectDisconnectListener(ConnectDisconnectListener connectDisconnectListener) {
connectDisconnectListeners.add(connectDisconnectListener);
}
public void notifyOfConnect() {
for (ConnectDisconnectListener connectDisconnectListener : connectDisconnectListeners) {
connectDisconnectListener.connected();
}
}
public void notifyOfDisconnect() {
for (ConnectDisconnectListener connectDisconnectListener : connectDisconnectListeners) {
connectDisconnectListener.disconnected();
}
}
protected void finish(Reflector reflector, ReflectorFactory reflectorFactory) {
}
public abstract void disconnect();
public abstract void connect(TokenHolder tokenHolder) throws ChannelConnectionException;
public SLongCheckinActionState checkinSync(String baseAddress, String token, long poid, String comment, long deserializerOid, boolean merge, long fileSize, String filename, InputStream inputStream, Long topicId) throws ServerException, UserException {
String address = baseAddress + "/upload";
HttpPost httppost = new HttpPost(address);
try {
if (topicId == null) {
topicId = getServiceInterface().initiateCheckin(poid, deserializerOid);
}
// TODO find some GzipInputStream variant that _compresses_ instead
// of _decompresses_ using deflate for now
InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setCharset(Charsets.UTF_8);
multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("deserializerOid", new StringBody("" + deserializerOid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("merge", new StringBody("" + merge, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("sync", new StringBody("" + true, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("compression", new StringBody("deflate", ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
} else {
SServicesMap sServicesMap = getSServicesMap();
try {
return (SLongCheckinActionState) getJsonConverter().fromJson(sServicesMap.getSType("SLongCheckinState"), null, result);
} catch (ConvertException e) {
e.printStackTrace();
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
return null;
}
protected JsonConverter getJsonConverter() {
return null;
}
protected SServicesMap getSServicesMap() {
return null;
}
public long checkinAsync(String baseAddress, String token, long poid, String comment, long deserializerOid, boolean merge, long fileSize, String filename, InputStream inputStream, long topicId) throws ServerException, UserException {
String address = baseAddress + "/upload";
HttpPost httppost = new HttpPost(address);
try {
// TODO find some GzipInputStream variant that _compresses_ instead
// of _decompresses_ using deflate for now
InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setCharset(Charsets.UTF_8);
multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("deserializerOid", new StringBody("" + deserializerOid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("merge", new StringBody("" + merge, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("sync", new StringBody("" + false, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("compression", new StringBody("deflate", ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
} else {
if (result.has("topicId")) {
return result.get("topicId").asLong();
} else {
throw new ServerException("No topicId found in response: " + result.toString());
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
return -1;
}
public InputStream getDownloadData(String baseAddress, String token, long topicId) throws IOException {
String address = baseAddress + "/download?token=" + token + "&topicId=" + topicId;
HttpPost httppost = new HttpPost(address);
try {
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
return httpResponse.getEntity().getContent();
} else {
LOGGER.error(httpResponse.getStatusLine().getStatusCode() + " - " + httpResponse.getStatusLine().getReasonPhrase());
httppost.releaseConnection();
}
} catch (ClientProtocolException e) {
LOGGER.error("", e);
} catch (IOException e) {
LOGGER.error("", e);
}
return null;
}
public InputStream getDownloadExtendedData(String baseAddress, String token, long edid) throws IOException {
String address = baseAddress + "/download?token=" + token + "&action=extendeddata&edid=" + edid;
HttpPost httppost = new HttpPost(address);
try {
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
return httpResponse.getEntity().getContent();
} else {
LOGGER.error(httpResponse.getStatusLine().getStatusCode() + " - " + httpResponse.getStatusLine().getReasonPhrase());
httppost.releaseConnection();
}
} catch (ClientProtocolException e) {
LOGGER.error("", e);
} catch (IOException e) {
LOGGER.error("", e);
}
return null;
}
public <T extends PublicInterface> T get(Class<T> class1) throws PublicInterfaceNotFoundException {
T t = get(class1.getName());
if (t == null) {
throw new PublicInterfaceNotFoundException("Interface " + class1.getSimpleName() + " not registered on channel " + this);
}
return t;
}
@Override
public AdminInterface getAdminInterface() throws PublicInterfaceNotFoundException {
return get(AdminInterface.class);
}
@Override
public AuthInterface getAuthInterface() throws PublicInterfaceNotFoundException {
return get(AuthInterface.class);
}
@Override
public LowLevelInterface getLowLevelInterface() throws PublicInterfaceNotFoundException {
return get(LowLevelInterface.class);
}
@Override
public MetaInterface getMeta() throws PublicInterfaceNotFoundException {
return get(MetaInterface.class);
}
@Override
public PluginInterface getPluginInterface() throws PublicInterfaceNotFoundException {
return get(PluginInterface.class);
}
@Override
public NotificationRegistryInterface getRegistry() throws PublicInterfaceNotFoundException {
return get(NotificationRegistryInterface.class);
}
@Override
public SettingsInterface getSettingsInterface() throws PublicInterfaceNotFoundException {
return get(SettingsInterface.class);
}
@Override
public ServiceInterface getServiceInterface() throws PublicInterfaceNotFoundException {
return get(ServiceInterface.class);
}
@Override
public NewServicesInterface getNewServicesInterface() throws PublicInterfaceNotFoundException {
return get(NewServicesInterface.class);
}
protected boolean has(Class<? extends PublicInterface> interface1) {
return serviceInterfaces.containsKey(interface1.getName());
}
public AuthInterface getBimServerAuthInterface() throws PublicInterfaceNotFoundException {
return get(AuthInterface.class);
}
public void bulkCheckin(String baseAddress, String token, long poid, String comment, Path file) throws UserException, ServerException {
String address = baseAddress + "/bulkupload";
HttpPost httppost = new HttpPost(address);
try (InputStream inputStream = Files.newInputStream(file)) {
InputStreamBody data = new InputStreamBody(inputStream, file.getFileName().toString());
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setCharset(Charsets.UTF_8);
multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("comment", new StringBody("" + comment, ContentType.DEFAULT_TEXT));
multipartEntityBuilder.addPart("data", data);
httppost.setEntity(multipartEntityBuilder.build());
HttpResponse httpResponse = closeableHttpClient.execute(httppost);
if (httpResponse.getStatusLine().getStatusCode() == 200) {
ObjectMapper objectMapper = new ObjectMapper();
InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent());
try {
ObjectNode result = objectMapper.readValue(in, ObjectNode.class);
if (result.has("exception")) {
ObjectNode exceptionJson = (ObjectNode) result.get("exception");
String exceptionType = exceptionJson.get("__type").asText();
String message = exceptionJson.has("message") ? exceptionJson.get("message").asText() : "unknown";
if (exceptionType.equals(UserException.class.getSimpleName())) {
throw new UserException(message);
} else if (exceptionType.equals(ServerException.class.getSimpleName())) {
throw new ServerException(message);
}
}
} finally {
in.close();
}
}
} catch (ClientProtocolException e) {
throw new ServerException(e);
} catch (IOException e) {
throw new ServerException(e);
} catch (PublicInterfaceNotFoundException e) {
throw new ServerException(e);
} finally {
httppost.releaseConnection();
}
}
} | Use HttpMultipartMode.BROWSER_COMPATIBLE | BimServerClientLib/src/org/bimserver/client/Channel.java | Use HttpMultipartMode.BROWSER_COMPATIBLE | <ide><path>imServerClientLib/src/org/bimserver/client/Channel.java
<ide> import org.apache.http.client.ClientProtocolException;
<ide> import org.apache.http.client.methods.HttpPost;
<ide> import org.apache.http.entity.ContentType;
<add>import org.apache.http.entity.mime.HttpMultipartMode;
<ide> import org.apache.http.entity.mime.MultipartEntityBuilder;
<ide> import org.apache.http.entity.mime.content.InputStreamBody;
<ide> import org.apache.http.entity.mime.content.StringBody;
<ide> // of _decompresses_ using deflate for now
<ide> InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
<ide>
<del> MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
<del> multipartEntityBuilder.setCharset(Charsets.UTF_8);
<add> MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
<ide>
<ide> multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
<ide> multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
<ide> return null;
<ide> }
<ide>
<add> private MultipartEntityBuilder createMultiPart() {
<add> MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
<add> multipartEntityBuilder.setCharset(Charsets.UTF_8);
<add> multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
<add> return multipartEntityBuilder;
<add> }
<add>
<ide> protected JsonConverter getJsonConverter() {
<ide> return null;
<ide> }
<ide> // of _decompresses_ using deflate for now
<ide> InputStreamBody data = new InputStreamBody(new DeflaterInputStream(inputStream), filename);
<ide>
<del> MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
<del> multipartEntityBuilder.setCharset(Charsets.UTF_8);
<add> MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
<ide>
<ide> multipartEntityBuilder.addPart("topicId", new StringBody("" + topicId, ContentType.DEFAULT_TEXT));
<ide> multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
<ide> try (InputStream inputStream = Files.newInputStream(file)) {
<ide> InputStreamBody data = new InputStreamBody(inputStream, file.getFileName().toString());
<ide>
<del> MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
<del> multipartEntityBuilder.setCharset(Charsets.UTF_8);
<add> MultipartEntityBuilder multipartEntityBuilder = createMultiPart();
<ide>
<ide> multipartEntityBuilder.addPart("token", new StringBody(token, ContentType.DEFAULT_TEXT));
<ide> multipartEntityBuilder.addPart("poid", new StringBody("" + poid, ContentType.DEFAULT_TEXT)); |
|
JavaScript | bsd-2-clause | 247ddb36b2fa1f72124ee23f0de218c96503df59 | 0 | pashky/connect-fastcgi | module.exports = function fastcgi(newOptions) {
var url = require('url')
, fs = require('fs')
, path = require("path")
, http = require("http")
, net = require("net")
, sys = require("sys")
, fastcgi = require("fastcgi-parser");
var debug = 0 ? console : { log: function(){}, dir: function(){} };
var FCGI_RESPONDER = fastcgi.constants.role.FCGI_RESPONDER;
var FCGI_BEGIN = fastcgi.constants.record.FCGI_BEGIN;
var FCGI_STDIN = fastcgi.constants.record.FCGI_STDIN;
var FCGI_STDOUT = fastcgi.constants.record.FCGI_STDOUT;
var FCGI_PARAMS = fastcgi.constants.record.FCGI_PARAMS;
var FCGI_END = fastcgi.constants.record.FCGI_END;
/**
* Make headers for FPM
*
* Some headers have to be modified to fit the FPM
* handler and some others don't. For instance, the Content-Type
* header, when received, has to be made upper-case and the
* hyphen has to be made into an underscore. However, the Accept
* header has to be made uppercase, hyphens turned into underscores
* and the string "HTTP_" has to be appended to the header.
*
* @param array headers An array of existing user headers from Node.js
* @param array params An array of pre-built headers set in serveFpm
*
* @return array An array of complete headers.
*/
function makeHeaders(headers, params) {
if (headers.length <= 0) {
return params;
}
for (var prop in headers) {
var head = headers[prop];
prop = prop.replace(/-/, '_').toUpperCase();
if (prop.indexOf('CONTENT_') < 0) {
// Quick hack for PHP, might be more or less headers.
prop = 'HTTP_' + prop;
}
params[params.length] = [prop, head]
}
return params;
};
/**
* Interact with FPM
*
* This function is used to interact with the FastCGI protocol
* using net.Stream and the fastcgi module.
*
* We pass the request, the response, some params and some options
* that we then use to serve the response to our client.
*
* @param object Request The HTTP Request object.
* @param object Response The HTTP Response object to use.
* @param array Params A list of parameters to pass to FCGI
* @param array options A list of options like the port of the fpm server.
*
* @return void
*/
function server(request, response, params, options, next) {
var connection = new net.Stream();
connection.setNoDelay(true);
var writer = null;
var parser = null;
var header = {
"version": fastcgi.constants.version,
"type": FCGI_BEGIN,
"recordId": 0,
"contentLength": 0,
"paddingLength": 0
};
var begin = {
"role": FCGI_RESPONDER,
"flags": fastcgi.constants.keepalive.OFF
};
var collectedStdin = [], noMoreData = false;
function endRequest() {
if(writer) {
header.type = FCGI_STDIN;
header.contentLength = 0;
header.paddingLength = 0;
writer.writeHeader(header)
connection.write(writer.tobuffer());
connection.end();
} else {
noMoreData = true;
}
}
function sendRequest (connection) {
header.type = FCGI_BEGIN;
header.contentLength = 8;
writer.writeHeader(header);
writer.writeBegin(begin);
connection.write(writer.tobuffer());
header.type = FCGI_PARAMS;
header.contentLength = fastcgi.getParamLength(params);
writer.writeHeader(header);
writer.writeParams(params);
connection.write(writer.tobuffer());
header.type = FCGI_PARAMS;
header.contentLength = 0;
writer.writeHeader(header);
connection.write(writer.tobuffer());
// header.type = FCGI_STDOUT;
// writer.writeHeader(header);
// connection.write(writer.tobuffer());
if((request.method != 'PUT' && request.method != 'POST')) {
endRequest()
} else {
for(var j = 0; j < collectedStdin.length; ++j) {
header.type = FCGI_STDIN;
header.contentLength = collectedStdin[j].length;
header.paddingLength = 0;
writer.writeHeader(header);
writer.writeBody(collectedStdin[j].toString());
connection.write(writer.tobuffer());
}
collectedStdin = [];
if(noMoreData) {
endRequest();
}
}
};
request.on('data', function(chunk) {
if(writer) {
header.type = FCGI_STDIN;
header.contentLength = chunk.length;
header.paddingLength = 0;
writer.writeHeader(header);
writer.writeBody(chunk);
connection.write(writer.tobuffer())
} else {
collectedStdin.push(chunk);
}
});
request.on('end', endRequest);
connection.ondata = function (buffer, start, end) {
parser.execute(buffer, start, end);
};
connection.addListener("connect", function() {
writer = new fastcgi.writer();
parser = new fastcgi.parser();
writer.encoding = 'binary';
var body="", hadheaders = false;
parser.onRecord = function(record) {
if (record.header.type == FCGI_STDOUT && !hadheaders) {
body = record.body;
debug.log(body);
var parts = body.split("\r\n\r\n");
var headers = parts[0];
var headerParts = headers.split("\r\n");
body = parts[1];
var responseStatus = 200;
headers = [];
try {
for(var i in headerParts) {
header = headerParts[i].split(': ');
if (header[0].indexOf('Status') >= 0) {
responseStatus = header[1].substr(0, 3);
continue;
}
headers.push([header[0], header[1]]);
}
} catch (err) {
//console.log(err);
}
debug.log(' --> Request Response Status Code: "' + responseStatus + '"');
if(responseStatus === "404") {
next();
parser.onRecord = function() {};
connection.end();
return;
}
response.writeHead(responseStatus, headers);
hadheaders = true;
} else if(record.header.type == FCGI_STDOUT && hadheaders) {
body += record.body;
} else if(record.header.type == FCGI_END) {
response.end(body);
}
};
parser.onError = function(err) {
//console.log(err);
};
sendRequest(connection);
});
connection.addListener("close", function() {
connection.end();
});
connection.addListener("error", function(err) {
sys.puts(sys.inspect(err.stack));
connection.end();
});
connection.connect(options.fastcgiPort, options.fastcgiHost);
}
// Let's mix those options.
var options = {
fastcgiPort: 9000,
fastcgiHost: 'localhost',
root: ''
};
for (var k in newOptions) {
options[k] = newOptions[k];
}
return function(request, response, next) {
var script_dir = options.root;
var script_file = url.parse(request.url).pathname;
var request_uri = request.headers['x-request-uri'] ? request.headers['x-request-uri'] : request.url;
var qs = url.parse(request_uri).query ? url.parse(request_uri).query : '';
var params = makeHeaders(request.headers, [
["SCRIPT_FILENAME",script_dir + script_file],
["REMOTE_ADDR",request.connection.remoteAddress],
["QUERY_STRING", qs],
["REQUEST_METHOD", request.method],
["SCRIPT_NAME", script_file],
["PATH_INFO", script_file],
["DOCUMENT_URI", script_file],
["REQUEST_URI", request_uri],
["DOCUMENT_ROOT", script_dir],
["PHP_SELF", script_file],
["GATEWAY_PROTOCOL", "CGI/1.1"],
["SERVER_SOFTWARE", "node/" + process.version]
]);
debug.log('Incoming Request: ' + request.method + ' ' + request.url);
debug.dir(params);
server(request, response, params, options, next);
};
}
| index.js | module.exports = function fastcgi(newOptions) {
var url = require('url')
, fs = require('fs')
, path = require("path")
, http = require("http")
, net = require("net")
, sys = require("sys")
, fastcgi = require("fastcgi-parser");
var debug = 0 ? console : { log: function(){}, dir: function(){} };
var FCGI_RESPONDER = fastcgi.constants.role.FCGI_RESPONDER;
var FCGI_BEGIN = fastcgi.constants.record.FCGI_BEGIN;
var FCGI_STDIN = fastcgi.constants.record.FCGI_STDIN;
var FCGI_STDOUT = fastcgi.constants.record.FCGI_STDOUT;
var FCGI_PARAMS = fastcgi.constants.record.FCGI_PARAMS;
var FCGI_END = fastcgi.constants.record.FCGI_END;
/**
* Make headers for FPM
*
* Some headers have to be modified to fit the FPM
* handler and some others don't. For instance, the Content-Type
* header, when received, has to be made upper-case and the
* hyphen has to be made into an underscore. However, the Accept
* header has to be made uppercase, hyphens turned into underscores
* and the string "HTTP_" has to be appended to the header.
*
* @param array headers An array of existing user headers from Node.js
* @param array params An array of pre-built headers set in serveFpm
*
* @return array An array of complete headers.
*/
function makeHeaders(headers, params) {
if (headers.length <= 0) {
return params;
}
for (var prop in headers) {
var head = headers[prop];
prop = prop.replace(/-/, '_').toUpperCase();
if (prop.indexOf('CONTENT_') < 0) {
// Quick hack for PHP, might be more or less headers.
prop = 'HTTP_' + prop;
}
params[params.length] = [prop, head]
}
return params;
};
/**
* Interact with FPM
*
* This function is used to interact with the FastCGI protocol
* using net.Stream and the fastcgi module.
*
* We pass the request, the response, some params and some options
* that we then use to serve the response to our client.
*
* @param object Request The HTTP Request object.
* @param object Response The HTTP Response object to use.
* @param array Params A list of parameters to pass to FCGI
* @param array options A list of options like the port of the fpm server.
*
* @return void
*/
function server(request, response, params, options, next) {
var connection = new net.Stream();
connection.setNoDelay(true);
var writer = null;
var parser = null;
var header = {
"version": fastcgi.constants.version,
"type": FCGI_BEGIN,
"recordId": 0,
"contentLength": 0,
"paddingLength": 0
};
var begin = {
"role": FCGI_RESPONDER,
"flags": fastcgi.constants.keepalive.OFF
};
var collectedStdin = [], noMoreData = false;
function endRequest() {
if(writer) {
header.type = FCGI_STDIN;
header.contentLength = 0;
header.paddingLength = 0;
writer.writeHeader(header)
connection.write(writer.tobuffer());
connection.end();
} else {
noMoreData = true;
}
}
function sendRequest (connection) {
header.type = FCGI_BEGIN;
header.contentLength = 8;
writer.writeHeader(header);
writer.writeBegin(begin);
connection.write(writer.tobuffer());
header.type = FCGI_PARAMS;
header.contentLength = fastcgi.getParamLength(params);
writer.writeHeader(header);
writer.writeParams(params);
connection.write(writer.tobuffer());
header.type = FCGI_PARAMS;
header.contentLength = 0;
writer.writeHeader(header);
connection.write(writer.tobuffer());
// header.type = FCGI_STDOUT;
// writer.writeHeader(header);
// connection.write(writer.tobuffer());
if((request.method != 'PUT' && request.method != 'POST')) {
endRequest()
} else {
for(var j = 0; j < collectedStdin.length; ++j) {
header.type = FCGI_STDIN;
header.contentLength = collectedStdin[j].length;
header.paddingLength = 0;
writer.writeHeader(header);
writer.writeBody(collectedStdin[j].toString());
connection.write(writer.tobuffer());
}
collectedStdin = [];
if(noMoreData) {
endRequest();
}
}
};
request.on('data', function(chunk) {
if(writer) {
header.type = FCGI_STDIN;
header.contentLength = chunk.length;
header.paddingLength = 0;
writer.writeHeader(header);
writer.writeBody(chunk);
connection.write(writer.tobuffer())
} else {
collectedStdin.push(chunk);
}
});
request.on('end', endRequest);
connection.ondata = function (buffer, start, end) {
parser.execute(buffer, start, end);
};
connection.addListener("connect", function() {
writer = new fastcgi.writer();
parser = new fastcgi.parser();
writer.encoding = 'binary';
var body="", hadheaders = false;
parser.onRecord = function(record) {
if (record.header.type == FCGI_STDOUT && !hadheaders) {
body = record.body;
debug.log(body);
var parts = body.split("\r\n\r\n");
var headers = parts[0];
var headerParts = headers.split("\r\n");
body = parts[1];
var responseStatus = 200;
headers = [];
try {
for(var i in headerParts) {
header = headerParts[i].split(': ');
if (header[0].indexOf('Status') >= 0) {
responseStatus = header[1].substr(0, 3);
continue;
}
headers.push([header[0], header[1]]);
}
} catch (err) {
//console.log(err);
}
debug.log(' --> Request Response Status Code: "' + responseStatus + '"');
if(responseStatus === "404") {
next();
parser.onRecord = function() {};
connection.end();
return;
}
response.writeHead(responseStatus, headers);
hadheaders = true;
} else if(record.header.type == FCGI_STDOUT && hadheaders) {
body += record.body;
} else if(record.header.type == FCGI_END) {
response.end(body);
}
};
parser.onError = function(err) {
//console.log(err);
};
sendRequest(connection);
});
connection.addListener("close", function() {
connection.end();
});
connection.addListener("error", function(err) {
sys.puts(sys.inspect(err.stack));
connection.end();
});
connection.connect(options.fastcgiPort, options.fastcgiHost);
}
// Let's mix those options.
var options = {
fastcgiPort: 9000,
fastcgiHost: 'localhost',
root: ''
};
for (var k in newOptions) {
options[k] = newOptions[k];
}
return function(request, response, next) {
var script_dir = options.root;
var script_file = url.parse(request.url).pathname;
var qs = url.parse(request.url).query ? url.parse(request.url).query : '';
var params = makeHeaders(request.headers, [
["SCRIPT_FILENAME",script_dir + script_file],
["REMOTE_ADDR",request.connection.remoteAddress],
["QUERY_STRING", qs],
["REQUEST_METHOD", request.method],
["SCRIPT_NAME", script_file],
["PATH_INFO", script_file],
["DOCUMENT_URI", script_file],
["REQUEST_URI", request.headers['x-request-uri'] ? request.headers['x-request-uri'] : request.url],
["DOCUMENT_ROOT", script_dir],
["PHP_SELF", script_file],
["GATEWAY_PROTOCOL", "CGI/1.1"],
["SERVER_SOFTWARE", "node/" + process.version]
]);
debug.log('Incoming Request: ' + request.method + ' ' + request.url);
debug.dir(params);
server(request, response, params, options, next);
};
}
| Takes query-string of x-request-uri into account. | index.js | Takes query-string of x-request-uri into account. | <ide><path>ndex.js
<ide> var script_dir = options.root;
<ide> var script_file = url.parse(request.url).pathname;
<ide>
<del> var qs = url.parse(request.url).query ? url.parse(request.url).query : '';
<add> var request_uri = request.headers['x-request-uri'] ? request.headers['x-request-uri'] : request.url;
<add> var qs = url.parse(request_uri).query ? url.parse(request_uri).query : '';
<ide> var params = makeHeaders(request.headers, [
<ide> ["SCRIPT_FILENAME",script_dir + script_file],
<ide> ["REMOTE_ADDR",request.connection.remoteAddress],
<ide> ["SCRIPT_NAME", script_file],
<ide> ["PATH_INFO", script_file],
<ide> ["DOCUMENT_URI", script_file],
<del> ["REQUEST_URI", request.headers['x-request-uri'] ? request.headers['x-request-uri'] : request.url],
<add> ["REQUEST_URI", request_uri],
<ide> ["DOCUMENT_ROOT", script_dir],
<ide> ["PHP_SELF", script_file],
<ide> ["GATEWAY_PROTOCOL", "CGI/1.1"], |
|
Java | unlicense | 9ca8606be5e43d07efa23cb3f70982f522799ea9 | 0 | Kesin11/Spokendoc-Baseline,Kesin11/Spokendoc-Baseline | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
* 形態素解析を行うシェルスクリプトを呼び出して文字列をトークンに分割する
* http://www.ne.jp/asahi/hishidama/home/tech/java/process.html
*/
public class Tokenizer {
String tokenizerPath = "tokenizer.sh";
public static String[] tokenize(String rowString) throws IOException, InterruptedException{
// サブコマンド実行
String command = "echo " + '"' + rowString + '"' + " | sh src/tokenizer.sh";
Process process = new ProcessBuilder("sh", "-c", command).start();
// デバッグ用。シェルのエラーコード
// int ret = process.waitFor();
// System.out.println(ret);
// 標準出力受け取り
InputStream iStream = process.getInputStream();
BufferedReader brReader = new BufferedReader(new InputStreamReader(iStream));
ArrayList<String> tokens = new ArrayList<String>();
String line = "";
while((line = brReader.readLine()) != null){
tokens.add(line);
}
return tokens.toArray(new String[0]);
}
public static void main(String[] args) throws IOException, InterruptedException {
String rawString = args[0];
String[] tokens = tokenize(rawString);
for (String token: tokens){
System.out.println(token);
}
}
}
| src/Tokenizer.java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
* 形態素解析を行うシェルスクリプトを呼び出して文字列をトークンに分割する
* http://www.ne.jp/asahi/hishidama/home/tech/java/process.html
*/
public class Tokenizer {
String tokenizerPath = "tokenizer.sh";
public static String[] tokenize(String rowString) throws IOException, InterruptedException{
// サブコマンド実行
String command = "echo " + rowString + " | sh src/tokenizer.sh";
Process process = new ProcessBuilder("sh", "-c", command).start();
// デバッグ用。シェルのエラーコード
// int ret = process.waitFor();
// System.out.println(ret);
// 標準出力受け取り
InputStream iStream = process.getInputStream();
BufferedReader brReader = new BufferedReader(new InputStreamReader(iStream));
ArrayList<String> tokens = new ArrayList<String>();
String line = "";
while((line = brReader.readLine()) != null){
tokens.add(line);
}
return tokens.toArray(new String[0]);
}
public static void main(String[] args) throws IOException, InterruptedException {
String rawString = args[0];
String[] tokens = tokenize(rawString);
for (String token: tokens){
System.out.println(token);
}
}
}
| クエリに括弧()が含まれていると形態素解析に失敗するバグの修正
| src/Tokenizer.java | クエリに括弧()が含まれていると形態素解析に失敗するバグの修正 | <ide><path>rc/Tokenizer.java
<ide> String tokenizerPath = "tokenizer.sh";
<ide> public static String[] tokenize(String rowString) throws IOException, InterruptedException{
<ide> // サブコマンド実行
<del> String command = "echo " + rowString + " | sh src/tokenizer.sh";
<add> String command = "echo " + '"' + rowString + '"' + " | sh src/tokenizer.sh";
<ide> Process process = new ProcessBuilder("sh", "-c", command).start();
<ide> // デバッグ用。シェルのエラーコード
<ide> // int ret = process.waitFor(); |
|
Java | agpl-3.0 | 7eedcb75b6e4ebe79ec1b4cdb9733515637fcff7 | 0 | clintonhealthaccess/lmis-moz-mobile,clintonhealthaccess/lmis-moz-mobile,clintonhealthaccess/lmis-moz-mobile,clintonhealthaccess/lmis-moz-mobile | package org.openlmis.core.view.holder;
import android.support.design.widget.TextInputLayout;
import android.text.InputFilter;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import org.apache.commons.lang.StringUtils;
import org.openlmis.core.R;
import org.openlmis.core.utils.SingleTextWatcher;
import org.openlmis.core.view.viewmodel.StockCardViewModel;
import org.openlmis.core.view.widget.ExpireDateViewGroup;
import org.openlmis.core.view.widget.InputFilterMinMax;
import roboguice.inject.InjectView;
public class UnpackKitViewHolder extends PhysicalInventoryViewHolder {
@InjectView(R.id.product_name)
TextView tvProductName;
@InjectView(R.id.stock_on_hand_in_inventory)
TextView tvStockOnHandInInventory;
@InjectView(R.id.product_unit)
TextView tvProductUnit;
@InjectView(R.id.tx_quantity)
EditText etQuantity;
@InjectView(R.id.ly_quantity)
TextInputLayout lyQuantity;
@InjectView(R.id.vg_expire_date_container)
ExpireDateViewGroup expireDateViewGroup;
public UnpackKitViewHolder(View itemView) {
super(itemView);
etQuantity.setHint(R.string.hint_quantity_in_unpack_kit);
}
public void populate(StockCardViewModel stockCardViewModel) {
etQuantity.setFilters(new InputFilter[]{new InputFilterMinMax(0, (int) stockCardViewModel.getStockOnHand())});
tvStockOnHandInInventory.setText(context.getString(R.string.label_unpack_kit_quantity_expected,
Long.toString(stockCardViewModel.getStockOnHand())));
populate(stockCardViewModel, StringUtils.EMPTY);
}
}
| app/src/main/java/org/openlmis/core/view/holder/UnpackKitViewHolder.java | package org.openlmis.core.view.holder;
import android.support.design.widget.TextInputLayout;
import android.text.Editable;
import android.text.InputFilter;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import org.openlmis.core.R;
import org.openlmis.core.utils.SingleTextWatcher;
import org.openlmis.core.view.viewmodel.StockCardViewModel;
import org.openlmis.core.view.widget.ExpireDateViewGroup;
import org.openlmis.core.view.widget.InputFilterMinMax;
import roboguice.inject.InjectView;
public class UnpackKitViewHolder extends BaseViewHolder {
@InjectView(R.id.product_name)
TextView tvProductName;
@InjectView(R.id.stock_on_hand_in_inventory)
TextView tvStockOnHandInInventory;
@InjectView(R.id.product_unit)
TextView tvProductUnit;
@InjectView(R.id.tx_quantity)
EditText etQuantity;
@InjectView(R.id.ly_quantity)
TextInputLayout lyQuantity;
@InjectView(R.id.vg_expire_date_container)
ExpireDateViewGroup expireDateViewGroup;
public UnpackKitViewHolder(View itemView) {
super(itemView);
etQuantity.setHint(R.string.hint_quantity_in_unpack_kit);
}
public void populate(StockCardViewModel stockCardViewModel) {
tvProductName.setText(stockCardViewModel.getStyledName());
tvProductUnit.setText(stockCardViewModel.getStyledUnit());
etQuantity.setFilters(new InputFilter[]{new InputFilterMinMax(0, (int) stockCardViewModel.getStockOnHand())});
tvStockOnHandInInventory.setText(context.getString(R.string.label_unpack_kit_quantity_expected,
Long.toString(stockCardViewModel.getStockOnHand())));
EditTextWatcher textWatcher = new EditTextWatcher(stockCardViewModel);
etQuantity.removeTextChangedListener(textWatcher);
etQuantity.setText(stockCardViewModel.getQuantity());
etQuantity.addTextChangedListener(textWatcher);
expireDateViewGroup.initExpireDateViewGroup(stockCardViewModel, false);
if (stockCardViewModel.isValid()) {
lyQuantity.setErrorEnabled(false);
} else {
lyQuantity.setError(context.getString(R.string.msg_inventory_check_failed));
}
}
class EditTextWatcher extends SingleTextWatcher {
private final StockCardViewModel viewModel;
public EditTextWatcher(StockCardViewModel viewModel) {
this.viewModel = viewModel;
}
@Override
public void afterTextChanged(Editable editable) {
viewModel.setHasDataChanged(true);
viewModel.setQuantity(editable.toString());
}
}
}
| MG&CS - #374 - UnpackViewHolder should be the subclass of PhysicalInventoryViewHolder
| app/src/main/java/org/openlmis/core/view/holder/UnpackKitViewHolder.java | MG&CS - #374 - UnpackViewHolder should be the subclass of PhysicalInventoryViewHolder | <ide><path>pp/src/main/java/org/openlmis/core/view/holder/UnpackKitViewHolder.java
<ide> package org.openlmis.core.view.holder;
<ide>
<ide> import android.support.design.widget.TextInputLayout;
<del>import android.text.Editable;
<ide> import android.text.InputFilter;
<ide> import android.view.View;
<ide> import android.widget.EditText;
<ide> import android.widget.TextView;
<ide>
<add>import org.apache.commons.lang.StringUtils;
<ide> import org.openlmis.core.R;
<ide> import org.openlmis.core.utils.SingleTextWatcher;
<ide> import org.openlmis.core.view.viewmodel.StockCardViewModel;
<ide>
<ide> import roboguice.inject.InjectView;
<ide>
<del>public class UnpackKitViewHolder extends BaseViewHolder {
<add>public class UnpackKitViewHolder extends PhysicalInventoryViewHolder {
<ide>
<ide> @InjectView(R.id.product_name)
<ide> TextView tvProductName;
<ide> }
<ide>
<ide> public void populate(StockCardViewModel stockCardViewModel) {
<del> tvProductName.setText(stockCardViewModel.getStyledName());
<del> tvProductUnit.setText(stockCardViewModel.getStyledUnit());
<ide> etQuantity.setFilters(new InputFilter[]{new InputFilterMinMax(0, (int) stockCardViewModel.getStockOnHand())});
<del>
<ide> tvStockOnHandInInventory.setText(context.getString(R.string.label_unpack_kit_quantity_expected,
<ide> Long.toString(stockCardViewModel.getStockOnHand())));
<ide>
<del> EditTextWatcher textWatcher = new EditTextWatcher(stockCardViewModel);
<del> etQuantity.removeTextChangedListener(textWatcher);
<del> etQuantity.setText(stockCardViewModel.getQuantity());
<del> etQuantity.addTextChangedListener(textWatcher);
<del>
<del> expireDateViewGroup.initExpireDateViewGroup(stockCardViewModel, false);
<del>
<del> if (stockCardViewModel.isValid()) {
<del> lyQuantity.setErrorEnabled(false);
<del> } else {
<del> lyQuantity.setError(context.getString(R.string.msg_inventory_check_failed));
<del> }
<del> }
<del>
<del> class EditTextWatcher extends SingleTextWatcher {
<del>
<del> private final StockCardViewModel viewModel;
<del>
<del> public EditTextWatcher(StockCardViewModel viewModel) {
<del> this.viewModel = viewModel;
<del> }
<del>
<del> @Override
<del> public void afterTextChanged(Editable editable) {
<del> viewModel.setHasDataChanged(true);
<del> viewModel.setQuantity(editable.toString());
<del> }
<add> populate(stockCardViewModel, StringUtils.EMPTY);
<ide> }
<ide> } |
|
Java | mit | 3383bb0fa55acb5101d17662d73c18b358e113e8 | 0 | VaclavStebra/stolen-car-database | package cz.muni.fi.a2p06.stolencardatabase;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.FrameLayout;
import com.firebase.ui.auth.AuthUI;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import butterknife.BindView;
import butterknife.ButterKnife;
import cz.muni.fi.a2p06.stolencardatabase.entity.Car;
import cz.muni.fi.a2p06.stolencardatabase.fragments.AddCarFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarDetailFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarListFragment;
public class MainActivity extends AppCompatActivity implements
CarListFragment.OnCarListFragmentInteractionListener,
CarDetailFragment.OnCarDetailFragmentInteractionListener {
private static final String TAG = "MainActivity";
@Nullable
@BindView(R.id.fragment_container)
FrameLayout mFragmentContainer;
private FirebaseAuth mAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAuth = FirebaseAuth.getInstance();
if (mAuth.getCurrentUser() == null) {
Intent loginIntent = new Intent(MainActivity.this, SignInActivity.class);
startActivity(loginIntent);
finish();
}
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ButterKnife.bind(this);
if (mFragmentContainer!= null) {
if (savedInstanceState != null) {
return;
}
CarListFragment carListFragment = new CarListFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, carListFragment).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (mAuth.getCurrentUser() != null) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.sign_out:
doLogout();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onItemClick(Car car) {
if (mFragmentContainer != null) {
manageCarClickOnMobile(car);
} else {
updateCarDetailFragment(car);
}
}
private void manageCarClickOnMobile(Car car) {
CarDetailFragment carDetailFragment = CarDetailFragment.newInstance(car);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, carDetailFragment);
transaction.addToBackStack(null);
transaction.commit();
}
@Override
public void onAddCarClick() {
if (mFragmentContainer != null) {
manageAddCarClickOnMobile();
} else {
manageAddCarClickOnTablet();
}
}
private void manageAddCarClickOnMobile() {
AddCarFragment addCarFragment = new AddCarFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, addCarFragment);
transaction.addToBackStack(null);
transaction.commit();
}
private void manageAddCarClickOnTablet() {
// TODO swap fragments
}
@Override
public void onDataLoaded(Car car) {
CarDetailFragment carFragment = (CarDetailFragment)
getSupportFragmentManager().findFragmentById(R.id.car_detail_frag);
if (carFragment != null && carFragment.getCar() == null) {
updateCarDetailFragment(car);
}
}
private void updateCarDetailFragment(Car car) {
CarDetailFragment carFragment = (CarDetailFragment)
getSupportFragmentManager().findFragmentById(R.id.car_detail_frag);
if (carFragment != null) {
carFragment.updateCarView(car);
}
}
public void doLogout() {
AuthUI.getInstance()
.signOut(this)
.addOnCompleteListener(new OnCompleteListener<Void>() {
public void onComplete(@NonNull Task<Void> task) {
// user is now signed out
startActivity(new Intent(MainActivity.this, SignInActivity.class));
finish();
}
});
}
@Override
public void onDeleteCar() {
if (mFragmentContainer != null) {
manageDeleteCarClickOnMobile();
} else {
manageDeleteCarClickOnTablet();
}
}
private void manageDeleteCarClickOnMobile() {
CarListFragment carListFragment = new CarListFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, carListFragment);
transaction.addToBackStack(null);
transaction.commit();
}
private void manageDeleteCarClickOnTablet() {
DatabaseReference ref = FirebaseDatabase.getInstance().getReference("cars");
Query query = ref.orderByChild("stolen_date").limitToFirst(1);
query.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
Car car = snapshot.getValue(Car.class);
updateCarDetailFragment(car);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
Log.w(TAG, "onCancelled", databaseError.toException());
}
});
}
}
| app/src/main/java/cz/muni/fi/a2p06/stolencardatabase/MainActivity.java | package cz.muni.fi.a2p06.stolencardatabase;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.FrameLayout;
import com.firebase.ui.auth.AuthUI;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import butterknife.BindView;
import butterknife.ButterKnife;
import cz.muni.fi.a2p06.stolencardatabase.entity.Car;
import cz.muni.fi.a2p06.stolencardatabase.fragments.AddCarFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarDetailFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarListFragment;
public class MainActivity extends AppCompatActivity implements
CarListFragment.OnCarListFragmentInteractionListener,
CarDetailFragment.OnCarDetailFragmentInteractionListener {
@Nullable
@BindView(R.id.fragment_container)
FrameLayout mFragmentContainer;
private FirebaseAuth mAuth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAuth = FirebaseAuth.getInstance();
if (mAuth.getCurrentUser() == null) {
Intent loginIntent = new Intent(MainActivity.this, SignInActivity.class);
startActivity(loginIntent);
finish();
}
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ButterKnife.bind(this);
if (mFragmentContainer!= null) {
if (savedInstanceState != null) {
return;
}
CarListFragment carListFragment = new CarListFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, carListFragment).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (mAuth.getCurrentUser() != null) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.sign_out:
doLogout();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onItemClick(Car car) {
if (mFragmentContainer != null) {
manageCarClickOnMobile(car);
} else {
manageCarClickOnTablet(car);
}
}
private void manageCarClickOnMobile(Car car) {
CarDetailFragment carDetailFragment = CarDetailFragment.newInstance(car);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, carDetailFragment);
transaction.addToBackStack(null);
transaction.commit();
}
private void manageCarClickOnTablet(Car car) {
updateCarDetailFragment(car);
}
@Override
public void onAddCarClick() {
if (mFragmentContainer != null) {
manageAddCarClickOnMobile();
} else {
manageAddCarClickOnTablet();
}
}
private void manageAddCarClickOnMobile() {
AddCarFragment addCarFragment = new AddCarFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, addCarFragment);
transaction.addToBackStack(null);
transaction.commit();
}
private void manageAddCarClickOnTablet() {
// TODO swap fragments
}
@Override
public void onDataLoaded(Car car) {
CarDetailFragment carFragment = (CarDetailFragment)
getSupportFragmentManager().findFragmentById(R.id.car_detail_frag);
if (carFragment != null && carFragment.getCar() == null) {
updateCarDetailFragment(car);
}
}
private void updateCarDetailFragment(Car car) {
CarDetailFragment carFragment = (CarDetailFragment)
getSupportFragmentManager().findFragmentById(R.id.car_detail_frag);
if (carFragment != null) {
carFragment.updateCarView(car);
}
}
public void doLogout() {
AuthUI.getInstance()
.signOut(this)
.addOnCompleteListener(new OnCompleteListener<Void>() {
public void onComplete(@NonNull Task<Void> task) {
// user is now signed out
startActivity(new Intent(MainActivity.this, SignInActivity.class));
finish();
}
});
}
@Override
public void onDeleteCar() {
if (mFragmentContainer != null) {
manageDeleteCarClickOnMobile();
} else {
manageDeleteCarClickOnTablet();
}
}
private void manageDeleteCarClickOnMobile() {
CarListFragment carListFragment = new CarListFragment();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, carListFragment);
transaction.addToBackStack(null);
transaction.commit();
}
private void manageDeleteCarClickOnTablet() {
// TODO
}
}
| Car delete on tablet - switch car in detail view when deleting car
| app/src/main/java/cz/muni/fi/a2p06/stolencardatabase/MainActivity.java | Car delete on tablet - switch car in detail view when deleting car | <ide><path>pp/src/main/java/cz/muni/fi/a2p06/stolencardatabase/MainActivity.java
<ide> import android.support.v4.app.FragmentTransaction;
<ide> import android.support.v7.app.AppCompatActivity;
<ide> import android.support.v7.widget.Toolbar;
<add>import android.util.Log;
<ide> import android.view.Menu;
<ide> import android.view.MenuInflater;
<ide> import android.view.MenuItem;
<ide> import com.google.android.gms.tasks.OnCompleteListener;
<ide> import com.google.android.gms.tasks.Task;
<ide> import com.google.firebase.auth.FirebaseAuth;
<add>import com.google.firebase.database.DataSnapshot;
<add>import com.google.firebase.database.DatabaseError;
<add>import com.google.firebase.database.DatabaseReference;
<add>import com.google.firebase.database.FirebaseDatabase;
<add>import com.google.firebase.database.Query;
<add>import com.google.firebase.database.ValueEventListener;
<ide>
<ide> import butterknife.BindView;
<ide> import butterknife.ButterKnife;
<ide> CarListFragment.OnCarListFragmentInteractionListener,
<ide> CarDetailFragment.OnCarDetailFragmentInteractionListener {
<ide>
<add> private static final String TAG = "MainActivity";
<ide> @Nullable
<ide> @BindView(R.id.fragment_container)
<ide> FrameLayout mFragmentContainer;
<ide> if (mFragmentContainer != null) {
<ide> manageCarClickOnMobile(car);
<ide> } else {
<del> manageCarClickOnTablet(car);
<add> updateCarDetailFragment(car);
<ide> }
<ide> }
<ide>
<ide> transaction.replace(R.id.fragment_container, carDetailFragment);
<ide> transaction.addToBackStack(null);
<ide> transaction.commit();
<del> }
<del>
<del> private void manageCarClickOnTablet(Car car) {
<del> updateCarDetailFragment(car);
<ide> }
<ide>
<ide> @Override
<ide> }
<ide>
<ide> private void manageDeleteCarClickOnTablet() {
<del> // TODO
<add> DatabaseReference ref = FirebaseDatabase.getInstance().getReference("cars");
<add> Query query = ref.orderByChild("stolen_date").limitToFirst(1);
<add> query.addValueEventListener(new ValueEventListener() {
<add> @Override
<add> public void onDataChange(DataSnapshot dataSnapshot) {
<add> for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
<add> Car car = snapshot.getValue(Car.class);
<add> updateCarDetailFragment(car);
<add> }
<add> }
<add>
<add> @Override
<add> public void onCancelled(DatabaseError databaseError) {
<add> Log.w(TAG, "onCancelled", databaseError.toException());
<add> }
<add> });
<ide> }
<ide> } |
|
Java | apache-2.0 | 25d1a8dc4a1f834c73efe4a2352193757d739998 | 0 | mufaddalq/cloudstack-datera-driver,mufaddalq/cloudstack-datera-driver,resmo/cloudstack,argv0/cloudstack,wido/cloudstack,cinderella/incubator-cloudstack,DaanHoogland/cloudstack,wido/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,DaanHoogland/cloudstack,argv0/cloudstack,cinderella/incubator-cloudstack,jcshen007/cloudstack,mufaddalq/cloudstack-datera-driver,cinderella/incubator-cloudstack,jcshen007/cloudstack,wido/cloudstack,argv0/cloudstack,mufaddalq/cloudstack-datera-driver,DaanHoogland/cloudstack,GabrielBrascher/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,mufaddalq/cloudstack-datera-driver,resmo/cloudstack,GabrielBrascher/cloudstack,cinderella/incubator-cloudstack,resmo/cloudstack,mufaddalq/cloudstack-datera-driver,argv0/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,wido/cloudstack,DaanHoogland/cloudstack,DaanHoogland/cloudstack,resmo/cloudstack,jcshen007/cloudstack,cinderella/incubator-cloudstack,DaanHoogland/cloudstack,resmo/cloudstack,wido/cloudstack,jcshen007/cloudstack,wido/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,wido/cloudstack,DaanHoogland/cloudstack,argv0/cloudstack,argv0/cloudstack,GabrielBrascher/cloudstack | /**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.storage.snapshot;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.BackupSnapshotAnswer;
import com.cloud.agent.api.BackupSnapshotCommand;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.DeleteSnapshotBackupCommand;
import com.cloud.agent.api.DeleteSnapshotsDirCommand;
import com.cloud.agent.api.ManageSnapshotAnswer;
import com.cloud.agent.api.ManageSnapshotCommand;
import com.cloud.api.commands.CreateSnapshotCmd;
import com.cloud.api.commands.CreateSnapshotPolicyCmd;
import com.cloud.api.commands.DeleteSnapshotCmd;
import com.cloud.api.commands.DeleteSnapshotPoliciesCmd;
import com.cloud.api.commands.ListRecurringSnapshotScheduleCmd;
import com.cloud.api.commands.ListSnapshotPoliciesCmd;
import com.cloud.api.commands.ListSnapshotsCmd;
import com.cloud.async.AsyncInstanceCreateStatus;
import com.cloud.async.AsyncJobManager;
import com.cloud.configuration.ResourceCount.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.dc.dao.DataCenterDao;
import com.cloud.domain.DomainVO;
import com.cloud.domain.dao.DomainDao;
import com.cloud.event.ActionEvent;
import com.cloud.event.EventTypes;
import com.cloud.event.UsageEventVO;
import com.cloud.event.dao.EventDao;
import com.cloud.event.dao.UsageEventDao;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.StorageUnavailableException;
import com.cloud.host.HostVO;
import com.cloud.host.dao.DetailsDao;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Snapshot;
import com.cloud.storage.Snapshot.Status;
import com.cloud.storage.Snapshot.Type;
import com.cloud.storage.SnapshotPolicyVO;
import com.cloud.storage.SnapshotScheduleVO;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.storage.dao.SnapshotDao;
import com.cloud.storage.dao.SnapshotPolicyDao;
import com.cloud.storage.dao.SnapshotScheduleDao;
import com.cloud.storage.dao.StoragePoolDao;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.AccountVO;
import com.cloud.user.User;
import com.cloud.user.UserContext;
import com.cloud.user.dao.AccountDao;
import com.cloud.user.dao.UserDao;
import com.cloud.utils.DateUtil;
import com.cloud.utils.DateUtil.IntervalType;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.component.Inject;
import com.cloud.utils.component.Manager;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.JoinBuilder.JoinType;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.dao.UserVmDao;
@Local(value = { SnapshotManager.class, SnapshotService.class })
public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Manager {
private static final Logger s_logger = Logger.getLogger(SnapshotManagerImpl.class);
@Inject
protected HostDao _hostDao;
@Inject
protected UserVmDao _vmDao;
@Inject
protected VolumeDao _volsDao;
@Inject
protected AccountDao _accountDao;
@Inject
protected DataCenterDao _dcDao;
@Inject
protected DiskOfferingDao _diskOfferingDao;
@Inject
protected UserDao _userDao;
@Inject
protected SnapshotDao _snapshotDao;
@Inject
protected StoragePoolDao _storagePoolDao;
@Inject
protected EventDao _eventDao;
@Inject
protected SnapshotPolicyDao _snapshotPolicyDao = null;
@Inject
protected SnapshotScheduleDao _snapshotScheduleDao;
@Inject
protected DetailsDao _detailsDao;
@Inject
protected DomainDao _domainDao;
@Inject
protected StorageManager _storageMgr;
@Inject
protected AgentManager _agentMgr;
@Inject
protected SnapshotScheduler _snapSchedMgr;
@Inject
protected AsyncJobManager _asyncMgr;
@Inject
protected AccountManager _accountMgr;
@Inject
protected ClusterDao _clusterDao;
@Inject
private UsageEventDao _usageEventDao;
String _name;
private int _totalRetries;
private int _pauseInterval;
private int _deltaSnapshotMax;
protected SearchBuilder<SnapshotVO> PolicySnapshotSearch;
protected SearchBuilder<SnapshotPolicyVO> PoliciesForSnapSearch;
private boolean isVolumeDirty(long volumeId, Long policy) {
VolumeVO volume = _volsDao.findById(volumeId);
boolean runSnap = true;
if (volume.getInstanceId() == null) {
long lastSnapId = _snapshotDao.getLastSnapshot(volumeId, 0);
SnapshotVO lastSnap = _snapshotDao.findByIdIncludingRemoved(lastSnapId);
if (lastSnap != null) {
Date lastSnapTime = lastSnap.getCreated();
if (lastSnapTime.after(volume.getUpdated())) {
runSnap = false;
s_logger.debug("Volume: " + volumeId + " is detached and last snap time is after Volume detach time. Skip snapshot for recurring policy");
}
}
} else if (_storageMgr.volumeInactive(volume)) {
// Volume is attached to a VM which is in Stopped state.
long lastSnapId = _snapshotDao.getLastSnapshot(volumeId, 0);
SnapshotVO lastSnap = _snapshotDao.findByIdIncludingRemoved(lastSnapId);
if (lastSnap != null) {
Date lastSnapTime = lastSnap.getCreated();
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
if (vmInstance != null) {
if (lastSnapTime.after(vmInstance.getUpdateTime())) {
runSnap = false;
s_logger.debug("Volume: " + volumeId + " is inactive and last snap time is after VM update time. Skip snapshot for recurring policy");
}
}
}
}
if (volume.getState() == Volume.State.Destroy || volume.getRemoved() != null) {
s_logger.debug("Volume: " + volumeId + " is destroyed/removed. Not taking snapshot");
runSnap = false;
}
return runSnap;
}
protected Answer sendToPool(Volume vol, Command cmd) {
StoragePool pool = _storagePoolDao.findById(vol.getPoolId());
VMInstanceVO vm = _vmDao.findById(vol.getInstanceId());
long[] hostIdsToTryFirst = null;
if (vm != null && vm.getHostId() != null) {
hostIdsToTryFirst = new long[] { vm.getHostId() };
}
List<Long> hostIdsToAvoid = new ArrayList<Long>();
for (int retry = _totalRetries; retry >= 0; retry--) {
try {
Pair<Long, Answer> result = _storageMgr.sendToPool(pool, hostIdsToTryFirst, hostIdsToAvoid, cmd);
if (result.second().getResult()) {
return result.second();
}
} catch (StorageUnavailableException e1) {
s_logger.warn("Storage unavailable ", e1);
return null;
}
try {
Thread.sleep(_pauseInterval * 1000);
} catch (InterruptedException e) {
}
}
return null;
}
@Override
public SnapshotVO createSnapshotOnPrimary(VolumeVO volume, Long policyId, Long snapshotId) {
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Can not find snapshot " + snapshotId);
}
// Send a ManageSnapshotCommand to the agent
String vmName = _storageMgr.getVmNameOnVolume(volume);
long volumeId = volume.getId();
long preId = _snapshotDao.getLastSnapshot(volumeId, snapshotId);
String preSnapshotPath = null;
SnapshotVO preSnapshotVO = null;
if (preId != 0) {
preSnapshotVO = _snapshotDao.findByIdIncludingRemoved(preId);
if (preSnapshotVO != null && preSnapshotVO.getBackupSnapshotId() != null) {
preSnapshotPath = preSnapshotVO.getPath();
}
}
ManageSnapshotCommand cmd = new ManageSnapshotCommand(snapshotId, volume.getPath(), preSnapshotPath, snapshot.getName(), vmName);
ManageSnapshotAnswer answer = (ManageSnapshotAnswer) sendToPool(volume, cmd);
// Update the snapshot in the database
if ((answer != null) && answer.getResult()) {
// The snapshot was successfully created
if (preSnapshotPath != null && preSnapshotPath == answer.getSnapshotPath()) {
// empty snapshot
s_logger.debug("CreateSnapshot: this is empty snapshot ");
snapshot.setPath(preSnapshotPath);
snapshot.setBackupSnapshotId(preSnapshotVO.getBackupSnapshotId());
snapshot.setStatus(Snapshot.Status.BackedUp);
snapshot.setPrevSnapshotId(preId);
_snapshotDao.update(snapshotId, snapshot);
} else {
long preSnapshotId = 0;
if (preSnapshotVO != null && preSnapshotVO.getBackupSnapshotId() != null) {
preSnapshotId = preId;
// default delta snap number is 16
int deltaSnap = _deltaSnapshotMax;
int i;
for (i = 1; i < deltaSnap; i++) {
String prevBackupUuid = preSnapshotVO.getBackupSnapshotId();
// previous snapshot doesn't have backup, create a full snapshot
if (prevBackupUuid == null) {
preSnapshotId = 0;
break;
}
long preSSId = preSnapshotVO.getPrevSnapshotId();
if (preSSId == 0) {
break;
}
preSnapshotVO = _snapshotDao.findByIdIncludingRemoved(preSSId);
}
if (i >= deltaSnap) {
preSnapshotId = 0;
}
}
snapshot = updateDBOnCreate(snapshotId, answer.getSnapshotPath(), preSnapshotId);
}
// Get the snapshot_schedule table entry for this snapshot and
// policy id.
// Set the snapshotId to retrieve it back later.
if (policyId != Snapshot.MANUAL_POLICY_ID) {
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, policyId, true);
assert snapshotSchedule != null;
snapshotSchedule.setSnapshotId(snapshotId);
_snapshotScheduleDao.update(snapshotSchedule.getId(), snapshotSchedule);
}
} else {
if (answer != null) {
s_logger.error(answer.getDetails());
}
// delete from the snapshots table
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("Creating snapshot for volume " + volumeId + " on primary storage failed.");
}
return snapshot;
}
public SnapshotVO createSnapshotImpl(long volumeId, long policyId) throws ResourceAllocationException {
return null;
}
@Override
@DB
public SnapshotVO createSnapshotImpl(Long volumeId, Long policyId, Long snapshotId) {
VolumeVO v = _volsDao.findById(volumeId);
Account owner = _accountMgr.getAccount(v.getAccountId());
SnapshotVO snapshot = null;
boolean backedUp = false;
try {
if (v != null && _volsDao.getHypervisorType(v.getId()).equals(HypervisorType.KVM)) {
/* KVM needs to lock on the vm of volume, because it takes snapshot on behalf of vm, not volume */
UserVmVO uservm = _vmDao.findById(v.getInstanceId());
if (uservm != null) {
UserVmVO vm = _vmDao.acquireInLockTable(uservm.getId(), 10);
if (vm == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is being used, try it later ");
}
}
}
Long poolId = v.getPoolId();
if (poolId == null) {
throw new CloudRuntimeException("You cannot take a snapshot of a volume until it has been attached to an instance");
}
if (_volsDao.getHypervisorType(v.getId()).equals(HypervisorType.KVM)) {
StoragePoolVO storagePool = _storagePoolDao.findById(v.getPoolId());
ClusterVO cluster = _clusterDao.findById(storagePool.getClusterId());
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
if (hosts != null && !hosts.isEmpty()) {
HostVO host = hosts.get(0);
if (!hostSupportSnapsthot(host)) {
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("KVM Snapshot is not supported on cluster: " + host.getId());
}
}
}
// if volume is attached to a vm in destroyed or expunging state; disallow
if (v.getInstanceId() != null) {
UserVmVO userVm = _vmDao.findById(v.getInstanceId());
if (userVm != null) {
if (userVm.getState().equals(State.Destroyed) || userVm.getState().equals(State.Expunging)) {
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is associated with vm:" + userVm.getInstanceName() + " is in " + userVm.getState().toString() + " state");
}
}
}
VolumeVO volume = _volsDao.acquireInLockTable(volumeId, 10);
if (volume == null) {
_snapshotDao.expunge(snapshotId);
volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " doesn't exist");
} else {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is being used, try it later ");
}
}
snapshot = createSnapshotOnPrimary(volume, policyId, snapshotId);
if (snapshot != null) {
if (snapshot.getStatus() == Snapshot.Status.CreatedOnPrimary) {
backedUp = backupSnapshotToSecondaryStorage(snapshot);
} else if (snapshot.getStatus() == Snapshot.Status.BackedUp) {
//For empty snapshot we set status to BackedUp in createSnapshotOnPrimary
backedUp = true;
}
if (!backedUp) {
throw new CloudRuntimeException("Created snapshot: " + snapshot + " on primary but failed to backup on secondary");
}
} else {
throw new CloudRuntimeException("Failed to create snapshot: " + snapshot + " on primary storage");
}
} finally {
// Cleanup jobs to do after the snapshot has been created; decrement resource count
if (snapshot != null) {
postCreateSnapshot(volumeId, snapshot.getId(), policyId, backedUp);
_volsDao.releaseFromLockTable(volumeId);
if (backedUp) {
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, v.getSize());
_usageEventDao.persist(usageEvent);
}
} else if (snapshot == null || !backedUp) {
_accountMgr.decrementResourceCount(owner.getId(), ResourceType.snapshot);
}
}
return snapshot;
}
@Override
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_CREATE, eventDescription = "creating snapshot", async = true)
public SnapshotVO createSnapshot(CreateSnapshotCmd cmd) {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getPolicyId();
Long snapshotId = cmd.getEntityId();
return createSnapshotImpl(volumeId, policyId, snapshotId);
}
private SnapshotVO updateDBOnCreate(Long id, String snapshotPath, long preSnapshotId) {
SnapshotVO createdSnapshot = _snapshotDao.findByIdIncludingRemoved(id);
createdSnapshot.setPath(snapshotPath);
createdSnapshot.setStatus(Snapshot.Status.CreatedOnPrimary);
createdSnapshot.setPrevSnapshotId(preSnapshotId);
_snapshotDao.update(id, createdSnapshot);
return createdSnapshot;
}
@Override
@DB
@SuppressWarnings("fallthrough")
public void validateSnapshot(Long userId, SnapshotVO snapshot) {
assert snapshot != null;
Long id = snapshot.getId();
Status status = snapshot.getStatus();
s_logger.debug("Snapshot scheduler found a snapshot whose actual status is not clear. Snapshot id:" + id + " with DB status: " + status);
switch (status) {
case Creating:
// else continue to the next case.
case CreatedOnPrimary:
// The snapshot has been created on the primary and the DB has been updated.
// However, it hasn't entered the backupSnapshotToSecondaryStorage, else
// status would have been backing up.
// So call backupSnapshotToSecondaryStorage without any fear.
case BackingUp:
// It has entered backupSnapshotToSecondaryStorage.
// But we have no idea whether it was backed up or not.
// So call backupSnapshotToSecondaryStorage again.
backupSnapshotToSecondaryStorage(snapshot);
break;
case BackedUp:
// No need to do anything as snapshot has already been backed up.
}
}
@Override
@DB
public boolean backupSnapshotToSecondaryStorage(SnapshotVO ss) {
long snapshotId = ss.getId();
SnapshotVO snapshot = _snapshotDao.acquireInLockTable(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Can not acquire lock for snapshot: " + ss);
}
try {
snapshot.setStatus(Snapshot.Status.BackingUp);
_snapshotDao.update(snapshot.getId(), snapshot);
long volumeId = snapshot.getVolumeId();
VolumeVO volume = _volsDao.lockRow(volumeId, true);
String primaryStoragePoolNameLabel = _storageMgr.getPrimaryStorageNameLabel(volume);
Long dcId = volume.getDataCenterId();
Long accountId = volume.getAccountId();
String secondaryStoragePoolUrl = _storageMgr.getSecondaryStorageURL(volume.getDataCenterId());
String snapshotUuid = snapshot.getPath();
// In order to verify that the snapshot is not empty,
// we check if the parent of the snapshot is not the same as the parent of the previous snapshot.
// We pass the uuid of the previous snapshot to the plugin to verify this.
SnapshotVO prevSnapshot = null;
String prevSnapshotUuid = null;
String prevBackupUuid = null;
long prevSnapshotId = snapshot.getPrevSnapshotId();
if (prevSnapshotId > 0) {
prevSnapshot = _snapshotDao.findByIdIncludingRemoved(prevSnapshotId);
prevBackupUuid = prevSnapshot.getBackupSnapshotId();
if (prevBackupUuid != null) {
prevSnapshotUuid = prevSnapshot.getPath();
}
}
boolean isVolumeInactive = _storageMgr.volumeInactive(volume);
String vmName = _storageMgr.getVmNameOnVolume(volume);
BackupSnapshotCommand backupSnapshotCommand = new BackupSnapshotCommand(primaryStoragePoolNameLabel, secondaryStoragePoolUrl, dcId, accountId, volumeId, volume.getPath(), snapshotUuid, snapshot.getName(), prevSnapshotUuid, prevBackupUuid,
isVolumeInactive, vmName);
String backedUpSnapshotUuid = null;
// By default, assume failed.
boolean backedUp = false;
BackupSnapshotAnswer answer = (BackupSnapshotAnswer) sendToPool(volume, backupSnapshotCommand);
if (answer != null && answer.getResult()) {
backedUpSnapshotUuid = answer.getBackupSnapshotName();
if (backedUpSnapshotUuid != null) {
backedUp = true;
}
} else if (answer != null) {
s_logger.error(answer.getDetails());
}
// Update the status in all cases.
Transaction txn = Transaction.currentTxn();
txn.start();
if (backedUp) {
snapshot.setBackupSnapshotId(backedUpSnapshotUuid);
if (answer.isFull()) {
snapshot.setPrevSnapshotId(0);
}
snapshot.setStatus(Snapshot.Status.BackedUp);
_snapshotDao.update(snapshotId, snapshot);
if (snapshot.getType() == Type.RECURRING) {
_accountMgr.incrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
}
} else {
s_logger.warn("Failed to back up snapshot on secondary storage, deleting the record from the DB");
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
_usageEventDao.persist(usageEvent);
_snapshotDao.remove(snapshotId);
}
txn.commit();
return backedUp;
} finally {
if (snapshot != null) {
_snapshotDao.releaseFromLockTable(snapshotId);
}
}
}
private Long getSnapshotUserId() {
Long userId = UserContext.current().getCallerUserId();
if (userId == null) {
return User.UID_SYSTEM;
}
return userId;
}
@Override
@DB
public void postCreateSnapshot(Long volumeId, Long snapshotId, Long policyId, boolean backedUp) {
Long userId = getSnapshotUserId();
SnapshotVO snapshot = _snapshotDao.findByIdIncludingRemoved(snapshotId);
// Even if the current snapshot failed, we should schedule the next
// recurring snapshot for this policy.
if (snapshot.isRecursive()) {
postCreateRecurringSnapshotForPolicy(userId, volumeId, snapshotId, policyId);
}
}
private void postCreateRecurringSnapshotForPolicy(long userId, long volumeId, long snapshotId, long policyId) {
// Use count query
SnapshotVO spstVO = _snapshotDao.findById(snapshotId);
Type type = spstVO.getType();
int maxSnaps = type.getMax();
List<SnapshotVO> snaps = listSnapsforVolumeType(volumeId, type);
SnapshotPolicyVO policy = _snapshotPolicyDao.findById(policyId);
if (policy != null && policy.getMaxSnaps() < maxSnaps) {
maxSnaps = policy.getMaxSnaps();
}
while (snaps.size() > maxSnaps && snaps.size() > 1) {
SnapshotVO oldestSnapshot = snaps.get(0);
long oldSnapId = oldestSnapshot.getId();
s_logger.debug("Max snaps: " + policy.getMaxSnaps() + " exceeded for snapshot policy with Id: " + policyId + ". Deleting oldest snapshot: " + oldSnapId);
deleteSnapshotInternal(oldSnapId);
snaps.remove(oldestSnapshot);
}
}
private Long checkAccountPermissions(long targetAccountId, long targetDomainId, String targetDesc, long targetId) {
Long accountId = null;
Account account = UserContext.current().getCaller();
if (account != null) {
if (!isAdmin(account.getType())) {
if (account.getId() != targetAccountId) {
throw new InvalidParameterValueException("Unable to find a " + targetDesc + " with id " + targetId + " for this account");
}
} else if (!_domainDao.isChildDomain(account.getDomainId(), targetDomainId)) {
throw new PermissionDeniedException("Unable to perform operation for " + targetDesc + " with id " + targetId + ", permission denied.");
}
accountId = account.getId();
}
return accountId;
}
private static boolean isAdmin(short accountType) {
return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
}
@Override
@DB
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_DELETE, eventDescription = "deleting snapshot", async = true)
public boolean deleteSnapshot(DeleteSnapshotCmd cmd) {
Long snapshotId = cmd.getId();
// Verify parameters
Snapshot snapshotCheck = _snapshotDao.findByIdIncludingRemoved(snapshotId.longValue());
if (snapshotCheck == null) {
throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId);
}
// If an account was passed in, make sure that it matches the account of the snapshot
Account snapshotOwner = _accountDao.findById(snapshotCheck.getAccountId());
if (snapshotOwner == null) {
throw new InvalidParameterValueException("Snapshot id " + snapshotId + " does not have a valid account");
}
checkAccountPermissions(snapshotOwner.getId(), snapshotOwner.getDomainId(), "snapshot", snapshotId);
boolean status = deleteSnapshotInternal(snapshotId);
if (!status) {
s_logger.warn("Failed to delete snapshot");
throw new CloudRuntimeException("Failed to delete snapshot:" + snapshotId);
}
return status;
}
@DB
private boolean deleteSnapshotInternal(Long snapshotId) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Calling deleteSnapshot for snapshotId: " + snapshotId);
}
SnapshotVO lastSnapshot = null;
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
if (snapshot.getBackupSnapshotId() != null) {
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(snapshot.getVolumeId(), snapshot.getBackupSnapshotId());
if (snaps != null && snaps.size() > 1) {
snapshot.setBackupSnapshotId(null);
_snapshotDao.update(snapshot.getId(), snapshot);
}
}
Transaction txn = Transaction.currentTxn();
txn.start();
_snapshotDao.remove(snapshotId);
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
_usageEventDao.persist(usageEvent);
_accountMgr.decrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
txn.commit();
long lastId = snapshotId;
boolean destroy = false;
while (true) {
lastSnapshot = _snapshotDao.findNextSnapshot(lastId);
if (lastSnapshot == null) {
// if all snapshots after this snapshot in this chain are removed, remove those snapshots.
destroy = true;
break;
}
if (lastSnapshot.getRemoved() == null) {
// if there is one child not removed, then can not remove back up snapshot.
break;
}
lastId = lastSnapshot.getId();
}
if (destroy) {
lastSnapshot = _snapshotDao.findByIdIncludingRemoved(lastId);
while (lastSnapshot.getRemoved() != null) {
String BackupSnapshotId = lastSnapshot.getBackupSnapshotId();
if (BackupSnapshotId != null) {
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(lastSnapshot.getVolumeId(), BackupSnapshotId);
if (snaps != null && !snaps.isEmpty()) {
lastSnapshot.setBackupSnapshotId(null);
_snapshotDao.update(lastSnapshot.getId(), lastSnapshot);
} else {
if (destroySnapshotBackUp(lastId)) {
} else {
s_logger.debug("Destroying snapshot backup failed " + lastSnapshot);
break;
}
}
}
lastId = lastSnapshot.getPrevSnapshotId();
if (lastId == 0) {
break;
}
lastSnapshot = _snapshotDao.findByIdIncludingRemoved(lastId);
}
}
return true;
}
@Override
@DB
public boolean destroySnapshot(long userId, long snapshotId, long policyId) {
return true;
}
@Override
@DB
public boolean destroySnapshotBackUp(long snapshotId) {
boolean success = false;
String details;
SnapshotVO snapshot = _snapshotDao.findByIdIncludingRemoved(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Destroying snapshot " + snapshotId + " backup failed due to unable to find snapshot ");
}
String secondaryStoragePoolUrl = _storageMgr.getSecondaryStorageURL(snapshot.getDataCenterId());
Long dcId = snapshot.getDataCenterId();
Long accountId = snapshot.getAccountId();
Long volumeId = snapshot.getVolumeId();
HypervisorType hvType = snapshot.getHypervisorType();
String backupOfSnapshot = snapshot.getBackupSnapshotId();
if (backupOfSnapshot == null) {
return true;
}
DeleteSnapshotBackupCommand cmd = new DeleteSnapshotBackupCommand(null, secondaryStoragePoolUrl, dcId, accountId, volumeId, backupOfSnapshot, snapshot.getName());
snapshot.setBackupSnapshotId(null);
_snapshotDao.update(snapshotId, snapshot);
Answer answer = _agentMgr.sendTo(dcId, hvType, cmd);
if ((answer != null) && answer.getResult()) {
// This is not the last snapshot.
success = true;
details = "Successfully deleted snapshot " + snapshotId + " for volumeId: " + volumeId;
s_logger.debug(details);
} else if (answer != null) {
details = "Failed to destroy snapshot id:" + snapshotId + " for volume: " + volumeId + " due to ";
if (answer.getDetails() != null) {
details += answer.getDetails();
}
s_logger.error(details);
}
return success;
}
@Override
public List<SnapshotVO> listSnapshots(ListSnapshotsCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
Long volumeId = cmd.getVolumeId();
Boolean isRecursive = cmd.isRecursive();
// Verify parameters
if (volumeId != null) {
VolumeVO volume = _volsDao.findById(volumeId);
if (volume != null) {
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
}
}
Account account = UserContext.current().getCaller();
Long domainId = cmd.getDomainId();
String accountName = cmd.getAccountName();
Long accountId = null;
if ((account == null) || isAdmin(account.getType())) {
if (domainId != null) {
if ((account != null) && !_domainDao.isChildDomain(account.getDomainId(), domainId)) {
throw new PermissionDeniedException("Unable to list templates for domain " + domainId + ", permission denied.");
}
} else if ((account != null) && (account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN)) {
domainId = account.getDomainId();
}
if (domainId != null && accountName != null) {
Account userAccount = _accountDao.findActiveAccount(accountName, domainId);
if (userAccount != null) {
accountId = userAccount.getId();
} else {
throw new InvalidParameterValueException("Could not find account:" + accountName + " in domain:" + domainId);
}
}
} else {
accountId = account.getId();
}
if (isRecursive == null) {
isRecursive = false;
}
Object name = cmd.getSnapshotName();
Object id = cmd.getId();
Object keyword = cmd.getKeyword();
Object snapshotTypeStr = cmd.getSnapshotType();
Object intervalTypeStr = cmd.getIntervalType();
Filter searchFilter = new Filter(SnapshotVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal());
SearchBuilder<SnapshotVO> sb = _snapshotDao.createSearchBuilder();
sb.and("status", sb.entity().getStatus(), SearchCriteria.Op.EQ);
sb.and("volumeId", sb.entity().getVolumeId(), SearchCriteria.Op.EQ);
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.EQ);
sb.and("snapshotTypeEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.IN);
sb.and("snapshotTypeNEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.NEQ);
if ((accountId == null) && (domainId != null)) {
// if accountId isn't specified, we can do a domain match for the admin case
SearchBuilder<AccountVO> accountSearch = _accountDao.createSearchBuilder();
sb.join("accountSearch", accountSearch, sb.entity().getAccountId(), accountSearch.entity().getId(), JoinType.INNER);
SearchBuilder<DomainVO> domainSearch = _domainDao.createSearchBuilder();
if (isRecursive) {
domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE);
} else {
domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.EQ);
}
accountSearch.join("domainSearch", domainSearch, accountSearch.entity().getDomainId(), domainSearch.entity().getId(), JoinType.INNER);
}
SearchCriteria<SnapshotVO> sc = sb.create();
sc.setParameters("status", Snapshot.Status.BackedUp);
if (volumeId != null) {
sc.setParameters("volumeId", volumeId);
}
if (name != null) {
sc.setParameters("name", "%" + name + "%");
}
if (id != null) {
sc.setParameters("id", id);
}
if (keyword != null) {
SearchCriteria<SnapshotVO> ssc = _snapshotDao.createSearchCriteria();
ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
sc.addAnd("name", SearchCriteria.Op.SC, ssc);
}
if (accountId != null) {
sc.setParameters("accountId", accountId);
} else if (domainId != null) {
DomainVO domain = _domainDao.findById(domainId);
SearchCriteria<?> joinSearch = sc.getJoin("accountSearch");
if (isRecursive) {
joinSearch.setJoinParameters("domainSearch", "path", domain.getPath() + "%");
} else {
joinSearch.setJoinParameters("domainSearch", "path", domain.getPath());
}
}
if (snapshotTypeStr != null) {
Type snapshotType = SnapshotVO.getSnapshotType((String) snapshotTypeStr);
if (snapshotType == null) {
throw new InvalidParameterValueException("Unsupported snapshot type " + snapshotTypeStr);
}
if (snapshotType == Type.RECURRING) {
sc.setParameters("snapshotTypeEQ", Type.HOURLY.ordinal(), Type.DAILY.ordinal(), Type.WEEKLY.ordinal(), Type.MONTHLY.ordinal());
} else {
sc.setParameters("snapshotTypeEQ", snapshotType.ordinal());
}
} else if (intervalTypeStr != null && volumeId != null) {
Type type = SnapshotVO.getSnapshotType((String) intervalTypeStr);
if (type == null) {
throw new InvalidParameterValueException("Unsupported snapstho interval type " + intervalTypeStr);
}
sc.setParameters("snapshotTypeEQ", type.ordinal());
} else {
// Show only MANUAL and RECURRING snapshot types
sc.setParameters("snapshotTypeNEQ", Snapshot.Type.TEMPLATE.ordinal());
}
return _snapshotDao.search(sc, searchFilter);
}
@Override
public boolean deleteSnapshotDirsForAccount(long accountId) {
List<VolumeVO> volumes = _volsDao.findByAccount(accountId);
// The above call will list only non-destroyed volumes.
// So call this method before marking the volumes as destroyed.
// i.e Call them before the VMs for those volumes are destroyed.
boolean success = true;
for (VolumeVO volume : volumes) {
if (volume.getPoolId() == null) {
continue;
}
Long volumeId = volume.getId();
Long dcId = volume.getDataCenterId();
String secondaryStoragePoolURL = _storageMgr.getSecondaryStorageURL(dcId);
String primaryStoragePoolNameLabel = _storageMgr.getPrimaryStorageNameLabel(volume);
if (_snapshotDao.listByVolumeIdIncludingRemoved(volumeId).isEmpty()) {
// This volume doesn't have any snapshots. Nothing do delete.
continue;
}
DeleteSnapshotsDirCommand cmd = new DeleteSnapshotsDirCommand(primaryStoragePoolNameLabel, secondaryStoragePoolURL, dcId, accountId, volumeId, volume.getPath());
Answer answer = null;
Long poolId = volume.getPoolId();
if (poolId != null) {
// Retry only once for this command. There's low chance of failure because of a connection problem.
try {
answer = _storageMgr.sendToPool(poolId, cmd);
} catch (StorageUnavailableException e) {
}
} else {
s_logger.info("Pool id for volume id: " + volumeId + " belonging to account id: " + accountId + " is null. Assuming the snapshotsDir for the account has already been deleted");
}
if (success) {
// SnapshotsDir has been deleted for the volumes so far.
success = (answer != null) && answer.getResult();
if (success) {
s_logger.debug("Deleted snapshotsDir for volume: " + volumeId + " under account: " + accountId);
} else if (answer != null) {
s_logger.error(answer.getDetails());
}
}
// Either way delete the snapshots for this volume.
List<SnapshotVO> snapshots = listSnapsforVolume(volumeId);
for (SnapshotVO snapshot : snapshots) {
if (_snapshotDao.expunge(snapshot.getId())) {
if (snapshot.getType() == Type.MANUAL) {
_accountMgr.decrementResourceCount(accountId, ResourceType.snapshot);
}
// Log event after successful deletion
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), volume.getDataCenterId(), snapshot.getId(), snapshot.getName(), null, null, volume.getSize());
_usageEventDao.persist(usageEvent);
}
}
}
// Returns true if snapshotsDir has been deleted for all volumes.
return success;
}
@Override
@DB
public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd) throws InvalidParameterValueException {
Long volumeId = cmd.getVolumeId();
VolumeVO volume = _volsDao.findById(cmd.getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Failed to create snapshot policy, unable to find a volume with id " + volumeId);
}
AccountVO owner = _accountDao.findById(volume.getAccountId());
DomainVO domain = _domainDao.findById(owner.getDomainId());
// If an account was passed in, make sure that it matches the account of the volume
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
Long instanceId = volume.getInstanceId();
if (instanceId != null) {
// It is not detached, but attached to a VM
if (_vmDao.findById(instanceId) == null) {
// It is not a UserVM but a SystemVM or DomR
throw new InvalidParameterValueException("Failed to create snapshot policy, snapshots of volumes attached to System or router VM are not allowed");
}
}
IntervalType intvType = DateUtil.IntervalType.getIntervalType(cmd.getIntervalType());
if (intvType == null) {
throw new InvalidParameterValueException("Unsupported interval type " + cmd.getIntervalType());
}
Type type = getSnapshotType(intvType);
TimeZone timeZone = TimeZone.getTimeZone(cmd.getTimezone());
String timezoneId = timeZone.getID();
if (!timezoneId.equals(cmd.getTimezone())) {
s_logger.warn("Using timezone: " + timezoneId + " for running this snapshot policy as an equivalent of " + cmd.getTimezone());
}
try {
DateUtil.getNextRunTime(intvType, cmd.getSchedule(), timezoneId, null);
} catch (Exception e) {
throw new InvalidParameterValueException("Invalid schedule: " + cmd.getSchedule() + " for interval type: " + cmd.getIntervalType());
}
if (cmd.getMaxSnaps() <= 0) {
throw new InvalidParameterValueException("maxSnaps should be greater than 0");
}
int intervalMaxSnaps = type.getMax();
if (cmd.getMaxSnaps() > intervalMaxSnaps) {
throw new InvalidParameterValueException("maxSnaps exceeds limit: " + intervalMaxSnaps + " for interval type: " + cmd.getIntervalType());
}
// Verify that max doesn't exceed domain and account snapshot limits
long accountLimit = _accountMgr.findCorrectResourceLimit(owner, ResourceType.snapshot);
long domainLimit = _accountMgr.findCorrectResourceLimit(domain, ResourceType.snapshot);
int max = cmd.getMaxSnaps().intValue();
if (owner.getType() != Account.ACCOUNT_TYPE_ADMIN && ((accountLimit != -1 && max > accountLimit) || (domainLimit != -1 && max > domainLimit))) {
throw new InvalidParameterValueException("Max number of snapshots shouldn't exceed the domain/account level snapshot limit");
}
SnapshotPolicyVO policy = _snapshotPolicyDao.findOneByVolumeInterval(volumeId, intvType);
if (policy == null) {
policy = new SnapshotPolicyVO(volumeId, cmd.getSchedule(), timezoneId, intvType, cmd.getMaxSnaps());
policy = _snapshotPolicyDao.persist(policy);
_snapSchedMgr.scheduleNextSnapshotJob(policy);
} else {
try {
policy = _snapshotPolicyDao.acquireInLockTable(policy.getId());
policy.setSchedule(cmd.getSchedule());
policy.setTimezone(timezoneId);
policy.setInterval((short) type.ordinal());
policy.setMaxSnaps(cmd.getMaxSnaps());
policy.setActive(true);
_snapshotPolicyDao.update(policy.getId(), policy);
} finally {
if (policy != null) {
_snapshotPolicyDao.releaseFromLockTable(policy.getId());
}
}
}
return policy;
}
@Override
public boolean deletePolicy(long userId, Long policyId) {
SnapshotPolicyVO snapshotPolicy = _snapshotPolicyDao.findById(policyId);
_snapSchedMgr.removeSchedule(snapshotPolicy.getVolumeId(), snapshotPolicy.getId());
return _snapshotPolicyDao.remove(policyId);
}
@Override
public List<SnapshotPolicyVO> listPoliciesforVolume(ListSnapshotPoliciesCmd cmd) throws InvalidParameterValueException {
Long volumeId = cmd.getVolumeId();
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new InvalidParameterValueException("Unable to find a volume with id " + volumeId);
}
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
return listPoliciesforVolume(cmd.getVolumeId());
}
@Override
public List<SnapshotPolicyVO> listPoliciesforVolume(long volumeId) {
return _snapshotPolicyDao.listByVolumeId(volumeId);
}
@Override
public List<SnapshotPolicyVO> listPoliciesforSnapshot(long snapshotId) {
SearchCriteria<SnapshotPolicyVO> sc = PoliciesForSnapSearch.create();
sc.setJoinParameters("policyRef", "snapshotId", snapshotId);
return _snapshotPolicyDao.search(sc, null);
}
@Override
public List<SnapshotVO> listSnapsforPolicy(long policyId, Filter filter) {
SearchCriteria<SnapshotVO> sc = PolicySnapshotSearch.create();
sc.setJoinParameters("policy", "policyId", policyId);
return _snapshotDao.search(sc, filter);
}
@Override
public List<SnapshotVO> listSnapsforVolume(long volumeId) {
return _snapshotDao.listByVolumeId(volumeId);
}
public List<SnapshotVO> listSnapsforVolumeType(long volumeId, Type type) {
return _snapshotDao.listByVolumeIdType(volumeId, type);
}
@Override
public void deletePoliciesForVolume(Long volumeId) {
List<SnapshotPolicyVO> policyInstances = listPoliciesforVolume(volumeId);
for (SnapshotPolicyVO policyInstance : policyInstances) {
Long policyId = policyInstance.getId();
deletePolicy(1L, policyId);
}
// We also want to delete the manual snapshots scheduled for this volume
// We can only delete the schedules in the future, not the ones which are already executing.
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, Snapshot.MANUAL_POLICY_ID, false);
if (snapshotSchedule != null) {
_snapshotScheduleDao.expunge(snapshotSchedule.getId());
}
}
/**
* {@inheritDoc}
*/
@Override
public List<SnapshotScheduleVO> findRecurringSnapshotSchedule(ListRecurringSnapshotScheduleCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getSnapshotPolicyId();
Account account = UserContext.current().getCaller();
// Verify parameters
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new InvalidParameterValueException("Failed to list snapshot schedule, unable to find a volume with id " + volumeId);
}
if (account != null) {
long volAcctId = volume.getAccountId();
if (isAdmin(account.getType())) {
Account userAccount = _accountDao.findById(Long.valueOf(volAcctId));
if (!_domainDao.isChildDomain(account.getDomainId(), userAccount.getDomainId())) {
throw new PermissionDeniedException("Unable to list snapshot schedule for volume " + volumeId + ", permission denied.");
}
} else if (account.getId() != volAcctId) {
throw new PermissionDeniedException("Unable to list snapshot schedule, account " + account.getAccountName() + " does not own volume id " + volAcctId);
}
}
// List only future schedules, not past ones.
List<SnapshotScheduleVO> snapshotSchedules = new ArrayList<SnapshotScheduleVO>();
if (policyId == null) {
List<SnapshotPolicyVO> policyInstances = listPoliciesforVolume(volumeId);
for (SnapshotPolicyVO policyInstance : policyInstances) {
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, policyInstance.getId(), false);
snapshotSchedules.add(snapshotSchedule);
}
} else {
snapshotSchedules.add(_snapshotScheduleDao.getCurrentSchedule(volumeId, policyId, false));
}
return snapshotSchedules;
}
@Override
public SnapshotPolicyVO getPolicyForVolume(long volumeId) {
return _snapshotPolicyDao.findOneByVolume(volumeId);
}
public Type getSnapshotType(Long policyId) {
if (policyId.equals(Snapshot.MANUAL_POLICY_ID)) {
return Type.MANUAL;
} else {
SnapshotPolicyVO spstPolicyVO = _snapshotPolicyDao.findById(policyId);
IntervalType intvType = DateUtil.getIntervalType(spstPolicyVO.getInterval());
return getSnapshotType(intvType);
}
}
public Type getSnapshotType(IntervalType intvType) {
if (intvType.equals(IntervalType.HOURLY)) {
return Type.HOURLY;
} else if (intvType.equals(IntervalType.DAILY)) {
return Type.DAILY;
} else if (intvType.equals(IntervalType.WEEKLY)) {
return Type.WEEKLY;
} else if (intvType.equals(IntervalType.MONTHLY)) {
return Type.MONTHLY;
}
return null;
}
@Override
public SnapshotVO allocSnapshot(CreateSnapshotCmd cmd) throws ResourceAllocationException {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getPolicyId();
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " doesn't exist");
}
if (volume.getStatus() != AsyncInstanceCreateStatus.Created) {
throw new InvalidParameterValueException("VolumeId: " + volumeId + " is not in Created state but " + volume.getStatus() + ". Cannot take snapshot.");
}
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
if (storagePoolVO == null) {
throw new InvalidParameterValueException("VolumeId: " + volumeId + " please attach this volume to a VM before create snapshot for it");
}
Account owner = _accountMgr.getAccount(volume.getAccountId());
if (_accountMgr.resourceLimitExceeded(owner, ResourceType.snapshot)) {
ResourceAllocationException rae = new ResourceAllocationException("Maximum number of snapshots for account: " + owner.getAccountName() + " has been exceeded.");
rae.setResourceType("snapshot");
throw rae;
}
// Determine the name for this snapshot
// Snapshot Name: VMInstancename + volumeName + timeString
String timeString = DateUtil.getDateDisplayString(DateUtil.GMT_TIMEZONE, new Date(), DateUtil.YYYYMMDD_FORMAT);
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
String vmDisplayName = "detached";
if (vmInstance != null) {
vmDisplayName = vmInstance.getName();
}
String snapshotName = vmDisplayName + "_" + volume.getName() + "_" + timeString;
// Create the Snapshot object and save it so we can return it to the
// user
Type snapshotType = getSnapshotType(policyId);
HypervisorType hypervisorType = this._volsDao.getHypervisorType(volumeId);
SnapshotVO snapshotVO = new SnapshotVO(volume.getDataCenterId(), volume.getAccountId(), volume.getDomainId(), volume.getId(), volume.getDiskOfferingId(), null, snapshotName, (short) snapshotType.ordinal(), snapshotType.name(), volume.getSize(),
hypervisorType);
SnapshotVO snapshot = _snapshotDao.persist(snapshotVO);
if (snapshot != null) {
_accountMgr.incrementResourceCount(volume.getAccountId(), ResourceType.snapshot);
}
return snapshot;
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
ComponentLocator locator = ComponentLocator.getCurrentLocator();
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
if (configDao == null) {
throw new ConfigurationException("Unable to get the configuration dao.");
}
Type.HOURLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.hourly"), HOURLYMAX));
Type.DAILY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.daily"), DAILYMAX));
Type.WEEKLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.weekly"), WEEKLYMAX));
Type.MONTHLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.monthly"), MONTHLYMAX));
_deltaSnapshotMax = NumbersUtil.parseInt(configDao.getValue("snapshot.delta.max"), DELTAMAX);
_totalRetries = NumbersUtil.parseInt(configDao.getValue("total.retries"), 4);
_pauseInterval = 2 * NumbersUtil.parseInt(configDao.getValue("ping.interval"), 60);
s_logger.info("Snapshot Manager is configured.");
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;
}
@Override
public boolean stop() {
return true;
}
@Override
public boolean deleteSnapshotPolicies(DeleteSnapshotPoliciesCmd cmd) {
Long policyId = cmd.getId();
List<Long> policyIds = cmd.getIds();
Long userId = getSnapshotUserId();
if ((policyId == null) && (policyIds == null)) {
throw new InvalidParameterValueException("No policy id (or list of ids) specified.");
}
if (policyIds == null) {
policyIds = new ArrayList<Long>();
policyIds.add(policyId);
} else if (policyIds.size() <= 0) {
// Not even sure how this is even possible
throw new InvalidParameterValueException("There are no policy ids");
}
for (Long policy : policyIds) {
SnapshotPolicyVO snapshotPolicyVO = _snapshotPolicyDao.findById(policy);
if (snapshotPolicyVO == null) {
throw new InvalidParameterValueException("Policy id given: " + policy + " does not exist");
}
VolumeVO volume = _volsDao.findById(snapshotPolicyVO.getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Policy id given: " + policy + " does not belong to a valid volume");
}
// If an account was passed in, make sure that it matches the account of the volume
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volume.getId());
}
boolean success = true;
if (policyIds.contains(Snapshot.MANUAL_POLICY_ID)) {
throw new InvalidParameterValueException("Invalid Policy id given: " + Snapshot.MANUAL_POLICY_ID);
}
for (Long pId : policyIds) {
if (!deletePolicy(userId, pId)) {
success = false;
s_logger.warn("Failed to delete snapshot policy with Id: " + policyId);
return success;
}
}
return success;
}
private boolean hostSupportSnapsthot(HostVO host) {
if (host.getHypervisorType() != HypervisorType.KVM) {
return true;
}
// Determine host capabilities
String caps = host.getCapabilities();
if (caps != null) {
String[] tokens = caps.split(",");
for (String token : tokens) {
if (token.contains("snapshot")) {
return true;
}
}
}
return false;
}
}
| server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | /**
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.storage.snapshot;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.BackupSnapshotAnswer;
import com.cloud.agent.api.BackupSnapshotCommand;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.DeleteSnapshotBackupCommand;
import com.cloud.agent.api.DeleteSnapshotsDirCommand;
import com.cloud.agent.api.ManageSnapshotAnswer;
import com.cloud.agent.api.ManageSnapshotCommand;
import com.cloud.api.commands.CreateSnapshotCmd;
import com.cloud.api.commands.CreateSnapshotPolicyCmd;
import com.cloud.api.commands.DeleteSnapshotCmd;
import com.cloud.api.commands.DeleteSnapshotPoliciesCmd;
import com.cloud.api.commands.ListRecurringSnapshotScheduleCmd;
import com.cloud.api.commands.ListSnapshotPoliciesCmd;
import com.cloud.api.commands.ListSnapshotsCmd;
import com.cloud.async.AsyncInstanceCreateStatus;
import com.cloud.async.AsyncJobManager;
import com.cloud.configuration.ResourceCount.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.dc.dao.DataCenterDao;
import com.cloud.domain.DomainVO;
import com.cloud.domain.dao.DomainDao;
import com.cloud.event.ActionEvent;
import com.cloud.event.EventTypes;
import com.cloud.event.UsageEventVO;
import com.cloud.event.dao.EventDao;
import com.cloud.event.dao.UsageEventDao;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.StorageUnavailableException;
import com.cloud.host.HostVO;
import com.cloud.host.dao.DetailsDao;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Snapshot;
import com.cloud.storage.Snapshot.Status;
import com.cloud.storage.Snapshot.Type;
import com.cloud.storage.SnapshotPolicyVO;
import com.cloud.storage.SnapshotScheduleVO;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.storage.dao.SnapshotDao;
import com.cloud.storage.dao.SnapshotPolicyDao;
import com.cloud.storage.dao.SnapshotScheduleDao;
import com.cloud.storage.dao.StoragePoolDao;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.AccountVO;
import com.cloud.user.User;
import com.cloud.user.UserContext;
import com.cloud.user.dao.AccountDao;
import com.cloud.user.dao.UserDao;
import com.cloud.utils.DateUtil;
import com.cloud.utils.DateUtil.IntervalType;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.component.Inject;
import com.cloud.utils.component.Manager;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.JoinBuilder.JoinType;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.dao.UserVmDao;
@Local(value = { SnapshotManager.class, SnapshotService.class })
public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Manager {
private static final Logger s_logger = Logger.getLogger(SnapshotManagerImpl.class);
@Inject
protected HostDao _hostDao;
@Inject
protected UserVmDao _vmDao;
@Inject
protected VolumeDao _volsDao;
@Inject
protected AccountDao _accountDao;
@Inject
protected DataCenterDao _dcDao;
@Inject
protected DiskOfferingDao _diskOfferingDao;
@Inject
protected UserDao _userDao;
@Inject
protected SnapshotDao _snapshotDao;
@Inject
protected StoragePoolDao _storagePoolDao;
@Inject
protected EventDao _eventDao;
@Inject
protected SnapshotPolicyDao _snapshotPolicyDao = null;
@Inject
protected SnapshotScheduleDao _snapshotScheduleDao;
@Inject
protected DetailsDao _detailsDao;
@Inject
protected DomainDao _domainDao;
@Inject
protected StorageManager _storageMgr;
@Inject
protected AgentManager _agentMgr;
@Inject
protected SnapshotScheduler _snapSchedMgr;
@Inject
protected AsyncJobManager _asyncMgr;
@Inject
protected AccountManager _accountMgr;
@Inject
protected ClusterDao _clusterDao;
@Inject
private UsageEventDao _usageEventDao;
String _name;
private int _totalRetries;
private int _pauseInterval;
private int _deltaSnapshotMax;
protected SearchBuilder<SnapshotVO> PolicySnapshotSearch;
protected SearchBuilder<SnapshotPolicyVO> PoliciesForSnapSearch;
private boolean isVolumeDirty(long volumeId, Long policy) {
VolumeVO volume = _volsDao.findById(volumeId);
boolean runSnap = true;
if (volume.getInstanceId() == null) {
long lastSnapId = _snapshotDao.getLastSnapshot(volumeId, 0);
SnapshotVO lastSnap = _snapshotDao.findByIdIncludingRemoved(lastSnapId);
if (lastSnap != null) {
Date lastSnapTime = lastSnap.getCreated();
if (lastSnapTime.after(volume.getUpdated())) {
runSnap = false;
s_logger.debug("Volume: " + volumeId + " is detached and last snap time is after Volume detach time. Skip snapshot for recurring policy");
}
}
} else if (_storageMgr.volumeInactive(volume)) {
// Volume is attached to a VM which is in Stopped state.
long lastSnapId = _snapshotDao.getLastSnapshot(volumeId, 0);
SnapshotVO lastSnap = _snapshotDao.findByIdIncludingRemoved(lastSnapId);
if (lastSnap != null) {
Date lastSnapTime = lastSnap.getCreated();
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
if (vmInstance != null) {
if (lastSnapTime.after(vmInstance.getUpdateTime())) {
runSnap = false;
s_logger.debug("Volume: " + volumeId + " is inactive and last snap time is after VM update time. Skip snapshot for recurring policy");
}
}
}
}
if (volume.getState() == Volume.State.Destroy || volume.getRemoved() != null) {
s_logger.debug("Volume: " + volumeId + " is destroyed/removed. Not taking snapshot");
runSnap = false;
}
return runSnap;
}
protected Answer sendToPool(Volume vol, Command cmd) {
StoragePool pool = _storagePoolDao.findById(vol.getPoolId());
VMInstanceVO vm = _vmDao.findById(vol.getInstanceId());
long[] hostIdsToTryFirst = null;
if (vm != null && vm.getHostId() != null) {
hostIdsToTryFirst = new long[] { vm.getHostId() };
}
List<Long> hostIdsToAvoid = new ArrayList<Long>();
for (int retry = _totalRetries; retry >= 0; retry--) {
try {
Pair<Long, Answer> result = _storageMgr.sendToPool(pool, hostIdsToTryFirst, hostIdsToAvoid, cmd);
if (result.second().getResult()) {
return result.second();
}
} catch (StorageUnavailableException e1) {
s_logger.warn("Storage unavailable ", e1);
return null;
}
try {
Thread.sleep(_pauseInterval * 1000);
} catch (InterruptedException e) {
}
}
return null;
}
@Override
public SnapshotVO createSnapshotOnPrimary(VolumeVO volume, Long policyId, Long snapshotId) {
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Can not find snapshot " + snapshotId);
}
// Send a ManageSnapshotCommand to the agent
String vmName = _storageMgr.getVmNameOnVolume(volume);
long volumeId = volume.getId();
long preId = _snapshotDao.getLastSnapshot(volumeId, snapshotId);
String preSnapshotPath = null;
SnapshotVO preSnapshotVO = null;
if (preId != 0) {
preSnapshotVO = _snapshotDao.findByIdIncludingRemoved(preId);
if (preSnapshotVO != null && preSnapshotVO.getBackupSnapshotId() != null) {
preSnapshotPath = preSnapshotVO.getPath();
}
}
ManageSnapshotCommand cmd = new ManageSnapshotCommand(snapshotId, volume.getPath(), preSnapshotPath, snapshot.getName(), vmName);
ManageSnapshotAnswer answer = (ManageSnapshotAnswer) sendToPool(volume, cmd);
// Update the snapshot in the database
if ((answer != null) && answer.getResult()) {
// The snapshot was successfully created
if (preSnapshotPath != null && preSnapshotPath == answer.getSnapshotPath()) {
// empty snapshot
s_logger.debug("CreateSnapshot: this is empty snapshot ");
snapshot.setPath(preSnapshotPath);
snapshot.setBackupSnapshotId(preSnapshotVO.getBackupSnapshotId());
snapshot.setStatus(Snapshot.Status.BackedUp);
snapshot.setPrevSnapshotId(preId);
_snapshotDao.update(snapshotId, snapshot);
} else {
long preSnapshotId = 0;
if (preSnapshotVO != null && preSnapshotVO.getBackupSnapshotId() != null) {
preSnapshotId = preId;
// default delta snap number is 16
int deltaSnap = _deltaSnapshotMax;
int i;
for (i = 1; i < deltaSnap; i++) {
String prevBackupUuid = preSnapshotVO.getBackupSnapshotId();
// previous snapshot doesn't have backup, create a full snapshot
if (prevBackupUuid == null) {
preSnapshotId = 0;
break;
}
long preSSId = preSnapshotVO.getPrevSnapshotId();
if (preSSId == 0) {
break;
}
preSnapshotVO = _snapshotDao.findByIdIncludingRemoved(preSSId);
}
if (i >= deltaSnap) {
preSnapshotId = 0;
}
}
snapshot = updateDBOnCreate(snapshotId, answer.getSnapshotPath(), preSnapshotId);
}
// Get the snapshot_schedule table entry for this snapshot and
// policy id.
// Set the snapshotId to retrieve it back later.
if (policyId != Snapshot.MANUAL_POLICY_ID) {
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, policyId, true);
assert snapshotSchedule != null;
snapshotSchedule.setSnapshotId(snapshotId);
_snapshotScheduleDao.update(snapshotSchedule.getId(), snapshotSchedule);
}
} else {
if (answer != null) {
s_logger.error(answer.getDetails());
}
// delete from the snapshots table
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("Creating snapshot for volume " + volumeId + " on primary storage failed.");
}
return snapshot;
}
public SnapshotVO createSnapshotImpl(long volumeId, long policyId) throws ResourceAllocationException {
return null;
}
@Override
@DB
public SnapshotVO createSnapshotImpl(Long volumeId, Long policyId, Long snapshotId) {
VolumeVO v = _volsDao.findById(volumeId);
Account owner = _accountMgr.getAccount(v.getAccountId());
SnapshotVO snapshot = null;
boolean backedUp = false;
try {
if (v != null && _volsDao.getHypervisorType(v.getId()).equals(HypervisorType.KVM)) {
/* KVM needs to lock on the vm of volume, because it takes snapshot on behalf of vm, not volume */
UserVmVO uservm = _vmDao.findById(v.getInstanceId());
if (uservm != null) {
UserVmVO vm = _vmDao.acquireInLockTable(uservm.getId(), 10);
if (vm == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is being used, try it later ");
}
}
}
Long poolId = v.getPoolId();
if (poolId == null) {
throw new CloudRuntimeException("You cannot take a snapshot of a volume until it has been attached to an instance");
}
if (_volsDao.getHypervisorType(v.getId()).equals(HypervisorType.KVM)) {
StoragePoolVO storagePool = _storagePoolDao.findById(v.getPoolId());
ClusterVO cluster = _clusterDao.findById(storagePool.getClusterId());
List<HostVO> hosts = _hostDao.listByCluster(cluster.getId());
if (hosts != null && !hosts.isEmpty()) {
HostVO host = hosts.get(0);
if (!hostSupportSnapsthot(host)) {
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("KVM Snapshot is not supported on cluster: " + host.getId());
}
}
}
// if volume is attached to a vm in destroyed or expunging state; disallow
if (v.getInstanceId() != null) {
UserVmVO userVm = _vmDao.findById(v.getInstanceId());
if (userVm != null) {
if (userVm.getState().equals(State.Destroyed) || userVm.getState().equals(State.Expunging)) {
_snapshotDao.expunge(snapshotId);
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is associated with vm:" + userVm.getInstanceName() + " is in " + userVm.getState().toString() + " state");
}
}
}
VolumeVO volume = _volsDao.acquireInLockTable(volumeId, 10);
if (volume == null) {
_snapshotDao.expunge(snapshotId);
volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " doesn't exist");
} else {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " is being used, try it later ");
}
}
snapshot = createSnapshotOnPrimary(volume, policyId, snapshotId);
if (snapshot != null) {
if (snapshot.getStatus() == Snapshot.Status.CreatedOnPrimary) {
backedUp = backupSnapshotToSecondaryStorage(snapshot);
} else if (snapshot.getStatus() == Snapshot.Status.BackedUp) {
//For empty snapshot we set status to BackedUp in createSnapshotOnPrimary
backedUp = true;
}
if (!backedUp) {
throw new CloudRuntimeException("Created snapshot: " + snapshot + " on primary but failed to backup on secondary");
}
}
} finally {
// Cleanup jobs to do after the snapshot has been created; decrement resource count
if (snapshot != null) {
postCreateSnapshot(volumeId, snapshot.getId(), policyId, backedUp);
_volsDao.releaseFromLockTable(volumeId);
if (backedUp) {
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_CREATE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, v.getSize());
_usageEventDao.persist(usageEvent);
}
} else if (snapshot == null || !backedUp) {
_accountMgr.decrementResourceCount(owner.getId(), ResourceType.snapshot);
}
}
return snapshot;
}
@Override
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_CREATE, eventDescription = "creating snapshot", async = true)
public SnapshotVO createSnapshot(CreateSnapshotCmd cmd) {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getPolicyId();
Long snapshotId = cmd.getEntityId();
return createSnapshotImpl(volumeId, policyId, snapshotId);
}
private SnapshotVO updateDBOnCreate(Long id, String snapshotPath, long preSnapshotId) {
SnapshotVO createdSnapshot = _snapshotDao.findByIdIncludingRemoved(id);
createdSnapshot.setPath(snapshotPath);
createdSnapshot.setStatus(Snapshot.Status.CreatedOnPrimary);
createdSnapshot.setPrevSnapshotId(preSnapshotId);
_snapshotDao.update(id, createdSnapshot);
return createdSnapshot;
}
@Override
@DB
@SuppressWarnings("fallthrough")
public void validateSnapshot(Long userId, SnapshotVO snapshot) {
assert snapshot != null;
Long id = snapshot.getId();
Status status = snapshot.getStatus();
s_logger.debug("Snapshot scheduler found a snapshot whose actual status is not clear. Snapshot id:" + id + " with DB status: " + status);
switch (status) {
case Creating:
// else continue to the next case.
case CreatedOnPrimary:
// The snapshot has been created on the primary and the DB has been updated.
// However, it hasn't entered the backupSnapshotToSecondaryStorage, else
// status would have been backing up.
// So call backupSnapshotToSecondaryStorage without any fear.
case BackingUp:
// It has entered backupSnapshotToSecondaryStorage.
// But we have no idea whether it was backed up or not.
// So call backupSnapshotToSecondaryStorage again.
backupSnapshotToSecondaryStorage(snapshot);
break;
case BackedUp:
// No need to do anything as snapshot has already been backed up.
}
}
@Override
@DB
public boolean backupSnapshotToSecondaryStorage(SnapshotVO ss) {
long snapshotId = ss.getId();
SnapshotVO snapshot = _snapshotDao.acquireInLockTable(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Can not acquire lock for snapshot: " + ss);
}
try {
snapshot.setStatus(Snapshot.Status.BackingUp);
_snapshotDao.update(snapshot.getId(), snapshot);
long volumeId = snapshot.getVolumeId();
VolumeVO volume = _volsDao.lockRow(volumeId, true);
String primaryStoragePoolNameLabel = _storageMgr.getPrimaryStorageNameLabel(volume);
Long dcId = volume.getDataCenterId();
Long accountId = volume.getAccountId();
String secondaryStoragePoolUrl = _storageMgr.getSecondaryStorageURL(volume.getDataCenterId());
String snapshotUuid = snapshot.getPath();
// In order to verify that the snapshot is not empty,
// we check if the parent of the snapshot is not the same as the parent of the previous snapshot.
// We pass the uuid of the previous snapshot to the plugin to verify this.
SnapshotVO prevSnapshot = null;
String prevSnapshotUuid = null;
String prevBackupUuid = null;
long prevSnapshotId = snapshot.getPrevSnapshotId();
if (prevSnapshotId > 0) {
prevSnapshot = _snapshotDao.findByIdIncludingRemoved(prevSnapshotId);
prevBackupUuid = prevSnapshot.getBackupSnapshotId();
if (prevBackupUuid != null) {
prevSnapshotUuid = prevSnapshot.getPath();
}
}
boolean isVolumeInactive = _storageMgr.volumeInactive(volume);
String vmName = _storageMgr.getVmNameOnVolume(volume);
BackupSnapshotCommand backupSnapshotCommand = new BackupSnapshotCommand(primaryStoragePoolNameLabel, secondaryStoragePoolUrl, dcId, accountId, volumeId, volume.getPath(), snapshotUuid, snapshot.getName(), prevSnapshotUuid, prevBackupUuid,
isVolumeInactive, vmName);
String backedUpSnapshotUuid = null;
// By default, assume failed.
boolean backedUp = false;
BackupSnapshotAnswer answer = (BackupSnapshotAnswer) sendToPool(volume, backupSnapshotCommand);
if (answer != null && answer.getResult()) {
backedUpSnapshotUuid = answer.getBackupSnapshotName();
if (backedUpSnapshotUuid != null) {
backedUp = true;
}
} else if (answer != null) {
s_logger.error(answer.getDetails());
}
// Update the status in all cases.
Transaction txn = Transaction.currentTxn();
txn.start();
if (backedUp) {
snapshot.setBackupSnapshotId(backedUpSnapshotUuid);
if (answer.isFull()) {
snapshot.setPrevSnapshotId(0);
}
snapshot.setStatus(Snapshot.Status.BackedUp);
_snapshotDao.update(snapshotId, snapshot);
if (snapshot.getType() == Type.RECURRING) {
_accountMgr.incrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
}
} else {
s_logger.warn("Failed to back up snapshot on secondary storage, deleting the record from the DB");
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
_usageEventDao.persist(usageEvent);
_snapshotDao.remove(snapshotId);
}
txn.commit();
return backedUp;
} finally {
if (snapshot != null) {
_snapshotDao.releaseFromLockTable(snapshotId);
}
}
}
private Long getSnapshotUserId() {
Long userId = UserContext.current().getCallerUserId();
if (userId == null) {
return User.UID_SYSTEM;
}
return userId;
}
@Override
@DB
public void postCreateSnapshot(Long volumeId, Long snapshotId, Long policyId, boolean backedUp) {
Long userId = getSnapshotUserId();
SnapshotVO snapshot = _snapshotDao.findByIdIncludingRemoved(snapshotId);
// Even if the current snapshot failed, we should schedule the next
// recurring snapshot for this policy.
if (snapshot.isRecursive()) {
postCreateRecurringSnapshotForPolicy(userId, volumeId, snapshotId, policyId);
}
}
private void postCreateRecurringSnapshotForPolicy(long userId, long volumeId, long snapshotId, long policyId) {
// Use count query
SnapshotVO spstVO = _snapshotDao.findById(snapshotId);
Type type = spstVO.getType();
int maxSnaps = type.getMax();
List<SnapshotVO> snaps = listSnapsforVolumeType(volumeId, type);
SnapshotPolicyVO policy = _snapshotPolicyDao.findById(policyId);
if (policy != null && policy.getMaxSnaps() < maxSnaps) {
maxSnaps = policy.getMaxSnaps();
}
while (snaps.size() > maxSnaps && snaps.size() > 1) {
SnapshotVO oldestSnapshot = snaps.get(0);
long oldSnapId = oldestSnapshot.getId();
s_logger.debug("Max snaps: " + policy.getMaxSnaps() + " exceeded for snapshot policy with Id: " + policyId + ". Deleting oldest snapshot: " + oldSnapId);
deleteSnapshotInternal(oldSnapId);
snaps.remove(oldestSnapshot);
}
}
private Long checkAccountPermissions(long targetAccountId, long targetDomainId, String targetDesc, long targetId) {
Long accountId = null;
Account account = UserContext.current().getCaller();
if (account != null) {
if (!isAdmin(account.getType())) {
if (account.getId() != targetAccountId) {
throw new InvalidParameterValueException("Unable to find a " + targetDesc + " with id " + targetId + " for this account");
}
} else if (!_domainDao.isChildDomain(account.getDomainId(), targetDomainId)) {
throw new PermissionDeniedException("Unable to perform operation for " + targetDesc + " with id " + targetId + ", permission denied.");
}
accountId = account.getId();
}
return accountId;
}
private static boolean isAdmin(short accountType) {
return ((accountType == Account.ACCOUNT_TYPE_ADMIN) || (accountType == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) || (accountType == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN));
}
@Override
@DB
@ActionEvent(eventType = EventTypes.EVENT_SNAPSHOT_DELETE, eventDescription = "deleting snapshot", async = true)
public boolean deleteSnapshot(DeleteSnapshotCmd cmd) {
Long snapshotId = cmd.getId();
// Verify parameters
Snapshot snapshotCheck = _snapshotDao.findByIdIncludingRemoved(snapshotId.longValue());
if (snapshotCheck == null) {
throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId);
}
// If an account was passed in, make sure that it matches the account of the snapshot
Account snapshotOwner = _accountDao.findById(snapshotCheck.getAccountId());
if (snapshotOwner == null) {
throw new InvalidParameterValueException("Snapshot id " + snapshotId + " does not have a valid account");
}
checkAccountPermissions(snapshotOwner.getId(), snapshotOwner.getDomainId(), "snapshot", snapshotId);
boolean status = deleteSnapshotInternal(snapshotId);
if (!status) {
s_logger.warn("Failed to delete snapshot");
throw new CloudRuntimeException("Failed to delete snapshot:" + snapshotId);
}
return status;
}
@DB
private boolean deleteSnapshotInternal(Long snapshotId) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Calling deleteSnapshot for snapshotId: " + snapshotId);
}
SnapshotVO lastSnapshot = null;
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
if (snapshot.getBackupSnapshotId() != null) {
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(snapshot.getVolumeId(), snapshot.getBackupSnapshotId());
if (snaps != null && snaps.size() > 1) {
snapshot.setBackupSnapshotId(null);
_snapshotDao.update(snapshot.getId(), snapshot);
}
}
Transaction txn = Transaction.currentTxn();
txn.start();
_snapshotDao.remove(snapshotId);
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), snapshot.getDataCenterId(), snapshotId, snapshot.getName(), null, null, 0L);
_usageEventDao.persist(usageEvent);
_accountMgr.decrementResourceCount(snapshot.getAccountId(), ResourceType.snapshot);
txn.commit();
long lastId = snapshotId;
boolean destroy = false;
while (true) {
lastSnapshot = _snapshotDao.findNextSnapshot(lastId);
if (lastSnapshot == null) {
// if all snapshots after this snapshot in this chain are removed, remove those snapshots.
destroy = true;
break;
}
if (lastSnapshot.getRemoved() == null) {
// if there is one child not removed, then can not remove back up snapshot.
break;
}
lastId = lastSnapshot.getId();
}
if (destroy) {
lastSnapshot = _snapshotDao.findByIdIncludingRemoved(lastId);
while (lastSnapshot.getRemoved() != null) {
String BackupSnapshotId = lastSnapshot.getBackupSnapshotId();
if (BackupSnapshotId != null) {
List<SnapshotVO> snaps = _snapshotDao.listByBackupUuid(lastSnapshot.getVolumeId(), BackupSnapshotId);
if (snaps != null && !snaps.isEmpty()) {
lastSnapshot.setBackupSnapshotId(null);
_snapshotDao.update(lastSnapshot.getId(), lastSnapshot);
} else {
if (destroySnapshotBackUp(lastId)) {
} else {
s_logger.debug("Destroying snapshot backup failed " + lastSnapshot);
break;
}
}
}
lastId = lastSnapshot.getPrevSnapshotId();
if (lastId == 0) {
break;
}
lastSnapshot = _snapshotDao.findByIdIncludingRemoved(lastId);
}
}
return true;
}
@Override
@DB
public boolean destroySnapshot(long userId, long snapshotId, long policyId) {
return true;
}
@Override
@DB
public boolean destroySnapshotBackUp(long snapshotId) {
boolean success = false;
String details;
SnapshotVO snapshot = _snapshotDao.findByIdIncludingRemoved(snapshotId);
if (snapshot == null) {
throw new CloudRuntimeException("Destroying snapshot " + snapshotId + " backup failed due to unable to find snapshot ");
}
String secondaryStoragePoolUrl = _storageMgr.getSecondaryStorageURL(snapshot.getDataCenterId());
Long dcId = snapshot.getDataCenterId();
Long accountId = snapshot.getAccountId();
Long volumeId = snapshot.getVolumeId();
HypervisorType hvType = snapshot.getHypervisorType();
String backupOfSnapshot = snapshot.getBackupSnapshotId();
if (backupOfSnapshot == null) {
return true;
}
DeleteSnapshotBackupCommand cmd = new DeleteSnapshotBackupCommand(null, secondaryStoragePoolUrl, dcId, accountId, volumeId, backupOfSnapshot, snapshot.getName());
snapshot.setBackupSnapshotId(null);
_snapshotDao.update(snapshotId, snapshot);
Answer answer = _agentMgr.sendTo(dcId, hvType, cmd);
if ((answer != null) && answer.getResult()) {
// This is not the last snapshot.
success = true;
details = "Successfully deleted snapshot " + snapshotId + " for volumeId: " + volumeId;
s_logger.debug(details);
} else if (answer != null) {
details = "Failed to destroy snapshot id:" + snapshotId + " for volume: " + volumeId + " due to ";
if (answer.getDetails() != null) {
details += answer.getDetails();
}
s_logger.error(details);
}
return success;
}
@Override
public List<SnapshotVO> listSnapshots(ListSnapshotsCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
Long volumeId = cmd.getVolumeId();
Boolean isRecursive = cmd.isRecursive();
// Verify parameters
if (volumeId != null) {
VolumeVO volume = _volsDao.findById(volumeId);
if (volume != null) {
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
}
}
Account account = UserContext.current().getCaller();
Long domainId = cmd.getDomainId();
String accountName = cmd.getAccountName();
Long accountId = null;
if ((account == null) || isAdmin(account.getType())) {
if (domainId != null) {
if ((account != null) && !_domainDao.isChildDomain(account.getDomainId(), domainId)) {
throw new PermissionDeniedException("Unable to list templates for domain " + domainId + ", permission denied.");
}
} else if ((account != null) && (account.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN)) {
domainId = account.getDomainId();
}
if (domainId != null && accountName != null) {
Account userAccount = _accountDao.findActiveAccount(accountName, domainId);
if (userAccount != null) {
accountId = userAccount.getId();
} else {
throw new InvalidParameterValueException("Could not find account:" + accountName + " in domain:" + domainId);
}
}
} else {
accountId = account.getId();
}
if (isRecursive == null) {
isRecursive = false;
}
Object name = cmd.getSnapshotName();
Object id = cmd.getId();
Object keyword = cmd.getKeyword();
Object snapshotTypeStr = cmd.getSnapshotType();
Object intervalTypeStr = cmd.getIntervalType();
Filter searchFilter = new Filter(SnapshotVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal());
SearchBuilder<SnapshotVO> sb = _snapshotDao.createSearchBuilder();
sb.and("status", sb.entity().getStatus(), SearchCriteria.Op.EQ);
sb.and("volumeId", sb.entity().getVolumeId(), SearchCriteria.Op.EQ);
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.EQ);
sb.and("snapshotTypeEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.IN);
sb.and("snapshotTypeNEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.NEQ);
if ((accountId == null) && (domainId != null)) {
// if accountId isn't specified, we can do a domain match for the admin case
SearchBuilder<AccountVO> accountSearch = _accountDao.createSearchBuilder();
sb.join("accountSearch", accountSearch, sb.entity().getAccountId(), accountSearch.entity().getId(), JoinType.INNER);
SearchBuilder<DomainVO> domainSearch = _domainDao.createSearchBuilder();
if (isRecursive) {
domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE);
} else {
domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.EQ);
}
accountSearch.join("domainSearch", domainSearch, accountSearch.entity().getDomainId(), domainSearch.entity().getId(), JoinType.INNER);
}
SearchCriteria<SnapshotVO> sc = sb.create();
sc.setParameters("status", Snapshot.Status.BackedUp);
if (volumeId != null) {
sc.setParameters("volumeId", volumeId);
}
if (name != null) {
sc.setParameters("name", "%" + name + "%");
}
if (id != null) {
sc.setParameters("id", id);
}
if (keyword != null) {
SearchCriteria<SnapshotVO> ssc = _snapshotDao.createSearchCriteria();
ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
sc.addAnd("name", SearchCriteria.Op.SC, ssc);
}
if (accountId != null) {
sc.setParameters("accountId", accountId);
} else if (domainId != null) {
DomainVO domain = _domainDao.findById(domainId);
SearchCriteria<?> joinSearch = sc.getJoin("accountSearch");
if (isRecursive) {
joinSearch.setJoinParameters("domainSearch", "path", domain.getPath() + "%");
} else {
joinSearch.setJoinParameters("domainSearch", "path", domain.getPath());
}
}
if (snapshotTypeStr != null) {
Type snapshotType = SnapshotVO.getSnapshotType((String) snapshotTypeStr);
if (snapshotType == null) {
throw new InvalidParameterValueException("Unsupported snapshot type " + snapshotTypeStr);
}
if (snapshotType == Type.RECURRING) {
sc.setParameters("snapshotTypeEQ", Type.HOURLY.ordinal(), Type.DAILY.ordinal(), Type.WEEKLY.ordinal(), Type.MONTHLY.ordinal());
} else {
sc.setParameters("snapshotTypeEQ", snapshotType.ordinal());
}
} else if (intervalTypeStr != null && volumeId != null) {
Type type = SnapshotVO.getSnapshotType((String) intervalTypeStr);
if (type == null) {
throw new InvalidParameterValueException("Unsupported snapstho interval type " + intervalTypeStr);
}
sc.setParameters("snapshotTypeEQ", type.ordinal());
} else {
// Show only MANUAL and RECURRING snapshot types
sc.setParameters("snapshotTypeNEQ", Snapshot.Type.TEMPLATE.ordinal());
}
return _snapshotDao.search(sc, searchFilter);
}
@Override
public boolean deleteSnapshotDirsForAccount(long accountId) {
List<VolumeVO> volumes = _volsDao.findByAccount(accountId);
// The above call will list only non-destroyed volumes.
// So call this method before marking the volumes as destroyed.
// i.e Call them before the VMs for those volumes are destroyed.
boolean success = true;
for (VolumeVO volume : volumes) {
if (volume.getPoolId() == null) {
continue;
}
Long volumeId = volume.getId();
Long dcId = volume.getDataCenterId();
String secondaryStoragePoolURL = _storageMgr.getSecondaryStorageURL(dcId);
String primaryStoragePoolNameLabel = _storageMgr.getPrimaryStorageNameLabel(volume);
if (_snapshotDao.listByVolumeIdIncludingRemoved(volumeId).isEmpty()) {
// This volume doesn't have any snapshots. Nothing do delete.
continue;
}
DeleteSnapshotsDirCommand cmd = new DeleteSnapshotsDirCommand(primaryStoragePoolNameLabel, secondaryStoragePoolURL, dcId, accountId, volumeId, volume.getPath());
Answer answer = null;
Long poolId = volume.getPoolId();
if (poolId != null) {
// Retry only once for this command. There's low chance of failure because of a connection problem.
try {
answer = _storageMgr.sendToPool(poolId, cmd);
} catch (StorageUnavailableException e) {
}
} else {
s_logger.info("Pool id for volume id: " + volumeId + " belonging to account id: " + accountId + " is null. Assuming the snapshotsDir for the account has already been deleted");
}
if (success) {
// SnapshotsDir has been deleted for the volumes so far.
success = (answer != null) && answer.getResult();
if (success) {
s_logger.debug("Deleted snapshotsDir for volume: " + volumeId + " under account: " + accountId);
} else if (answer != null) {
s_logger.error(answer.getDetails());
}
}
// Either way delete the snapshots for this volume.
List<SnapshotVO> snapshots = listSnapsforVolume(volumeId);
for (SnapshotVO snapshot : snapshots) {
if (_snapshotDao.expunge(snapshot.getId())) {
if (snapshot.getType() == Type.MANUAL) {
_accountMgr.decrementResourceCount(accountId, ResourceType.snapshot);
}
// Log event after successful deletion
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_SNAPSHOT_DELETE, snapshot.getAccountId(), volume.getDataCenterId(), snapshot.getId(), snapshot.getName(), null, null, volume.getSize());
_usageEventDao.persist(usageEvent);
}
}
}
// Returns true if snapshotsDir has been deleted for all volumes.
return success;
}
@Override
@DB
public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd) throws InvalidParameterValueException {
Long volumeId = cmd.getVolumeId();
VolumeVO volume = _volsDao.findById(cmd.getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Failed to create snapshot policy, unable to find a volume with id " + volumeId);
}
AccountVO owner = _accountDao.findById(volume.getAccountId());
DomainVO domain = _domainDao.findById(owner.getDomainId());
// If an account was passed in, make sure that it matches the account of the volume
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
Long instanceId = volume.getInstanceId();
if (instanceId != null) {
// It is not detached, but attached to a VM
if (_vmDao.findById(instanceId) == null) {
// It is not a UserVM but a SystemVM or DomR
throw new InvalidParameterValueException("Failed to create snapshot policy, snapshots of volumes attached to System or router VM are not allowed");
}
}
IntervalType intvType = DateUtil.IntervalType.getIntervalType(cmd.getIntervalType());
if (intvType == null) {
throw new InvalidParameterValueException("Unsupported interval type " + cmd.getIntervalType());
}
Type type = getSnapshotType(intvType);
TimeZone timeZone = TimeZone.getTimeZone(cmd.getTimezone());
String timezoneId = timeZone.getID();
if (!timezoneId.equals(cmd.getTimezone())) {
s_logger.warn("Using timezone: " + timezoneId + " for running this snapshot policy as an equivalent of " + cmd.getTimezone());
}
try {
DateUtil.getNextRunTime(intvType, cmd.getSchedule(), timezoneId, null);
} catch (Exception e) {
throw new InvalidParameterValueException("Invalid schedule: " + cmd.getSchedule() + " for interval type: " + cmd.getIntervalType());
}
if (cmd.getMaxSnaps() <= 0) {
throw new InvalidParameterValueException("maxSnaps should be greater than 0");
}
int intervalMaxSnaps = type.getMax();
if (cmd.getMaxSnaps() > intervalMaxSnaps) {
throw new InvalidParameterValueException("maxSnaps exceeds limit: " + intervalMaxSnaps + " for interval type: " + cmd.getIntervalType());
}
// Verify that max doesn't exceed domain and account snapshot limits
long accountLimit = _accountMgr.findCorrectResourceLimit(owner, ResourceType.snapshot);
long domainLimit = _accountMgr.findCorrectResourceLimit(domain, ResourceType.snapshot);
int max = cmd.getMaxSnaps().intValue();
if (owner.getType() != Account.ACCOUNT_TYPE_ADMIN && ((accountLimit != -1 && max > accountLimit) || (domainLimit != -1 && max > domainLimit))) {
throw new InvalidParameterValueException("Max number of snapshots shouldn't exceed the domain/account level snapshot limit");
}
SnapshotPolicyVO policy = _snapshotPolicyDao.findOneByVolumeInterval(volumeId, intvType);
if (policy == null) {
policy = new SnapshotPolicyVO(volumeId, cmd.getSchedule(), timezoneId, intvType, cmd.getMaxSnaps());
policy = _snapshotPolicyDao.persist(policy);
_snapSchedMgr.scheduleNextSnapshotJob(policy);
} else {
try {
policy = _snapshotPolicyDao.acquireInLockTable(policy.getId());
policy.setSchedule(cmd.getSchedule());
policy.setTimezone(timezoneId);
policy.setInterval((short) type.ordinal());
policy.setMaxSnaps(cmd.getMaxSnaps());
policy.setActive(true);
_snapshotPolicyDao.update(policy.getId(), policy);
} finally {
if (policy != null) {
_snapshotPolicyDao.releaseFromLockTable(policy.getId());
}
}
}
return policy;
}
@Override
public boolean deletePolicy(long userId, Long policyId) {
SnapshotPolicyVO snapshotPolicy = _snapshotPolicyDao.findById(policyId);
_snapSchedMgr.removeSchedule(snapshotPolicy.getVolumeId(), snapshotPolicy.getId());
return _snapshotPolicyDao.remove(policyId);
}
@Override
public List<SnapshotPolicyVO> listPoliciesforVolume(ListSnapshotPoliciesCmd cmd) throws InvalidParameterValueException {
Long volumeId = cmd.getVolumeId();
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new InvalidParameterValueException("Unable to find a volume with id " + volumeId);
}
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volumeId);
return listPoliciesforVolume(cmd.getVolumeId());
}
@Override
public List<SnapshotPolicyVO> listPoliciesforVolume(long volumeId) {
return _snapshotPolicyDao.listByVolumeId(volumeId);
}
@Override
public List<SnapshotPolicyVO> listPoliciesforSnapshot(long snapshotId) {
SearchCriteria<SnapshotPolicyVO> sc = PoliciesForSnapSearch.create();
sc.setJoinParameters("policyRef", "snapshotId", snapshotId);
return _snapshotPolicyDao.search(sc, null);
}
@Override
public List<SnapshotVO> listSnapsforPolicy(long policyId, Filter filter) {
SearchCriteria<SnapshotVO> sc = PolicySnapshotSearch.create();
sc.setJoinParameters("policy", "policyId", policyId);
return _snapshotDao.search(sc, filter);
}
@Override
public List<SnapshotVO> listSnapsforVolume(long volumeId) {
return _snapshotDao.listByVolumeId(volumeId);
}
public List<SnapshotVO> listSnapsforVolumeType(long volumeId, Type type) {
return _snapshotDao.listByVolumeIdType(volumeId, type);
}
@Override
public void deletePoliciesForVolume(Long volumeId) {
List<SnapshotPolicyVO> policyInstances = listPoliciesforVolume(volumeId);
for (SnapshotPolicyVO policyInstance : policyInstances) {
Long policyId = policyInstance.getId();
deletePolicy(1L, policyId);
}
// We also want to delete the manual snapshots scheduled for this volume
// We can only delete the schedules in the future, not the ones which are already executing.
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, Snapshot.MANUAL_POLICY_ID, false);
if (snapshotSchedule != null) {
_snapshotScheduleDao.expunge(snapshotSchedule.getId());
}
}
/**
* {@inheritDoc}
*/
@Override
public List<SnapshotScheduleVO> findRecurringSnapshotSchedule(ListRecurringSnapshotScheduleCmd cmd) throws InvalidParameterValueException, PermissionDeniedException {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getSnapshotPolicyId();
Account account = UserContext.current().getCaller();
// Verify parameters
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new InvalidParameterValueException("Failed to list snapshot schedule, unable to find a volume with id " + volumeId);
}
if (account != null) {
long volAcctId = volume.getAccountId();
if (isAdmin(account.getType())) {
Account userAccount = _accountDao.findById(Long.valueOf(volAcctId));
if (!_domainDao.isChildDomain(account.getDomainId(), userAccount.getDomainId())) {
throw new PermissionDeniedException("Unable to list snapshot schedule for volume " + volumeId + ", permission denied.");
}
} else if (account.getId() != volAcctId) {
throw new PermissionDeniedException("Unable to list snapshot schedule, account " + account.getAccountName() + " does not own volume id " + volAcctId);
}
}
// List only future schedules, not past ones.
List<SnapshotScheduleVO> snapshotSchedules = new ArrayList<SnapshotScheduleVO>();
if (policyId == null) {
List<SnapshotPolicyVO> policyInstances = listPoliciesforVolume(volumeId);
for (SnapshotPolicyVO policyInstance : policyInstances) {
SnapshotScheduleVO snapshotSchedule = _snapshotScheduleDao.getCurrentSchedule(volumeId, policyInstance.getId(), false);
snapshotSchedules.add(snapshotSchedule);
}
} else {
snapshotSchedules.add(_snapshotScheduleDao.getCurrentSchedule(volumeId, policyId, false));
}
return snapshotSchedules;
}
@Override
public SnapshotPolicyVO getPolicyForVolume(long volumeId) {
return _snapshotPolicyDao.findOneByVolume(volumeId);
}
public Type getSnapshotType(Long policyId) {
if (policyId.equals(Snapshot.MANUAL_POLICY_ID)) {
return Type.MANUAL;
} else {
SnapshotPolicyVO spstPolicyVO = _snapshotPolicyDao.findById(policyId);
IntervalType intvType = DateUtil.getIntervalType(spstPolicyVO.getInterval());
return getSnapshotType(intvType);
}
}
public Type getSnapshotType(IntervalType intvType) {
if (intvType.equals(IntervalType.HOURLY)) {
return Type.HOURLY;
} else if (intvType.equals(IntervalType.DAILY)) {
return Type.DAILY;
} else if (intvType.equals(IntervalType.WEEKLY)) {
return Type.WEEKLY;
} else if (intvType.equals(IntervalType.MONTHLY)) {
return Type.MONTHLY;
}
return null;
}
@Override
public SnapshotVO allocSnapshot(CreateSnapshotCmd cmd) throws ResourceAllocationException {
Long volumeId = cmd.getVolumeId();
Long policyId = cmd.getPolicyId();
VolumeVO volume = _volsDao.findById(volumeId);
if (volume == null) {
throw new CloudRuntimeException("Creating snapshot failed due to volume:" + volumeId + " doesn't exist");
}
if (volume.getStatus() != AsyncInstanceCreateStatus.Created) {
throw new InvalidParameterValueException("VolumeId: " + volumeId + " is not in Created state but " + volume.getStatus() + ". Cannot take snapshot.");
}
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
if (storagePoolVO == null) {
throw new InvalidParameterValueException("VolumeId: " + volumeId + " please attach this volume to a VM before create snapshot for it");
}
Account owner = _accountMgr.getAccount(volume.getAccountId());
if (_accountMgr.resourceLimitExceeded(owner, ResourceType.snapshot)) {
ResourceAllocationException rae = new ResourceAllocationException("Maximum number of snapshots for account: " + owner.getAccountName() + " has been exceeded.");
rae.setResourceType("snapshot");
throw rae;
}
// Determine the name for this snapshot
// Snapshot Name: VMInstancename + volumeName + timeString
String timeString = DateUtil.getDateDisplayString(DateUtil.GMT_TIMEZONE, new Date(), DateUtil.YYYYMMDD_FORMAT);
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
String vmDisplayName = "detached";
if (vmInstance != null) {
vmDisplayName = vmInstance.getName();
}
String snapshotName = vmDisplayName + "_" + volume.getName() + "_" + timeString;
// Create the Snapshot object and save it so we can return it to the
// user
Type snapshotType = getSnapshotType(policyId);
HypervisorType hypervisorType = this._volsDao.getHypervisorType(volumeId);
SnapshotVO snapshotVO = new SnapshotVO(volume.getDataCenterId(), volume.getAccountId(), volume.getDomainId(), volume.getId(), volume.getDiskOfferingId(), null, snapshotName, (short) snapshotType.ordinal(), snapshotType.name(), volume.getSize(),
hypervisorType);
SnapshotVO snapshot = _snapshotDao.persist(snapshotVO);
if (snapshot != null) {
_accountMgr.incrementResourceCount(volume.getAccountId(), ResourceType.snapshot);
}
return snapshot;
}
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
ComponentLocator locator = ComponentLocator.getCurrentLocator();
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
if (configDao == null) {
throw new ConfigurationException("Unable to get the configuration dao.");
}
Type.HOURLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.hourly"), HOURLYMAX));
Type.DAILY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.daily"), DAILYMAX));
Type.WEEKLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.weekly"), WEEKLYMAX));
Type.MONTHLY.setMax(NumbersUtil.parseInt(configDao.getValue("snapshot.max.monthly"), MONTHLYMAX));
_deltaSnapshotMax = NumbersUtil.parseInt(configDao.getValue("snapshot.delta.max"), DELTAMAX);
_totalRetries = NumbersUtil.parseInt(configDao.getValue("total.retries"), 4);
_pauseInterval = 2 * NumbersUtil.parseInt(configDao.getValue("ping.interval"), 60);
s_logger.info("Snapshot Manager is configured.");
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;
}
@Override
public boolean stop() {
return true;
}
@Override
public boolean deleteSnapshotPolicies(DeleteSnapshotPoliciesCmd cmd) {
Long policyId = cmd.getId();
List<Long> policyIds = cmd.getIds();
Long userId = getSnapshotUserId();
if ((policyId == null) && (policyIds == null)) {
throw new InvalidParameterValueException("No policy id (or list of ids) specified.");
}
if (policyIds == null) {
policyIds = new ArrayList<Long>();
policyIds.add(policyId);
} else if (policyIds.size() <= 0) {
// Not even sure how this is even possible
throw new InvalidParameterValueException("There are no policy ids");
}
for (Long policy : policyIds) {
SnapshotPolicyVO snapshotPolicyVO = _snapshotPolicyDao.findById(policy);
if (snapshotPolicyVO == null) {
throw new InvalidParameterValueException("Policy id given: " + policy + " does not exist");
}
VolumeVO volume = _volsDao.findById(snapshotPolicyVO.getVolumeId());
if (volume == null) {
throw new InvalidParameterValueException("Policy id given: " + policy + " does not belong to a valid volume");
}
// If an account was passed in, make sure that it matches the account of the volume
checkAccountPermissions(volume.getAccountId(), volume.getDomainId(), "volume", volume.getId());
}
boolean success = true;
if (policyIds.contains(Snapshot.MANUAL_POLICY_ID)) {
throw new InvalidParameterValueException("Invalid Policy id given: " + Snapshot.MANUAL_POLICY_ID);
}
for (Long pId : policyIds) {
if (!deletePolicy(userId, pId)) {
success = false;
s_logger.warn("Failed to delete snapshot policy with Id: " + policyId);
return success;
}
}
return success;
}
private boolean hostSupportSnapsthot(HostVO host) {
if (host.getHypervisorType() != HypervisorType.KVM) {
return true;
}
// Determine host capabilities
String caps = host.getCapabilities();
if (caps != null) {
String[] tokens = caps.split(",");
for (String token : tokens) {
if (token.contains("snapshot")) {
return true;
}
}
}
return false;
}
}
| bug 8993: throw exception if creating snapshot on primary storage fails it may be due to previous creation desn't finish
status 8993: resolved fixed
| server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | bug 8993: throw exception if creating snapshot on primary storage fails it may be due to previous creation desn't finish | <ide><path>erver/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
<ide> if (!backedUp) {
<ide> throw new CloudRuntimeException("Created snapshot: " + snapshot + " on primary but failed to backup on secondary");
<ide> }
<del> }
<add> } else {
<add> throw new CloudRuntimeException("Failed to create snapshot: " + snapshot + " on primary storage");
<add> }
<ide> } finally {
<ide> // Cleanup jobs to do after the snapshot has been created; decrement resource count
<ide> if (snapshot != null) { |
|
Java | apache-2.0 | e5b29110f6482416c1026878cdc23cbef30bf172 | 0 | martincooper/java-datatable | import io.vavr.collection.Stream;
import io.vavr.control.Try;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Random;
import java.util.function.Supplier;
/**
* Memory Profiling Tests for the Data Table.
* Created by Martin Cooper on 19/07/2017.
*/
public class DataTableMemoryTests {
private final Random rand = new Random();
private static Integer ROW_COUNT = 1000000;
// Check memory usage of the data in it's raw form (plain Java Arrays).
@Ignore
@Test
public void testRawRowData() {
String[] stringData = randomStringData(ROW_COUNT);
Integer[] intData = randomIntegerData(ROW_COUNT);
Double[] doubleData = randomDoubleData(ROW_COUNT);
Boolean[] boolData = randomBooleanData(ROW_COUNT);
long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("MB: " + (mem / 1024) / 1024);
}
// Check memory usage of the data stored in a Data Table.
@Ignore
@Test
public void testDataTableWithRowData() {
Try<DataTable> table = DataTableBuilder
.create("NewTable")
.withColumn(String.class, "StrCol", randomStringData(ROW_COUNT))
.withColumn(Integer.class, "IntCol", randomIntegerData(ROW_COUNT))
.withColumn(Double.class, "DoubleCol", randomDoubleData(ROW_COUNT))
.withColumn(Boolean.class, "BoolCol", randomBooleanData(ROW_COUNT))
.build();
long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("MB: " + (mem / 1024) / 1024);
}
private Integer[] randomIntegerData(int dataSize) {
return generateRange(Integer.class, dataSize, rand::nextInt);
}
private Boolean[] randomBooleanData(int dataSize) {
return generateRange(Boolean.class, dataSize, rand::nextBoolean);
}
private Double[] randomDoubleData(int dataSize) {
return generateRange(Double.class, dataSize, rand::nextDouble);
}
private String[] randomStringData(int dataSize) {
return generateRange(String.class, dataSize, () -> randomString(10));
}
private String randomString(int length) {
return Stream
.range(0, length)
.map(i -> (char)(rand.nextInt((int)(Character.MAX_VALUE))))
.toString();
}
private <T> T[] generateRange(Class<T> classType, int size, Supplier<T> supplier) {
return Stream
.range(0, size)
.map(i -> supplier.get())
.toJavaArray(classType);
}
}
| src/test/profiling/DataTableMemoryTests.java | import io.vavr.collection.Stream;
import io.vavr.control.Try;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Random;
import java.util.function.Supplier;
/**
* Memory Tests for the Data Table.
* Created by Martin Cooper on 19/07/2017.
*/
public class DataTableMemoryTests {
private final Random rand = new Random();
private static Integer ROW_COUNT = 1000000;
@Ignore
@Test
public void testRawRowData() {
String[] stringData = randomStringData(ROW_COUNT);
Integer[] intData = randomIntegerData(ROW_COUNT);
Double[] doubleData = randomDoubleData(ROW_COUNT);
Boolean[] boolData = randomBooleanData(ROW_COUNT);
long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("MB: " + (mem / 1024) / 1024);
}
@Ignore
@Test
public void testDataTableWithRowData() {
Try<DataTable> table = DataTableBuilder
.create("NewTable")
.withColumn(String.class, "StrCol", randomStringData(ROW_COUNT))
.withColumn(Integer.class, "IntCol", randomIntegerData(ROW_COUNT))
.withColumn(Double.class, "DoubleCol", randomDoubleData(ROW_COUNT))
.withColumn(Boolean.class, "BoolCol", randomBooleanData(ROW_COUNT))
.build();
long mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("MB: " + (mem / 1024) / 1024);
}
private Integer[] randomIntegerData(int dataSize) {
return generateRange(Integer.class, dataSize, rand::nextInt);
}
private Boolean[] randomBooleanData(int dataSize) {
return generateRange(Boolean.class, dataSize, rand::nextBoolean);
}
private Double[] randomDoubleData(int dataSize) {
return generateRange(Double.class, dataSize, rand::nextDouble);
}
private String[] randomStringData(int dataSize) {
return generateRange(String.class, dataSize, () -> randomString(10));
}
private String randomString(int length) {
return Stream
.range(0, length)
.map(i -> (char)(rand.nextInt((int)(Character.MAX_VALUE))))
.toString();
}
private <T> T[] generateRange(Class<T> classType, int size, Supplier<T> supplier) {
return Stream
.range(0, size)
.map(i -> supplier.get())
.toJavaArray(classType);
}
}
| Adding memory performance tests.
| src/test/profiling/DataTableMemoryTests.java | Adding memory performance tests. | <ide><path>rc/test/profiling/DataTableMemoryTests.java
<ide> import java.util.function.Supplier;
<ide>
<ide> /**
<del> * Memory Tests for the Data Table.
<add> * Memory Profiling Tests for the Data Table.
<ide> * Created by Martin Cooper on 19/07/2017.
<ide> */
<ide> public class DataTableMemoryTests {
<ide> private final Random rand = new Random();
<ide> private static Integer ROW_COUNT = 1000000;
<ide>
<add> // Check memory usage of the data in it's raw form (plain Java Arrays).
<ide> @Ignore
<ide> @Test
<ide> public void testRawRowData() {
<ide> System.out.println("MB: " + (mem / 1024) / 1024);
<ide> }
<ide>
<add> // Check memory usage of the data stored in a Data Table.
<ide> @Ignore
<ide> @Test
<ide> public void testDataTableWithRowData() { |
|
JavaScript | mit | 90ee45d8f6851525903ebcc0782ccdbb13fcbcf5 | 0 | argos-ci/argos,argos-ci/argos,argos-ci/argos | import { transaction } from 'objection'
import errorHandler, { HttpError } from 'express-err'
import express from 'express'
import multer from 'multer'
import S3 from 'aws-sdk/clients/s3'
import multerS3 from 'multer-s3'
import config from 'config'
import Build from 'server/models/Build'
import Repository from 'server/models/Repository'
import ScreenshotBucket from 'server/models/ScreenshotBucket'
import buildJob from 'server/jobs/build'
const router = new express.Router()
const s3 = new S3({
signatureVersion: 'v4',
})
const upload = multer({
storage: multerS3({
s3,
bucket: config.get('s3.screenshotsBucket'),
contentType: multerS3.AUTO_CONTENT_TYPE,
}),
})
/**
* Takes a route handling function and returns
* a function that wraps it in a `try/catch`. Caught
* exceptions are forwarded to the `next` handler.
*/
function errorChecking(routeHandler) {
return async (req, res, next) => {
try {
await routeHandler(req, res, next)
} catch (err) {
// Handle objection errors
err.status = err.status || err.statusCode
next(err)
}
}
}
router.post('/builds', upload.array('screenshots[]', 50), errorChecking(
async (req, res) => {
if (!req.body.token) {
throw new HttpError(401, 'Invalid token')
}
const [repository] = await Repository.query().where({ token: req.body.token })
if (!repository) {
throw new HttpError(400, `Repository not found (token: "${req.body.token}")`)
} else if (!repository.enabled) {
throw new HttpError(400, 'Repository not enabled')
}
const build = await transaction(
Build,
ScreenshotBucket,
async function (Build, ScreenshotBucket) {
const bucket = await ScreenshotBucket
.query()
.insert({
name: 'default',
commit: req.body.commit,
branch: req.body.branch,
repositoryId: repository.id,
})
const inserts = req.files.map(file => bucket
.$relatedQuery('screenshots')
.insert({
name: file.originalname,
s3Id: file.key,
screenshotBucketId: bucket.id,
}))
await Promise.all(inserts)
const baseScreenshotBucket = await bucket.baseScreenshotBucket()
const build = await Build.query()
.insert({
baseScreenshotBucketId: baseScreenshotBucket ? baseScreenshotBucket.id : undefined,
compareScreenshotBucketId: bucket.id,
repositoryId: repository.id,
})
return build
},
)
await buildJob.push(build.id)
res.send(build)
},
))
router.get('/buckets', errorChecking(
async (req, res) => {
let query = ScreenshotBucket.query()
if (req.query.branch) {
query = query.where({ branch: req.query.branch })
}
res.send(await query)
},
))
// Display errors
router.use(errorHandler({
exitOnUncaughtException: false,
formatters: ['json'],
defaultFormatter: 'json',
}))
export default router
| src/server/routes/api.js | import { transaction } from 'objection'
import errorHandler, { HttpError } from 'express-err'
import express from 'express'
import multer from 'multer'
import S3 from 'aws-sdk/clients/s3'
import multerS3 from 'multer-s3'
import config from 'config'
import Build from 'server/models/Build'
import Repository from 'server/models/Repository'
import ScreenshotBucket from 'server/models/ScreenshotBucket'
import buildJob from 'server/jobs/build'
const router = new express.Router()
const s3 = new S3({
signatureVersion: 'v4',
})
const upload = multer({
storage: multerS3({
s3,
bucket: config.get('s3.screenshotsBucket'),
contentType: multerS3.AUTO_CONTENT_TYPE,
}),
})
/**
* Takes a route handling function and returns
* a function that wraps it in a `try/catch`. Caught
* exceptions are forwarded to the `next` handler.
*/
function errorChecking(routeHandler) {
return async (req, res, next) => {
try {
await routeHandler(req, res, next)
} catch (err) {
// Handle objection errors
err.status = err.status || err.statusCode
next(err)
}
}
}
router.post('/builds', upload.array('screenshots[]', 50), errorChecking(
async (req, res) => {
if (!req.body.token) {
throw new HttpError(401, 'Invalid token')
}
const [repository] = await Repository.query().where({ token: req.body.token })
if (!repository) {
throw new HttpError(400, `Repository not found (token: "${req.body.token}")`)
} else if (!repository.enabled) {
throw new HttpError(400, 'Repository not enabled')
}
const build = await transaction(
Build,
ScreenshotBucket,
async function (Build, ScreenshotBucket) {
const bucket = await ScreenshotBucket
.query()
.insert({
name: 'default',
commit: req.body.commit,
branch: req.body.branch,
repositoryId: repository.id,
})
const inserts = req.files.map(file => bucket
.$relatedQuery('screenshots')
.insert({
name: file.originalname,
s3Id: file.key,
}))
await Promise.all(inserts)
const baseScreenshotBucket = await bucket.baseScreenshotBucket()
const build = await Build.query()
.insert({
baseScreenshotBucketId: baseScreenshotBucket ? baseScreenshotBucket.id : undefined,
compareScreenshotBucketId: bucket.id,
repositoryId: repository.id,
})
return build
},
)
await buildJob.push(build.id)
res.send(build)
},
))
router.get('/buckets', errorChecking(
async (req, res) => {
let query = ScreenshotBucket.query()
if (req.query.branch) {
query = query.where({ branch: req.query.branch })
}
res.send(await query)
},
))
// Display errors
router.use(errorHandler({
exitOnUncaughtException: false,
formatters: ['json'],
defaultFormatter: 'json',
}))
export default router
| tests: fix test, weird bug in objection
| src/server/routes/api.js | tests: fix test, weird bug in objection | <ide><path>rc/server/routes/api.js
<ide> .insert({
<ide> name: file.originalname,
<ide> s3Id: file.key,
<add> screenshotBucketId: bucket.id,
<ide> }))
<ide>
<ide> await Promise.all(inserts) |
|
Java | apache-2.0 | error: pathspec 'rest-assured/src/test/java/com/jayway/restassured/path/json/support/Book.java' did not match any file(s) known to git
| 2316f8557f0d6051da46048faf01257be705a322 | 1 | camunda-third-party/rest-assured,lucamilanesio/rest-assured,paweld2/rest-assured,eeichinger/rest-assured,suvarnaraju/rest-assured,janusnic/rest-assured,caravenase/rest-assured,suvarnaraju/rest-assured,Navrattan-Yadav/rest-assured,dushmis/rest-assured,Navrattan-Yadav/rest-assured,BenSeverson/rest-assured,eeichinger/rest-assured,nishantkashyap/rest-assured-1,paweld2/rest-assured,BenSeverson/rest-assured,rest-assured/rest-assured,pxy0592/rest-assured,jayway/rest-assured,pxy0592/rest-assured,Igor-Petrov/rest-assured,RocketRaccoon/rest-assured,rest-assured/rest-assured,Igor-Petrov/rest-assured,jayway/rest-assured,MattGong/rest-assured,camunda-third-party/rest-assured,RocketRaccoon/rest-assured,janusnic/rest-assured,MattGong/rest-assured,caravena-nisum-com/rest-assured,dushmis/rest-assured,rest-assured/rest-assured,nishantkashyap/rest-assured-1,caravenase/rest-assured,caravena-nisum-com/rest-assured | /*
* Copyright 2011 the original author or 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.
*/
package com.jayway.restassured.path.json.support;
import org.junit.Ignore;
@Ignore
public class Book {
private String category;
private String author;
private String title;
private String isbn;
private float price;
public Book(String category, String author, String title, String isbn, float price) {
this.category = category;
this.author = author;
this.title = title;
this.isbn = isbn;
this.price = price;
}
public Book() {
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Book book = (Book) o;
if (Float.compare(book.price, price) != 0) return false;
if (author != null ? !author.equals(book.author) : book.author != null) return false;
if (category != null ? !category.equals(book.category) : book.category != null) return false;
if (isbn != null ? !isbn.equals(book.isbn) : book.isbn != null) return false;
if (title != null ? !title.equals(book.title) : book.title != null) return false;
return true;
}
@Override
public int hashCode() {
int result = category != null ? category.hashCode() : 0;
result = 31 * result + (author != null ? author.hashCode() : 0);
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + (isbn != null ? isbn.hashCode() : 0);
result = 31 * result + (price != +0.0f ? Float.floatToIntBits(price) : 0);
return result;
}
}
| rest-assured/src/test/java/com/jayway/restassured/path/json/support/Book.java | Added missing class
| rest-assured/src/test/java/com/jayway/restassured/path/json/support/Book.java | Added missing class | <ide><path>est-assured/src/test/java/com/jayway/restassured/path/json/support/Book.java
<add>/*
<add> * Copyright 2011 the original author or authors.
<add> *
<add> * Licensed under the Apache License, Version 2.0 (the "License");
<add> * you may not use this file except in compliance with the License.
<add> * You may obtain a copy of the License at
<add> *
<add> * http://www.apache.org/licenses/LICENSE-2.0
<add> *
<add> * Unless required by applicable law or agreed to in writing, software
<add> * distributed under the License is distributed on an "AS IS" BASIS,
<add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<add> * See the License for the specific language governing permissions and
<add> * limitations under the License.
<add> */
<add>
<add>package com.jayway.restassured.path.json.support;
<add>
<add>import org.junit.Ignore;
<add>
<add>@Ignore
<add>public class Book {
<add> private String category;
<add> private String author;
<add> private String title;
<add> private String isbn;
<add> private float price;
<add>
<add> public Book(String category, String author, String title, String isbn, float price) {
<add> this.category = category;
<add> this.author = author;
<add> this.title = title;
<add> this.isbn = isbn;
<add> this.price = price;
<add> }
<add>
<add> public Book() {
<add> }
<add>
<add> public String getCategory() {
<add> return category;
<add> }
<add>
<add> public void setCategory(String category) {
<add> this.category = category;
<add> }
<add>
<add> public String getAuthor() {
<add> return author;
<add> }
<add>
<add> public void setAuthor(String author) {
<add> this.author = author;
<add> }
<add>
<add> public String getTitle() {
<add> return title;
<add> }
<add>
<add> public void setTitle(String title) {
<add> this.title = title;
<add> }
<add>
<add> public String getIsbn() {
<add> return isbn;
<add> }
<add>
<add> public void setIsbn(String isbn) {
<add> this.isbn = isbn;
<add> }
<add>
<add> public float getPrice() {
<add> return price;
<add> }
<add>
<add> public void setPrice(float price) {
<add> this.price = price;
<add> }
<add>
<add> @Override
<add> public boolean equals(Object o) {
<add> if (this == o) return true;
<add> if (o == null || getClass() != o.getClass()) return false;
<add>
<add> Book book = (Book) o;
<add>
<add> if (Float.compare(book.price, price) != 0) return false;
<add> if (author != null ? !author.equals(book.author) : book.author != null) return false;
<add> if (category != null ? !category.equals(book.category) : book.category != null) return false;
<add> if (isbn != null ? !isbn.equals(book.isbn) : book.isbn != null) return false;
<add> if (title != null ? !title.equals(book.title) : book.title != null) return false;
<add>
<add> return true;
<add> }
<add>
<add> @Override
<add> public int hashCode() {
<add> int result = category != null ? category.hashCode() : 0;
<add> result = 31 * result + (author != null ? author.hashCode() : 0);
<add> result = 31 * result + (title != null ? title.hashCode() : 0);
<add> result = 31 * result + (isbn != null ? isbn.hashCode() : 0);
<add> result = 31 * result + (price != +0.0f ? Float.floatToIntBits(price) : 0);
<add> return result;
<add> }
<add>} |
|
JavaScript | mit | 694d33eb3f0004dceba62b3f3f47bc124df6ae5c | 0 | udupashreyas/voteamerica.github.io,udupashreyas/voteamerica.github.io,misteranderson/voteamerica.github.io,misteranderson/voteamerica.github.io | $(function(){
var $forms = $('#forms'),
$intro = $('#intro'),
rowTemplate = $('#available-time-row').html(),
supportsHistoryApi = !!(window.history && history.pushState);
var datetimeClasses = [
'.input--date',
'.input--time-start',
'.input--time-end'
];
toggleFormsOnHashChange();
window.onpopstate = toggleFormsOnHashChange;
// Rather than download all of Modernizr, just fake the bits we need:
function checkInputSupport(type) {
var input = document.createElement('input');
input.setAttribute('type',type);
var invalidValue = 'invalid-value';
input.setAttribute('value', invalidValue);
return (input.type === type) && (input.value !== invalidValue);
}
window.Modernizr = {
inputtypes: {
date: checkInputSupport('date'),
time: checkInputSupport('time')
}
};
if (!Modernizr.inputtypes.time) {
$('<link>').appendTo('head').attr({
type: 'text/css',
rel: 'stylesheet',
href: 'styles/time-polyfill.css'
});
$.getScript('scripts/time-polyfill.min.js');
}
if (!Modernizr.inputtypes.date) {
$.getScript('scripts/nodep-date-input-polyfill.dist.js', function(){
$('body').on('click', 'date-input-polyfill', function(){
$('input[type="date"]').trigger('change');
});
});
}
// Initialise form validator
$forms.find('form').validator({
custom: {
start: function($el) {
var endTime = $($el.data('start')).val();
if ($el.val() >= endTime) {
return 'Start time must be before the end time';
}
},
end: function($el) {
var startTime = $($el.data('end')).val();
if ($el.val() <= startTime) {
return 'End time must be after the start time';
}
}
}
});
// Update sibling start/end time validation on change
$forms.on('change', 'input[type="time"]', function(){
var sibling = $(this).data('start') || $(this).data('end');
$(sibling).trigger('input'); // Use a different event to prevent recursive trigger
});
function scrollTo(offset, speed) {
$('html, body').animate({
scrollTop: offset
}, speed || 500);
}
function showForm(target){
$(target).slideDown(200).attr('aria-hidden','false')
.siblings().slideUp(200).attr('aria-hidden','true');
$intro.slideUp(200).attr('aria-hidden','true');
scrollTo(0);
}
function hideForms(){
$forms.children().slideUp(200).attr('aria-hidden','true');
$intro.slideDown(200).attr('aria-hidden','false');
scrollTo(0);
}
function toggleFormsOnHashChange() {
if (document.location.hash.length) {
showForm(document.location.hash);
} else {
hideForms();
}
}
$('#nav-links').on('click', '.scroll', function(e) {
var anchor = $(this).attr('href');
scrollTo($(anchor).offset().top, 999);
e.preventDefault();
});
$intro.on('click', '.show-form', function(e) {
var href = $(this).attr('href');
showForm(href);
if (supportsHistoryApi) {
history.pushState({page: href}, href, href);
} else {
window.location.hash = href;
}
e.preventDefault();
});
$forms.on('click', '.close-form', function(e) {
hideForms();
if (supportsHistoryApi) {
history.pushState({page: 'home'}, 'Home', '/' + window.location.search);
} else {
window.location.hash = '';
}
e.preventDefault();
});
$forms.on('change', '.toggleRequiredEmail', function(){
var id = $(this).attr('data-emailID');
$forms.find(id).prop('required', $(this).is(':checked')).trigger('change');
});
$forms.on('submit', 'form', function() {
updateHiddenJSONTimes( $(this).find('.available-times') );
});
$forms.find('.available-times').each(function() {
var $self = $(this),
type = $self.attr('data-type'),
rowID = 0;
function addRow(hideDeleteButton) {
var $row = $(rowTemplate.replace(/{{type}}/g, type).replace(/{{id}}/g, rowID++));
$row.find('.input--date').attr('min', yyyymmdd());
if (!hideDeleteButton && Modernizr.inputtypes.date) {
var $prevRow = $self.find('.available-times__row').last();
datetimeClasses.forEach(function(c){
var prevVal = $prevRow.find(c).val();
$row.find(c).val(prevVal).trigger('update');
});
}
if (hideDeleteButton) {
$row.find('.remove-time').hide();
}
$self.append($row);
if (!Modernizr.inputtypes.time) {
var $times = $row.find('input[type="time"]').attr('step', 3600);
if ($times.inputTime) {
$times.inputTime();
}
}
$self.parents('form').validator('update');
}
function removeRow($row){
$row.remove();
$self.parents('form').validator('update');
}
function toggleRemoveTimeBtn() {
var rowCount = $self.find('.available-times__row').length;
$self.find('.remove-time').toggle(rowCount > 1);
}
addRow(true);
$self.siblings('.add-time-btn').on('click', function(e) {
addRow();
toggleRemoveTimeBtn();
e.preventDefault();
});
$self.on('click', '.remove-time', function(e) {
removeRow( $(this).parent() );
toggleRemoveTimeBtn();
e.preventDefault();
});
});
function getDateTimeValues($timesList) {
return $timesList.find('.available-times__row').get().map(function(li) {
var inputValues = datetimeClasses.map(function(c) {
return $(li).find(c).val();
});
return formatTime.apply(this, inputValues);
});
}
function updateHiddenJSONTimes($timesList) {
var timeData = getDateTimeValues($timesList);
$timesList.siblings('.hiddenJSONTimes').val(timeData.join('|'));
}
function formatTime(date, startTime, endTime) {
return [startTime, endTime].map(function(time){
return (date || '') + 'T' + (time || '');
}).join('/');
}
function yyyymmdd(date) {
date = date || new Date();
var mm = date.getMonth() + 1;
var dd = date.getDate();
return [
date.getFullYear(),
mm<10 ? '0'+mm : mm,
dd<10 ? '0'+dd : dd
].join('-');
}
// Load JSON data to dropdown template
$.getJSON('scripts/voting-details.json', function(data) {
function getListItems(type) {
return $.map(data, function (val, key) {
return '<li class="state-dropdown__item">' + '<a href="' + val[type] + '" target="_blank" id="' + key + '" >' + val['State'] + '</a>' + '</li>';
}).join('');
}
$("#state-select").html( getListItems('RegCheck') );
$("#location-details").html( getListItems('LocationFinder') );
});
}); | scripts/main.js | $(function(){
var $forms = $('#forms'),
$intro = $('#intro'),
rowTemplate = $('#available-time-row').html(),
supportsHistoryApi = !!(window.history && history.pushState);
var datetimeClasses = [
'.input--date',
'.input--time-start',
'.input--time-end'
];
toggleFormsOnHashChange();
window.onpopstate = toggleFormsOnHashChange;
// Rather than download all of Modernizr, just fake the bits we need:
function checkInputSupport(type) {
var input = document.createElement('input');
input.setAttribute('type',type);
var invalidValue = 'invalid-value';
input.setAttribute('value', invalidValue);
return (input.type === type) && (input.value !== invalidValue);
}
window.Modernizr = {
inputtypes: {
date: checkInputSupport('date'),
time: checkInputSupport('time')
}
};
if (!Modernizr.inputtypes.time) {
$('<link>').appendTo('head').attr({
type: 'text/css',
rel: 'stylesheet',
href: 'styles/time-polyfill.css'
});
$.getScript('scripts/time-polyfill.min.js');
}
if (!Modernizr.inputtypes.date) {
$.getScript('scripts/nodep-date-input-polyfill.dist.js', function(){
$('body').on('click', 'date-input-polyfill', function(){
$('input[type="date"]').trigger('change');
});
});
}
// Initialise form validator
$forms.find('form').validator({
custom: {
start: function($el) {
var endTime = $($el.data('start')).val();
if ($el.val() >= endTime) {
return 'Start time must be before the end time';
}
},
end: function($el) {
var startTime = $($el.data('end')).val();
if ($el.val() <= startTime) {
return 'End time must be after the start time';
}
}
}
});
// Update sibling start/end time validation on change
$forms.on('change', 'input[type="time"]', function(){
var sibling = $(this).data('start') || $(this).data('end');
$(sibling).trigger('input'); // Use a different event to prevent recursive trigger
});
function scrollTo(offset, speed) {
$('html, body').animate({
scrollTop: offset
}, speed || 500);
}
function showForm(target){
$(target).slideDown(200).attr('aria-hidden','false')
.siblings().slideUp(200).attr('aria-hidden','true');
$intro.slideUp(200).attr('aria-hidden','true');
scrollTo(0);
}
function hideForms(){
$forms.children().slideUp(200).attr('aria-hidden','true');
$intro.slideDown(200).attr('aria-hidden','false');
scrollTo(0);
}
function toggleFormsOnHashChange() {
if (document.location.hash.length) {
showForm(document.location.hash);
} else {
hideForms();
}
}
$('#nav-links').on('click', '.scroll', function(e) {
var anchor = $(this).attr('href');
scrollTo($(anchor).offset().top, 999);
e.preventDefault();
});
$intro.on('click', '.show-form', function(e) {
var href = $(this).attr('href');
showForm(href);
if (supportsHistoryApi) {
history.pushState({page: href}, href, href);
} else {
window.location.hash = href;
}
e.preventDefault();
});
$forms.on('click', '.close-form', function(e) {
hideForms();
if (supportsHistoryApi) {
history.pushState({page: 'home'}, 'Home', '/' + window.location.search);
} else {
window.location.hash = '';
}
e.preventDefault();
});
$forms.on('change', '.toggleRequiredEmail', function(){
var id = $(this).attr('data-emailID');
$forms.find(id).prop('required', $(this).is(':checked')).trigger('change');
});
$forms.on('submit', 'form', function() {
updateHiddenJSONTimes( $(this).find('.available-times') );
});
$forms.find('.available-times').each(function() {
var $self = $(this),
type = $self.attr('data-type'),
rowID = 0;
function addRow(hideDeleteButton) {
var $row = $(rowTemplate.replace(/{{type}}/g, type).replace(/{{id}}/g, rowID++));
$row.find('.input--date').attr('min', yyyymmdd());
if (!hideDeleteButton && Modernizr.inputtypes.date) {
var $prevRow = $self.find('.available-times__row').last();
datetimeClasses.forEach(function(c){
var prevVal = $prevRow.find(c).val();
$row.find(c).val(prevVal).trigger('update');
});
}
if (hideDeleteButton) {
$row.find('.remove-time').hide();
}
$self.append($row);
if (!Modernizr.inputtypes.time) {
var $times = $row.find('input[type="time"]').attr('step', 3600);
if ($times.inputTime) {
$times.inputTime();
}
}
$self.parents('form').validator('update');
}
function removeRow($row){
$row.remove();
$self.parents('form').validator('update');
}
function toggleRemoveTimeBtn() {
var rowCount = $self.find('.available-times__row').length;
$self.find('.remove-time').toggle(rowCount > 1);
}
addRow(true);
$self.siblings('.add-time-btn').on('click', function(e) {
addRow();
toggleRemoveTimeBtn();
e.preventDefault();
});
$self.on('click', '.remove-time', function(e) {
removeRow( $(this).parent() );
toggleRemoveTimeBtn();
e.preventDefault();
});
});
function getDateTimeValues($timesList) {
return $timesList.find('.available-times__row').get().map(function(li) {
var inputValues = datetimeClasses.map(function(c) {
return $(li).find(c).val();
});
return formatTime.apply(this, inputValues);
});
}
function updateHiddenJSONTimes($timesList) {
var timeData = getDateTimeValues($timesList);
console.log(timeData);
$timesList.siblings('.hiddenJSONTimes').val(timeData.join('|'));
}
function formatTime(date, startTime, endTime) {
return [startTime, endTime].map(function(time){
return (date || '') + 'T' + (time || '');
}).join('/');
}
function yyyymmdd(date) {
date = date || new Date();
var mm = date.getMonth() + 1;
var dd = date.getDate();
return [
date.getFullYear(),
mm<10 ? '0'+mm : mm,
dd<10 ? '0'+dd : dd
].join('-');
}
// Load JSON data to dropdown template
$.getJSON('scripts/voting-details.json', function(data) {
function getListItems(type) {
return $.map(data, function (val, key) {
return '<li class="state-dropdown__item">' + '<a href="' + val[type] + '" target="_blank" id="' + key + '" >' + val['State'] + '</a>' + '</li>';
}).join('');
}
$("#state-select").html( getListItems('RegCheck') );
$("#location-details").html( getListItems('LocationFinder') );
});
}); | Remove leftover console.log
| scripts/main.js | Remove leftover console.log | <ide><path>cripts/main.js
<ide>
<ide> function updateHiddenJSONTimes($timesList) {
<ide> var timeData = getDateTimeValues($timesList);
<del> console.log(timeData);
<ide> $timesList.siblings('.hiddenJSONTimes').val(timeData.join('|'));
<ide> }
<ide> |
|
Java | epl-1.0 | b0a6fa0bb8cb01cfb52fe499001c1321aeb76fea | 0 | Beagle-PSE/Beagle,Beagle-PSE/Beagle,Beagle-PSE/Beagle | package de.uka.ipd.sdq.beagle.core;
import static de.uka.ipd.sdq.beagle.core.testutil.EqualsMatcher.hasDefaultEqualsProperties;
import static de.uka.ipd.sdq.beagle.core.testutil.ExceptionThrownMatcher.throwsException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;
import de.uka.ipd.sdq.beagle.core.testutil.ThrowingMethod;
import de.uka.ipd.sdq.beagle.core.testutil.factories.CodeSectionFactory;
import org.junit.Test;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Tests {@link SeffBranch} and contains all test cases needed to check every method.
*
* @author Annika Berger
*/
public class SeffBranchTest {
/**
* A {@link CodeSectionFactory}, which is able to generate {@link CodeSection}s.
*/
private static final CodeSectionFactory CODE_SECTION_FACTORY = new CodeSectionFactory();
/**
* Test method for {@link SeffBranch#SeffBranch(java.util.Set)}.
*
* <p>Asserts that an {@link IllegalArgumentException} is thrown when the set of
* {@link CodeSection} does not contain any CodeSections. Asserts that input Set of
* {@link CodeSection} is the same instance as the one returned with
* {@link SeffBranch#getBranches()}. Tests behaviour of Constructor for a set
* containing {@code null} and assures that changing the Set after inizialising a new
* branch does not affect the Branch.
*/
@Test
public void testConstructor() {
final Set<CodeSection> noCodeSections = new HashSet<CodeSection>();
ThrowingMethod method = () -> {
new SeffBranch(noCodeSections);
};
assertThat("Set must not be empty.", method, throwsException(IllegalArgumentException.class));
final Set<CodeSection> codeSections = new HashSet<CodeSection>();
final CodeSection[] codeSecs = CODE_SECTION_FACTORY.getAll();
codeSections.add(codeSecs[0]);
method = () -> {
new SeffBranch(codeSections);
};
assertThat("Set must contain at least two code sections.", method,
throwsException(IllegalArgumentException.class));
codeSections.add(codeSecs[1]);
final SeffBranch branch = new SeffBranch(codeSections);
final int amountBranches = 2;
for (int i = amountBranches; i < codeSecs.length; i++) {
codeSections.add(codeSecs[i]);
}
assertThat(
"Adding code sections after initialisation must not influence number of codesections in seff branch.",
branch.getBranches().size(), is(equalTo(amountBranches)));
codeSections.add(null);
method = () -> {
new SeffBranch(codeSections);
};
assertThat("Set must not contain null.", method, throwsException(IllegalArgumentException.class));
method = () -> {
new SeffBranch(null);
};
assertThat("Set must not be null.", method, throwsException(NullPointerException.class));
}
/**
* Test method for {@link SeffBranch#equals()} and {@link SeffBranch#hashCode()}.
*
* <p>Asserts that two SeffBranches inizialised with a Set containing the same code
* sections are equal while inizialised with Sets containing different code sections
* are different. This test fails if there is only one code section defined in the
* {@link CodeSectionFactory}.
*/
@Test
public void testEqualsAndHashCode() {
assertThat(new SeffBranch(CODE_SECTION_FACTORY.getAllAsSet()), hasDefaultEqualsProperties());
final Set<CodeSection> codeSectionsA = new HashSet<>();
final Set<CodeSection> codeSectionsB = new HashSet<>();
final Set<CodeSection> codeSectionsC = new HashSet<>();
final Set<CodeSection> codeSectionsD = new HashSet<>();
final CodeSection[] codeSecs = CODE_SECTION_FACTORY.getAll();
if (codeSecs.length > 2) {
for (final CodeSection codeSection : codeSecs) {
codeSectionsA.add(codeSection);
codeSectionsB.add(codeSection);
}
codeSectionsC.add(CODE_SECTION_FACTORY.getAll()[0]);
codeSectionsC.add(CODE_SECTION_FACTORY.getAll()[1]);
codeSectionsD.add(CODE_SECTION_FACTORY.getAll()[codeSecs.length - 1]);
codeSectionsD.add(CODE_SECTION_FACTORY.getAll()[codeSecs.length - 2]);
final SeffBranch branchA = new SeffBranch(codeSectionsA);
final SeffBranch branchB = new SeffBranch(codeSectionsB);
final SeffBranch branchC = new SeffBranch(codeSectionsC);
final SeffBranch branchD = new SeffBranch(codeSectionsD);
assertThat(branchB, is(equalTo(branchA)));
assertThat(branchB.hashCode(), is(equalTo(branchA.hashCode())));
assertThat(branchC, is(not(equalTo(branchA))));
assertThat(branchD, is(not(equalTo(branchC))));
} else {
fail("There have to be minimum three CodeSections in the CodeSectionFactory to test this method properly.");
}
}
/**
* Test method for {@link SeffBranch#getBranches()}.
*/
@Test
public void testGetBranches() {
final Set<CodeSection> codeSections = CODE_SECTION_FACTORY.getAllAsSet();
final SeffBranch branch = new SeffBranch(codeSections);
assertThat(branch.getBranches(), is(equalTo(codeSections)));
// make sure branches are a copy.
final List<CodeSection> branches = branch.getBranches();
branches.add(CODE_SECTION_FACTORY.getOne());
assertThat("List returned must be a copy.", branch.getBranches(), is(equalTo(codeSections)));
}
/**
* Test method for {@link SeffBranch#toString()}.
*/
@Test
public void testToString() {
final Set<CodeSection> codeSections = CODE_SECTION_FACTORY.getAllAsSet();
final SeffBranch branch = new SeffBranch(codeSections);
assertThat(branch.toString(), not(startsWith("SeffBranch@")));
}
}
| Core/src/test/java/de/uka/ipd/sdq/beagle/core/SeffBranchTest.java | package de.uka.ipd.sdq.beagle.core;
import static de.uka.ipd.sdq.beagle.core.testutil.EqualsMatcher.hasDefaultEqualsProperties;
import static de.uka.ipd.sdq.beagle.core.testutil.ExceptionThrownMatcher.throwsException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;
import de.uka.ipd.sdq.beagle.core.testutil.ThrowingMethod;
import de.uka.ipd.sdq.beagle.core.testutil.factories.CodeSectionFactory;
import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
/**
* Tests {@link SeffBranch} and contains all test cases needed to check every method.
*
* @author Annika Berger
*/
public class SeffBranchTest {
/**
* A {@link CodeSectionFactory}, which is able to generate {@link CodeSection}s.
*/
private static final CodeSectionFactory CODE_SECTION_FACTORY = new CodeSectionFactory();
/**
* Test method for {@link SeffBranch#SeffBranch(java.util.Set)}.
*
* <p>Asserts that an {@link IllegalArgumentException} is thrown when the set of
* {@link CodeSection} does not contain any CodeSections. Asserts that input Set of
* {@link CodeSection} is the same instance as the one returned with
* {@link SeffBranch#getBranches()}. Tests behaviour of Constructor for a set
* containing {@code null} and assures that changing the Set after inizialising a new
* branch does not affect the Branch.
*/
@Test
public void testConstructor() {
final Set<CodeSection> noCodeSections = new HashSet<CodeSection>();
ThrowingMethod method = () -> {
new SeffBranch(noCodeSections);
};
assertThat("Set must not be empty.", method, throwsException(IllegalArgumentException.class));
final Set<CodeSection> codeSections = new HashSet<CodeSection>();
final CodeSection[] codeSecs = CODE_SECTION_FACTORY.getAll();
codeSections.add(codeSecs[0]);
method = () -> {
new SeffBranch(codeSections);
};
assertThat("Set must contain at least two code sections.", method,
throwsException(IllegalArgumentException.class));
codeSections.add(codeSecs[1]);
final SeffBranch branch = new SeffBranch(codeSections);
final int amountBranches = 2;
for (int i = amountBranches; i < codeSecs.length; i++) {
codeSections.add(codeSecs[i]);
}
assertThat(
"Adding code sections after initialisation must not influence number of codesections in seff branch.",
branch.getBranches().size(), is(equalTo(amountBranches)));
codeSections.add(null);
method = () -> {
new SeffBranch(codeSections);
};
assertThat("Set must not contain null.", method, throwsException(IllegalArgumentException.class));
method = () -> {
new SeffBranch(null);
};
assertThat("Set must not be null.", method, throwsException(NullPointerException.class));
}
/**
* Test method for {@link SeffBranch#equals()} and {@link SeffBranch#hashCode()}.
*
* <p>Asserts that two SeffBranches inizialised with a Set containing the same code
* sections are equal while inizialised with Sets containing different code sections
* are different. This test fails if there is only one code section defined in the
* {@link CodeSectionFactory}.
*/
@Test
public void testEqualsAndHashCode() {
assertThat(new SeffBranch(CODE_SECTION_FACTORY.getAllAsSet()), hasDefaultEqualsProperties());
final Set<CodeSection> codeSectionsA = new HashSet<>();
final Set<CodeSection> codeSectionsB = new HashSet<>();
final Set<CodeSection> codeSectionsC = new HashSet<>();
final Set<CodeSection> codeSectionsD = new HashSet<>();
final CodeSection[] codeSecs = CODE_SECTION_FACTORY.getAll();
if (codeSecs.length > 2) {
for (final CodeSection codeSection : codeSecs) {
codeSectionsA.add(codeSection);
codeSectionsB.add(codeSection);
}
codeSectionsC.add(CODE_SECTION_FACTORY.getAll()[0]);
codeSectionsC.add(CODE_SECTION_FACTORY.getAll()[1]);
codeSectionsD.add(CODE_SECTION_FACTORY.getAll()[codeSecs.length - 1]);
codeSectionsD.add(CODE_SECTION_FACTORY.getAll()[codeSecs.length - 2]);
final SeffBranch branchA = new SeffBranch(codeSectionsA);
final SeffBranch branchB = new SeffBranch(codeSectionsB);
final SeffBranch branchC = new SeffBranch(codeSectionsC);
final SeffBranch branchD = new SeffBranch(codeSectionsD);
assertThat(branchB, is(equalTo(branchA)));
assertThat(branchB.hashCode(), is(equalTo(branchA.hashCode())));
assertThat(branchC, is(not(equalTo(branchA))));
assertThat(branchD, is(not(equalTo(branchC))));
} else {
fail("There have to be minimum three CodeSections in the CodeSectionFactory to test this method properly.");
}
}
/**
* Test method for {@link SeffBranch#getBranches()}.
*/
@Test
public void testGetBranches() {
final Set<CodeSection> codeSections = CODE_SECTION_FACTORY.getAllAsSet();
final SeffBranch branch = new SeffBranch(codeSections);
assertThat(branch.getBranches(), is(equalTo(codeSections)));
// make sure branches are a copy.
final List<CodeSection> branches = branch.getBranches();
branches.add(CODE_SECTION_FACTORY.getOne());
assertThat("List returned must be a copy.", branch.getBranches(), is(equalTo(codeSections)));
}
/**
* Test method for {@link SeffBranch#toString()}.
*/
@Test
public void testToString() {
final Set<CodeSection> codeSections = CODE_SECTION_FACTORY.getAllAsSet();
final SeffBranch branch = new SeffBranch(codeSections);
assertThat(branch.toString(), not(startsWith("SeffBranch@")));
}
}
| fixed test
| Core/src/test/java/de/uka/ipd/sdq/beagle/core/SeffBranchTest.java | fixed test | <ide><path>ore/src/test/java/de/uka/ipd/sdq/beagle/core/SeffBranchTest.java
<ide> import org.junit.Test;
<ide>
<ide> import java.util.HashSet;
<add>import java.util.List;
<ide> import java.util.Set;
<ide>
<ide> /** |
|
Java | apache-2.0 | dc54c8594acc972ad92471912028496f60d3e4a3 | 0 | swift-lang/swift-k,ya7lelkom/swift-k,ya7lelkom/swift-k,ya7lelkom/swift-k,ya7lelkom/swift-k,ya7lelkom/swift-k,swift-lang/swift-k,swift-lang/swift-k,ya7lelkom/swift-k,swift-lang/swift-k,ya7lelkom/swift-k,swift-lang/swift-k,ya7lelkom/swift-k,ya7lelkom/swift-k,swift-lang/swift-k,swift-lang/swift-k,swift-lang/swift-k,ya7lelkom/swift-k,swift-lang/swift-k,swift-lang/swift-k | /*
* Copyright 2012 University of Chicago
*
* 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.
*/
/*
* Created on Jan 29, 2007
*/
package org.griphyn.vdl.karajan.monitor.monitors.http;
import java.io.IOException;
import org.apache.log4j.Logger;
import org.griphyn.vdl.karajan.monitor.SystemState;
import org.griphyn.vdl.karajan.monitor.SystemStateListener;
import org.griphyn.vdl.karajan.monitor.common.DataSampler;
import org.griphyn.vdl.karajan.monitor.items.StatefulItem;
import org.griphyn.vdl.karajan.monitor.monitors.AbstractMonitor;
public class HTTPMonitor extends AbstractMonitor {
public static final Logger logger = Logger.getLogger(HTTPMonitor.class);
public static final int DEFAULT_PORT = 3030;
private int port = DEFAULT_PORT;
private String password;
private HTTPServer server;
public HTTPMonitor() {
}
@Override
public void start() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
// sleep 2 seconds before shutting down to allow monitor to get
// latest data
Thread.sleep(2000);
}
catch (Exception e) {
//ignored
}
}
});
}
@Override
public void setState(SystemState state) {
DataSampler.install(state);
super.setState(state);
server = new HTTPServer(port, password, getState());
try {
server.start();
System.out.println("HTTP montior URL: " + server.getURL());
}
catch (IOException e) {
logger.warn("Failed to start HTTP monitor server", e);
}
}
public void itemUpdated(SystemStateListener.UpdateType updateType, StatefulItem item) {
}
public void shutdown() {
}
@Override
public void setParams(String params) {
if (params.contains("@")) {
int index = params.lastIndexOf('@');
password = params.substring(0, index);
port = Integer.parseInt(params.substring(index + 1));
}
else {
port = Integer.parseInt(params);
}
if (port < 0) {
throw new IllegalArgumentException("Negative port number!");
}
else if (port > 65535) {
throw new IllegalArgumentException("Port number larger than 65535");
}
}
}
| src/org/griphyn/vdl/karajan/monitor/monitors/http/HTTPMonitor.java | /*
* Copyright 2012 University of Chicago
*
* 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.
*/
/*
* Created on Jan 29, 2007
*/
package org.griphyn.vdl.karajan.monitor.monitors.http;
import java.io.IOException;
import org.apache.log4j.Logger;
import org.griphyn.vdl.karajan.monitor.SystemState;
import org.griphyn.vdl.karajan.monitor.SystemStateListener;
import org.griphyn.vdl.karajan.monitor.common.DataSampler;
import org.griphyn.vdl.karajan.monitor.items.StatefulItem;
import org.griphyn.vdl.karajan.monitor.monitors.AbstractMonitor;
public class HTTPMonitor extends AbstractMonitor {
public static final Logger logger = Logger.getLogger(HTTPMonitor.class);
public static final int DEFAULT_PORT = 3030;
private int port = DEFAULT_PORT;
private String password;
private HTTPServer server;
public HTTPMonitor() {
}
@Override
public void start() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
// sleep 2 seconds before shutting down to allow monitor to get
// latest data
Thread.sleep(2000);
}
catch (Exception e) {
//ignored
}
}
});
}
@Override
public void setState(SystemState state) {
DataSampler.install(state);
super.setState(state);
server = new HTTPServer(port, password, getState());
try {
server.start();
}
catch (IOException e) {
logger.warn("Failed to start HTTP monitor server", e);
}
}
public void itemUpdated(SystemStateListener.UpdateType updateType, StatefulItem item) {
}
public void shutdown() {
}
@Override
public void setParams(String params) {
if (params.contains("@")) {
int index = params.lastIndexOf('@');
password = params.substring(0, index);
port = Integer.parseInt(params.substring(index + 1));
}
else {
port = Integer.parseInt(params);
}
if (port < 0) {
throw new IllegalArgumentException("Negative port number!");
}
else if (port > 65535) {
throw new IllegalArgumentException("Port number larger than 65535");
}
}
}
| Print monitor URL on the console.
| src/org/griphyn/vdl/karajan/monitor/monitors/http/HTTPMonitor.java | Print monitor URL on the console. | <ide><path>rc/org/griphyn/vdl/karajan/monitor/monitors/http/HTTPMonitor.java
<ide> server = new HTTPServer(port, password, getState());
<ide> try {
<ide> server.start();
<add> System.out.println("HTTP montior URL: " + server.getURL());
<ide> }
<ide> catch (IOException e) {
<ide> logger.warn("Failed to start HTTP monitor server", e); |
|
Java | bsd-3-clause | 13b513ddb4fe0e196051790d70b56b63693f8484 | 0 | krishagni/openspecimen,krishagni/openspecimen,krishagni/openspecimen,asamgir/openspecimen,asamgir/openspecimen,asamgir/openspecimen | /**
* <p>Title: ConflictViewAction Class>
* <p>Description: Initialization action for conflict view
* Copyright: Copyright (c) year
* Company: Washington University, School of Medicine, St. Louis.
* @version 1.00
* @author kalpana Thakur
* Created on sep 18,2007
*/
package edu.wustl.catissuecore.action;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import edu.wustl.catissuecore.actionForm.ConflictViewForm;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.global.Utility;
import edu.wustl.common.action.SecureAction;
import edu.wustl.common.beans.NameValueBean;
import edu.wustl.common.beans.SessionDataBean;
import edu.wustl.common.dao.QuerySessionData;
import edu.wustl.common.dao.queryExecutor.PagenatedResultData;
import edu.wustl.common.util.XMLPropertyHandler;
public class ConflictViewAction extends SecureAction
{
/**
* Overrides the execute method of Action class.
* Initializes the various fields in ConflictView.jsp Page.
* @param mapping object
* @param form object
* @param request object
* @param response object
* @return ActionForward object
* @throws Exception object
* */
protected ActionForward executeSecureAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
ConflictViewForm conflictViewForm = (ConflictViewForm) form;
int selectedFilter = Integer.parseInt(conflictViewForm.getSelectedFilter());
// Added by Ravindra to disallow Non Super Admin users to view Conflicting Reports
SessionDataBean sessionDataBean = (SessionDataBean) request.getSession().getAttribute(Constants.SESSION_DATA);
if(!sessionDataBean.isAdmin())
{
ActionErrors errors = new ActionErrors();
ActionError error = new ActionError("access.execute.action.denied");
errors.add(ActionErrors.GLOBAL_ERROR, error);
saveErrors(request, errors);
return mapping.findForward(Constants.ACCESS_DENIED);
}
String[] retrieveFilterList = Constants.CONFLICT_FILTER_LIST;
List filterList = new ArrayList();
for(int i=0;i<retrieveFilterList.length;i++)
{
filterList.add(0,new NameValueBean(retrieveFilterList[i], i));
}
Collections.sort(filterList);
//Setting the list in request
request.getSession().setAttribute(Constants.FILTER_LIST, filterList);
//Returns the page number to be shown.
int pageNum = Integer.parseInt(request.getParameter(Constants.PAGE_NUMBER));
//Gets the session of this request.
HttpSession session = request.getSession();
//The start index in the list of users to be approved/rejected.
int startIndex = Constants.ZERO;
String sqlString="";
if (selectedFilter==0)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME ,REPORT_COLLECTION_DATE from catissue_report_queue where status='PARTICIPANT_CONFLICT' or status='SCG_PARTIAL_CONFLICT' or status='SCG_CONFLICT'";
}
else
{ //retrieving only the participant conflicts
if (selectedFilter==1)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME,REPORT_COLLECTION_DATE from catissue_report_queue where status='PARTICIPANT_CONFLICT'";
}
else
{ //retrieving all the scg conflicts both partial and exact match
if (selectedFilter==2)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME,REPORT_COLLECTION_DATE from catissue_report_queue where status='SCG_PARTIAL_CONFLICT' or status='SCG_CONFLICT'";
}
}
}
int recordsPerPage;
String recordsPerPageSessionValue = (String)session.getAttribute(Constants.RESULTS_PER_PAGE);
if (recordsPerPageSessionValue==null)
{
recordsPerPage = Integer.parseInt(XMLPropertyHandler.getValue(Constants.RECORDS_PER_PAGE_PROPERTY_NAME));
session.setAttribute(Constants.RESULTS_PER_PAGE, recordsPerPage+"");
}
else
recordsPerPage = new Integer(recordsPerPageSessionValue).intValue();
PagenatedResultData pagenatedResultData=null;
pagenatedResultData = Utility.executeForPagination(sqlString,getSessionData(request), false, null, false,0,recordsPerPage);
QuerySessionData querySessionData = new QuerySessionData();
querySessionData.setSql(sqlString);
querySessionData.setQueryResultObjectDataMap(null);
querySessionData.setSecureExecute(false);
querySessionData.setHasConditionOnIdentifiedField(false);
querySessionData.setRecordsPerPage(recordsPerPage);
querySessionData.setTotalNumberOfRecords(pagenatedResultData.getTotalRecords());
session.setAttribute(Constants.QUERY_SESSION_DATA, querySessionData);
String[] retrieveColumnList = Constants.CONFLICT_LIST_HEADER;
List columnList = new ArrayList();
for(int i=0;i<retrieveColumnList.length;i++)
{
columnList.add(retrieveColumnList[i]);
}
// List of results the query will return on execution.
List list = pagenatedResultData.getResult();
//request.setAttribute(Constants.SPREADSHEET_DATA_LIST, list);
//request.setAttribute(Constants.SPREADSHEET_COLUMN_LIST, columnNames);
//Saves the page number in the request.
request.setAttribute(Constants.PAGE_NUMBER,Integer.toString(pageNum));
//Saves the total number of results in the request.
session.setAttribute(Constants.TOTAL_RESULTS,Integer.toString(pagenatedResultData.getTotalRecords()));
session.setAttribute(Constants.RESULTS_PER_PAGE,recordsPerPage+"");
List dataList = makeGridData(list);
Utility.setGridData( dataList,columnList, request);
Integer identifierFieldIndex = new Integer(1);
request.setAttribute("identifierFieldIndex", identifierFieldIndex.intValue());
request.setAttribute("pageOf", "pageOfConflictResolver");
request.getSession().setAttribute(Constants.SELECTED_FILTER, Integer.toString(selectedFilter));
request.setAttribute(Constants.PAGINATION_DATA_LIST, dataList);
request.getSession().setAttribute(Constants.SPREADSHEET_COLUMN_LIST, columnList);
return mapping.findForward(Constants.SUCCESS);
}
/**
* To prepare the grid to display on conflictView.jsp
* @param reportQueueDataList
* @param selectedFilter
* @return
*/
private List makeGridData(List reportQueueDataList)
{
Iterator iter = reportQueueDataList.iterator();
List gridData = new ArrayList();
while(iter.hasNext())
{
List rowData = new ArrayList();
List reportDataList = new ArrayList();
reportDataList = (ArrayList) iter.next();
rowData.add((String) reportDataList.get(0));
rowData.add((String) reportDataList.get(1));
rowData.add((String) reportDataList.get(2));
rowData.add((String) reportDataList.get(3));
rowData.add((String) reportDataList.get(4));
rowData.add((String) reportDataList.get(5));
rowData.add((String) reportDataList.get(6));
gridData.add(rowData);
}
return gridData;
}
}
| WEB-INF/src/edu/wustl/catissuecore/action/ConflictViewAction.java | /**
* <p>Title: ConflictViewAction Class>
* <p>Description: Initialization action for conflict view
* Copyright: Copyright (c) year
* Company: Washington University, School of Medicine, St. Louis.
* @version 1.00
* @author kalpana Thakur
* Created on sep 18,2007
*/
package edu.wustl.catissuecore.action;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import edu.wustl.catissuecore.actionForm.ConflictViewForm;
import edu.wustl.catissuecore.util.global.Constants;
import edu.wustl.catissuecore.util.global.Utility;
import edu.wustl.common.action.SecureAction;
import edu.wustl.common.beans.NameValueBean;
import edu.wustl.common.dao.QuerySessionData;
import edu.wustl.common.dao.queryExecutor.PagenatedResultData;
import edu.wustl.common.util.XMLPropertyHandler;
public class ConflictViewAction extends SecureAction
{
/**
* Overrides the execute method of Action class.
* Initializes the various fields in ConflictView.jsp Page.
* @param mapping object
* @param form object
* @param request object
* @param response object
* @return ActionForward object
* @throws Exception object
* */
protected ActionForward executeSecureAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
ConflictViewForm conflictViewForm = (ConflictViewForm) form;
int selectedFilter = Integer.parseInt(conflictViewForm.getSelectedFilter());
String[] retrieveFilterList = Constants.CONFLICT_FILTER_LIST;
List filterList = new ArrayList();
for(int i=0;i<retrieveFilterList.length;i++)
{
filterList.add(0,new NameValueBean(retrieveFilterList[i], i));
}
Collections.sort(filterList);
//Setting the list in request
request.getSession().setAttribute(Constants.FILTER_LIST, filterList);
//Returns the page number to be shown.
int pageNum = Integer.parseInt(request.getParameter(Constants.PAGE_NUMBER));
//Gets the session of this request.
HttpSession session = request.getSession();
//The start index in the list of users to be approved/rejected.
int startIndex = Constants.ZERO;
String sqlString="";
if (selectedFilter==0)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME ,REPORT_COLLECTION_DATE from catissue_report_queue where status='PARTICIPANT_CONFLICT' or status='SCG_PARTIAL_CONFLICT' or status='SCG_CONFLICT'";
}
else
{ //retrieving only the participant conflicts
if (selectedFilter==1)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME,REPORT_COLLECTION_DATE from catissue_report_queue where status='PARTICIPANT_CONFLICT'";
}
else
{ //retrieving all the scg conflicts both partial and exact match
if (selectedFilter==2)
{
sqlString="select PARTICIPANT_NAME ,IDENTIFIER ,SURGICAL_PATHOLOGY_NUMBER,REPORT_LOADED_DATE,STATUS ,SITE_NAME,REPORT_COLLECTION_DATE from catissue_report_queue where status='SCG_PARTIAL_CONFLICT' or status='SCG_CONFLICT'";
}
}
}
int recordsPerPage;
String recordsPerPageSessionValue = (String)session.getAttribute(Constants.RESULTS_PER_PAGE);
if (recordsPerPageSessionValue==null)
{
recordsPerPage = Integer.parseInt(XMLPropertyHandler.getValue(Constants.RECORDS_PER_PAGE_PROPERTY_NAME));
session.setAttribute(Constants.RESULTS_PER_PAGE, recordsPerPage+"");
}
else
recordsPerPage = new Integer(recordsPerPageSessionValue).intValue();
PagenatedResultData pagenatedResultData=null;
pagenatedResultData = Utility.executeForPagination(sqlString,getSessionData(request), false, null, false,0,recordsPerPage);
QuerySessionData querySessionData = new QuerySessionData();
querySessionData.setSql(sqlString);
querySessionData.setQueryResultObjectDataMap(null);
querySessionData.setSecureExecute(false);
querySessionData.setHasConditionOnIdentifiedField(false);
querySessionData.setRecordsPerPage(recordsPerPage);
querySessionData.setTotalNumberOfRecords(pagenatedResultData.getTotalRecords());
session.setAttribute(Constants.QUERY_SESSION_DATA, querySessionData);
String[] retrieveColumnList = Constants.CONFLICT_LIST_HEADER;
List columnList = new ArrayList();
for(int i=0;i<retrieveColumnList.length;i++)
{
columnList.add(retrieveColumnList[i]);
}
// List of results the query will return on execution.
List list = pagenatedResultData.getResult();
//request.setAttribute(Constants.SPREADSHEET_DATA_LIST, list);
//request.setAttribute(Constants.SPREADSHEET_COLUMN_LIST, columnNames);
//Saves the page number in the request.
request.setAttribute(Constants.PAGE_NUMBER,Integer.toString(pageNum));
//Saves the total number of results in the request.
session.setAttribute(Constants.TOTAL_RESULTS,Integer.toString(pagenatedResultData.getTotalRecords()));
session.setAttribute(Constants.RESULTS_PER_PAGE,recordsPerPage+"");
List dataList = makeGridData(list);
Utility.setGridData( dataList,columnList, request);
Integer identifierFieldIndex = new Integer(1);
request.setAttribute("identifierFieldIndex", identifierFieldIndex.intValue());
request.setAttribute("pageOf", "pageOfConflictResolver");
request.getSession().setAttribute(Constants.SELECTED_FILTER, Integer.toString(selectedFilter));
request.setAttribute(Constants.PAGINATION_DATA_LIST, dataList);
request.getSession().setAttribute(Constants.SPREADSHEET_COLUMN_LIST, columnList);
return mapping.findForward(Constants.SUCCESS);
}
/**
* To prepare the grid to display on conflictView.jsp
* @param reportQueueDataList
* @param selectedFilter
* @return
*/
private List makeGridData(List reportQueueDataList)
{
Iterator iter = reportQueueDataList.iterator();
List gridData = new ArrayList();
while(iter.hasNext())
{
List rowData = new ArrayList();
List reportDataList = new ArrayList();
reportDataList = (ArrayList) iter.next();
rowData.add((String) reportDataList.get(0));
rowData.add((String) reportDataList.get(1));
rowData.add((String) reportDataList.get(2));
rowData.add((String) reportDataList.get(3));
rowData.add((String) reportDataList.get(4));
rowData.add((String) reportDataList.get(5));
rowData.add((String) reportDataList.get(6));
gridData.add(rowData);
}
return gridData;
}
}
| added code to disallow Non Super Admin users to view Conflicting Reports
SVN-Revision: 15132
| WEB-INF/src/edu/wustl/catissuecore/action/ConflictViewAction.java | added code to disallow Non Super Admin users to view Conflicting Reports | <ide><path>EB-INF/src/edu/wustl/catissuecore/action/ConflictViewAction.java
<ide> import javax.servlet.http.HttpServletResponse;
<ide> import javax.servlet.http.HttpSession;
<ide>
<add>import org.apache.struts.action.ActionError;
<add>import org.apache.struts.action.ActionErrors;
<ide> import org.apache.struts.action.ActionForm;
<ide> import org.apache.struts.action.ActionForward;
<ide> import org.apache.struts.action.ActionMapping;
<ide> import edu.wustl.catissuecore.util.global.Utility;
<ide> import edu.wustl.common.action.SecureAction;
<ide> import edu.wustl.common.beans.NameValueBean;
<add>import edu.wustl.common.beans.SessionDataBean;
<ide> import edu.wustl.common.dao.QuerySessionData;
<ide> import edu.wustl.common.dao.queryExecutor.PagenatedResultData;
<ide> import edu.wustl.common.util.XMLPropertyHandler;
<ide> ConflictViewForm conflictViewForm = (ConflictViewForm) form;
<ide> int selectedFilter = Integer.parseInt(conflictViewForm.getSelectedFilter());
<ide>
<add> // Added by Ravindra to disallow Non Super Admin users to view Conflicting Reports
<add> SessionDataBean sessionDataBean = (SessionDataBean) request.getSession().getAttribute(Constants.SESSION_DATA);
<add> if(!sessionDataBean.isAdmin())
<add> {
<add> ActionErrors errors = new ActionErrors();
<add> ActionError error = new ActionError("access.execute.action.denied");
<add> errors.add(ActionErrors.GLOBAL_ERROR, error);
<add> saveErrors(request, errors);
<add>
<add> return mapping.findForward(Constants.ACCESS_DENIED);
<add> }
<ide> String[] retrieveFilterList = Constants.CONFLICT_FILTER_LIST;
<ide> List filterList = new ArrayList();
<ide> for(int i=0;i<retrieveFilterList.length;i++) |
|
Java | agpl-3.0 | 1e04850a1409845c1a2ea412f5509e417c6f971e | 0 | rroart/stockstat,rroart/stockstat,rroart/stockstat,rroart/stockstat,rroart/stockstat,rroart/stockstat,rroart/stockstat | package roart.component;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.Period;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Map.Entry;
import java.util.OptionalDouble;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import roart.action.MarketAction;
import roart.common.config.ConfigConstants;
import roart.common.constants.Constants;
import roart.common.model.MetaItem;
import roart.common.pipeline.PipelineConstants;
import roart.common.util.JsonUtil;
import roart.common.util.MathUtil;
import roart.common.util.MetaUtil;
import roart.common.util.TimeUtil;
import roart.common.util.ValidateUtil;
import roart.component.adviser.AboveBelowAdviser;
import roart.component.adviser.Adviser;
import roart.component.adviser.AdviserFactory;
import roart.component.model.ComponentData;
import roart.component.model.SimulateInvestData;
import roart.constants.IclijConstants;
import roart.db.IclijDbDao;
import roart.evolution.chromosome.impl.ConfigMapChromosome2;
import roart.evolution.chromosome.winner.IclijConfigMapChromosomeWinner;
import roart.evolution.config.EvolutionConfig;
import roart.evolution.iclijconfigmap.genetics.gene.impl.IclijConfigMapChromosome;
import roart.evolution.iclijconfigmap.genetics.gene.impl.IclijConfigMapGene;
import roart.iclij.config.IclijConfig;
import roart.iclij.config.IclijConfigConstants;
import roart.iclij.config.MLConfigs;
import roart.iclij.config.Market;
import roart.iclij.config.SimulateInvestConfig;
import roart.iclij.evolution.fitness.impl.FitnessIclijConfigMap;
import roart.iclij.filter.Memories;
import roart.iclij.model.IncDecItem;
import roart.iclij.model.MLMetricsItem;
import roart.iclij.model.MemoryItem;
import roart.iclij.model.Parameters;
import roart.iclij.model.Trend;
import roart.iclij.verifyprofit.TrendUtil;
import roart.service.model.ProfitData;
public class SimulateInvestComponent extends ComponentML {
@Override
public void enable(Map<String, Object> valueMap) {
}
@Override
public void disable(Map<String, Object> valueMap) {
}
@Override
public ComponentData handle(MarketAction action, Market market, ComponentData param, ProfitData profitdata,
Memories positions, boolean evolve, Map<String, Object> aMap, String subcomponent, String mlmarket,
Parameters parameters) {
ComponentData componentData = new ComponentData(param);
SimulateInvestData simulateParam;
if (param instanceof SimulateInvestData) {
simulateParam = (SimulateInvestData) param;
} else {
simulateParam = new SimulateInvestData(param);
}
IclijConfig config = param.getInput().getConfig();
int beatavg = 0;
int runs = 0;
SimulateInvestConfig simConfig = getSimConfig(config);
int extradelay = 0;
//Integer overrideAdviser = null;
if (!(param instanceof SimulateInvestData)) {
SimulateInvestConfig localSimConfig = market.getSimulate();
simConfig.merge(localSimConfig);
if (simConfig.getExtradelay() != null) {
extradelay = simConfig.getExtradelay();
}
} else {
/*
if (simulateParam.getConfig() != null) {
overrideAdviser = simulateParam.getConfig().getAdviser();
simConfig.merge(simulateParam.getConfig());
}
*/
/*
if (!simulateParam.getInput().getValuemap().isEmpty()) {
overrideAdviser = simulateParam.getConfig().getAdviser();
simConfig.merge(simulateParam.getConfig());
}
*/
SimulateInvestConfig localSimConfig = market.getSimulate();
if (localSimConfig != null && localSimConfig.getVolumelimits() != null) {
simConfig.setVolumelimits(localSimConfig.getVolumelimits());
}
if (localSimConfig != null && localSimConfig.getExtradelay() != null) {
extradelay = localSimConfig.getExtradelay();
}
}
List<String> stockDates;
if (simulateParam.getStockDates() != null) {
stockDates = simulateParam.getStockDates();
} else {
stockDates = param.getService().getDates(market.getConfig().getMarket());
}
int interval = simConfig.getInterval();
//ComponentData componentData = component.improve2(action, param, market, profitdata, null, buy, subcomponent, parameters, mlTests);
Map<String, List<List<Double>>> categoryValueMap;
if (simConfig.getInterpolate()) {
categoryValueMap = param.getFillCategoryValueMap();
} else {
categoryValueMap = param.getCategoryValueMap();
}
Map<String, List<List<Object>>> volumeMap = param.getVolumeMap();
LocalDate investStart = null;
LocalDate investEnd = param.getFutureDate();
String mldate = null;
if (simConfig.getMldate()) {
mldate = market.getConfig().getMldate();
if (mldate != null) {
mldate = mldate.replace('-', '.');
}
//mldate = ((SimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
//mldate = ((ImproveSimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
} else {
Short populate = market.getConfig().getPopulate();
if (populate == null) {
//mldate = ((SimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
mldate = market.getConfig().getMldate();
if (mldate != null) {
mldate = mldate.replace('-', '.');
}
} else {
mldate = stockDates.get(populate);
}
}
if (mldate == null) {
mldate = stockDates.get(0);
}
if (simConfig.getStartdate() != null) {
mldate = simConfig.getStartdate();
mldate = mldate.replace('-', '.');
}
try {
investStart = TimeUtil.convertDate(mldate);
} catch (ParseException e1) {
log.error(Constants.EXCEPTION, e1);
}
try {
String enddate = simConfig.getEnddate();
if (enddate != null) {
enddate = enddate.replace('-', '.');
investEnd = TimeUtil.convertDate(enddate);
}
} catch (ParseException e1) {
log.error(Constants.EXCEPTION, e1);
}
Integer origAdviserId = (Integer) param.getInput().getValuemap().get(IclijConfigConstants.SIMULATEINVESTADVISER);
int adviserId = simConfig.getAdviser();
Adviser adviser = new AdviserFactory().get(adviserId, market, investStart, investEnd, param, simConfig);
String[] excludes = null;
if (market.getSimulate() != null) {
excludes = market.getSimulate().getExcludes();
}
if (excludes == null) {
excludes = new String[0];
}
List<String> configExcludeList = Arrays.asList(excludes);
Map<String, List<List<Double>>> filteredCategoryValueMap = new HashMap<>(categoryValueMap);
filteredCategoryValueMap.keySet().removeAll(configExcludeList);
boolean intervalwhole = config.wantsSimulateInvestIntervalWhole();
int end = 1;
if (intervalwhole) {
end = simConfig.getInterval();
}
List<String> parametersList = adviser.getParameters();
if (parametersList.isEmpty()) {
parametersList.add(null);
}
List<Double> scores = new ArrayList<>();
for (String aParameter : parametersList) {
Parameters realParameters = JsonUtil.convert(aParameter, Parameters.class);
if (realParameters != null && realParameters.getThreshold() != 1.0) {
continue;
}
int delay = simConfig.getDelay();
int totalDelays = extradelay + delay;
investEnd = TimeUtil.getBackEqualBefore2(investEnd, 0 /* findTime */, stockDates);
if (investEnd != null) {
String aDate = TimeUtil.convertDate2(investEnd);
if (aDate != null) {
int idx = stockDates.indexOf(aDate) - totalDelays;
if (idx >=0 ) {
aDate = stockDates.get(idx);
try {
investEnd = TimeUtil.convertDate(aDate);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
}
}
}
long time0 = System.currentTimeMillis();
AboveBelowAdviser.time1 = 0;
AboveBelowAdviser.time2 = 0;
long time3 = 0;
long time4 = 0;
for (int offset = 0; offset < end; offset++) {
Capital capital = new Capital();
capital.amount = 1;
List<Astock> mystocks = new ArrayList<>();
List<Astock> stockhistory = new ArrayList<>();
List<String> sumHistory = new ArrayList<>();
List<String> plotDates = new ArrayList<>();
List<Double> plotCapital = new ArrayList<>();
List<Double> plotDefault = new ArrayList<>();
double resultavg = 1;
int findTimes = simConfig.getConfidenceFindTimes();
Pair<Integer, Integer>[] hits = new ImmutablePair[findTimes];
Integer[] trendInc = new Integer[] { 0 };
Integer[] trendDec = new Integer[] { 0 };
Pair<Integer, Integer> trendIncDec = new ImmutablePair<>(0, 0);
int prevIndexOffset = 0;
//try {
LocalDate date = investStart;
date = TimeUtil.getEqualBefore(stockDates, date);
if (date == null) {
try {
date = TimeUtil.convertDate(stockDates.get(0));
} catch (ParseException e) {
log.error(Constants.ERROR, e);
}
}
date = TimeUtil.getForwardEqualAfter2(date, offset, stockDates);
/*
} catch (Exception e) {
log.error(Constants.ERROR, e);
date = null;
}
*/
int indexOffset = totalDelays;
while (date != null && investEnd != null && !date.isAfter(investEnd)) {
date = TimeUtil.getForwardEqualAfter2(date, 0 /* findTime */, stockDates);
String datestring = TimeUtil.convertDate2(date);
indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
Trend trend = getTrendIncDec(market, param, stockDates, interval, filteredCategoryValueMap, trendInc, trendDec, indexOffset);
// get recommendations
List<String> myExcludes = getExclusions(simConfig, extradelay, stockDates, interval, categoryValueMap,
volumeMap, configExcludeList, delay, indexOffset);
double myavg = increase(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset);
List<Astock> holdIncrease = new ArrayList<>();
int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
List<Astock> sells = new ArrayList<>();
List<Astock> buys = new ArrayList<>();
if (simConfig.getIntervalStoploss()) {
// TODO delay
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset - extradelay, sells, simConfig.getIntervalStoplossValue(), "ISTOP");
}
double myreliability = getReliability(mystocks, hits, findTimes, up);
boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc[0] >= simConfig.getConfidencetrendincreaseTimes();
boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec[0] >= simConfig.getNoconfidencetrenddecreaseTimes();
boolean noconfidence = !confidence || !confidence1 || noconfidence2;
if (!noconfidence) {
mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, myExcludes,
aParameter, mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay);
} else {
mystocks = noConfidenceHoldSell(mystocks, holdIncrease, sells, simConfig);
}
// TODO delay DELAY
sell(stockDates, categoryValueMap, capital, sells, stockhistory, indexOffset - extradelay - delay, date, mystocks);
// TODO delay DELAY
buy(stockDates, categoryValueMap, capital, simConfig.getStocks(), mystocks, buys, simConfig.getBuyweight(), date, indexOffset - extradelay - delay);
List<String> myids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
if (myids.size() != mystocks.size()) {
log.error("Sizes");
}
List<String> ids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
// to delay?
update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay - delay, new ArrayList<>(), prevIndexOffset - extradelay - delay);
// depends on delay DELAY
Capital sum = getSum(mystocks);
//boolean noconf = simConfig.getConfidence() && myreliability < simConfig.getConfidenceValue();
String hasNoConf = noconfidence ? "NOCONF" : "";
datestring = stockDates.get(stockDates.size() - 1 - (indexOffset - extradelay - delay));
sumHistory.add(datestring + " " + capital.toString() + " " + sum.toString() + " " + new MathUtil().round(resultavg, 2) + " " + hasNoConf + " " + ids + " " + trend);
if (trend != null && trend.incAverage != 0) {
resultavg *= trend.incAverage;
}
plotDates.add(datestring);
plotDefault.add(resultavg);
plotCapital.add(sum.amount + capital.amount);
if (Double.isInfinite(resultavg)) {
int jj = 0;
}
runs++;
if (myavg > trend.incAverage) {
beatavg++;
}
if (simConfig.getStoploss()) {
for (int j = 0; j < interval; j++) {
sells = new ArrayList<>();
//System.out.println(interval + " " + j);
if (indexOffset - j - 1 - extradelay < 0) {
break;
}
// TODO delay DELAY
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - j - extradelay, categoryValueMap, indexOffset - j - 1 - extradelay, sells, simConfig.getStoplossValue(), "STOP");
sell(stockDates, categoryValueMap, capital, sells, stockhistory, indexOffset - j - extradelay, date, mystocks);
}
}
prevIndexOffset = indexOffset;
if (indexOffset - interval < 0) {
break;
}
datestring = stockDates.get(stockDates.size() - 1 - (indexOffset - interval));
try {
date = TimeUtil.convertDate(datestring);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
}
if (offset == 0) {
try {
lastbuysell(stockDates, date, adviser, capital, simConfig, categoryValueMap, mystocks, extradelay, prevIndexOffset, hits, findTimes, aParameter, param.getUpdateMap(), trendInc, trendDec, configExcludeList, param, market, interval, filteredCategoryValueMap, volumeMap, delay);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
}
update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay - delay, new ArrayList<>(), prevIndexOffset - extradelay - delay);
Capital sum = getSum(mystocks);
sum.amount += capital.amount;
long days = 0;
if (investStart != null && investEnd != null) {
days = ChronoUnit.DAYS.between(investStart, investEnd);
}
double years = (double) days / 365;
Double score = sum.amount / resultavg;
if (years != 0) {
score = Math.pow(score, 1 / years);
} else {
score = 0.0;
}
if (score < -1) {
int jj = 0;
}
if (score > 10) {
int jj = 0;
}
if (score > 100) {
int jj = 0;
}
scores.add(score);
if (offset == 0) {
int myIndexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, mldate);
Trend trend = new TrendUtil().getTrend(myIndexOffset - prevIndexOffset, null /*TimeUtil.convertDate2(olddate)*/, prevIndexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
log.info(trend.toString());
log.info("" + simConfig.asMap());
}
if (offset == 0) {
Map<String, Object> map = new HashMap<>();
map.put("sumhistory", sumHistory);
map.put("stockhistory", stockhistory);
map.put("plotdefault", plotDefault);
map.put("plotdates", plotDates);
map.put("plotcapital", plotCapital);
map.put("startdate", investStart);
map.put("enddate", investEnd);
map.put("titletext", getPipeline() + " " + emptyNull(simConfig.getStartdate(), "start") + "-" + emptyNull(simConfig.getEnddate(), "end") + " " + (emptyNull(origAdviserId, "all")));
param.getUpdateMap().putAll(map);
componentData.getUpdateMap().putAll(map);
}
}
log.info("time0 {}", System.currentTimeMillis() - time0);
log.info("time1 {}", AboveBelowAdviser.time1);
log.info("time2 {}", AboveBelowAdviser.time2);
log.info("time2 {}", time3);
log.info("time2 {}", time4);
}
Double score = 0.0;
if (!scores.isEmpty()) {
OptionalDouble average = scores
.stream()
.mapToDouble(a -> a)
.average();
score = average.getAsDouble();
}
if (intervalwhole) {
String stats = scores.stream().filter(Objects::nonNull).mapToDouble(e -> (Double) e).summaryStatistics().toString();
Map<String, Object> map = new HashMap<>();
map.put("scores", scores);
map.put("stats", stats);
double min = Collections.min(scores);
double max = Collections.max(scores);
int minDay = scores.indexOf(min);
int maxDay = scores.indexOf(max);
map.put("minmax", "min " + min + " at " + minDay + " and max " + max + " at " + maxDay);
param.getUpdateMap().putAll(map);
componentData.getUpdateMap().putAll(map);
}
Map<String, Double> scoreMap = new HashMap<>();
scoreMap.put("" + score, score);
scoreMap.put("score", score);
componentData.setScoreMap(scoreMap);
//componentData.setFuturedays(0);
handle2(action, market, componentData, profitdata, positions, evolve, aMap, subcomponent, mlmarket, parameters);
return componentData;
}
private List<String> getExclusions(SimulateInvestConfig simConfig, int extradelay, List<String> stockDates,
int interval, Map<String, List<List<Double>>> categoryValueMap, Map<String, List<List<Object>>> volumeMap,
List<String> configExcludeList, int delay, int indexOffset) {
List<String> myExcludes = new ArrayList<>();
List<String> volumeExcludes = new ArrayList<>();
getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
indexOffset, volumeExcludes);
myExcludes.addAll(configExcludeList);
myExcludes.addAll(volumeExcludes);
return myExcludes;
}
private Trend getTrendIncDec(Market market, ComponentData param, List<String> stockDates, int interval,
Map<String, List<List<Double>>> filteredCategoryValueMap, Integer[] trendInc, Integer[] trendDec,
int indexOffset) {
Trend trend = null;
try {
trend = new TrendUtil().getTrend(interval, null /*TimeUtil.convertDate2(olddate)*/, indexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
} catch (Exception e) {
log.error(Constants.ERROR, e);
}
if (trend != null && trend.incAverage < 0) {
int jj = 0;
}
log.debug("Trend {}", trend);
if (trend != null) {
if (trend.incAverage > 1) {
trendInc[0]++;
trendDec[0] = 0;
} else {
trendInc[0] = 0;
trendDec[0]++;
}
}
return trend;
}
private void getVolumeExcludes(SimulateInvestConfig simConfig, int extradelay, List<String> stockDates,
int interval, Map<String, List<List<Double>>> categoryValueMap,
Map<String, List<List<Object>>> volumeMap, int delay, int indexOffset, List<String> volumeExcludes) {
if (simConfig.getVolumelimits() != null) {
Map<String, Double> volumeLimits = simConfig.getVolumelimits();
for (Entry<String, List<List<Double>>> entry : categoryValueMap.entrySet()) {
String id = entry.getKey();
int anOffset = indexOffset /* - extradelay - delay */;
int len = interval * 2;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
int size = mainList.size();
int first = size - anOffset - len;
if (first < 0) {
first = 0;
}
List<List<Object>> list = volumeMap.get(id);
String currency = null;
for (int i = 0; i < list.size(); i++) {
currency = (String) list.get(i).get(1);
if (currency != null) {
break;
}
}
Double limit = volumeLimits.get(currency);
if (limit == null) {
continue;
}
Double sum = 0.0;
int count = 0;
for (int i = first; i <= size - 1 - anOffset; i++) {
Integer volume = (Integer) list.get(i).get(0);
if (volume != null) {
Double price = mainList.get(i /* mainList.size() - 1 - indexOffset */);
if (price == null) {
if (volume > 0) {
log.debug("Price null with volume > 0");
}
continue;
}
sum += volume * price;
count++;
}
}
if (count > 0 && sum / count < limit) {
volumeExcludes.add(id);
}
}
}
}
}
private List<Astock> confidenceBuyHoldSell(SimulateInvestConfig simConfig, List<String> stockDates,
Map<String, List<List<Double>>> categoryValueMap, Adviser adviser, List<String> excludeList,
String aParameter, List<Astock> mystocks, LocalDate date, int indexOffset, List<Astock> sells,
List<Astock> buys, List<Astock> holdIncrease, int extradelay, int delay) {
List<Astock> hold;
if (simConfig.getConfidenceholdincrease() == null || simConfig.getConfidenceholdincrease()) {
hold = holdIncrease;
} else {
hold = new ArrayList<>();
}
List<String> anExcludeList = new ArrayList<>(excludeList);
List<String> ids1 = sells.stream().map(Astock::getId).collect(Collectors.toList());
List<String> ids2 = hold.stream().map(Astock::getId).collect(Collectors.toList());
anExcludeList.addAll(ids1);
anExcludeList.addAll(ids2);
// full list
List<IncDecItem> myincs = adviser.getIncs(aParameter, simConfig.getStocks(), date, indexOffset, stockDates, anExcludeList);
//List<IncDecItem> myincs = ds.getIncs(valueList);
//List<ValueList> valueList = ds.getValueList(categoryValueMap, indexOffset);
// full list, except if null value
//int delay = simConfig.getDelay();
List<Astock> buysTmp;
if (indexOffset < delay + extradelay) {
buysTmp = new ArrayList<>();
} else {
buysTmp = getBuyList(stockDates, categoryValueMap, myincs, indexOffset - delay - extradelay, simConfig.getStocks());
}
myincs = null;
//buysTmp = filter(buysTmp, sells);
List<Astock> keeps = keep(mystocks, buysTmp);
keeps.addAll(hold);
buysTmp = filter(buysTmp, mystocks);
//buysTmp = buysTmp.subList(0, Math.min(buysTmp.size(), simConfig.getStocks() - mystocks.size()));
buys.clear();
buys.addAll(buysTmp);
List<Astock> newsells = filter(mystocks, keeps);
//mystocks.removeAll(newsells);
sells.addAll(newsells);
mystocks = keeps;
return mystocks;
}
private List<Astock> noConfidenceHoldSell(List<Astock> mystocks, List<Astock> holdIncrease, List<Astock> sells, SimulateInvestConfig simConfig) {
List<Astock> keeps;
if (simConfig.getNoconfidenceholdincrease() == null || simConfig.getNoconfidenceholdincrease()) {
keeps = holdIncrease;
} else {
keeps = new ArrayList<>();
}
List<Astock> newsells = filter(mystocks, keeps);
//mystocks.removeAll(newsells);
sells.addAll(newsells);
mystocks = keeps;
return mystocks;
}
private SimulateInvestConfig getSimConfig(IclijConfig config) {
SimulateInvestConfig simConfig = new SimulateInvestConfig();
simConfig.setAdviser(config.getSimulateInvestAdviser());
simConfig.setBuyweight(config.wantsSimulateInvestBuyweight());
simConfig.setConfidence(config.wantsSimulateInvestConfidence());
simConfig.setConfidenceValue(config.getSimulateInvestConfidenceValue());
simConfig.setConfidenceFindTimes(config.getSimulateInvestConfidenceFindtimes());
simConfig.setConfidenceholdincrease(config.wantsSimulateInvestConfidenceHoldIncrease());
simConfig.setNoconfidenceholdincrease(config.wantsSimulateInvestNoConfidenceHoldIncrease());
simConfig.setConfidencetrendincrease(config.wantsSimulateInvestConfidenceTrendIncrease());
simConfig.setConfidencetrendincreaseTimes(config.wantsSimulateInvestConfidenceTrendIncreaseTimes());
simConfig.setNoconfidencetrenddecrease(config.wantsSimulateInvestNoConfidenceTrendDecrease());
simConfig.setNoconfidencetrenddecreaseTimes(config.wantsSimulateInvestNoConfidenceTrendDecreaseTimes());
simConfig.setInterval(config.getSimulateInvestInterval());
simConfig.setIndicatorPure(config.wantsSimulateInvestIndicatorPure());
simConfig.setIndicatorRebase(config.wantsSimulateInvestIndicatorRebase());
simConfig.setIndicatorReverse(config.wantsSimulateInvestIndicatorReverse());
simConfig.setIndicatorDirection(config.wantsSimulateInvestIndicatorDirection());
simConfig.setIndicatorDirectionUp(config.wantsSimulateInvestIndicatorDirectionUp());
simConfig.setMldate(config.wantsSimulateInvestMLDate());
try {
simConfig.setPeriod(config.getSimulateInvestPeriod());
} catch (Exception e) {
}
simConfig.setStoploss(config.wantsSimulateInvestStoploss());
simConfig.setStoplossValue(config.getSimulateInvestStoplossValue());
simConfig.setIntervalStoploss(config.wantsSimulateInvestIntervalStoploss());
simConfig.setIntervalStoplossValue(config.getSimulateInvestIntervalStoplossValue());
simConfig.setStocks(config.getSimulateInvestStocks());
simConfig.setInterpolate(config.wantsSimulateInvestInterpolate());
simConfig.setDay(config.getSimulateInvestDay());
simConfig.setDelay(config.getSimulateInvestDelay());
try {
simConfig.setEnddate(config.getSimulateInvestEnddate());
} catch (Exception e) {
}
try {
simConfig.setStartdate(config.getSimulateInvestStartdate());
} catch (Exception e) {
}
return simConfig;
}
private String emptyNull(Object object) {
if (object == null) {
return "";
} else {
return "" + object;
}
}
private String emptyNull(Object object, String defaults) {
if (object == null) {
return defaults;
} else {
return "" + object;
}
}
private List<Astock> filter(List<Astock> stocks, List<Astock> others) {
List<String> ids = others.stream().map(Astock::getId).collect(Collectors.toList());
return stocks.stream().filter(e -> !ids.contains(e.id)).collect(Collectors.toList());
}
private List<Astock> keep(List<Astock> stocks, List<Astock> others) {
List<String> ids = others.stream().map(Astock::getId).collect(Collectors.toList());
return stocks.stream().filter(e -> ids.contains(e.id)).collect(Collectors.toList());
}
private Capital getSum(List<Astock> mystocks) {
Capital sum = new Capital();
for (Astock astock : mystocks) {
sum.amount += astock.count * astock.price;
}
return sum;
}
@Override
public ComponentData improve(MarketAction action, ComponentData componentparam, Market market, ProfitData profitdata,
Memories positions, Boolean buy, String subcomponent, Parameters parameters, boolean wantThree,
List<MLMetricsItem> mlTests) {
SimulateInvestData param = new SimulateInvestData(componentparam);
param.setAllIncDecs(getAllIncDecs(market, null, null));
param.setAllMemories(getAllMemories(market, null, null));
param.setAllMetas(getAllMetas(componentparam));
/*
Integer adviser = (Integer) param.getInput().getConfig().getConfigValueMap().get(IclijConfigConstants.SIMULATEINVESTADVISER);
if (adviser != null) {
SimulateInvestConfig config = new SimulateInvestConfig();
config.setAdviser(adviser);
param.setConfig(config);
}
*/
getResultMaps(param, market);
List<String> stockDates = param.getService().getDates(market.getConfig().getMarket());
param.setStockDates(stockDates);
List<String> confList = getConfList();
int ga = param.getInput().getConfig().getEvolveGA();
Evolve evolve = SimulateInvestEvolveFactory.factory(ga);
String evolutionConfigString = param.getInput().getConfig().getImproveAbovebelowEvolutionConfig();
EvolutionConfig evolutionConfig = JsonUtil.convert(evolutionConfigString, EvolutionConfig.class);
//evolutionConfig.setGenerations(3);
//evolutionConfig.setSelect(6);
Map<String, Object> confMap = new HashMap<>();
// confmap
return evolve.evolve(action, param, market, profitdata, buy, subcomponent, parameters, mlTests, confMap , evolutionConfig, getPipeline(), this, confList);
}
@Override
public MLConfigs getOverrideMLConfig(ComponentData componentdata) {
return null;
}
@Override
public void calculateIncDec(ComponentData param, ProfitData profitdata, Memories positions, Boolean above,
List<MLMetricsItem> mlTests, Parameters parameters) {
}
@Override
public List<MemoryItem> calculateMemory(ComponentData param, Parameters parameters) throws Exception {
return null;
}
@Override
public String getPipeline() {
return PipelineConstants.SIMULATEINVEST;
}
@Override
protected List<String> getConfList() {
List<String> confList = new ArrayList<>();
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEFINDTIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEHOLDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCEHOLDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCETRENDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCETRENDINCREASETIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCETRENDDECREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCETRENDDECREASETIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOPLOSS);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOPLOSSVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVALSTOPLOSS);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVALSTOPLOSSVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORPURE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORREBASE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORREVERSE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORDIRECTION);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORDIRECTIONUP);
confList.add(IclijConfigConstants.SIMULATEINVESTMLDATE);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOCKS);
confList.add(IclijConfigConstants.SIMULATEINVESTBUYWEIGHT);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVAL);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERPOLATE);
confList.add(IclijConfigConstants.SIMULATEINVESTADVISER);
confList.add(IclijConfigConstants.SIMULATEINVESTPERIOD);
confList.add(IclijConfigConstants.SIMULATEINVESTDAY);
return confList;
}
@Override
public String getThreshold() {
return null;
}
@Override
public String getFuturedays() {
return null;
}
@Override
protected EvolutionConfig getImproveEvolutionConfig(IclijConfig config) {
String evolveString = config.getImproveAbovebelowEvolutionConfig();
return JsonUtil.convert(evolveString, EvolutionConfig.class);
}
public Object[] calculateAccuracy(ComponentData componentparam) throws Exception {
return new Object[] { componentparam.getScoreMap().get("score") };
}
private double increase(Capital capital, int buytop, List<Astock> mystocks, List<String> stockDates, int indexOffset,
Map<String, List<List<Double>>> categoryValueMap, int prevIndexOffset) {
List<Double> incs = new ArrayList<>();
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (prevIndexOffset <= -1) {
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valWas != null && valNow != null) {
double inc = valNow / valWas;
incs.add(inc);
}
} else {
// put back if unknown
//mystocks.add(item);
}
}
if (incs.isEmpty()) {
return 1.0;
}
OptionalDouble average = incs
.stream()
.mapToDouble(a -> a)
.average();
return average.getAsDouble();
}
private void lastbuysell(List<String> stockDates, LocalDate date, Adviser adviser, Capital capital, SimulateInvestConfig simConfig, Map<String, List<List<Double>>> categoryValueMap, List<Astock> mystocks, int extradelay, int prevIndexOffset, Pair<Integer, Integer>[] hits, int findTimes, String aParameter, Map<String, Object> map, Integer[] trendInc, Integer[] trendDec, List<String> configExcludeList, ComponentData param, Market market, int interval, Map<String, List<List<Double>>> filteredCategoryValueMap, Map<String, List<List<Object>>> volumeMap, int delay) {
mystocks = new ArrayList<>(mystocks);
date = TimeUtil.getForwardEqualAfter2(date, 0 /* findTime */, stockDates);
String datestring = TimeUtil.convertDate2(date);
int indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
Trend trend = getTrendIncDec(market, param, stockDates, interval, filteredCategoryValueMap, trendInc, trendDec, indexOffset);
// get recommendations
List<String> myExcludes = getExclusions(simConfig, extradelay, stockDates, interval, categoryValueMap,
volumeMap, configExcludeList, delay, indexOffset);
double myavg = increase(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset);
List<Astock> holdIncrease = new ArrayList<>();
int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
List<Astock> sells = new ArrayList<>();
List<Astock> buys = new ArrayList<>();
if (simConfig.getIntervalStoploss()) {
// TODO delay
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset - extradelay, sells, simConfig.getIntervalStoplossValue(), "ISTOP");
}
double myreliability = getReliability(mystocks, hits, findTimes, up);
boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc[0] >= simConfig.getConfidencetrendincreaseTimes();
boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec[0] >= simConfig.getNoconfidencetrenddecreaseTimes();
boolean noconfidence = !confidence || !confidence1 || noconfidence2;
if (!noconfidence) {
int delay0 = 0;
mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, myExcludes, aParameter,
mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay0);
} else {
mystocks = noConfidenceHoldSell(mystocks, holdIncrease, sells, simConfig);
}
List<String> ids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
List<String> buyids = buys.stream().map(Astock::getId).collect(Collectors.toList());
List<String> sellids = sells.stream().map(Astock::getId).collect(Collectors.toList());
if (!noconfidence) {
int buyCnt = simConfig.getStocks() - mystocks.size();
buyCnt = Math.min(buyCnt, buys.size());
ids.addAll(buyids.subList(0, buyCnt));
buyids = buyids.subList(0, buyCnt);
} else {
buyids.clear();
}
ids.removeAll(sellids);
map.put("lastbuysell", "Buy: " + buyids + " Sell: " + sellids + " Stocks: " +ids);
}
private double getReliability(List<Astock> mystocks, Pair<Integer, Integer>[] hits, int findTimes, int up) {
Pair<Integer, Integer> pair = new ImmutablePair(up, mystocks.size());
for (int j = findTimes - 1; j > 0; j--) {
hits[j] = hits[j - 1];
}
hits[0] = pair;
double count = 0;
int total = 0;
for (Pair<Integer, Integer> aPair : hits) {
if (aPair == null) {
continue;
}
count += aPair.getLeft();
total += aPair.getRight();
}
double reliability = 1;
if (total > 0) {
reliability = count / total;
}
return reliability;
}
private void stoploss(Capital capital, int buytop, List<Astock> mystocks, List<String> stockDates, int indexOffset,
Map<String, List<List<Double>>> categoryValueMap, int prevIndexOffset, List<Astock> sells, double stoploss, String stop) {
List<Astock> newSells = new ArrayList<>();
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
String dateNowStr = stockDates.get(stockDates.size() - 1 - indexOffset);
LocalDate dateNow = null;
try {
dateNow = TimeUtil.convertDate(dateNowStr);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
if (!dateNow.isAfter(item.buydate)) {
continue;
}
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (prevIndexOffset <= -1) {
int jj = 0;
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valWas != null && valNow != null && valNow != 0 && valWas != 0 && valNow / valWas < stoploss) {
item.status = stop;
newSells.add(item);
}
}
}
mystocks.removeAll(newSells);
sells.addAll(newSells);
}
private void buy(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital, int buytop, List<Astock> mystocks, List<Astock> newbuys, boolean buyweight, LocalDate date, int indexOffset) {
int buys = buytop - mystocks.size();
buys = Math.min(buys, newbuys.size());
double totalweight = 0;
if (buyweight) {
for (int i = 0; i < buys; i++) {
totalweight += Math.abs(newbuys.get(i).weight);
}
}
double totalamount = 0;
for (int i = 0; i < buys; i++) {
Astock astock = newbuys.get(i);
String id = astock.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
double amount = 0;
if (!buyweight) {
amount = capital.amount / buys;
} else {
amount = capital.amount * astock.weight / totalweight;
}
astock.buyprice = valNow;
astock.count = amount / astock.buyprice;
String dateNow = stockDates.get(stockDates.size() - 1 - indexOffset);
try {
date = TimeUtil.convertDate(dateNow);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
astock.buydate = date;
mystocks.add(astock);
totalamount += amount;
} else {
log.error("Not found");
}
}
}
capital.amount -= totalamount;
}
private int update(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital,
List<Astock> mystocks, int indexOffset, List<Astock> noConfKeep, int prevIndexOffset) {
int up = 0;
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
item.price = valNow;
}
if (prevIndexOffset <= -1) {
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valNow != null && valWas != null) {
if (valNow > valWas) {
up++;
noConfKeep.add(item);
}
}
}
}
return up;
}
private void sell(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital,
List<Astock> sells, List<Astock> stockhistory, int indexOffset, LocalDate date, List<Astock> mystocks) {
for (Astock item : sells) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
item.sellprice = valNow;
String dateNow = stockDates.get(stockDates.size() - 1 - indexOffset);
try {
date = TimeUtil.convertDate(dateNow);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
item.selldate = date;
stockhistory.add(item);
capital.amount += item.count * item.sellprice;
} else {
// put back if unknown
mystocks.add(item);
}
} else {
// put back if unknown
mystocks.add(item);
}
}
}
private List<Astock> getSellList(List<Astock> mystocks, List<Astock> newbuys) {
List<String> myincids = newbuys.stream().map(Astock::getId).collect(Collectors.toList());
return mystocks.stream().filter(e -> !myincids.contains(e.id)).collect(Collectors.toList());
}
private List<Astock> getBuyList(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap,
List<IncDecItem> myincs, int indexOffset, Integer count) {
List<Astock> newbuys = new ArrayList<>();
for (IncDecItem item : myincs) {
String id = item.getId();
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
Astock astock = new Astock();
astock.id = id;
//astock.price = -1;
astock.weight = Math.abs(item.getScore());
newbuys.add(astock);
count--;
if (count == 0) {
break;
}
}
}
}
return newbuys;
}
class Astock {
public String id;
public double price;
public double count;
public double buyprice;
public double sellprice;
public LocalDate buydate;
public LocalDate selldate;
public double weight;
public String status;
public String getId() {
return id;
}
public String toString() {
MathUtil mu = new MathUtil();
return id + " " + mu.round(price, 3) + " " + count + " " + mu.round(buyprice, 3) + " " + mu.round(sellprice, 3) + " " + buydate + " " + selldate;
}
}
class Capital {
public double amount;
public String toString() {
return "" + new MathUtil().round(amount, 2);
}
}
private List<IncDecItem> getAllIncDecs(Market market, LocalDate investStart, LocalDate investEnd) {
try {
return IclijDbDao.getAllIncDecs(market.getConfig().getMarket(), investStart, investEnd, null);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
return new ArrayList<>();
}
private List<MemoryItem> getAllMemories(Market market, LocalDate investStart, LocalDate investEnd) {
try {
return IclijDbDao.getAllMemories(market.getConfig().getMarket(), IclijConstants.IMPROVEABOVEBELOW, PipelineConstants.ABOVEBELOW, null, null, investStart, investEnd);
// also filter on params
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
return new ArrayList<>();
}
private List<MetaItem> getAllMetas(ComponentData param) {
return param.getService().getMetas();
}
private void getResultMaps(SimulateInvestData param, Market market) {
//Map<String, List<Object>> objectMap = new HashMap<>();
IclijConfig config = param.getInput().getConfig();
Map<String, Object> aMap = new HashMap<>();
// for improve evolver
//List<MetaItem> metas = param.getService().getMetas();
//MetaItem meta = new MetaUtil().findMeta(metas, market.getConfig().getMarket());
//ComponentData componentData = component.improve2(action, param, market, profitdata, null, buy, subcomponent, parameters, mlTests);
// don't need these both here and in getevolveml?
aMap.put(ConfigConstants.MACHINELEARNING, false);
aMap.put(ConfigConstants.AGGREGATORS, false);
aMap.put(ConfigConstants.INDICATORS, true);
aMap.put(ConfigConstants.INDICATORSMACD, true);
aMap.put(ConfigConstants.MISCTHRESHOLD, null);
aMap.put(ConfigConstants.MISCMYTABLEDAYS, 0);
aMap.put(ConfigConstants.MISCMYDAYS, 0);
aMap.put(ConfigConstants.MISCPERCENTIZEPRICEINDEX, true);
aMap.put(ConfigConstants.MISCINTERPOLATIONMETHOD, market.getConfig().getInterpolate());
aMap.put(ConfigConstants.MISCMERGECY, false);
// different line
param.getResultMap(null, aMap);
Map<String, Map<String, Object>> mapsRebase = param.getResultMaps();
param.setResultRebaseMaps(mapsRebase);
aMap.put(ConfigConstants.MISCPERCENTIZEPRICEINDEX, false);
// different line
param.getResultMap(null, aMap);
//Map<String, Map<String, Object>> maps = param.getResultMaps();
//param.getAndSetWantedCategoryValueMap();
/*
for (Entry<String, Map<String, Object>> entry : maps.entrySet()) {
String key = entry.getKey();
System.out.println("key " + key);
System.out.println("keys " + entry.getValue().keySet());
}
*/
//Integer cat = (Integer) maps.get(PipelineConstants.META).get(PipelineConstants.WANTEDCAT);
//String catName = new MetaUtil().getCategory(meta, cat);
//Map<String, Object> resultMaps = maps.get(catName);
/*
if (resultMaps != null) {
Map<String, Object> macdMaps = (Map<String, Object>) resultMaps.get(PipelineConstants.INDICATORMACD);
//System.out.println("macd"+ macdMaps.keySet());
objectMap = (Map<String, List<Object>>) macdMaps.get(PipelineConstants.OBJECT);
}
*/
//return resultMaps;
}
// loop
// update values with indexoffset - extra
// get advise based on indexoffset info (TODO extra)
// get istoploss sells with indexoffset
// get buy list with indexoffset - delay - extra
// stoploss is based on indexoffset - extra
// algo 0
// loop
// get recommend for buy sell on date1
// sell buy on date1
// date1 = date1 + 1w
// calculate capital after 1w, new date1
// endloop
// #calculate capital after 1w
// # remember stoploss
// algo 1
// loop
// get findprofit recommendations from last week on date1
// ignore sell buy if not reliable lately
// sell buy
// date += 1w
// calc new capital
// endloop
// algo 2
// incr date by 1w
// loop
// date1
// stocklist
// check pr date1 top 5 for last 1m 1w etc
// if stocklist in top 5, keep, else sell
// buy stocklist in top 5
// date1 += 1w
// calc new capital
// endloop
// #get stocklist value
// use mach highest mom
// improve with ds
}
| iclij/iclij-core/src/main/java/roart/component/SimulateInvestComponent.java | package roart.component;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.Period;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Map.Entry;
import java.util.OptionalDouble;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import roart.action.MarketAction;
import roart.common.config.ConfigConstants;
import roart.common.constants.Constants;
import roart.common.model.MetaItem;
import roart.common.pipeline.PipelineConstants;
import roart.common.util.JsonUtil;
import roart.common.util.MathUtil;
import roart.common.util.MetaUtil;
import roart.common.util.TimeUtil;
import roart.common.util.ValidateUtil;
import roart.component.adviser.Adviser;
import roart.component.adviser.AdviserFactory;
import roart.component.model.ComponentData;
import roart.component.model.SimulateInvestData;
import roart.constants.IclijConstants;
import roart.db.IclijDbDao;
import roart.evolution.chromosome.impl.ConfigMapChromosome2;
import roart.evolution.chromosome.winner.IclijConfigMapChromosomeWinner;
import roart.evolution.config.EvolutionConfig;
import roart.evolution.iclijconfigmap.genetics.gene.impl.IclijConfigMapChromosome;
import roart.evolution.iclijconfigmap.genetics.gene.impl.IclijConfigMapGene;
import roart.iclij.config.IclijConfig;
import roart.iclij.config.IclijConfigConstants;
import roart.iclij.config.MLConfigs;
import roart.iclij.config.Market;
import roart.iclij.config.SimulateInvestConfig;
import roart.iclij.evolution.fitness.impl.FitnessIclijConfigMap;
import roart.iclij.filter.Memories;
import roart.iclij.model.IncDecItem;
import roart.iclij.model.MLMetricsItem;
import roart.iclij.model.MemoryItem;
import roart.iclij.model.Parameters;
import roart.iclij.model.Trend;
import roart.iclij.verifyprofit.TrendUtil;
import roart.service.model.ProfitData;
public class SimulateInvestComponent extends ComponentML {
@Override
public void enable(Map<String, Object> valueMap) {
}
@Override
public void disable(Map<String, Object> valueMap) {
}
@Override
public ComponentData handle(MarketAction action, Market market, ComponentData param, ProfitData profitdata,
Memories positions, boolean evolve, Map<String, Object> aMap, String subcomponent, String mlmarket,
Parameters parameters) {
ComponentData componentData = new ComponentData(param);
SimulateInvestData simulateParam;
if (param instanceof SimulateInvestData) {
simulateParam = (SimulateInvestData) param;
} else {
simulateParam = new SimulateInvestData(param);
}
IclijConfig config = param.getInput().getConfig();
int beatavg = 0;
int runs = 0;
SimulateInvestConfig simConfig = getSimConfig(config);
int extradelay = 0;
//Integer overrideAdviser = null;
if (!(param instanceof SimulateInvestData)) {
SimulateInvestConfig localSimConfig = market.getSimulate();
simConfig.merge(localSimConfig);
if (simConfig.getExtradelay() != null) {
extradelay = simConfig.getExtradelay();
}
} else {
/*
if (simulateParam.getConfig() != null) {
overrideAdviser = simulateParam.getConfig().getAdviser();
simConfig.merge(simulateParam.getConfig());
}
*/
/*
if (!simulateParam.getInput().getValuemap().isEmpty()) {
overrideAdviser = simulateParam.getConfig().getAdviser();
simConfig.merge(simulateParam.getConfig());
}
*/
SimulateInvestConfig localSimConfig = market.getSimulate();
if (localSimConfig != null && localSimConfig.getVolumelimits() != null) {
simConfig.setVolumelimits(localSimConfig.getVolumelimits());
}
if (localSimConfig != null && localSimConfig.getExtradelay() != null) {
extradelay = localSimConfig.getExtradelay();
}
}
List<String> stockDates;
if (simulateParam.getStockDates() != null) {
stockDates = simulateParam.getStockDates();
} else {
stockDates = param.getService().getDates(market.getConfig().getMarket());
}
int interval = simConfig.getInterval();
//ComponentData componentData = component.improve2(action, param, market, profitdata, null, buy, subcomponent, parameters, mlTests);
Map<String, List<List<Double>>> categoryValueMap;
if (simConfig.getInterpolate()) {
categoryValueMap = param.getFillCategoryValueMap();
} else {
categoryValueMap = param.getCategoryValueMap();
}
Map<String, List<List<Object>>> volumeMap = param.getVolumeMap();
LocalDate investStart = null;
LocalDate investEnd = param.getFutureDate();
String mldate = null;
if (simConfig.getMldate()) {
mldate = market.getConfig().getMldate();
if (mldate != null) {
mldate = mldate.replace('-', '.');
}
//mldate = ((SimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
//mldate = ((ImproveSimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
} else {
Short populate = market.getConfig().getPopulate();
if (populate == null) {
//mldate = ((SimulateInvestActionData) action.getActionData()).getMlDate(market, stockDates);
mldate = market.getConfig().getMldate();
if (mldate != null) {
mldate = mldate.replace('-', '.');
}
} else {
mldate = stockDates.get(populate);
}
}
if (mldate == null) {
mldate = stockDates.get(0);
}
if (simConfig.getStartdate() != null) {
mldate = simConfig.getStartdate();
mldate = mldate.replace('-', '.');
}
try {
investStart = TimeUtil.convertDate(mldate);
} catch (ParseException e1) {
log.error(Constants.EXCEPTION, e1);
}
try {
String enddate = simConfig.getEnddate();
if (enddate != null) {
enddate = enddate.replace('-', '.');
investEnd = TimeUtil.convertDate(enddate);
}
} catch (ParseException e1) {
log.error(Constants.EXCEPTION, e1);
}
Integer origAdviserId = (Integer) param.getInput().getValuemap().get(IclijConfigConstants.SIMULATEINVESTADVISER);
int adviserId = simConfig.getAdviser();
Adviser adviser = new AdviserFactory().get(adviserId, market, investStart, investEnd, param, simConfig);
String[] excludes = null;
if (market.getSimulate() != null) {
excludes = market.getSimulate().getExcludes();
}
if (excludes == null) {
excludes = new String[0];
}
List<String> configExcludeList = Arrays.asList(excludes);
Map<String, List<List<Double>>> filteredCategoryValueMap = new HashMap<>(categoryValueMap);
filteredCategoryValueMap.keySet().removeAll(configExcludeList);
boolean intervalwhole = config.wantsSimulateInvestIntervalWhole();
int end = 1;
if (intervalwhole) {
end = simConfig.getInterval();
}
List<String> parametersList = adviser.getParameters();
if (parametersList.isEmpty()) {
parametersList.add(null);
}
List<Double> scores = new ArrayList<>();
for (String aParameter : parametersList) {
Parameters realParameters = JsonUtil.convert(aParameter, Parameters.class);
if (realParameters != null && realParameters.getThreshold() != 1.0) {
continue;
}
int delay = simConfig.getDelay();
int totalDelays = extradelay + delay;
investEnd = TimeUtil.getBackEqualBefore2(investEnd, 0 /* findTime */, stockDates);
if (investEnd != null) {
String aDate = TimeUtil.convertDate2(investEnd);
if (aDate != null) {
int idx = stockDates.indexOf(aDate) - totalDelays;
if (idx >=0 ) {
aDate = stockDates.get(idx);
try {
investEnd = TimeUtil.convertDate(aDate);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
}
}
}
for (int offset = 0; offset < end; offset++) {
Capital capital = new Capital();
capital.amount = 1;
List<Astock> mystocks = new ArrayList<>();
List<Astock> stockhistory = new ArrayList<>();
List<String> sumHistory = new ArrayList<>();
List<String> plotDates = new ArrayList<>();
List<Double> plotCapital = new ArrayList<>();
List<Double> plotDefault = new ArrayList<>();
double resultavg = 1;
int findTimes = simConfig.getConfidenceFindTimes();
Pair<Integer, Integer>[] hits = new ImmutablePair[findTimes];
int trendInc = 0;
int trendDec = 0;
int prevIndexOffset = 0;
//try {
LocalDate date = investStart;
date = TimeUtil.getEqualBefore(stockDates, date);
if (date == null) {
try {
date = TimeUtil.convertDate(stockDates.get(0));
} catch (ParseException e) {
log.error(Constants.ERROR, e);
}
}
date = TimeUtil.getForwardEqualAfter2(date, offset, stockDates);
/*
} catch (Exception e) {
log.error(Constants.ERROR, e);
date = null;
}
*/
int indexOffset = totalDelays;
while (date != null && investEnd != null && !date.isAfter(investEnd)) {
date = TimeUtil.getForwardEqualAfter2(date, 0 /* findTime */, stockDates);
String datestring = TimeUtil.convertDate2(date);
indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
Trend trend = null;
try {
trend = new TrendUtil().getTrend(interval, null /*TimeUtil.convertDate2(olddate)*/, indexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
} catch (Exception e) {
log.error(Constants.ERROR, e);
}
if (trend != null && trend.incAverage < 0) {
int jj = 0;
}
log.debug("Trend {}", trend);
if (trend != null) {
if (trend.incAverage > 1) {
trendInc++;
trendDec = 0;
} else {
trendInc = 0;
trendDec++;
}
}
// get recommendations
List<String> volumeExcludes = new ArrayList<>();
getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
indexOffset, volumeExcludes);
List<String> myExcludes = new ArrayList<>();
myExcludes.addAll(configExcludeList);
myExcludes.addAll(volumeExcludes);
double myavg = increase(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset);
List<Astock> holdIncrease = new ArrayList<>();
int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
List<Astock> sells = new ArrayList<>();
List<Astock> buys = new ArrayList<>();
if (simConfig.getIntervalStoploss()) {
// TODO delay
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset - extradelay, sells, simConfig.getIntervalStoplossValue(), "ISTOP");
}
double myreliability = getReliability(mystocks, hits, findTimes, up);
boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc >= simConfig.getConfidencetrendincreaseTimes();
boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec >= simConfig.getNoconfidencetrenddecreaseTimes();
boolean noconfidence = !confidence || !confidence1 || noconfidence2;
if (!noconfidence) {
mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, myExcludes,
aParameter, mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay);
} else {
mystocks = noConfidenceHoldSell(mystocks, holdIncrease, sells, simConfig);
}
// TODO delay DELAY
sell(stockDates, categoryValueMap, capital, sells, stockhistory, indexOffset - extradelay - delay, date, mystocks);
// TODO delay DELAY
buy(stockDates, categoryValueMap, capital, simConfig.getStocks(), mystocks, buys, simConfig.getBuyweight(), date, indexOffset - extradelay - delay);
List<String> myids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
if (myids.size() != mystocks.size()) {
log.error("Sizes");
}
List<String> ids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
// to delay?
update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay - delay, new ArrayList<>(), prevIndexOffset - extradelay - delay);
// depends on delay DELAY
Capital sum = getSum(mystocks);
//boolean noconf = simConfig.getConfidence() && myreliability < simConfig.getConfidenceValue();
String hasNoConf = noconfidence ? "NOCONF" : "";
datestring = stockDates.get(stockDates.size() - 1 - (indexOffset - extradelay - delay));
sumHistory.add(datestring + " " + capital.toString() + " " + sum.toString() + " " + new MathUtil().round(resultavg, 2) + " " + hasNoConf + " " + ids + " " + trend);
if (trend != null && trend.incAverage != 0) {
resultavg *= trend.incAverage;
}
plotDates.add(datestring);
plotDefault.add(resultavg);
plotCapital.add(sum.amount + capital.amount);
if (Double.isInfinite(resultavg)) {
int jj = 0;
}
runs++;
if (myavg > trend.incAverage) {
beatavg++;
}
if (simConfig.getStoploss()) {
for (int j = 0; j < interval; j++) {
sells = new ArrayList<>();
//System.out.println(interval + " " + j);
if (indexOffset - j - 1 - extradelay < 0) {
break;
}
// TODO delay DELAY
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - j - extradelay, categoryValueMap, indexOffset - j - 1 - extradelay, sells, simConfig.getStoplossValue(), "STOP");
sell(stockDates, categoryValueMap, capital, sells, stockhistory, indexOffset - j - extradelay, date, mystocks);
}
}
prevIndexOffset = indexOffset;
if (indexOffset - interval < 0) {
break;
}
datestring = stockDates.get(stockDates.size() - 1 - (indexOffset - interval));
try {
date = TimeUtil.convertDate(datestring);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
}
if (offset == 0) {
try {
List<String> myExcludes = new ArrayList<>();
myExcludes.addAll(configExcludeList);
List<String> volumeExcludes = new ArrayList<>();
getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
indexOffset, volumeExcludes);
myExcludes.addAll(volumeExcludes);
lastbuysell(stockDates, date, adviser, capital, simConfig, categoryValueMap, mystocks, extradelay, prevIndexOffset, hits, findTimes, aParameter, myExcludes, param.getUpdateMap(), trendInc, trendDec);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
}
update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay - delay, new ArrayList<>(), prevIndexOffset - extradelay - delay);
Capital sum = getSum(mystocks);
sum.amount += capital.amount;
long days = 0;
if (investStart != null && investEnd != null) {
days = ChronoUnit.DAYS.between(investStart, investEnd);
}
double years = (double) days / 365;
Double score = sum.amount / resultavg;
if (years != 0) {
score = Math.pow(score, 1 / years);
} else {
score = 0.0;
}
if (score < -1) {
int jj = 0;
}
if (score > 10) {
int jj = 0;
}
if (score > 100) {
int jj = 0;
}
scores.add(score);
if (offset == 0) {
int myIndexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, mldate);
Trend trend = new TrendUtil().getTrend(myIndexOffset - prevIndexOffset, null /*TimeUtil.convertDate2(olddate)*/, prevIndexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
log.info(trend.toString());
log.info("" + simConfig.asMap());
}
if (offset == 0) {
Map<String, Object> map = new HashMap<>();
map.put("sumhistory", sumHistory);
map.put("stockhistory", stockhistory);
map.put("plotdefault", plotDefault);
map.put("plotdates", plotDates);
map.put("plotcapital", plotCapital);
map.put("startdate", investStart);
map.put("enddate", investEnd);
map.put("titletext", getPipeline() + " " + emptyNull(simConfig.getStartdate(), "start") + "-" + emptyNull(simConfig.getEnddate(), "end") + " " + (emptyNull(origAdviserId, "all")));
param.getUpdateMap().putAll(map);
componentData.getUpdateMap().putAll(map);
}
}
}
Double score = 0.0;
if (!scores.isEmpty()) {
OptionalDouble average = scores
.stream()
.mapToDouble(a -> a)
.average();
score = average.getAsDouble();
}
if (intervalwhole) {
String stats = scores.stream().filter(Objects::nonNull).mapToDouble(e -> (Double) e).summaryStatistics().toString();
Map<String, Object> map = new HashMap<>();
map.put("scores", scores);
map.put("stats", stats);
double min = Collections.min(scores);
double max = Collections.max(scores);
int minDay = scores.indexOf(min);
int maxDay = scores.indexOf(max);
map.put("minmax", "min " + min + " at " + minDay + " and max " + max + " at " + maxDay);
param.getUpdateMap().putAll(map);
componentData.getUpdateMap().putAll(map);
}
Map<String, Double> scoreMap = new HashMap<>();
scoreMap.put("" + score, score);
scoreMap.put("score", score);
componentData.setScoreMap(scoreMap);
//componentData.setFuturedays(0);
handle2(action, market, componentData, profitdata, positions, evolve, aMap, subcomponent, mlmarket, parameters);
return componentData;
}
private void getVolumeExcludes(SimulateInvestConfig simConfig, int extradelay, List<String> stockDates,
int interval, Map<String, List<List<Double>>> categoryValueMap,
Map<String, List<List<Object>>> volumeMap, int delay, int indexOffset, List<String> volumeExcludes) {
if (simConfig.getVolumelimits() != null) {
Map<String, Double> volumeLimits = simConfig.getVolumelimits();
for (Entry<String, List<List<Double>>> entry : categoryValueMap.entrySet()) {
String id = entry.getKey();
int anOffset = indexOffset /* - extradelay - delay */;
int len = interval * 2;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
int size = mainList.size();
int first = size - anOffset - len;
if (first < 0) {
first = 0;
}
List<List<Object>> list = volumeMap.get(id);
String currency = null;
for (int i = 0; i < list.size(); i++) {
currency = (String) list.get(i).get(1);
if (currency != null) {
break;
}
}
Double limit = volumeLimits.get(currency);
if (limit == null) {
continue;
}
Double sum = 0.0;
int count = 0;
for (int i = first; i <= size - 1 - anOffset; i++) {
Integer volume = (Integer) list.get(i).get(0);
if (volume != null) {
Double price = mainList.get(i /* mainList.size() - 1 - indexOffset */);
if (price == null) {
if (volume > 0) {
log.debug("Price null with volume > 0");
}
continue;
}
sum += volume * price;
count++;
}
}
if (count > 0 && sum / count < limit) {
volumeExcludes.add(id);
}
}
}
}
}
private List<Astock> confidenceBuyHoldSell(SimulateInvestConfig simConfig, List<String> stockDates,
Map<String, List<List<Double>>> categoryValueMap, Adviser adviser, List<String> excludeList,
String aParameter, List<Astock> mystocks, LocalDate date, int indexOffset, List<Astock> sells,
List<Astock> buys, List<Astock> holdIncrease, int extradelay, int delay) {
List<Astock> hold;
if (simConfig.getConfidenceholdincrease() == null || simConfig.getConfidenceholdincrease()) {
hold = holdIncrease;
} else {
hold = new ArrayList<>();
}
List<String> anExcludeList = new ArrayList<>(excludeList);
List<String> ids1 = sells.stream().map(Astock::getId).collect(Collectors.toList());
List<String> ids2 = hold.stream().map(Astock::getId).collect(Collectors.toList());
anExcludeList.addAll(ids1);
anExcludeList.addAll(ids2);
// full list
List<IncDecItem> myincs = adviser.getIncs(aParameter, simConfig.getStocks(), date, indexOffset, stockDates, anExcludeList);
//List<IncDecItem> myincs = ds.getIncs(valueList);
//List<ValueList> valueList = ds.getValueList(categoryValueMap, indexOffset);
// full list, except if null value
//int delay = simConfig.getDelay();
List<Astock> buysTmp;
if (indexOffset < delay + extradelay) {
buysTmp = new ArrayList<>();
} else {
buysTmp = getBuyList(stockDates, categoryValueMap, myincs, indexOffset - delay - extradelay, simConfig.getStocks());
}
//buysTmp = filter(buysTmp, sells);
List<Astock> keeps = keep(mystocks, buysTmp);
keeps.addAll(hold);
buysTmp = filter(buysTmp, mystocks);
//buysTmp = buysTmp.subList(0, Math.min(buysTmp.size(), simConfig.getStocks() - mystocks.size()));
buys.clear();
buys.addAll(buysTmp);
List<Astock> newsells = filter(mystocks, keeps);
//mystocks.removeAll(newsells);
sells.addAll(newsells);
mystocks = keeps;
return mystocks;
}
private List<Astock> noConfidenceHoldSell(List<Astock> mystocks, List<Astock> holdIncrease, List<Astock> sells, SimulateInvestConfig simConfig) {
List<Astock> keeps;
if (simConfig.getNoconfidenceholdincrease() == null || simConfig.getNoconfidenceholdincrease()) {
keeps = holdIncrease;
} else {
keeps = new ArrayList<>();
}
List<Astock> newsells = filter(mystocks, keeps);
//mystocks.removeAll(newsells);
sells.addAll(newsells);
mystocks = keeps;
return mystocks;
}
private SimulateInvestConfig getSimConfig(IclijConfig config) {
SimulateInvestConfig simConfig = new SimulateInvestConfig();
simConfig.setAdviser(config.getSimulateInvestAdviser());
simConfig.setBuyweight(config.wantsSimulateInvestBuyweight());
simConfig.setConfidence(config.wantsSimulateInvestConfidence());
simConfig.setConfidenceValue(config.getSimulateInvestConfidenceValue());
simConfig.setConfidenceFindTimes(config.getSimulateInvestConfidenceFindtimes());
simConfig.setConfidenceholdincrease(config.wantsSimulateInvestConfidenceHoldIncrease());
simConfig.setNoconfidenceholdincrease(config.wantsSimulateInvestNoConfidenceHoldIncrease());
simConfig.setConfidencetrendincrease(config.wantsSimulateInvestConfidenceTrendIncrease());
simConfig.setConfidencetrendincreaseTimes(config.wantsSimulateInvestConfidenceTrendIncreaseTimes());
simConfig.setNoconfidencetrenddecrease(config.wantsSimulateInvestNoConfidenceTrendDecrease());
simConfig.setNoconfidencetrenddecreaseTimes(config.wantsSimulateInvestNoConfidenceTrendDecreaseTimes());
simConfig.setInterval(config.getSimulateInvestInterval());
simConfig.setIndicatorPure(config.wantsSimulateInvestIndicatorPure());
simConfig.setIndicatorRebase(config.wantsSimulateInvestIndicatorRebase());
simConfig.setIndicatorReverse(config.wantsSimulateInvestIndicatorReverse());
simConfig.setIndicatorDirection(config.wantsSimulateInvestIndicatorDirection());
simConfig.setIndicatorDirectionUp(config.wantsSimulateInvestIndicatorDirectionUp());
simConfig.setMldate(config.wantsSimulateInvestMLDate());
try {
simConfig.setPeriod(config.getSimulateInvestPeriod());
} catch (Exception e) {
}
simConfig.setStoploss(config.wantsSimulateInvestStoploss());
simConfig.setStoplossValue(config.getSimulateInvestStoplossValue());
simConfig.setIntervalStoploss(config.wantsSimulateInvestIntervalStoploss());
simConfig.setIntervalStoplossValue(config.getSimulateInvestIntervalStoplossValue());
simConfig.setStocks(config.getSimulateInvestStocks());
simConfig.setInterpolate(config.wantsSimulateInvestInterpolate());
simConfig.setDay(config.getSimulateInvestDay());
simConfig.setDelay(config.getSimulateInvestDelay());
try {
simConfig.setEnddate(config.getSimulateInvestEnddate());
} catch (Exception e) {
}
try {
simConfig.setStartdate(config.getSimulateInvestStartdate());
} catch (Exception e) {
}
return simConfig;
}
private String emptyNull(Object object) {
if (object == null) {
return "";
} else {
return "" + object;
}
}
private String emptyNull(Object object, String defaults) {
if (object == null) {
return defaults;
} else {
return "" + object;
}
}
private List<Astock> filter(List<Astock> stocks, List<Astock> others) {
List<String> ids = others.stream().map(Astock::getId).collect(Collectors.toList());
return stocks.stream().filter(e -> !ids.contains(e.id)).collect(Collectors.toList());
}
private List<Astock> keep(List<Astock> stocks, List<Astock> others) {
List<String> ids = others.stream().map(Astock::getId).collect(Collectors.toList());
return stocks.stream().filter(e -> ids.contains(e.id)).collect(Collectors.toList());
}
private Capital getSum(List<Astock> mystocks) {
Capital sum = new Capital();
for (Astock astock : mystocks) {
sum.amount += astock.count * astock.price;
}
return sum;
}
@Override
public ComponentData improve(MarketAction action, ComponentData componentparam, Market market, ProfitData profitdata,
Memories positions, Boolean buy, String subcomponent, Parameters parameters, boolean wantThree,
List<MLMetricsItem> mlTests) {
SimulateInvestData param = new SimulateInvestData(componentparam);
param.setAllIncDecs(getAllIncDecs(market, null, null));
param.setAllMemories(getAllMemories(market, null, null));
param.setAllMetas(getAllMetas(componentparam));
/*
Integer adviser = (Integer) param.getInput().getConfig().getConfigValueMap().get(IclijConfigConstants.SIMULATEINVESTADVISER);
if (adviser != null) {
SimulateInvestConfig config = new SimulateInvestConfig();
config.setAdviser(adviser);
param.setConfig(config);
}
*/
getResultMaps(param, market);
List<String> stockDates = param.getService().getDates(market.getConfig().getMarket());
param.setStockDates(stockDates);
List<String> confList = getConfList();
int ga = param.getInput().getConfig().getEvolveGA();
Evolve evolve = SimulateInvestEvolveFactory.factory(ga);
String evolutionConfigString = param.getInput().getConfig().getImproveAbovebelowEvolutionConfig();
EvolutionConfig evolutionConfig = JsonUtil.convert(evolutionConfigString, EvolutionConfig.class);
//evolutionConfig.setGenerations(3);
//evolutionConfig.setSelect(6);
Map<String, Object> confMap = new HashMap<>();
// confmap
return evolve.evolve(action, param, market, profitdata, buy, subcomponent, parameters, mlTests, confMap , evolutionConfig, getPipeline(), this, confList);
}
@Override
public MLConfigs getOverrideMLConfig(ComponentData componentdata) {
return null;
}
@Override
public void calculateIncDec(ComponentData param, ProfitData profitdata, Memories positions, Boolean above,
List<MLMetricsItem> mlTests, Parameters parameters) {
}
@Override
public List<MemoryItem> calculateMemory(ComponentData param, Parameters parameters) throws Exception {
return null;
}
@Override
public String getPipeline() {
return PipelineConstants.SIMULATEINVEST;
}
@Override
protected List<String> getConfList() {
List<String> confList = new ArrayList<>();
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEFINDTIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCEHOLDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCEHOLDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCETRENDINCREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTCONFIDENCETRENDINCREASETIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCETRENDDECREASE);
confList.add(IclijConfigConstants.SIMULATEINVESTNOCONFIDENCETRENDDECREASETIMES);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOPLOSS);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOPLOSSVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVALSTOPLOSS);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVALSTOPLOSSVALUE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORPURE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORREBASE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORREVERSE);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORDIRECTION);
confList.add(IclijConfigConstants.SIMULATEINVESTINDICATORDIRECTIONUP);
confList.add(IclijConfigConstants.SIMULATEINVESTMLDATE);
confList.add(IclijConfigConstants.SIMULATEINVESTSTOCKS);
confList.add(IclijConfigConstants.SIMULATEINVESTBUYWEIGHT);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERVAL);
confList.add(IclijConfigConstants.SIMULATEINVESTINTERPOLATE);
confList.add(IclijConfigConstants.SIMULATEINVESTADVISER);
confList.add(IclijConfigConstants.SIMULATEINVESTPERIOD);
confList.add(IclijConfigConstants.SIMULATEINVESTDAY);
return confList;
}
@Override
public String getThreshold() {
return null;
}
@Override
public String getFuturedays() {
return null;
}
@Override
protected EvolutionConfig getImproveEvolutionConfig(IclijConfig config) {
String evolveString = config.getImproveAbovebelowEvolutionConfig();
return JsonUtil.convert(evolveString, EvolutionConfig.class);
}
public Object[] calculateAccuracy(ComponentData componentparam) throws Exception {
return new Object[] { componentparam.getScoreMap().get("score") };
}
private double increase(Capital capital, int buytop, List<Astock> mystocks, List<String> stockDates, int indexOffset,
Map<String, List<List<Double>>> categoryValueMap, int prevIndexOffset) {
List<Double> incs = new ArrayList<>();
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (prevIndexOffset <= -1) {
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valWas != null && valNow != null) {
double inc = valNow / valWas;
incs.add(inc);
}
} else {
// put back if unknown
//mystocks.add(item);
}
}
if (incs.isEmpty()) {
return 1.0;
}
OptionalDouble average = incs
.stream()
.mapToDouble(a -> a)
.average();
return average.getAsDouble();
}
private void lastbuysell(List<String> stockDates, LocalDate date, Adviser adviser, Capital capital, SimulateInvestConfig simConfig, Map<String, List<List<Double>>> categoryValueMap, List<Astock> mystocks, int extradelay, int prevIndexOffset, Pair<Integer, Integer>[] hits, int findTimes, String aParameter, List<String> excludeList, Map<String, Object> map, int trendInc, int trendDec) {
mystocks = new ArrayList<>(mystocks);
date = TimeUtil.getForwardEqualAfter2(date, 0 /* findTime */, stockDates);
String datestring = TimeUtil.convertDate2(date);
int indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
// get recommendations
List<Astock> holdIncrease = new ArrayList<>();
int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
List<Astock> sells = new ArrayList<>();
List<Astock> buys = new ArrayList<>();
if (simConfig.getIntervalStoploss()) {
// TODO delay
stoploss(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset - extradelay, sells, simConfig.getIntervalStoplossValue(), "ISTOP");
}
double myreliability = getReliability(mystocks, hits, findTimes, up);
boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc >= simConfig.getConfidencetrendincreaseTimes();
boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec >= simConfig.getNoconfidencetrenddecreaseTimes();
boolean noconfidence = !confidence || !confidence1 || noconfidence2;
if (!noconfidence) {
int delay = 0;
mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, excludeList, aParameter,
mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay);
} else {
mystocks = noConfidenceHoldSell(mystocks, holdIncrease, sells, simConfig);
}
List<String> ids = mystocks.stream().map(Astock::getId).collect(Collectors.toList());
List<String> buyids = buys.stream().map(Astock::getId).collect(Collectors.toList());
List<String> sellids = sells.stream().map(Astock::getId).collect(Collectors.toList());
if (!noconfidence) {
int buyCnt = simConfig.getStocks() - mystocks.size();
buyCnt = Math.min(buyCnt, buys.size());
ids.addAll(buyids.subList(0, buyCnt));
buyids = buyids.subList(0, buyCnt);
} else {
buyids.clear();
}
ids.removeAll(sellids);
map.put("lastbuysell", "Buy: " + buyids + " Sell: " + sellids + " Stocks: " +ids);
}
private double getReliability(List<Astock> mystocks, Pair<Integer, Integer>[] hits, int findTimes, int up) {
Pair<Integer, Integer> pair = new ImmutablePair(up, mystocks.size());
for (int j = findTimes - 1; j > 0; j--) {
hits[j] = hits[j - 1];
}
hits[0] = pair;
double count = 0;
int total = 0;
for (Pair<Integer, Integer> aPair : hits) {
if (aPair == null) {
continue;
}
count += aPair.getLeft();
total += aPair.getRight();
}
double reliability = 1;
if (total > 0) {
reliability = count / total;
}
return reliability;
}
private void stoploss(Capital capital, int buytop, List<Astock> mystocks, List<String> stockDates, int indexOffset,
Map<String, List<List<Double>>> categoryValueMap, int prevIndexOffset, List<Astock> sells, double stoploss, String stop) {
List<Astock> newSells = new ArrayList<>();
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
String dateNowStr = stockDates.get(stockDates.size() - 1 - indexOffset);
LocalDate dateNow = null;
try {
dateNow = TimeUtil.convertDate(dateNowStr);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
if (!dateNow.isAfter(item.buydate)) {
continue;
}
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (prevIndexOffset <= -1) {
int jj = 0;
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valWas != null && valNow != null && valNow != 0 && valWas != 0 && valNow / valWas < stoploss) {
item.status = stop;
newSells.add(item);
}
}
}
mystocks.removeAll(newSells);
sells.addAll(newSells);
}
private void buy(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital, int buytop, List<Astock> mystocks, List<Astock> newbuys, boolean buyweight, LocalDate date, int indexOffset) {
int buys = buytop - mystocks.size();
buys = Math.min(buys, newbuys.size());
double totalweight = 0;
if (buyweight) {
for (int i = 0; i < buys; i++) {
totalweight += Math.abs(newbuys.get(i).weight);
}
}
double totalamount = 0;
for (int i = 0; i < buys; i++) {
Astock astock = newbuys.get(i);
String id = astock.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
double amount = 0;
if (!buyweight) {
amount = capital.amount / buys;
} else {
amount = capital.amount * astock.weight / totalweight;
}
astock.buyprice = valNow;
astock.count = amount / astock.buyprice;
String dateNow = stockDates.get(stockDates.size() - 1 - indexOffset);
try {
date = TimeUtil.convertDate(dateNow);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
astock.buydate = date;
mystocks.add(astock);
totalamount += amount;
} else {
log.error("Not found");
}
}
}
capital.amount -= totalamount;
}
private int update(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital,
List<Astock> mystocks, int indexOffset, List<Astock> noConfKeep, int prevIndexOffset) {
int up = 0;
for (Astock item : mystocks) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
item.price = valNow;
}
if (prevIndexOffset <= -1) {
continue;
}
Double valWas = mainList.get(mainList.size() - 1 - prevIndexOffset);
if (valNow != null && valWas != null) {
if (valNow > valWas) {
up++;
noConfKeep.add(item);
}
}
}
}
return up;
}
private void sell(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap, Capital capital,
List<Astock> sells, List<Astock> stockhistory, int indexOffset, LocalDate date, List<Astock> mystocks) {
for (Astock item : sells) {
String id = item.id;
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
item.sellprice = valNow;
String dateNow = stockDates.get(stockDates.size() - 1 - indexOffset);
try {
date = TimeUtil.convertDate(dateNow);
} catch (ParseException e) {
log.error(Constants.EXCEPTION, e);
}
item.selldate = date;
stockhistory.add(item);
capital.amount += item.count * item.sellprice;
} else {
// put back if unknown
mystocks.add(item);
}
} else {
// put back if unknown
mystocks.add(item);
}
}
}
private List<Astock> getSellList(List<Astock> mystocks, List<Astock> newbuys) {
List<String> myincids = newbuys.stream().map(Astock::getId).collect(Collectors.toList());
return mystocks.stream().filter(e -> !myincids.contains(e.id)).collect(Collectors.toList());
}
private List<Astock> getBuyList(List<String> stockDates, Map<String, List<List<Double>>> categoryValueMap,
List<IncDecItem> myincs, int indexOffset, Integer count) {
List<Astock> newbuys = new ArrayList<>();
for (IncDecItem item : myincs) {
String id = item.getId();
List<List<Double>> resultList = categoryValueMap.get(id);
if (resultList == null || resultList.isEmpty()) {
continue;
}
List<Double> mainList = resultList.get(0);
ValidateUtil.validateSizes(mainList, stockDates);
if (mainList != null) {
Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
if (valNow != null) {
Astock astock = new Astock();
astock.id = id;
//astock.price = -1;
astock.weight = Math.abs(item.getScore());
newbuys.add(astock);
count--;
if (count == 0) {
break;
}
}
}
}
return newbuys;
}
class Astock {
public String id;
public double price;
public double count;
public double buyprice;
public double sellprice;
public LocalDate buydate;
public LocalDate selldate;
public double weight;
public String status;
public String getId() {
return id;
}
public String toString() {
MathUtil mu = new MathUtil();
return id + " " + mu.round(price, 3) + " " + count + " " + mu.round(buyprice, 3) + " " + mu.round(sellprice, 3) + " " + buydate + " " + selldate;
}
}
class Capital {
public double amount;
public String toString() {
return "" + new MathUtil().round(amount, 2);
}
}
private List<IncDecItem> getAllIncDecs(Market market, LocalDate investStart, LocalDate investEnd) {
try {
return IclijDbDao.getAllIncDecs(market.getConfig().getMarket(), investStart, investEnd, null);
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
return new ArrayList<>();
}
private List<MemoryItem> getAllMemories(Market market, LocalDate investStart, LocalDate investEnd) {
try {
return IclijDbDao.getAllMemories(market.getConfig().getMarket(), IclijConstants.IMPROVEABOVEBELOW, PipelineConstants.ABOVEBELOW, null, null, investStart, investEnd);
// also filter on params
} catch (Exception e) {
log.error(Constants.EXCEPTION, e);
}
return new ArrayList<>();
}
private List<MetaItem> getAllMetas(ComponentData param) {
return param.getService().getMetas();
}
private void getResultMaps(SimulateInvestData param, Market market) {
//Map<String, List<Object>> objectMap = new HashMap<>();
IclijConfig config = param.getInput().getConfig();
Map<String, Object> aMap = new HashMap<>();
// for improve evolver
//List<MetaItem> metas = param.getService().getMetas();
//MetaItem meta = new MetaUtil().findMeta(metas, market.getConfig().getMarket());
//ComponentData componentData = component.improve2(action, param, market, profitdata, null, buy, subcomponent, parameters, mlTests);
// don't need these both here and in getevolveml?
aMap.put(ConfigConstants.MACHINELEARNING, false);
aMap.put(ConfigConstants.AGGREGATORS, false);
aMap.put(ConfigConstants.INDICATORS, true);
aMap.put(ConfigConstants.INDICATORSMACD, true);
aMap.put(ConfigConstants.MISCTHRESHOLD, null);
aMap.put(ConfigConstants.MISCMYTABLEDAYS, 0);
aMap.put(ConfigConstants.MISCMYDAYS, 0);
aMap.put(ConfigConstants.MISCPERCENTIZEPRICEINDEX, true);
aMap.put(ConfigConstants.MISCINTERPOLATIONMETHOD, market.getConfig().getInterpolate());
aMap.put(ConfigConstants.MISCMERGECY, false);
// different line
param.getResultMap(null, aMap);
Map<String, Map<String, Object>> mapsRebase = param.getResultMaps();
param.setResultRebaseMaps(mapsRebase);
aMap.put(ConfigConstants.MISCPERCENTIZEPRICEINDEX, false);
// different line
param.getResultMap(null, aMap);
//Map<String, Map<String, Object>> maps = param.getResultMaps();
//param.getAndSetWantedCategoryValueMap();
/*
for (Entry<String, Map<String, Object>> entry : maps.entrySet()) {
String key = entry.getKey();
System.out.println("key " + key);
System.out.println("keys " + entry.getValue().keySet());
}
*/
//Integer cat = (Integer) maps.get(PipelineConstants.META).get(PipelineConstants.WANTEDCAT);
//String catName = new MetaUtil().getCategory(meta, cat);
//Map<String, Object> resultMaps = maps.get(catName);
/*
if (resultMaps != null) {
Map<String, Object> macdMaps = (Map<String, Object>) resultMaps.get(PipelineConstants.INDICATORMACD);
//System.out.println("macd"+ macdMaps.keySet());
objectMap = (Map<String, List<Object>>) macdMaps.get(PipelineConstants.OBJECT);
}
*/
//return resultMaps;
}
// loop
// update values with indexoffset - extra
// get advise based on indexoffset info (TODO extra)
// get istoploss sells with indexoffset
// get buy list with indexoffset - delay - extra
// stoploss is based on indexoffset - extra
// algo 0
// loop
// get recommend for buy sell on date1
// sell buy on date1
// date1 = date1 + 1w
// calculate capital after 1w, new date1
// endloop
// #calculate capital after 1w
// # remember stoploss
// algo 1
// loop
// get findprofit recommendations from last week on date1
// ignore sell buy if not reliable lately
// sell buy
// date += 1w
// calc new capital
// endloop
// algo 2
// incr date by 1w
// loop
// date1
// stocklist
// check pr date1 top 5 for last 1m 1w etc
// if stocklist in top 5, keep, else sell
// buy stocklist in top 5
// date1 += 1w
// calc new capital
// endloop
// #get stocklist value
// use mach highest mom
// improve with ds
}
| Last buy/sell recommendation fix, temp commit, for simulate invest action (I220).
| iclij/iclij-core/src/main/java/roart/component/SimulateInvestComponent.java | Last buy/sell recommendation fix, temp commit, for simulate invest action (I220). | <ide><path>clij/iclij-core/src/main/java/roart/component/SimulateInvestComponent.java
<ide> import roart.common.util.MetaUtil;
<ide> import roart.common.util.TimeUtil;
<ide> import roart.common.util.ValidateUtil;
<add>import roart.component.adviser.AboveBelowAdviser;
<ide> import roart.component.adviser.Adviser;
<ide> import roart.component.adviser.AdviserFactory;
<ide> import roart.component.model.ComponentData;
<ide> }
<ide> }
<ide>
<add> long time0 = System.currentTimeMillis();
<add> AboveBelowAdviser.time1 = 0;
<add> AboveBelowAdviser.time2 = 0;
<add> long time3 = 0;
<add> long time4 = 0;
<ide> for (int offset = 0; offset < end; offset++) {
<ide>
<ide> Capital capital = new Capital();
<ide> int findTimes = simConfig.getConfidenceFindTimes();
<ide> Pair<Integer, Integer>[] hits = new ImmutablePair[findTimes];
<ide>
<del> int trendInc = 0;
<del> int trendDec = 0;
<add> Integer[] trendInc = new Integer[] { 0 };
<add> Integer[] trendDec = new Integer[] { 0 };
<add> Pair<Integer, Integer> trendIncDec = new ImmutablePair<>(0, 0);
<ide>
<ide> int prevIndexOffset = 0;
<ide> //try {
<ide> String datestring = TimeUtil.convertDate2(date);
<ide> indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
<ide>
<del> Trend trend = null;
<del> try {
<del> trend = new TrendUtil().getTrend(interval, null /*TimeUtil.convertDate2(olddate)*/, indexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
<del> } catch (Exception e) {
<del> log.error(Constants.ERROR, e);
<del> }
<del> if (trend != null && trend.incAverage < 0) {
<del> int jj = 0;
<del> }
<del> log.debug("Trend {}", trend);
<del>
<del> if (trend != null) {
<del> if (trend.incAverage > 1) {
<del> trendInc++;
<del> trendDec = 0;
<del> } else {
<del> trendInc = 0;
<del> trendDec++;
<del> }
<del> }
<add> Trend trend = getTrendIncDec(market, param, stockDates, interval, filteredCategoryValueMap, trendInc, trendDec, indexOffset);
<ide> // get recommendations
<ide>
<del> List<String> volumeExcludes = new ArrayList<>();
<del> getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
<del> indexOffset, volumeExcludes);
<del>
<del> List<String> myExcludes = new ArrayList<>();
<del> myExcludes.addAll(configExcludeList);
<del> myExcludes.addAll(volumeExcludes);
<add> List<String> myExcludes = getExclusions(simConfig, extradelay, stockDates, interval, categoryValueMap,
<add> volumeMap, configExcludeList, delay, indexOffset);
<add>
<ide> double myavg = increase(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset);
<del> List<Astock> holdIncrease = new ArrayList<>();
<add>
<add> List<Astock> holdIncrease = new ArrayList<>();
<ide> int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
<ide>
<ide> List<Astock> sells = new ArrayList<>();
<ide> double myreliability = getReliability(mystocks, hits, findTimes, up);
<ide>
<ide> boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
<del> boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc >= simConfig.getConfidencetrendincreaseTimes();
<del> boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec >= simConfig.getNoconfidencetrenddecreaseTimes();
<add> boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc[0] >= simConfig.getConfidencetrendincreaseTimes();
<add> boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec[0] >= simConfig.getNoconfidencetrenddecreaseTimes();
<ide> boolean noconfidence = !confidence || !confidence1 || noconfidence2;
<ide> if (!noconfidence) {
<ide> mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, myExcludes,
<ide> }
<ide> if (offset == 0) {
<ide> try {
<del> List<String> myExcludes = new ArrayList<>();
<del> myExcludes.addAll(configExcludeList);
<del> List<String> volumeExcludes = new ArrayList<>();
<del> getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
<del> indexOffset, volumeExcludes);
<del> myExcludes.addAll(volumeExcludes);
<del> lastbuysell(stockDates, date, adviser, capital, simConfig, categoryValueMap, mystocks, extradelay, prevIndexOffset, hits, findTimes, aParameter, myExcludes, param.getUpdateMap(), trendInc, trendDec);
<add> lastbuysell(stockDates, date, adviser, capital, simConfig, categoryValueMap, mystocks, extradelay, prevIndexOffset, hits, findTimes, aParameter, param.getUpdateMap(), trendInc, trendDec, configExcludeList, param, market, interval, filteredCategoryValueMap, volumeMap, delay);
<ide> } catch (Exception e) {
<ide> log.error(Constants.EXCEPTION, e);
<ide> }
<ide> componentData.getUpdateMap().putAll(map);
<ide> }
<ide> }
<add> log.info("time0 {}", System.currentTimeMillis() - time0);
<add> log.info("time1 {}", AboveBelowAdviser.time1);
<add> log.info("time2 {}", AboveBelowAdviser.time2);
<add> log.info("time2 {}", time3);
<add> log.info("time2 {}", time4);
<ide> }
<ide>
<ide> Double score = 0.0;
<ide>
<ide> handle2(action, market, componentData, profitdata, positions, evolve, aMap, subcomponent, mlmarket, parameters);
<ide> return componentData;
<add> }
<add>
<add> private List<String> getExclusions(SimulateInvestConfig simConfig, int extradelay, List<String> stockDates,
<add> int interval, Map<String, List<List<Double>>> categoryValueMap, Map<String, List<List<Object>>> volumeMap,
<add> List<String> configExcludeList, int delay, int indexOffset) {
<add> List<String> myExcludes = new ArrayList<>();
<add> List<String> volumeExcludes = new ArrayList<>();
<add> getVolumeExcludes(simConfig, extradelay, stockDates, interval, categoryValueMap, volumeMap, delay,
<add> indexOffset, volumeExcludes);
<add>
<add> myExcludes.addAll(configExcludeList);
<add> myExcludes.addAll(volumeExcludes);
<add> return myExcludes;
<add> }
<add>
<add> private Trend getTrendIncDec(Market market, ComponentData param, List<String> stockDates, int interval,
<add> Map<String, List<List<Double>>> filteredCategoryValueMap, Integer[] trendInc, Integer[] trendDec,
<add> int indexOffset) {
<add> Trend trend = null;
<add> try {
<add> trend = new TrendUtil().getTrend(interval, null /*TimeUtil.convertDate2(olddate)*/, indexOffset, stockDates /*, findTime*/, param, market, filteredCategoryValueMap);
<add> } catch (Exception e) {
<add> log.error(Constants.ERROR, e);
<add> }
<add> if (trend != null && trend.incAverage < 0) {
<add> int jj = 0;
<add> }
<add> log.debug("Trend {}", trend);
<add>
<add> if (trend != null) {
<add> if (trend.incAverage > 1) {
<add> trendInc[0]++;
<add> trendDec[0] = 0;
<add> } else {
<add> trendInc[0] = 0;
<add> trendDec[0]++;
<add> }
<add> }
<add> return trend;
<ide> }
<ide>
<ide> private void getVolumeExcludes(SimulateInvestConfig simConfig, int extradelay, List<String> stockDates,
<ide> } else {
<ide> buysTmp = getBuyList(stockDates, categoryValueMap, myincs, indexOffset - delay - extradelay, simConfig.getStocks());
<ide> }
<add> myincs = null;
<ide> //buysTmp = filter(buysTmp, sells);
<ide> List<Astock> keeps = keep(mystocks, buysTmp);
<ide> keeps.addAll(hold);
<ide> return average.getAsDouble();
<ide> }
<ide>
<del> private void lastbuysell(List<String> stockDates, LocalDate date, Adviser adviser, Capital capital, SimulateInvestConfig simConfig, Map<String, List<List<Double>>> categoryValueMap, List<Astock> mystocks, int extradelay, int prevIndexOffset, Pair<Integer, Integer>[] hits, int findTimes, String aParameter, List<String> excludeList, Map<String, Object> map, int trendInc, int trendDec) {
<add> private void lastbuysell(List<String> stockDates, LocalDate date, Adviser adviser, Capital capital, SimulateInvestConfig simConfig, Map<String, List<List<Double>>> categoryValueMap, List<Astock> mystocks, int extradelay, int prevIndexOffset, Pair<Integer, Integer>[] hits, int findTimes, String aParameter, Map<String, Object> map, Integer[] trendInc, Integer[] trendDec, List<String> configExcludeList, ComponentData param, Market market, int interval, Map<String, List<List<Double>>> filteredCategoryValueMap, Map<String, List<List<Object>>> volumeMap, int delay) {
<ide> mystocks = new ArrayList<>(mystocks);
<ide> date = TimeUtil.getForwardEqualAfter2(date, 0 /* findTime */, stockDates);
<ide> String datestring = TimeUtil.convertDate2(date);
<ide> int indexOffset = stockDates.size() - 1 - TimeUtil.getIndexEqualAfter(stockDates, datestring);
<ide>
<add> Trend trend = getTrendIncDec(market, param, stockDates, interval, filteredCategoryValueMap, trendInc, trendDec, indexOffset);
<ide> // get recommendations
<ide>
<del> List<Astock> holdIncrease = new ArrayList<>();
<add> List<String> myExcludes = getExclusions(simConfig, extradelay, stockDates, interval, categoryValueMap,
<add> volumeMap, configExcludeList, delay, indexOffset);
<add>
<add> double myavg = increase(capital, simConfig.getStocks(), mystocks, stockDates, indexOffset - extradelay, categoryValueMap, prevIndexOffset);
<add>
<add> List<Astock> holdIncrease = new ArrayList<>();
<ide> int up = update(stockDates, categoryValueMap, capital, mystocks, indexOffset - extradelay, holdIncrease, prevIndexOffset - extradelay);
<ide>
<ide> List<Astock> sells = new ArrayList<>();
<ide> double myreliability = getReliability(mystocks, hits, findTimes, up);
<ide>
<ide> boolean confidence = !simConfig.getConfidence() || myreliability >= simConfig.getConfidenceValue();
<del> boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc >= simConfig.getConfidencetrendincreaseTimes();
<del> boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec >= simConfig.getNoconfidencetrenddecreaseTimes();
<add> boolean confidence1 = !simConfig.getConfidencetrendincrease() || trendInc[0] >= simConfig.getConfidencetrendincreaseTimes();
<add> boolean noconfidence2 = simConfig.getNoconfidencetrenddecrease() && trendDec[0] >= simConfig.getNoconfidencetrenddecreaseTimes();
<ide> boolean noconfidence = !confidence || !confidence1 || noconfidence2;
<ide> if (!noconfidence) {
<del> int delay = 0;
<del> mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, excludeList, aParameter,
<del> mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay);
<add> int delay0 = 0;
<add> mystocks = confidenceBuyHoldSell(simConfig, stockDates, categoryValueMap, adviser, myExcludes, aParameter,
<add> mystocks, date, indexOffset, sells, buys, holdIncrease, extradelay, delay0);
<ide> } else {
<ide> mystocks = noConfidenceHoldSell(mystocks, holdIncrease, sells, simConfig);
<ide> }
<ide> List<Double> mainList = resultList.get(0);
<ide> ValidateUtil.validateSizes(mainList, stockDates);
<ide> if (mainList != null) {
<del> Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
<add> Double valNow = mainList.get(mainList.size() - 1 - indexOffset);
<ide> if (valNow != null) {
<ide> Astock astock = new Astock();
<ide> astock.id = id; |
|
JavaScript | mit | 3acd001cdbedd89aa771e8d832c1e74bd64cff6a | 0 | dickhardt/node-a2p3 | /*
* A2P3 App Module
*
* library to make it easy to build A2P3 apps with node.js
*
* Copyright (C) Province of British Columbia, 2013
*/
var request = require('request')
, urlParse = require('url').parse
, jwt = require('./jwt')
, fs = require('fs')
, async = require('async')
var CONFIG_FILE = __dirname + '/../config.json'
var VAULT_FILE = __dirname + '/../vault.json'
if ( !fs.existsSync( CONFIG_FILE ) ) throw new Error('could not find "'+CONFIG_FILE+'"')
if ( !fs.existsSync( VAULT_FILE ) ) throw new Error('could not find "'+VAULT_FILE+'"')
var config = require(CONFIG_FILE)
var vault = require(VAULT_FILE)
// makes sure config and vault have what we need, sets defaults not provided
if (!config) throw new Error('Invalid config')
if (!config.appID) throw new Error('No appID in config')
if (!config.device) throw new Error('No device in config')
if (!config.name) throw new Error('No name in config')
if (!vault) throw new Error('Invalid vault')
config.ix = config.ix || 'ix.a2p3.net'
config.ixURL = config.ixURL || 'http://ix.a2p3.net'
if (!vault[config.ix] || !vault[config.ix].latest) throw new Error('No keys for IX in vault.')
config.alg = config.alg || 'HS512'
config.auth = config.auth || { passcode: true, authorization: true }
// create an Agent Request
function createAgentRequest ( returnURL, resources ) {
var credentials = vault[ config.ix ].latest
var details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': config.ix
, 'iat': jwt.iat()
, 'request.a2p3.org':
{ 'resources': resources
, 'auth': config.auth
, 'returnURL': returnURL
}
}
, credentials: credentials
}
this.agentRequest = jwt.jws( details )
return this.agentRequest
}
// Resource constructor
function Resource ( ) {
return this
}
function processResponse ( callback ) {
return function processResponse ( error, response, body ) {
var data = null
, err = null
if ( error ) {
err = new Error(error)
return callback( err, null)
}
if ( response.statusCode != 200 ) {
err = new Error('Server responded with '+response.statusCode)
return callback( err, null)
}
try {
data = JSON.parse(body)
}
catch (e){
return callback( e, null)
}
if (data.error) {
err = new Error(data.error.message)
return callback( err, null)
}
callback( null, data.result )
}
}
// Exchange the IX Token for the RS Tokens
Resource.prototype.exchange = function exchange ( agentRequest, ixToken, callback ) {
var that = this
, credentials = vault[config.ix].latest
, details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': config.ix
, 'iat': jwt.iat()
, 'request.a2p3.org':
{ 'token': ixToken
, 'request': agentRequest
}
}
, credentials: credentials
}
var ixRequest = jwt.jws( details )
request.post( config.ixURL + '/exchange'
, { form: { request: ixRequest } }
, processResponse( function ( e, result ) {
if (e) return callback( e )
that.ix = result // store results in this.ix for later
callback( null, that.ix.sub )
})
)
}
// call a Resource API
Resource.prototype.call = function call ( api, params, callback ) {
if (typeof params === 'function') {
callback = params
params = {}
}
var that = this
, url = urlParse( api )
, apiHost = url.hostname
, err = null
if ( !that.ix ) {
err = new Error('No IX exchange results in A2P3 Resource object.')
return callback( err )
}
// check if we are calling a standardized resource, and if so, map to the first redirect
if ( that.ix.redirects && that.ix.redirects[ apiHost ] ) {
var newApiHost = that.ix.redirects[ apiHost ][ 0 ]
api = api.replace( apiHost, newApiHost )
apiHost = newApiHost
}
if ( !that.ix.tokens || !that.ix.tokens[ apiHost] ) {
err = new Error('No Resource Server token found in A2P3 Resource object for "'+apiHost+'".')
return callback( err )
}
if ( !vault[ apiHost ] || !vault[ apiHost ].latest ) {
err = new Error('No keys found in vault for "'+apiHost+'".')
return callback( err )
}
var credentials = vault[ apiHost ].latest
var details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': apiHost
, 'iat': jwt.iat()
, 'request.a2p3.org': params
}
, credentials: credentials
}
details.payload['request.a2p3.org'].token = that.ix.tokens[ apiHost]
var rsRequest = jwt.jws( details )
request.post( api, { form: { request: rsRequest } } , processResponse( callback ) )
}
// calls mulitple Resource APIs and all Standardized Resource redirected resources
Resource.prototype.callMultiple = function callMultiple ( apis, callback ) {
var that = this
, err = null
if ( !that.ix ) {
err = new Error('No IX exchange results in A2P3 Resource object.')
return callback( err )
}
var tasks = {}
var redirectResults = {}
Object.keys( apis ).forEach( function ( api ) {
var url = urlParse( api )
, apiHost = url.hostname
// check if we are calling a standardized resource, and if so, call each redirected resource
if ( that.ix.redirects && that.ix.redirects[ apiHost ] ) {
Object.keys( that.ix.redirects[ apiHost ] ).forEach( function ( host ) {
var redirectApi = api.replace( apiHost, host )
tasks[host] = function( done ) { that.call( redirectApi, apis[api], done ) }
})
redirectResults[apiHost] = { redirect: Object.keys( that.ix.redirects[ apiHost ] ) }
} else {
tasks[apiHost] = function( done ) { that.call( api, apis[api], done ) }
}
})
async.parallel( tasks, function ( error, results ) {
if ( results )
Object.keys( redirectResults ).forEach( function ( redirect ) {
results[redirect] = redirectResults[redirect]
})
callback( error, results )
})
}
exports.Resource = Resource
exports.createAgentRequest = createAgentRequest
exports.random16bytes = function() {
return jwt.handle()
}
| lib/a2p3.js | /*
* A2P3 App Module
*
* library to make it easy to build A2P3 apps with node.js
*
* Copyright (C) Province of British Columbia, 2013
*/
var request = require('request')
, urlParse = require('url').parse
, jwt = require('./jwt')
, fs = require('fs')
, async = require('async')
var CONFIG_FILE = __dirname + '/../config.json'
var VAULT_FILE = __dirname + '/../vault.json'
if ( !fs.existsSync( CONFIG_FILE ) ) throw new Error('could not find "'+CONFIG_FILE+'"')
if ( !fs.existsSync( VAULT_FILE ) ) throw new Error('could not find "'+VAULT_FILE+'"')
var config = require(CONFIG_FILE)
var vault = require(VAULT_FILE)
// makes sure config and vault have what we need, sets defaults not provided
if (!config) throw new Error('Invalid config')
if (!config.appID) throw new Error('No appID in config')
if (!config.device) throw new Error('No device in config')
if (!config.name) throw new Error('No name in config')
if (!vault) throw new Error('Invalid vault')
config.ix = config.ix || 'ix.a2p3.net'
config.ixURL = config.ixURL || 'http://ix.a2p3.net'
if (!vault[config.ix] || !vault[config.ix].latest) throw new Error('No keys for IX in vault.')
config.alg = config.alg || 'HS512'
config.auth = config.auth || { passcode: true, authorization: true }
// create an Agent Request
function createAgentRequest ( returnURL, resources ) {
var credentials = vault[ config.ix ].latest
var details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': config.ix
, 'iat': jwt.iat()
, 'request.a2p3.org':
{ 'resources': resources
, 'auth': config.auth
, 'returnURL': returnURL
}
}
, credentials: credentials
}
this.agentRequest = jwt.jws( details )
return this.agentRequest
}
// Resource constructor
function Resource ( ) {
return this
}
function processResponse ( callback ) {
return function processResponse ( error, response, body ) {
var data = null
, err = null
if ( error ) {
err = new Error(error)
return callback( err, null)
}
if ( response.statusCode != 200 ) {
err = new Error('Server responded with '+response.statusCode)
return callback( err, null)
}
try {
data = JSON.parse(body)
}
catch (e){
return callback( e, null)
}
if (data.error) {
err = new Error(data.error.message)
return callback( err, null)
}
callback( null, data.result )
}
}
// Exchange the IX Token for the RS Tokens
Resource.prototype.exchange = function exchange ( agentRequest, ixToken, callback ) {
var that = this
, credentials = vault[config.ix].latest
, details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': config.ix
, 'iat': jwt.iat()
, 'request.a2p3.org':
{ 'token': ixToken
, 'request': agentRequest
}
}
, credentials: credentials
}
var ixRequest = jwt.jws( details )
request.post( config.ixURL + '/exchange'
, { form: { request: ixRequest } }
, processResponse( function ( e, result ) {
if (e) return callback( e )
that.ix = result // store results in this.ix for later
callback( null, that.ix.sub )
})
)
}
// call a Resource API
Resource.prototype.call = function call ( api, params, callback ) {
if (typeof params === 'function') {
callback = params
params = {}
}
var that = this
, url = urlParse( api )
, apiHost = url.hostname
, err = null
if ( !that.ix ) {
err = new Error('No IX exchange results in A2P3 Resource object.')
return callback( err )
}
// check if we are calling a standardized resource, and if so, map to the first redirect
if ( that.ix.redirects && that.ix.redirects[ apiHost ] ) {
var newApiHost = that.ix.redirects[ apiHost ][ 0 ]
api = api.replace( apiHost, newApiHost )
apiHost = newApiHost
}
if ( !that.ix.tokens || !that.ix.tokens[ apiHost] ) {
err = new Error('No Resource Server token found in A2P3 Resource object for "'+apiHost+'".')
return callback( err )
}
if ( !vault[ apiHost ] || !vault[ apiHost ].latest ) {
err = new Error('No keys found in vault for "'+apiHost+'".')
return callback( err )
}
var credentials = vault[ apiHost ].latest
var details =
{ header:
{ typ: 'JWS'
, alg: config.alg
}
, payload:
{ 'iss': config.appID
, 'aud': apiHost
, 'iat': jwt.iat()
, 'request.a2p3.org': params
}
, credentials: credentials
}
details.payload['request.a2p3.org'].token = that.ix.tokens[ apiHost]
var rsRequest = jwt.jws( details )
request.post( api, { form: { request: rsRequest } } , processResponse( callback ) )
}
exports.Resource = Resource
exports.createAgentRequest = createAgentRequest
exports.random16bytes = function() {
return jwt.handle()
}
| added callMultiple
| lib/a2p3.js | added callMultiple | <ide><path>ib/a2p3.js
<ide> request.post( api, { form: { request: rsRequest } } , processResponse( callback ) )
<ide> }
<ide>
<add>
<add>
<add>
<add>// calls mulitple Resource APIs and all Standardized Resource redirected resources
<add>Resource.prototype.callMultiple = function callMultiple ( apis, callback ) {
<add> var that = this
<add> , err = null
<add>
<add> if ( !that.ix ) {
<add> err = new Error('No IX exchange results in A2P3 Resource object.')
<add> return callback( err )
<add> }
<add>
<add> var tasks = {}
<add> var redirectResults = {}
<add> Object.keys( apis ).forEach( function ( api ) {
<add> var url = urlParse( api )
<add> , apiHost = url.hostname
<add> // check if we are calling a standardized resource, and if so, call each redirected resource
<add> if ( that.ix.redirects && that.ix.redirects[ apiHost ] ) {
<add> Object.keys( that.ix.redirects[ apiHost ] ).forEach( function ( host ) {
<add> var redirectApi = api.replace( apiHost, host )
<add> tasks[host] = function( done ) { that.call( redirectApi, apis[api], done ) }
<add> })
<add> redirectResults[apiHost] = { redirect: Object.keys( that.ix.redirects[ apiHost ] ) }
<add> } else {
<add> tasks[apiHost] = function( done ) { that.call( api, apis[api], done ) }
<add> }
<add> })
<add> async.parallel( tasks, function ( error, results ) {
<add> if ( results )
<add> Object.keys( redirectResults ).forEach( function ( redirect ) {
<add> results[redirect] = redirectResults[redirect]
<add> })
<add> callback( error, results )
<add> })
<add>}
<add>
<add>
<ide> exports.Resource = Resource
<ide> exports.createAgentRequest = createAgentRequest
<ide> |
|
Java | mit | error: pathspec 'src/org/adaptlab/chpir/android/activerecordcloudsync/HttpPushr.java' did not match any file(s) known to git
| 6bbca8d672c50fc006eb45b7d4fbae7907287e22 | 1 | mnipper/AndroidSurvey,DukeMobileTech/AndroidSurvey,mnipper/AndroidSurvey,mnipper/AndroidSurvey | package org.adaptlab.chpir.android.activerecordcloudsync;
import android.util.Log;
public class HttpPushr {
private static final String TAG = "HttpPushr";
private Class<? extends SendTable> mSendTableClass;
private String mRemoteTableName;
public HttpPushr(String remoteTableName, Class<? extends SendTable> sendTableClass) {
mSendTableClass = sendTableClass;
mRemoteTableName = remoteTableName;
}
public void push() {
if (ActiveRecordCloudSync.getEndPoint() == null) {
Log.i(TAG, "ActiveRecordCloudSync end point is not set!");
return;
}
// TODO Push non-pushed entries in mSendTableClass to remote table
}
}
| src/org/adaptlab/chpir/android/activerecordcloudsync/HttpPushr.java | Add HttpPushr
| src/org/adaptlab/chpir/android/activerecordcloudsync/HttpPushr.java | Add HttpPushr | <ide><path>rc/org/adaptlab/chpir/android/activerecordcloudsync/HttpPushr.java
<add>package org.adaptlab.chpir.android.activerecordcloudsync;
<add>
<add>import android.util.Log;
<add>
<add>public class HttpPushr {
<add> private static final String TAG = "HttpPushr";
<add> private Class<? extends SendTable> mSendTableClass;
<add> private String mRemoteTableName;
<add>
<add> public HttpPushr(String remoteTableName, Class<? extends SendTable> sendTableClass) {
<add> mSendTableClass = sendTableClass;
<add> mRemoteTableName = remoteTableName;
<add> }
<add>
<add> public void push() {
<add> if (ActiveRecordCloudSync.getEndPoint() == null) {
<add> Log.i(TAG, "ActiveRecordCloudSync end point is not set!");
<add> return;
<add> }
<add>
<add> // TODO Push non-pushed entries in mSendTableClass to remote table
<add> }
<add>} |
|
Java | apache-2.0 | 7bad3c3298e299634fc34aa3fe019a6841ba10b5 | 0 | atomicjets/distributed-graph-analytics,Sotera/distributed-graph-analytics,atomicjets/distributed-graph-analytics,Sotera/distributed-graph-analytics,atomicjets/distributed-graph-analytics,Sotera/distributed-graph-analytics | package com.soteradefense.dga.highbetweenness;
import org.apache.giraph.conf.GiraphConfiguration;
import org.apache.giraph.io.formats.InMemoryVertexOutputFormat;
import org.apache.giraph.utils.InternalVertexRunner;
import org.apache.giraph.utils.TestGraph;
import org.apache.hadoop.io.IntWritable;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class HBSEComputeTest {
public GiraphConfiguration getConf() {
GiraphConfiguration conf = new GiraphConfiguration();
conf.setMasterComputeClass(HBSEMasterCompute.class);
conf.setComputationClass(HBSEVertexComputation.class);
conf.setVertexOutputFormatClass(InMemoryVertexOutputFormat.class);
conf.set("betweenness.output.dir", "tmp/output");
conf.set("betweenness.set.stability", "1");
conf.set("betweenness.set.maxSize", "10");
conf.set("betweenness.set.stability.counter", "3");
conf.set("pivot.batch.string", "1,2,3,4,5");
conf.set("pivot.batch.size", "5");
conf.set("vertex.count", "7");
return conf;
}
@Test
public void testComputeOutput() throws Exception {
GiraphConfiguration conf = getConf();
TestGraph<IntWritable, VertexData, IntWritable> input = getFirstTestGraph(conf);
InMemoryVertexOutputFormat.initializeOutputGraph(conf);
InternalVertexRunner.run(conf, input);
TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
assertEquals(8, output.getVertices().size());
assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() > 0.0, true);
assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() > 0.0, true);
assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
}
@Test
public void testGraphWithShortestPathOne() throws Exception {
GiraphConfiguration conf = getConf();
TestGraph<IntWritable, VertexData, IntWritable> input = getShortestPathOneTestGraph(conf);
InMemoryVertexOutputFormat.initializeOutputGraph(conf);
InternalVertexRunner.run(conf, input);
TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
assertEquals(8, output.getVertices().size());
assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
}
@Test
public void testTwoCriticalPointGraph() throws Exception {
GiraphConfiguration conf = getConf();
TestGraph<IntWritable, VertexData, IntWritable> input = getTwoCriticalPointGraph(conf);
InMemoryVertexOutputFormat.initializeOutputGraph(conf);
InternalVertexRunner.run(conf, input);
TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
assertEquals(16, output.getVertices().size());
assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(9)).getValue().getApproxBetweenness() > 0.0, true);
assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(10)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(11)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(12)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(13)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(14)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(15)).getValue().getApproxBetweenness() == 0.0, true);
assertEquals(output.getVertex(new IntWritable(16)).getValue().getApproxBetweenness() == 0.0, true);
}
private TestGraph<IntWritable, VertexData, IntWritable> getTwoCriticalPointGraph(GiraphConfiguration conf) {
TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(3), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(4), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(5), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(6), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(7), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(8), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(10), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(11), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(12), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(13), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(14), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(15), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(16), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(9), new IntWritable(1));
testGraph.addEdge(new IntWritable(9), new IntWritable(1), new IntWritable(1));
return testGraph;
}
private TestGraph<IntWritable, VertexData, IntWritable> getShortestPathOneTestGraph(GiraphConfiguration conf) {
TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(3), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(4), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(5), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(6), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(7), new IntWritable(1));
testGraph.addEdge(new IntWritable(1), new IntWritable(8), new IntWritable(1));
return testGraph;
}
private TestGraph<IntWritable, VertexData, IntWritable> getFirstTestGraph(GiraphConfiguration conf) {
TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
testGraph.addEdge(new IntWritable(2), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(3), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(4), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(5), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(6), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(7), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(2), new IntWritable(8), new IntWritable(1));
return testGraph;
}
}
| dga-giraph/src/test/java/com/soteradefense/dga/highbetweenness/HBSEComputeTest.java | package com.soteradefense.dga.highbetweenness;
import org.apache.giraph.conf.GiraphConfiguration;
import org.apache.giraph.io.formats.InMemoryVertexOutputFormat;
import org.apache.giraph.utils.InternalVertexRunner;
import org.apache.giraph.utils.TestGraph;
import org.apache.hadoop.io.IntWritable;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class HBSEComputeTest {
public GiraphConfiguration getConf() {
GiraphConfiguration conf = new GiraphConfiguration();
conf.setMasterComputeClass(HBSEMasterCompute.class);
conf.setComputationClass(HBSEVertexComputation.class);
conf.setVertexOutputFormatClass(InMemoryVertexOutputFormat.class);
conf.set("betweenness.output.dir", "tmp/output");
conf.set("betweenness.set.stability", "1");
conf.set("betweenness.set.maxSize", "10");
conf.set("betweenness.set.stability.counter", "3");
conf.set("pivot.batch.string", "1,2,3,4,5");
conf.set("pivot.batch.size", "5");
conf.set("vertex.count", "7");
return conf;
}
@Test
public void testComputeOutput() throws Exception {
GiraphConfiguration conf = getConf();
TestGraph<IntWritable, VertexData, IntWritable> input = getGraph(conf);
InMemoryVertexOutputFormat.initializeOutputGraph(conf);
InternalVertexRunner.run(conf, input);
TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
assertEquals(8, output.getVertices().size());
assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() > 0.0, true);
assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() > 0.0, true);
}
private TestGraph<IntWritable, VertexData, IntWritable> getGraph(GiraphConfiguration conf) {
TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
testGraph.addEdge(new IntWritable(2), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(3), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(4), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(5), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(6), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(7), new IntWritable(1), new IntWritable(1));
testGraph.addEdge(new IntWritable(2), new IntWritable(8), new IntWritable(1));
return testGraph;
}
}
| Added a few more tests
| dga-giraph/src/test/java/com/soteradefense/dga/highbetweenness/HBSEComputeTest.java | Added a few more tests | <ide><path>ga-giraph/src/test/java/com/soteradefense/dga/highbetweenness/HBSEComputeTest.java
<ide> @Test
<ide> public void testComputeOutput() throws Exception {
<ide> GiraphConfiguration conf = getConf();
<del> TestGraph<IntWritable, VertexData, IntWritable> input = getGraph(conf);
<add> TestGraph<IntWritable, VertexData, IntWritable> input = getFirstTestGraph(conf);
<ide> InMemoryVertexOutputFormat.initializeOutputGraph(conf);
<ide> InternalVertexRunner.run(conf, input);
<ide> TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
<ide> assertEquals(8, output.getVertices().size());
<ide> assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() > 0.0, true);
<ide> assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() > 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
<ide> }
<ide>
<del> private TestGraph<IntWritable, VertexData, IntWritable> getGraph(GiraphConfiguration conf) {
<add> @Test
<add> public void testGraphWithShortestPathOne() throws Exception {
<add> GiraphConfiguration conf = getConf();
<add> TestGraph<IntWritable, VertexData, IntWritable> input = getShortestPathOneTestGraph(conf);
<add> InMemoryVertexOutputFormat.initializeOutputGraph(conf);
<add> InternalVertexRunner.run(conf, input);
<add> TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
<add> assertEquals(8, output.getVertices().size());
<add> assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
<add>
<add> }
<add>
<add> @Test
<add> public void testTwoCriticalPointGraph() throws Exception {
<add> GiraphConfiguration conf = getConf();
<add> TestGraph<IntWritable, VertexData, IntWritable> input = getTwoCriticalPointGraph(conf);
<add> InMemoryVertexOutputFormat.initializeOutputGraph(conf);
<add> InternalVertexRunner.run(conf, input);
<add> TestGraph<IntWritable, VertexData, IntWritable> output = InMemoryVertexOutputFormat.getOutputGraph();
<add> assertEquals(16, output.getVertices().size());
<add> assertEquals(output.getVertex(new IntWritable(1)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(9)).getValue().getApproxBetweenness() > 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(2)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(3)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(4)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(5)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(6)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(7)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(8)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(10)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(11)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(12)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(13)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(14)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(15)).getValue().getApproxBetweenness() == 0.0, true);
<add> assertEquals(output.getVertex(new IntWritable(16)).getValue().getApproxBetweenness() == 0.0, true);
<add>
<add> }
<add>
<add> private TestGraph<IntWritable, VertexData, IntWritable> getTwoCriticalPointGraph(GiraphConfiguration conf) {
<add> TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(3), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(4), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(5), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(6), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(7), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(8), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(10), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(11), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(12), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(13), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(14), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(15), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(16), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(9), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(9), new IntWritable(1), new IntWritable(1));
<add> return testGraph;
<add> }
<add>
<add> private TestGraph<IntWritable, VertexData, IntWritable> getShortestPathOneTestGraph(GiraphConfiguration conf) {
<add> TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(3), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(4), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(5), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(6), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(7), new IntWritable(1));
<add> testGraph.addEdge(new IntWritable(1), new IntWritable(8), new IntWritable(1));
<add> return testGraph;
<add> }
<add>
<add> private TestGraph<IntWritable, VertexData, IntWritable> getFirstTestGraph(GiraphConfiguration conf) {
<ide> TestGraph<IntWritable, VertexData, IntWritable> testGraph = new TestGraph<IntWritable, VertexData, IntWritable>(conf);
<ide> testGraph.addEdge(new IntWritable(1), new IntWritable(2), new IntWritable(1));
<ide> testGraph.addEdge(new IntWritable(2), new IntWritable(1), new IntWritable(1)); |
|
Java | apache-2.0 | 8c61b45861c820b2ed5a6bb265bdc7c3dab9c829 | 0 | blademainer/intellij-community,apixandru/intellij-community,wreckJ/intellij-community,FHannes/intellij-community,fengbaicanhe/intellij-community,supersven/intellij-community,ivan-fedorov/intellij-community,tmpgit/intellij-community,Lekanich/intellij-community,allotria/intellij-community,robovm/robovm-studio,salguarnieri/intellij-community,xfournet/intellij-community,robovm/robovm-studio,ol-loginov/intellij-community,salguarnieri/intellij-community,fitermay/intellij-community,retomerz/intellij-community,SerCeMan/intellij-community,jexp/idea2,MichaelNedzelsky/intellij-community,xfournet/intellij-community,izonder/intellij-community,vladmm/intellij-community,wreckJ/intellij-community,ivan-fedorov/intellij-community,xfournet/intellij-community,allotria/intellij-community,ahb0327/intellij-community,youdonghai/intellij-community,vladmm/intellij-community,dslomov/intellij-community,blademainer/intellij-community,vladmm/intellij-community,adedayo/intellij-community,vvv1559/intellij-community,Distrotech/intellij-community,robovm/robovm-studio,supersven/intellij-community,gnuhub/intellij-community,allotria/intellij-community,petteyg/intellij-community,petteyg/intellij-community,retomerz/intellij-community,ibinti/intellij-community,wreckJ/intellij-community,blademainer/intellij-community,signed/intellij-community,michaelgallacher/intellij-community,caot/intellij-community,tmpgit/intellij-community,Distrotech/intellij-community,nicolargo/intellij-community,muntasirsyed/intellij-community,SerCeMan/intellij-community,salguarnieri/intellij-community,pwoodworth/intellij-community,alphafoobar/intellij-community,slisson/intellij-community,da1z/intellij-community,suncycheng/intellij-community,fnouama/intellij-community,lucafavatella/intellij-community,clumsy/intellij-community,muntasirsyed/intellij-community,amith01994/intellij-community,ibinti/intellij-community,apixandru/intellij-community,diorcety/intellij-community,hurricup/intellij-community,ftomassetti/intellij-community,samthor/intellij-community,FHannes/intellij-community,apixandru/intellij-community,diorcety/intellij-community,SerCeMan/intellij-community,lucafavatella/intellij-community,ol-loginov/intellij-community,nicolargo/intellij-community,Lekanich/intellij-community,akosyakov/intellij-community,alphafoobar/intellij-community,wreckJ/intellij-community,ryano144/intellij-community,Distrotech/intellij-community,adedayo/intellij-community,slisson/intellij-community,muntasirsyed/intellij-community,samthor/intellij-community,hurricup/intellij-community,holmes/intellij-community,ol-loginov/intellij-community,vladmm/intellij-community,supersven/intellij-community,vvv1559/intellij-community,MichaelNedzelsky/intellij-community,muntasirsyed/intellij-community,gnuhub/intellij-community,diorcety/intellij-community,Lekanich/intellij-community,ryano144/intellij-community,joewalnes/idea-community,kdwink/intellij-community,MichaelNedzelsky/intellij-community,robovm/robovm-studio,kool79/intellij-community,ftomassetti/intellij-community,MER-GROUP/intellij-community,ibinti/intellij-community,fitermay/intellij-community,nicolargo/intellij-community,TangHao1987/intellij-community,ThiagoGarciaAlves/intellij-community,salguarnieri/intellij-community,idea4bsd/idea4bsd,consulo/consulo,TangHao1987/intellij-community,hurricup/intellij-community,pwoodworth/intellij-community,ol-loginov/intellij-community,jexp/idea2,idea4bsd/idea4bsd,ol-loginov/intellij-community,xfournet/intellij-community,petteyg/intellij-community,vvv1559/intellij-community,kdwink/intellij-community,FHannes/intellij-community,jagguli/intellij-community,Distrotech/intellij-community,gnuhub/intellij-community,diorcety/intellij-community,orekyuu/intellij-community,idea4bsd/idea4bsd,clumsy/intellij-community,muntasirsyed/intellij-community,caot/intellij-community,salguarnieri/intellij-community,SerCeMan/intellij-community,amith01994/intellij-community,blademainer/intellij-community,fnouama/intellij-community,da1z/intellij-community,jagguli/intellij-community,hurricup/intellij-community,retomerz/intellij-community,retomerz/intellij-community,izonder/intellij-community,consulo/consulo,michaelgallacher/intellij-community,caot/intellij-community,petteyg/intellij-community,da1z/intellij-community,dslomov/intellij-community,jagguli/intellij-community,adedayo/intellij-community,consulo/consulo,allotria/intellij-community,signed/intellij-community,vvv1559/intellij-community,nicolargo/intellij-community,salguarnieri/intellij-community,SerCeMan/intellij-community,slisson/intellij-community,dslomov/intellij-community,akosyakov/intellij-community,retomerz/intellij-community,ahb0327/intellij-community,petteyg/intellij-community,fitermay/intellij-community,akosyakov/intellij-community,mglukhikh/intellij-community,diorcety/intellij-community,MER-GROUP/intellij-community,wreckJ/intellij-community,alphafoobar/intellij-community,signed/intellij-community,samthor/intellij-community,FHannes/intellij-community,dslomov/intellij-community,lucafavatella/intellij-community,izonder/intellij-community,semonte/intellij-community,suncycheng/intellij-community,lucafavatella/intellij-community,slisson/intellij-community,TangHao1987/intellij-community,tmpgit/intellij-community,ThiagoGarciaAlves/intellij-community,blademainer/intellij-community,da1z/intellij-community,samthor/intellij-community,adedayo/intellij-community,blademainer/intellij-community,adedayo/intellij-community,ThiagoGarciaAlves/intellij-community,supersven/intellij-community,dslomov/intellij-community,da1z/intellij-community,gnuhub/intellij-community,tmpgit/intellij-community,MER-GROUP/intellij-community,alphafoobar/intellij-community,ThiagoGarciaAlves/intellij-community,vvv1559/intellij-community,jexp/idea2,apixandru/intellij-community,nicolargo/intellij-community,supersven/intellij-community,consulo/consulo,joewalnes/idea-community,amith01994/intellij-community,FHannes/intellij-community,allotria/intellij-community,petteyg/intellij-community,da1z/intellij-community,idea4bsd/idea4bsd,TangHao1987/intellij-community,supersven/intellij-community,kdwink/intellij-community,allotria/intellij-community,ahb0327/intellij-community,vladmm/intellij-community,orekyuu/intellij-community,Lekanich/intellij-community,da1z/intellij-community,hurricup/intellij-community,ThiagoGarciaAlves/intellij-community,apixandru/intellij-community,allotria/intellij-community,holmes/intellij-community,kool79/intellij-community,joewalnes/idea-community,tmpgit/intellij-community,signed/intellij-community,wreckJ/intellij-community,nicolargo/intellij-community,supersven/intellij-community,ahb0327/intellij-community,jagguli/intellij-community,fitermay/intellij-community,wreckJ/intellij-community,kdwink/intellij-community,apixandru/intellij-community,TangHao1987/intellij-community,FHannes/intellij-community,amith01994/intellij-community,samthor/intellij-community,diorcety/intellij-community,asedunov/intellij-community,michaelgallacher/intellij-community,ThiagoGarciaAlves/intellij-community,orekyuu/intellij-community,ivan-fedorov/intellij-community,jagguli/intellij-community,tmpgit/intellij-community,gnuhub/intellij-community,holmes/intellij-community,xfournet/intellij-community,jagguli/intellij-community,slisson/intellij-community,amith01994/intellij-community,semonte/intellij-community,dslomov/intellij-community,orekyuu/intellij-community,Distrotech/intellij-community,vvv1559/intellij-community,diorcety/intellij-community,ftomassetti/intellij-community,michaelgallacher/intellij-community,fengbaicanhe/intellij-community,MichaelNedzelsky/intellij-community,dslomov/intellij-community,amith01994/intellij-community,robovm/robovm-studio,vladmm/intellij-community,signed/intellij-community,semonte/intellij-community,da1z/intellij-community,holmes/intellij-community,MER-GROUP/intellij-community,caot/intellij-community,kool79/intellij-community,Lekanich/intellij-community,michaelgallacher/intellij-community,apixandru/intellij-community,ftomassetti/intellij-community,signed/intellij-community,izonder/intellij-community,caot/intellij-community,hurricup/intellij-community,asedunov/intellij-community,adedayo/intellij-community,salguarnieri/intellij-community,FHannes/intellij-community,ibinti/intellij-community,MER-GROUP/intellij-community,ol-loginov/intellij-community,da1z/intellij-community,SerCeMan/intellij-community,hurricup/intellij-community,allotria/intellij-community,slisson/intellij-community,fnouama/intellij-community,ftomassetti/intellij-community,lucafavatella/intellij-community,alphafoobar/intellij-community,ryano144/intellij-community,youdonghai/intellij-community,ftomassetti/intellij-community,holmes/intellij-community,caot/intellij-community,clumsy/intellij-community,kdwink/intellij-community,fnouama/intellij-community,ThiagoGarciaAlves/intellij-community,supersven/intellij-community,youdonghai/intellij-community,youdonghai/intellij-community,pwoodworth/intellij-community,asedunov/intellij-community,amith01994/intellij-community,semonte/intellij-community,michaelgallacher/intellij-community,ahb0327/intellij-community,hurricup/intellij-community,slisson/intellij-community,muntasirsyed/intellij-community,ftomassetti/intellij-community,suncycheng/intellij-community,fitermay/intellij-community,caot/intellij-community,allotria/intellij-community,ryano144/intellij-community,ftomassetti/intellij-community,ol-loginov/intellij-community,Lekanich/intellij-community,adedayo/intellij-community,idea4bsd/idea4bsd,dslomov/intellij-community,ibinti/intellij-community,vvv1559/intellij-community,vvv1559/intellij-community,supersven/intellij-community,idea4bsd/idea4bsd,xfournet/intellij-community,fengbaicanhe/intellij-community,vvv1559/intellij-community,TangHao1987/intellij-community,diorcety/intellij-community,jexp/idea2,MER-GROUP/intellij-community,ernestp/consulo,ftomassetti/intellij-community,consulo/consulo,orekyuu/intellij-community,muntasirsyed/intellij-community,tmpgit/intellij-community,asedunov/intellij-community,MER-GROUP/intellij-community,ftomassetti/intellij-community,diorcety/intellij-community,Distrotech/intellij-community,samthor/intellij-community,ivan-fedorov/intellij-community,hurricup/intellij-community,pwoodworth/intellij-community,Lekanich/intellij-community,fengbaicanhe/intellij-community,petteyg/intellij-community,youdonghai/intellij-community,allotria/intellij-community,muntasirsyed/intellij-community,gnuhub/intellij-community,dslomov/intellij-community,fengbaicanhe/intellij-community,amith01994/intellij-community,ahb0327/intellij-community,blademainer/intellij-community,hurricup/intellij-community,nicolargo/intellij-community,izonder/intellij-community,SerCeMan/intellij-community,da1z/intellij-community,ernestp/consulo,mglukhikh/intellij-community,MichaelNedzelsky/intellij-community,lucafavatella/intellij-community,akosyakov/intellij-community,retomerz/intellij-community,signed/intellij-community,youdonghai/intellij-community,kool79/intellij-community,asedunov/intellij-community,youdonghai/intellij-community,supersven/intellij-community,idea4bsd/idea4bsd,gnuhub/intellij-community,ol-loginov/intellij-community,semonte/intellij-community,allotria/intellij-community,lucafavatella/intellij-community,fengbaicanhe/intellij-community,vladmm/intellij-community,apixandru/intellij-community,Distrotech/intellij-community,joewalnes/idea-community,alphafoobar/intellij-community,hurricup/intellij-community,wreckJ/intellij-community,semonte/intellij-community,michaelgallacher/intellij-community,kool79/intellij-community,izonder/intellij-community,Distrotech/intellij-community,asedunov/intellij-community,robovm/robovm-studio,MichaelNedzelsky/intellij-community,jagguli/intellij-community,slisson/intellij-community,suncycheng/intellij-community,ol-loginov/intellij-community,muntasirsyed/intellij-community,pwoodworth/intellij-community,jagguli/intellij-community,samthor/intellij-community,Lekanich/intellij-community,ol-loginov/intellij-community,ryano144/intellij-community,jexp/idea2,orekyuu/intellij-community,MichaelNedzelsky/intellij-community,clumsy/intellij-community,blademainer/intellij-community,ivan-fedorov/intellij-community,samthor/intellij-community,asedunov/intellij-community,ahb0327/intellij-community,ibinti/intellij-community,kdwink/intellij-community,suncycheng/intellij-community,alphafoobar/intellij-community,MichaelNedzelsky/intellij-community,ibinti/intellij-community,akosyakov/intellij-community,asedunov/intellij-community,mglukhikh/intellij-community,jagguli/intellij-community,akosyakov/intellij-community,orekyuu/intellij-community,holmes/intellij-community,fnouama/intellij-community,izonder/intellij-community,alphafoobar/intellij-community,TangHao1987/intellij-community,lucafavatella/intellij-community,nicolargo/intellij-community,akosyakov/intellij-community,amith01994/intellij-community,suncycheng/intellij-community,signed/intellij-community,tmpgit/intellij-community,lucafavatella/intellij-community,jexp/idea2,ahb0327/intellij-community,mglukhikh/intellij-community,youdonghai/intellij-community,retomerz/intellij-community,Lekanich/intellij-community,supersven/intellij-community,pwoodworth/intellij-community,adedayo/intellij-community,blademainer/intellij-community,signed/intellij-community,kool79/intellij-community,MER-GROUP/intellij-community,caot/intellij-community,holmes/intellij-community,semonte/intellij-community,holmes/intellij-community,clumsy/intellij-community,lucafavatella/intellij-community,dslomov/intellij-community,wreckJ/intellij-community,suncycheng/intellij-community,wreckJ/intellij-community,FHannes/intellij-community,vladmm/intellij-community,signed/intellij-community,allotria/intellij-community,vladmm/intellij-community,michaelgallacher/intellij-community,clumsy/intellij-community,nicolargo/intellij-community,alphafoobar/intellij-community,slisson/intellij-community,wreckJ/intellij-community,kool79/intellij-community,muntasirsyed/intellij-community,asedunov/intellij-community,ahb0327/intellij-community,kool79/intellij-community,ryano144/intellij-community,orekyuu/intellij-community,apixandru/intellij-community,hurricup/intellij-community,holmes/intellij-community,alphafoobar/intellij-community,FHannes/intellij-community,diorcety/intellij-community,pwoodworth/intellij-community,robovm/robovm-studio,robovm/robovm-studio,fitermay/intellij-community,fengbaicanhe/intellij-community,orekyuu/intellij-community,petteyg/intellij-community,blademainer/intellij-community,ivan-fedorov/intellij-community,ryano144/intellij-community,adedayo/intellij-community,xfournet/intellij-community,asedunov/intellij-community,TangHao1987/intellij-community,mglukhikh/intellij-community,pwoodworth/intellij-community,kdwink/intellij-community,kool79/intellij-community,xfournet/intellij-community,mglukhikh/intellij-community,lucafavatella/intellij-community,xfournet/intellij-community,semonte/intellij-community,da1z/intellij-community,clumsy/intellij-community,TangHao1987/intellij-community,ernestp/consulo,MichaelNedzelsky/intellij-community,ThiagoGarciaAlves/intellij-community,salguarnieri/intellij-community,pwoodworth/intellij-community,Distrotech/intellij-community,ThiagoGarciaAlves/intellij-community,semonte/intellij-community,fnouama/intellij-community,joewalnes/idea-community,gnuhub/intellij-community,joewalnes/idea-community,salguarnieri/intellij-community,mglukhikh/intellij-community,ThiagoGarciaAlves/intellij-community,MichaelNedzelsky/intellij-community,suncycheng/intellij-community,amith01994/intellij-community,semonte/intellij-community,muntasirsyed/intellij-community,Lekanich/intellij-community,ibinti/intellij-community,tmpgit/intellij-community,akosyakov/intellij-community,MER-GROUP/intellij-community,TangHao1987/intellij-community,fitermay/intellij-community,ivan-fedorov/intellij-community,vvv1559/intellij-community,fitermay/intellij-community,jexp/idea2,fnouama/intellij-community,gnuhub/intellij-community,kdwink/intellij-community,idea4bsd/idea4bsd,ivan-fedorov/intellij-community,youdonghai/intellij-community,clumsy/intellij-community,suncycheng/intellij-community,petteyg/intellij-community,idea4bsd/idea4bsd,diorcety/intellij-community,idea4bsd/idea4bsd,SerCeMan/intellij-community,ahb0327/intellij-community,pwoodworth/intellij-community,nicolargo/intellij-community,fnouama/intellij-community,adedayo/intellij-community,ol-loginov/intellij-community,xfournet/intellij-community,hurricup/intellij-community,Lekanich/intellij-community,apixandru/intellij-community,ivan-fedorov/intellij-community,amith01994/intellij-community,fengbaicanhe/intellij-community,diorcety/intellij-community,retomerz/intellij-community,kool79/intellij-community,xfournet/intellij-community,fengbaicanhe/intellij-community,ivan-fedorov/intellij-community,idea4bsd/idea4bsd,Lekanich/intellij-community,ibinti/intellij-community,kdwink/intellij-community,lucafavatella/intellij-community,adedayo/intellij-community,youdonghai/intellij-community,ahb0327/intellij-community,mglukhikh/intellij-community,signed/intellij-community,pwoodworth/intellij-community,michaelgallacher/intellij-community,samthor/intellij-community,samthor/intellij-community,retomerz/intellij-community,semonte/intellij-community,izonder/intellij-community,vvv1559/intellij-community,akosyakov/intellij-community,xfournet/intellij-community,fengbaicanhe/intellij-community,jagguli/intellij-community,muntasirsyed/intellij-community,blademainer/intellij-community,dslomov/intellij-community,fengbaicanhe/intellij-community,ryano144/intellij-community,vvv1559/intellij-community,apixandru/intellij-community,caot/intellij-community,FHannes/intellij-community,retomerz/intellij-community,ibinti/intellij-community,samthor/intellij-community,apixandru/intellij-community,youdonghai/intellij-community,joewalnes/idea-community,fitermay/intellij-community,asedunov/intellij-community,Distrotech/intellij-community,xfournet/intellij-community,ibinti/intellij-community,MichaelNedzelsky/intellij-community,petteyg/intellij-community,ftomassetti/intellij-community,mglukhikh/intellij-community,ryano144/intellij-community,slisson/intellij-community,mglukhikh/intellij-community,adedayo/intellij-community,amith01994/intellij-community,ThiagoGarciaAlves/intellij-community,asedunov/intellij-community,youdonghai/intellij-community,TangHao1987/intellij-community,holmes/intellij-community,salguarnieri/intellij-community,salguarnieri/intellij-community,MichaelNedzelsky/intellij-community,vladmm/intellij-community,vvv1559/intellij-community,michaelgallacher/intellij-community,ibinti/intellij-community,SerCeMan/intellij-community,kool79/intellij-community,TangHao1987/intellij-community,ThiagoGarciaAlves/intellij-community,fitermay/intellij-community,akosyakov/intellij-community,consulo/consulo,FHannes/intellij-community,samthor/intellij-community,jagguli/intellij-community,michaelgallacher/intellij-community,orekyuu/intellij-community,apixandru/intellij-community,SerCeMan/intellij-community,akosyakov/intellij-community,ernestp/consulo,akosyakov/intellij-community,izonder/intellij-community,gnuhub/intellij-community,alphafoobar/intellij-community,fengbaicanhe/intellij-community,mglukhikh/intellij-community,retomerz/intellij-community,kdwink/intellij-community,MER-GROUP/intellij-community,fnouama/intellij-community,nicolargo/intellij-community,pwoodworth/intellij-community,clumsy/intellij-community,lucafavatella/intellij-community,nicolargo/intellij-community,gnuhub/intellij-community,fnouama/intellij-community,ahb0327/intellij-community,ftomassetti/intellij-community,jexp/idea2,petteyg/intellij-community,ernestp/consulo,blademainer/intellij-community,idea4bsd/idea4bsd,da1z/intellij-community,joewalnes/idea-community,ernestp/consulo,izonder/intellij-community,clumsy/intellij-community,fitermay/intellij-community,caot/intellij-community,holmes/intellij-community,signed/intellij-community,michaelgallacher/intellij-community,semonte/intellij-community,FHannes/intellij-community,SerCeMan/intellij-community,retomerz/intellij-community,FHannes/intellij-community,tmpgit/intellij-community,izonder/intellij-community,kool79/intellij-community,orekyuu/intellij-community,semonte/intellij-community,kdwink/intellij-community,wreckJ/intellij-community,fnouama/intellij-community,clumsy/intellij-community,ryano144/intellij-community,signed/intellij-community,gnuhub/intellij-community,youdonghai/intellij-community,tmpgit/intellij-community,suncycheng/intellij-community,orekyuu/intellij-community,SerCeMan/intellij-community,fnouama/intellij-community,holmes/intellij-community,idea4bsd/idea4bsd,allotria/intellij-community,ol-loginov/intellij-community,MER-GROUP/intellij-community,MER-GROUP/intellij-community,clumsy/intellij-community,caot/intellij-community,joewalnes/idea-community,slisson/intellij-community,robovm/robovm-studio,tmpgit/intellij-community,suncycheng/intellij-community,Distrotech/intellij-community,mglukhikh/intellij-community,robovm/robovm-studio,jagguli/intellij-community,fitermay/intellij-community,ivan-fedorov/intellij-community,robovm/robovm-studio,dslomov/intellij-community,Distrotech/intellij-community,vladmm/intellij-community,da1z/intellij-community,salguarnieri/intellij-community,fitermay/intellij-community,izonder/intellij-community,ryano144/intellij-community,suncycheng/intellij-community,vladmm/intellij-community,ivan-fedorov/intellij-community,asedunov/intellij-community,caot/intellij-community,ibinti/intellij-community,apixandru/intellij-community,slisson/intellij-community,mglukhikh/intellij-community,supersven/intellij-community,ryano144/intellij-community,petteyg/intellij-community,robovm/robovm-studio,alphafoobar/intellij-community,kdwink/intellij-community,retomerz/intellij-community | package com.intellij.compiler.impl.javaCompiler.javac;
import com.intellij.compiler.OutputParser;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.rt.compiler.JavacResourcesReader;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JavacOutputParser extends OutputParser {
private int myTabSize;
private @NonNls String WARNING_PREFIX = "warning:"; // default value
public JavacOutputParser(Project project) {
myTabSize = CodeStyleSettingsManager.getSettings(project).getTabSize(StdFileTypes.JAVA);
if (ApplicationManager.getApplication().isUnitTestMode()) {
// emulate patterns setup if 'embedded' javac is used (javac is started not via JavacRunner)
addJavacPattern(JavacResourcesReader.MSG_PARSING_STARTED + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[parsing started {0}]");
addJavacPattern(JavacResourcesReader.MSG_PARSING_COMPLETED + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[parsing completed {0}ms]");
addJavacPattern(JavacResourcesReader.MSG_LOADING + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[loading {0}]");
addJavacPattern(JavacResourcesReader.MSG_CHECKING + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[checking {0}]");
addJavacPattern(JavacResourcesReader.MSG_WROTE + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[wrote {0}]");
}
}
public boolean processMessageLine(Callback callback) {
if (super.processMessageLine(callback)) {
return true;
}
final String line = callback.getCurrentLine();
if (line == null) {
return false;
}
if (JavacResourcesReader.MSG_PATTERNS_START.equals(line)) {
myParserActions.clear();
while (true) {
final String patternLine = callback.getNextLine();
if (JavacResourcesReader.MSG_PATTERNS_END.equals(patternLine)) {
break;
}
addJavacPattern(patternLine);
}
return true;
}
int colonIndex1 = line.indexOf(':');
if (colonIndex1 == 1){ // drive letter
colonIndex1 = line.indexOf(':', colonIndex1 + 1);
}
if (colonIndex1 >= 0){ // looks like found something like file path
@NonNls String part1 = line.substring(0, colonIndex1).trim();
if(part1.equalsIgnoreCase("error")) { // jikes
addMessage(callback, CompilerMessageCategory.ERROR, line.substring(colonIndex1));
return true;
}
if(part1.equalsIgnoreCase("warning")) {
addMessage(callback, CompilerMessageCategory.WARNING, line.substring(colonIndex1));
return true;
}
if(part1.equals("javac")) {
addMessage(callback, CompilerMessageCategory.ERROR, line);
return true;
}
final int colonIndex2 = line.indexOf(':', colonIndex1 + 1);
if (colonIndex2 >= 0){
final String filePath = part1.replace(File.separatorChar, '/');
final Boolean fileExists = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>(){
public Boolean compute(){
return LocalFileSystem.getInstance().findFileByPath(filePath) != null? Boolean.TRUE : Boolean.FALSE;
}
});
if (!fileExists.booleanValue()) {
// the part one turned out to be something else than a file path
return true;
}
try {
final int lineNum = Integer.parseInt(line.substring(colonIndex1 + 1, colonIndex2).trim());
String message = line.substring(colonIndex2 + 1).trim();
CompilerMessageCategory category = CompilerMessageCategory.ERROR;
if (message.startsWith(WARNING_PREFIX)){
message = message.substring(WARNING_PREFIX.length()).trim();
category = CompilerMessageCategory.WARNING;
}
List<String> messages = new ArrayList<String>();
messages.add(message);
int colNum;
String prevLine = null;
do{
final String nextLine = callback.getNextLine();
if (nextLine == null) {
return false;
}
if (nextLine.trim().equals("^")){
final int fakeColNum = nextLine.indexOf('^') + 1;
final CharSequence chars = prevLine == null ? line : prevLine;
final int offsetColNum = EditorUtil.calcOffset(null, chars, 0, chars.length(), fakeColNum, 8);
colNum = EditorUtil.calcColumnNumber(null, chars,0, offsetColNum, myTabSize);
break;
}
if (prevLine != null) {
messages.add(prevLine);
}
prevLine = nextLine;
}
while(true);
if (colNum > 0){
messages = convertMessages(messages);
StringBuffer buf = new StringBuffer();
for (final String m : messages) {
if (buf.length() > 0) {
buf.append("\n");
}
buf.append(m);
}
addMessage(callback, category, buf.toString(), VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, filePath), lineNum, colNum);
return true;
}
}
catch (NumberFormatException e) {
}
}
}
if(line.endsWith("java.lang.OutOfMemoryError")) {
addMessage(callback, CompilerMessageCategory.ERROR, CompilerBundle.message("error.javac.out.of.memory"));
return true;
}
addMessage(callback, CompilerMessageCategory.INFORMATION, line);
return true;
}
private static List<String> convertMessages(List<String> messages) {
if(messages.size() <= 1) {
return messages;
}
final String line0 = messages.get(0);
final String line1 = messages.get(1);
final int colonIndex = line1.indexOf(':');
if (colonIndex > 0){
@NonNls String part1 = line1.substring(0, colonIndex).trim();
// jikes
if ("symbol".equals(part1)){
String symbol = line1.substring(colonIndex + 1).trim();
messages.remove(1);
if(messages.size() >= 2) {
messages.remove(1);
}
messages.set(0, line0 + " " + symbol);
}
}
return messages;
}
private void addJavacPattern(@NonNls final String line) {
final int dividerIndex = line.indexOf(JavacResourcesReader.CATEGORY_VALUE_DIVIDER);
if (dividerIndex < 0) {
// by reports it may happen for some IBM JDKs (empty string?)
return;
}
final String category = line.substring(0, dividerIndex);
final String resourceBundleValue = line.substring(dividerIndex + 1);
if (JavacResourcesReader.MSG_PARSING_COMPLETED.equals(category) ||
JavacResourcesReader.MSG_PARSING_STARTED.equals(category) ||
JavacResourcesReader.MSG_WROTE.equals(category)
) {
myParserActions.add(new FilePathActionJavac(createMatcher(resourceBundleValue)));
}
else if (JavacResourcesReader.MSG_CHECKING.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(String parsedData, final Callback callback) {
callback.setProgressText(CompilerBundle.message("progress.compiling.class", parsedData));
}
});
}
else if (JavacResourcesReader.MSG_LOADING.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(@Nullable String parsedData, final Callback callback) {
callback.setProgressText(CompilerBundle.message("progress.loading.classes"));
}
});
}
else if (JavacResourcesReader.MSG_WARNING.equals(category)) {
WARNING_PREFIX = resourceBundleValue;
}
else if (JavacResourcesReader.MSG_STATISTICS.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(@Nullable String parsedData, final Callback callback) {
// empty
}
});
}
}
/**
* made public for Tests, do not use this method directly
*/
public static Matcher createMatcher(@NonNls final String resourceBundleValue) {
@NonNls String regexp = resourceBundleValue.replaceAll("([\\[\\]\\(\\)\\.\\*])", "\\\\$1");
regexp = regexp.replaceAll("\\{\\d+\\}", "(.+)");
return Pattern.compile(regexp, Pattern.CASE_INSENSITIVE).matcher("");
}
public boolean isTrimLines() {
return false;
}
} | compiler/impl/com/intellij/compiler/impl/javaCompiler/javac/JavacOutputParser.java | package com.intellij.compiler.impl.javaCompiler.javac;
import com.intellij.compiler.OutputParser;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.rt.compiler.JavacResourcesReader;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class JavacOutputParser extends OutputParser {
private int myTabSize;
private @NonNls String WARNING_PREFIX = "warning:"; // default value
public JavacOutputParser(Project project) {
myTabSize = CodeStyleSettingsManager.getSettings(project).getTabSize(StdFileTypes.JAVA);
if (ApplicationManager.getApplication().isUnitTestMode()) {
// emulate patterns setup if 'embedded' javac is used (javac is started not via JavacRunner)
addJavacPattern(JavacResourcesReader.MSG_PARSING_STARTED + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[parsing started {0}]");
addJavacPattern(JavacResourcesReader.MSG_PARSING_COMPLETED + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[parsing completed {0}ms]");
addJavacPattern(JavacResourcesReader.MSG_LOADING + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[loading {0}]");
addJavacPattern(JavacResourcesReader.MSG_CHECKING + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[checking {0}]");
addJavacPattern(JavacResourcesReader.MSG_WROTE + JavacResourcesReader.CATEGORY_VALUE_DIVIDER + "[wrote {0}]");
}
}
public boolean processMessageLine(Callback callback) {
if (super.processMessageLine(callback)) {
return true;
}
final String line = callback.getCurrentLine();
if (line == null) {
return false;
}
if (JavacResourcesReader.MSG_PATTERNS_START.equals(line)) {
myParserActions.clear();
while (true) {
final String patternLine = callback.getNextLine();
if (JavacResourcesReader.MSG_PATTERNS_END.equals(patternLine)) {
break;
}
addJavacPattern(patternLine);
}
return true;
}
int colonIndex1 = line.indexOf(':');
if (colonIndex1 == 1){ // drive letter
colonIndex1 = line.indexOf(':', colonIndex1 + 1);
}
if (colonIndex1 >= 0){ // looks like found something like file path
@NonNls String part1 = line.substring(0, colonIndex1).trim();
if(part1.equalsIgnoreCase("error")) { // jikes
addMessage(callback, CompilerMessageCategory.ERROR, line.substring(colonIndex1));
return true;
}
if(part1.equalsIgnoreCase("warning")) {
addMessage(callback, CompilerMessageCategory.WARNING, line.substring(colonIndex1));
return true;
}
if(part1.equals("javac")) {
addMessage(callback, CompilerMessageCategory.ERROR, line);
return true;
}
final int colonIndex2 = line.indexOf(':', colonIndex1 + 1);
if (colonIndex2 >= 0){
final String filePath = part1.replace(File.separatorChar, '/');
final Boolean fileExists = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>(){
public Boolean compute(){
return LocalFileSystem.getInstance().findFileByPath(filePath) != null? Boolean.TRUE : Boolean.FALSE;
}
});
if (!fileExists.booleanValue()) {
// the part one turned out to be something else than a file path
return true;
}
try {
final int lineNum = Integer.parseInt(line.substring(colonIndex1 + 1, colonIndex2).trim());
String message = line.substring(colonIndex2 + 1).trim();
CompilerMessageCategory category = CompilerMessageCategory.ERROR;
if (message.startsWith(WARNING_PREFIX)){
message = message.substring(WARNING_PREFIX.length()).trim();
category = CompilerMessageCategory.WARNING;
}
List<String> messages = new ArrayList<String>();
messages.add(message);
int colNum;
String prevLine = null;
do{
final String nextLine = callback.getNextLine();
if (nextLine == null) {
return false;
}
if (nextLine.trim().equals("^")){
final int fakeColNum = nextLine.indexOf('^') + 1;
final CharSequence chars = prevLine == null ? line : prevLine;
final int offsetColNum = EditorUtil.calcOffset(null, chars, 0, chars.length(), fakeColNum, 8);
colNum = EditorUtil.calcColumnNumber(null, chars,0, offsetColNum, myTabSize);
break;
}
if (prevLine != null) {
messages.add(prevLine);
}
prevLine = nextLine;
}
while(true);
if (colNum > 0){
messages = convertMessages(messages);
StringBuffer buf = new StringBuffer();
for (final String m : messages) {
if (buf.length() > 0) {
buf.append("\n");
}
buf.append(m);
}
addMessage(callback, category, buf.toString(), VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, filePath), lineNum, colNum);
return true;
}
}
catch (NumberFormatException e) {
}
}
}
if(line.endsWith("java.lang.OutOfMemoryError")) {
addMessage(callback, CompilerMessageCategory.ERROR, CompilerBundle.message("error.javac.out.of.memory"));
return true;
}
addMessage(callback, CompilerMessageCategory.INFORMATION, line);
return true;
}
private static List<String> convertMessages(List<String> messages) {
if(messages.size() <= 1) {
return messages;
}
final String line0 = messages.get(0);
final String line1 = messages.get(1);
final int colonIndex = line1.indexOf(':');
if (colonIndex > 0){
@NonNls String part1 = line1.substring(0, colonIndex).trim();
// jikes
if ("symbol".equals(part1)){
String symbol = line1.substring(colonIndex + 1).trim();
messages.remove(1);
if(messages.size() >= 2) {
messages.remove(1);
}
messages.set(0, line0 + " " + symbol);
}
}
return messages;
}
private void addJavacPattern(@NonNls final String line) {
final int dividerIndex = line.indexOf(JavacResourcesReader.CATEGORY_VALUE_DIVIDER);
final String category = line.substring(0, dividerIndex);
final String resourceBundleValue = line.substring(dividerIndex + 1);
if (JavacResourcesReader.MSG_PARSING_COMPLETED.equals(category) ||
JavacResourcesReader.MSG_PARSING_STARTED.equals(category) ||
JavacResourcesReader.MSG_WROTE.equals(category)
) {
myParserActions.add(new FilePathActionJavac(createMatcher(resourceBundleValue)));
}
else if (JavacResourcesReader.MSG_CHECKING.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(String parsedData, final Callback callback) {
callback.setProgressText(CompilerBundle.message("progress.compiling.class", parsedData));
}
});
}
else if (JavacResourcesReader.MSG_LOADING.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(@Nullable String parsedData, final Callback callback) {
callback.setProgressText(CompilerBundle.message("progress.loading.classes"));
}
});
}
else if (JavacResourcesReader.MSG_WARNING.equals(category)) {
WARNING_PREFIX = resourceBundleValue;
}
else if (JavacResourcesReader.MSG_STATISTICS.equals(category)) {
myParserActions.add(new JavacParserAction(createMatcher(resourceBundleValue)) {
protected void doExecute(@Nullable String parsedData, final Callback callback) {
// empty
}
});
}
}
/**
* made public for Tests, do not use this method directly
*/
public static Matcher createMatcher(@NonNls final String resourceBundleValue) {
@NonNls String regexp = resourceBundleValue.replaceAll("([\\[\\]\\(\\)\\.\\*])", "\\\\$1");
regexp = regexp.replaceAll("\\{\\d+\\}", "(.+)");
return Pattern.compile(regexp, Pattern.CASE_INSENSITIVE).matcher("");
}
public boolean isTrimLines() {
return false;
}
} | (no message) | compiler/impl/com/intellij/compiler/impl/javaCompiler/javac/JavacOutputParser.java | (no message) | <ide><path>ompiler/impl/com/intellij/compiler/impl/javaCompiler/javac/JavacOutputParser.java
<ide>
<ide> private void addJavacPattern(@NonNls final String line) {
<ide> final int dividerIndex = line.indexOf(JavacResourcesReader.CATEGORY_VALUE_DIVIDER);
<add> if (dividerIndex < 0) {
<add> // by reports it may happen for some IBM JDKs (empty string?)
<add> return;
<add> }
<ide> final String category = line.substring(0, dividerIndex);
<ide> final String resourceBundleValue = line.substring(dividerIndex + 1);
<ide> if (JavacResourcesReader.MSG_PARSING_COMPLETED.equals(category) || |
|
Java | apache-2.0 | error: pathspec 'java/PalindromeLinkedList.java' did not match any file(s) known to git
| 2504feb73108b7a47f06baf3c3e1e540fe31a914 | 1 | robertzm/algotest | /**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
public class Solution {
public boolean isPalindrome(ListNode head) {
if(head == null) return true;
ListNode fast = head, slow = head;
ListNode rHead = null;
while(fast.next != null && fast.next.next != null){
fast = fast.next.next;
ListNode tmp = slow.next;
slow.next = rHead;
rHead = slow;
slow = tmp;
}
if(fast.next == null){
return compare(rHead, slow.next);
}else{
return compare(rHead, slow.next.next) && slow.val == slow.next.val;
}
}
public boolean compare(ListNode head1, ListNode head2){
while(head1 != null && head2 != null){
if(head1.val != head2.val) return false;
head1 = head1.next;
head2 = head2.next;
}
if(head1 != null || head2 != null) return false;
return true;
}
} | java/PalindromeLinkedList.java | Q234 Palindrome Linked List
| java/PalindromeLinkedList.java | Q234 Palindrome Linked List | <ide><path>ava/PalindromeLinkedList.java
<add>/**
<add> * Definition for singly-linked list.
<add> * public class ListNode {
<add> * int val;
<add> * ListNode next;
<add> * ListNode(int x) { val = x; }
<add> * }
<add> */
<add>public class Solution {
<add> public boolean isPalindrome(ListNode head) {
<add> if(head == null) return true;
<add> ListNode fast = head, slow = head;
<add> ListNode rHead = null;
<add> while(fast.next != null && fast.next.next != null){
<add> fast = fast.next.next;
<add> ListNode tmp = slow.next;
<add> slow.next = rHead;
<add> rHead = slow;
<add> slow = tmp;
<add> }
<add> if(fast.next == null){
<add> return compare(rHead, slow.next);
<add> }else{
<add> return compare(rHead, slow.next.next) && slow.val == slow.next.val;
<add> }
<add> }
<add> public boolean compare(ListNode head1, ListNode head2){
<add> while(head1 != null && head2 != null){
<add> if(head1.val != head2.val) return false;
<add> head1 = head1.next;
<add> head2 = head2.next;
<add> }
<add> if(head1 != null || head2 != null) return false;
<add> return true;
<add> }
<add>} |
|
Java | bsd-2-clause | 51c5f8dfe820eeb589214db75a6f4d449e34f067 | 0 | ratan12/Atarashii,AnimeNeko/Atarashii,ratan12/Atarashii,AnimeNeko/Atarashii | package net.somethingdreadful.MAL;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.NotificationCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import com.freshdesk.mobihelp.Mobihelp;
import com.squareup.picasso.Picasso;
import net.somethingdreadful.MAL.account.AccountService;
import net.somethingdreadful.MAL.adapters.IGFPagerAdapter;
import net.somethingdreadful.MAL.api.APIHelper;
import net.somethingdreadful.MAL.api.MALApi;
import net.somethingdreadful.MAL.dialog.ChooseDialogFragment;
import net.somethingdreadful.MAL.dialog.InputDialogFragment;
import net.somethingdreadful.MAL.tasks.TaskJob;
import butterknife.BindView;
import butterknife.ButterKnife;
public class Home extends AppCompatActivity implements ChooseDialogFragment.onClickListener, SwipeRefreshLayout.OnRefreshListener, IGF.IGFCallbackListener, View.OnClickListener, ViewPager.OnPageChangeListener, NavigationView.OnNavigationItemSelectedListener, InputDialogFragment.onClickListener {
private IGF af;
private IGF mf;
private Menu menu;
private BroadcastReceiver networkReceiver;
private String username;
private boolean networkAvailable = true;
private boolean myList = true; //tracks if the user is on 'My List' or not
private int callbackCounter = 0;
@BindView(R.id.navigationView)
NavigationView navigationView;
@BindView(R.id.drawerLayout)
DrawerLayout drawerLayout;
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
//Initializing activity and application
Theme.context = getApplicationContext();
if (AccountService.AccountExists(this)) {
//The following is state handling code
if (state != null) {
myList = state.getBoolean("myList");
networkAvailable = state.getBoolean("networkAvailable", true);
}
//Initializing
Theme.setTheme(this, R.layout.activity_home, false);
Theme.setActionBar(this, new IGFPagerAdapter(getFragmentManager()));
ButterKnife.bind(this);
username = AccountService.getUsername();
//Initializing NavigationView
navigationView.setNavigationItemSelectedListener(this);
navigationView.getMenu().findItem(R.id.nav_list).setChecked(true);
Theme.setNavDrawer(navigationView, this, this);
//Initializing navigation toggle button
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, (Toolbar) findViewById(R.id.actionbar), R.string.drawer_open, R.string.drawer_close) {
};
drawerLayout.addDrawerListener(drawerToggle);
drawerToggle.syncState();
networkReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
checkNetworkAndDisplayCrouton();
myListChanged();
}
};
} else {
Intent firstRunInit = new Intent(this, FirstTimeInit.class);
startActivity(firstRunInit);
finish();
}
NfcHelper.disableBeam(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_home, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
ComponentName cn = new ComponentName(this, SearchActivity.class);
searchView.setSearchableInfo(searchManager.getSearchableInfo(cn));
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.listType_all:
getRecords(true, TaskJob.GETLIST, 0);
setChecked(item);
break;
case R.id.listType_inprogress:
getRecords(true, TaskJob.GETLIST, 1);
setChecked(item);
break;
case R.id.listType_completed:
getRecords(true, TaskJob.GETLIST, 2);
setChecked(item);
break;
case R.id.listType_onhold:
getRecords(true, TaskJob.GETLIST, 3);
setChecked(item);
break;
case R.id.listType_dropped:
getRecords(true, TaskJob.GETLIST, 4);
setChecked(item);
break;
case R.id.listType_planned:
getRecords(true, TaskJob.GETLIST, 5);
setChecked(item);
break;
case R.id.listType_rewatching:
getRecords(true, TaskJob.GETLIST, 6);
setChecked(item);
break;
case R.id.forceSync:
synctask(true);
break;
case R.id.sort_title:
sortRecords(1, item);
break;
case R.id.sort_score:
sortRecords(2, item);
break;
case R.id.sort_type:
sortRecords(3, item);
break;
case R.id.sort_status:
sortRecords(4, item);
break;
case R.id.sort_progress:
sortRecords(5, item);
break;
case R.id.menu_details:
item.setChecked(!item.isChecked());
if (af != null && mf != null) {
af.details();
mf.details();
}
break;
case R.id.menu_inverse:
item.setChecked(!item.isChecked());
if (af != null && mf != null) {
af.inverse();
mf.inverse();
}
break;
}
return super.onOptionsItemSelected(item);
}
private void sortRecords(int sortType, MenuItem item) {
setChecked(item);
if (af != null && mf != null) {
af.sort(sortType);
mf.sort(sortType);
}
}
private void getRecords(boolean clear, TaskJob task, int list) {
if (af != null && mf != null) {
af.getRecords(clear, task, list);
mf.getRecords(clear, task, list);
if (task == TaskJob.FORCESYNC)
syncNotify();
}
}
@Override
public void onResume() {
super.onResume();
checkNetworkAndDisplayCrouton();
registerReceiver(networkReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
@Override
public void onPause() {
super.onPause();
if (menu != null)
menu.findItem(R.id.action_search).collapseActionView();
unregisterReceiver(networkReceiver);
}
private void synctask(boolean clear) {
getRecords(clear, TaskJob.FORCESYNC, af.list);
}
@Override
public void onSaveInstanceState(Bundle state) {
//This is telling out future selves that we already have some things and not to do them
state.putBoolean("networkAvailable", networkAvailable);
state.putBoolean("myList", myList);
super.onSaveInstanceState(state);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
this.menu = menu;
if (af != null) {
//All this is handling the ticks in the switch list menu
switch (af.list) {
case 0:
setChecked(menu.findItem(R.id.listType_all));
break;
case 1:
setChecked(menu.findItem(R.id.listType_inprogress));
break;
case 2:
setChecked(menu.findItem(R.id.listType_completed));
break;
case 3:
setChecked(menu.findItem(R.id.listType_onhold));
break;
case 4:
setChecked(menu.findItem(R.id.listType_dropped));
break;
case 5:
setChecked(menu.findItem(R.id.listType_planned));
break;
case 6:
setChecked(menu.findItem(R.id.listType_rewatching));
break;
}
}
menu.findItem(R.id.sort_title).setChecked(true);
myListChanged();
return true;
}
private void setChecked(MenuItem item) {
if (item != null)
item.setChecked(true);
}
private void myListChanged() {
if (menu != null) {
if (af != null && mf != null)
menu.findItem(R.id.menu_details).setChecked(myList && af.getDetails());
menu.findItem(R.id.menu_listType).setVisible(myList);
menu.findItem(R.id.menu_sort).setVisible(myList);
menu.findItem(R.id.menu_inverse).setVisible(myList || (!AccountService.isMAL() && af.taskjob == TaskJob.GETMOSTPOPULAR));
menu.findItem(R.id.forceSync).setVisible(myList && networkAvailable);
menu.findItem(R.id.action_search).setVisible(networkAvailable);
}
}
/**
* Creates the sync notification.
*/
private void syncNotify() {
Intent notificationIntent = new Intent(this, Home.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 1, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setOngoing(true)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.toast_info_SyncMessage))
.setContentIntent(contentIntent);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(R.id.notification_sync, mBuilder.build());
}
private void showLogoutDialog() {
ChooseDialogFragment lcdf = new ChooseDialogFragment();
Bundle bundle = new Bundle();
bundle.putString("title", getString(R.string.dialog_label_logout));
bundle.putString("message", getString(R.string.dialog_message_logout));
bundle.putString("positive", getString(R.string.dialog_label_logout));
lcdf.setArguments(bundle);
lcdf.setCallback(this);
lcdf.show(getFragmentManager(), "fragment_LogoutConfirmationDialog");
}
private void checkNetworkAndDisplayCrouton() {
if (APIHelper.isNetworkAvailable(this) && !networkAvailable)
synctask(false);
networkAvailable = APIHelper.isNetworkAvailable(this);
}
@Override
public void onRefresh() {
if (networkAvailable)
synctask(false);
else {
if (af != null && mf != null) {
af.toggleSwipeRefreshAnimation(false);
mf.toggleSwipeRefreshAnimation(false);
}
Theme.Snackbar(this, R.string.toast_error_noConnectivity);
}
}
@Override
public void onIGFReady(IGF igf) {
igf.setUsername(AccountService.getUsername());
if (igf.isAnime())
af = igf;
else
mf = igf;
// do forced sync after FirstInit
if (PrefManager.getForceSync()) {
if (af != null && mf != null) {
PrefManager.setForceSync(false);
PrefManager.commitChanges();
synctask(true);
}
} else {
if (igf.taskjob == null) {
igf.getRecords(true, TaskJob.GETLIST, PrefManager.getDefaultList());
}
}
}
@Override
public void onRecordsLoadingFinished(TaskJob job) {
if (!job.equals(TaskJob.FORCESYNC)) {
return;
}
callbackCounter++;
if (callbackCounter >= 2) {
callbackCounter = 0;
if (job.equals(TaskJob.FORCESYNC)) {
NotificationManager nm = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel(R.id.notification_sync);
}
}
}
@Override
public void onItemClick(int id, MALApi.ListType listType, String username) {
Intent startDetails = new Intent(this, DetailView.class);
startDetails.putExtra("recordID", id);
startDetails.putExtra("recordType", listType);
startDetails.putExtra("username", username);
startActivity(startDetails);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.Image:
Intent Profile = new Intent(this, ProfileActivity.class);
Profile.putExtra("username", username);
startActivity(Profile);
break;
case R.id.NDimage:
InputDialogFragment lcdf = new InputDialogFragment();
Bundle bundle = new Bundle();
bundle.putInt("id", R.id.NDimage);
bundle.putString("title", getString(R.string.dialog_title_update_navigation));
bundle.putString("hint", getString(R.string.dialog_message_update_navigation));
bundle.putString("message", PrefManager.getNavigationBackground());
lcdf.setArguments(bundle);
lcdf.setCallback(this);
lcdf.show(getFragmentManager(), "fragment_InputDialogFragment");
break;
}
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (menu != null)
menu.findItem(R.id.listType_rewatching).setTitle(getString(position == 0 ? R.string.listType_rewatching : R.string.listType_rereading));
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
@Override
public void onPositiveButtonClicked() {
AccountService.clearData();
startActivity(new Intent(this, FirstTimeInit.class));
System.exit(0);
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
//Checking if the item should be checked & if the list status has been changed
switch (item.getItemId()) {
case R.id.nav_profile:
case R.id.nav_friends:
case R.id.nav_forum:
case R.id.nav_schedule:
case R.id.nav_charts:
case R.id.nav_settings:
case R.id.nav_support:
case R.id.nav_about:
break;
default:
// Set the list tracker to false. It will be updated later in the code.
myList = false;
if (item.isChecked())
item.setChecked(false);
else
item.setChecked(true);
break;
}
// disable swipeRefresh for other lists
af.setSwipeRefreshEnabled(myList);
mf.setSwipeRefreshEnabled(myList);
//Closing drawer on item click
drawerLayout.closeDrawers();
//Performing the action
switch (item.getItemId()) {
case R.id.nav_list:
getRecords(true, TaskJob.GETLIST, af.list);
myList = true;
break;
case R.id.nav_profile:
Intent Profile = new Intent(this, ProfileActivity.class);
Profile.putExtra("username", username);
startActivity(Profile);
break;
case R.id.nav_friends:
Intent Friends = new Intent(this, ProfileActivity.class);
Friends.putExtra("username", username);
Friends.putExtra("friends", username);
startActivity(Friends);
break;
case R.id.nav_forum:
if (networkAvailable)
startActivity(new Intent(this, ForumActivity.class));
else
Theme.Snackbar(this, R.string.toast_error_noConnectivity);
break;
case R.id.nav_schedule:
startActivity(new Intent(this, ScheduleActivity.class));
break;
case R.id.nav_charts:
startActivity(new Intent(this, ChartActivity.class));
break;
case R.id.nav_browse:
if (AccountService.isMAL())
startActivity(new Intent(this, BrowseActivity.class));
else
Theme.Snackbar(this, R.string.toast_info_disabled);
break;
case R.id.nav_logout: // Others subgroup
showLogoutDialog();
break;
case R.id.nav_settings:
startActivity(new Intent(this, Settings.class));
break;
case R.id.nav_support:
Mobihelp.showSupport(this);
break;
case R.id.nav_about:
startActivity(new Intent(this, AboutActivity.class));
break;
}
myListChanged();
return false;
}
@Override
public void onPosInputButtonClicked(String text, int id) {
Picasso.with(this)
.load(text)
.placeholder(R.drawable.atarashii_background)
.error(R.drawable.atarashii_background)
.into((ImageView) findViewById(R.id.NDimage));
PrefManager.setNavigationBackground(text);
PrefManager.commitChanges();
}
@Override
public void onNegInputButtonClicked(int id) {
Picasso.with(this)
.load(R.drawable.atarashii_background)
.placeholder(R.drawable.atarashii_background)
.error(R.drawable.atarashii_background)
.into((ImageView) findViewById(R.id.NDimage));
PrefManager.setNavigationBackground(null);
PrefManager.commitChanges();
}
}
| Atarashii/src/net/somethingdreadful/MAL/Home.java | package net.somethingdreadful.MAL;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.NotificationCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import com.freshdesk.mobihelp.Mobihelp;
import com.squareup.picasso.Picasso;
import net.somethingdreadful.MAL.account.AccountService;
import net.somethingdreadful.MAL.adapters.IGFPagerAdapter;
import net.somethingdreadful.MAL.api.APIHelper;
import net.somethingdreadful.MAL.api.MALApi;
import net.somethingdreadful.MAL.dialog.ChooseDialogFragment;
import net.somethingdreadful.MAL.dialog.InputDialogFragment;
import net.somethingdreadful.MAL.tasks.TaskJob;
import butterknife.BindView;
import butterknife.ButterKnife;
public class Home extends AppCompatActivity implements ChooseDialogFragment.onClickListener, SwipeRefreshLayout.OnRefreshListener, IGF.IGFCallbackListener, View.OnClickListener, ViewPager.OnPageChangeListener, NavigationView.OnNavigationItemSelectedListener, InputDialogFragment.onClickListener {
private IGF af;
private IGF mf;
private Menu menu;
private BroadcastReceiver networkReceiver;
private String username;
private boolean networkAvailable = true;
private boolean myList = true; //tracks if the user is on 'My List' or not
private int callbackCounter = 0;
@BindView(R.id.navigationView)
NavigationView navigationView;
@BindView(R.id.drawerLayout)
DrawerLayout drawerLayout;
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
//Initializing activity and application
Theme.context = getApplicationContext();
if (AccountService.AccountExists(this)) {
//The following is state handling code
if (state != null) {
myList = state.getBoolean("myList");
networkAvailable = state.getBoolean("networkAvailable", true);
}
//Initializing
Theme.setTheme(this, R.layout.activity_home, false);
Theme.setActionBar(this, new IGFPagerAdapter(getFragmentManager()));
ButterKnife.bind(this);
username = AccountService.getUsername();
//Initializing NavigationView
navigationView.setNavigationItemSelectedListener(this);
navigationView.getMenu().findItem(R.id.nav_list).setChecked(true);
Theme.setNavDrawer(navigationView, this, this);
//Initializing navigation toggle button
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, (Toolbar) findViewById(R.id.actionbar), R.string.drawer_open, R.string.drawer_close) {
};
drawerLayout.addDrawerListener(drawerToggle);
drawerToggle.syncState();
networkReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
checkNetworkAndDisplayCrouton();
myListChanged();
}
};
} else {
Intent firstRunInit = new Intent(this, FirstTimeInit.class);
startActivity(firstRunInit);
finish();
}
NfcHelper.disableBeam(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_home, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
ComponentName cn = new ComponentName(this, SearchActivity.class);
searchView.setSearchableInfo(searchManager.getSearchableInfo(cn));
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.listType_all:
getRecords(true, TaskJob.GETLIST, 0);
setChecked(item);
break;
case R.id.listType_inprogress:
getRecords(true, TaskJob.GETLIST, 1);
setChecked(item);
break;
case R.id.listType_completed:
getRecords(true, TaskJob.GETLIST, 2);
setChecked(item);
break;
case R.id.listType_onhold:
getRecords(true, TaskJob.GETLIST, 3);
setChecked(item);
break;
case R.id.listType_dropped:
getRecords(true, TaskJob.GETLIST, 4);
setChecked(item);
break;
case R.id.listType_planned:
getRecords(true, TaskJob.GETLIST, 5);
setChecked(item);
break;
case R.id.listType_rewatching:
getRecords(true, TaskJob.GETLIST, 6);
setChecked(item);
break;
case R.id.forceSync:
synctask(true);
break;
case R.id.sort_title:
sortRecords(1, item);
break;
case R.id.sort_score:
sortRecords(2, item);
break;
case R.id.sort_type:
sortRecords(3, item);
break;
case R.id.sort_status:
sortRecords(4, item);
break;
case R.id.sort_progress:
sortRecords(5, item);
break;
case R.id.menu_details:
item.setChecked(!item.isChecked());
if (af != null && mf != null) {
af.details();
mf.details();
}
break;
case R.id.menu_inverse:
item.setChecked(!item.isChecked());
if (af != null && mf != null) {
af.inverse();
mf.inverse();
}
break;
}
return super.onOptionsItemSelected(item);
}
private void sortRecords(int sortType, MenuItem item) {
setChecked(item);
if (af != null && mf != null) {
af.sort(sortType);
mf.sort(sortType);
}
}
private void getRecords(boolean clear, TaskJob task, int list) {
if (af != null && mf != null) {
af.getRecords(clear, task, list);
mf.getRecords(clear, task, list);
if (task == TaskJob.FORCESYNC)
syncNotify();
}
}
@Override
public void onResume() {
super.onResume();
checkNetworkAndDisplayCrouton();
registerReceiver(networkReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
@Override
public void onPause() {
super.onPause();
if (menu != null)
menu.findItem(R.id.action_search).collapseActionView();
unregisterReceiver(networkReceiver);
}
private void synctask(boolean clear) {
getRecords(clear, TaskJob.FORCESYNC, af.list);
}
@Override
public void onSaveInstanceState(Bundle state) {
//This is telling out future selves that we already have some things and not to do them
state.putBoolean("networkAvailable", networkAvailable);
state.putBoolean("myList", myList);
super.onSaveInstanceState(state);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
this.menu = menu;
if (af != null) {
//All this is handling the ticks in the switch list menu
switch (af.list) {
case 0:
setChecked(menu.findItem(R.id.listType_all));
break;
case 1:
setChecked(menu.findItem(R.id.listType_inprogress));
break;
case 2:
setChecked(menu.findItem(R.id.listType_completed));
break;
case 3:
setChecked(menu.findItem(R.id.listType_onhold));
break;
case 4:
setChecked(menu.findItem(R.id.listType_dropped));
break;
case 5:
setChecked(menu.findItem(R.id.listType_planned));
break;
case 6:
setChecked(menu.findItem(R.id.listType_rewatching));
break;
}
}
menu.findItem(R.id.sort_title).setChecked(true);
myListChanged();
return true;
}
private void setChecked(MenuItem item) {
if (item != null)
item.setChecked(true);
}
private void myListChanged() {
if (menu != null) {
if (af != null && mf != null)
menu.findItem(R.id.menu_details).setChecked(myList && af.getDetails());
menu.findItem(R.id.menu_listType).setVisible(myList);
menu.findItem(R.id.menu_sort).setVisible(myList);
menu.findItem(R.id.menu_inverse).setVisible(myList || (!AccountService.isMAL() && af.taskjob == TaskJob.GETMOSTPOPULAR));
menu.findItem(R.id.forceSync).setVisible(myList && networkAvailable);
menu.findItem(R.id.action_search).setVisible(networkAvailable);
}
}
/**
* Creates the sync notification.
*/
private void syncNotify() {
Intent notificationIntent = new Intent(this, Home.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 1, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setOngoing(true)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.toast_info_SyncMessage))
.setContentIntent(contentIntent);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(R.id.notification_sync, mBuilder.build());
}
private void showLogoutDialog() {
ChooseDialogFragment lcdf = new ChooseDialogFragment();
Bundle bundle = new Bundle();
bundle.putString("title", getString(R.string.dialog_label_logout));
bundle.putString("message", getString(R.string.dialog_message_logout));
bundle.putString("positive", getString(R.string.dialog_label_logout));
lcdf.setArguments(bundle);
lcdf.setCallback(this);
lcdf.show(getFragmentManager(), "fragment_LogoutConfirmationDialog");
}
private void checkNetworkAndDisplayCrouton() {
if (APIHelper.isNetworkAvailable(this) && !networkAvailable)
synctask(false);
networkAvailable = APIHelper.isNetworkAvailable(this);
}
@Override
public void onRefresh() {
if (networkAvailable)
synctask(false);
else {
if (af != null && mf != null) {
af.toggleSwipeRefreshAnimation(false);
mf.toggleSwipeRefreshAnimation(false);
}
Theme.Snackbar(this, R.string.toast_error_noConnectivity);
}
}
@Override
public void onIGFReady(IGF igf) {
igf.setUsername(AccountService.getUsername());
if (igf.isAnime())
af = igf;
else
mf = igf;
// do forced sync after FirstInit
if (PrefManager.getForceSync()) {
if (af != null && mf != null) {
PrefManager.setForceSync(false);
PrefManager.commitChanges();
synctask(true);
}
} else {
if (igf.taskjob == null) {
igf.getRecords(true, TaskJob.GETLIST, PrefManager.getDefaultList());
}
}
}
@Override
public void onRecordsLoadingFinished(TaskJob job) {
if (!job.equals(TaskJob.FORCESYNC)) {
return;
}
callbackCounter++;
if (callbackCounter >= 2) {
callbackCounter = 0;
if (job.equals(TaskJob.FORCESYNC)) {
NotificationManager nm = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel(R.id.notification_sync);
}
}
}
@Override
public void onItemClick(int id, MALApi.ListType listType, String username) {
Intent startDetails = new Intent(this, DetailView.class);
startDetails.putExtra("recordID", id);
startDetails.putExtra("recordType", listType);
startDetails.putExtra("username", username);
startActivity(startDetails);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.Image:
Intent Profile = new Intent(this, ProfileActivity.class);
Profile.putExtra("username", username);
startActivity(Profile);
break;
case R.id.NDimage:
InputDialogFragment lcdf = new InputDialogFragment();
Bundle bundle = new Bundle();
bundle.putInt("id", R.id.NDimage);
bundle.putString("title", getString(R.string.dialog_title_update_navigation));
bundle.putString("hint", getString(R.string.dialog_message_update_navigation));
bundle.putString("message", PrefManager.getNavigationBackground());
lcdf.setArguments(bundle);
lcdf.setCallback(this);
lcdf.show(getFragmentManager(), "fragment_InputDialogFragment");
break;
}
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (menu != null)
menu.findItem(R.id.listType_rewatching).setTitle(getString(position == 0 ? R.string.listType_rewatching : R.string.listType_rereading));
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
}
@Override
public void onPositiveButtonClicked() {
AccountService.clearData();
startActivity(new Intent(this, FirstTimeInit.class));
System.exit(0);
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
//Checking if the item should be checked & if the list status has been changed
switch (item.getItemId()) {
case R.id.nav_profile:
case R.id.nav_friends:
case R.id.nav_forum:
case R.id.nav_schedule:
case R.id.nav_charts:
case R.id.nav_settings:
case R.id.nav_support:
case R.id.nav_about:
break;
default:
// Set the list tracker to false. It will be updated later in the code.
myList = false;
if (item.isChecked())
item.setChecked(false);
else
item.setChecked(true);
break;
}
// disable swipeRefresh for other lists
af.setSwipeRefreshEnabled(myList);
mf.setSwipeRefreshEnabled(myList);
//Closing drawer on item click
drawerLayout.closeDrawers();
//Performing the action
switch (item.getItemId()) {
case R.id.nav_list:
getRecords(true, TaskJob.GETLIST, af.list);
myList = true;
break;
case R.id.nav_profile:
Intent Profile = new Intent(this, ProfileActivity.class);
Profile.putExtra("username", username);
startActivity(Profile);
break;
case R.id.nav_friends:
Intent Friends = new Intent(this, ProfileActivity.class);
Friends.putExtra("username", username);
Friends.putExtra("friends", username);
startActivity(Friends);
break;
case R.id.nav_forum:
if (networkAvailable)
startActivity(new Intent(this, ForumActivity.class));
else
Theme.Snackbar(this, R.string.toast_error_noConnectivity);
break;
case R.id.nav_schedule:
startActivity(new Intent(this, ScheduleActivity.class));
break;
case R.id.nav_charts:
startActivity(new Intent(this, ChartActivity.class));
break;
case R.id.nav_browse:
startActivity(new Intent(this, BrowseActivity.class));
break;
case R.id.nav_logout: // Others subgroup
showLogoutDialog();
break;
case R.id.nav_settings:
startActivity(new Intent(this, Settings.class));
break;
case R.id.nav_support:
Mobihelp.showSupport(this);
break;
case R.id.nav_about:
startActivity(new Intent(this, AboutActivity.class));
break;
}
myListChanged();
return false;
}
@Override
public void onPosInputButtonClicked(String text, int id) {
Picasso.with(this)
.load(text)
.placeholder(R.drawable.atarashii_background)
.error(R.drawable.atarashii_background)
.into((ImageView) findViewById(R.id.NDimage));
PrefManager.setNavigationBackground(text);
PrefManager.commitChanges();
}
@Override
public void onNegInputButtonClicked(int id) {
Picasso.with(this)
.load(R.drawable.atarashii_background)
.placeholder(R.drawable.atarashii_background)
.error(R.drawable.atarashii_background)
.into((ImageView) findViewById(R.id.NDimage));
PrefManager.setNavigationBackground(null);
PrefManager.commitChanges();
}
}
| Disable browse for AL
| Atarashii/src/net/somethingdreadful/MAL/Home.java | Disable browse for AL | <ide><path>tarashii/src/net/somethingdreadful/MAL/Home.java
<ide> startActivity(new Intent(this, ChartActivity.class));
<ide> break;
<ide> case R.id.nav_browse:
<del> startActivity(new Intent(this, BrowseActivity.class));
<add> if (AccountService.isMAL())
<add> startActivity(new Intent(this, BrowseActivity.class));
<add> else
<add> Theme.Snackbar(this, R.string.toast_info_disabled);
<ide> break;
<ide> case R.id.nav_logout: // Others subgroup
<ide> showLogoutDialog(); |
|
Java | agpl-3.0 | 3e42a43a7b9a00d40edddae30acaedb78a92a406 | 0 | Audiveris/audiveris,Audiveris/audiveris | //----------------------------------------------------------------------------//
// //
// G l y p h I n s p e c t o r //
// //
// Copyright (C) Herve Bitteur 2000-2009. All rights reserved. //
// This software is released under the GNU General Public License. //
// Please contact [email protected] to report bugs & suggestions. //
//----------------------------------------------------------------------------//
//
package omr.glyph;
import omr.constant.ConstantSet;
import omr.log.Logger;
import omr.score.common.PixelRectangle;
import omr.sheet.Scale;
import omr.sheet.StaffInfo;
import omr.sheet.SystemInfo;
import omr.util.Implement;
import java.awt.*;
import java.util.*;
import java.util.List;
/**
* Class <code>GlyphInspector</code> is at a System level, dedicated to the
* inspection of retrieved glyphs, their recognition being usually based on
* features used by a neural network evaluator.
*
* @author Hervé Bitteur
* @version $Id$
*/
public class GlyphInspector
{
//~ Static fields/initializers ---------------------------------------------
/** Specific application parameters */
private static final Constants constants = new Constants();
/** Usual logger utility */
private static final Logger logger = Logger.getLogger(GlyphInspector.class);
//~ Instance fields --------------------------------------------------------
/** Dedicated system */
private final SystemInfo system;
/** Related scale */
private final Scale scale;
/** Related lag */
private final GlyphLag lag;
// Constants for alter verification
private final int maxCloseStemDx;
private final int minCloseStemOverlap;
private final int maxCloseStemLength;
private final int maxNaturalOverlap;
private final int maxSharpNonOverlap;
private final double alterMaxDoubt;
// Constants for clef verification
private final int clefHalfWidth;
private final double clefMaxDoubt;
//~ Constructors -----------------------------------------------------------
//----------------//
// GlyphInspector //
//----------------//
/**
* Create an GlyphInspector instance.
*
* @param system the dedicated system
*/
public GlyphInspector (SystemInfo system)
{
this.system = system;
scale = system.getSheet()
.getScale();
lag = system.getSheet()
.getVerticalLag();
maxCloseStemDx = scale.toPixels(constants.maxCloseStemDx);
minCloseStemOverlap = scale.toPixels(constants.minCloseStemOverlap);
maxCloseStemLength = scale.toPixels(constants.maxCloseStemLength);
maxNaturalOverlap = scale.toPixels(constants.maxNaturalOverlap);
maxSharpNonOverlap = scale.toPixels(constants.maxSharpNonOverlap);
alterMaxDoubt = constants.alterMaxDoubt.getValue();
clefHalfWidth = scale.toPixels(constants.clefHalfWidth);
clefMaxDoubt = constants.clefMaxDoubt.getValue();
}
//~ Methods ----------------------------------------------------------------
//--------------------//
// getCleanupMaxDoubt //
//--------------------//
/**
* Report the maximum doubt for a cleanup
*
*
* @return maximum acceptable doubt value
*/
public static double getCleanupMaxDoubt ()
{
return constants.cleanupMaxDoubt.getValue();
}
//-----------------//
// getLeafMaxDoubt //
//-----------------//
/**
* Report the maximum doubt for a leaf
*
*
* @return maximum acceptable doubt value
*/
public static double getLeafMaxDoubt ()
{
return constants.leafMaxDoubt.getValue();
}
//-------------------------//
// getMinCompoundPartDoubt //
//-------------------------//
/**
* Report the minimum doubt value to be considered as part of a compound
* @return the doubt threshold for a compound part
*/
public static double getMinCompoundPartDoubt ()
{
return constants.minCompoundPartDoubt.getValue();
}
//-------------------//
// getSymbolMaxDoubt //
//-------------------//
/**
* Report the maximum doubt for a symbol
*
* @return maximum acceptable doubt value
*/
public static double getSymbolMaxDoubt ()
{
return constants.symbolMaxDoubt.getValue();
}
//----------------//
// evaluateGlyphs //
//----------------//
/**
* All unassigned symbol glyphs of a given system, for which we can get
* a positive vote from the evaluator, are assigned the voted shape.
* @param maxDoubt the upper limit on doubt to accept an evaluation
*/
public void evaluateGlyphs (double maxDoubt)
{
Evaluator evaluator = GlyphNetwork.getInstance();
for (Glyph glyph : system.getGlyphs()) {
if (glyph.getShape() == null) {
// Get vote
Evaluation vote = evaluator.vote(glyph, maxDoubt);
if (vote != null) {
glyph.setShape(vote.shape, vote.doubt);
}
}
}
}
//---------------//
// inspectGlyphs //
//---------------//
/**
* Process the given system, by retrieving unassigned glyphs, evaluating
* and assigning them if OK, or trying compounds otherwise.
*
* @param maxDoubt the maximum acceptable doubt for this processing
*/
public void inspectGlyphs (double maxDoubt)
{
system.retrieveGlyphs();
evaluateGlyphs(maxDoubt);
system.removeInactiveGlyphs();
retrieveCompounds(maxDoubt);
evaluateGlyphs(maxDoubt);
}
//-------------------//
// purgeManualShapes //
//-------------------//
/**
* Purge a collection of glyphs from manually assigned shapes
* @param glyphs the glyph collection to purge
*/
public static void purgeManualShapes (Collection<Glyph> glyphs)
{
for (Iterator<Glyph> it = glyphs.iterator(); it.hasNext();) {
Glyph glyph = it.next();
if (glyph.isManualShape()) {
it.remove();
}
}
}
//-----------------//
// runAlterPattern //
//-----------------//
/**
* Verify the case of stems very close to each other since they may result
* from wrong segmentation of sharp or natural signs
* @return the number of cases fixed
*/
public int runAlterPattern ()
{
// First retrieve the collection of all stems in the system
// Ordered naturally by their abscissa
final SortedSet<Glyph> stems = new TreeSet<Glyph>();
for (Glyph glyph : system.getGlyphs()) {
if (glyph.isStem() && glyph.isActive()) {
PixelRectangle box = glyph.getContourBox();
// Check stem length
if (box.height <= maxCloseStemLength) {
stems.add(glyph);
}
}
}
int successNb = 0; // Success counter
// Then, look for close stems
for (Glyph glyph : stems) {
if (!glyph.isStem()) {
continue;
}
final PixelRectangle lBox = glyph.getContourBox();
final int lX = lBox.x + (lBox.width / 2);
//logger.info("Checking stems close to glyph #" + glyph.getId());
for (Glyph other : stems.tailSet(glyph)) {
if ((other == glyph) || !other.isStem()) {
continue;
}
// Check horizontal distance
final PixelRectangle rBox = other.getContourBox();
final int dx = lX - lX;
if (dx > maxCloseStemDx) {
break; // Since the set is ordered, no candidate is left
}
// Check vertical overlap
final int commonTop = Math.max(lBox.y, rBox.y);
final int commonBot = Math.min(
lBox.y + lBox.height,
rBox.y + rBox.height);
final int overlap = commonBot - commonTop;
if (overlap < minCloseStemOverlap) {
continue;
}
if (logger.isFineEnabled()) {
logger.fine(
"close stems: " +
Glyph.toString(Arrays.asList(glyph, other)));
}
// "hide" the stems to not perturb evaluation
glyph.setShape(null);
other.setShape(null);
boolean success = false;
if (overlap <= maxNaturalOverlap) {
// logger.info(
// "Natural glyph rebuilt as #" + compound.getId());
// success = true;
} else {
success = checkSharp(lBox, rBox);
}
if (success) {
successNb++;
} else {
// Restore stem shapes
glyph.setShape(Shape.COMBINING_STEM);
other.setShape(Shape.COMBINING_STEM);
}
}
}
return successNb;
}
//----------------//
// runClefPattern //
//----------------//
/**
* Verify the initial clefs of a system
* @return the number of clefs fixed
*/
public int runClefPattern ()
{
int successNb = 0;
for (Glyph glyph : system.getGlyphs()) {
if (!glyph.isClef()) {
continue;
}
if (logger.isFineEnabled()) {
logger.fine("Glyph#" + glyph.getId() + " " + glyph.getShape());
}
PixelRectangle box = glyph.getContourBox();
int x = box.x + (box.width / 2);
int y = box.y + (box.height / 2);
StaffInfo staff = system.getStaffAtY(y);
// Look in the other staves
for (StaffInfo oStaff : system.getStaves()) {
if (oStaff == staff) {
continue;
}
// Is there a clef in this staff, with similar abscissa?
PixelRectangle oBox = new PixelRectangle(
x - clefHalfWidth,
oStaff.getFirstLine().yAt(x),
2 * clefHalfWidth,
oStaff.getHeight());
if (logger.isFineEnabled()) {
logger.fine("oBox: " + oBox);
}
Collection<Glyph> glyphs = system.lookupIntersectedGlyphs(oBox);
if (logger.isFineEnabled()) {
logger.fine(Glyph.toString(glyphs));
}
if (!foundClef(glyphs)) {
if (logger.isFineEnabled()) {
logger.fine(
"No clef found at x:" + x + " in staff " + oStaff);
}
if (checkClef(glyphs)) {
successNb++;
}
}
}
}
return successNb;
}
//-------------//
// tryCompound //
//-------------//
/**
* Try to build a compound, starting from given seed and looking into the
* collection of suitable glyphs.
*
* <p>Note that this method has no impact on the system/lag environment.
* It is the caller's responsability, for a successful (i.e. non-null)
* compound, to assign its shape and to add the glyph to the system/lag.
*
* @param seed the initial glyph around which the compound is built
* @param suitables collection of potential glyphs
* @param adapter the specific behavior of the compound tests
* @return the compound built if successful, null otherwise
*/
public Glyph tryCompound (Glyph seed,
List<Glyph> suitables,
CompoundAdapter adapter)
{
// Build box extended around the seed
Rectangle rect = seed.getContourBox();
Rectangle box = new Rectangle(
rect.x - adapter.getBoxDx(),
rect.y - adapter.getBoxDy(),
rect.width + (2 * adapter.getBoxDx()),
rect.height + (2 * adapter.getBoxDy()));
// Retrieve good neighbors among the suitable glyphs
List<Glyph> neighbors = new ArrayList<Glyph>();
// Include the seed in the compound glyphs
neighbors.add(seed);
for (Glyph g : suitables) {
if (!adapter.isSuitable(g)) {
continue;
}
if (box.intersects(g.getContourBox())) {
neighbors.add(g);
}
}
if (neighbors.size() > 1) {
if (logger.isFineEnabled()) {
logger.finest(
"neighbors=" + Glyph.toString(neighbors) + " seed=" + seed);
}
Glyph compound = system.buildCompound(neighbors);
if (adapter.isValid(compound)) {
// If this compound duplicates an original glyph,
// make sure the shape was not forbidden in the original
Glyph original = system.getSheet()
.getVerticalLag()
.getOriginal(compound);
if ((original == null) ||
!original.isShapeForbidden(compound.getShape())) {
if (logger.isFineEnabled()) {
logger.fine("Inserted compound " + compound);
}
return compound;
}
}
}
return null;
}
//-----------//
// checkClef //
//-----------//
/**
* Try to recognize a glef in the compound of the provided glyphs
* @param glyphs the parts of a clef candidate
* @return true if successful
*/
private boolean checkClef (Collection<Glyph> glyphs)
{
purgeManualShapes(glyphs);
Glyph compound = system.buildCompound(glyphs);
system.computeGlyphFeatures(compound);
final Evaluation[] votes = GlyphNetwork.getInstance()
.getEvaluations(compound);
// Check if a clef appears in the top evaluations
for (Evaluation vote : votes) {
if (vote.doubt > clefMaxDoubt) {
break;
}
if (Shape.Clefs.contains(vote.shape)) {
compound = system.addGlyph(compound);
compound.setShape(vote.shape, Evaluation.ALGORITHM);
logger.info(
vote.shape + " rebuilt as glyph#" + compound.getId());
return true;
}
}
return false;
}
//------------//
// checkSharp //
//------------//
/**
* Check if, around the two (stem) boxes, there is actually a sharp sign
* @param lbox contour box of left stem
* @param rBox contour box of right stem
* @return true if successful
*/
private boolean checkSharp (PixelRectangle lBox,
PixelRectangle rBox)
{
final int lX = lBox.x + (lBox.width / 2);
final int rX = rBox.x + (rBox.width / 2);
final int dyTop = Math.abs(lBox.y - rBox.y);
final int dyBot = Math.abs(
(lBox.y + lBox.height) - rBox.y - rBox.height);
if ((dyTop <= maxSharpNonOverlap) && (dyBot <= maxSharpNonOverlap)) {
if (logger.isFineEnabled()) {
logger.fine("SHARP sign?");
}
final int halfWidth = (3 * maxCloseStemDx) / 2;
final int hMargin = minCloseStemOverlap / 2;
final PixelRectangle box = new PixelRectangle(
((lX + rX) / 2) - halfWidth,
Math.min(lBox.y, rBox.y) - hMargin,
2 * halfWidth,
Math.max(lBox.y + lBox.height, rBox.y + rBox.height) -
Math.min(lBox.y, rBox.y) + (2 * hMargin));
if (logger.isFineEnabled()) {
logger.fine("outerBox: " + box);
}
// Look for glyphs in this outer box
final Set<Glyph> glyphs = lag.lookupGlyphs(system.getGlyphs(), box);
purgeManualShapes(glyphs);
Glyph compound = system.buildCompound(glyphs);
system.computeGlyphFeatures(compound);
final Evaluation[] votes = GlyphNetwork.getInstance()
.getEvaluations(compound);
// Check if a sharp appears in the top evaluations
for (Evaluation vote : votes) {
if (vote.doubt > alterMaxDoubt) {
break;
}
if (vote.shape == Shape.SHARP) {
compound = system.addGlyph(compound);
compound.setShape(vote.shape, Evaluation.ALGORITHM);
logger.info("SHARP rebuilt as glyph#" + compound.getId());
return true;
}
}
}
return false;
}
//-----------//
// foundClef //
//-----------//
/**
* Check whether the provided collection of glyphs contains a clef
* @param glyphs the provided glyphs
* @return trur if a clef shape if found
*/
private boolean foundClef (Collection<Glyph> glyphs)
{
for (Glyph gl : glyphs) {
if (gl.isClef()) {
if (logger.isFineEnabled()) {
logger.fine(
"Found glyph#" + gl.getId() + " as " + gl.getShape());
}
return true;
}
}
return false;
}
//-------------------//
// retrieveCompounds //
//-------------------//
/**
* In the specified system, look for glyphs portions that should be
* considered as parts of compound glyphs
*/
private void retrieveCompounds (double maxDoubt)
{
BasicAdapter adapter = new BasicAdapter(maxDoubt);
// Collect glyphs suitable for participating in compound building
List<Glyph> suitables = new ArrayList<Glyph>(
system.getGlyphs().size());
for (Glyph glyph : system.getGlyphs()) {
if (adapter.isSuitable(glyph)) {
suitables.add(glyph);
}
}
// Sort suitable glyphs by decreasing weight
Collections.sort(
suitables,
new Comparator<Glyph>() {
public int compare (Glyph o1,
Glyph o2)
{
return o2.getWeight() - o1.getWeight();
}
});
// Now process each seed in turn, by looking at smaller ones
for (int index = 0; index < suitables.size(); index++) {
Glyph seed = suitables.get(index);
adapter.setSeed(seed);
Glyph compound = tryCompound(
seed,
suitables.subList(index + 1, suitables.size()),
adapter);
if (compound != null) {
compound = system.addGlyph(compound);
compound.setShape(
adapter.getVote().shape,
adapter.getVote().doubt);
}
}
}
//~ Inner Interfaces -------------------------------------------------------
//-----------------//
// CompoundAdapter //
//-----------------//
/**
* Interface <code>CompoundAdapter</code> provides the needed features for
* a generic compound building.
*/
public static interface CompoundAdapter
{
//~ Methods ------------------------------------------------------------
/** Extension in abscissa to look for neighbors
* @return the extension on left and right
*/
int getBoxDx ();
/** Extension in ordinate to look for neighbors
* @return the extension on top and bottom
*/
int getBoxDy ();
/**
* Predicate for a glyph to be a potential part of the building (the
* location criteria is handled separately)
* @param glyph the glyph to check
* @return true if the glyph is suitable for inclusion
*/
boolean isSuitable (Glyph glyph);
/** Predicate to check the success of the newly built compound
* @param compound the resulting compound glyph to check
* @return true if the compound is found OK
*/
boolean isValid (Glyph compound);
}
//~ Inner Classes ----------------------------------------------------------
//--------------//
// BasicAdapter //
//--------------//
/**
* Class <code>BasicAdapter</code> is a CompoundAdapter meant to retrieve
* all compounds (in a system). It is reusable from one candidate to the
* other, by using the setSeed() method.
*/
private class BasicAdapter
implements CompoundAdapter
{
//~ Instance fields ----------------------------------------------------
/** Maximum doubt for a compound */
private final double maxDoubt;
/** The seed being considered */
private Glyph seed;
/** The result of compound evaluation */
private Evaluation vote;
//~ Constructors -------------------------------------------------------
public BasicAdapter (double maxDoubt)
{
this.maxDoubt = maxDoubt;
}
//~ Methods ------------------------------------------------------------
@Implement(CompoundAdapter.class)
public int getBoxDx ()
{
return scale.toPixels(constants.boxWiden);
}
@Implement(CompoundAdapter.class)
public int getBoxDy ()
{
return scale.toPixels(constants.boxWiden);
}
public void setSeed (Glyph seed)
{
this.seed = seed;
}
@Implement(CompoundAdapter.class)
public boolean isSuitable (Glyph glyph)
{
return glyph.isActive() &&
(!glyph.isKnown() ||
(!glyph.isManualShape() &&
((glyph.getShape() == Shape.DOT) ||
(glyph.getShape() == Shape.SLUR) ||
(glyph.getShape() == Shape.CLUTTER) ||
(glyph.getDoubt() >= getMinCompoundPartDoubt()))));
}
@Implement(CompoundAdapter.class)
public boolean isValid (Glyph compound)
{
vote = GlyphNetwork.getInstance()
.vote(compound, maxDoubt);
if (vote != null) {
compound.setShape(vote.shape, vote.doubt);
}
return (vote != null) && vote.shape.isWellKnown() &&
(vote.shape != Shape.CLUTTER) &&
(!seed.isKnown() || (vote.doubt < seed.getDoubt()));
}
public Evaluation getVote ()
{
return vote;
}
}
//-----------//
// Constants //
//-----------//
private static final class Constants
extends ConstantSet
{
//~ Instance fields ----------------------------------------------------
Scale.Fraction boxWiden = new Scale.Fraction(
0.15,
"Box widening to check intersection with compound");
Evaluation.Doubt alterMaxDoubt = new Evaluation.Doubt(
6,
"Maximum doubt for alteration sign verification");
Evaluation.Doubt cleanupMaxDoubt = new Evaluation.Doubt(
1.2,
"Maximum doubt for cleanup phase");
Evaluation.Doubt leafMaxDoubt = new Evaluation.Doubt(
1.01,
"Maximum acceptance doubt for a leaf");
Evaluation.Doubt symbolMaxDoubt = new Evaluation.Doubt(
1.0001,
"Maximum doubt for a symbol");
Evaluation.Doubt minCompoundPartDoubt = new Evaluation.Doubt(
1.020,
"Minimum doubt for a suitable compound part");
Scale.Fraction maxCloseStemDx = new Scale.Fraction(
0.7d,
"Maximum horizontal distance for close stems");
Scale.Fraction maxSharpNonOverlap = new Scale.Fraction(
1d,
"Maximum vertical non overlap for sharp stems");
Scale.Fraction maxNaturalOverlap = new Scale.Fraction(
1.5d,
"Maximum vertical overlap for natural stems");
Scale.Fraction minCloseStemOverlap = new Scale.Fraction(
0.5d,
"Minimum vertical overlap for close stems");
Scale.Fraction maxCloseStemLength = new Scale.Fraction(
3d,
"Maximum length for close stems");
Scale.Fraction clefHalfWidth = new Scale.Fraction(
2d,
"half width of a clef");
Evaluation.Doubt clefMaxDoubt = new Evaluation.Doubt(
3,
"Maximum doubt for clef verification");
}
}
| src/main/omr/glyph/GlyphInspector.java | //----------------------------------------------------------------------------//
// //
// G l y p h I n s p e c t o r //
// //
// Copyright (C) Herve Bitteur 2000-2009. All rights reserved. //
// This software is released under the GNU General Public License. //
// Please contact [email protected] to report bugs & suggestions. //
//----------------------------------------------------------------------------//
//
package omr.glyph;
import omr.constant.ConstantSet;
import omr.log.Logger;
import omr.score.common.PixelRectangle;
import omr.sheet.Scale;
import omr.sheet.StaffInfo;
import omr.sheet.SystemInfo;
import omr.util.Implement;
import java.awt.*;
import java.util.*;
import java.util.List;
/**
* Class <code>GlyphInspector</code> is at a System level, dedicated to the
* inspection of retrieved glyphs, their recognition being usually based on
* features used by a neural network evaluator.
*
* @author Hervé Bitteur
* @version $Id$
*/
public class GlyphInspector
{
//~ Static fields/initializers ---------------------------------------------
/** Specific application parameters */
private static final Constants constants = new Constants();
/** Usual logger utility */
private static final Logger logger = Logger.getLogger(GlyphInspector.class);
//~ Instance fields --------------------------------------------------------
/** Dedicated system */
private final SystemInfo system;
/** Related scale */
private final Scale scale;
/** Related lag */
private final GlyphLag lag;
// Constants for alter verification
private final int maxCloseStemDx;
private final int minCloseStemOverlap;
private final int maxCloseStemLength;
private final int maxNaturalOverlap;
private final int maxSharpNonOverlap;
private final double alterMaxDoubt;
// Constants for clef verification
private final int clefHalfWidth;
private final double clefMaxDoubt;
//~ Constructors -----------------------------------------------------------
//----------------//
// GlyphInspector //
//----------------//
/**
* Create an GlyphInspector instance.
*
* @param system the dedicated system
*/
public GlyphInspector (SystemInfo system)
{
this.system = system;
scale = system.getSheet()
.getScale();
lag = system.getSheet()
.getVerticalLag();
maxCloseStemDx = scale.toPixels(constants.maxCloseStemDx);
minCloseStemOverlap = scale.toPixels(constants.minCloseStemOverlap);
maxCloseStemLength = scale.toPixels(constants.maxCloseStemLength);
maxNaturalOverlap = scale.toPixels(constants.maxNaturalOverlap);
maxSharpNonOverlap = scale.toPixels(constants.maxSharpNonOverlap);
alterMaxDoubt = constants.alterMaxDoubt.getValue();
clefHalfWidth = scale.toPixels(constants.clefHalfWidth);
clefMaxDoubt = constants.clefMaxDoubt.getValue();
}
//~ Methods ----------------------------------------------------------------
//--------------------//
// getCleanupMaxDoubt //
//--------------------//
/**
* Report the maximum doubt for a cleanup
*
*
* @return maximum acceptable doubt value
*/
public static double getCleanupMaxDoubt ()
{
return constants.cleanupMaxDoubt.getValue();
}
//-----------------//
// getLeafMaxDoubt //
//-----------------//
/**
* Report the maximum doubt for a leaf
*
*
* @return maximum acceptable doubt value
*/
public static double getLeafMaxDoubt ()
{
return constants.leafMaxDoubt.getValue();
}
//-------------------------//
// getMinCompoundPartDoubt //
//-------------------------//
/**
* Report the minimum doubt value to be considered as part of a compound
* @return the doubt threshold for a compound part
*/
public static double getMinCompoundPartDoubt ()
{
return constants.minCompoundPartDoubt.getValue();
}
//-------------------//
// getSymbolMaxDoubt //
//-------------------//
/**
* Report the maximum doubt for a symbol
*
* @return maximum acceptable doubt value
*/
public static double getSymbolMaxDoubt ()
{
return constants.symbolMaxDoubt.getValue();
}
//----------------//
// evaluateGlyphs //
//----------------//
/**
* All unassigned symbol glyphs of a given system, for which we can get
* a positive vote from the evaluator, are assigned the voted shape.
* @param maxDoubt the upper limit on doubt to accept an evaluation
*/
public void evaluateGlyphs (double maxDoubt)
{
Evaluator evaluator = GlyphNetwork.getInstance();
for (Glyph glyph : system.getGlyphs()) {
if (glyph.getShape() == null) {
// Get vote
Evaluation vote = evaluator.vote(glyph, maxDoubt);
if (vote != null) {
glyph.setShape(vote.shape, vote.doubt);
}
}
}
}
//---------------//
// inspectGlyphs //
//---------------//
/**
* Process the given system, by retrieving unassigned glyphs, evaluating
* and assigning them if OK, or trying compounds otherwise.
*
* @param maxDoubt the maximum acceptable doubt for this processing
*/
public void inspectGlyphs (double maxDoubt)
{
system.retrieveGlyphs();
evaluateGlyphs(maxDoubt);
system.removeInactiveGlyphs();
retrieveCompounds(maxDoubt);
evaluateGlyphs(maxDoubt);
}
//-------------------//
// purgeManualShapes //
//-------------------//
/**
* Purge a collection of glyphs from manually assigned shapes
* @param glyphs the glyph collection to purge
*/
public static void purgeManualShapes (Collection<Glyph> glyphs)
{
for (Iterator<Glyph> it = glyphs.iterator(); it.hasNext();) {
Glyph glyph = it.next();
if (glyph.isManualShape()) {
it.remove();
}
}
}
//-----------------//
// runAlterPattern //
//-----------------//
/**
* Verify the case of stems very close to each other since they may result
* from wrong segmentation of sharp or natural signs
* @return the number of cases fixed
*/
public int runAlterPattern ()
{
// First retrieve the collection of all stems in the system
// Ordered naturally by their abscissa
final SortedSet<Glyph> stems = new TreeSet<Glyph>();
for (Glyph glyph : system.getGlyphs()) {
if (glyph.isStem() && glyph.isActive()) {
PixelRectangle box = glyph.getContourBox();
// Check stem length
if (box.height <= maxCloseStemLength) {
stems.add(glyph);
}
}
}
int successNb = 0; // Success counter
// Then, look for close stems
for (Glyph glyph : stems) {
if (!glyph.isStem()) {
continue;
}
final PixelRectangle lBox = glyph.getContourBox();
final int lX = lBox.x + (lBox.width / 2);
//logger.info("Checking stems close to glyph #" + glyph.getId());
for (Glyph other : stems.tailSet(glyph)) {
if ((other == glyph) || !other.isStem()) {
continue;
}
// Check horizontal distance
final PixelRectangle rBox = other.getContourBox();
final int dx = lX - lX;
if (dx > maxCloseStemDx) {
break; // Since the set is ordered, no candidate is left
}
// Check vertical overlap
final int commonTop = Math.max(lBox.y, rBox.y);
final int commonBot = Math.min(
lBox.y + lBox.height,
rBox.y + rBox.height);
final int overlap = commonBot - commonTop;
if (overlap < minCloseStemOverlap) {
continue;
}
logger.info(
"close stems: " +
Glyph.toString(Arrays.asList(glyph, other)));
// "hide" the stems to not perturb evaluation
glyph.setShape(null);
other.setShape(null);
boolean success = false;
if (overlap <= maxNaturalOverlap) {
// logger.info(
// "Natural glyph rebuilt as #" + compound.getId());
// success = true;
} else {
success = checkSharp(lBox, rBox);
}
if (success) {
successNb++;
} else {
// Restore stem shapes
glyph.setShape(Shape.COMBINING_STEM);
other.setShape(Shape.COMBINING_STEM);
}
}
}
return successNb;
}
//----------------//
// runClefPattern //
//----------------//
/**
* Verify the initial clefs of a system
* @return the number of clefs fixed
*/
public int runClefPattern ()
{
int successNb = 0;
for (Glyph glyph : system.getGlyphs()) {
if (!glyph.isClef()) {
continue;
}
if (logger.isFineEnabled()) {
logger.fine("Glyph#" + glyph.getId() + " " + glyph.getShape());
}
PixelRectangle box = glyph.getContourBox();
int x = box.x + (box.width / 2);
int y = box.y + (box.height / 2);
StaffInfo staff = system.getStaffAtY(y);
// Look in the other staves
for (StaffInfo oStaff : system.getStaves()) {
if (oStaff == staff) {
continue;
}
// Is there a clef in this staff, with similar abscissa?
PixelRectangle oBox = new PixelRectangle(
x - clefHalfWidth,
oStaff.getFirstLine().yAt(x),
2 * clefHalfWidth,
oStaff.getHeight());
if (logger.isFineEnabled()) {
logger.fine("oBox: " + oBox);
}
Collection<Glyph> glyphs = system.lookupIntersectedGlyphs(oBox);
if (logger.isFineEnabled()) {
logger.fine(Glyph.toString(glyphs));
}
if (!foundClef(glyphs)) {
if (logger.isFineEnabled()) {
logger.fine(
"No clef found at x:" + x + " in staff " + oStaff);
}
if (checkClef(glyphs)) {
successNb++;
}
}
}
}
return successNb;
}
//-------------//
// tryCompound //
//-------------//
/**
* Try to build a compound, starting from given seed and looking into the
* collection of suitable glyphs.
*
* <p>Note that this method has no impact on the system/lag environment.
* It is the caller's responsability, for a successful (i.e. non-null)
* compound, to assign its shape and to add the glyph to the system/lag.
*
* @param seed the initial glyph around which the compound is built
* @param suitables collection of potential glyphs
* @param adapter the specific behavior of the compound tests
* @return the compound built if successful, null otherwise
*/
public Glyph tryCompound (Glyph seed,
List<Glyph> suitables,
CompoundAdapter adapter)
{
// Build box extended around the seed
Rectangle rect = seed.getContourBox();
Rectangle box = new Rectangle(
rect.x - adapter.getBoxDx(),
rect.y - adapter.getBoxDy(),
rect.width + (2 * adapter.getBoxDx()),
rect.height + (2 * adapter.getBoxDy()));
// Retrieve good neighbors among the suitable glyphs
List<Glyph> neighbors = new ArrayList<Glyph>();
// Include the seed in the compound glyphs
neighbors.add(seed);
for (Glyph g : suitables) {
if (!adapter.isSuitable(g)) {
continue;
}
if (box.intersects(g.getContourBox())) {
neighbors.add(g);
}
}
if (neighbors.size() > 1) {
if (logger.isFineEnabled()) {
logger.finest(
"neighbors=" + Glyph.toString(neighbors) + " seed=" + seed);
}
Glyph compound = system.buildCompound(neighbors);
if (adapter.isValid(compound)) {
// If this compound duplicates an original glyph,
// make sure the shape was not forbidden in the original
Glyph original = system.getSheet()
.getVerticalLag()
.getOriginal(compound);
if ((original == null) ||
!original.isShapeForbidden(compound.getShape())) {
if (logger.isFineEnabled()) {
logger.fine("Inserted compound " + compound);
}
return compound;
}
}
}
return null;
}
//-----------//
// checkClef //
//-----------//
/**
* Try to recognize a glef in the compound of the provided glyphs
* @param glyphs the parts of a clef candidate
* @return true if successful
*/
private boolean checkClef (Collection<Glyph> glyphs)
{
purgeManualShapes(glyphs);
Glyph compound = system.buildCompound(glyphs);
system.computeGlyphFeatures(compound);
final Evaluation[] votes = GlyphNetwork.getInstance()
.getEvaluations(compound);
// Check if a clef appears in the top evaluations
for (Evaluation vote : votes) {
if (vote.doubt > clefMaxDoubt) {
break;
}
if (Shape.Clefs.contains(vote.shape)) {
compound = system.addGlyph(compound);
compound.setShape(vote.shape, Evaluation.ALGORITHM);
logger.info(
"Clef " + vote.shape + " rebuilt as #" + compound.getId());
return true;
}
}
return false;
}
//------------//
// checkSharp //
//------------//
/**
* Check if, around the two (stem) boxes, there is actually a sharp sign
* @param lbox contour box of left stem
* @param rBox contour box of right stem
* @return true if successful
*/
private boolean checkSharp (PixelRectangle lBox,
PixelRectangle rBox)
{
final int lX = lBox.x + (lBox.width / 2);
final int rX = rBox.x + (rBox.width / 2);
final int dyTop = Math.abs(lBox.y - rBox.y);
final int dyBot = Math.abs(
(lBox.y + lBox.height) - rBox.y - rBox.height);
if ((dyTop <= maxSharpNonOverlap) && (dyBot <= maxSharpNonOverlap)) {
if (logger.isFineEnabled()) {
logger.fine("SHARP sign?");
}
final int halfWidth = (3 * maxCloseStemDx) / 2;
final int hMargin = minCloseStemOverlap / 2;
final PixelRectangle box = new PixelRectangle(
((lX + rX) / 2) - halfWidth,
Math.min(lBox.y, rBox.y) - hMargin,
2 * halfWidth,
Math.max(lBox.y + lBox.height, rBox.y + rBox.height) -
Math.min(lBox.y, rBox.y) + (2 * hMargin));
if (logger.isFineEnabled()) {
logger.fine("outerBox: " + box);
}
// Look for glyphs in this outer box
final Set<Glyph> glyphs = lag.lookupGlyphs(system.getGlyphs(), box);
purgeManualShapes(glyphs);
Glyph compound = system.buildCompound(glyphs);
system.computeGlyphFeatures(compound);
final Evaluation[] votes = GlyphNetwork.getInstance()
.getEvaluations(compound);
// Check if a sharp appears in the top evaluations
for (Evaluation vote : votes) {
if (vote.doubt > alterMaxDoubt) {
break;
}
if (vote.shape == Shape.SHARP) {
compound = system.addGlyph(compound);
compound.setShape(vote.shape, Evaluation.ALGORITHM);
logger.info("Sharp glyph rebuilt as #" + compound.getId());
return true;
}
}
}
return false;
}
//-----------//
// foundClef //
//-----------//
/**
* Check whether the provided collection of glyphs contains a clef
* @param glyphs the provided glyphs
* @return trur if a clef shape if found
*/
private boolean foundClef (Collection<Glyph> glyphs)
{
for (Glyph gl : glyphs) {
if (gl.isClef()) {
if (logger.isFineEnabled()) {
logger.fine(
"Found glyph#" + gl.getId() + " as " + gl.getShape());
}
return true;
}
}
return false;
}
//-------------------//
// retrieveCompounds //
//-------------------//
/**
* In the specified system, look for glyphs portions that should be
* considered as parts of compound glyphs
*/
private void retrieveCompounds (double maxDoubt)
{
BasicAdapter adapter = new BasicAdapter(maxDoubt);
// Collect glyphs suitable for participating in compound building
List<Glyph> suitables = new ArrayList<Glyph>(
system.getGlyphs().size());
for (Glyph glyph : system.getGlyphs()) {
if (adapter.isSuitable(glyph)) {
suitables.add(glyph);
}
}
// Sort suitable glyphs by decreasing weight
Collections.sort(
suitables,
new Comparator<Glyph>() {
public int compare (Glyph o1,
Glyph o2)
{
return o2.getWeight() - o1.getWeight();
}
});
// Now process each seed in turn, by looking at smaller ones
for (int index = 0; index < suitables.size(); index++) {
Glyph seed = suitables.get(index);
adapter.setSeed(seed);
Glyph compound = tryCompound(
seed,
suitables.subList(index + 1, suitables.size()),
adapter);
if (compound != null) {
compound = system.addGlyph(compound);
compound.setShape(
adapter.getVote().shape,
adapter.getVote().doubt);
}
}
}
//~ Inner Interfaces -------------------------------------------------------
//-----------------//
// CompoundAdapter //
//-----------------//
/**
* Interface <code>CompoundAdapter</code> provides the needed features for
* a generic compound building.
*/
public static interface CompoundAdapter
{
//~ Methods ------------------------------------------------------------
/** Extension in abscissa to look for neighbors
* @return the extension on left and right
*/
int getBoxDx ();
/** Extension in ordinate to look for neighbors
* @return the extension on top and bottom
*/
int getBoxDy ();
/**
* Predicate for a glyph to be a potential part of the building (the
* location criteria is handled separately)
* @param glyph the glyph to check
* @return true if the glyph is suitable for inclusion
*/
boolean isSuitable (Glyph glyph);
/** Predicate to check the success of the newly built compound
* @param compound the resulting compound glyph to check
* @return true if the compound is found OK
*/
boolean isValid (Glyph compound);
}
//~ Inner Classes ----------------------------------------------------------
//--------------//
// BasicAdapter //
//--------------//
/**
* Class <code>BasicAdapter</code> is a CompoundAdapter meant to retrieve
* all compounds (in a system). It is reusable from one candidate to the
* other, by using the setSeed() method.
*/
private class BasicAdapter
implements CompoundAdapter
{
//~ Instance fields ----------------------------------------------------
/** Maximum doubt for a compound */
private final double maxDoubt;
/** The seed being considered */
private Glyph seed;
/** The result of compound evaluation */
private Evaluation vote;
//~ Constructors -------------------------------------------------------
public BasicAdapter (double maxDoubt)
{
this.maxDoubt = maxDoubt;
}
//~ Methods ------------------------------------------------------------
@Implement(CompoundAdapter.class)
public int getBoxDx ()
{
return scale.toPixels(constants.boxWiden);
}
@Implement(CompoundAdapter.class)
public int getBoxDy ()
{
return scale.toPixels(constants.boxWiden);
}
public void setSeed (Glyph seed)
{
this.seed = seed;
}
@Implement(CompoundAdapter.class)
public boolean isSuitable (Glyph glyph)
{
return glyph.isActive() &&
(!glyph.isKnown() ||
(!glyph.isManualShape() &&
((glyph.getShape() == Shape.DOT) ||
(glyph.getShape() == Shape.SLUR) ||
(glyph.getShape() == Shape.CLUTTER) ||
(glyph.getDoubt() >= getMinCompoundPartDoubt()))));
}
@Implement(CompoundAdapter.class)
public boolean isValid (Glyph compound)
{
vote = GlyphNetwork.getInstance()
.vote(compound, maxDoubt);
if (vote != null) {
compound.setShape(vote.shape, vote.doubt);
}
return (vote != null) && vote.shape.isWellKnown() &&
(vote.shape != Shape.CLUTTER) &&
(!seed.isKnown() || (vote.doubt < seed.getDoubt()));
}
public Evaluation getVote ()
{
return vote;
}
}
//-----------//
// Constants //
//-----------//
private static final class Constants
extends ConstantSet
{
//~ Instance fields ----------------------------------------------------
Scale.Fraction boxWiden = new Scale.Fraction(
0.15,
"Box widening to check intersection with compound");
Evaluation.Doubt alterMaxDoubt = new Evaluation.Doubt(
6,
"Maximum doubt for alteration sign verification");
Evaluation.Doubt cleanupMaxDoubt = new Evaluation.Doubt(
1.2,
"Maximum doubt for cleanup phase");
Evaluation.Doubt leafMaxDoubt = new Evaluation.Doubt(
1.01,
"Maximum acceptance doubt for a leaf");
Evaluation.Doubt symbolMaxDoubt = new Evaluation.Doubt(
1.0001,
"Maximum doubt for a symbol");
Evaluation.Doubt minCompoundPartDoubt = new Evaluation.Doubt(
1.020,
"Minimum doubt for a suitable compound part");
Scale.Fraction maxCloseStemDx = new Scale.Fraction(
0.7d,
"Maximum horizontal distance for close stems");
Scale.Fraction maxSharpNonOverlap = new Scale.Fraction(
1d,
"Maximum vertical non overlap for sharp stems");
Scale.Fraction maxNaturalOverlap = new Scale.Fraction(
1.5d,
"Maximum vertical overlap for natural stems");
Scale.Fraction minCloseStemOverlap = new Scale.Fraction(
0.5d,
"Minimum vertical overlap for close stems");
Scale.Fraction maxCloseStemLength = new Scale.Fraction(
3d,
"Maximum length for close stems");
Scale.Fraction clefHalfWidth = new Scale.Fraction(
2d,
"half width of a clef");
Evaluation.Doubt clefMaxDoubt = new Evaluation.Doubt(
3,
"Maximum doubt for clef verification");
}
}
| Better info message for patterns
| src/main/omr/glyph/GlyphInspector.java | Better info message for patterns | <ide><path>rc/main/omr/glyph/GlyphInspector.java
<ide> continue;
<ide> }
<ide>
<del> logger.info(
<del> "close stems: " +
<del> Glyph.toString(Arrays.asList(glyph, other)));
<add> if (logger.isFineEnabled()) {
<add> logger.fine(
<add> "close stems: " +
<add> Glyph.toString(Arrays.asList(glyph, other)));
<add> }
<ide>
<ide> // "hide" the stems to not perturb evaluation
<ide> glyph.setShape(null);
<ide> compound = system.addGlyph(compound);
<ide> compound.setShape(vote.shape, Evaluation.ALGORITHM);
<ide> logger.info(
<del> "Clef " + vote.shape + " rebuilt as #" + compound.getId());
<add> vote.shape + " rebuilt as glyph#" + compound.getId());
<ide>
<ide> return true;
<ide> }
<ide> if (vote.shape == Shape.SHARP) {
<ide> compound = system.addGlyph(compound);
<ide> compound.setShape(vote.shape, Evaluation.ALGORITHM);
<del> logger.info("Sharp glyph rebuilt as #" + compound.getId());
<add> logger.info("SHARP rebuilt as glyph#" + compound.getId());
<ide>
<ide> return true;
<ide> } |
|
JavaScript | mit | dfce65eb5361fa17d605121c380dbbe538fbedc5 | 0 | benji6/andromeda,benji6/andromeda,benji6/andromeda | import {fromPairs} from 'ramda'
import React from 'react'
import ReactDOM from 'react-dom'
import createVirtualAudioGraph from 'virtual-audio-graph'
let reverbGraphs = {}
const containerEls = new WeakMap()
const dryLevels = new WeakMap()
const highCuts = new WeakMap()
const lowCuts = new WeakMap()
const outputs = new WeakMap()
const reverbTypes = new WeakMap()
const virtualAudioGraphs = new WeakMap()
const wetLevels = new WeakMap()
import audioContext from '../../audioContext'
const loadReverb = (uri, name) => window.fetch(uri)
.then(response => response.arrayBuffer())
.then(data => new Promise(
// word is audioContext.decodeAudioData will one day return a promise...
resolve => audioContext.decodeAudioData(data, resolve)
))
.then(buffer => _ => ({
0: ['gain', 'output', {gain: 0.5}],
1: ['convolver', 0, {buffer}, 'input']
}))
.then(reverb => [name, reverb])
const loadAllReverbs = Promise.all([
loadReverb('assets/sb.wav', 'reverb chapel'),
loadReverb('assets/h.wav', 'reverb mausoleum'),
loadReverb('assets/st.wav', 'reverb stairwell')
]).then(fromPairs)
loadAllReverbs.then(x => reverbGraphs = x)
const ControlContainer = ({children}) => <div style={{padding: '1rem'}}>
<label>
{children}
</label>
</div>
const updateAudioGraph = function () {
virtualAudioGraphs.get(this).update({
0: ['gain', 'output', {gain: dryLevels.get(this)}],
1: ['biquadFilter', 'output', {frequency: highCuts.get(this)}],
2: ['biquadFilter', 1, {frequency: lowCuts.get(this), type: 'highpass'}],
3: ['gain', 2, {gain: wetLevels.get(this)}],
4: [reverbTypes.get(this), 3],
input: ['gain', [0, 4]]
})
}
export default class {
constructor ({audioContext}) {
const output = audioContext.createGain()
const virtualAudioGraph = createVirtualAudioGraph({audioContext, output})
dryLevels.set(this, 0.35)
highCuts.set(this, 8000)
lowCuts.set(this, 50)
outputs.set(this, output)
reverbTypes.set(this, 'reverb chapel')
wetLevels.set(this, 0.8)
virtualAudioGraph.update({
input: ['gain', 'output']
})
loadAllReverbs
.then(x => virtualAudioGraph.defineNodes(x))
.then(x => updateAudioGraph.call(this))
.then(_ => {
const containerEl = containerEls.get(this)
if (containerEl) this.render(containerEls.get(this))
})
virtualAudioGraphs.set(this, virtualAudioGraph)
this.destination = virtualAudioGraph.getAudioNodeById('input')
}
connect (destination) {
outputs.get(this).connect(destination)
}
disconnect (destination) {
outputs.get(this).disconnect()
}
render (containerEl) {
containerEls.set(this, containerEl)
ReactDOM.render(
<div style={{textAlign: 'center'}}>
<h2>Reverb</h2>
<ControlContainer>
Type
<select onChange={e => {
reverbTypes.set(this, e.target.value)
updateAudioGraph.call(this)
}}>
{Object.keys(reverbGraphs).map((x, i) => <option key={i}>{x}</option>)}
</select>
</ControlContainer>
<ControlContainer>
Dry level
<input
defaultValue={dryLevels.get(this)}
max='1'
min='0'
onInput={e => {
dryLevels.set(this, Number(e.target.value))
updateAudioGraph.call(this)
}}
step='0.01'
type='range'
/>
</ControlContainer>
<ControlContainer>
Wet level
<input
defaultValue={wetLevels.get(this)}
max='1'
min='0'
onInput={e => {
wetLevels.set(this, Number(e.target.value))
updateAudioGraph.call(this)
}}
step='0.01'
type='range'
/>
</ControlContainer>
<ControlContainer>
Low cutoff
<input
defaultValue={Math.log(lowCuts.get(this))}
max={Math.log(20000)}
min={Math.log(20)}
onInput={e => {
lowCuts.set(this, Math.exp(Number(e.target.value)))
updateAudioGraph.call(this)
}}
step='0.1'
type='range'
/>
</ControlContainer>
<ControlContainer>
High cutoff
<input
defaultValue={Math.log(highCuts.get(this))}
max={Math.log(20000)}
min={Math.log(20)}
onInput={e => {
highCuts.set(this, Math.exp(Number(e.target.value)))
updateAudioGraph.call(this)
}}
step='0.1'
type='range'
/>
</ControlContainer>
</div>,
containerEl
)
}
}
| src/plugins/effects/Reverb.js | import {fromPairs} from 'ramda'
import React from 'react'
import ReactDOM from 'react-dom'
import createVirtualAudioGraph from 'virtual-audio-graph'
let reverbGraphs = {}
const containerEls = new WeakMap()
const dryLevels = new WeakMap()
const lowCuts = new WeakMap()
const outputs = new WeakMap()
const reverbTypes = new WeakMap()
const virtualAudioGraphs = new WeakMap()
const wetLevels = new WeakMap()
import audioContext from '../../audioContext'
const loadReverb = (uri, name) => window.fetch(uri)
.then(response => response.arrayBuffer())
.then(data => new Promise(
// word is audioContext.decodeAudioData will one day return a promise...
resolve => audioContext.decodeAudioData(data, resolve)
))
.then(buffer => _ => ({
0: ['gain', 'output', {gain: 0.5}],
1: ['convolver', 0, {buffer}, 'input']
}))
.then(reverb => [name, reverb])
const loadAllReverbs = Promise.all([
loadReverb('assets/sb.wav', 'reverb chapel'),
loadReverb('assets/h.wav', 'reverb mausoleum'),
loadReverb('assets/st.wav', 'reverb stairwell')
]).then(fromPairs)
loadAllReverbs.then(x => reverbGraphs = x)
const ControlContainer = ({children}) => <div style={{padding: '1rem'}}>
<label>
{children}
</label>
</div>
const updateAudioGraph = function () {
virtualAudioGraphs.get(this).update({
0: ['gain', 'output', {gain: dryLevels.get(this)}],
1: ['biquadFilter', 'output', {frequency: lowCuts.get(this), type: 'highpass'}],
2: ['gain', 1, {gain: wetLevels.get(this)}],
3: [reverbTypes.get(this), 2],
input: ['gain', [0, 3]]
})
}
export default class {
constructor ({audioContext}) {
const output = audioContext.createGain()
const virtualAudioGraph = createVirtualAudioGraph({audioContext, output})
dryLevels.set(this, 0.35)
lowCuts.set(this, 50)
wetLevels.set(this, 1)
reverbTypes.set(this, 'reverb chapel')
outputs.set(this, output)
virtualAudioGraph.update({
input: ['gain', 'output']
})
loadAllReverbs
.then(x => virtualAudioGraph.defineNodes(x))
.then(x => updateAudioGraph.call(this))
.then(_ => {
const containerEl = containerEls.get(this)
if (containerEl) this.render(containerEls.get(this))
})
virtualAudioGraphs.set(this, virtualAudioGraph)
this.destination = virtualAudioGraph.getAudioNodeById('input')
}
connect (destination) {
outputs.get(this).connect(destination)
}
disconnect (destination) {
outputs.get(this).disconnect()
}
render (containerEl) {
containerEls.set(this, containerEl)
ReactDOM.render(
<div style={{textAlign: 'center'}}>
<h2>Reverb</h2>
<ControlContainer>
Type
<select onChange={e => {
reverbTypes.set(this, e.target.value)
updateAudioGraph.call(this)
}}>
{Object.keys(reverbGraphs).map((x, i) => <option key={i}>{x}</option>)}
</select>
</ControlContainer>
<ControlContainer>
Dry level
<input
defaultValue={dryLevels.get(this)}
max='1'
min='0'
onInput={e => {
dryLevels.set(this, Number(e.target.value))
updateAudioGraph.call(this)
}}
step='0.01'
type='range'
/>
</ControlContainer>
<ControlContainer>
Wet level
<input
defaultValue={wetLevels.get(this)}
max='1'
min='0'
onInput={e => {
wetLevels.set(this, Number(e.target.value))
updateAudioGraph.call(this)
}}
step='0.01'
type='range'
/>
</ControlContainer>
<ControlContainer>
Low cutoff
<input
defaultValue={Math.log(lowCuts.get(this))}
max={Math.log(20000)}
min={Math.log(20)}
onInput={e => {
lowCuts.set(this, Math.exp(Number(e.target.value)))
updateAudioGraph.call(this)
}}
step='0.1'
type='range'
/>
</ControlContainer>
</div>,
containerEl
)
}
}
| feat(reverb) high cutoff param for reverb plugin
| src/plugins/effects/Reverb.js | feat(reverb) high cutoff param for reverb plugin | <ide><path>rc/plugins/effects/Reverb.js
<ide>
<ide> const containerEls = new WeakMap()
<ide> const dryLevels = new WeakMap()
<add>const highCuts = new WeakMap()
<ide> const lowCuts = new WeakMap()
<ide> const outputs = new WeakMap()
<ide> const reverbTypes = new WeakMap()
<ide> const updateAudioGraph = function () {
<ide> virtualAudioGraphs.get(this).update({
<ide> 0: ['gain', 'output', {gain: dryLevels.get(this)}],
<del> 1: ['biquadFilter', 'output', {frequency: lowCuts.get(this), type: 'highpass'}],
<del> 2: ['gain', 1, {gain: wetLevels.get(this)}],
<del> 3: [reverbTypes.get(this), 2],
<del> input: ['gain', [0, 3]]
<add> 1: ['biquadFilter', 'output', {frequency: highCuts.get(this)}],
<add> 2: ['biquadFilter', 1, {frequency: lowCuts.get(this), type: 'highpass'}],
<add> 3: ['gain', 2, {gain: wetLevels.get(this)}],
<add> 4: [reverbTypes.get(this), 3],
<add> input: ['gain', [0, 4]]
<ide> })
<ide> }
<ide>
<ide> const virtualAudioGraph = createVirtualAudioGraph({audioContext, output})
<ide>
<ide> dryLevels.set(this, 0.35)
<add> highCuts.set(this, 8000)
<ide> lowCuts.set(this, 50)
<del> wetLevels.set(this, 1)
<add> outputs.set(this, output)
<ide> reverbTypes.set(this, 'reverb chapel')
<del> outputs.set(this, output)
<add> wetLevels.set(this, 0.8)
<ide>
<ide> virtualAudioGraph.update({
<ide> input: ['gain', 'output']
<ide> type='range'
<ide> />
<ide> </ControlContainer>
<add> <ControlContainer>
<add> High cutoff
<add> <input
<add> defaultValue={Math.log(highCuts.get(this))}
<add> max={Math.log(20000)}
<add> min={Math.log(20)}
<add> onInput={e => {
<add> highCuts.set(this, Math.exp(Number(e.target.value)))
<add> updateAudioGraph.call(this)
<add> }}
<add> step='0.1'
<add> type='range'
<add> />
<add> </ControlContainer>
<ide> </div>,
<ide> containerEl
<ide> ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.