Skip to content

Commit

Permalink
Feature/headers bindings (#79)
Browse files Browse the repository at this point in the history
* Add headers guards for c bindings includes
* Add header guards in java bindings includes
  • Loading branch information
JmGV authored and avilchess committed Feb 10, 2019
1 parent 32010d0 commit 1536190
Show file tree
Hide file tree
Showing 27 changed files with 156 additions and 21 deletions.
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/array.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_ARRAY_H
#define KHIVA_BINDINGC_ARRAY_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -302,3 +305,5 @@ KHIVAAPI void khiva_as(khiva_array *array, const int *type, khiva_array *result)
#ifdef __cplusplus
}
#endif

#endif
9 changes: 7 additions & 2 deletions bindings/c/include/khiva_c/defines.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_DEFINES_H
#define KHIVA_BINDINGC_DEFINES_H

#if defined(_WIN32) || defined(_MSC_VER)
// http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.80).aspx
// http://msdn.microsoft.com/en-us/library/3y1sfaz2%28v=VS.80%29.aspx
Expand All @@ -18,10 +21,12 @@
#define KHIVAAPI
#else
#if defined(BUILDING_KHIVA_DLL)
# define KHIVAAPI DLL_EXPORT
#define KHIVAAPI DLL_EXPORT
#else
# define KHIVAAPI DLL_IMPORT
#define KHIVAAPI DLL_IMPORT
#endif
#endif

typedef void *khiva_array;

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/dimensionality.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_DIMENSIONALITY_H
#define KHIVA_BINDINGC_DIMENSIONALITY_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -121,3 +124,5 @@ KHIVAAPI void visvalingam(khiva_array *points, int *num_points, khiva_array *res
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/distances.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_DISTANCES_H
#define KHIVA_BINDINGC_DISTANCES_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -84,3 +87,5 @@ KHIVAAPI void squared_euclidean(khiva_array *tss, khiva_array *result);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/features.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_FEATURES_H
#define KHIVA_BINDINGC_FEATURES_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -858,3 +861,5 @@ KHIVAAPI void variance_larger_than_standard_deviation(khiva_array *array, khiva_
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/library.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_LIBRARY_H
#define KHIVA_BINDINGC_LIBRARY_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -67,3 +70,5 @@ KHIVAAPI void version(char **v);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/linalg.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_LINALG_H
#define KHIVA_BINDINGC_LINALG_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand All @@ -26,3 +29,5 @@ KHIVAAPI void lls(khiva_array *a, khiva_array *b, khiva_array *result);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/matrix.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_MATRIX_H
#define KHIVA_BINDINGC_MATRIX_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -85,3 +88,5 @@ KHIVAAPI void stomp_self_join(khiva_array *tss, long *m, khiva_array *p, khiva_a
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/normalization.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_NORMALIZATION_H
#define KHIVA_BINDINGC_NORMALIZATION_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -113,3 +116,5 @@ KHIVAAPI void znorm_in_place(khiva_array *tss, double *epsilon);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/polynomial.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_POLINOMIAL_H
#define KHIVA_BINDINGC_POLINOMIAL_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -36,3 +39,5 @@ KHIVAAPI void roots(khiva_array *p, khiva_array *result);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/regression.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_REGRESSION_H
#define KHIVA_BINDINGC_REGRESSION_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -31,3 +34,5 @@ KHIVAAPI void linear(khiva_array *xss, khiva_array *yss, khiva_array *slope, khi
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/regularization.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_REGULARIZATION_H
#define KHIVA_BINDINGC_REGULARIZATION_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -39,3 +42,5 @@ KHIVAAPI void group_by(khiva_array *array, int *aggregation_function, int *n_col
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/statistics.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_STATISTICS_H
#define KHIVA_BINDINGC_STATISTICS_H

#include <khiva_c/defines.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -117,3 +120,5 @@ KHIVAAPI void skewness_statistics(khiva_array *tss, khiva_array *result);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/c/include/khiva_c/util.h
Expand Up @@ -4,7 +4,12 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGC_UTIL_H
#define KHIVA_BINDINGC_UTIL_H

#include <arrayfire.h>
#include <khiva_c/defines.h>

void check_and_retain_arrays(khiva_array *a, khiva_array *b, af::array &var_a, af::array &var_b);

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/array.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_ARRAY_H
#define KHIVA_BINDINGJAVA_ARRAY_H

#include <arrayfire.h>
#include <jni.h>

Expand Down Expand Up @@ -346,3 +349,5 @@ JNIEXPORT jlong JNICALL Java_io_shapelets_khiva_Array_as(JNIEnv *env, jobject th
#ifdef __cplusplus
}
#endif

#endif
17 changes: 11 additions & 6 deletions bindings/jni/include/khiva_jni/dimensionality.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_DIMENSIONALITY_H
#define KHIVA_BINDINGJAVA_DIMENSIONALITY_H

#include <jni.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -40,7 +43,7 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_paa(JNIEnv *
* @return The updated ref and an array with the most Perceptually Important numberIPs.
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_pip(JNIEnv *env, jobject, jlong ref,
jint numberIPs);
jint numberIPs);

/**
* @brief Applies the Piecewise Linear Approximation (PLA BottomUP) to the time series.
Expand All @@ -55,7 +58,7 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_pip(JNIEnv *
* @return The updated reference and a reference to an Array with the reduced number of points.
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_PLABottomUp(JNIEnv *env, jobject, jlong ref,
jfloat maxError);
jfloat maxError);

/**
* @brief Applies the Piecewise Linear Approximation (PLA Sliding Window) to the time series.
Expand All @@ -70,7 +73,7 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_PLABottomUp(
* @return The updated reference and a reference to an Array with the reduced number of points.
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_PLASlidingWindow(JNIEnv *env, jobject, jlong ref,
jfloat maxError);
jfloat maxError);

/**
* @brief The Ramer–Douglas–Peucker algorithm (RDP) is an algorithm for reducing the number of points in a curve that is
Expand All @@ -90,7 +93,7 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_PLASlidingWi
* and y in column 1).
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_ramerDouglasPeucker(JNIEnv *env, jobject,
jlong ref, jdouble epsilon);
jlong ref, jdouble epsilon);

/**
* @brief Symbolic Aggregate approXimation (SAX). It transforms a numeric time series into a time series of symbols with
Expand All @@ -110,7 +113,7 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_ramerDouglas
* @return The updated ref and an array of symbols.
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_sax(JNIEnv *env, jobject, jlong ref,
jint alphabetSize);
jint alphabetSize);

/**
* @brief Reduces a set of points by applying the Visvalingam method (minimun triangle area) until the number
Expand All @@ -126,8 +129,10 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_sax(JNIEnv *
* and y in column 1).
*/
JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Dimensionality_visvalingam(JNIEnv *env, jobject, jlong ref,
jint numPoints);
jint numPoints);

#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/distances.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_DISTANCES_H
#define KHIVA_BINDINGJAVA_DISTANCES_H

#include <jni.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -86,3 +89,5 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Distances_squaredEuclidean(
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/features.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_FEATURES_H
#define KHIVA_BINDINGJAVA_FEATURES_H

#include <jni.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -847,3 +850,5 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Features_varianceLargerThan
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/library.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_LIBRARY_H
#define KHIVA_BINDINGJAVA_LIBRARY_H

#include <jni.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -67,3 +70,5 @@ JNIEXPORT jstring JNICALL Java_io_shapelets_khiva_Library_version(JNIEnv *env, j
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/linalg.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_LINALG_H
#define KHIVA_BINDINGJAVA_LINALG_H

#include <jni.h>

#ifdef __cplusplus
Expand All @@ -26,3 +29,5 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Linalg_lls(JNIEnv *env, job
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions bindings/jni/include/khiva_jni/matrix.h
Expand Up @@ -4,6 +4,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef KHIVA_BINDINGJAVA_MATRIX_H
#define KHIVA_BINDINGJAVA_MATRIX_H

#include <jni.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -88,3 +91,5 @@ JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Matrix_stompSelfJoin(JNIEnv
#ifdef __cplusplus
}
#endif

#endif

0 comments on commit 1536190

Please sign in to comment.