示例#1
0
        /// <summary>
        /// Execute operation on each value in matrix
        /// </summary>
        /// <param name="operation">MatrixValueOperation - operation type</param>
        /// <param name="number">double - value</param>
        /// <returns>MatrixMB</returns>
        public MatrixMB OperationNew(MatrixAction operation, double number)
        {
            MatrixMB mat = this.Copy();

            switch (operation)
            {
            case MatrixAction.Add:
            {
                mat.AddNumber(number);
            } break;

            case MatrixAction.Substract:
            {
                mat.SubNumber(number);
            } break;

            case MatrixAction.Multiply:
            {
                mat.MulByNumber(number);
            } break;

            case MatrixAction.Divide:
            {
                mat.DivByNumber(number);
            } break;

            case MatrixAction.Power:
            {
                mat.PowerByNumber(number);
            } break;

            case MatrixAction.Sqrt:
            {
                mat.SqrtFromNumber();
            } break;

            case MatrixAction.Abs:
            {
                mat.AbsoluteNumber();
            } break;
            }
            return(mat);
        }
示例#2
0
        /// <summary>
        /// Execute operation on each value in matrix
        /// </summary>
        /// <param name="operation">MatrixValueOperation - operation type</param>
        /// <param name="number">double - value</param>
        public void Operation(MatrixAction operation, double number)
        {
            switch (operation)
            {
            case MatrixAction.Add:
            {
                AddNumber(number);
            } break;

            case MatrixAction.Substract:
            {
                SubNumber(number);
            } break;

            case MatrixAction.Multiply:
            {
                MulByNumber(number);
            } break;

            case MatrixAction.Divide:
            {
                DivByNumber(number);
            } break;

            case MatrixAction.Power:
            {
                PowerByNumber(number);
            } break;

            case MatrixAction.Sqrt:
            {
                SqrtFromNumber();
            } break;

            case MatrixAction.Abs:
            {
                AbsoluteNumber();
            } break;
            }
        }
示例#3
0
 /// <summary>
 /// Execute operation on each value in matrix
 /// </summary>
 /// <param name="operation">MatrixValueOperation - operation type</param>
 /// <param name="number">double - value</param>
 /// <returns>MatrixMB</returns>
 public MatrixMB OperationNew(MatrixAction operation, double number)
 {
     MatrixMB mat = this.Copy();
     switch (operation)
     {
         case MatrixAction.Add:
             {
                 mat.AddNumber(number);
             } break;
         case MatrixAction.Substract:
             {
                 mat.SubNumber(number);
             } break;
         case MatrixAction.Multiply:
             {
                 mat.MulByNumber(number);
             } break;
         case MatrixAction.Divide:
             {
                 mat.DivByNumber(number);
             } break;
         case MatrixAction.Power:
             {
                 mat.PowerByNumber(number);
             } break;
         case MatrixAction.Sqrt:
             {
                 mat.SqrtFromNumber();
             } break;
         case MatrixAction.Abs:
             {
                 mat.AbsoluteNumber();
             } break;
     }
     return mat;
 }
示例#4
0
 /// <summary>
 /// Execute operation on each value in matrix
 /// </summary>
 /// <param name="operation">MatrixValueOperation - operation type</param>
 /// <param name="number">double - value</param>
 public void Operation(MatrixAction operation, double number)
 {
     switch (operation)
     {
         case MatrixAction.Add:
             {
                 AddNumber(number);
             } break;
         case MatrixAction.Substract:
             {
                 SubNumber(number);
             } break;
         case MatrixAction.Multiply:
             {
                 MulByNumber(number);
             } break;
         case MatrixAction.Divide:
             {
                 DivByNumber(number);
             } break;
         case MatrixAction.Power:
             {
                 PowerByNumber(number);
             } break;
         case MatrixAction.Sqrt:
             {
                 SqrtFromNumber();
             } break;
         case MatrixAction.Abs:
             {
                 AbsoluteNumber();
             } break;
     }
 }