473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A line from UBLAS explanation

Dear all, I have a question regarding an assignment operation

This is the statement:

"If you know for sure that the left hand expression and the right hand
expression have no common storage, then assignment has no aliasing."

This is from

http://www.boost.org/libs/numeric/ublas/doc/
operations_overview.htm#noalias

under Matrix/Vector operation header.

I could not understand this, can someone clarify that for me?

Best regards

Jan 30 '07 #1
1 1519
Hi

utab wrote:
Dear all, I have a question regarding an assignment operation

This is the statement:

"If you know for sure that the left hand expression and the right hand
expression have no common storage, then assignment has no aliasing."
[...]
I could not understand this, can someone clarify that for me?
Consider the following assignment with matrices A and B
A = A * B
Clearly, the expression on the left hand side and the expression on the
right hand side refer to common storage, the storage of A. It is obvious
that you cannot assign the result of A*B directly into A, as you would
destroy your first operand. Therefore, in that case (and generally
whenever _some_ storage is shared among left and right hand side) you
need to store the result in some temporary storage before you can assign
them. If, on the other hand, there is no common storage, e.g. because
you have two _distinct_ matrices A and B, you know that you could store
directly into A in the expression
A = B * B
The documentation says that in those cases you can use noalias(A) to
speed things up.

hth
Markus
Jan 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dmiller23462 | last post by:
Hi again guys.... This is my first source of help, by far the best ASP intellectual collective....Thanks in advance for any assistance...Anyway.... The forms I'm still working on (finishing...
19
by: Atif | last post by:
Hello all, In my html page I want to add an image say of 800x600. Now I want that when ever I am given two coordinates on this image say (x1, y1)=(50, 100) and (x2, y2)=(200, 300), the java script...
3
by: Manzanita | last post by:
Hi. I'm using boost::numerics::ublas to solve linear symmetric and hermitian systems (cholesky, qr, etc.). I'm aware that ublas only provide basic algebra operations (blas1, blas2 and blas3) so...
15
by: christopher diggins | last post by:
Here is some code I wrote for Matrix multiplication for arbitrary dimensionality known at compile-time. I am curious how practical it is. For instance, is it common to know the dimensionality of...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
22
by: ashkaan57 | last post by:
Hi, I am trying to put text on left and right side of the page and used: <div> <span>blah blah</span> <span style="float:right">blah blah</span> </div> The 2nd text does go to the right but the...
3
Axon
by: Axon | last post by:
Hi, I'm using Boost::uBLAS::mapped_matrix for working with sparse matrices. At the moment, the maximum dimension of mapped_matrix is 65535x65535 since std::size_t compiles as unsigned int. I'm...
1
by: sanjeev.p3 | last post by:
I need to pass ublas::matrix data to a legacy C API which expects input in the form: void doSomething(double* data,...); If I have a std::vector<doublemyA this is easy. I do: ...
0
by: brekehan | last post by:
Anyone know an easy way to compare to boost matrices using the same template argument for equality? boost::numeric::ublas::matrix<doublea(2, 2); boost::numeric::ublas::matrix<doubleb(4, 4); ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.