This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: OrderedCollection a2" s1 addAll: a1. "part v: Take all elements and put them in ascending order into s1" s2 := s1 reversed. "part vi: Take all elements in a1 and put them in descending order in s2" 1 to: s1 size do:[:i| s3 add: (s2 at: i) *(s1 at: i)]. "part vii: Sort in ascending order the ith component of s1 with the ith component of s2 and put in s3" "------Part B------" |A B C sum| A := Matrix new: n. "Declare Matrices A and B to be of size n X n" B := Matrix new: n. sum := 0. "Initialize sum to 0" "part i: Computer the matrix A X B" C := B preMultiplyByMatrix: A. "part ii: sum the elements of C, column order, and put them into sum" 1 to: C columnCount do:[:i| 1 to: C rowCount do:[:j| sum := sum + (C at:i at:j)]]....
View Full Document
This note was uploaded on 08/23/2011 for the course CSE 324 taught by Professor Soliman during the Spring '11 term at NMT.
- Spring '11