• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[ANN] IsingCocoa - simulation of the Ising model for ferromagnetic material
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ANN] IsingCocoa - simulation of the Ising model for ferromagnetic material


  • Subject: [ANN] IsingCocoa - simulation of the Ising model for ferromagnetic material
  • From: Cameron Hayne <email@hidden>
  • Date: Fri, 13 May 2005 23:31:55 -0400

IsingCocoa is an application that runs simulations of the Ising model of magnetically interacting spins on a 2-dimensional lattice.
It is available (source and executable) from:
http://hayne.net/MacDev/IsingCocoa/


This project illustrates several aspects of programming for Mac OS X
using the Cocoa API:
- NSDocument architecture
- separate NSWindowController's for each type of window or sheet
- auxiliary information displayed in an NSDrawer
- the use of sheets for getting parameters from the user
- a toolbar with state-dependent icons
- interactive controls (e.g. a slider) in the toolbar
- calculation in a separate thread
- synchronizing use of shared variables via NSLock
- image drawn via NSBitmapImageRep in a subclass of NSView (giving display rates upward of 7 million pixels per second on an iBook G4 1.2 MHz)
- display updates done via NSTimer
- using NSEventTrackingRunLoopMode to get events while mouse is down
- maintaining aspect ratio of a view (as opposed to a window) via
tricky code in the window resizing methods, and the use of
performSelector:withObject:afterDelay to wrap up after the
resizing has finished
- adding resizing methods to NSWindow via an Objective-C category
- the use of an Objective-C protocol in keeping multiple views in sync
The calculation is done extremely efficiently (thanks to analysis
from Apple's "Shark" utility) and uses a few interesting techniques:
- multi-spin coding technique to achieve a 32 times parallelism (32 = # of bits in an int)
- faster random numbers via inlining of BSD code for random()
- use of gcc's "-fast" flag on a per-file basis
(in gcc 4.0 it is not supported for Objective-C code, so it was only used for the .c files)


--
Cameron Hayne
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: [NSString setStringWithContentsOfURL] vs. Tiger
  • Next by Date: Re: NSMailDelivery
  • Previous by thread: [NSString setStringWithContentsOfURL] vs. Tiger
  • Next by thread: How to get observe KVO changes to *every* key for an object?
  • Index(es):
    • Date
    • Thread