Returns the first non zero column
@param x the matrix to get a column from
@return the first non zero column
189275
private static Vec getColumn(Matrix x)
    {
        Vec t;
        
        for(int i = 0; i < x.cols(); i++)
        {
            t = x.getColumn(i);
            if(t.dot(t) > 0 )
                return t;
        }
        
        throw new ArithmeticException("Matrix is essentially zero");
    }
678065
def first(self, limit=1, columns=None):
        
        if not columns:
            columns = ["*"]

        return self.take(limit).get(columns).first()
686300
int getColumnByX(int x) {
        checkForInit();
        int sum = 0;
        // header offset
        int tempX = x - mHeaderRowWidth;
        if (tempX <= sum) {
            return 0;
        }
        for (int count = mColumnWidths.length, i = 0; i < count; i++) {
            int nextSum = sum + mColumnWidths[i];
            if (tempX > sum && tempX < nextSum) {
                return i;
            } else if (tempX < nextSum) {
                return i - 1;
            }
            sum = nextSum;
        }
        return mColumnWidths.length - 1;
    }
1211435
protected DoubleMatrix2D getGradFi(DoubleMatrix1D X) {
		DoubleMatrix2D ret = F2.make(request.getFi().length, X.size());
		double[] x = X.toArray();
		for(int i=0; i<request.getFi().length; i++){
			ret.viewRow(i).assign(request.getFi()[i].gradient(x));
		}
		return ret;
	}
772562
public static DoubleMatrix logi(DoubleMatrix x) {
		/*# mapfct('Math.log') #*/
//RJPP-BEGIN------------------------------------------------------------
	   for (int i = 0; i < x.length; i++)
	      x.put(i, (double) Math.log(x.get(i)));
	   return x;
//RJPP-END--------------------------------------------------------------
	}
198269
public CellStyle getOrCreateColumnStyle(int x) {
		CellStyle columnStyle = this.sheet.getColumnStyle(x);
		if (null == columnStyle) {
			columnStyle = this.workbook.createCellStyle();
			this.sheet.setDefaultColumnStyle(x, columnStyle);
		}
		return columnStyle;
	}
824853
public static int nextAllOnesInt(int x) {
    x |= x >>> 1;
    x |= x >>> 2;
    x |= x >>> 4;
    x |= x >>> 8;
    x |= x >>> 16;
    return x;
  }
762058
static public double EScafferF6NonCont(double[] x) {

    double sum = 0.0;
    double prevX, currX;

    currX = myXRound(x[0]);
    for (int i = 1; i < x.length; i++) {
      prevX = currX;
      currX = myXRound(x[i]);
      sum += ScafferF6(prevX, currX);
    }
    prevX = currX;
    currX = myXRound(x[0]);
    sum += ScafferF6(prevX, currX);

    return (sum);
  }
1054901
public static FloatMatrix centerColumns(FloatMatrix x) {
                FloatMatrix temp = new FloatMatrix(x.rows);
		for (int c = 0; c < x.columns; c++)
			x.putColumn(c, center(x.getColumn(c, temp)));
		return x;
	}
457330
public Object getValue(int x) {
    if (x >= width())
      throw new IllegalArgumentException("Index out of scope on axis (" + x + " >= " + width() + ")!");

    return m_List[(int) m_Min + x];
  }
659607
public DMatrixRMaj next( DMatrixRMaj x )
	{
		for( int i = 0; i < r.numRows; i++ ) {
			r.set(i,0,rand.nextGaussian());
		}
		x.set(mean);

		multAdd(A,r,x);

		return x;
	}
947340
public NumberExpression<Double> x() {
        if (x == null) {
            x = Expressions.numberOperation(Double.class, SpatialOps.X, mixin);
        }
        return x;
    }
323365
public static DoubleMatrix atani(DoubleMatrix x) { 
		/*# mapfct('Math.atan') #*/
//RJPP-BEGIN------------------------------------------------------------
	   for (int i = 0; i < x.length; i++)
	      x.put(i, (double) Math.atan(x.get(i)));
	   return x;
//RJPP-END--------------------------------------------------------------
	}
957328
public Matrix getD () {
      Matrix X = MatrixFactory.createMatrix(n,n);
      for (int i = 0; i < n; i++) {
         X.set(i,i,d[i]);
         if (e[i] > 0) {
				X.set(i,i+1,e[i]);
         } else if (e[i] < 0) {
				X.set(i,i-1,e[i]);
         }
      }
      return X;
   }
1316955
public static int[] c(int[]... x) {
        int n = 0;
        for (int i = 0; i < x.length; i++) {
            n += x.length;
        }

        int[] y = new int[n];
        for (int i = 0, k = 0; i < x.length; i++) {
            for (int xi : x[i]) {
                y[k++] = xi;
            }
        }
        return y;
    }
1358138
@Pure
	public UnitVectorProperty firstAxisProperty() {
		if (this.raxis == null) {
			this.raxis = new UnitVectorProperty(this, MathFXAttributeNames.FIRST_AXIS, getGeomFactory());
		}
		return this.raxis;
	}
13174
public double get(int x, int y) {
    return (x == y) ? 0 : (x < y) //
        ? matrix[MatrixParadigm.triangleSize(y) + x] //
        : matrix[MatrixParadigm.triangleSize(x) + y];
  }