Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement vector of arrays in Java?

I want to have a resizable structure in Java to keep one dimension-arrays or vectors of type double. What is the best way to do?

Is it possible to pass an array as parameter to an Arraylist? May be to a Vector?

If not what is a quite reasonable solution?

After all, based on the proposed implementation, what is the most effective way to gain values from the structure and to use them on calculations (adding arrays, multiply arrays ,etc).

like image 438
arjacsoh Avatar asked May 08 '26 21:05

arjacsoh


1 Answers

You can use an ArrayList<Double> however you may find that TDoubleArrayList is more efficient as this wraps a double[]

like image 141
Peter Lawrey Avatar answered May 11 '26 10:05

Peter Lawrey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!