Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6130593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:52:35+00:00 2026-05-23T16:52:35+00:00

I am trying to have two arbitrary length vectors (typical length will be 2048)

  • 0

I am trying to have two arbitrary length vectors (typical length will be 2048) and multiply element by element. So Z[n] = X[n] * Y[n] for all n.

The code I have setup to test is fairly basic:

float inputX[4] = { 2, 4, 8, 16 };
float inputY[4] = { 2, 4, 8, 16 };

catlas_saxpby(4, 1, inputX, 1, 1, inputY, 1);

The result goes into inputY, and the result is

4.000000, 8.000000, 16.000000, 32.000000

Which if they were multiplying it should be 4, 16, 64, 256. But it looks like it is adding.

So this is not doing what I expect, and the documentation doesn’t give me enough information to figure what it is doing.

Any ideas?

Apple's documentation for BLAS says this: 

Computes the product of two vectors, scaling each one separately (single-precision).

void catlas_saxpby (
   const int N,
   const float alpha,
   const float *X,
   const int incX,
   const float beta,
   float *Y,
   const int incY
);
Parameters
N
Number of elements in the vector.
alpha
Scaling factor for X.
X
Input vector X.
incX
Stride within X. For example, if incX is 7, every 7th element is used.
beta
Scaling factor for Y.
Y
Input vector Y.
incY
Stride within Y. For example, if incY is 7, every 7th element is used.
Discussion
On return, the contents of vector Y are replaced with the result.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:52:35+00:00Added an answer on May 23, 2026 at 4:52 pm

    The Apple documentation is mistaken. The saxpby function computes the expression alpha*X + beta*Y for scalars alpha and beta and vectors X and Y.

    I don’t think there’s a function available to compute the element-wise product of two vectors, since that’s not a common operation in linear algebra. You could take the diagonal of the outer product, but that’s a severe waste of effort since it computes the entire outer product (N2 multiplications instead of N).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two PNGs that I am trying to combine into a PDF using
I have two named instances of SQL Server 2008 and am trying to set
I have two arrays of data that I'm trying to amalgamate. One contains actual
I have two models indexed for searching (User and Item). I'm trying to do
I have two classes.... Parcel and FundParcel...and I'm trying to convert an IEnumerable of
I have two classes one of which inherits from the other. Im trying to
I have two tables: subject and student. I'm trying to count the number of
I am trying to compare two decimal values in Java script. I have two
I am trying to introduce RoR to my company and I have two ways
Trying to solve a problem with templatetags. I have two templatetags: @register.inclusion_tag('directory/_alphabet.html') def alphabet_list(names):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.