Beispiel #1
0
        /// <summary>
        /// Object clone
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            RectangleMatrix matrix = new RectangleMatrix();

            base.Copy(matrix);

            return(matrix);
        }
Beispiel #2
0
        /// <summary>
        /// Matrix subtract
        /// </summary>
        /// <param name="matrix1">Matrix 1</param>
        /// <param name="matrix2">Matrix 2</param>
        /// <returns>Result</returns>
        public static RectangleMatrix operator -(RectangleMatrix matrix1, RectangleMatrix matrix2)
        {
            RectangleMatrix m1 = (RectangleMatrix)matrix1.Clone();
            RectangleMatrix m2 = (RectangleMatrix)matrix2.Clone();

            RectangleMatrix matrix = new RectangleMatrix();

            Matrix.sub(m1, m2, matrix);

            return(matrix);
        }
Beispiel #3
0
        public static RectangleMatrix operator *(SquareMatrix matrix1, RectangleMatrix matrix2)
        {
            SquareMatrix    m1 = (SquareMatrix)matrix1.Clone();
            RectangleMatrix m2 = (RectangleMatrix)matrix2.Clone();

            RectangleMatrix matrix = new RectangleMatrix();

            Matrix.mult(m1, m2, matrix);

            return(matrix);
        }
Beispiel #4
0
        public Vector LQR(Vector v)
        {
            if (this.rows != v.Dimension)
            {
                return(null);
            }

            RectangleMatrix M = (RectangleMatrix)(this.Clone());

            M.transpose();
            Vector V = M * v;

            M = M * this;
            SquareMatrix s = new SquareMatrix(M.rows);

            s.CopyValue(M);

            return(s.linsolve(V));
        }