Directory Listing | |
---|---|
map.cpp
|
|
map.txt
|
|
matrix1.txt
|
|
matrix_example.txt
|
|
result.txt
|
|
vector1.txt
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
VECTOR: 1 2 3 4
MATRIX: 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
//MULTIPLY EACH ROW BY VECTOR ELEMENTS
( 1 * 1 ) + ( 2 * 2 ) + ( 3 * 3 ) + ( 4 * 4 ) = 30
( 5 * 1 ) + ( 6 * 2 ) + ( 7 * 3 ) + ( 8 * 4 ) = 70
( 9 * 1 ) + ( 10 * 2 ) + ( 11 * 3 ) + ( 12 * 4 ) = 110
( 13 * 1 ) + ( 14 * 2 ) + ( 15 * 3 ) + ( 16 * 4 ) = 150
//WRITE TO FILE
30.0 70.0 110.0 150.0