diff --git a/src/methods/new_method_template/Makefile b/src/methods/new_method_template/Makefile deleted file mode 100644 index c95df91abedbee8c1261c05e25ef6db73032d7d4..0000000000000000000000000000000000000000 --- a/src/methods/new_method_template/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -splfr=/usr/local/sicstus4.7.1/bin/splfr - -METHOD_NAME=new_method - -$(METHOD_NAME).so: $(METHOD_NAME).pl $(METHOD_NAME).cpp - $(splfr) -larmadillo -fopenmp -lmlpack -lstdc++ -cxx --struct $(METHOD_NAME).pl $(METHOD_NAME).cpp ../../helper_files/helper.cpp -clean: - rm $(METHOD_NAME).so diff --git a/src/methods/new_method_template/new_method.cpp b/src/methods/new_method_template/new_method.cpp deleted file mode 100644 index b425679ae1bdc305a0b5fb71e52554f3d2fd42d4..0000000000000000000000000000000000000000 --- a/src/methods/new_method_template/new_method.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include <sicstus/sicstus.h> -/* ex_glue.h is generated by splfr from the foreign/[2,3] facts. - Always include the glue header in your foreign resource code. -*/ -#include "new_method_glue.h" -#include <mlpack/methods/new_method.hpp> -#include <mlpack/core.hpp> - -// including helper functions for converting between arma structures and arrays -#include "../../helper_files/helper.hpp" - -// some of the most used namespaces -using namespace arma; -using namespace mlpack; -using namespace std; - -// Global Variable of the GlobalMethodObject object so it can be accessed from all functions -GlobalMethodObject globalMethodObject; - -// TODO: -// input: -// output: -// description: -void sampleFunction() -{ - //stuff; -} - -// Basic input parameters -// -// SP_integer integerNumber, double doubleNumber, char const *string -// -// Snippets -// -// Take Matrix: mat-take, take-mat -// Take Array: arr-take, take-arr -// -// Return Matrix: mat-return, return-mat -// Return Array: arr-return, return-arr diff --git a/src/methods/new_method_template/new_method.pl b/src/methods/new_method_template/new_method.pl deleted file mode 100644 index 2f37c9c96514c831233953420a763e74d66f024b..0000000000000000000000000000000000000000 --- a/src/methods/new_method_template/new_method.pl +++ /dev/null @@ -1,49 +0,0 @@ - -:- module(new_method, [function/1]). - -%% requirements of library(struct) -:- load_files(library(str_decl), - [when(compile_time), if(changed)]). - -%% needed for using the array type -:- use_module(library(structs)). -:- use_module('../../helper_files/helper.pl'). - -%% type definitions for the float array -:- foreign_type - float32 = float_32, - float_array = array(float32). - -%% definitions for the connected function - -%% TODO: -%% --Input-- -%% -%% --Output-- -%% -%% --Description-- -foreign(function, c, function(arguments)). - - - -%% +integer , +float32, +string -%% [-integer] , [-float32], [-string] - -%% matrix input -%% +pointer(float_array), +integer, +integer - -%% array input -%% +pointer(float_array), +integer - -%% matrix return -%% -pointer(float_array), -integer, -integer - -%% array return -%% -pointer(float_array), -integer - -%% bool name => (1)true / (0)false - -%% Defines the functions that get connected from new_method.cpp -foreign_resource(new_method, [function]). - -:- load_foreign_resource(new_method). diff --git a/src/methods/new_method_template/new_method_test.pl b/src/methods/new_method_template/new_method_test.pl deleted file mode 100644 index 043589b4f3e3d92b84e74b08275f8565113119f1..0000000000000000000000000000000000000000 --- a/src/methods/new_method_template/new_method_test.pl +++ /dev/null @@ -1,44 +0,0 @@ - -:- module(new_method_tests, [run_new_method_tests/0]). - -:- use_module(library(plunit)). - -:- use_module(new_method). -:- use_module('../../helper_files/helper.pl'). - -reset_Model :- - initModel(1,0,50,0.0001). - -%% -%% TESTING predicate predicate/10 -%% -:- begin_tests(predicate). - -%% Failure Tests - -test(testDescription, [error(domain_error('expectation' , culprit), _)]) :- - reset_Model_No_Train(perceptron), - train([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,0,0,0], 2, culprit, 50, 0.0001, _). - -test(testDescription2, [error(_,system_error('The values of the Label have to start at 0 and be >= 0 and < the given numClass!'))]) :- - reset_Model_No_Train(perceptron), - train([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,2], 2, perceptron, 50, 0.0001, _). - - -%% Successful Tests - -test(testDescription3, [true(Error =:= 1)]) :- - reset_Model_No_Train(perceptron), - train([5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,0,0,0], 2, perceptron, 50, 0.0001, Error). - -test(testDescription4, [true(Error =:= 0.9797958971132711)]) :- - reset_Model_No_Train(perceptron), - open('src/data_csv/iris2.csv', read, File), - take_csv_row(File, skipFirstRow,10, Data), - train(Data, 4, [0,1,0,1,1,0,1,1,1,0], 2, perceptron, 50, 0.0001, Error). - -:- end_tests(predicate). - -run_new_method_tests :- - run_tests. -