dtype

WebJar for dtype

License

License

MIT
GroupId

GroupId

org.webjars.bowergithub.shama
ArtifactId

ArtifactId

dtype
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

dtype
WebJar for dtype
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/shama/dtype

Download dtype

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.shama/dtype/ -->
<dependency>
    <groupId>org.webjars.bowergithub.shama</groupId>
    <artifactId>dtype</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.shama/dtype/
implementation 'org.webjars.bowergithub.shama:dtype:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.shama/dtype/
implementation ("org.webjars.bowergithub.shama:dtype:2.0.0")
'org.webjars.bowergithub.shama:dtype:jar:2.0.0'
<dependency org="org.webjars.bowergithub.shama" name="dtype" rev="2.0.0">
  <artifact name="dtype" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.shama', module='dtype', version='2.0.0')
)
libraryDependencies += "org.webjars.bowergithub.shama" % "dtype" % "2.0.0"
[org.webjars.bowergithub.shama/dtype "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

dtype

Return a data type from a string representing the data type.

Mostly useful for using with ndarray where you would like instantiate a typed array of the same array.dtype.

See ndarray-dtype if you need to support Buffer and other ndarray types.

example

var dtype = require('dtype')
var ndarray = require('ndarray')

var arr = ndarray(new Int8Array(32))

// some time later

var newarr = ndarray(new (dtype(arr.dtype)))

API

dtype(string) will return the following data types based on the strings given:

Data type String
Int8Array "int8"
Int16Array "int16"
Int32Array "int32"
Uint8Array "uint8"
Uint16Array "uint16"
Uint32Array "uint32"
Float32Array "float32"
Float64Array "float64"
Array "array"
Uint8ClampedArray "uint8_clamped"

Returns undefined if the type isn't recognized.

install

With npm do:

npm install dtype

Use browserify to require('dtype').

see also

release history

  • 2.0.0 - moving buffer, generic and data to a different module
  • 1.0.0 - Add uint8_clamped, generic, data, dataview and buffer types
  • 0.1.0 - initial release

license

Copyright (c) 2015 Kyle Robinson Young
Licensed under the MIT license.

Versions

Version
2.0.0