From 3acc3151d842922fda223cbed8987b3fe9f83e24 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期五, 13 九月 2024 08:38:49 +0800 Subject: [PATCH] delete bak --- /dev/null | 163 ------------------------------------------------------ 1 files changed, 0 insertions(+), 163 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.cpp.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.cpp.vm deleted file mode 100644 index 2b56a69..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.cpp.vm +++ /dev/null @@ -1,31 +0,0 @@ -\#include "pch.h" -\#include"cstring" -\#include <iostream> -\#include "framework.h" -\#include <fstream> -\#include <stdio.h> -\#include <stdlib.h> -\#include <string.h> -\#include"${pyName}Jni.h" - -JNIEXPORT jobject JNICALL Java_${pkgName.replace('.','_')}_impl_${pyName}Impl_${pyName}Train(JNIEnv* env, jobject object1, jobjectArray data_train, jobject settings) -{ - jclass class_hashmap = env->FindClass("java/util/HashMap"); - jmethodID hashmap_construct_method = env->GetMethodID(class_hashmap, "<init>", "()V"); - jobject obj_hashmap = env->NewObject(class_hashmap, hashmap_construct_method, ""); - env->DeleteLocalRef(class_hashmap); - - obj_hashmap = ${pyName}_train(env, data_train, settings); - return obj_hashmap; -} - -JNIEXPORT jobject JNICALL Java_${pkgName.replace('.','_')}_impl_${pyName}Impl_${pyName}Predict(JNIEnv* env, jobject object1, #{foreach} ($column in [1..$dataLength])jobjectArray data${column}, #{end}jobject model_path_, jobject settings) -{ - jclass class_hashmap = env->FindClass("java/util/HashMap"); - jmethodID hashmap_construct_method = env->GetMethodID(class_hashmap, "<init>", "()V"); - jobject obj_hashmap = env->NewObject(class_hashmap, hashmap_construct_method, ""); - env->DeleteLocalRef(class_hashmap); - - obj_hashmap = ${pyName}_predict(env, #{foreach} ($column in [1..$dataLength])data${column}, #{end}model_path_, settings); - return obj_hashmap; -} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.h.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.h.vm deleted file mode 100644 index ea21d7d..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/Jni.h.vm +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once -/* DO NOT EDIT THIS FILE - it is machine generated */ -//修改 -\#include "jni.h" -//\#include "common.h" -\#include"${pyName}.h" -/* Header for class Jni */ - -//修改cycleCom_impl_CycleComAlg_predFactGuiComShortPointLossRateV2Train -#ifndef _Included_iail_mdk_model_pred_fact_impl_${pyName}Impl_ -\#define _Included_iail_mdk_model_pred_fact_impl_${pyName}Impl_ -#ifdef __cplusplus -extern "C" { -#endif - /* - - */ - //修改Java_iail_mdk_model_pred_spred_impl_LssvmAlg_LssvmPredict - JNIEXPORT jobject JNICALL Java_${pkgName.replace('.','_')}_impl_${pyName}Impl_${pyName}Predict - (JNIEnv*, jobject, #{foreach} ($column in [1..$dataLength])jobjectArray, #{end}jobject, jobject); - JNIEXPORT jobject JNICALL Java_${pkgName.replace('.','_')}_impl_${pyName}Impl_${pyName}Train - (JNIEnv*, jobject, jobjectArray, jobject); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/abstract.java.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/abstract.java.vm deleted file mode 100644 index 584ced8..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/abstract.java.vm +++ /dev/null @@ -1,9 +0,0 @@ -package ${pkgName}; - -import java.util.HashMap; - -public abstract class ${pyName} { - public abstract HashMap<String, Object> train(double data[][], HashMap<String, Object> settings); - - public abstract HashMap<String, Object> predict(#foreach ($column in [1..$dataLength])double data${column}[][], #{end}HashMap<String, Object> model, HashMap<String, Object> settings); -} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/cpp.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/cpp.vm deleted file mode 100644 index 25714c1..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/cpp.vm +++ /dev/null @@ -1,161 +0,0 @@ -\#include "stdafx.h" -\#include "pch.h" -\#include "${pyName}.h" -\#include <string> -\#include "pyutils.h" -\#include "jni.h" -\#include "Python.h" -\#include "PyGILThreadLock.h" -\#include "convertutils.h" - -using namespace std; - -jobject ${pyName}_train(JNIEnv* env, jobjectArray data_train, jobject settings) -{ - try - { - PyGILThreadLock lock; - PyObject* pModule = create_py_module("${pyModule}.${pyName}"); - if (pModule == NULL) - { - cout << "pModule error" << endl; - throw "模块调用失败!"; - } - - //*************导入函数****************** - PyObject* pFunc = PyObject_GetAttrString(pModule, "train"); - if (pFunc == NULL) - { - cout << "pfunc error" << endl; - throw "函数调用失败!"; - } - PyObject* data_1 = ConvertJdarrToPydarr(env, data_train); - PyObject* settings_ = ConvertJhmapToPydict(env, settings); - - //************构造参数数据 ******************** - PyObject* pArg = PyTuple_New(2); - PyTuple_SetItem(pArg, 0, data_1); - PyTuple_SetItem(pArg, 1, settings_); - - /*PyTuple_SetItem(pArg, 1, parseCppData(data_in->feature_range));*/ - - - //********************调用python方法计算***************** - PyObject* pReturn = PyEval_CallObject(pFunc, pArg); - if (pReturn == NULL) - { - cout << "pReturn error" << endl; - throw "函数返回值异常!"; - } - //*******************返回数据封装************************ - // 开辟返回数据内存空间,转换数据,拆分数据 - - /*jobject result = jhmappydict_(env, pReturn);*/ - jobject result = ConvertPydictToJhmap(env, pReturn); - if (result == NULL) - { - cout << "ConvertPydictToJhmap error" << endl; - throw "函数返回值异常!"; - } - delete pModule, pFunc, data_1, settings_, pArg; - return result; - } - catch (const char* msg) - { - cout << "train error" << endl; - return NULL; - } -} - -jobject ${pyName}_predict(JNIEnv* env, #{foreach} ($column in [1..$dataLength])jobjectArray data${column}, #{end}jobject model_path_,jobject settings) -{ - try - { - - PyGILThreadLock lock; - PyObject* pModule = create_py_module("${pyModule}.${pyName}"); - if (pModule == NULL) - { - cout << "model error" << endl; - throw "模块调用失败!"; - } - - //*************导入函数****************** - PyObject* pFunc = PyObject_GetAttrString(pModule, "predict"); - if (pFunc == NULL) - { - cout << "func error" << endl; - throw "函数调用失败!"; - } -#{foreach} ($column in [1..$dataLength]) - PyObject* data_${column} = ConvertJdarrToPydarr(env, data${column}); -#{end} - PyObject* model_path = ConvertJhmapToPydict(env, model_path_); - PyObject* settings_1 = ConvertJhmapToPydict(env, settings); - - - //************构造参数数据 ******************** -#set($a=$dataLength + 2) - PyObject* pArg = PyTuple_New(${a}); -#{foreach} ($column in [1..$dataLength]) -#set($a=$column - 1) - PyTuple_SetItem(pArg, ${a}, data_${column}); -#{end} - PyTuple_SetItem(pArg, ${dataLength}, model_path); -#set($a=$dataLength + 1) - PyTuple_SetItem(pArg, ${a}, settings_1); - - /*PyTuple_SetItem(pArg, 1, parseCppData(data_in->feature_range));*/ - - - //********************调用python方法计算***************** - PyObject* pReturn = PyEval_CallObject(pFunc, pArg); - if (pReturn == NULL) - { - cout << "return error" << endl; - throw "函数返回值异常!"; - } - //*******************返回数据封装************************ - // 开辟返回数据内存空间,转换数据,拆分数据 - - /*jobject result = jhmappydict_(env, pReturn);*/ - jobject result = ConvertPydictToJhmap(env, pReturn); - if (result == NULL) - { - cout << "ConvertPydictToJhmap error" << endl; - throw "函数返回值异常!"; - } - delete pModule; - pModule = nullptr; - delete pModule; - - delete pFunc; - pFunc = nullptr; - delete pFunc; - -#{foreach} ($column in [1..$dataLength]) - delete[] data_${column}; - data_${column} = nullptr; - delete data_${column}; - -#{end} - delete model_path; - model_path = nullptr; - delete model_path; - - delete settings_1; - settings_1 = nullptr; - delete settings_1; - - delete[] pArg; - pArg = nullptr; - delete pArg; - - return result; - } - catch (const char* msg) - { - cout << "predict error" << endl; - return NULL; - } -} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/h.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/h.vm deleted file mode 100644 index dc3490f..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/h.vm +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#ifndef ${pyName}_H -\#define ${pyName}_H - -#endif //PCH_H - -#ifdef _EXPORTING -\#define API_DECLSPEC extern "C" __declspec(dllexport) -\#else -\#define API_DECLSPEC extern "C" __declspec(dllimport) -#endif -// 输入参数 - -\#include <string> -//\#include "PyGILThreadLock.h" -\#include <iostream> -\#include "Python.h" -\#include "jni.h" - -using namespace std; - -jobject ${pyName}_train(JNIEnv* env, jobjectArray data_train, jobject settings); -jobject ${pyName}_predict(JNIEnv* env, #{foreach} ($column in [1..$dataLength])jobjectArray data${column}, #{end}jobject model_path, jobject settings); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/impl.java.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/impl.java.vm deleted file mode 100644 index 1459b49..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/impl.java.vm +++ /dev/null @@ -1,48 +0,0 @@ -package ${pkgName}.impl; - -import ${pkgName}.${pyName}; -import utils.AlgsUtils; - -import java.util.HashMap; - -public class ${pyName}Impl extends ${pyName} { - private AlgsUtils utils = new AlgsUtils(); - //train的输出map - private HashMap<String, Object> train_result; - //predict输入模型 - private HashMap<String, Object> model; - //predict输出模型 - private HashMap<String, Object> predict_result; - - public native HashMap<String, Object> ${pyName}Train(double[][] dataone, HashMap<String, Object> settings); - - @Override - public HashMap<String, Object> train(double[][] dataone, HashMap<String, Object> settings) { - double startTime = System.currentTimeMillis(); //获取开始时间 - - if (dataone == null || dataone.length == 0 || dataone[0].length == 0) { - train_result = new HashMap<String, Object>(); - train_result.put("status_code", -4); - return train_result; - } - - train_result = ${pyName}Train(dataone, settings); - return train_result; - } - - public native HashMap<String, Object> ${pyName}Predict(#foreach ($column in [1..$dataLength])double data${column}[][], #{end}HashMap<String, Object> models, HashMap<String, Object> settings); - - @Override - public HashMap<String, Object> predict(#foreach ($column in [1..$dataLength])double data${column}[][], #{end}HashMap<String, Object> models, HashMap<String, Object> settings) { - model = utils.createPredictHashmapplus(models); - if (#{foreach} ($column in [1..$dataLength])#{if}($column==1)data${column} == null || data${column}.length == 0 || data${column}[0].length == 0#{else} || data${column} == null || data${column}.length == 0 || data${column}[0].length == 0#{end}#{end}) { - predict_result = new HashMap<String, Object>(); - predict_result.put("status_code", -4); - return predict_result; - } - predict_result = ${pyName}Predict(#foreach ($column in [1..$dataLength])data${column}, #{end}model, settings); - - // predict_result.put("result_code",utils.reverseResultCode(predict_result)); - return predict_result; - } -} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/log.txt.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/log.txt.vm deleted file mode 100644 index 1658938..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/log.txt.vm +++ /dev/null @@ -1,9 +0,0 @@ -MDK ${projectName} ${now} 更新日志 - -#{foreach} ($entry in $dataMap.entrySet()) --------------${entry.getKey()}-------------- -#{foreach} ($dto in $entry.getValue()) -${foreach.count}.${dto.getLog()} -#{end} - -#{end} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.Jni.cpp.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.Jni.cpp.vm deleted file mode 100644 index 95998fe..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.Jni.cpp.vm +++ /dev/null @@ -1,33 +0,0 @@ -\#include "pch.h" -\#include"cstring" -\#include <iostream> -\#include "framework.h" -\#include <fstream> -\#include <stdio.h> -\#include <stdlib.h> -\#include <string.h> - -#{foreach} ($entity in $entities) -JNIEXPORT jobject JNICALL Java_${entity.pkgName.replace('.','_')}_impl_${entity.pyName}Impl_${entity.pyName}Train(JNIEnv* env, jobject object1, jobjectArray data_train, jobject settings) -{ - jclass class_hashmap = env->FindClass("java/util/HashMap"); - jmethodID hashmap_construct_method = env->GetMethodID(class_hashmap, "<init>", "()V"); - jobject obj_hashmap = env->NewObject(class_hashmap, hashmap_construct_method, ""); - env->DeleteLocalRef(class_hashmap); - - obj_hashmap = ${entity.pyName}_train(env, data_train, settings); - return obj_hashmap; -} - -JNIEXPORT jobject JNICALL Java_${entity.pkgName.replace('.','_')}_impl_${entity.pyName}Impl_${entity.pyName}Predict(JNIEnv* env, jobject object1, #{foreach} ($column in [1..$entity.dataLength])jobjectArray data${column}, #{end}jobject model_path_, jobject settings) -{ - jclass class_hashmap = env->FindClass("java/util/HashMap"); - jmethodID hashmap_construct_method = env->GetMethodID(class_hashmap, "<init>", "()V"); - jobject obj_hashmap = env->NewObject(class_hashmap, hashmap_construct_method, ""); - env->DeleteLocalRef(class_hashmap); - - obj_hashmap = ${entity.pyName}_predict(env, #{foreach} ($column in [1..$entity.dataLength])data${column}, #{end}model_path_, settings); - return obj_hashmap; -} - -#{end} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.cpp.vm b/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.cpp.vm deleted file mode 100644 index 37d6182..0000000 --- a/iailab-module-model/iailab-module-model-biz/src/main/resources/template_bak/pkg.cpp.vm +++ /dev/null @@ -1,163 +0,0 @@ -\#include "stdafx.h" -\#include "pch.h" -\#include <string> -\#include "pyutils.h" -\#include "jni.h" -\#include "Python.h" -\#include "PyGILThreadLock.h" -\#include "convertutils.h" - -using namespace std; - -#{foreach} ($entity in $entities) -jobject ${entity.pyName}_train(JNIEnv* env, jobjectArray data_train, jobject settings) -{ - try - { - PyGILThreadLock lock; - PyObject* pModule = create_py_module("${entity.pyModule}.${entity.pyName}"); - if (pModule == NULL) - { - cout << "pModule error" << endl; - throw "模块调用失败!"; - } - - //*************导入函数****************** - PyObject* pFunc = PyObject_GetAttrString(pModule, "train"); - if (pFunc == NULL) - { - cout << "pfunc error" << endl; - throw "函数调用失败!"; - } - PyObject* data_1 = ConvertJdarrToPydarr(env, data_train); - PyObject* settings_ = ConvertJhmapToPydict(env, settings); - - //************构造参数数据 ******************** - PyObject* pArg = PyTuple_New(2); - PyTuple_SetItem(pArg, 0, data_1); - PyTuple_SetItem(pArg, 1, settings_); - - /*PyTuple_SetItem(pArg, 1, parseCppData(data_in->feature_range));*/ - - - //********************调用python方法计算***************** - PyObject* pReturn = PyEval_CallObject(pFunc, pArg); - if (pReturn == NULL) - { - cout << "pReturn error" << endl; - throw "函数返回值异常!"; - } - //*******************返回数据封装************************ - // 开辟返回数据内存空间,转换数据,拆分数据 - - /*jobject result = jhmappydict_(env, pReturn);*/ - jobject result = ConvertPydictToJhmap(env, pReturn); - if (result == NULL) - { - cout << "ConvertPydictToJhmap error" << endl; - throw "函数返回值异常!"; - } - delete pModule, pFunc, data_1, settings_, pArg; - return result; - } - catch (const char* msg) - { - cout << "train error" << endl; - return NULL; - } -} - -jobject ${entity.pyName}_predict(JNIEnv* env, #{foreach} ($column in [1..$entity.dataLength])jobjectArray data${column}, #{end}jobject model_path_,jobject settings) -{ - try - { - - PyGILThreadLock lock; - PyObject* pModule = create_py_module("${entity.pyModule}.${entity.pyName}"); - if (pModule == NULL) - { - cout << "model error" << endl; - throw "模块调用失败!"; - } - - //*************导入函数****************** - PyObject* pFunc = PyObject_GetAttrString(pModule, "predict"); - if (pFunc == NULL) - { - cout << "func error" << endl; - throw "函数调用失败!"; - } -#{foreach} ($column in [1..$entity.dataLength]) - PyObject* data_${column} = ConvertJdarrToPydarr(env, data${column}); -#{end} - PyObject* model_path = ConvertJhmapToPydict(env, model_path_); - PyObject* settings_1 = ConvertJhmapToPydict(env, settings); - - - //************构造参数数据 ******************** -#set($a=$entity.dataLength + 2) - PyObject* pArg = PyTuple_New(${a}); -#{foreach} ($column in [1..$entity.dataLength]) -#set($a=$column - 1) - PyTuple_SetItem(pArg, ${a}, data_${column}); -#{end} - PyTuple_SetItem(pArg, ${entity.dataLength}, model_path); -#set($a=$entity.dataLength + 1) - PyTuple_SetItem(pArg, ${a}, settings_1); - - /*PyTuple_SetItem(pArg, 1, parseCppData(data_in->feature_range));*/ - - - //********************调用python方法计算***************** - PyObject* pReturn = PyEval_CallObject(pFunc, pArg); - if (pReturn == NULL) - { - cout << "return error" << endl; - throw "函数返回值异常!"; - } - //*******************返回数据封装************************ - // 开辟返回数据内存空间,转换数据,拆分数据 - - /*jobject result = jhmappydict_(env, pReturn);*/ - jobject result = ConvertPydictToJhmap(env, pReturn); - if (result == NULL) - { - cout << "ConvertPydictToJhmap error" << endl; - throw "函数返回值异常!"; - } - delete pModule; - pModule = nullptr; - delete pModule; - - delete pFunc; - pFunc = nullptr; - delete pFunc; - -#{foreach} ($column in [1..$entity.dataLength]) - delete[] data_${column}; - data_${column} = nullptr; - delete data_${column}; - -#{end} - delete model_path; - model_path = nullptr; - delete model_path; - - delete settings_1; - settings_1 = nullptr; - delete settings_1; - - delete[] pArg; - pArg = nullptr; - delete pArg; - - return result; - } - catch (const char* msg) - { - cout << "predict error" << endl; - return NULL; - } -} - -#{end} \ No newline at end of file -- Gitblit v1.9.3