Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 6 of 6
I have the following question. We are writing a high performance application.
This will require preallocating memory for a matrix. The matrix will be used
as Circular Buffer - when the new row arrives, it will replace one of the
existing rows, with the old values in that row being "lost". Therefore, the
"beginning row" of the matrix will be shifted as new rows are populated. What
we want is to be able to reindex the existing background matrix so that the
other "matrix as a view" would recalculate indexes accordingly. Let me give
you an example.
Let's say we have a matrix
m =
[ 1 2;
3 4]
I want to create a matrix m2 that would use the same background storage, but
return the following values when queried by indices as follows:
m2(0,0) -> 3
m2(0,1) -> 2
m2(1,0) -> 1
m2(1,1) -> 2
Ideally, we would want to be able to create something like "reindexer" and
pass it into constructor of the new ILArray along with the instance if the
old ILArray.
Do you think it is (or will be) possible to do?
A.
this might be archievable with the referencing feature of ILArray<T>. (?) You might combine ILArray.ReferencingBehaviour.DetachNever with a rotating row definition for the subarray creation.
For every step:
A[String.Format("{0}:end,0:{0};:",step.ToString()]; step++;
will realize the rotating rows. In order to overwrite them without detaching (and recreating) the original storage, you must prevent the array from automatic detaching. use the before mentioned property for that.
Take a look at ILMemoryPool. It may be tuned to achieve similar results.
See this page: http://redir.ec/xjcp (http://ilnumerics.net/siteref_Support_Online+Documentation_Advanced+Tutorials_Performance+Considerations_Optimizing+Memory+Usage)
1 to 6 of 6