예제 #1
0
        public static int[,] GetIndicesMatrix(VfpuRegisterInfo RegisterInfo)
        {
            var IndicesMatrix = new int[RegisterInfo.Size, RegisterInfo.Size];

            for (int Row = 0; Row < RegisterInfo.Size; Row++)
            {
                for (int Column = 0; Column < RegisterInfo.Size; Column++)
                {
                    IndicesMatrix[Column, Row] = (int)GetIndexCell(RegisterInfo.GetCellOffset(Column, Row));
                }
            }

            return IndicesMatrix;
        }
예제 #2
0
        public static int[,] GetIndicesMatrix(VfpuRegisterInfo registerInfo)
        {
            var indicesMatrix = new int[registerInfo.Size, registerInfo.Size];

            for (var row = 0; row < registerInfo.Size; row++)
            {
                for (var column = 0; column < registerInfo.Size; column++)
                {
                    indicesMatrix[column, row] = GetIndexCell(registerInfo.GetCellOffset(column, row));
                }
            }

            return(indicesMatrix);
        }
예제 #3
0
        private static int[] _GetIndices(VfpuRegisterInfo registerInfo)
        {
            switch (registerInfo.RegisterType)
            {
            case VfpuRegisterType.Cell: return(new[] { GetIndexCell(registerInfo) });

            case VfpuRegisterType.Vector: return(GetIndicesVector(registerInfo));

            case VfpuRegisterType.Matrix: return(GetIndicesMatrix(registerInfo).Compact());

            default:
                throw new NotImplementedException(
                          $"Invalid vfpu registry name {registerInfo.RegisterIndex}('{registerInfo.Name}')");
            }
        }
예제 #4
0
 public static int[] GetIndicesVector(VfpuRegisterInfo registerInfo) => Enumerable.Range(0, registerInfo.Size)
 .Select(offset => GetIndexCell(registerInfo.GetCellOffset(offset))).ToArray();
예제 #5
0
 public static int GetIndexCell(VfpuRegisterInfo registerInfo) => GetIndexCell(registerInfo.GetCellOffset(0));
예제 #6
0
 public static int[,] GetIndicesMatrix(int size, VfpuRegisterInt register) =>
 GetIndicesMatrix(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Matrix, size, register));
예제 #7
0
 public static int[] GetIndicesVector(int size, VfpuRegisterInt register) =>
 GetIndicesVector(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Vector, size, register));
예제 #8
0
 public static int GetIndexCell(VfpuRegisterInt register) =>
 GetIndexCell(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Cell, 1, register));
예제 #9
0
 public static int[] GetIndices(VfpuRegisterInfo registerInfo) => _GetIndices(registerInfo).ToArray();
예제 #10
0
 public static int[] GetIndices(int size, string name) => GetIndices(VfpuRegisterInfo.Parse(size, name));
예제 #11
0
 public static int[] GetIndices(VfpuRegisterInfo RegisterInfo)
 {
     return _GetIndices(RegisterInfo).ToArray();
 }
예제 #12
0
 public static int GetIndexCell(VfpuRegisterInfo RegisterInfo)
 {
     return GetIndexCell(RegisterInfo.GetCellOffset(0));
 }
예제 #13
0
 private static int[] _GetIndices(VfpuRegisterInfo RegisterInfo)
 {
     switch (RegisterInfo.RegisterType)
     {
         case VfpuRegisterType.Cell: return new[] { (int)GetIndexCell(RegisterInfo) };
         case VfpuRegisterType.Vector: return GetIndicesVector(RegisterInfo);
         case VfpuRegisterType.Matrix: return GetIndicesMatrix(RegisterInfo).Compact();
         default:
             throw (new NotImplementedException(String.Format("Invalid vfpu registry name {0}('{1}')", RegisterInfo.RegisterIndex, RegisterInfo.Name)));
     }
 }
예제 #14
0
 public static int[] GetIndicesVector(VfpuRegisterInfo RegisterInfo)
 {
     return Enumerable.Range(0, RegisterInfo.Size).Select(Offset => GetIndexCell(RegisterInfo.GetCellOffset(Offset))).ToArray();
 }