Final Project - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Final Project

Description:

The final goal is to create a 'dense, complex valued matrix class object' and a ' ... The file format for a complex matrix (both sparse and dense) should be: ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 15
Provided by: timwar1
Category:

less

Transcript and Presenter's Notes

Title: Final Project


1
Final Project
  • CAAM 420
  • Fall 2004

2
Overview
  • This project will exercise your ability to modify
    existing codes and use other libraries.
  • The final goal is to create a dense, complex
    valued matrix class object and a sparse,
    complex valued matrix class object.
  • i.e. we are extending the ability of the dmat and
    spmat objects to allow for systems of equations
    with complex coefficients and their corresponding
    matrices.

3
Teams
  • You may work with at most one other person.
  • Each team must complete the full task,
    irregardless of the number of team members.
  • There should be no communication of code between
    different teams.
  • Students may discuss concepts between teams.

4
Teams cont
  • If your partner flakes you may break up the
    group, but must still hand in a complete project
    --- however, you must acknowledge what state the
    code was in at that time.
  • If a team breaks up, you must each independently
    inform me by email and explain what happened. In
    this instance each team member will submit a
    separate report and is NOT permitted to join
    another group.
  • You MAY NOT switch to another team, under any
    circumstances.

5
Code
  • You may use any freely downloadable library
    available on the internet.
  • You must cite any code used in your report,
    without exception. A bibliography of web pages
    will be sufficient for this task.
  • You should annotate the code with indications of
    which team member coded which functions.
  • Minor edits may remain unclaimed.

6
Debugging
  • In order to receive assistance from the
    instructor or assistants you must use gdb to
    assertain the cause of the problem first.
  • No exceptions.

7
Part 1
  • Create two different class types, namely
  • double precision complex dense (cmatrix)
  • double precision complex sparse (cspmatrix)
  • You must equip the classes with the following
    functions
  • Default constructor
  • Constructor (using a file name)
  • Copy constructor
  • Destructor
  • File input
  • File output
  • Addition, division operators
  • You must create the following algebraic friend
    operators
  • cmatrix operator(const cmatrix , const
    cspmatrix )
  • cmatrix operator\(const cmatrix , const
    cspmatrix )
  • cmatrix operator(const cspmatrix , const
    cmatrix )
  • cmatrix operator\(const cspmatrix , const
    cmatrix )

8
File Format
  • Do not deviate from the following format.
  • The file format for a complex matrix (both sparse
    and dense) should be
  • Number of rows, number of columns, number of
    non-zeros
  • 3 2 4
  • row, column (indexed from 1), real part,
    imaginary part
  • 1 1 .3 -.2
  • 1 2 .1 0
  • 2 2 -.1 .2
  • 3 1 0 .1
  • Also invoke fileobject.precision(15) before
    writing to file.

This corresponds to

9
Part 1 Hints
  • Design your interface, then divide up who codes
    which matrix type.
  • Division of the matrices can be done with LAPACK
    (dense) and UMFPACK (sparse) or similar. Each
    package has specific routines for these
    operations.
  • Make your storage convention for the dense matrix
    Fortran friendly (i.e. column major).
  • Use your previous UMFPACK interface as a starting
    point for the complex sparse matrix.

10
Part 2
  • I will provide four downloadable complex
    matrices, in the format described
  • Your code must be able to compute the following
  • cmatrix A(A.cmat)
  • cmatrix B(B.cmat)
  • cspmatrix C(C.cspmat)
  • cspmatrix D(D.cspmat)
  • cmatrix E AC
  • cmatrix F A\E
  • cmatrix G C\A
  • cspmatrix H C\(CD)
  • E.output(E.cmat)
  • F.output(F.cmat)
  • G.output(G.cspmat)
  • H.output(H.cspmat)

TEST YOUR CODERESULTS IN MATLAB
11
Extra Credit
  • When (and only when) you have completed Parts 1
    2, create an eigenvalue computation functions
    which solves the following
  • This is the standard eigenvalue problem for a
    complex matrix, with eigenvectors stored as the
    columns of V and eigenvalues stored as the
    diagonal of L
  • For the complex sparse matrix use ARPACK, or
    ARPACK or similar and use extra function
    arguments to determine how many eigenvalues
    should be computed.
  • For the complex dense matrix use LAPACK or
    similar.

12
Testing Portability
  • You must make sure that your code works with both
    the SUN compiler suite (CC, cc, f77) and with the
    gnu compiler suite (g,gcc,g77)
  • i.e. create two versions of Make.opt, i.e.
    Make.gnu and Make.sun. Make sure your code
    compiles and runs without difficulties with both
    sets of compilers.

13
Report
  • Standard report format required.
  • Include all test results from your code and from
    Matlab.
  • ONE REPORT PER GROUP
  • ALL TEAM MEMBER NAMES MUST APPEAR ON FRONT PAGE.
  • Do not air your team grievances in the report.

14
Deadline
  • Deadline midnight 28th November 2004
  • Extensions may be granted, on a case by case
    basis, with latest possible submission on 3rd
    December 2004.
Write a Comment
User Comments (0)
About PowerShow.com