Find the adjoint of the passed matrix
var tms=a.length; if(tms<=1){ console.warn("Can't find the adjoint of a matrix with a dimension less than 2"); return [[0]]; } if(a.length!=a[0].length){ console.warn("Can't find the adjoint of a non-square matrix"); return [[0]]; } var m=this.create(tms, tms), ap=this.create(tms-1, tms-1); var ii=0, jj=0, ia=0, ja=0, det=0; for(var i=0; i<tms; i++){ for (var j=0; j<tms; j++){ ia=0; for(ii=0; ii<tms; ii++){ if(ii==i){ continue; } ja = 0; for(jj=0; jj<tms; jj++){ if(jj==j){ continue; } ap[ia][ja] = a[ii][jj]; ja++; } ia++; } det=this.determinant(ap); m[i][j]=Math.pow(-1, (i+j))*det; } } return this.transpose(m); // Array