[eigen] Missing operator definition in Sparse? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Missing operator definition in Sparse?
- From: Sameer Agarwal <sameeragarwal@xxxxxxxxxx>
- Date: Thu, 24 Jun 2010 13:07:38 -0700
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1277410060; bh=aTl0e6qboN2o5XMIF9/e3TN9+h8=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type: Content-Transfer-Encoding; b=q6iYP03/0c39eGw8vopvIr4z4SQCWKtERK+KCrdjXhcN3TnCeFh88D4e4ZkwVPGa4 f/yi11upEg5dOE4gvswwA==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:date:message-id:subject:from:to:content-type: content-transfer-encoding:x-system-of-record; b=iGVbOldGozP00oWKByKe1aMrtly3RHI2JMjF/eI/XBIyVJu4hjjrxIB+dVcgDCWR3 3gEdeiimKxKlyzGKLUN1A==
Hi Guys,
I am using the development branch. The following bit of code does not compile.
#include "Eigen/Core"
#include "Eigen/Sparse"
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseCol;
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> Vector;
int main() {
int nrow = 5;
int ncol = 5;
SparseCol m(nrow,ncol);
Vector x(ncol,1);
SparseCol A = m.subcols(1, 4) - m.col(0)* x.transpose();
return 0;
}
Compiled complains about a missing operator definition.
test_sparse.cc: In function ‘int main()’:
test_sparse.cc:12: error: no match for ‘operator-’ in
‘m.Eigen::SparseMatrix<double, 0,
int>::<anonymous>.Eigen::SparseMatrixBase<Derived>::subcols [with
Derived = Eigen::SparseMatrix<double, 0, int>](1, 4) -
Eigen::SparseMatrixBase<Derived>::operator*(const
Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived =
Eigen::Transpose<Eigen::Matrix<double, -0x00000000000000001, 1, 0,
-0x00000000000000001, 1> >, Derived =
Eigen::SparseInnerVectorSet<Eigen::SparseMatrix<double, 0, int>,
1>](((const Eigen::MatrixBase<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> > >&)((const
Eigen::MatrixBase<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >
>*)(&((Eigen::DenseBase<Eigen::Matrix<double, -0x00000000000000001, 1,
0, -0x00000000000000001, 1> >*)(&
x))->Eigen::DenseBase<Derived>::transpose [with Derived =
Eigen::Matrix<double, -0x00000000000000001, 1, 0,
-0x00000000000000001, 1>]()))))’
Eigen/src/Sparse/../plugins/CommonCwiseUnaryOps.h:59: note: candidates
are: const Eigen::CwiseUnaryOp<Eigen::ei_scalar_opposite_op<typename
Eigen::ei_traits<Derived>::Scalar>, Derived>
Eigen::SparseMatrixBase<Derived>::operator-() const [with Derived =
Eigen::SparseInnerVectorSet<Eigen::SparseMatrix<double, 0, int>,
-0x00000000000000001>]
Thanks,
Sameer