06-04-2013 03:02 AM
Dear sir,
please tell me how delet 0 from multiple column besuace to delet zero from one by one column take too much time. here i have attache the main file and programme with this message.
Solved! Go to Solution.
06-04-2013 04:52 AM
What is your goal for deleting these entries?
One basic info btw:
A multi-dimensional array requires all parts within each dimension to be of the of the same size.
For better understanding:
A 2D array has two dimensions, we often call ROW and COLUMN. So each row has to have the same number of columns, each column has to have the same number of rows. So a 2D array is always a "rectangle".
E.g. if column 0 has 10 elements (rows), each other column also has to have 10 elements (rows). If row 1 has 5 elements (columns), all other rows have to have 5 elements (columns) as well.
So:
What do you intend to replace the '0' with? You cannot simply remove that entry as it would reduce the number of rows for that column.
Sidequestion:
Why are there '0's if you dont like them?
Norbert
06-04-2013 10:16 AM - edited 06-04-2013 10:21 AM
Also, if the data ren't really the same, why are they in an array instead of a cluster?
[edit] e.g. separate arrays within a cluster.
06-04-2013 12:44 PM - edited 06-04-2013 12:49 PM
I assume you want to delete all rows where certain columns are all zero. Is this right?
(Just glancing at your code, please get rid of the matrix operations, they make no sense. Also you should not wire N if you are autoindexing. You also need to initialize your shift registers where you keep track of the position!)
06-04-2013 12:59 PM - edited 06-04-2013 01:44 PM
Julian_prince wrote:please tell me how delet 0 from multiple column besuace to delet zero from one by one column take too much time. here i have attache the main file and programme with this message.
How big are your actual arrays? How do you measure the speed? How fast is it currently and how fast does it need to be?
In any case, you can do it all with one loop, e.g. as attached.
06-05-2013 01:19 AM
Dear sir,
Thanks for reply,
This file has array size of 87815 to run one file it takes approximately 1-2 minute, i want make so it will take time 30 sec for one file.
Programme provided by you is gud and takes less time than my programme but still i need some more speed to make it fast.
06-05-2013 01:40 AM
Dear,
Yes i want to delet certain columns with have zero , but there are also some column in which i want to keep zero.
06-05-2013 01:55 AM - edited 06-05-2013 01:58 AM
Julian_prince wrote:This file has array size of 87815 to run one file ...
What are the units? 87815 Bytes, Kilobytes, Megabyes? DBL array elements??
Again, how do you measure the speed? In the 5125kB file you have attached above, the code takes only 20ms on my 7 year old laptop. Reading the file is actually significantly (~50x) slower than that, so reading and parsing the file is the limiting step. Processing the array is insignificant.
This is one of the reasons why you should use binary files if performance is important.
I am sure you could go a bit faster by e.g. not converting to DBL, but operating on an array of strings, for example. I get about 2x faster. What exactly do you need at the end? Do you really need the DBL array?
06-05-2013 04:07 AM
Please tell me the option to take in array of string I don't need DBL array.
06-05-2013 11:38 AM
Is the pattern always very regular as in your example file (i.e. delete every other row) or are the lines to be deleted distributed randomly?
(Example files should always be typical and not contain extra assumptions!)