Programming :: Optimizing The Spacing Of A Mesh Containing A Given Set Of Points?
Jan 15, 2011
I tried to summarize the this as best as possible in the title. I am writing an initial value problem solver in the most general way possible. I start with an arbitrary number of initial values at arbitrary locations (inside a boundary.) The first part of my program creates a mesh/grid (I am not sure which is the correct nuance), with N points total, that contains all the initial values. My goal is to optimize the mesh such that the spacing is as uniform as possible. My solver seems to work half decently (it needs some more obscure debugging that is not relevant here.)
I am starting with one dimension. I intend to generalize the algorithm to an arbitrary number of dimensions once I get it working consistently. I am writing my code in fortran, but feel free to reply with pseudocode or the language of your choice.Allow me to elaborate with an example:Say I am working on a closed interval [1,10]
I store my mesh/grid points in an array called coord. Say I want 10 points total in my mesh/grid.
N=10
coord(10)
Remember, all this is arbitrary--except the variable names of course. The algorithm should set coord to {1,2,3,4,5,6,7,8,9,10} Now for a less trivial example:
num_ivc=3
known(num_ivc)=[xmin,5.5,xmax
or just
num_ivc=1
known(num_ivc)=[5.5]
Now, would you have 5 evenly spaced points on the interval [1, 5.5] and 5 evenly spaced points on the interval (5.5, 10]? But there is more space between 1 and 5.5 than between 5.5 and 10. So would you have 6 points on [1, 5.5] followed by 4 on (5.5 to 10]. The key is to minimize the difference in spacing.I have been working on this for 2 days straight and I can assure you it is a lot trickier than it sounds. I have written code that
only works if N is large
only works if N is small
only works if it the known points are close together
[code]....
So as you can see, I have coded the gamut of almost-solutions. I cannot figure out a way to get it to perform equally well in all possible scenarios (that is, create the optimum spacing.)
I wrote a little Bash script which accepts two values -- sender address and recipient address -- and finds any instances of mail sent from sender to recipient in /var/log/maillog. The script works fine, but it seems to be very inefficient. I'm just wondering how I can optimize it.
Code:
Example:
Code:
Again, it seems to work fine, but the script greps through /var/log/maillog three times -- first to find the sender; second to see if it's also going to the desired recipient; finally to view all instances of the message ID in the logs. This seems redundant and inefficient.
I'm trying to solve this problem, but always get Time limit exceeded. I've tried my best but still can't get under time limit. Could you please give me some hint about it?
I want to know that how the break points and watch points work in the GDB. I know the GDB works on symbol table. But would like to know more details of it. How watch points differ from break points.
I want to get the last term of an unknown-sized text line, by usig the awk command. Is there any variable which points to the last term of a text line ? (obviously, y can obtain that term if i knew how many terms does the line have... i.e. awk '{print $12}' ; if we are talking about a 12-terms text line) I wonder if there is an option like $?, to get the last term.
I'm going to write a script that flashes all AccessPoints in our network, with an expect script. Unfortunately the following code doesn't work. Code: spawn cat <file> | ssh root@$ip mtd -r -e linux write - linux cat: invalid option -- o Try `cat --help' for more information. So it doesn't understand the pipe thing anymore. Is there a way to get this command working?
I have a database with x number of files (192 at the moment, but will vary from time to time). I am going to copy these files to another location on the same server thorugh shell script. Problem with total size of 192 files is approx 900 GB (again this will vary from time to time).
My shell script should calculate the free space available at present in the server on each of the mount point (can be filled till it reaches 95%). Always 5% free space should be available free for future growth.
After calculating, it should prepare another flat file with following details:
We have a program that catalogs to 40 different mount points. The program is fine as long as thier is free space on at least one of the 40 mount points. My boss wants me to come up with a script that will email us daily to know how much overall free space is left. I know I can do a df but I don't know how to combine the 40 mount points into a single disk used/disk free report.
The 40 mount points are /dev/mapper/areaxx, xx being 01 to 40.
I've a question regarding two camera images. Suppose I've detected 2d window coordinate of 8 markers of an object in a scene in one camera and detected window coordinates of 10 markers of the same object on another camera.
I've detected the marker. It was easy. Now how do i know which window coordinates on two cameras are the coordinates of same marker? I mean there are markers captured on both cameras and some of them are representing the same marker in both cameras. I just like to know which ones are same on both cameras. Is it possible to find that out using opencv?
I have one more question about R.I have made a scatter graph, now I need to place a legend describing both data (red points) and lowess line (blue line with yellow triangles).How do I do that?Here is the graph-I have started it this way-> legend("topleft", pch=1, legend="h,srtm", fill=c("red","yellow"))Not sure about that.How do I describe the fill color, line style, etc.?
I am doing my thesis on Wireless mesh Networks and I am new to Ns2 to ....trying to learn how it works at the moment. Has any body worked on wireless mesh Networks in Ns2.
A bunch of hosts all connected to each other.I'd like to have a directory where a group of hosts can dump files and all access, synchronising with each other their changes automatically and transparent to the user.How can I have it so that rsync updates both ways?
* host A asks host B for a list of files, modification dates, checksums
* then applies the rules to select which files it will fetch from B
--> if A owns the file then do not get modifications from B --> files differ, then select newer file
Pt.1: Is this the right place for a question about Abiword? Pt.2: How does one set the line spacing in Abiword, wherever? Pt.3: . . . on an Asus eee netbook running Windows?
I am working on optimizing the iptables. I came across some way of optimizing the rules by removing the redundant rules and merging the rules . Is there any other way to increase the optimization of iptables ?The network that we applied the iptables is a simple LAN network. (College Network)
I upgraded to Lucid today and noticed that toolbar spacing/sizing is HUGE. In eclipse it is making my once single line toolbar wrap down to too. There is a ton of waisted space here.
Running Ubuntu 9.04 here and having some frequent problems in the terminal. The characters have "smooshed" together so some strings are unreadable. This happened randomly when I opened terminal and has been happening ever since. I don't know what the problem is.
BTW: I checked forums, two topics on this; 0 answers, go figure.
Evolution is presenting many incoming email messages as double-spaced when they weren't written that way. The unwanted double-spacing is also retained in replies, which show the original messages as having repeated carriage returns.How can this be prevented so that Evolution renders the messages as they were written?
I have been mucking around with this for a couple of days and finally got Urxvt set with transparency and font spacing like I want. Does anyone else use Urxvt?
I have just bought a digital-to-analog converter, this one to be exact, along with an amplificator and two speakers. I'd like to get the most of my Ubuntu, a good sound (what player can I use ?) and to know wether I need to do some extra changes in the kernel (OSS / PulseAudio / ALSA ?) or not.
I wonder if my converter will be detected when i plug it in, and if any sound from my computer will be leaded to it automatically ? (I'll have the converter tomorrow). I believe its purpose is to replace the sound card, to provide a greater, pure sound. The converter is linked by USB by the way.
I have a friend who is using Ubuntu 10.10 Netbook Edition on their netbook and well they love it. However, I notice that at times (if not all the time) their internet is ridiculously slow. Yes, it's a 1 Mbps download connection, but I still think it's a little slow and at times I can't even get it to load a website. I'm thinking if I adjusted the MTU within Ubuntu, it might improve, if even only slightly. I believe the router is set to 1490 or 1500, I haven't really looked yet.
I would like to ask how can I optimize apache2 load on my dedicated server. I am hosting Facebook applications on it, but most users will get a Timed Out message when they try to access it. I was tinkering with MaxClients directive in apache2 config, and it got better, but still it's not best. Programmers are trying their best to optimize the applications at their side, but I am afraid this is an server issue.
URl...how wide are the spaces between these entries. A quick research shows that this affects only certain apps such as gnome-terminal or Anjuta, but doesn't affect for example Synaptic - my first thought was that it's related to these using GTK3, but now I can see it's not that. This is not theme-related as it appears no matter what theme I choose. No results by googling.
It is mentioned in bugs and other posts, but they are old and don't provide an answer. On my small screen, the extra horizontal spacing/padding between the icons in the notification area takes up far, far too much space.Is there a way to reduce the spacing/padding. Preferably, I would put it back to what it was in Karmic which I think was about half the current spacing/padding.
I am running Ferdora 12 (constantine) 64 with Intel Xeon 3.2GHz processor + 12GB Ram. I am running this machine specifically for number chunching applications but it isnt running as fast as i thought it would! Are there any tips to optimizing the speed of processors in fedora?
I recently purchased a Western Digital 1TB USB hard drive to use for general data storage. I had thought about repartitioning it into 8 - 10 individual drives (most Linux users will doubtless understand the arguments for and against this) and reformatting them with another filesystem, probably ext2.
The unit actually consists of two 500GB drives that are presented by the internal controller as a single 1TB drive, and are formatted with the old HPFS/NTFS filesystem, so I'm a bit cautious about the possibility of my original plan confusing the drive's controller. Does anyone have any experience with these large drives, any thoughts about repartitioning/reformatting, and relevant criteria for optimizing their use?
Where can I find comprehensive information on optimizing Linux? I keep searching online but seem to get only to performance monitoring. I don't want to run a lighter version of Linux or upgrade my hardware! Just want to get my current distro and future ones I might install to run at its best.