Thanks Heiko, Sergey. Will look into the noalias. One more question. What
would be an efficient way to initialize a SparseMatrix (eigen3) from
SGSparseMatrix? I was writing the log determinant for the sparse matrix
case, and was considering taking a SGSparseMatrix as input.


On Sat, Mar 30, 2013 at 1:00 AM, Sergey Lisitsyn
<notifications@github.com>wrote:

> In tests/unit/mathematics/Statistics_unittest.cc:
>
> > +	
> > +	/* the cholesky decomposition gives m = L.L', where
> > +	 * L = [(2, 0, 0), (6, 1, 0), (-8, 5, 3)].
> > +	 * 2 * (log(2) + log(1) + log(3)) = 3.58352
> > +	 */
> > +	EXPECT_FLOAT_EQ(CStatistics::log_det(m), 3.58352);
> > +
> > +	// TEST 2
> > +	// create random positive definite symmetric matrix
> > +	size = 100;
> > +	MatrixXd A(size, size);	// random matrix
> > +        MatrixXd M(size, size);
> > +
> > +	// to make all the values between [0, 1] (is it really needed?)
> > +	A = MatrixXd::Random(size,size) * 0.5 + MatrixXd::Constant(size,size,0.5);
> > +	M = A * A.transpose();	// positive definite matrix
>
> Consider using noalias() next time
> http://eigen.tuxfamily.org/dox/TopicWritingEfficientProductExpression.html
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/shogun-toolbox/shogun/pull/956/files#r3590345>
> .
>



-- 
Regards,
Rahul
+918879426396