build/modelscript.umd.js
function luJs() {
                var A = this.dup();
                var L = Matrix$b.I(A.rows());
                var P = Matrix$b.I(A.rows());
                var U = Matrix$b.Zeros(A.rows(), A.cols());
                var p = 1;

                for(var k = 1; k <= Math.min(A.cols(), A.rows()); k++) {
            	P = A.partialPivot(k, p, P, A, L);
            	
            	for(var i = k + 1; i <= A.rows(); i++) {
            	    var l = A.e(i, p) / A.e(k, p);
            	    L.elements[i - 1][k - 1] = l;
            	    
            	    for(var j = k + 1 ; j <= A.cols(); j++) {
            		A.elements[i - 1][j - 1] -= A.e(k, j) * l;
            	    }
            	}
            	
            	for(var j = k; j <= A.cols(); j++) {
            	    U.elements[k - 1][j - 1] = A.e(k, j);
            	}

            	if(p < A.cols())
            	    p++;
                }    
                
                return {L: L, U: U, P: P};
            }
function luJs() {
                var A = this.dup();
                var L = Matrix$b.I(A.rows());
                var P = Matrix$b.I(A.rows());
                var U = Matrix$b.Zeros(A.rows(), A.cols());
                var p = 1;

                for(var k = 1; k <= Math.min(A.cols(), A.rows()); k++) {
            	P = A.partialPivot(k, p, P, A, L);
            	
            	for(var i = k + 1; i <= A.rows(); i++) {
            	    var l = A.e(i, p) / A.e(k, p);
            	    L.elements[i - 1][k - 1] = l;
            	    
            	    for(var j = k + 1 ; j <= A.cols(); j++) {
            		A.elements[i - 1][j - 1] -= A.e(k, j) * l;
            	    }
            	}
            	
            	for(var j = k; j <= A.cols(); j++) {
            	    U.elements[k - 1][j - 1] = A.e(k, j);
            	}

            	if(p < A.cols())
            	    p++;
                }    
                
                return {L: L, U: U, P: P};
            }
function luJs ( ) { var A = this . dup ( ) ; var L = Matrix$b . I ( A . rows ( ) ) ; var P = Matrix$b . I ( A . rows ( ) ) ; var U = Matrix$b . Zeros ( A . rows ( ) , A . cols ( ) ) ; var p = 1 ; for ( var k = 1 ; k <= Math . min ( A . cols ( ) , A . rows ( ) ) ; k ++ ) { P = A . partialPivot ( k , p , P , A , L ) ; for ( var i = k + 1 ; i <= A . rows ( ) ; i ++ ) { var l = A . e ( i , p ) / A . e ( k , p ) ; L . elements [ i - 1 ] [ k - 1 ] = l ; for ( var j = k + 1 ; j <= A . cols ( ) ; j ++ ) { A . elements [ i - 1 ] [ j - 1 ] -= A . e ( k , j ) * l ; } } for ( var j = k ; j <= A . cols ( ) ; j ++ ) { U . elements [ k - 1 ] [ j - 1 ] = A . e ( k , j ) ; } if ( p < A . cols ( ) ) p ++ ; } return { L : L , U : U , P : P } ; }
pure Javascript LU factorization
pure Javascript LU factorization