I want to create an array of references to my arrays. The reason for this is because i want to optimise my fast Fourier transform algorithm to be branchless - or rather, less branchy.
The idea behind it is i have two arrays:
Array1 and Array2
I need to ping pong between the two in a for loop so i want to store the reference to the arrays like this:
[0] = Array1Ref
[1] = Array2Ref
[2] = Array1Ref
. . .
Is it possible to do this in C#? If so how would you define such an array - would i need to use unsafe ?
if(i%2 == 0) arr1 : arr2I am trying to see if i can make it faster by aligning the for loop iteration with an array of references. This is a micro optimisation attempt.var someArray = new WhatEverTypeItIs[][];which is an array of array of WhatEverTypeItIs