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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? matrix.h

?? BP神經(jīng)網(wǎng)絡(luò)算法的仿真程序
?? 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(dllimport) 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 * int'
	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 ----> 子矩陣在矩陣中的起始坐標(biāo),對應(yīng)行,索引從1開始
	//		[in]	nStartY ----> 子矩陣在矩陣中的起始坐標(biāo),對應(yīng)列,索引從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();

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

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


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

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

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

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

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

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中的元素進(jìn)行一次操作:
	//		使矩陣變?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();

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

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進(jìn)行拓展
	//	實現(xiàn)功能:
	//		對矩陣的列數(shù)進(jìn)行拓展
	//	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);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進(jìn)行拓展
	//	實現(xiàn)功能:
	//		對矩陣的列數(shù)進(jìn)行拓展,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ù)和列數(shù)后,矩陣中的元素被重新初始化為0
	/////////////////////////////////////////////////////////////////////////

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

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

	/////////////////////////////////////////////////////////////////////////
	// 設(shè)置矩陣的行列數(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(dllimport) CMatrix operator - (double nValue,CMatrix& cMatrixB);

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



#endif // _MATRIX_H

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产色一区二区| 亚洲乱码国产乱码精品精的特点| 日韩欧美国产系列| 国产精品进线69影院| 欧美a级一区二区| 91小视频在线免费看| 日韩免费福利电影在线观看| 亚洲乱码精品一二三四区日韩在线 | 久久精品国产第一区二区三区| 9色porny自拍视频一区二区| 欧美成人a∨高清免费观看| 亚洲欧美一区二区不卡| 国产成人午夜片在线观看高清观看| 欧美日韩国产影片| 一区二区三区小说| 激情综合五月天| 51精品视频一区二区三区| 一区二区三区四区国产精品| 国产91精品一区二区| 亚洲精品一区二区精华| 视频一区二区中文字幕| 色婷婷综合中文久久一本| 亚洲欧美在线另类| 成人在线视频首页| 国产欧美精品一区二区色综合朱莉 | 北条麻妃国产九九精品视频| 久久亚洲精品小早川怜子| 久久国产精品99精品国产| 欧美精品久久一区二区三区| 国产亚洲污的网站| 日韩高清中文字幕一区| 99久久婷婷国产| 久久九九久久九九| 日韩av电影天堂| www.日韩精品| 久久精品夜色噜噜亚洲aⅴ| 亚洲第四色夜色| 日本视频一区二区三区| 色婷婷av一区二区三区之一色屋| 久久伊99综合婷婷久久伊| 日本欧美一区二区三区| 欧美在线看片a免费观看| 国产免费成人在线视频| 久久久久国产精品麻豆ai换脸| 亚洲自拍偷拍网站| thepron国产精品| 久久精品人人做人人综合 | 国产精品资源在线| 日韩美女天天操| 日本视频在线一区| 欧美精选午夜久久久乱码6080| 欧美一区二区成人| 亚洲综合久久久| 色婷婷国产精品综合在线观看| 中文字幕欧美三区| 国产乱淫av一区二区三区| 精品久久久久久久久久久院品网 | 91精品国产综合久久香蕉的特点| 日韩美女主播在线视频一区二区三区| 午夜在线成人av| 欧美美女bb生活片| 亚洲va韩国va欧美va| 欧美日本一区二区三区四区| 欧美国产一区在线| 成人网男人的天堂| 亚洲人成7777| 一本色道久久综合亚洲精品按摩| 国产精品美女久久久久久久久| 一区二区三区电影在线播| 日本国产一区二区| 午夜精品久久久久久久久久久 | 久久99久久久久久久久久久| 欧美久久一区二区| 国产精品久久久久久久久快鸭 | 欧美巨大另类极品videosbest| 久久亚洲精品小早川怜子| 男女男精品视频网| 7777精品久久久大香线蕉| 久久精品二区亚洲w码| 精品国产髙清在线看国产毛片 | 国产在线精品一区二区夜色| 91精品蜜臀在线一区尤物| 日本大胆欧美人术艺术动态| 久久婷婷成人综合色| 视频一区二区三区中文字幕| 日韩免费高清视频| 久久99国内精品| 欧美不卡在线视频| 亚洲一区二区三区四区五区黄| 9191成人精品久久| 日韩二区三区在线观看| 欧美日韩国产综合一区二区 | 综合色中文字幕| 欧美在线一二三| 久久丁香综合五月国产三级网站| 久久久五月婷婷| 波多野结衣亚洲| 国产婷婷色一区二区三区| 91视频精品在这里| 日本一区二区免费在线| 在线中文字幕不卡| 激情五月激情综合网| 亚洲欧美乱综合| 日韩视频一区在线观看| 国产一区二区免费在线| 久久综合久久综合久久| 精品视频在线免费观看| 国产一区二区美女| 亚洲欧美日韩一区二区三区在线观看 | 国产免费久久精品| 懂色av中文字幕一区二区三区| 精品电影一区二区三区| 在线观看日韩毛片| 国产在线视频精品一区| 亚洲视频1区2区| 精品国产一区二区国模嫣然| 天堂蜜桃一区二区三区| 国产偷国产偷精品高清尤物| 欧美老女人第四色| 色香蕉久久蜜桃| 国产成人日日夜夜| 韩国一区二区三区| 精品久久久久久无| 91麻豆精品91久久久久久清纯 | 色婷婷久久一区二区三区麻豆| 中文字幕av一区二区三区高| 欧美精品 日韩| 国产乱一区二区| 久久久www成人免费毛片麻豆 | 91污片在线观看| 国产一区二区三区视频在线播放| 婷婷国产在线综合| 香港成人在线视频| 亚洲男帅同性gay1069| 国产精品久久久久久久午夜片| 欧美一级在线观看| 91欧美一区二区| 99久久精品费精品国产一区二区| 日韩精品一二三区| 亚洲综合一区二区精品导航| |精品福利一区二区三区| 国产精品热久久久久夜色精品三区 | 亚洲精选视频在线| 欧美国产日韩在线观看| 欧美成人女星排行榜| 在线不卡一区二区| 欧美乱妇一区二区三区不卡视频| 在线观看av一区二区| 成人午夜在线免费| 国产91精品露脸国语对白| 国产成人av影院| 国产99久久久久| 一区二区视频免费在线观看| 自拍av一区二区三区| 亚洲欧洲成人av每日更新| 国产精品久久久久久亚洲伦 | 欧美大黄免费观看| 日韩欧美国产综合一区| 欧美日韩精品一区二区| 欧美精品一级二级| 91精品国产色综合久久不卡电影| 极品尤物av久久免费看| 麻豆成人久久精品二区三区红| 日韩成人av影视| 免费的国产精品| 日韩成人免费在线| 亚洲色图在线视频| 国产精品久久久久久久久久免费看 | 色狠狠一区二区| 欧美伦理电影网| 国产网站一区二区三区| 一区精品在线播放| 亚洲成人av电影在线| 久久精品国产99| 99久久伊人精品| 91精品国产品国语在线不卡| 欧美成人在线直播| 综合在线观看色| 国产精品成人免费精品自在线观看| 天天影视色香欲综合网老头| 美女脱光内衣内裤视频久久网站 | 久久久国产一区二区三区四区小说| 国产欧美日韩麻豆91| 亚洲一区二区三区激情| 蜜桃在线一区二区三区| 精久久久久久久久久久| 99国产精品国产精品久久| 日韩一区二区在线观看视频播放| 亚洲精品视频免费看| 亚洲成av人片一区二区三区| 欧美高清视频www夜色资源网| 韩国av一区二区三区在线观看| 亚洲制服欧美中文字幕中文字幕| 欧美国产日韩一二三区| 欧美丰满美乳xxx高潮www| 欧美视频在线一区二区三区 | 日韩和欧美一区二区| 亚洲欧美日韩久久精品| 中文字幕精品在线不卡| 日本一区二区三区久久久久久久久不|