Hi Sumit, > I have the following reduction that I can do in Eigen. Is there > something similar that I can do in ViennaCL? > RMMatrix_Float v = (prod.block(0,0,rows,cols).rowwise() - > aVector.transpose());
you can use outer_prod() for this. First argument is a vector of all ones, the second argument is your row vector. > RMSparseMatrix_Float v1 = > v.unaryExpr(std::ptr_fun(clip_lower)).sparseView(); We don't provide anything like this natively at the moment, so you would need to write a custom kernel for it (most likely you would need one custom kernel to count the number of nonzeros per row, then an exclusive scan, and finally another loop over the elements to fill the sparse matrix). Best regards, Karli > > Essentially, I am subtracting a row vector from every rows of a matrix. > Then, I am applying a unary operation (soft threshold for example) on > every pixel and making the matrix sparse. > > RMMatrix_Float is a typedef for a row-major Eigen Dense matrix; > SparseMatrix being its sparse equivalenth > > Thanks and Regards > Sumit > > ------------------------------------------------------------------------ > *From:* Karl Rupp <r...@iue.tuwien.ac.at> > *To:* Charles Determan <cdeterma...@gmail.com> > *Cc:* viennacl-devel@lists.sourceforge.net > *Sent:* Wednesday, July 15, 2015 1:53 AM > *Subject:* Re: [ViennaCL-devel] ViennaCL eigenvectors? > > Hi Charles, > > > Everything appears to be working correctly with the power method. A > > followup though, is it possible to return 'all' eigenvalues and > > eigenvectors with the power algorithm? > > No, it only provides the largest eigenvalue in modulus. > > > The Lanczos example (in the > > feature-improve-lanczos branch) code looks like it would iterate through > > all eigenvalues and eigenvectors. For example, with a trivial matrix of > > size 4x4 I would expect to get 4 eigenvalues and 4 eigenvectors (of > > length 4, i.e. a matrix of 16 elements). > > Lanczos is typically used for obtaining estimates on the largest > eigenvalues of a huge matrix (say, the largest 10). There is actually an > implementation of the QR method for finding all eigenvalues of a > symmetric matrix available, too, cf. > https://github.com/viennacl/viennacl-dev/blob/master/examples/tutorial/qr_method.cpp > (I need to check why it does not show up in the manual) > > > > This leads me to another question, I didn't see a merge between the > > Lanczos algorithm. Is that still under development or is it now > > implemented in the master branch? > > Some parts currently experience a final polishing (for example, > yesterday I eliminated the Boost dependency), so it will migrate to > master soon. :-) > > Best regards, > Karli > > > > > On Fri, Jul 10, 2015 at 4:20 AM, Karl Rupp <r...@iue.tuwien.ac.at > <mailto:r...@iue.tuwien.ac.at> > > <mailto:r...@iue.tuwien.ac.at <mailto:r...@iue.tuwien.ac.at>>> wrote: > > > > Hi Charles, > > > > the interface for the power iteration has been updated to also > > return eigenvectors: > > > https://github.com/viennacl/viennacl-dev/commit/e80cc2141f266eb9b279dd45b7c4075b557bf558 > > > > Please let me know if you run into issues. > > > > Best regards, > > Karli > > > > > > > > On 07/08/2015 06:58 PM, Charles Determan wrote: > > > > Greetings, > > > > I have seen that I can get all the eigenvalues with the lanczos > > algorithm in the lanczos.cpp example file but I don't see any > > documentation on eigenvectors. The only thing I have found is > > on the > > feature-improve-lanczos branch > > > https://github.com/viennacl/viennacl-dev/blob/karlrupp/feature-improve-lanczos/examples/tutorial/lanczos.cpp. > > Is this intended to be implemented or is there existing > support for > > determining eigen vectors? > > > > A secondary question, is the same possible with the power method? > > > > Thanks, > > Charles > > > > > > > ------------------------------------------------------------------------------ > > Don't Limit Your Business. Reach for the Cloud. > > GigeNET's Cloud Solutions provide you with the tools and support > > that > > you need to offload your IT needs and focus on growing your > > business. > > Configured For All Businesses. Start Your Cloud Today. > > https://www.gigenetcloud.com/ > > > > > > > > _______________________________________________ > > ViennaCL-devel mailing list > > ViennaCL-devel@lists.sourceforge.net > <mailto:ViennaCL-devel@lists.sourceforge.net> > > <mailto:ViennaCL-devel@lists.sourceforge.net > <mailto:ViennaCL-devel@lists.sourceforge.net>> > > > > > https://lists.sourceforge.net/lists/listinfo/viennacl-devel > > > > > > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > ViennaCL-devel mailing list > ViennaCL-devel@lists.sourceforge.net > <mailto:ViennaCL-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/viennacl-devel > > ------------------------------------------------------------------------------ _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel