@Override public void dgemm(boolean transposeA, boolean transposeB, double alpha, DoubleMatrix2D A, DoubleMatrix2D B, double beta, DoubleMatrix2D C){
		if (B.rows() != A.cols())
			throw new IllegalArgumentException ("Multipication undefined.");
		if (C.rows() != A.rows() || C.cols() != B.cols())
			throw new IllegalArgumentException ("C has wrong dimensions .");
		if (A == C || B == C)
			throw new IllegalArgumentException ("A or B is bad.");

		if (transposeA)
			A = MathUtils.transpose(A);
		if (transposeB)
			B = MathUtils.transpose(B);
		for ( final Pointer ptr = C.ptr(); ptr.hasNext(); ptr.increment())
			ptr.setValue(ptr.getValue() * beta);
		daxpy(alpha, MathUtils.matrixMultiply(A, B), C);
	}