This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Error calling prune function

Tags: None
(comma "," separated)
pamparana
Registered Member
Posts
18
Karma
0

Error calling prune function

Fri Feb 28, 2014 11:52 am
Hello,

I have the following code:

Code: Select all
typedef Eigen::SparseMatrix<double,Eigen::RowMajor> MatSparseDouble;
MatSparseDouble * precision;
// Initialised somewhere...
precision->prune(); // remove explicit zeros


However, I get the compilation error.

candidate template ignored: couldn't infer template argument 'KeepFunc'
void prune(const KeepFunc& keep = KeepFunc())
^
note: candidate function not viable: requires at least argument 'reference', but no arguments were provided
void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits<RealScalar>::dummy_precision())

I thought I should be able to use prune() with no arguments. I am using OSX 10.9.2 with the clang compiler (Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn))

Any help would be appreciated.
Thanks,
Luca
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Error calling prune function  Topic is solved

Fri Feb 28, 2014 12:25 pm
Please, have a look at the documentation: http://eigen.tuxfamily.org/dox/classEig ... b07a5036b6

You either have to specify a functor or a reference value. If you want to suppress exact 0, then calling prune(0) will work.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]