In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "R language RcppEigen calculation point multiplication and matrix multiplication algorithm error solution is", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "R language RcppEigen to calculate point multiplication and matrix multiplication algorithm error solution is what" bar!
Error in calculating point multiplication and matrix multiplication
When we want to modify the continuous multiplication in R (as shown in the following formula) to Rcpp code
T (X) ^ 2% *% X
In theory, we only need to enter the following statement in the .cpp code (the RcppEigen library is used by default):
X.adjoint () .array () .square () * X.array () .square ()
But in fact, there will be problems because X.adjoint (). Array (). Square () and X.array (). Square () are not successfully converted to Eigen::MatrixXd form. Although it is okay to display the two parts separately (you can output and see them directly), you will make an error when multiplying. At this point, we do a default transformation separately, and then do matrix multiplication, as follows:
Eigen::MatrixXd A, B * A = X.adjoint (). Array (). Square (); B = X.array (). Square (); A * B
In this way, the problem of previous calculation errors can be solved.
At this point, I believe you have a deeper understanding of "R language RcppEigen calculation of point multiplication and matrix multiplication algorithm error solution", might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.