Le 28/10/2015 17:33, Eric Barnhill a écrit : > Dear all, Hi Eric,
> > Thanks for the feedback on ComplexUtils and I have submitted a pull request > with the edits. I have pulled this request into our git repository, with minor edits. The changes are mainly removing tabs and trailing blanks, and fixing some javadocs. In the initialize methods, I have also replaced the construction of a bunch of new Complex(0, 0) with the reuse of the constant Complex.ZERO. As our complex instances are immutable, it seemed better to me this way. For now, it is in a dedicated branch named complex-and-primitive-arrays, so the pull request may not close automatically as it is not on master. Do other developers agree with merging this branch to master? > > I have added functionality to convert between Complex arrays and real > double, real float, interleaved double, interleaved float, split double > (one real, one imag) and split float arrays. Per Gilles' suggestion I have > included the use of IntegerSequence.range() arguments and the methods > mostly refer to workhorse Extract() methods. I also added a method to > initialize Complex[] arrays to all zeros, to avoid null pointer exceptions. > > I have also updated ComplexUtilsTest to include JUnit tests of every > method, which all pass. I had to define many arrays to run the tests and > hopefully the comments make the purpose of each clear. I was not entirely > clear how to use the tolerance parameter and submitted ulp each time, so > contact me if I should do something else. > > I am using nearly all of these methods in the medical imaging library I am > working on so I don't think I overdid it. > > Repeating the methods for different types, so many times, got me to > thinking about the overall structure of arrays in math functions and what I > would most like to see. So in my own library I am creating a MathArray > superclass. This in turn can be Complex, real, split, or interleaved, and > contain any type of primitive, kind of like the ImageJ ImageProcessor > interface This will allow every method I have put in ComplexUtils, and many > more I keep in other libraries, to be written only once for the superclass. > Further the superclass will have a full range of math methods that operate > on arrays element wise, enabling syntax approaching Matlab to be used for > arrays that is basically the same as what is already in place for Complex > objects, i.e. commands like > array1.multiply(array2).pwr(2).zeroPad(n).resizeBicubic(2).stripPadding(n/2) > . > > If this is of interest to the community I can submit a pull request when > I've got it worked up. If someone has already designed such a library I'd > be grateful if someone mentions it before I get started. This should be discussed in a separate thread. best regards, Luc > > Best, > Eric > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org