Exemplo n.º 1
0
void Kernel::computeDiag(MMatrix &d, const MMatrix &X) const
{
 	assert(X.rowsMatch(d) && d.sizeCol()== 1);
 	size_t nRows = X.sizeRow(); 
	for(size_t t = 0; t < nRows; t++)
	 	 d.assign(computeDiagElement(X,t),t);  
}
Exemplo n.º 2
0
void Kernel::computeKernel(MMatrix& K, const MMatrix& X, const MMatrix& X2, size_t row) const
{
	assert(K.rowsMatch(X) && K.sizeCol() == 1);
 	
	for(size_t i = 0; i < K.sizeRow(); i++)
	{
 		K.assign(computeElement(X,i,X2,row),i, 0);
	}
}
Exemplo n.º 3
0
void Kernel::computeKernel(MMatrix &K, const MMatrix &X, const MMatrix &X2) const
{
	assert(K.rowsMatch(X) && K.sizeCol() == X2.sizeRow());
 	
	for(size_t i = 0; i < K.sizeRow(); i++)
	{
		for(size_t j = 0; j < K.sizeCol(); j++)
		{
			K.assign(computeElement(X, i, X2, j), i, j);
		}
	}
}
Exemplo n.º 4
0
void Kernel::computeKernel(MMatrix &K, const MMatrix &X) const
{
	assert(K.rowsMatch(X) && K.isSquare());

	for(size_t i = 0; i < K.sizeRow(); i++)
	{
		for(size_t j = 0; j < i; j++)
		{
			double k = computeElement(X, i, X, j);
	 		K.assign(k,i,j);
			K.assign(k,j,i);
		}
		K.assign(computeDiagElement(X,i), i, i);
	}
	
}