- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm looking for functions in MKL or other libraries that does vector-scalar and vector-vector subtraction efficiently. Elements are doubles.
vector-scalar:
[a1, a2, a3,...an] - b = [(a1 - b), (a2 - b), (a3 - b),...(an - b)]
scalar-vector:
b - [a1, a2, a3,...an] = [(b - a1), (b - a2), (b - a3),...(b - an)]
vector-vector 1:
[a1, a2, a3,...an] - [b1, b2, b3,...bm] = [(a1 - b1), (a1 - b2), (a1 - b3),...(a1 - bm),
(a2 - b1), (a2 - b2), (a2 - b3),...(a2 - bm),
...,
(an - b1), (an - b2), (an - b3),...(an - bm)]
vector-vector 2:
[a1, a2, a3,...an] - [b1, b2, b3,...bm] = [(a1 - b1), (a2 - b1), (a3 - b1),...(an - b1),
(a1 - b2), (a2 - b2), (a3 - b2),...(an - b2),
...,
(a1 - bm), (a2 - bm), (a3 - bm),...(an - bm)]
I am new to MKL and a bit lost in the documentation, can someone help?
I have also need for addition, multiplication and division, but I think if subtraction is figured out, I should know how to do the rest.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
For vector-scalar and vector-vector subtraction in MKL, use the vdSub function. This function handles element-wise subtraction for double precision vectors. For vector-scalar subtraction, subtract the scalar from each element of the vector. For vector-vector subtraction, subtract corresponding elements of the two vectors. Similar functions like vdAdd, vdMul, and vdDiv are available for addition, multiplication, and division. If you need more details, feel free to ask.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
BR,
Miles

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page