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

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

?? matrix.h

?? 該軟件為BP網絡的仿真軟件
?? 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 ----> 矩陣的子矩陣返回的結果
	//		[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);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣中的元素進行一次操作:
	//		使矩陣變為單位陣
	//
	void Eye();

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

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

	/////////////////////////////////////////////////////////////////////////
	// Parameter:
	//		CMatrix& cMatrix:		被拷貝的數據源
	//		unsigned int nIndex:	被拷貝的數據在對象中的開始索引位置
	// 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:	被拷貝的數據在對象中的開始索引位置
	// 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:		被拷貝的數據源
	//		unsigned int nIndex:	被拷貝的數據在對象中的開始索引位置
	//		unsigned int nRow:		被拷貝的數據在被拷貝對象中的行索引(從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:	被拷貝的數據在對象中的開始索引位置
	//		unsigned int nRow:		被填充的數據在被填充對象中的行索引
	// 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();

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

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進行拓展
	//	實現功能:
	//		對矩陣的列數進行拓展
	//	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);

	/////////////////////////////////////////////////////////////////////////
	// 對矩陣進行拓展
	//	實現功能:
	//		對矩陣的列數進行拓展,nTimes是每列拓展的次數
	//	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;			// 矩陣所擁有的行數
	unsigned int m_nCol;			// 矩陣所擁有的列數


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

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

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

	/////////////////////////////////////////////////////////////////////////
	// 設置矩陣的行列數
	//
	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);



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




#endif // _MATRIX_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品二区亚洲w码| 日本aⅴ免费视频一区二区三区 | 日韩视频免费观看高清完整版| 99久久精品免费| 99久久婷婷国产| 99久久免费精品高清特色大片| 粉嫩蜜臀av国产精品网站| 成人avav影音| 在线视频综合导航| 欧美日韩三级一区| 日韩欧美国产wwwww| 国产欧美一区二区在线观看| 国产精品午夜在线观看| 亚洲欧美二区三区| 日日骚欧美日韩| 久久99久久精品欧美| 国产91对白在线观看九色| 成人av免费网站| 欧美日韩国产综合一区二区| 欧美哺乳videos| 中文字幕+乱码+中文字幕一区| 亚洲色图视频网| 青椒成人免费视频| www.欧美.com| 日韩视频在线一区二区| 中文一区二区在线观看| 亚洲成av人片观看| 国产99久久久久久免费看农村| 91麻豆免费视频| 久久综合九色综合久久久精品综合 | 日韩精品最新网址| 国产精品国产自产拍高清av| 亚洲va韩国va欧美va| 精品亚洲porn| 欧美少妇一区二区| 欧美国产日韩在线观看| 日韩av中文字幕一区二区| www.亚洲免费av| 精品福利av导航| 一区二区免费在线| 国产69精品久久久久777| 欧美人与性动xxxx| 国产精品久久久久一区| 九九九久久久精品| 欧美日韩你懂得| 亚洲欧洲精品一区二区三区 | 老司机精品视频线观看86 | 欧美日韩一区二区三区在线看| 欧美精品一区二区三区在线| 一区二区三区四区乱视频| 久久99国产精品免费| 91久久精品一区二区二区| 国产欧美日韩综合| 久久99国产精品麻豆| 678五月天丁香亚洲综合网| 日韩毛片精品高清免费| 成人激情校园春色| 久久久久久久电影| 激情综合五月婷婷| 精品黑人一区二区三区久久| 亚洲成人在线观看视频| 日本乱人伦一区| 亚洲视频一区在线| jiyouzz国产精品久久| 欧美精品一区二区三区蜜桃| 蜜臀99久久精品久久久久久软件| 欧美在线三级电影| 亚洲国产欧美另类丝袜| 欧美日韩亚洲综合| 亚洲一本大道在线| 欧美人与禽zozo性伦| 视频一区国产视频| 欧美另类videos死尸| 日韩高清欧美激情| 欧美一区二区日韩| 美女国产一区二区| 久久先锋影音av鲁色资源| 国产乱子轮精品视频| 2020日本不卡一区二区视频| 国内成人精品2018免费看| 2020国产精品自拍| 粉嫩绯色av一区二区在线观看| 中文成人综合网| 91丨porny丨国产| 亚洲成av人**亚洲成av**| 91精品婷婷国产综合久久性色| 捆绑紧缚一区二区三区视频| 久久综合999| www.亚洲人| 午夜av区久久| 久久婷婷综合激情| www.成人网.com| 五月综合激情网| 亚洲精品一区二区三区精华液| 成人自拍视频在线观看| 亚洲免费观看高清在线观看| 欧美人与z0zoxxxx视频| 黄色资源网久久资源365| 中文字幕中文字幕在线一区| 欧美日韩免费电影| 国产不卡视频一区| 亚洲综合小说图片| 精品欧美久久久| 91成人免费网站| 国产精品一区二区久久不卡| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日韩中文精品| 丁香啪啪综合成人亚洲小说| 亚洲高清视频中文字幕| 国产欧美日本一区二区三区| 欧美三级在线看| 国产成人av一区二区三区在线观看| 亚洲黄色性网站| 久久人人爽爽爽人久久久| 欧洲生活片亚洲生活在线观看| 国产九色精品成人porny| 亚洲国产精品久久人人爱蜜臀| 久久精品视频网| 制服丝袜国产精品| 色婷婷av久久久久久久| 国模套图日韩精品一区二区| 亚洲一区二区欧美日韩| 中文字幕中文乱码欧美一区二区| 日韩亚洲欧美成人一区| 欧美伊人久久久久久久久影院 | 九色综合狠狠综合久久| 亚洲免费视频中文字幕| 中文字幕精品一区二区三区精品| 日韩欧美国产一区在线观看| 欧美亚洲一区三区| 色狠狠综合天天综合综合| 成人性生交大片免费看视频在线| 另类专区欧美蜜桃臀第一页| 天堂蜜桃91精品| 亚洲国产精品欧美一二99| 亚洲精品免费一二三区| 国产精品精品国产色婷婷| 久久精品一区二区三区不卡| 精品国产不卡一区二区三区| 欧美一二三四区在线| 欧美日韩国产在线播放网站| 欧美色男人天堂| 欧美日韩精品一区二区| 欧美午夜理伦三级在线观看| 欧美自拍丝袜亚洲| 一本久久a久久精品亚洲| 一本色道亚洲精品aⅴ| 色综合久久综合| 在线观看日产精品| 欧美日韩一区 二区 三区 久久精品| 91久久精品国产91性色tv| 色婷婷一区二区| 欧美丝袜自拍制服另类| 欧美美女网站色| 日韩美女主播在线视频一区二区三区| 制服丝袜一区二区三区| 精品国产精品一区二区夜夜嗨| 日韩视频一区二区三区在线播放| 日韩欧美国产三级| 久久精品无码一区二区三区| 欧美极品美女视频| 最新欧美精品一区二区三区| 亚洲人被黑人高潮完整版| 亚洲国产一区二区视频| 日本aⅴ亚洲精品中文乱码| 精品无人码麻豆乱码1区2区| 国产精品一线二线三线| 波多野结衣亚洲一区| 欧美亚洲免费在线一区| 日韩欧美色综合网站| 久久精品视频免费观看| 一区二区三区四区精品在线视频| 午夜一区二区三区在线观看| 蜜桃av一区二区在线观看| 国产精品一二三四五| 色哟哟在线观看一区二区三区| 777a∨成人精品桃花网| 2020国产精品自拍| 亚洲日穴在线视频| 日本不卡中文字幕| 成人黄色综合网站| 欧美日韩日日摸| 国产欧美日韩在线| 日韩在线一区二区| 国产不卡免费视频| 69p69国产精品| 亚洲欧洲制服丝袜| 狠狠色丁香婷综合久久| 91麻豆国产香蕉久久精品| 日韩三级.com| 亚洲九九爱视频| 狠狠久久亚洲欧美| 欧美日韩日日骚| 18涩涩午夜精品.www| 另类欧美日韩国产在线| 欧美调教femdomvk| 国产精品区一区二区三| 美国十次综合导航| 色成年激情久久综合| 国产农村妇女毛片精品久久麻豆|