Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Now available on bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lautenschlager committed Feb 20, 2016
1 parent b6759be commit 7a14518
Show file tree
Hide file tree
Showing 10 changed files with 601 additions and 28 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[![Build Status](https://travis-ci.org/ChronixDB/chronix.fastdtw.svg?branch=master)](https://travis-ci.org/ChronixDB/chronix.fastdtw)
[![Coverage Status](https://coveralls.io/repos/github/ChronixDB/chronix.fastdtw/badge.svg?branch=master)](https://coveralls.io/github/ChronixDB/chronix.fastdtw?branch=master)
[![Stories in Ready](https://badge.waffle.io/ChronixDB/chronix.fastdtw.png?label=ready&title=Ready)](https://waffle.io/ChronixDB/chronix.fastdtw)
[![Download](https://api.bintray.com/packages/chronix/maven/chronix-fastdtw/images/download.svg) ](https://bintray.com/chronix/maven/chronix-fastdtw/_latestVersion)
# Chronix FastDTW - Dynamic Time Warping (DTW) with a linear time and memory complexity
An implementation of the Fast DTW algorithm used in Chronix.
This implementation is 40 times faster than the provided implementation at [Google Code](http://code.google.com/p/fastdtw/).

## Performance comparision
This implemenation includes some performance optimizations.
## Performance comparison
This implementation includes some performance optimizations.
The following results show the benefits.

### Test-Dataset:
Expand All @@ -17,7 +18,7 @@ The following results show the benefits.
- Chronix [Results](https://github.com/ChronixDB/chronix.fastdtw/blob/master/results/chronix-optimization.csv)
- Original [Results](https://github.com/ChronixDB/chronix.fastdtw/blob/master/results/source-runtime.csv)

### Comparision
### Comparison
Times are in milliseconds.

| Search Radius|Original|Chronix|
Expand Down
127 changes: 121 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ allprojects {
//Logging
compile 'org.slf4j:slf4j-api:1.7.12'

//Chronix Kassiopeia
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.1'


//Logging framework for tests
testCompile 'org.apache.logging.log4j:log4j-api:2.4'
testCompile 'org.apache.logging.log4j:log4j-core:2.4'
Expand Down Expand Up @@ -160,9 +156,128 @@ sonarqube {
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
property "sonar.jdbc.username", "$jdbcUser"
property "sonar.jdbc.password", "$jdbcPw"
property "sonar.projectName", "ChronixDB-Server"
property "sonar.projectName", "ChronixDB-FastDTW"
property "sonar.projectKey", "de.qaware.chronix:chronix.server"
property "sonar.projectVersoin", "$project.version"
property "sonar.projectVersion", "$project.version"

}
}
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources

task javadocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'javadoc'
from groovydoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

def pomConfig = {

inceptionYear '2016'

scm {
connection "scm:git:${project.scmUrl}"
developerConnection "scm:git:${project.scmUrl}"
url project.websiteUrl
}

issueManagement {
system 'GitHub'
url project.issueTrackerUrl
}

licenses {
license([:]) {
name 'The MIT License (MIT)'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}

organisation {
name 'QAware GmbH'
url 'https://www.qaware.de'
}

developers {
developer {
id 'florianlautenschlager'
name 'Florian Lautenschlager'
email '[email protected]'
organization 'QAware GmbH'
organizationUrl 'https://www.qaware.de'
roles { role 'Developer' }
}
}
}

publishing {
publications {
chronixFastDTW(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar

pom.withXml {
asNode().appendNode('name', project.displayName)
asNode().appendNode('description', project.description)
asNode().appendNode('url', project.websiteUrl)

asNode().children().last() + pomConfig
}
}
}
}

bintray {
user = project.hasProperty('bintrayUsername') ? project.bintrayUsername : 'unknown'
key = project.hasProperty('bintrayApiKey') ? project.bintrayApiKey : 'unknown'
publications = ['chronixFastDTW']
dryRun = false
publish = true
pkg {
repo = project.bintrayRepo
name = 'chronix-fastdtw' //override name
desc = project.description
licenses = ['MIT']
labels = ['java', 'time series', 'dtw', 'chronix']
websiteUrl = project.websiteUrl
issueTrackerUrl = project.issueTrackerUrl
vcsUrl = project.scmUrl
publicDownloadNumbers = true
version {
name = project.version
desc = project.description
released = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZZ")
vcsTag = "v${project.version}"
attributes = [
'chronix-fast-dtw': ['de.qaware.chronix', project.group, project.name].join(':')
]
mavenCentralSync {
sync = false
}
}
}
}

pluginBundle {
website = project.websiteUrl
vcsUrl = project.scmUrl

plugins {
basePlugin {
id = 'de.qaware.chronix'
displayName = project.displayName
description = project.description
tags = ['chronix', 'fast dtw']
version = project.version
}
}
}
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
displayName=Chronix FastDTW
description=An modifed implementation of the FastDTW algorithm used in Chronix.
websiteUrl=https://github.com/ChronixDB/chronix.fastdtw
scmUrl=https://github.com/ChronixDB/chronix.fastdtw
issueTrackerUrl=https://github.com/ChronixDB/chronix.fastdtw/issues
bintrayRepo=maven
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
public enum DistanceFunctionEnum {

BINARY,
MANHATTEN,
MANHATTAN,
EUCLIDEAN
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static DistanceFunction getDistanceFunction(DistanceFunctionEnum function
switch (function) {
case EUCLIDEAN:
return EUCLIDEAN_DIST_FN;
case MANHATTEN:
case MANHATTAN:
return MANHATTAN_DIST_FN;
case BINARY:
return BINARY_DIST_FN;
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/de/qaware/chronix/dt/IntList.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public boolean isEmpty() {
* @param o element whose presence in this list is to be tested
* @return <tt>true</tt> if this list contains the specified element
*/
public boolean contains(double o) {
public boolean contains(long o) {
return indexOf(o) >= 0;
}

Expand All @@ -118,10 +118,10 @@ public boolean contains(double o) {
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
* or -1 if there is no such index.
*
* @param o the double value
* @return the index of the given double element
* @param o the long value
* @return the index of the given long element
*/
public int indexOf(double o) {
public int indexOf(long o) {

for (int i = 0; i < size; i++) {
if (o == ints[i]) {
Expand All @@ -138,10 +138,10 @@ public int indexOf(double o) {
* <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt>,
* or -1 if there is no such index.
*
* @param o the double value
* @return the last index of the given double element
* @param o the long value
* @return the last index of the given long element
*/
public int lastIndexOf(double o) {
public int lastIndexOf(long o) {

for (int i = size - 1; i >= 0; i--) {
if (o == ints[i]) {
Expand Down Expand Up @@ -261,10 +261,10 @@ public void add(int index, int element) {
* @return the element that was removed from the list
* @throws IndexOutOfBoundsException
*/
public double remove(int index) {
public long remove(int index) {
rangeCheck(index, size);

double oldValue = ints[index];
long oldValue = ints[index];

int numMoved = size - index - 1;
if (numMoved > 0) {
Expand All @@ -288,7 +288,7 @@ public double remove(int index) {
* @param o element to be removed from this list, if present
* @return <tt>true</tt> if this list contained the specified element
*/
public boolean remove(double o) {
public boolean remove(long o) {

for (int index = 0; index < size; index++) {
if (o == ints[index]) {
Expand Down
Loading

0 comments on commit 7a14518

Please sign in to comment.