Sergey, thanks. That's what I am trying. I think it would be nice if we
have a toEigenSparseMatrix method in the SGSparseMatrix class itself :D


On Sat, Mar 30, 2013 at 9:34 PM, 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
>
> The most efficient is to collect a vector of triplets (i,j,value) and use
> the setFromTriplets method. It would not work with eigen older than 3.1.0
> though.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/shogun-toolbox/shogun/pull/956/files#r3594835>
> .
>



-- 
Regards,
Rahul
+918879426396