473,400 Members | 2,145 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,400 software developers and data experts.

Multiply vectors

3
First I want to create two vectors each of size 1x3072 of the format [each entry in 'a' be repeated 64 time]
a=[111.....222.....333.......444..... 484848.....]
b=[1 2 3.....64 1 2 3.....64 1 2 3 .....64.....]
Then I want to multiply a matrix T=[-1 0 30;0 -1 20] with above vectors stacked as column
i.e C=[a;b;1] where each 1 means 1x3072 1's. R=T*C, the result will be 2X3072 matrix.
I then want to take vector 'x' as R(1) and 'y' as R(2) each of size 1x3072.
then I want to do z=sqrt(x)+square(y)
and have z as my final vector.

Any help,
Thanks.
Nov 9 '07 #1
3 2547
r035198x
13,262 8TB
First I want to create two vectors each of size 1x3072 of the format [each entry in 'a' be repeated 64 time]
a=[111.....222.....333.......444..... 484848.....]
b=[1 2 3.....64 1 2 3.....64 1 2 3 .....64.....]
Then I want to multiply a matrix T=[-1 0 30;0 -1 20] with above vectors stacked as column
i.e C=[a;b;1] where each 1 means 1x3072 1's. R=T*C, the result will be 2X3072 matrix.
I then want to take vector 'x' as R(1) and 'y' as R(2) each of size 1x3072.
then I want to do z=sqrt(x)+square(y)
and have z as my final vector.

Any help,
Thanks.
We don't know how to help because you don't seem to have done anything yet.
Where specifically are you stuck?
Nov 9 '07 #2
fmufti
3
I have done this in MATLA but I want to code it in C++. I am not current in C++, so I need help.
Nov 9 '07 #3
sicarie
4,677 Expert Mod 4TB
And, as r035198x asked, where do you need help? Do you need a recommendation of a good C++ tutorial so you can learn the basics, or are you having trouble with a certain part? Which part?

You might have a look at our Posting Guidelines, which contains the part where we recommend what to post in your question so that you get the best and quickest responses.
Nov 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Pratyush | last post by:
Hi, Suppose there is a vector of objects of class A, i.e., std::vector<A> vec_A(N); The class A satisifies all the STL vector requirements. Now I wish to add some attributes for each of the...
2
by: Martin Pettersson | last post by:
Hi all, I'm trying to multiply parent values in xsl. The thing is that I start with a value down in the xml-structure. From that value (in my case 'qty' value) I check the parent value and later...
5
by: Computer Whizz | last post by:
I was reading through Accelerated C++ at work when I read through the first mention of Vectors, giving us certain functions etc. Is there any benefit of Arrays over Vectors? Since all Vectors...
3
by: Amit | last post by:
Hello. I am having some problem organizing a set of vectors. The vectors itself, could contain a pointer( say integer pointer) or could contain another object MyClass. 1>So, first of all, is...
4
by: Dr. J.K. Becker | last post by:
Hi all, I have vectors that holds pointers to other vectors, like so: vector<whatever> x; vector<whatever*> z; z=&x; Now I add something to x
5
by: madhu | last post by:
http://msdn2.microsoft.com/en-us/library/fs5a18ce(VS.80).aspx vector <intv1; v1.push_back( 10 ); //adds 10 to the tail v1.push_back( 20 ); //adds 20 to the tail cout << "The size of v1 is " <<...
2
by: wuzertheloser | last post by:
Use the program skeleton below (starting with #include <stdio.h>) as the starting point for quiz4. Add the necessary code to the functions prob1() and prob2(), and add the other 2 functions, as...
1
by: Rob | last post by:
How would I do this? I want to be able to handle vectors of many different types of data and vectors that can contain any number of other vectors of data. Currently, I have a templated...
1
by: Gavin Chen | last post by:
Hello: I tried to install Tk800.015 on SunOS 4.1.4 with perl 5.6.2. At "make test" time, I got the error message as below: collect2: ld returned 2 exit status ld:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.