So, C# has a wonderful feature where you can add actual variables to lists, but that is unhelpful for me right now as I want the value of said variable.
public List<List<float?>> distMatrix = new List<List<float?>>();
public List<List<float>> routeMatrix = new List<List<float>>();
public List<List<List<float?>>> distMatrixHistory = new List<List<List<float?>>();
public List<List<List<float>>> routeMatrixHistory = new List<List<List<float>>();
This is where I am defining my variables.
distMatrixHistory.Add(distMatrix);
routeMatrixHistory.Add(routeMatrix);
And this is the piece of code I have that adds those matrices to the matrix history list. The issue is that I loop and change the value of these matrices, but I don't want the value of the elements in the matrixhistory lists to change too.
I know that, theoretically, I can just do this manually. I know that I can probably program a small function that would cycle through and add each value separately. But this seems like something that c# should have inbuilt functions (or libraries) to deal with, even if I have not found anything when looking into it.
Side note: If anyone wants a bit more context, this is a small program that runs Floyd's Algorithm, so I cycle every step and change my distance and my route matrix, and my little winforms app should theoretically be able to display any step requested.
>(listListA)`. You probably have to do something like `var listListB = new List
>(listListA.Count); foreach(var listA in listListA) { listListB.Add(new List(listA)); }` -- and then add _that_ `listListB` to the archive.