Click here to Skip to main content
15,891,799 members
Home / Discussions / C#
   

C#

 
GeneralIncluding files in my app, then using them Pin
Anthony Mushrow16-May-05 7:25
professionalAnthony Mushrow16-May-05 7:25 
GeneralRe: Including files in my app, then using them Pin
Marc Clifton16-May-05 11:29
mvaMarc Clifton16-May-05 11:29 
Question1. How to simulate mouse click on an arbitrary screen position? 2. How to get screen pixels color at arbitrary position? Pin
lgstef16-May-05 6:15
lgstef16-May-05 6:15 
Generalactive desktop Pin
Sabry190516-May-05 5:41
Sabry190516-May-05 5:41 
GeneralHandling Large Matrix in C#: Scientific Calculation Pin
amitmohanty16-May-05 5:39
amitmohanty16-May-05 5:39 
GeneralRe: Handling Large Matrix in C#: Scientific Calculation Pin
Robert Rohde16-May-05 7:12
Robert Rohde16-May-05 7:12 
GeneralRe: Handling Large Matrix in C#: Scientific Calculation Pin
Anonymous16-May-05 8:08
Anonymous16-May-05 8:08 
GeneralRe: Handling Large Matrix in C#: Scientific Calculation Pin
Robert Rohde16-May-05 11:33
Robert Rohde16-May-05 11:33 
Principally its relatively easy.
First you have to specify some sort of file structure. In this case the file could start with 2x4bytes containing the info about the size of the matrix. After that I would just place all elements of the matrix row by row, column by column into the file.
If you have such a file you should implement some sort of access wrapper which holds an open stream to the file and positions it to the correctly depending on what elements should be read. The formula is relatively simple. Assuming each element has a size of 8 bytes position x,y would be at the position 2 * 4 + x * 8 + y * matrixWidth * 8.
The ByteConverter class will help you to transform specific datatypes to pure byte arrays which can be written to the stream. To boost performance the access wrapper will also need the ability for stack reading (means a whole row or several rows in one catch) and probably also some caching or buffering mechanisms. But this greatly depends on what calculations you need.
I once made such a thing for some very special matrix types (but those were only 4 byte floating numbers) and if you put enough brain into it it can work really well. But keep in mind that for example calculating the inverse of a matrix means that youll have to read through the whole 760 mb file and then write it to another 760 mb file. So the bottleneck with this solution will always be the IO operations no matter how fast the algorithm behind is. The advantage is that you can nearly work on as many matrices at the same time as you want.
If you can reduce the size of each element as far as you can, e.g. take floats instead of double or short instead of long. Probably even byte will do it. Think carefully as it will greatly influence the performance and data size.
GeneralRe: Handling Large Matrix in C#: Scientific Calculation Pin
DavidNohejl16-May-05 11:54
DavidNohejl16-May-05 11:54 
GeneralRe: Handling Large Matrix in C#: Scientific Calculation Pin
amitmohanty16-May-05 14:16
amitmohanty16-May-05 14:16 
GeneralFew more primitive tricks Pin
DavidNohejl17-May-05 1:30
DavidNohejl17-May-05 1:30 
Generalstoring value in dll Pin
siuntung16-May-05 5:24
siuntung16-May-05 5:24 
GeneralRe: storing value in dll Pin
S. Senthil Kumar16-May-05 6:38
S. Senthil Kumar16-May-05 6:38 
GeneralRe: storing value in dll Pin
siuntung18-May-05 3:16
siuntung18-May-05 3:16 
GeneralRe: storing value in dll Pin
pubududilena17-May-05 18:01
pubududilena17-May-05 18:01 
GeneralHandling System Events Pin
heavenamour16-May-05 4:31
heavenamour16-May-05 4:31 
GeneralRe: Handling System Events Pin
Dave Kreskowiak16-May-05 7:19
mveDave Kreskowiak16-May-05 7:19 
GeneralRe: Handling System Events Pin
heavenamour16-May-05 17:52
heavenamour16-May-05 17:52 
GeneralRe: Handling System Events Pin
Dave Kreskowiak17-May-05 4:02
mveDave Kreskowiak17-May-05 4:02 
GeneralRe: Handling System Events Pin
heavenamour17-May-05 18:31
heavenamour17-May-05 18:31 
GeneralUninstalling your uninstaller!! Pin
exhaulted16-May-05 4:28
exhaulted16-May-05 4:28 
GeneralRe: Uninstalling your uninstaller!! Pin
Colin Angus Mackay16-May-05 4:33
Colin Angus Mackay16-May-05 4:33 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 4:41
exhaulted16-May-05 4:41 
GeneralRe: Uninstalling your uninstaller!! Pin
Colin Angus Mackay16-May-05 4:57
Colin Angus Mackay16-May-05 4:57 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 5:00
exhaulted16-May-05 5:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.