lib/ops.js
/**
 * Computes direction vector of A, where A is a 1D vector
 */
Computes direction vector of A, where A is a 1D vector
Computes direction vector of A where A is a 1D vector
function dir(A) {
    if (A.shape.length !== 1) {
        throw new Error('A is not a 1D array');
    }
    return div(A, length(A));
}
function dir ( A ) { if ( A . shape . length !== 1 ) { throw new Error ( 'A is not a 1D array' ) ; } return div ( A , length ( A ) ) ; }
Computes direction vector of A, where A is a 1D vector
Computes direction vector of A where A is a 1D vector