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; }
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); }
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}')"); } }
public static int[] GetIndicesVector(VfpuRegisterInfo registerInfo) => Enumerable.Range(0, registerInfo.Size) .Select(offset => GetIndexCell(registerInfo.GetCellOffset(offset))).ToArray();
public static int GetIndexCell(VfpuRegisterInfo registerInfo) => GetIndexCell(registerInfo.GetCellOffset(0));
public static int[,] GetIndicesMatrix(int size, VfpuRegisterInt register) => GetIndicesMatrix(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Matrix, size, register));
public static int[] GetIndicesVector(int size, VfpuRegisterInt register) => GetIndicesVector(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Vector, size, register));
public static int GetIndexCell(VfpuRegisterInt register) => GetIndexCell(VfpuRegisterInfo.FromVfpuRegisterInt(VfpuRegisterType.Cell, 1, register));
public static int[] GetIndices(VfpuRegisterInfo registerInfo) => _GetIndices(registerInfo).ToArray();
public static int[] GetIndices(int size, string name) => GetIndices(VfpuRegisterInfo.Parse(size, name));
public static int[] GetIndices(VfpuRegisterInfo RegisterInfo) { return _GetIndices(RegisterInfo).ToArray(); }
public static int GetIndexCell(VfpuRegisterInfo RegisterInfo) { return GetIndexCell(RegisterInfo.GetCellOffset(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))); } }
public static int[] GetIndicesVector(VfpuRegisterInfo RegisterInfo) { return Enumerable.Range(0, RegisterInfo.Size).Select(Offset => GetIndexCell(RegisterInfo.GetCellOffset(Offset))).ToArray(); }