double matrix and data structure?

This is a discussion on double matrix and data structure? within the C Programming forums, part of the General Programming Boards category; a program that stores and processes sparse matrices of floating point numbers. The matrices are of a fixed xize(1,000x1,000 elements), ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    17

    double matrix and data structure?

    a program that stores and processes sparse matrices of floating point numbers. The matrices are of a fixed xize(1,000x1,000 elements), but only a small percentage of the elements have non-zero values. Suggest a method for storing the matrices that is more economical with memory than a two-dimensional array of 1,000x1,000 floats. Write C definitions for your suggested data structure(s).


    I use linkedlist to do it.

    struct matrix {
    int row;
    int coloum;
    struct node *next;

    } node;

    is it right? then how to do it?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    In the absense of more information, its as good as any other method.

    There are no correct answers - any number of solutions are possible. All will have advantages and disadvantages, and as you gain experience, you will be able to make better choices.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Matrix Multiplication ( Accessing data from a file ) HELP
    By six_degreez in forum C Programming
    Replies: 2
    Last Post: 07-24-2008, 06:21 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 05:57 PM
  3. Replies: 3
    Last Post: 02-26-2008, 02:12 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 02:03 AM
  5. Trying to make this code faster & Cramer
    By just2peachy in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2004, 10:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21