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

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

?? matrix.h

?? 專家系統(tǒng)-神經(jīng)網(wǎng)絡代碼
?? H
字號:
/////////////////////////////////////////////////////////////////////////////
// Matrix.h : 
//		Interface of the class CMatrix
// Author : freeia
// Modified Date : 3/11/2003
// E-mail : freeia@163.com
// Company/School : hdcad
/////////////////////////////////////////////////////////////////////////////

#ifndef _MATRIX_H
#define _MATRIX_H

#include <vector>

using namespace std;

typedef vector <double> VDOUBLE;
typedef vector <VDOUBLE> TMatrix;


class __declspec(dllexport) CMatrix  
{	

	/************************************************************************
	*				the interface function of the class CMatrix 			*
	************************************************************************/
public:

	/////////////////////////////////////////////////////////////////////////
	// Construction and Destruction	
	CMatrix();

	CMatrix(CMatrix& cMatrixB);

	virtual ~CMatrix();

	TMatrix	m_pTMatrix;				// 指向矩陣的頭指針

	/////////////////////////////////////////////////////////////////////////
	// According to the parameters nRow & nCol to construct a matrix
	CMatrix(unsigned int nRow, unsigned int nCol);


	/////////////////////////////////////////////////////////////////////////
	// This function initialize the matrix :
	//		the matrix which has been initialized has 0 row & 0 column, and
	// all elements in it is zeros.
	// 
	void Initialize();

	/////////////////////////////////////////////////////////////////////////
	// This function initialize the matrix :
	//		the matrix which has been initialized has 0 row & 0 column, and
	// all elements in it is zeros.
	// 
	void InitializeZero();

	/////////////////////////////////////////////////////////////////////////
	// To make random in the elements of the matrix and the elements of the 
	// matrix has been randomized between -1 and 1.These elements must be
	// decimal fractions.
	// 
	void RandomInitialize();

	/////////////////////////////////////////////////////////////////////////
	// Overload Operations

	// 'CMatrix + CMatrix'
	CMatrix operator + (CMatrix& cMatrixB);	
	// 'CMatrix - CMatrix'
	CMatrix operator - (CMatrix& cMatrixB);	
	// 'CMatrix * CMatrix'
	CMatrix operator * (CMatrix& cMatrixB);	
	// 'CMatrix * double'
	CMatrix operator * (double nValue);	
	// 'CMatrix = CMatrix'
	CMatrix& operator = (CMatrix& cMatrixB);	
	// 'CMatrix += CMatrix'
	CMatrix& operator += (CMatrix& cMatrixB);	
	// 'CMatrix .* CMatrix'
	CMatrix operator / (CMatrix& cMatrixB);	


	/////////////////////////////////////////////////////////////////////////
	// Transpose the matrix
	//
	CMatrix Transpose();

	/////////////////////////////////////////////////////////////////////////
	// Inverse the matrix
	//
	CMatrix Inverse();

	/////////////////////////////////////////////////////////////////////////
	// Load the data from the file and reset the rows and the colums of the 
	// matrix
	//
	bool LoadDataFromFile(CString& strFileName);

	/////////////////////////////////////////////////////////////////////////
	// Save the data from the CMatrix object to the specified file
	//
	bool SaveDataToFile(CString& strFileName);
	
	/////////////////////////////////////////////////////////////////////////
	// Get the matrix Row Number
	//
	unsigned int GetMatrixRowNumber() const
	{
		return m_nRow;
	}

	/////////////////////////////////////////////////////////////////////////
	// Get the matrix Colum Number
	//
	unsigned int GetMatrixColNumber() const
	{
		return m_nCol;
	}


	/////////////////////////////////////////////////////////////////////////////
	// Load the data from the file and reset the rows and the colums of 
	// the matrixes.
	// Parameter:
	//		[in] strFileName
	//		[out]cMatrixInputToHideWeightValue
	//		[out]cMatrixHideLayerValveValue
	//		[out]cMatrixHideToOutputWeightValue
	//		[out]cMatrixOutputLayerValveValue
	//		[out]nInputLayerNumber
	//		[out]nHideLayerNumber
	//		[out]nOutputLayerNumber
	//		[out]nComboArithmetic
	//		[out]nComboFunc
	//
	bool LoadDataFromFileSpecial (	CString& strFileName,
									CMatrix& cMatrixInputToHideWeightValue,
									CMatrix& cMatrixHideLayerValveValue,
									CMatrix& cMatrixHideToOutputWeightValue,
									CMatrix& cMatrixOutputLayerValveValue,
									unsigned int &nInputLayerNumber,
									unsigned int &nHideLayerNumber,
									unsigned int &nOutputLayerNumber,
									int &nComboArithmetic,
									int	&nComboFunc);


	/////////////////////////////////////////////////////////////////////////
	//	Copy data from a vector to a matrix
	//	Parameter:
	//		[out]	cMatrix ----> the returned value
	//		[in]	nIndex	----> the index in vector
	//	Notes:
	//		the object copied must be vector!!!
	//
	void CopySubMatrixFromVector(CMatrix& cMatrix,unsigned int nIndex);

	/////////////////////////////////////////////////////////////////////////
	// Copy data from sub matrix to another matrix
	// Parameter:
	//		[out]	cMatrix ----> 矩陣的子矩陣返回的結(jié)果
	//		[in]	nStartX ----> 子矩陣在矩陣中的起始坐標,對應行,索引從1開始
	//		[in]	nStartY ----> 子矩陣在矩陣中的起始坐標,對應列,索引從1開始
	//
	void CopySubMatrix(CMatrix& cMatrix,unsigned int nStartX,unsigned int nStartY);

	/////////////////////////////////////////////////////////////////////////
	// Copy Matrix
	//	Parameter:
	//		[in]	cMatrix ----> be copied matrix
	//
	void CopyMatrix(CMatrix& cMatrix);

	/////////////////////////////////////////////////////////////////////////
	// 將矩陣的所有的元素按列合成一列
	//	例如:
	//		matrix = [
	//			1	2	3
	//			4	5	6
	//			7	8	9
	//				]
	//		CMatrix cMatrix = matrix.MergeColumnsToColumnVector();
	//		cMatrix = 
	//			[	1
	//				4	
	//				7
	//				2
	//				5
	//				8
	//				3
	//				6
	//				9	]
	//
	CMatrix MergeColumnsToColumnVector();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = f(x) = 1 / (1 + exp(-x))	( 0 < f(x) < 1)
	//
	CMatrix Sigmoid();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = f'(x) = (1 / (1 + exp(-x)))'	( 0 < f(x) < 1)
	//			  = exp(-x)/((1 + exp(-x))*(1 + exp(-x)))
	//
	CMatrix SigmoidDerivative();


	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = tanh(x) = (1 - exp(-x)) / (1 + exp(-x))
	//					 =  1 - 2 * exp(-x) / (1 + exp(-x))	( -1 < f(x) < 1)
	//
	CMatrix tanh(); 

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = tanh'(x) = ((1 - exp(-x)) / (1 + exp(-x)))'	( -1 < f(x) < 1)
	//					 = 	2*exp(-x)/((1 + exp(-x))*(1 + exp(-x)))
	//
	CMatrix tanhDerivative();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = Tansig(x) = 2 / (1 + exp(-2 * x)) -1
	//
	CMatrix Tansig();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中所有的元素進行一次非線性變換:
	//		變換后的值y與變換前的值的關系是:
	//			y = Tansig'(x) = (2 / (1 + exp(-2 * x)) -1)'
	//				= (2 / (1 + exp(-2 * x)) -1) * (2 / (1 + exp(-2 * x)) -1) -1
	//
	CMatrix TansigDerivative();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中的元素進行一次操作:
	//		使所有行中的相對應的列元素相等
	//	Parameter:
	//		nRowIndex	---->	行索引值(the index starts from 0)
	//							以此行做為標準,使矩陣中其余的行相對應的列的值
	//							與此行相對應的列的值相等	
	//
	void MakeAllColumnElementsSameValue(unsigned int nRowIndex);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中的元素進行一次操作:
	//		使矩陣變?yōu)閱挝魂?	//
	void Eye();

	/////////////////////////////////////////////////////////////////////////
	// Get System Error
	//
	double	GetSystemError() const;

	/////////////////////////////////////////////////////////////////////////
	// Make all the matrix elements to be changed into absolute value
	//
	CMatrix AbsoluteValue();

	/////////////////////////////////////////////////////////////////////////
	// Parameter:
	//		CMatrix& cMatrix:		被拷貝的數(shù)據(jù)源
	//		unsigned int nIndex:	被拷貝的數(shù)據(jù)在對象中的開始索引位置
	// Purpose:
	//		This function will copy all the data of the cMatrix
	// Notes:
	//		The object must be column vector!!!
	//
	void GetMatrixData(CMatrix& cMatrix, unsigned int nIndex);

	/////////////////////////////////////////////////////////////////////////
	// Parameter:
	//		CMatrix& cMatrix:		被填充的矩陣
	//		unsigned int nIndex:	被拷貝的數(shù)據(jù)在對象中的開始索引位置
	// Purpose:
	//		This function will copy part of the object data into cMatrix
	// Notes:
	//		The object must be column vector!!!
	//
	void SetMatrixData(CMatrix& cMatrix, unsigned int nIndex);

	/////////////////////////////////////////////////////////////////////////
	// Parameter:
	//		CMatrix& cMatrix:		被拷貝的數(shù)據(jù)源
	//		unsigned int nIndex:	被拷貝的數(shù)據(jù)在對象中的開始索引位置
	//		unsigned int nRow:		被拷貝的數(shù)據(jù)在被拷貝對象中的行索引(從0開始)
	// Purpose:
	//		This function will copy all the data of the cMatrix
	// Notes:
	//		The object must be column vector!!!
	//
	void GetMatrixRowData(CMatrix& cMatrix, unsigned int nIndex, unsigned int nRow);

	/////////////////////////////////////////////////////////////////////////
	// Parameter:
	//		CMatrix& cMatrix:		被填充的矩陣
	//		unsigned int nIndex:	被拷貝的數(shù)據(jù)在對象中的開始索引位置
	//		unsigned int nRow:		被填充的數(shù)據(jù)在被填充對象中的行索引
	// Purpose:
	//		This function will copy part of the object data to fill the special 
	// row of the cMatrix
	//	Notes:
	//		The object must be column vector!!!
	//
	void SetMatrixRowData(CMatrix& cMatrix, unsigned int nIndex, unsigned int nRow);

	/////////////////////////////////////////////////////////////////////////
	// Get the total value of the matrix
	double GetTotalElementValue();

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進行拓展
	//	實現(xiàn)功能:
	//		對矩陣的列數(shù)進行拓展,nTimes是每列拓展的次數(shù)
	//
	void nncpyi(CMatrix &cMatrix, unsigned int nTimes);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進行拓展
	//	實現(xiàn)功能:
	//		對矩陣的列數(shù)進行拓展
	//	matrix =	[ 
	//			1	2	3
	//			4	5	6
	//			7	8	9
	//				]
	//
	//		nncpyd(matrix)	=	[
	//			1	0	0	2	0	0	3	0	0
	//			0	4	0	0	5	0	0	6	0
	//			0	0	7	0	0	8	0	0	9
	//							]
	void nncpyd(CMatrix &cMatrix);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進行拓展
	//	實現(xiàn)功能:
	//		對矩陣的列數(shù)進行拓展,nTimes是每列拓展的次數(shù)
	//	matrix =	[ 
	//			1	2	3
	//			4	5	6
	//			7	8	9
	//				]
	//		nTimes = 2
	//
	//		nncpyd(matrix)	=	[
	//					1	2	3	1	2	3
	//					4	5	6	4	5	6
	//					7	8	9	7	8	9
	//							]
	//
	void nncpy (CMatrix& cMatrix, unsigned int nTimes);



private:

	unsigned int m_nRow;			// 矩陣所擁有的行數(shù)
	unsigned int m_nCol;			// 矩陣所擁有的列數(shù)


	/////////////////////////////////////////////////////////////////////////
	// 注意:
	//		在重新設置矩陣的行數(shù)和列數(shù)后,矩陣中的元素被重新初始化為0
	/////////////////////////////////////////////////////////////////////////

	/////////////////////////////////////////////////////////////////////////
	// 設置矩陣的行數(shù)
	//
	void SetMatrixRowNumber(unsigned int nRow);

	/////////////////////////////////////////////////////////////////////////
	// 設置矩陣的列數(shù)
	//
	void SetMatrixColNumber(unsigned int nCol);

	/////////////////////////////////////////////////////////////////////////
	// 設置矩陣的行列數(shù)
	//
	void SetMatrixRowAndCol(unsigned int nRow,unsigned int nCol);


	/////////////////////////////////////////////////////////////////////////
	// 交換矩陣的兩行
	//
	void SwapMatrixRow(unsigned int nRow1,unsigned int nRow2);

	/////////////////////////////////////////////////////////////////////////
	// 交換矩陣的兩列
	//
	void SwapMatrixCol(unsigned int nCol1,unsigned int nCol2);


};


/////////////////////////////////////////////////////////////////////////////
// overload operator 'double - CMatrix'
__declspec(dllexport) CMatrix operator - (double nValue,CMatrix& cMatrixB);



/////////////////////////////////////////////////////////////////////////
// 矩陣合并運算符
//	合并規(guī)則:
//		1. 參與合并運算的兩個矩陣的行數(shù)必須相等;
//		2. 參與合并的兩個矩陣的列數(shù)可以不相等;
//		3. 合并后返回的矩陣的行數(shù)與參與合并的矩陣的行數(shù)相等,列數(shù)是參與合并的
//			兩個矩陣的列數(shù)之和;
//
__declspec(dllexport) CMatrix MergeMatrix(CMatrix& cMatrixA,CMatrix& cMatrixB);




#endif // _MATRIX_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久新电视剧免费观看| 久久亚洲精品小早川怜子| 韩国中文字幕2020精品| 亚洲精品免费在线播放| 337p粉嫩大胆噜噜噜噜噜91av| 日本二三区不卡| 国产一区二区精品久久| 日韩高清电影一区| 亚洲美女屁股眼交| 国产精品网站在线| 26uuu亚洲综合色欧美| 欧美人牲a欧美精品| 91美女在线观看| 成人午夜电影久久影院| 国产曰批免费观看久久久| 日欧美一区二区| 亚洲午夜在线电影| 亚洲欧美成aⅴ人在线观看| 久久九九久精品国产免费直播| 欧美一区二区三区婷婷月色| 色婷婷综合激情| av一区二区不卡| 成人免费毛片高清视频| 国产一区二区影院| 极品销魂美女一区二区三区| 日本午夜一区二区| 午夜精品久久久久久久99水蜜桃| 伊人开心综合网| 亚洲欧洲中文日韩久久av乱码| 国产精品网站导航| 国产精品乱码一区二区三区软件| 久久麻豆一区二区| 久久精品日韩一区二区三区| 精品国产百合女同互慰| 欧美一级片免费看| 日韩欧美一级二级三级| 欧美一级理论片| 欧美电影免费观看高清完整版在 | 国产精品毛片久久久久久久| 久久久久久久国产精品影院| 久久精品日韩一区二区三区| 国产欧美日本一区二区三区| 国产精品麻豆欧美日韩ww| 国产精品国产三级国产a| 国产精品另类一区| 亚洲婷婷国产精品电影人久久| 亚洲精品成人精品456| 亚洲黄色性网站| 亚洲第一激情av| 免费人成精品欧美精品 | 毛片基地黄久久久久久天堂| 免费高清视频精品| 开心九九激情九九欧美日韩精美视频电影| 麻豆精品在线观看| 国产一区福利在线| 91在线云播放| 欧美日韩一级片在线观看| 欧美军同video69gay| 欧美一二三四区在线| 久久久久久麻豆| 亚洲欧洲日本在线| 亚洲成人一二三| 黄页网站大全一区二区| 成人小视频在线| 91福利在线观看| 欧美电影免费观看高清完整版在线| 国产日产亚洲精品系列| 亚洲影视在线观看| 裸体一区二区三区| 成人高清免费观看| 欧美另类变人与禽xxxxx| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲欧美怡红院| 午夜日韩在线电影| 国产成人在线免费| 欧美午夜一区二区| 久久综合九色综合97_久久久| 综合久久国产九一剧情麻豆| 日本亚洲视频在线| 99久久久久免费精品国产| 欧美日韩国产片| 国产欧美日韩在线视频| 香蕉加勒比综合久久| 国产成人精品1024| 欧美日韩高清影院| 国产精品美女久久久久高潮 | 高清国产一区二区三区| 在线视频国产一区| 久久日韩精品一区二区五区| 亚洲自拍偷拍网站| 高清不卡在线观看av| 91精品国产麻豆| 亚洲欧洲成人精品av97| 国产制服丝袜一区| 欧美日韩国产一区二区三区地区| 国产精品无圣光一区二区| 日本午夜一区二区| 色8久久精品久久久久久蜜| 欧美精品一区二区三| 一个色在线综合| 成人性生交大片免费看视频在线| 日韩精品一区二区三区视频播放| 亚洲精品中文在线观看| 成人午夜视频在线| 久久婷婷国产综合精品青草| 丝袜a∨在线一区二区三区不卡| 成人18视频日本| 久久精品亚洲国产奇米99| 麻豆精品久久久| 欧美日本在线观看| 亚洲一区二区三区激情| 成人app在线观看| 国产女主播一区| 国内精品嫩模私拍在线| 欧美一区二区二区| 婷婷六月综合网| 91成人看片片| 伊人一区二区三区| 色老综合老女人久久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91蜜桃视频在线| 亚洲欧洲日韩av| 99久久精品国产一区| 人人超碰91尤物精品国产| 欧美网站大全在线观看| 亚洲香肠在线观看| 91精品福利在线| 专区另类欧美日韩| www.综合网.com| 亚洲欧洲av色图| 色综合一区二区| 国产精品77777竹菊影视小说| 丝袜诱惑制服诱惑色一区在线观看| 成人ar影院免费观看视频| 国产日韩欧美高清| 高清国产一区二区| 国产精品伦理一区二区| 99久久国产综合精品女不卡| 国产精品传媒在线| 91麻豆精东视频| 亚洲一区电影777| 欧美另类一区二区三区| 麻豆视频观看网址久久| 精品国产制服丝袜高跟| 国产69精品久久99不卡| 亚洲视频一区在线| 欧美亚洲综合一区| 日韩av二区在线播放| 日韩欧美久久久| 国产suv一区二区三区88区| 中文字幕欧美激情一区| 色狠狠av一区二区三区| 亚洲一级二级三级在线免费观看| 3d成人h动漫网站入口| 激情综合色综合久久综合| 日本一区二区三区国色天香| 99精品在线免费| 爽爽淫人综合网网站 | 国产精品人妖ts系列视频| 99久久久无码国产精品| 婷婷开心激情综合| 国产亚洲综合性久久久影院| 一本一本大道香蕉久在线精品| 图片区日韩欧美亚洲| 久久免费午夜影院| 一本一本大道香蕉久在线精品| 日韩av不卡一区二区| 国产色爱av资源综合区| 欧美私人免费视频| 激情偷乱视频一区二区三区| 18欧美亚洲精品| 欧美一级二级三级蜜桃| 成年人国产精品| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产欧美日韩在线看| 欧美日韩精品三区| 丁香激情综合五月| 天天操天天色综合| 亚洲国产精品99久久久久久久久| 欧美在线观看一区| 国产成人精品在线看| 一区二区三区在线观看网站| 精品国产乱码久久久久久牛牛| 色婷婷av一区二区三区大白胸| 久久精品999| 亚洲综合一区在线| 中国色在线观看另类| 7777精品伊人久久久大香线蕉完整版| 成人动漫视频在线| 蜜桃视频在线观看一区二区| 一区二区三区 在线观看视频| 久久精品欧美日韩精品| 欧美一区二区网站| 欧美午夜电影一区| av一本久道久久综合久久鬼色| 国产在线精品一区二区不卡了 | 蜜臀av国产精品久久久久| 亚洲人成网站在线| 久久精品这里都是精品| 欧美一区二区女人|