0

I have a DenseArray<ComplexNumber> symbols now I would like to transform these into a mutable Matrix of complex numbers, don't care if column or row major. The documentation is a bit sparse around this, I looked at all the examples.

Also how can I get sub-array of the dense array? Something like symbols.subArray(start, end, step).

  • Can't you create an ```Array1D```, ```Array2D``` or ```ComplexDenseStore``` instead of that ```DenseArray```? – apete Oct 30 '17 at 14:23
  • @apete I don't know how to create an Array1D, it wants a delegate. The documentation does not tell me what that is or what it does with it. And also I don't know why I should use it over a DenseArray, when the Working-With-Arrays recommends me using a DenseArray when I use complex numbers. –  Oct 30 '17 at 14:26
  • ```Àrray1D.COMPLEX.makeZero(long)``` – apete Oct 30 '17 at 15:19

1 Answers1

1

To answer one part of your question there is an interface org.ojalgo.access.Access1D.Sliceable and it has 2D and AnyD counter parts. Is that one part of the puzzle for you?

Further the https://github.com/optimatika/ojAlgo/wiki/Working-with-arrays wiki page does outline how how to use dense array factories to create other higher level objects.

You need to be more precise regarding what you actually want to achieve.

apete
  • 1,250
  • 1
  • 10
  • 16
  • I changed everything to be an Array1D now. I want to transform this long array into a matrix, padded with zero-elements. The only way I see is to manual go trough the array and set each value individually. Is that the intended way to do this? –  Oct 30 '17 at 15:51
  • That's one way... I don't understand what you mean by "padded with zero-elements". Will that Array1D be a row/column/diagonal of the matrix? – apete Oct 30 '17 at 16:45