提交 | 用户 | 时间
|
f7932f
|
1 |
// TestJNI.cpp : ���� DLL Ӧ�ó���ĵ��������� |
D |
2 |
#include "pch.h" |
|
3 |
#include "opt.h" |
|
4 |
#include"cstring" |
|
5 |
#include <iostream> |
|
6 |
#include "framework.h" |
|
7 |
#include <fstream> |
|
8 |
#include <sstream> |
|
9 |
#include <map> |
|
10 |
#include <stdio.h> |
|
11 |
#include <stdlib.h> |
|
12 |
#include <string.h> |
|
13 |
#include"optmethod.h" |
|
14 |
|
|
15 |
using namespace std; |
|
16 |
JNIEXPORT jobject JNICALL Java_iail_mdk_model_opt_impl_OptAlgImpl_OPT(JNIEnv *env, jobject object1, jobjectArray data, jobject settings) { |
|
17 |
/*�����ʼ��*/ |
|
18 |
darr<float> *data_in = new darr<float>(); |
|
19 |
ga_opt_inp *setting = new ga_opt_inp(); |
|
20 |
ga_opt_outp *resPtr = new ga_opt_outp(); |
|
21 |
|
|
22 |
/*.��java�еĶ�ά����ת��Ϊc++�е�darr_f2*/ |
|
23 |
Array2ConvertoDarr(env, data, data_in); |
|
24 |
/*HashMap��ֵ��setting*/ |
|
25 |
HashMapConvertoGa_Opt_Inp(env, settings, setting); |
|
26 |
jobject obj_hashmap = CreateHashMap(env); |
|
27 |
//resPtr = ga_opt(data_in, setting); |
|
28 |
//Ga_Opt_OutpConvertoHashMap(env, obj_hashmap, resPtr); |
|
29 |
put(env, obj_hashmap, ConvertoJobject(env, 10.1), ConvertoJobject(env, 10.2)); |
|
30 |
return obj_hashmap; |
|
31 |
|
|
32 |
} |