Error using Operator/ in Vector and FullMatrix

15 views
Skip to first unread message

Raghunandan Pratoori

unread,
Apr 8, 2022, 9:20:35 PM4/8/22
to deal.II User Group
Hello team,

I am trying to use the following equations -
        r = r/theta;
OM = OM_1*cos(theta);

where r is a dealii::Vector<double>, theta is double, OM and OM_1 are dealii::FullMatrix<double>.

According to the documentation, operator/ and operator* are implemented for both Vector and FullMatrix, but both throw an error "no match for 'operator'".

I am using v9.3.0 and have included /lac/vector.h and /lac/fullmatrix.h. I believe I am missing something trivial. Can anyone identify what mistake I might be making?

Thanks in advance,
Raghunandan.

Jean-Paul Pelteret

unread,
Apr 9, 2022, 4:15:55 AM4/9/22
to dea...@googlegroups.com
Hi Raghunandan,

I think that you misinterpreted the documentation: operator/= is implemented for the Vector class and operator*= is implemented for the FullMatrix class. So your code probably needs to be

r /= theta;
OM *= cos(theta);

I hope that this helps you resolve your issue.

Best,
Jean-Paul

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/1abee09e-2230-4087-882b-3b9871c9dfd8n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages