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

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

?? matrix.h

?? BP神經(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(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 ----> 子矩陣在矩陣中的起始坐標,對應行,索引從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(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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩毛片精品高清免费| 欧美日韩免费一区二区三区视频| 成人午夜电影久久影院| 97se亚洲国产综合在线| 欧美亚日韩国产aⅴ精品中极品| 欧美精品日日鲁夜夜添| 精品国产sm最大网站| 亚洲丝袜制服诱惑| 捆绑紧缚一区二区三区视频| 国产精品888| 欧美午夜精品久久久| 欧美成人aa大片| 综合av第一页| 天堂成人免费av电影一区| 国内一区二区在线| 色综合一个色综合亚洲| 91精品国产色综合久久ai换脸 | 亚洲欧美一区二区三区国产精品 | 欧美一级二级在线观看| 欧美高清在线精品一区| 亚洲va欧美va人人爽午夜| 国产成人小视频| 欧美一区二区三区免费视频 | 一本大道av一区二区在线播放| 在线不卡欧美精品一区二区三区| 国产清纯白嫩初高生在线观看91| 午夜视频一区二区三区| 成人一区二区三区视频在线观看| 欧美乱妇20p| 亚洲日本乱码在线观看| 国产麻豆精品在线观看| 欧美剧情片在线观看| 最新欧美精品一区二区三区| 九一九一国产精品| 欧美在线视频你懂得| 国产精品卡一卡二卡三| 国产在线精品视频| 欧美日韩aaaaaa| 亚洲免费大片在线观看| 国产白丝精品91爽爽久久| 欧美大片在线观看| 亚洲成av人影院| 色噜噜狠狠色综合中国| 国产精品午夜在线观看| 国精产品一区一区三区mba视频| 欧美日韩综合在线| 依依成人综合视频| 成人av午夜电影| 国产女人aaa级久久久级 | 久久久久88色偷偷免费| 日本aⅴ亚洲精品中文乱码| 色美美综合视频| 亚洲乱码国产乱码精品精小说 | 中文字幕日韩一区| 国产精品主播直播| 精品国产青草久久久久福利| 日韩国产在线观看| 欧美日韩不卡视频| 午夜精品一区在线观看| 欧美在线色视频| 亚洲一区二区三区美女| 色一区在线观看| 亚洲乱码国产乱码精品精的特点| av一区二区三区黑人| 国产精品私房写真福利视频| 国产另类ts人妖一区二区| 26uuu久久综合| 国产尤物一区二区在线| 2023国产精品| 国产精品99久久久| 欧美激情在线一区二区三区| 国产a级毛片一区| 日本一区二区电影| eeuss鲁一区二区三区| 亚洲欧洲av一区二区三区久久| 成人avav影音| 亚洲精品视频在线看| 色欧美片视频在线观看| 亚洲黄色在线视频| 欧美少妇一区二区| 首页欧美精品中文字幕| 欧美一级一区二区| 狠狠狠色丁香婷婷综合久久五月| 久久综合久色欧美综合狠狠| 国产精品123区| 中文幕一区二区三区久久蜜桃| 成人激情综合网站| 亚洲一区在线视频| 欧美一区二区三区在线| 韩国一区二区在线观看| 中文在线免费一区三区高中清不卡| 成人黄色综合网站| 一区二区三区波多野结衣在线观看| 欧美最猛性xxxxx直播| 亚洲成av人片观看| 精品剧情v国产在线观看在线| 国产精品99久久久久| 亚洲天堂2014| 日韩一区二区不卡| 国产成人免费高清| 亚洲精品国产无天堂网2021| 在线成人午夜影院| 国产成人综合在线播放| 亚洲色图清纯唯美| 91精品国产品国语在线不卡| 国产一区二区三区四| 国产精品精品国产色婷婷| 在线观看日韩高清av| 美日韩一区二区| 中文文精品字幕一区二区| 色婷婷久久久久swag精品| 日韩国产成人精品| 中文在线资源观看网站视频免费不卡 | 在线免费亚洲电影| 美脚の诱脚舐め脚责91| 国产精品久久久久久妇女6080| 欧美日韩性生活| 国产乱人伦精品一区二区在线观看| 亚洲免费色视频| 精品av综合导航| 91久久精品一区二区三| 毛片一区二区三区| 亚洲天堂免费看| 精品国一区二区三区| 99精品视频在线观看| 奇米四色…亚洲| 亚洲少妇中出一区| 精品国产一区a| 欧美日韩一级黄| 成人av资源在线| 日本视频在线一区| 亚洲色大成网站www久久九九| 日韩免费一区二区| 91精彩视频在线观看| 国产成人8x视频一区二区 | 欧美一区二区性放荡片| 不卡视频在线看| 精品在线一区二区三区| 亚洲一区二区欧美| 亚洲国产精品ⅴa在线观看| 欧美精品自拍偷拍| 99国产精品久久久久久久久久 | 久久久国际精品| 欧美日本一区二区三区四区| 不卡在线观看av| 国产在线不卡一卡二卡三卡四卡| 亚洲va韩国va欧美va| 亚洲欧洲日韩av| 久久精品日产第一区二区三区高清版| 欧美日韩国产一区二区三区地区| 成人精品小蝌蚪| 国产乱人伦精品一区二区在线观看| 日韩和欧美的一区| 一区二区三区欧美视频| 国产精品无人区| 2021中文字幕一区亚洲| 欧美一区二区美女| 欧美日韩一区二区三区不卡| 97久久人人超碰| 成人av网站在线观看| 国产精品888| 国产美女在线观看一区| 蜜臀av性久久久久av蜜臀妖精| 亚洲www啪成人一区二区麻豆| 亚洲免费在线电影| 亚洲女同女同女同女同女同69| 亚洲国产激情av| 久久久久国产一区二区三区四区| 日韩午夜电影av| 欧美一区二区三区四区久久| 欧美中文一区二区三区| 欧美视频在线播放| 欧洲精品视频在线观看| 色婷婷久久综合| 在线观看日韩一区| 欧美性猛交xxxx黑人交| 在线一区二区观看| 日本韩国一区二区| 一本到高清视频免费精品| 不卡av免费在线观看| 成人h动漫精品一区二区| av亚洲精华国产精华精| 99久久免费视频.com| av在线播放成人| 色婷婷综合久色| 在线看日韩精品电影| 欧美在线一区二区| 在线播放/欧美激情| 91麻豆精品国产91久久久资源速度| 欧美日韩一区 二区 三区 久久精品| 欧美日韩国产高清一区二区| 欧美精三区欧美精三区| 日韩三级视频在线看| 2021中文字幕一区亚洲| 日本一区二区三区四区| 国产精品久久久久精k8| 一区二区三区日韩| 日韩电影在线看| 精品一区二区久久久| 国产成人精品三级麻豆|