vectorCommands.txt - 'Copies the elements of inVec into result in reverse order'NOTE result vector may be the same as the input vector NEWCMD REVERSE

# vectorCommands.txt - 'Copies the elements of inVec into...

• 3

This preview shows page 1 - 2 out of 3 pages.

'Copies the elements of inVec into result in reverse order. 'NOTE: result vector may be the same as the input vector. NEWCMD REVERSE inVec result @"vector operations" ?"Reverses the order of inVec's elements" SIZE invec vecSize COPY vecSize,1 tags TAKE invec tags result END 'DELTAS Returns the differences between adjacent elements of the input vector. 'The differences (deltas) are computed like this: nth delta = (n+1st)element - (nth)element /*** Example usage: DELTAS 1,10 del1 DELTAS (1 1 2 3 5 8 13 21 34 55 89) del2 'This happens to be a Fibonacci series DELTAS del2 del3 PRINT del1 del2 del3 ***/ NEWCMD DELTAS vec vecDeltas @"vector operations" ?"Returns the differences between adjacent elements" COPY 0 vec shiftedVec SUBTRACT vec shiftedVec diff SIZE vec vecSize TAKE diff 2,vecSize vecDeltas END NAME (0 1) equal notEqual GLOBAL equal notEqual 'Compares two vectors element by element for equality. 'Returns equal (0) if they are equal. 'Returns notEqual (1) if they are not equal.

Subscribe to view the full document.

• Fall '19
• fefef

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes