Returns column k of the matrix as a vector
480287
function(j) {
    if (j > this.elements[0].length) { return null; }
    var col = [], n = this.elements.length, k = n, i;
    do { i = k - n;
      col.push(this.elements[i][j-1]);
    } while (--n);
    return Vector.create(col);
  }
118480
function subMatrix (data, numRows, numCols, row, col) {
  var sub = []

  for (var i = 0; i < numRows; i++) {
    for (var j = 0; j < numCols; j++) {
      if ((i !== row) && (j !== col)) {
        sub.push(data[matrixToArrayIndex(i, j, numCols)])
      }
    }
  }

  return sub
}
1037486
function(startRow, endRow, startCol, endCol) {
            	var x = [];
            	
            	if(endRow == 0)
            	    endRow = this.rows();
            	
            	if(endCol == 0)
            	    endCol = this.cols();

            	for(i = startRow; i <= endRow; i++) {
            	    var row = [];

            	    for(j = startCol; j <= endCol; j++) {
            		row.push(this.e(i, j));
            	    }

            	    x.push(row);
            	}

            	return $M(x);
                }
924747
public Vector4f getColumn(int column, Vector4f dest) throws IndexOutOfBoundsException {
        switch (column) {
        case 0:
            MemUtil.INSTANCE.putColumn0(this, dest);
            break;
        case 1:
            MemUtil.INSTANCE.putColumn1(this, dest);
            break;
        case 2:
            MemUtil.INSTANCE.putColumn2(this, dest);
            break;
        case 3:
            MemUtil.INSTANCE.putColumn3(this, dest);
            break;
        default:
            throw new IndexOutOfBoundsException();
        }
        return dest;
    }
395984
public double[] getColumn(int col) {
    double[] column = new double[numRows];
    int offset = translate(0, col, numRows);
    for (int i = 0; i < column.length; i++) {
      column[i] = matrix[offset + i];
    }
    return column;
  }
156576
public IVector getVectorFromRow(int index) {
        IVector result = new IVector(columns);
        for (int i = 0; i < columns; i++) {
            result.realvector[i] = realmatrix[index][i];
            result.imagvector[i] = imagmatrix[index][i];
        }
        return result;
    }
231979
def flatten(self):
        
        blocksize = self.get_array()[0][0].get_width()
        width = self.get_width() * blocksize

        columnsNew = [[] for dummy in xrange(width)]

        for row in self.get_array():
            index = 0
            for submatrix in row:
                for column in submatrix.get_array(False):
                    columnsNew[index] += column
                    index += 1

        columnsFlat = sum(columnsNew, [])
        return Matrix(width, len(columnsNew[0]), columnsFlat, rowBased=False)
554099
public static DMatrixRMaj extractRow(DMatrixRMaj a , int row , DMatrixRMaj out ) {
        if( out == null)
            out = new DMatrixRMaj(1,a.numCols);
        else if( !MatrixFeatures_DDRM.isVector(out) || out.getNumElements() != a.numCols )
            throw new MatrixDimensionException("Output must be a vector of length "+a.numCols);

        System.arraycopy(a.data,a.getIndex(row,0),out.data,0,a.numCols);

        return out;
    }
163638
def mkron(a, *args):
    """"""
    if not isinstance(a, list):
        a = [a]
    a = list(a)  # copy list
    for i in args:
        if isinstance(i, list):
            a.extend(i)
        else:
            a.append(i)

    c = _vector.vector()
    c.d = 0
    c.n = _np.array([], dtype=_np.int32)
    c.r = _np.array([], dtype=_np.int32)
    c.core = []

    for t in a:
        thetensor = t.tt if isinstance(t, _matrix.matrix) else t
        c.d += thetensor.d
        c.n = _np.concatenate((c.n, thetensor.n))
        c.r = _np.concatenate((c.r[:-1], thetensor.r))
        c.core = _np.concatenate((c.core, thetensor.core))

    c.get_ps()
    return c
58151
int getIndex(int row, int column) {
        check(row, column);
        return ku + row - column + column * (kl + ku + 1);
    }
340962
protected void convertToColumnMajor(ZMatrixRMaj A) {
        for( int x = 0; x < numCols; x++ ) {
            double colQ[] = dataQR[x];
            int indexCol = 0;
            for( int y = 0; y < numRows; y++ ) {
                int index = (y*numCols+x)*2;
                colQ[indexCol++] = A.data[index];
                colQ[indexCol++] = A.data[index+1];
            }
        }
    }
833066
def vectorize(self, df, column_name):
        """"""
        vec_df = df[column_name].str.join(sep='-').str.get_dummies(sep='-')
        return vec_df
991735
public function argmax() : ColumnVector
    {
        $b = [];

        foreach ($this->a as $row) {
            $b[] = (int) array_search(max($row), $row);
        }

        return ColumnVector::quick($b);
    }
963767
def rowcol(x, y, affine, op=math.floor):
    
    r = int(op((y - affine.f) / affine.e))
    c = int(op((x - affine.c) / affine.a))
    return r, c
905091
public static RealMatrix colSubtract (RealMatrix matrix, double[] vector) {
        // Declare and initialize the new matrix:
        double[][] retval = new double[matrix.getRowDimension()][matrix.getColumnDimension()];

        // Iterate over rows:
        for (int col = 0; col < retval.length; col++) {
            // Iterate over columns:
            for (int row = 0; row < retval[0].length; row++) {
                retval[row][col] = matrix.getEntry(row, col) - vector[row];
            }
        }

        // Done, return a new matrix:
        return MatrixUtils.createRealMatrix(retval);
    }
1211438
public Vector3f getColumn(int column, Vector3f dest) throws IndexOutOfBoundsException {
        switch (column) {
        case 0:
            dest.x = m00;
            dest.y = m01;
            dest.z = m02;
            break;
        case 1:
            dest.x = m10;
            dest.y = m11;
            dest.z = m12;
            break;
        case 2:
            dest.x = m20;
            dest.y = m21;
            dest.z = m22;
            break;
        case 3:
            dest.x = m30;
            dest.y = m31;
            dest.z = m32;
            break;
        default:
            throw new IndexOutOfBoundsException();
        }
        return dest;
    }
655070
def from_columns(columns):
        
        data = [
            [
                column[i]
                for i in range(len(column))
            ]
            for column in columns
        ]
        return Matrix(data)