ECN No Name Newsletter: September, 1990

The ECN No Name Newsletter is no longer being published. This is an archived issue.

[previous article] [next article]

CLAM:Computational Linear Algebra Machine

Bill Simmons and Marian Hensler

CLAM, the Computational Linear Algebra Machine, is a tool to ease the programming of scientific and engineering problems and to view the results. This new tool is now available for use on Sun workstations under either SunView or X Windows.

CLAM is both a programming language and a system for writing, editing, using, saving, and sharing programs. It is a complete, interactive computing environment. It automatically handles vector and matrix data structures, and it also automatically selects appropriate algorithms from its own internal library to match the solution techniques to your problem size and characteristics. You only need to know what kind of problem you have to solve, and CLAM provides fast computations in any particular hardware environment. In short, CLAM combines the power and ease of modern programming languages with current research in numerical algorithms for the solution of matrix-based problems.

CLAM graphics are designed to support the effective visualization of scientific computations. CLAM takes a two-level approach to this goal by providing both high-level set of easy-to-use routines, and a low-level library of graphics primitives.

Most casual users of CLAM will prefer to use the high-level commands, which require a minimum of practice to master. By adding information to the top-level commands, the user can gain greater control over the plotted output. The more serious users of CLAM graphics will prefer to work with the graphics primitives, which provide substantial control over all graphics functions in CLAM. (The primitive routines are distinguished by a leading underscore in the names, e.g., _line.)

CLAM Manuals

A CLAM manual is available for 3-day loan from the Reference desk in Potter Engineering Library. Details of the CLAM examples presented next can be found on pages 239-242 of the manual.

  1. Calling CLAM: While working on a Sun Workstation with SunView open, type: % clam. The system will respond with the following screen after which you will see the CLAM prompt >.
             ________________________________________________
             |  CLAM(R)  Version 1.06                       |
             |                                              |
             |                                              |
             |  Copyright(C)  1987, 1988, 1989              |
             |  Scientific Computing Associates, Inc.       |
             |  All rights reserved.                        |
             |______________________________________________|
    
  2. Loading graphics commands: When using CLAM on Sun workstations, graphs will appear in a separate window. To load the necessary graphics commands and open the graphics window, at the CLAM prompt, type

    > load_graphics().

  3. Specifying a device: While located in the original (SunView) window, type:

    > device (#Sun).

    To informs CLAM which type of device you are using. If you are using X Windows, read page 240 of the CLAM manual. After a few moments a new window will appear, this is where CLAM will do all its plotting.

                                 graph shown
    
  4. Sample data: To plot some data, create a matrix of values of the form sin (x)/x. Type in the following:
         > vec = [-10 : 10 : 0.2]$
         > e = ones(size(vec))$
         > mat = sqrt((e'*vec).^ 2 + (vec'*e).^ 2)$
         > mat(51, 51) = 1$
         > mat = sin(mat)./mat$
         > mat(51, 51) = 1$
    
  5. 2D plot:
         > line (mat(:,51))
         > title ("Sinc function")
    
                      illustration of 2D plot shown here
    
  6. Point plot:
         >  clear()  (to clear window)
         >  points(mat(:,51))
         >  axis(#corner)
    
                                 graph shown
    
  7. Contour plot:
         >  clear()       (to clear window)
         >  ginit()       (to switch from 2D to 3D plot)
         >  contour(mat)
    
                                 graph shown
    
  8. Surface plot:
         >  clear()       (to clear window)
         >  surface(mat)
    
                                 graph shown
    
  9. Surface plot with box:
         >  clear()       (to clear window)
         >  surface(mat)
         >  axis(#corner)
    
                                 graph shown
    
  10. Quitting CLAM:
         >  ddelete       (to delete window)
         >  exit          (to quit CLAM)
    
                                 graph shown
    

To View CLAM Demo:

 
     % clam  to call CLAM)
     > load_graphics()
     > load_demo()
     > demo(#sun)
     > exit  to quit CLAM)


webmaster@ecn.purdue.edu
Last modified: Friday, 24-Oct-97 12:45:40 EST

[HTML Check] HTML