Beispiel #1
0
        /**
         * Creates a new SimpleMatrix which is a copy of the Matrix.
         *
         * @param orig The original matrix whose value is copied.  Not modified.
         */
        public SimpleMatrix(Matrix orig)
        {
            Matrix mat;

            if (orig is DMatrixRBlock)
            {
                DMatrixRMaj a = new DMatrixRMaj(orig.getNumRows(), orig.getNumCols());
                ConvertDMatrixStruct.convert((DMatrixRBlock)orig, a);
                mat = a;
            }
            else if (orig is FMatrixRBlock)
            {
                FMatrixRMaj a = new FMatrixRMaj(orig.getNumRows(), orig.getNumCols());
                ConvertFMatrixStruct.convert((FMatrixRBlock)orig, a);
                mat = a;
            }
            else
            {
                mat = orig.copy();
            }
            setMatrix((T)mat);
        }
Beispiel #2
0
 /**
  * Converts a row major block matrix into a row major matrix.
  *
  * @param src Original FMatrixRBlock..  Not modified.
  * @param dst Equivalent FMatrixRMaj.  Modified.
  */
 public static FMatrixRMaj convert(FMatrixRBlock src, FMatrixRMaj dst)
 {
     return(ConvertFMatrixStruct.convert(src, dst));
 }
Beispiel #3
0
 /**
  * Converts a row major matrix into a row major block matrix.
  *
  * @param src Original FMatrixRMaj.  Not modified.
  * @param dst Equivalent FMatrixRBlock. Modified.
  */
 public static void convert(FMatrixRMaj src, FMatrixRBlock dst)
 {
     ConvertFMatrixStruct.convert(src, dst);
 }