## 2014年12月19日 星期五

### [ RubyAlg ] MIT Linear Algebra, Spring 2005 - Lec7

source from here
Solving Null Space A(x)=0
Consider we have a matrix A
>> A = LA.newMtx3(3,4, [1,2,2,2,2,4,6,8,3,6,8,10])
=> #
>> puts A
1 2 2 2
2 4 6 8
3 6 8 10
=> nil

Then we do row elimination:
>> B = A.rowElim(0,-2,1) # 將 row0 乘與 -2 並加到 row1
>> print("Elim Row1:\n#{B}\n")
Elim Row1:
1 2 2 2
0 0 2 4
3 6 8 10

>> B = B.rowElim(0,-3,2) # 將 row0 乘與 -3 並加到 row2
>> print("Elim Row2:\n#{B}\n")
Elim Row2:
1 2 2 2
0 0 2 4
0 0 2 4

>> B = B.rowElim(1,-1,2) # Row echelon form
>> print("Echelon From:\n#{B}\n")
Echelon From:
1 2 2 2
0 0 2 4
0 0 0 0

>> puts A.rref()
1 2 0 -2.0
0 0.0 1 2.0
0 0.0 0 0.0
=> nil

Pivot Variables vs Free Variables

Special Solution rref(A)=R

>> newREFF = A.rref.swapCol!(1,2) # swap col1 with col2 from reff
>> puts newREFF
1 0 2 -2.0
0 1 0.0 2.0
0 0 0.0 0.0
=> nil

### [NodeJS 文章收集] NodeJS accessing file with relative path

Source From  Here Question It seemed like a straight forward problem. But I am not able to crack this. Within  helper1.js  I would like to a...