Applies the <i>cube root</i> function element wise on this
matrix. Note that this is an in-place operation.
@see MatrixFunctions#cbrt(DoubleMatrix)
@return this matrix
486534
public static DoubleMatrix cbrti(DoubleMatrix x) { 
		/*# mapfct('Math.cbrt') #*/
//RJPP-BEGIN------------------------------------------------------------
	   for (int i = 0; i < x.length; i++)
	      x.put(i, (double) Math.cbrt(x.get(i)));
	   return x;
//RJPP-END--------------------------------------------------------------
	}
700412
public Matrix transformRow(int i, VectorFunction function) {
        Matrix result = copy();
        VectorIterator it = result.iteratorOfRow(i);

        while (it.hasNext()) {
            double x = it.next();
            int j = it.index();
            it.set(function.evaluate(j, x));
        }

        return result;
    }
466956
public Matrix3d set(Matrix4x3dc m) {
        m00 = m.m00();
        m01 = m.m01();
        m02 = m.m02();
        m10 = m.m10();
        m11 = m.m11();
        m12 = m.m12();
        m20 = m.m20();
        m21 = m.m21();
        m22 = m.m22();
        return this;
    }
1016349
public Matrix getMatrixForRepeater(float amount) {
    PointF position = this.position == null ? null : this.position.getValue();
    ScaleXY scale = this.scale == null ? null : this.scale.getValue();

    matrix.reset();
    if (position != null) {
      matrix.preTranslate(position.x * amount, position.y * amount);
    }
    if (scale != null) {
      matrix.preScale(
          (float) Math.pow(scale.getScaleX(), amount),
          (float) Math.pow(scale.getScaleY(), amount));
    }
    if (this.rotation != null) {
      float rotation = this.rotation.getValue();
      PointF anchorPoint = this.anchorPoint == null ? null : this.anchorPoint.getValue();
      matrix.preRotate(rotation * amount, anchorPoint == null ? 0f : anchorPoint.x, anchorPoint == null ? 0f : anchorPoint.y);
    }

    return matrix;
  }
470691
public Matrix subtract(double c)
    {
        Matrix toReturn = getThisSideMatrix(null);
        toReturn.mutableSubtract(c);
        return toReturn;
    }
928518
@Nonnull
  @ReturnsMutableCopy
  public Matrix solve (@Nonnull final Matrix aMatrix)
  {
    if (aMatrix.getRowDimension () != m_nRows)
      throw new IllegalArgumentException ("Matrix row dimensions must agree.");
    if (!isNonsingular ())
      throw new IllegalStateException ("Matrix is singular.");

    // Copy right hand side with pivoting
    final int nCols = aMatrix.getColumnDimension ();
    final Matrix aNewMatrix = aMatrix.getMatrix (m_aPivot, 0, nCols - 1);
    final double [] [] aNewArray = aNewMatrix.internalGetArray ();

    // Solve L*Y = B(piv,:)
    for (int k = 0; k < m_nCols; k++)
    {
      final double [] aNewk = aNewArray[k];
      for (int i = k + 1; i < m_nCols; i++)
      {
        final double [] aLUi = m_aLU[i];
        final double [] aNewi = aNewArray[i];
        for (int j = 0; j < nCols; j++)
          aNewi[j] -= aNewk[j] * aLUi[k];
      }
    }
    // Solve U*X = Y;
    for (int k = m_nCols - 1; k >= 0; k--)
    {
      final double [] aLUk = m_aLU[k];
      final double [] aNewk = aNewArray[k];
      for (int j = 0; j < nCols; j++)
        aNewk[j] /= aLUk[k];
      for (int i = 0; i < k; i++)
      {
        final double [] aLUi = m_aLU[i];
        final double [] aNewi = aNewArray[i];
        for (int j = 0; j < nCols; j++)
          aNewi[j] -= aNewk[j] * aLUi[k];
      }
    }
    return aNewMatrix;
  }
1298571
public DMatrixRMaj getR() {
        DMatrixRMaj R = new DMatrixRMaj(QR.numRows,QR.numCols);
        int N = Math.min(QR.numCols,QR.numRows);

        for( int i = 0; i < N; i++ ) {
            for( int j = i; j < QR.numCols; j++ ) {
                R.unsafe_set(i,j, QR.unsafe_get(i,j));
            }
        }

        return R;
    }
117920
public Matrix plus(Matrix B)
    {
        checkMatrixDimensions(B);
        Matrix X = new Matrix(m, n);
        double[][] C = X.getArray();
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                C[i][j] = A[i][j] + B.A[i][j];
            }
        }
        return X;
    }
921618
public Matrix shuffle() {
        Matrix result = copy();

        // Conduct Fisher-Yates shuffle
        Random random = new Random();

        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < columns; j++) {
                int ii = random.nextInt(rows - i) + i;
                int jj = random.nextInt(columns - j) + j;

                double a = result.get(ii, jj);
                result.set(ii, jj, result.get(i, j));
                result.set(i, j, a);
            }
        }

        return result;
    }
1338439
public Matrix3 setToRotation (IQuaternion quat) {
        double qx = quat.x(), qy = quat.y(), qz = quat.z(), qw = quat.w();
        double xx = qx*qx, yy = qy*qy, zz = qz*qz;
        double xy = qx*qy, xz = qx*qz, xw = qx*qw;
        double yz = qy*qz, yw = qy*qw, zw = qz*qw;
        return set(1f - 2f*(yy + zz), 2f*(xy - zw), 2f*(xz + yw),
                   2f*(xy + zw), 1f - 2f*(xx + zz), 2f*(yz - xw),
                   2f*(xz - yw), 2f*(yz + xw), 1f - 2f*(xx + yy));
    }
898548
public CubicSplineCurve transpose()
    {
        List<Point> tr = new ArrayList<Point>();
        for (int ii=0;ii<S.length;ii++)
        {
            tr.add(new AbstractPoint(S[ii].getY(), S[ii].getX()));
        }
        if (tr.get(0).getX() > tr.get(tr.size()-1).getX())    // reverse order
        {
            Collections.reverse(tr);
        }
        return new CubicSplineCurve(tr);
    }
513538
public Matrix multiply(double c)
    {
        Matrix toReturn = getThisSideMatrix(null);
        toReturn.mutableMultiply(c);
        return toReturn;
    }
1342442
public Matrix calcOrig() {
		if (!Coordinates.equals(getSource().getSize(), getSize())) {
			throw new RuntimeException(
					"Cannot change Matrix size. Use calc(Ret.NEW) or calc(Ret.LINK) instead.");
		}
		long[] newCoordinates = new long[position.length];
		for (long[] c : newContent.allCoordinates()) {
			Coordinates.plus(newCoordinates, position, c);
			getSource().setAsObject(getObject(newCoordinates), newCoordinates);
		}
		getSource().fireValueChanged();
		return getSource();
	}
25059
@Override
	protected DoubleMatrix1D getLb() {
		if (this.limitedLb == null) {
			if (super.getLb() == null) {
				this.limitedLb = F1.make(getC().size(), minLBValue);
			} else {
				this.limitedLb = F1.make(super.getLb().size());
				for (int i = 0; i < super.getLb().size(); i++) {
					double lbi = super.getLb().getQuick(i);
					if (lbi < minLBValue) {
						log.warn("the " + i +"-th lower bound was limited form "+lbi+" to the value of minLBValue: " + minLBValue);
						limitedLb.setQuick(i, minLBValue);
					} else {
						limitedLb.setQuick(i, lbi);
					}
				}
			}
		}
		return limitedLb;
	}
379948
public Matrix4f set(Vector4fc col0, Vector4fc col1, Vector4fc col2, Vector4fc col3) {
        if (col0 instanceof Vector4f &&
            col1 instanceof Vector4f &&
            col2 instanceof Vector4f &&
            col3 instanceof Vector4f) {
            MemUtil.INSTANCE.set(this, (Vector4f) col0, (Vector4f) col1, (Vector4f) col2, (Vector4f) col3);
        } else {
            setVector4fc(col0, col1, col2, col3);
        }
        _properties(0);
        return this;
    }
243295
public static DoubleMatrix coshi(DoubleMatrix x) { 
		/*# mapfct('Math.cosh') #*/
//RJPP-BEGIN------------------------------------------------------------
	   for (int i = 0; i < x.length; i++)
	      x.put(i, (double) Math.cosh(x.get(i)));
	   return x;
//RJPP-END--------------------------------------------------------------
	}
929066
public Matrix4x3fStack pushMatrix() {
        if (curr == mats.length) {
            throw new IllegalStateException("max stack size of " + (curr + 1) + " reached"); //$NON-NLS-1$ //$NON-NLS-2$
        }
        mats[curr++].set(this);
        return this;
    }