Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
how to find the norm of a function of type |XY|

C++
function(int n, double **X, double *Y, double *norm)
{
    //write the code to find the norm 
}

where
n = number of iteration
Y = pointer to d
X = double pointer to B
norm = output
Posted
Updated 29-Nov-14 21:44pm
v3
Comments
Zoltán Zörgő 30-Nov-14 3:38am    
Do it! I suppose it is your homework, not ours...
George Jonsson 30-Nov-14 3:40am    
It would be nice if there were a coding service out there that would write your code for you.

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
Comments
Hapisha 1-Dec-14 3:30am    
thanks. i solved it by myself. and again sorry for asking a silly question.
OriginalGriff 1-Dec-14 4:37am    
Good! Well done!
Feel free to ask, but you learn a lot better if you at least try and do it yourself.
:thumbsup:
1. look up the formula(s) required to calculate the expected return value from these inputs
2. translate these formulas into a series of C/C++ operations; use local variables to hold temporary values if needed
3. understand and fix any compiler errors and warnings that you may encounter
4. run the program using a debugger and verify at each step of your algorithm if your (temporary) variable(s) hold the expected value(s); if not, find out what is wrong, and why, then fix the program and go back to step 3.

If you have any questions regarding steps 3 and 4, go ahead and ask here. If you have issues with step 2, ask specifically which operation you don't know how to express as a C/C++ command. if you have issues with step 1, we can't help with that, because that is information your tutor should have provided you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900