Changeset 81 in tspsg-svn for trunk/src/globals.h


Ignore:
Timestamp:
Jan 7, 2010, 2:24:18 AM (14 years ago)
Author:
laleppa
Message:

+ Added the ability to generate fractional random numbers.
+ Added "Scroll to the end of solution output after solving" option.

  • Set the accuracy for fractional numbers on output to 2 decimail places.
  • Updated translations to reflect changes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/globals.h

    r78 r81  
    4646//! Default number of cities
    4747#define DEF_NUM_CITIES 5
     48//! Default value for generating fractional random values
     49#define DEF_FRACTIONAL_RANDOM false
    4850//! Default value for showing or not solution step matrices
    4951#define DEF_SHOW_MATRIX true
     
    5254//! Default maximum number of cities to show solution step matrices
    5355#define DEF_SHOW_MATRIX_CITY_LIMIT 15
     56//! Default for scrolling to the end of output after solving
     57#define DEF_SCROLL_TO_END true
    5458//! Default font name
    5559#define DEF_FONT_FAMILY "Courier New"
     
    108112#define INFSTR "---"
    109113
     114// FUNCTIONS
     115/*!
     116 * \brief Checks whether \a x contains an integer value
     117 * \param x A value to check
     118 * \return \c true if \a x countains an integer, oherwise \c false
     119 */
     120inline bool isInteger(double x)
     121{
     122double i;
     123        return (modf(x, &i) == 0.0);
     124}
     125
    110126// Sanity checks
    111127// Check that default number of cities is sane (<= MAX_NUM_CITIES)
Note: See TracChangeset for help on using the changeset viewer.