lib/sbm.js
function(sbm, n) {
    if (n == 0) {
      return this.identity(n)
    } else if (n == 1) {
      return sbm
    } else if (n % 2 == 0) {
      return this.pow(this.multiply(sbm, sbm), n/2)
    } else {
      return this.multiply(sbm, this.pow(this.multiply(sbm, sbm), (n-1)/2))
    }
  }
function(sbm, n) {
    if (n == 0) {
      return this.identity(n)
    } else if (n == 1) {
      return sbm
    } else if (n % 2 == 0) {
      return this.pow(this.multiply(sbm, sbm), n/2)
    } else {
      return this.multiply(sbm, this.pow(this.multiply(sbm, sbm), (n-1)/2))
    }
  }
function ( sbm , n ) { if ( n == 0 ) { return this . identity ( n ) } else if ( n == 1 ) { return sbm } else if ( n % 2 == 0 ) { return this . pow ( this . multiply ( sbm , sbm ) , n / 2 ) } else { return this . multiply ( sbm , this . pow ( this . multiply ( sbm , sbm ) , ( n - 1 ) / 2 ) ) } }
power of the matrix
power of the matrix