Thread: Filling in a table

  1. #16
    Registered User
    Join Date
    May 2008
    Posts
    87
    The constructor for your table is not a y by x table. If each row can have a variable number of columns then it is not a y by x table
    Each row *cannot* have a variable number of columns. For this reason I have changed the internal representation to simply be a vector, rather than a vector of vectors. The table holds decrement rates for a demographic model. For example, it may hold termination rates from employment, looked up by age and service with employer. The startY and startX parameters specify what age/service the table begins at.

    It seems nicer or cleaner to me to be able to load in the rates into the table all at once in the constructor. What other options do you have - repeatedly calling something like fillrow() for fillcolumn() ? If a suitable iterator can be defined, how is that not preferred?

  2. #17
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Each row *cannot* have a variable number of columns. For this reason I have changed the internal representation to simply be a vector, rather than a vector of vectors.
    Ah..yes. Seems I missed that in one of your later posts.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please help me as fast as possible
    By Xbox999 in forum C Programming
    Replies: 5
    Last Post: 11-30-2009, 06:53 PM
  2. help with structs and malloc!
    By coni in forum C Programming
    Replies: 20
    Last Post: 09-14-2009, 05:38 PM
  3. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 05:06 PM
  4. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 04:03 PM
  5. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 07:18 AM