alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (Course-2002-04-msil.check)

This example Scala source code file (Course-2002-04-msil.check) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

list, list

The Scala Course-2002-04-msil.check source code

list0 = List(6, 3, 1, 8, 7, 1, 2, 5, 8, 4, 3, 4, 8)
list1 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8)
list2 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8)
list3 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8)
list4 = List(1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 8)
list5 = List(8, 8, 8, 7, 6, 5, 4, 4, 3, 3, 2, 1, 1)
list6 = List(8, 8, 8, 7, 6, 5, 4, 4, 3, 3, 2, 1, 1)

list0: List() -> List()
list1: List(0) -> List(0)
list2: List(0, 1) -> List(0, 1)
list3: List(1, 0) -> List(0, 1)
list4: List(0, 1, 2) -> List(0, 1, 2)
list5: List(1, 0, 2) -> List(0, 1, 2)
list6: List(0, 1, 2) -> List(0, 1, 2)
list7: List(1, 0, 2) -> List(0, 1, 2)
list8: List(2, 0, 1) -> List(0, 1, 2)
list9: List(2, 1, 0) -> List(0, 1, 2)
listA: List(6, 3, 1, 8, 7, 1, 2, 5, 8, 4) -> List(1, 1, 2, 3, 4, 5, 6, 7, 8, 8)

f(x) = 5x^3+7x^2+5x+9
f(0) = 9
f(1) = 26
f(2) = 87
f(3) = 222

v1        = List(2, 3, 4)
v2        = List(6, 7, 8)

id        = List(List(1, 0, 0), List(0, 1, 0), List(0, 0, 1))
m1        = List(List(2, 0, 0), List(0, 2, 0), List(0, 0, 2))
m2        = List(List(1, 2, 3), List(4, 5, 6), List(7, 8, 9))

v1 * v1   = 29
v1 * v2   = 65
v2 * v1   = 65
v1 * v2   = 65

id * v1   = List(2, 3, 4)
m1 * v1   = List(4, 6, 8)
m2 * v1   = List(20, 47, 74)

trn(id)   = List(List(1, 0, 0), List(0, 1, 0), List(0, 0, 1))
trn(m1)   = List(List(2, 0, 0), List(0, 2, 0), List(0, 0, 2))
trn(m2)   = List(List(1, 4, 7), List(2, 5, 8), List(3, 6, 9))

List(v1) * id = List(List(2, 3, 4))
List(v1) * m1 = List(List(4, 6, 8))
List(v1) * m2 = List(List(42, 51, 60))

id * List(v1) = List(List(2, 3, 4), List(0, 0, 0), List(0, 0, 0))
m1 * List(v1) = List(List(4, 6, 8), List(0, 0, 0), List(0, 0, 0))
m2 * List(v1) = List(List(2, 3, 4), List(8, 12, 16), List(14, 21, 28))

id * id   = List(List(1, 0, 0), List(0, 1, 0), List(0, 0, 1))
id * m1   = List(List(2, 0, 0), List(0, 2, 0), List(0, 0, 2))
m1 * id   = List(List(2, 0, 0), List(0, 2, 0), List(0, 0, 2))
m1 * m1   = List(List(4, 0, 0), List(0, 4, 0), List(0, 0, 4))
id * m2   = List(List(1, 2, 3), List(4, 5, 6), List(7, 8, 9))
m2 * id   = List(List(1, 2, 3), List(4, 5, 6), List(7, 8, 9))
m1 * m2   = List(List(2, 4, 6), List(8, 10, 12), List(14, 16, 18))
m2 * m1   = List(List(2, 4, 6), List(8, 10, 12), List(14, 16, 18))
m2 * m2   = List(List(30, 36, 42), List(66, 81, 96), List(102, 126, 150))

Other Scala examples (source code examples)

Here is a short list of links related to this Scala Course-2002-04-msil.check source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.