亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fiscore.c

?? 模糊控制工具箱,很好用的,有相應的說明文件,希望對大家有用!
?? C
字號:
/* Copyright 1994-2001 The MathWorks, Inc. */
/* $Revision: $  $Date: $  */

#include "mex.h"

#include "fis.h"
#include "lib.c"
#include "mf.c"
#include "t_norm.c"
#include "defuzz.c"
#include "callml.c"
#include "list.c"
#include "list2.c"
#include "evaluate.c"

/***********************************************************************
 Main routine 
 **********************************************************************/

#define	HANDLE	prhs[0]		/* handle of FIS */
#define	ACTION	prhs[1]		/* action string */
#define	DATA	prhs[2]		/* data array */
#define	OUTPUT	plhs[0]		/* output */

static void
fisAtExit()
{
	int nlhs = 0;
	int nrhs = 3;
	mxArray **plhs = NULL;
	mxArray **prhs;

	prhs = (mxArray **)mxCalloc(nrhs, sizeof(mxArray *));
	HANDLE = mxCreateDoubleMatrix(1, 1, mxREAL);
	ACTION = mxCreateString("at_exit");
	DATA = mxCreateDoubleMatrix(1, 1, mxREAL);
	mexFunction(nlhs, plhs, nrhs, prhs);
}

void
mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
	double	*output, *input;
	unsigned int m ,n;
	int i, j, handle, data_n;
	FIS *p, *fis; 
	char action[STR_LEN], fisName[STR_LEN];
	static FIS *head = NULL, *curr_fis = NULL;
	static int initialized = 0;	/* for mexAtExit() */

	if (initialized == 0) {
		mexAtExit(fisAtExit);
		initialized = 1;
	}

	if (nrhs != 3)
		mexErrMsgTxt("Needs 3 arguments.");
	if (mxGetM(HANDLE) != 1 || mxGetN(HANDLE)!= 1)
		mexErrMsgTxt("The first argument must be a scalar.");
	if (!mxIsChar(ACTION))
		mexErrMsgTxt("The second argument must be an action string.");

	mxGetString(ACTION, action, mxGetN(ACTION)+1);
	handle = mxGetScalar(HANDLE);

	/* Evaluate the output of the FIS with the given handle*/
	/* If handle <= 0, use current FIS */
	if (strcmp(action, "evaluate") == 0) {
		fis = handle > 0 ? fisMatchHandle(head, handle): curr_fis;
		if (curr_fis == NULL)
			mexErrMsgTxt("No FIS in memory!");

		/* Check the dimensions of input vector */
		/* This is permissive - granted as long as enough inputs
		   are there. So the user can pass the original training data
		   directly */
		m = mxGetM(DATA);
		n = mxGetN(DATA);
		if (!((n >= fis->in_n) || ((n == 1) && (m >= fis->in_n)))) {
			mexPrintf("Input vector is of size %d by %d.\n", m, n);
			mexPrintf("Number of input variables should be %d.\n", fis->in_n);
			mexErrMsgTxt("Input vector has a wrong size!");
		}



		if ((n == 1) && (m == fis->in_n))
			data_n = 1;
		else
			data_n = m;

		/* Create a matrix for the return argument */
		OUTPUT = mxCreateDoubleMatrix(data_n, fis->out_n, mxREAL);

		for (i = 0; i < data_n; i++) {
			/* Assign pointers to the various parameters */
			output = mxGetPr(OUTPUT);
			input = mxGetPr(DATA);

			/* Dispatch the inputs */
			for (j = 0; j < fis->in_n; j++)
				fis->input[j]->value = input[j*data_n+i];
			/* Compute the output */
			fisEvaluate(fis);
			/* Collect the output */
			for (j = 0; j < fis->out_n; j++)
				output[j*data_n+i] = fis->output[j]->value;
		}
	}

	/* Load parameters (from another fismat) to FIS */
	else if (strcmp(action, "load_param") == 0) {
		double **fismatrix;
		int m, n;

		if (!mxIsNumeric(DATA))
			mexErrMsgTxt("The second argument must be a numeric data.");

		/* put fismatrix into proper format */
		m = mxGetM(DATA);
		n = mxGetN(DATA);
		fismatrix = (double **)fisCreateMatrix(m, n, sizeof(double));
		for (i = 0; i < m; i++)
			for (j = 0; j < n; j++)
				fismatrix[i][j] = mxGetPr(DATA)[j*m + i];

		/* Set FIS if handle > 0, otherwise use the original curr. FIS */
		fis = handle > 0 ? fisMatchHandle(head, handle): curr_fis;
		fisLoadParameter(fis, fismatrix);

		/* Free fismatrix */
		fisFreeMatrix((void **)fismatrix, m);
	}

	/* Load parameters (from an array) to FIS */
	else if (strcmp(action, "load_param1") == 0) {
		if (!mxIsNumeric(DATA))
			mexErrMsgTxt("The second argument must be a numeric data.");

		/* Set FIS if handle > 0, otherwise use the original curr. FIS */
		fis = handle > 0 ? fisMatchHandle(head, handle): curr_fis;
		fisLoadParameter1(fis, mxGetPr(DATA));
	}

	/* Build a new FIS node, add it to the end, and make it current */
	/* Build a new FIS node, add it to the end, and make it current */
	/* Name clash is not checked */
	else if (strcmp(action, "build") == 0) {
		double **fismatrix;
		int m, n;

		if (!mxIsNumeric(DATA))
			mexErrMsgTxt("The second argument must be a numeric data.");
		/* put fismatrix into proper format */
		m = mxGetM(DATA);
		n = mxGetN(DATA);
		fismatrix = (double **)fisCreateMatrix(m, n, sizeof(double));
		for (i = 0; i < m; i++)
			for (j = 0; j < n; j++)
				fismatrix[i][j] = mxGetPr(DATA)[j*m + i];

		/* Create FIS node */
		fis = (FIS *)calloc(1, sizeof(FIS));
		fisBuildFisNode(fis, fismatrix, n);
		fis->handle = fisFindMaxHandle(head) + 1;
		fis->next = NULL;

		/* Free fismatrix */
		fisFreeMatrix((void **)fismatrix, m);

		/* Create a matrix for the return argument */
		OUTPUT = mxCreateDoubleMatrix(1, 1, mxREAL);
		/* output[0] is equal to the handle of newly created FIS */
		output = mxGetPr(OUTPUT);

		if (head == NULL) {
			head = fis;
		} else {
			/* Find p as the tail of the FIS list */
			/* Also find the handle for this new node */
			for (p = head; p->next != NULL; p = p->next);
			p->next = fis;
		}
		/* curr_fis is the newly created fis */
		curr_fis = fis;
		output[0] = fis->handle;
	}

	/* Delete the current FIS, change the current FIS to head */
	/* If there is a valid handle, delete the FIS with that handle */
	else if (strcmp(action, "delete") == 0) {
		if (head  == NULL) {
			mexPrintf("No FIS in memory!\n");
			return;
		}

		/* Delete FIS with given valid handle. */
		/* If given handle is unvalid, delete the curretn FIS */
		fis = handle > 0 ? fisMatchHandle(head, handle): curr_fis;
		if (fis == head)
			head = head->next;
		else {
			/* find p such p->next == fis */
			for (p = head; p->next != fis; p = p->next);
			p->next = fis->next;
		}
		/* Change  current FIS to head if it is deleted */
		if (fis == curr_fis)
			curr_fis = head;
		fisFreeFisNode(fis);
	}

	/* Delete all data structure */
	/* This is used in mexAtExit only */
	else if (strcmp(action, "at_exit") == 0) {
		FIS *next, *now = head;
		/*
		if (head != NULL)
			mexPrintf("Destroying FIS data structures ...\n");
		*/
		while (now != NULL) {
			mexPrintf("Deleting %s FIS data structure...\n", now->name);
			next = now->next;
			fisFreeFisNode(now);
			now = next;
		}
	}

	/* Print the FIS with given handle. DATA is not used. */
	else if (strcmp(action, "print_fis_data") == 0) {
		fis = fisMatchHandle(head, handle);
		fisPrintData(fis);
	}

	/* Set current FIS by handle if handle > 0, otherwise by name */
	else if (strcmp(action, "set_current") == 0) {
		if (head == NULL)
			mexErrMsgTxt("No FIS is in memory!\n");
		if (handle <= 0) { /* by namee */
			if (!mxIsChar(DATA))
				mexErrMsgTxt("The third argument must be a string.");
			/* Create the fisName string */
			mxGetString(DATA, fisName, mxGetN(DATA)+1);

			fis = fisMatchName(head, fisName);
			if (fis == NULL)
				mexErrMsgTxt("Cannot find an FIS with the given name!");
		} else /* by handle */
			fis = fisMatchHandle(head, handle);
		curr_fis = fis;
	}

	/* Return the handle of the current FIS if DATA == [] */
	/* (Return 0 if the current FIS is NULL) */
	/* If DATA is not [], return handle with that name. */
	else if (strcmp(action, "return_handle") == 0) {
		OUTPUT = mxCreateDoubleMatrix(1, 1, mxREAL);
		if (mxIsNumeric(DATA) && (mxGetM(DATA) == 0) && (mxGetN(DATA) == 0))
			*(mxGetPr(OUTPUT)) = curr_fis == NULL ? 0:curr_fis->handle;
		else { /* return handle with given name */
			if (!mxIsChar(DATA))
				mexErrMsgTxt("The third argument must be a string.");
			/* Create the fisName string */
			mxGetString(DATA, fisName, mxGetN(DATA)+1);

			fis = fisMatchName(head, fisName);
			if (fis == NULL)
				mexErrMsgTxt("Cannot find an FIS with the given name!");
			*(mxGetPr(OUTPUT)) = fis == NULL ? 0:fis->handle;
		}
	}

	else if (strcmp(action, "print_name") == 0) {
		/* print name of FIS with given handle */
		if (head == NULL)
			mexErrMsgTxt("No FIS is in memory.");
		fis = handle > 0 ? fisMatchHandle(head, handle): curr_fis;
		mexPrintf("%s\n", fis->name);
	}

	else if (strcmp(action, "list_all") == 0) {
		if (head == NULL) {
			mexPrintf("No FIS is in memory.\n");
			return;
		}
		for (p = head; p != NULL; p = p->next) {
			/*
			mexPrintf("p = %d\t", p);
			mexPrintf("p->next = %d\n", p->next);
			*/
			mexPrintf("\t%d\t%s\n", p->handle, p->name);
		}
		mexPrintf("\n");
	}

	/* Unrecognized action string */
	else {
		mexPrintf("The action string %s is not recognized!\n", action);
		return;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一二三区| 七七婷婷婷婷精品国产| 亚洲一区在线观看免费| 久久成人免费电影| 91浏览器打开| 精品日韩在线一区| 亚洲成av人片在www色猫咪| 国产伦精品一区二区三区免费迷| 欧美综合一区二区| 亚洲国产电影在线观看| 久久99国产精品麻豆| 日本高清成人免费播放| 亚洲国产精品成人综合| 国内精品在线播放| 欧美一区二区精品久久911| 一区二区三区在线视频播放| 国产成人av电影| 久久影院午夜论| 日韩综合小视频| 欧美视频完全免费看| 亚洲视频网在线直播| 成人性生交大片免费看在线播放| 精品欧美乱码久久久久久 | 国产成a人亚洲精品| 欧美一级理论片| 三级在线观看一区二区| 欧美日韩视频在线一区二区| 亚洲精品亚洲人成人网在线播放| 成人免费观看视频| 国产农村妇女毛片精品久久麻豆| 国产综合色在线视频区| 精品免费国产一区二区三区四区| 日韩av电影免费观看高清完整版 | 欧美久久婷婷综合色| 玉足女爽爽91| 在线看一区二区| 亚洲在线视频免费观看| 欧美色中文字幕| 亚洲6080在线| 欧美一级二级在线观看| 激情av综合网| 国产精品每日更新| 99国产精品国产精品久久| 国产精品久久看| 欧美综合亚洲图片综合区| 亚洲va国产天堂va久久en| 91精品国产一区二区| 久久综合综合久久综合| 久久久久久久久久久久久久久99 | 中文字幕欧美国产| 91视视频在线观看入口直接观看www | 日韩影院精彩在线| 日韩午夜精品视频| 国产成人免费在线| 亚洲男人天堂一区| 717成人午夜免费福利电影| 美女一区二区三区| 国产精品久久久久久久久免费相片 | 色综合久久久久网| 丝袜a∨在线一区二区三区不卡| 日韩区在线观看| 国产成人啪免费观看软件| 亚洲欧美日韩电影| 欧美一区二区啪啪| 成人福利视频在线| 首页综合国产亚洲丝袜| 久久久久久久久久久黄色| 日本乱码高清不卡字幕| 激情久久五月天| 亚洲永久精品大片| 久久久午夜精品| 欧美性大战xxxxx久久久| 九色|91porny| 一区二区三区国产精品| 26uuu亚洲婷婷狠狠天堂| 色噜噜狠狠色综合中国| 六月丁香综合在线视频| 一个色在线综合| 国产偷国产偷精品高清尤物 | 一区二区理论电影在线观看| 欧美一级黄色录像| 一本大道久久精品懂色aⅴ| 久久av资源站| 亚洲成人你懂的| 中文字幕一区二区在线播放| 欧美一级黄色大片| 欧美日韩在线免费视频| 成人免费高清在线| 九九视频精品免费| 三级在线观看一区二区| 亚洲人成在线播放网站岛国| 久久日韩粉嫩一区二区三区 | 日本高清无吗v一区| 高清不卡一区二区| 开心九九激情九九欧美日韩精美视频电影| 亚洲欧美日韩国产手机在线| 中文字幕免费观看一区| 欧美成人a∨高清免费观看| 欧美三级午夜理伦三级中视频| 成人一区二区三区视频在线观看 | 成人自拍视频在线观看| 久久97超碰国产精品超碰| 男女性色大片免费观看一区二区| 亚洲愉拍自拍另类高清精品| 亚洲欧美日韩电影| 亚洲日本一区二区| 亚洲视频在线观看一区| 中文字幕一区二| 国产精品国产三级国产有无不卡| 久久久久9999亚洲精品| 久久夜色精品国产噜噜av| 欧美xxxx在线观看| 久久综合资源网| 久久色在线视频| 久久夜色精品一区| 国产日韩欧美激情| 中文字幕乱码一区二区免费| 欧美激情一区二区三区在线| 26uuu精品一区二区在线观看| 精品欧美一区二区久久| 久久久久亚洲蜜桃| 国产日产欧美一区| 国产精品色噜噜| 亚洲私人影院在线观看| 一区二区在线看| 亚洲超碰精品一区二区| 男男视频亚洲欧美| 狠狠色丁香久久婷婷综合_中 | 日韩欧美色电影| 精品成人一区二区三区四区| 久久精品一区四区| 国产精品护士白丝一区av| 亚洲免费观看高清完整版在线| 亚洲乱码国产乱码精品精的特点 | 亚洲美女淫视频| 亚洲成人在线网站| 精品一区中文字幕| 白白色 亚洲乱淫| 色综合久久久久久久久久久| 欧美日韩高清一区二区不卡| 精品人在线二区三区| 国产精品久久99| 午夜激情一区二区三区| 国产一区二区在线看| 94色蜜桃网一区二区三区| 精品视频在线视频| 久久―日本道色综合久久| 中文字幕一区二区三区四区| 视频精品一区二区| 成人黄色在线网站| 欧美日韩午夜精品| 久久久影视传媒| 亚洲国产一区在线观看| 国产一区二区在线视频| 在线观看视频一区| 国产视频在线观看一区二区三区| 亚洲另类在线制服丝袜| 国产九色sp调教91| 欧美色大人视频| 中文字幕乱码久久午夜不卡| 午夜伊人狠狠久久| 成人av在线播放网址| 91精品国产综合久久精品app| 国产欧美精品国产国产专区| 亚洲成av人片观看| 99久久精品费精品国产一区二区| 日韩精品一区二区三区视频在线观看| 中日韩av电影| 麻豆久久一区二区| 欧美在线免费观看视频| 中文字幕av一区 二区| 青青国产91久久久久久| 一本久久精品一区二区| 久久久综合视频| 日本成人中文字幕在线视频| 色综合久久天天综合网| 国产精品毛片a∨一区二区三区| 久久精品国产精品青草| 欧美视频在线一区| 亚洲欧美一区二区三区久本道91| 激情综合色综合久久综合| 欧美福利视频一区| 一区二区三区欧美亚洲| 成人国产精品免费观看动漫| 久久综合色8888| 免费久久99精品国产| 欧美精品tushy高清| 亚洲综合色丁香婷婷六月图片| 国产91丝袜在线观看| 国产午夜精品福利| 黑人精品欧美一区二区蜜桃| 日韩欧美自拍偷拍| 久久99久久久欧美国产| 日韩区在线观看| 国内一区二区视频| 国产校园另类小说区| 国产精品996| 国产精品伦理一区二区| k8久久久一区二区三区| 18欧美乱大交hd1984|