Home > src > verbosePrint.m

# verbosePrint

## PURPOSE

- master print function that regulates cmd line output based on verbosity flags

## SYNOPSIS

function verbosePrint(msg,fieldName)

## DESCRIPTION

     - master print function that regulates cmd line output based on verbosity flags

     copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut

        This file is part of SOS

        SOS is free software: you can redistribute it and/or modify
        it for academic and non-commercial purposes
        under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.  For commercial or for-profit
        uses, please contact the authors (sos@cnbc.cmu.edu).

        SOS is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

## CROSS-REFERENCE INFORMATION

This function calls:

- initVerbosePrint - initializes the flags which control the verbosity of output

This function is called by:

- calculateOverlap_Dialog - calculate overlap dialog
- create2samplettest_Dialog - create 2-sample t-test dialog
- createHardBoundConstraint_Dialog - create hard bound constraint dialog
- createMatchCorrelztest_Dialog - create correlation-matching z-test dialog
- createMatchUniformkstest_Dialog - create uniformity ks-test dialog
- createPlots_Dialog - create sosplots dialog
- createPop_Dialog - create population dialog
- createSOS_dialog - create SOS optimizer dialog
- createSample_Dialog - create sample dialog
- createSingleSampleSoftDistanceConstraint_Dialog - create single sample soft distance constraint dialog
- createSoftEntropyConstraint_Dialog - create soft entropy constraint dialog
- createSoftMatchCorrelDistanceConstraint_Dialog - create soft match correlation constraint dialog
- createSoftMetaConstraint_Dialog - create soft meta-constraint dialog
- createTwoSampleSoftDistanceConstraint_Dialog - create two sample soft distance constraint dialog
- createsinglesamplettest_Dialog - create single sample t-test dialog
- dataFrame - dataframe object
- expAnneal - exponentially-decaying temperature annealing object
- expAnneal_Dialog - create expAnneal dialog
- greedyAnneal - greedy annealing (i.e., T = 0) object
- hardBoundConstraint - hard bound constraint object
- maxpDecrease_Dialog dialog used for calculating the largest p-decrease value
- numSteps_Dialog dialog used to calculate the nubmer of temperature-lowering steps
- population - population object
- randPopulationAndSampleCandidateSelection - random population and sample selection method for swaps
- randPopulationCandidateSelection - random population selection method for selecting swaps
- randSampleCandidateSelection - random sample method for selecting swaps
- sample - sample object
- saveHistory_Dialog - dialog used to save the optimization history
- setBufferedHistoryOutfile_Dialog - dialog for setting output file for buffered history output
- setSeed - function for setting the seed for the random number generator
- setSeed_Dialog - dialog for setting the random seed
- softDistanceConstraint - parent class for soft distance constraints
- softEntropyConstraint - soft entropy constraint object
- softMatchCorrelConstraint - soft correlation matching constraint object
- softMetaConstraint - parent class for soft meta-constraints
- sos - SOS optimization object
- sosCorrelTest - test for equivalence of two correlations
- sosHistory - object for storing the detailed history of an optimization
- sosPlots - object used to create detailed plots of SOS optimization
- sos_gui - sos main GUI
- soskstest - object for testing normality using a Kolmogorov-Smirnov test
- sosttest - object for creating t-tests

## SOURCE CODE

    0001 % - master print function that regulates cmd line output based on verbosity flags
    0002 %
    0003 % copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut
    0004 %
    0005 %    This file is part of SOS
    0006 %
    0007 %    SOS is free software: you can redistribute it and/or modify
    0008 %    it for academic and non-commercial purposes
    0009 %    under the terms of the GNU General Public License as published by
    0010 %    the Free Software Foundation, either version 3 of the License, or
    0011 %    (at your option) any later version.  For commercial or for-profit
    0012 %    uses, please contact the authors (sos@cnbc.cmu.edu).
    0013 %
    0014 %    SOS is distributed in the hope that it will be useful,
    0015 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
    0016 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0017 %    GNU General Public License for more details.
    0018
    0019 %    You should have received a copy of the GNU General Public License
    0020 %    along with SOS (see COPYING.txt).
    0021 %    If not, see <http://www.gnu.org/licenses/>.
    0022
    0023 function verbosePrint(msg,fieldName)
    0024     % the main output driver for SOS information.
    0025     % provides support for displaying data to the standard output.  It's
    0026     % associated functions (e.g., setVerbosePrintVerbosity) can also be
    0027     % used to set what messages will be printed and to what output stream
    0028     % (though only stdout is currently supported).
    0029
    0030     %check that what was supplied is a string
    0031     if (ischar(msg) == false)
    0032         error('{msg} supplied to verbosePrint is not a String');
    0033     end
    0034
    0035     if (ischar(fieldName) == false)
    0036         error('{fieldName} supplied to verbosePrint is not a String');
    0037     end
    0038
    0039     global verbosityFlags;
    0040     if(isempty(verbosityFlags))
    0041         initVerbosePrint();
    0042     end
    0043
    0044     %try looking up the string,
    0045     if (isfield(verbosityFlags,fieldName))
    0046         if getfield(verbosityFlags,fieldName) == 1
    0047             disp(msg);
    0048         end
    0049     else
    0050        error('{fieldName} is not a registered verbosityFlag');
    0051     end
    0052 end
    0053
    0054
    0055