[eigen] Vector's -= operator does not seem to work |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Vector's -= operator does not seem to work
- From: Hung Dang <hungptit@xxxxxxxxx>
- Date: Tue, 17 Mar 2020 20:51:40 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=X//smCe8w/kSnvcRIaKfHvDwWa945bfjdfvQdpoSa+s=; b=uLI9Bmi8y/etx6eekSA1hrKkE82wFuc4a3qCr/hbEvFEVBYoIoYwj1o7TyfrxySYNF UT/1ilLjo0OfaiVBX6Kmb+xkv2wKk0TrnKG6UU2lldo7LilaWsO+iOUdh9nHYDulG9IC aWsoj77oTPGop4gE6W2JkFwF7rRvSTlbdDkjGm1ZpGySqr5VpIuv/p1AavmjTJnrKO4C b2yIupS35A6YnvM5VMmSKPVzJrNDk869K6wXwkwqq/7MVnfXYyco9GyX5I4YQxY/85xH nZotvbSpLbKu+DR6NAAv3NydNYNxyqBIGXe11Sx0fqc8afbic8dCjZY/SdHvQkzOG22A DpQQ==
Hi,
I try some Eigen examples (see below) and the -= operator is not
supported. Is there any way to make it work without creating a constant
vector?
Thank a lot,
Hung
Matrix2d a;
a << 1, 2, 3, 4;
Vector3d v(1, 2, 3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << "Now v =\n" << v << std::endl;
// Does not work
// v -= 2;
// std::cout << "Now v =\n" << v << std::endl;